[gnome-builder] buildui: set runtime/device sensitivity



commit fc9895cb0216300bbf86b9635b304a44c5a48051
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 14 11:25:20 2017 -0800

    buildui: set runtime/device sensitivity
    
    The configuration can tell us if it supports the runtime or
    device. So we should use that to set the sensitivity of the
    row in the configuration view.

 libide/buildui/ide-build-configuration-view.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libide/buildui/ide-build-configuration-view.c b/libide/buildui/ide-build-configuration-view.c
index fba74f6..e36ec46 100644
--- a/libide/buildui/ide-build-configuration-view.c
+++ b/libide/buildui/ide-build-configuration-view.c
@@ -74,10 +74,13 @@ create_runtime_row (gpointer item,
   GtkWidget *image;
   GtkWidget *label;
   GtkWidget *row;
+  gboolean sensitive;
 
   g_assert (IDE_IS_RUNTIME (runtime));
   g_assert (IDE_IS_CONFIGURATION (configuration));
 
+  sensitive = ide_configuration_supports_runtime (configuration, runtime);
+
   box = g_object_new (GTK_TYPE_BOX,
                       "spacing", 12,
                       "visible", TRUE,
@@ -112,6 +115,7 @@ create_runtime_row (gpointer item,
 
   row = g_object_new (GTK_TYPE_LIST_BOX_ROW,
                       "child", box,
+                      "sensitive", sensitive,
                       "visible", TRUE,
                       NULL);
 
@@ -130,10 +134,13 @@ create_device_row (gpointer item,
   GtkWidget *image;
   GtkWidget *label;
   GtkWidget *row;
+  gboolean sensitive;
 
   g_assert (IDE_IS_DEVICE (device));
   g_assert (IDE_IS_CONFIGURATION (configuration));
 
+  sensitive = ide_configuration_supports_device (configuration, device);
+
   box = g_object_new (GTK_TYPE_BOX,
                       "spacing", 12,
                       "visible", TRUE,
@@ -168,6 +175,7 @@ create_device_row (gpointer item,
 
   row = g_object_new (GTK_TYPE_LIST_BOX_ROW,
                       "child", box,
+                      "sensitive", sensitive,
                       "visible", TRUE,
                       NULL);
 


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