[gnome-builder/wip/chergert/debugger] run-manager: don't allow running during current session



commit e14a0d44ab547dc090445266637dcefbd55ba39c
Author: Christian Hergert <chergert redhat com>
Date:   Sun Mar 26 18:22:44 2017 -0700

    run-manager: don't allow running during current session

 libide/runner/ide-run-manager.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/libide/runner/ide-run-manager.c b/libide/runner/ide-run-manager.c
index 69b4b93..86db071 100644
--- a/libide/runner/ide-run-manager.c
+++ b/libide/runner/ide-run-manager.c
@@ -38,7 +38,6 @@ struct _IdeRunManager
   IdeObject                parent_instance;
 
   GCancellable            *cancellable;
-  GSimpleActionGroup      *actions;
   IdeBuildTarget          *build_target;
 
   const IdeRunHandlerInfo *handler;
@@ -47,7 +46,8 @@ struct _IdeRunManager
   guint                    busy : 1;
 };
 
-static void action_group_iface_init (GActionGroupInterface *iface);
+static void action_group_iface_init     (GActionGroupInterface *iface);
+static void ide_run_manager_notify_busy (IdeRunManager         *self);
 
 G_DEFINE_TYPE_EXTENDED (IdeRunManager, ide_run_manager, IDE_TYPE_OBJECT, 0,
                         G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, action_group_iface_init))
@@ -106,7 +106,6 @@ ide_run_manager_finalize (GObject *object)
   IdeRunManager *self = (IdeRunManager *)object;
 
   g_clear_object (&self->cancellable);
-  g_clear_object (&self->actions);
   g_clear_object (&self->build_target);
 
   g_list_free_full (self->handlers, ide_run_handler_info_free);
@@ -295,6 +294,9 @@ ide_run_manager_run_cb (GObject      *object,
   g_assert (G_IS_TASK (task));
 
   self = g_task_get_source_object (task);
+  g_assert (IDE_IS_RUN_MANAGER (self));
+
+  self->busy = FALSE;
 
   if (!ide_runner_run_finish (runner, result, &error))
     {
@@ -308,6 +310,8 @@ failure:
 
   g_signal_emit (self, signals [STOPPED], 0);
 
+  ide_run_manager_notify_busy (self);
+
   IDE_EXIT;
 }
 
@@ -366,6 +370,9 @@ do_run_async (IdeRunManager *self,
       IDE_EXIT;
     }
 
+  self->busy = TRUE;
+  ide_run_manager_notify_busy (self);
+
   ide_runner_run_async (runner,
                         cancellable,
                         ide_run_manager_run_cb,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]