[gnome-builder/wip/chergert/runtimes] start migrating build panel to "configuration"



commit b4e7c0007589d4744a5514071a8a50538e0f8a3e
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 2 23:03:13 2016 +0100

    start migrating build panel to "configuration"

 libide/ide-configuration-manager.c              |   35 +++++++-
 libide/ide-configuration-manager.h              |   10 ++-
 libide/ide-configuration.c                      |   66 +++++++++++++--
 libide/ide-context.c                            |   12 +++
 plugins/build-tools/gbp-build-panel.c           |  104 +++++++++++-----------
 plugins/build-tools/gbp-build-panel.ui          |   73 ++++------------
 plugins/build-tools/gbp-build-workbench-addin.c |   72 ++++++++--------
 7 files changed, 214 insertions(+), 158 deletions(-)
---
diff --git a/libide/ide-configuration-manager.c b/libide/ide-configuration-manager.c
index 5535f94..a7e41ce 100644
--- a/libide/ide-configuration-manager.c
+++ b/libide/ide-configuration-manager.c
@@ -18,6 +18,8 @@
 
 #define G_LOG_DOMAIN "ide-configuration-manager"
 
+#include <glib/gi18n.h>
+
 #include "ide-configuration.h"
 #include "ide-configuration-manager.h"
 #include "ide-context.h"
@@ -53,7 +55,8 @@ static GParamSpec *properties [LAST_PROP];
  *
  * Gets the #IdeConfiguration by id. See ide_configuration_get_id().
  *
- * Returns: (transfer none) (nullable): An #IdeConfiguration
+ * Returns: (transfer none) (nullable): An #IdeConfiguration or %NULL if
+ *   the configuration could not be found.
  */
 IdeConfiguration *
 ide_configuration_manager_get_configuration (IdeConfigurationManager *self,
@@ -246,11 +249,18 @@ ide_configuration_manager_init_async (GAsyncInitable      *initable,
                                       gpointer             user_data)
 {
   IdeConfigurationManager *self = (IdeConfigurationManager *)initable;
+  IdeContext *context;
+  g_autoptr(IdeConfiguration) config = NULL;
   g_autoptr(GTask) task = NULL;
 
   g_assert (G_IS_ASYNC_INITABLE (self));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
+  context = ide_object_get_context (IDE_OBJECT (self));
+  config = ide_configuration_new (context, "default", "local", "system");
+  ide_configuration_set_display_name (config, _("Default Configuration"));
+  ide_configuration_manager_add (self, config);
+
   task = g_task_new (self, cancellable, callback, user_data);
   g_task_run_in_thread (task, ide_configuration_manager_init_worker);
 }
@@ -304,11 +314,28 @@ ide_configuration_manager_get_current (IdeConfigurationManager *self)
 
   if (self->current == NULL)
     {
-      IdeContext *context;
+      for (guint i = 0; i < self->configurations->len; i++)
+        {
+          IdeConfiguration *config = g_ptr_array_index (self->configurations, i);
 
-      context = ide_object_get_context (IDE_OBJECT (self));
-      self->current = ide_configuration_new (context, "libide-default", "local", "system");
+          if (0 == g_strcmp0 ("default", ide_configuration_get_id (config)))
+            return config;
+        }
     }
 
   return self->current;
 }
+
+void
+ide_configuration_manager_add (IdeConfigurationManager *self,
+                               IdeConfiguration        *configuration)
+{
+  guint position;
+
+  g_return_if_fail (IDE_IS_CONFIGURATION_MANAGER (self));
+  g_return_if_fail (IDE_IS_CONFIGURATION (configuration));
+
+  position = self->configurations->len;
+  g_ptr_array_add (self->configurations, g_object_ref (configuration));
+  g_list_model_items_changed (G_LIST_MODEL (self), position, 0, 1);
+}
diff --git a/libide/ide-configuration-manager.h b/libide/ide-configuration-manager.h
index 00db9a6..4012532 100644
--- a/libide/ide-configuration-manager.h
+++ b/libide/ide-configuration-manager.h
@@ -30,9 +30,13 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (IdeConfigurationManager, ide_configuration_manager, IDE, CONFIGURATION_MANAGER, 
IdeObject)
 
-IdeConfiguration *ide_configuration_manager_get_current (IdeConfigurationManager *self);
-void              ide_configuration_manager_set_current (IdeConfigurationManager *self,
-                                                         IdeConfiguration        *configuration);
+IdeConfiguration *ide_configuration_manager_get_current       (IdeConfigurationManager *self);
+void              ide_configuration_manager_set_current       (IdeConfigurationManager *self,
+                                                               IdeConfiguration        *configuration);
+IdeConfiguration *ide_configuration_manager_get_configuration (IdeConfigurationManager *self,
+                                                               const gchar             *id);
+void              ide_configuration_manager_add               (IdeConfigurationManager *self,
+                                                               IdeConfiguration        *configuration);
 
 G_END_DECLS
 
diff --git a/libide/ide-configuration.c b/libide/ide-configuration.c
index e47a40b..2c5e9fe 100644
--- a/libide/ide-configuration.c
+++ b/libide/ide-configuration.c
@@ -35,6 +35,7 @@ struct _IdeConfiguration
   gchar      *id;
   gchar      *device_id;
   gchar      *runtime_id;
+  gchar      *display_name;
   IdeEnviron *environ;
   IdeEnviron *device_environ;
   IdeEnviron *runtime_environ;
@@ -62,6 +63,7 @@ enum {
   PROP_DEBUG,
   PROP_DEVICE,
   PROP_DEVICE_ID,
+  PROP_DISPLAY_NAME,
   PROP_ENVIRON,
   PROP_ID,
   PROP_PARALLELISM,
@@ -151,6 +153,7 @@ ide_configuration_finalize (GObject *object)
   g_clear_pointer (&self->device_id, g_free);
   g_clear_pointer (&self->environ, ide_environ_unref);
   g_clear_pointer (&self->id, g_free);
+  g_clear_pointer (&self->display_name, g_free);
   g_clear_pointer (&self->prefix, g_free);
   g_clear_pointer (&self->runtime_id, g_free);
 
@@ -175,6 +178,10 @@ ide_configuration_get_property (GObject    *object,
       g_value_set_object (value, ide_configuration_get_device (self));
       break;
 
+    case PROP_DISPLAY_NAME:
+      g_value_set_string (value, ide_configuration_get_display_name (self));
+      break;
+
     case PROP_ENVIRON:
       g_value_set_boxed (value, ide_configuration_get_environ (self));
       break;
@@ -226,6 +233,10 @@ ide_configuration_set_property (GObject      *object,
       ide_configuration_set_device_id (self, g_value_get_string (value));
       break;
 
+    case PROP_DISPLAY_NAME:
+      ide_configuration_set_display_name (self, g_value_get_string (value));
+      break;
+
     case PROP_ID:
       ide_configuration_set_id (self, g_value_get_string (value));
       break;
@@ -273,14 +284,21 @@ ide_configuration_class_init (IdeConfigurationClass *klass)
                          "Device",
                          "Device",
                          IDE_TYPE_DEVICE,
-                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_DEVICE_ID] =
     g_param_spec_string ("device-id",
                          "Device Id",
                          "The identifier of the device",
                          "local",
-                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  properties [PROP_DISPLAY_NAME] =
+    g_param_spec_string ("display-name",
+                         "Display Name",
+                         "Display Name",
+                         NULL,
+                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_ENVIRON] =
     g_param_spec_boxed ("environ",
@@ -317,14 +335,14 @@ ide_configuration_class_init (IdeConfigurationClass *klass)
                          "Runtime",
                          "Runtime",
                          IDE_TYPE_RUNTIME,
-                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_RUNTIME_ID] =
     g_param_spec_string ("runtime-id",
                          "Runtime Id",
                          "The identifier of the runtime",
                          "system",
-                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+                         (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_properties (object_class, N_PROPS, properties);
 }
@@ -409,10 +427,15 @@ static void
 ide_configuration_set_device (IdeConfiguration *self,
                               IdeDevice        *device)
 {
+  const gchar *device_id = "local";
+
   g_return_if_fail (IDE_IS_CONFIGURATION (self));
-  g_return_if_fail (IDE_IS_DEVICE (device));
+  g_return_if_fail (!device || IDE_IS_DEVICE (device));
+
+  if (device != NULL)
+    device_id = ide_device_get_id (device);
 
-  ide_configuration_set_device_id (self, ide_device_get_id (device));
+  ide_configuration_set_device_id (self, device_id);
 }
 
 const gchar *
@@ -465,10 +488,15 @@ static void
 ide_configuration_set_runtime (IdeConfiguration *self,
                                IdeRuntime       *runtime)
 {
+  const gchar *runtime_id = "system";
+
   g_return_if_fail (IDE_IS_CONFIGURATION (self));
-  g_return_if_fail (IDE_IS_RUNTIME (runtime));
+  g_return_if_fail (!runtime || IDE_IS_RUNTIME (runtime));
+
+  if (runtime != NULL)
+    runtime_id = ide_runtime_get_id (runtime);
 
-  ide_configuration_set_runtime_id (self, ide_runtime_get_id (runtime));
+  ide_configuration_set_runtime_id (self, runtime_id);
 }
 
 /**
@@ -598,3 +626,25 @@ ide_configuration_set_debug (IdeConfiguration *self,
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DEBUG]);
     }
 }
+
+const gchar *
+ide_configuration_get_display_name (IdeConfiguration *self)
+{
+  g_return_val_if_fail (IDE_IS_CONFIGURATION (self), NULL);
+
+  return self->display_name;
+}
+
+void
+ide_configuration_set_display_name (IdeConfiguration *self,
+                                    const gchar      *display_name)
+{
+  g_return_if_fail (IDE_IS_CONFIGURATION (self));
+
+  if (g_strcmp0 (display_name, self->display_name) != 0)
+    {
+      g_free (self->display_name);
+      self->display_name = g_strdup (display_name);
+      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DISPLAY_NAME]);
+    }
+}
diff --git a/libide/ide-context.c b/libide/ide-context.c
index 6f9a041..82dda95 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -95,6 +95,7 @@ enum {
   PROP_BACK_FORWARD_LIST,
   PROP_BUFFER_MANAGER,
   PROP_BUILD_SYSTEM,
+  PROP_CONFIGURATION_MANAGER,
   PROP_DEVICE_MANAGER,
   PROP_PROJECT_FILE,
   PROP_PROJECT,
@@ -577,6 +578,10 @@ ide_context_get_property (GObject    *object,
       g_value_set_object (value, ide_context_get_build_system (self));
       break;
 
+    case PROP_CONFIGURATION_MANAGER:
+      g_value_set_object (value, ide_context_get_configuration_manager (self));
+      break;
+
     case PROP_DEVICE_MANAGER:
       g_value_set_object (value, ide_context_get_device_manager (self));
       break;
@@ -676,6 +681,13 @@ ide_context_class_init (IdeContextClass *klass)
                          IDE_TYPE_BUILD_SYSTEM,
                          (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
+  properties [PROP_CONFIGURATION_MANAGER] =
+    g_param_spec_object ("configuration-manager",
+                         "Configuration Manager",
+                         "The configuration manager for the context",
+                         IDE_TYPE_CONFIGURATION_MANAGER,
+                         (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
   properties [PROP_DEVICE_MANAGER] =
     g_param_spec_object ("device-manager",
                          "Device Manager",
diff --git a/plugins/build-tools/gbp-build-panel.c b/plugins/build-tools/gbp-build-panel.c
index 481da28..901acdd 100644
--- a/plugins/build-tools/gbp-build-panel.c
+++ b/plugins/build-tools/gbp-build-panel.c
@@ -34,20 +34,20 @@ struct _GbpBuildPanel
   EggBindingGroup  *bindings;
 
   IdeDevice        *device;
-  IdeRuntime       *runtime;
+  IdeConfiguration *configuration;
 
   GtkListBox       *diagnostics;
   GtkRevealer      *status_revealer;
   GtkLabel         *status_label;
   GtkLabel         *running_time_label;
+  GtkListBox       *configurations;
+  GtkLabel         *configuration_label;
+  GtkPopover       *configuration_popover;
   GtkMenuButton    *device_button;
   GtkLabel         *device_label;
   GtkListBox       *devices;
   GtkPopover       *device_popover;
   GtkLabel         *errors_label;
-  GtkListBox       *runtimes;
-  GtkLabel         *runtime_label;
-  GtkPopover       *runtime_popover;
   GtkLabel         *warnings_label;
 
   guint             running_time_source;
@@ -60,10 +60,10 @@ G_DEFINE_TYPE (GbpBuildPanel, gbp_build_panel, GTK_TYPE_BIN)
 
 enum {
   PROP_0,
+  PROP_CONFIGURATION,
+  PROP_CONFIGURATION_MANAGER,
   PROP_DEVICE,
   PROP_DEVICE_MANAGER,
-  PROP_RUNTIME,
-  PROP_RUNTIME_MANAGER,
   PROP_RESULT,
   LAST_PROP
 };
@@ -71,25 +71,25 @@ enum {
 static GParamSpec *properties [LAST_PROP];
 
 static GtkWidget *
-create_runtime_row (gpointer item,
-                    gpointer user_data)
+create_configuration_row (gpointer item,
+                          gpointer user_data)
 {
-  IdeRuntime *runtime = item;
+  IdeConfiguration *configuration = item;
   GtkListBoxRow *row;
   const gchar *name;
   const gchar *id;
   GtkLabel *label;
 
-  g_assert (IDE_IS_RUNTIME (runtime));
+  g_assert (IDE_IS_CONFIGURATION (configuration));
 
   row = g_object_new (GTK_TYPE_LIST_BOX_ROW,
                       "visible", TRUE,
                       NULL);
 
-  id = ide_runtime_get_id (runtime);
-  g_object_set_data_full (G_OBJECT (row), "IDE_RUNTIME_ID", g_strdup (id), g_free);
+  id = ide_configuration_get_id (configuration);
+  g_object_set_data_full (G_OBJECT (row), "IDE_CONFIGURATION_ID", g_strdup (id), g_free);
 
-  name = ide_runtime_get_title (runtime);
+  name = ide_configuration_get_display_name (configuration);
   label = g_object_new (GTK_TYPE_LABEL,
                         "label", name,
                         "xalign", 0.0f,
@@ -168,32 +168,32 @@ gbp_build_panel_set_device_manager (GbpBuildPanel    *self,
 }
 
 static void
-gbp_build_panel_set_runtime (GbpBuildPanel *self,
-                             IdeRuntime    *runtime)
+gbp_build_panel_set_configuration (GbpBuildPanel    *self,
+                                   IdeConfiguration *configuration)
 {
   g_return_if_fail (GBP_IS_BUILD_PANEL (self));
-  g_return_if_fail (!runtime || IDE_IS_RUNTIME (runtime));
+  g_return_if_fail (!configuration || IDE_IS_CONFIGURATION (configuration));
 
-  if (g_set_object (&self->runtime, runtime))
+  if (g_set_object (&self->configuration, configuration))
     {
       const gchar *name = NULL;
 
-      if (runtime != NULL)
-        name = ide_runtime_get_title (runtime);
-      gtk_label_set_label (self->runtime_label, name);
+      if (configuration != NULL)
+        name = ide_configuration_get_display_name (configuration);
+      gtk_label_set_label (self->configuration_label, name);
     }
 }
 
 static void
-gbp_build_panel_set_runtime_manager (GbpBuildPanel     *self,
-                                     IdeRuntimeManager *runtime_manager)
+gbp_build_panel_set_configuration_manager (GbpBuildPanel           *self,
+                                           IdeConfigurationManager *configuration_manager)
 {
   g_assert (GBP_IS_BUILD_PANEL (self));
-  g_assert (IDE_IS_RUNTIME_MANAGER (runtime_manager));
+  g_assert (IDE_IS_CONFIGURATION_MANAGER (configuration_manager));
 
-  gtk_list_box_bind_model (self->runtimes,
-                           G_LIST_MODEL (runtime_manager),
-                           create_runtime_row, NULL, NULL);
+  gtk_list_box_bind_model (self->configurations,
+                           G_LIST_MODEL (configuration_manager),
+                           create_configuration_row, NULL, NULL);
 }
 
 void
@@ -365,7 +365,7 @@ gbp_build_panel_device_activated (GbpBuildPanel *self,
 }
 
 static void
-gbp_build_panel_runtime_activated (GbpBuildPanel *self,
+gbp_build_panel_configuration_activated (GbpBuildPanel *self,
                                    GtkListBoxRow *row,
                                    GtkListBox    *list_box)
 {
@@ -375,12 +375,12 @@ gbp_build_panel_runtime_activated (GbpBuildPanel *self,
   g_assert (GTK_IS_LIST_BOX_ROW (row));
   g_assert (GTK_IS_LIST_BOX (list_box));
 
-  if ((id = g_object_get_data (G_OBJECT (row), "IDE_RUNTIME_ID")))
+  if ((id = g_object_get_data (G_OBJECT (row), "IDE_CONFIGURATION_ID")))
     ide_widget_action (GTK_WIDGET (self),
-                       "build-tools", "runtime",
+                       "build-tools", "configuration",
                        g_variant_new_string (id));
 
-  gtk_widget_hide (GTK_WIDGET (self->runtime_popover));
+  gtk_widget_hide (GTK_WIDGET (self->configuration_popover));
 }
 
 static void
@@ -424,7 +424,7 @@ gbp_build_panel_destroy (GtkWidget *widget)
   g_clear_object (&self->bindings);
   g_clear_object (&self->signals);
   g_clear_object (&self->device);
-  g_clear_object (&self->runtime);
+  g_clear_object (&self->configuration);
 
   GTK_WIDGET_CLASS (gbp_build_panel_parent_class)->destroy (widget);
 }
@@ -447,8 +447,8 @@ gbp_build_panel_get_property (GObject    *object,
       g_value_set_object (value, self->result);
       break;
 
-    case PROP_RUNTIME:
-      g_value_set_object (value, self->runtime);
+    case PROP_CONFIGURATION:
+      g_value_set_object (value, self->configuration);
       break;
 
     default:
@@ -478,12 +478,12 @@ gbp_build_panel_set_property (GObject      *object,
       gbp_build_panel_set_result (self, g_value_get_object (value));
       break;
 
-    case PROP_RUNTIME_MANAGER:
-      gbp_build_panel_set_runtime_manager (self, g_value_get_object (value));
+    case PROP_CONFIGURATION_MANAGER:
+      gbp_build_panel_set_configuration_manager (self, g_value_get_object (value));
       break;
 
-    case PROP_RUNTIME:
-      gbp_build_panel_set_runtime (self, g_value_get_object (value));
+    case PROP_CONFIGURATION:
+      gbp_build_panel_set_configuration (self, g_value_get_object (value));
       break;
 
     default:
@@ -516,18 +516,18 @@ gbp_build_panel_class_init (GbpBuildPanelClass *klass)
                          IDE_TYPE_DEVICE_MANAGER,
                          (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
 
-  properties [PROP_RUNTIME_MANAGER] =
-    g_param_spec_object ("runtime-manager",
-                         "Runtime Manager",
-                         "Runtime Manager",
-                         IDE_TYPE_RUNTIME_MANAGER,
+  properties [PROP_CONFIGURATION_MANAGER] =
+    g_param_spec_object ("configuration-manager",
+                         "Configuration Manager",
+                         "Configuration Manager",
+                         IDE_TYPE_CONFIGURATION_MANAGER,
                          (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
 
-  properties [PROP_RUNTIME] =
-    g_param_spec_object ("runtime",
-                         "Runtime",
-                         "Runtime",
-                         IDE_TYPE_RUNTIME,
+  properties [PROP_CONFIGURATION] =
+    g_param_spec_object ("configuration",
+                         "Configuration",
+                         "Configuration",
+                         IDE_TYPE_CONFIGURATION,
                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_RESULT] =
@@ -541,6 +541,9 @@ gbp_build_panel_class_init (GbpBuildPanelClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/builder/plugins/build-tools-plugin/gbp-build-panel.ui");
   gtk_widget_class_set_css_name (widget_class, "buildpanel");
+  gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, configurations);
+  gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, configuration_label);
+  gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, configuration_popover);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, device_button);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, device_label);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, device_popover);
@@ -548,9 +551,6 @@ gbp_build_panel_class_init (GbpBuildPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, diagnostics);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, errors_label);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, running_time_label);
-  gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, runtimes);
-  gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, runtime_label);
-  gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, runtime_popover);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, status_label);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, status_revealer);
   gtk_widget_class_bind_template_child (widget_class, GbpBuildPanel, warnings_label);
@@ -581,9 +581,9 @@ gbp_build_panel_init (GbpBuildPanel *self)
                            self,
                            G_CONNECT_SWAPPED);
 
-  g_signal_connect_object (self->runtimes,
+  g_signal_connect_object (self->configurations,
                            "row-activated",
-                           G_CALLBACK (gbp_build_panel_runtime_activated),
+                           G_CALLBACK (gbp_build_panel_configuration_activated),
                            self,
                            G_CONNECT_SWAPPED);
 
diff --git a/plugins/build-tools/gbp-build-panel.ui b/plugins/build-tools/gbp-build-panel.ui
index a28464c..4080964 100644
--- a/plugins/build-tools/gbp-build-panel.ui
+++ b/plugins/build-tools/gbp-build-panel.ui
@@ -5,6 +5,22 @@
         <property name="visible">true</property>
         <property name="orientation">vertical</property>
         <child>
+          <object class="GtkMenuButton" id="configuration_button">
+            <property name="border-width">12</property>
+            <property name="popover">configuration_popover</property>
+            <property name="visible">true</property>
+            <style>
+              <class name="flat"/>
+            </style>
+            <child>
+              <object class="GtkLabel" id="configuration_label">
+                <property name="ellipsize">middle</property>
+                <property name="visible">true</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
           <object class="GtkGrid">
             <property name="border-width">12</property>
             <property name="column-spacing">12</property>
@@ -26,20 +42,6 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label2">
-                <property name="label" translatable="yes">Runtime:</property>
-                <property name="xalign">1.0</property>
-                <property name="visible">true</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
-              </object>
-              <packing>
-                <property name="left-attach">0</property>
-                <property name="top-attach">1</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkLabel" id="label3">
                 <property name="label" translatable="yes">Packaging:</property>
                 <property name="xalign">1.0</property>
@@ -135,45 +137,6 @@
             </child>
             <child>
               <object class="GtkMenuButton">
-                <property name="focus-on-click">false</property>
-                <property name="popover">runtime_popover</property>
-                <property name="visible">true</property>
-                <style>
-                  <class name="flat"/>
-                </style>
-                <child>
-                  <object class="GtkBox">
-                    <property name="spacing">6</property>
-                    <property name="visible">true</property>
-                    <child>
-                      <object class="GtkLabel" id="runtime_label">
-                        <property name="visible">true</property>
-                        <property name="ellipsize">end</property>
-                        <property name="hexpand">false</property>
-                        <property name="xalign">0.0</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkImage">
-                        <property name="icon-name">pan-down-symbolic</property>
-                        <property name="visible">true</property>
-                        <property name="hexpand">false</property>
-                        <property name="xalign">0.0</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="left-attach">1</property>
-                <property name="top-attach">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkMenuButton">
                 <property name="label" translatable="yes">packaging</property>
                 <property name="visible">false</property>
               </object>
@@ -391,7 +354,7 @@
       </object>
     </child>
   </object>
-  <object class="GtkPopover" id="runtime_popover">
+  <object class="GtkPopover" id="configuration_popover">
     <child>
       <object class="EggScrolledWindow">
         <property name="min-content-width">100</property>
@@ -399,7 +362,7 @@
         <property name="max-content-height">300</property>
         <property name="visible">true</property>
         <child>
-          <object class="GtkListBox" id="runtimes">
+          <object class="GtkListBox" id="configurations">
             <property name="selection-mode">none</property>
             <property name="visible">true</property>
             <style>
diff --git a/plugins/build-tools/gbp-build-workbench-addin.c b/plugins/build-tools/gbp-build-workbench-addin.c
index 9462b2e..b0975fd 100644
--- a/plugins/build-tools/gbp-build-workbench-addin.c
+++ b/plugins/build-tools/gbp-build-workbench-addin.c
@@ -39,7 +39,7 @@ struct _GbpBuildWorkbenchAddin
   GSimpleActionGroup *actions;
   GCancellable       *cancellable;
   IdeDevice          *device;
-  IdeRuntime         *runtime;
+  IdeConfiguration   *configuration;
 };
 
 static void workbench_addin_iface_init (IdeWorkbenchAddinInterface *iface);
@@ -52,7 +52,7 @@ enum {
   PROP_0,
   PROP_DEVICE,
   PROP_RESULT,
-  PROP_RUNTIME,
+  PROP_CONFIGURATION,
   LAST_PROP
 };
 
@@ -78,21 +78,21 @@ gbp_build_workbench_addin_set_device (GbpBuildWorkbenchAddin *self,
 }
 
 static void
-gbp_build_workbench_addin_set_runtime (GbpBuildWorkbenchAddin *self,
-                                       IdeRuntime             *runtime)
+gbp_build_workbench_addin_set_configuration (GbpBuildWorkbenchAddin *self,
+                                       IdeConfiguration             *configuration)
 {
   g_assert (GBP_IS_BUILD_WORKBENCH_ADDIN (self));
-  g_assert (IDE_IS_RUNTIME (runtime));
+  g_assert (IDE_IS_CONFIGURATION (configuration));
 
-  if (g_set_object (&self->runtime, runtime))
+  if (g_set_object (&self->configuration, configuration))
     {
-      const gchar *id = ide_runtime_get_id (runtime);
+      const gchar *id = ide_configuration_get_id (configuration);
       GAction *action;
 
-      action = g_action_map_lookup_action (G_ACTION_MAP (self->actions), "runtime");
+      action = g_action_map_lookup_action (G_ACTION_MAP (self->actions), "configuration");
       g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_string (id));
 
-      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_RUNTIME]);
+      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CONFIGURATION]);
     }
 }
 
@@ -317,14 +317,14 @@ gbp_build_workbench_addin_device (GSimpleAction *action,
 }
 
 static void
-gbp_build_workbench_addin_runtime (GSimpleAction *action,
-                                   GVariant      *param,
-                                   gpointer       user_data)
+gbp_build_workbench_addin_configuration (GSimpleAction *action,
+                                         GVariant      *param,
+                                         gpointer       user_data)
 {
   GbpBuildWorkbenchAddin *self = user_data;
-  IdeRuntimeManager *runtime_manager;
+  IdeConfigurationManager *configuration_manager;
   IdeContext *context;
-  IdeRuntime *runtime;
+  IdeConfiguration *configuration;
   const gchar *id;
 
   g_assert (GBP_IS_BUILD_WORKBENCH_ADDIN (self));
@@ -335,10 +335,10 @@ gbp_build_workbench_addin_runtime (GSimpleAction *action,
     id = "system";
 
   context = ide_workbench_get_context (self->workbench);
-  runtime_manager = ide_context_get_runtime_manager (context);
-  runtime = ide_runtime_manager_get_runtime (runtime_manager, id);
+  configuration_manager = ide_context_get_configuration_manager (context);
+  configuration = ide_configuration_manager_get_configuration (configuration_manager, id);
 
-  gbp_build_workbench_addin_set_runtime (self, runtime);
+  gbp_build_workbench_addin_set_configuration (self, configuration);
 }
 
 static const GActionEntry actions[] = {
@@ -349,7 +349,7 @@ static const GActionEntry actions[] = {
   { "deploy", gbp_build_workbench_addin_deploy },
   { "export", gbp_build_workbench_addin_export },
   { "device", NULL, "s", "'local'", gbp_build_workbench_addin_device },
-  { "runtime", NULL, "s", "'system'", gbp_build_workbench_addin_runtime },
+  { "configuration", NULL, "s", "'default'", gbp_build_workbench_addin_configuration },
 };
 
 static void
@@ -362,8 +362,8 @@ gbp_build_workbench_addin_load (IdeWorkbenchAddin *addin,
   IdeContext *context;
   IdeDeviceManager *device_manager;
   IdeDevice *device;
-  IdeRuntimeManager *runtime_manager;
-  IdeRuntime *runtime;
+  IdeConfigurationManager *configuration_manager;
+  IdeConfiguration *configuration;
 
   g_assert (IDE_IS_WORKBENCH_ADDIN (addin));
   g_assert (GBP_IS_BUILD_WORKBENCH_ADDIN (self));
@@ -374,16 +374,16 @@ gbp_build_workbench_addin_load (IdeWorkbenchAddin *addin,
   context = ide_workbench_get_context (workbench);
   device_manager = ide_context_get_device_manager (context);
   device = ide_device_manager_get_device (device_manager, "local");
-  runtime_manager = ide_context_get_runtime_manager (context);
-  runtime = ide_runtime_manager_get_runtime (runtime_manager, "system");
+  configuration_manager = ide_context_get_configuration_manager (context);
+  configuration = ide_configuration_manager_get_current (configuration_manager);
 
   editor = ide_workbench_get_perspective_by_name (workbench, "editor");
   pane = ide_layout_get_right_pane (IDE_LAYOUT (editor));
   self->panel = g_object_new (GBP_TYPE_BUILD_PANEL,
                               "device-manager", device_manager,
                               "device", device,
-                              "runtime-manager", runtime_manager,
-                              "runtime", runtime,
+                              "configuration-manager", configuration_manager,
+                              "configuration", configuration,
                               "visible", TRUE,
                               NULL);
   ide_layout_pane_add_page (IDE_LAYOUT_PANE (pane),
@@ -401,10 +401,10 @@ gbp_build_workbench_addin_load (IdeWorkbenchAddin *addin,
 
   g_object_bind_property (self, "result", self->panel, "result", 0);
   g_object_bind_property (self, "device", self->panel, "device", 0);
-  g_object_bind_property (self, "runtime", self->panel, "runtime", 0);
+  g_object_bind_property (self, "configuration", self->panel, "configuration", 0);
 
   gbp_build_workbench_addin_set_device (self, device);
-  gbp_build_workbench_addin_set_runtime (self, runtime);
+  gbp_build_workbench_addin_set_configuration (self, configuration);
 }
 
 static void
@@ -449,8 +449,8 @@ gbp_build_workbench_addin_get_property (GObject    *object,
       g_value_set_object (value, self->result);
       break;
 
-    case PROP_RUNTIME:
-      g_value_set_object (value, self->runtime);
+    case PROP_CONFIGURATION:
+      g_value_set_object (value, self->configuration);
       break;
 
     default:
@@ -472,8 +472,8 @@ gbp_build_workbench_addin_set_property (GObject      *object,
       gbp_build_workbench_addin_set_device (self, g_value_get_object (value));
       break;
 
-    case PROP_RUNTIME:
-      gbp_build_workbench_addin_set_runtime (self, g_value_get_object (value));
+    case PROP_CONFIGURATION:
+      gbp_build_workbench_addin_set_configuration (self, g_value_get_object (value));
       break;
 
     default:
@@ -490,7 +490,7 @@ gbp_build_workbench_addin_finalize (GObject *object)
   g_clear_object (&self->bindings);
   g_clear_object (&self->actions);
   g_clear_object (&self->result);
-  g_clear_object (&self->runtime);
+  g_clear_object (&self->configuration);
   g_clear_object (&self->cancellable);
 
   G_OBJECT_CLASS (gbp_build_workbench_addin_parent_class)->finalize (object);
@@ -519,11 +519,11 @@ gbp_build_workbench_addin_class_init (GbpBuildWorkbenchAddinClass *klass)
                          IDE_TYPE_BUILD_RESULT,
                          (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
-  properties [PROP_RUNTIME] =
-    g_param_spec_object ("runtime",
-                         "Runtime",
-                         "Runtime",
-                         IDE_TYPE_RUNTIME,
+  properties [PROP_CONFIGURATION] =
+    g_param_spec_object ("configuration",
+                         "Configuration",
+                         "Configuration",
+                         IDE_TYPE_CONFIGURATION,
                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_properties (object_class, LAST_PROP, properties);


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