[gnome-control-center] color: Do not use a combobox when listing profiles to add to devices



commit 76e451fd518430fd0800f8c11f1d46c9958f2c9c
Author: Richard Hughes <richard hughsie com>
Date:   Tue Nov 20 14:10:41 2012 +0000

    color: Do not use a combobox when listing profiles to add to devices
    
    On some machines used for pre-press or animation the number of display-suitable
    profiles is going to be large. We really don't want to have a GtkComboBox
    several times bigger than the height of the screen to navigate.
    
    Also, while we're here get some design feedback from the #gnome-design guys and
    fix up some spacing and alignment issues.

 panels/color/cc-color-panel.c |  344 +++++++++++++++++------------------------
 panels/color/color.ui         |  257 +++++++++++++++----------------
 2 files changed, 269 insertions(+), 332 deletions(-)
---
diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c
index de82dca..563fa47 100644
--- a/panels/color/cc-color-panel.c
+++ b/panels/color/cc-color-panel.c
@@ -70,11 +70,6 @@ enum {
   GCM_PREFS_COMBO_COLUMN_NUM_COLUMNS
 };
 
-typedef enum {
-  GCM_PREFS_ENTRY_TYPE_PROFILE,
-  GCM_PREFS_ENTRY_TYPE_IMPORT
-} GcmPrefsEntryType;
-
 #define GCM_SETTINGS_SCHEMA                             "org.gnome.settings-daemon.plugins.color"
 #define GCM_SETTINGS_RECALIBRATE_PRINTER_THRESHOLD      "recalibrate-printer-threshold"
 #define GCM_SETTINGS_RECALIBRATE_DISPLAY_THRESHOLD      "recalibrate-display-threshold"
@@ -85,63 +80,61 @@ typedef enum {
 static void     gcm_prefs_device_add_cb (GtkWidget *widget, CcColorPanel *prefs);
 
 static void
-gcm_prefs_combobox_add_profile (GtkWidget *widget,
+gcm_prefs_combobox_add_profile (CcColorPanel *prefs,
                                 CdProfile *profile,
-                                GcmPrefsEntryType entry_type,
                                 GtkTreeIter *iter)
 {
   const gchar *id;
-  GtkTreeModel *model;
   GtkTreeIter iter_tmp;
   GString *string;
+  GtkListStore *list_store;
+  gchar *escaped = NULL;
+  guint kind = 0;
 
   /* iter is optional */
   if (iter == NULL)
     iter = &iter_tmp;
 
   /* use description */
-  if (entry_type == GCM_PREFS_ENTRY_TYPE_IMPORT)
+  string = g_string_new (cd_profile_get_title (profile));
+
+  /* any source prefix? */
+  id = cd_profile_get_metadata_item (profile,
+                                     CD_PROFILE_METADATA_DATA_SOURCE);
+  if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0)
     {
-      /* TRANSLATORS: this is where the user can click and import a profile */
-      string = g_string_new (_("Other profileâ"));
+      /* TRANSLATORS: this is a profile prefix to signify the
+       * profile has been auto-generated for this hardware */
+      g_string_prepend (string, _("Default: "));
+      kind = 1;
     }
-  else
-    {
-      string = g_string_new (cd_profile_get_title (profile));
-
-      /* any source prefix? */
-      id = cd_profile_get_metadata_item (profile,
-                                         CD_PROFILE_METADATA_DATA_SOURCE);
-      if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0)
-        {
-          /* TRANSLATORS: this is a profile prefix to signify the
-           * profile has been auto-generated for this hardware */
-          g_string_prepend (string, _("Default: "));
-        }
 #if CD_CHECK_VERSION(0,1,14)
-      if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0)
-        {
-          /* TRANSLATORS: this is a profile prefix to signify the
-           * profile his a standard space like AdobeRGB */
-          g_string_prepend (string, _("Colorspace: "));
-        }
-      if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_TEST) == 0)
-        {
-          /* TRANSLATORS: this is a profile prefix to signify the
-           * profile is a test profile */
-          g_string_prepend (string, _("Test profile: "));
-        }
-#endif
+  if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0)
+    {
+      /* TRANSLATORS: this is a profile prefix to signify the
+       * profile his a standard space like AdobeRGB */
+      g_string_prepend (string, _("Colorspace: "));
+      kind = 2;
     }
+  if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_TEST) == 0)
+    {
+      /* TRANSLATORS: this is a profile prefix to signify the
+       * profile is a test profile */
+      g_string_prepend (string, _("Test profile: "));
+      kind = 3;
+    }
+#endif
 
-  /* also add profile */
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX(widget));
-  gtk_list_store_append (GTK_LIST_STORE(model), iter);
-  gtk_list_store_set (GTK_LIST_STORE(model), iter,
-                      GCM_PREFS_COMBO_COLUMN_TEXT, string->str,
+  escaped = g_markup_escape_text (string->str, -1);
+  list_store = GTK_LIST_STORE(gtk_builder_get_object (prefs->priv->builder,
+                                                      "liststore_assign"));
+  gtk_list_store_append (list_store, iter);
+  gtk_list_store_set (list_store, iter,
+                      GCM_PREFS_COMBO_COLUMN_TEXT, escaped,
                       GCM_PREFS_COMBO_COLUMN_PROFILE, profile,
-                      GCM_PREFS_COMBO_COLUMN_TYPE, entry_type,
+                      GCM_PREFS_COMBO_COLUMN_TYPE, kind,
                       -1);
+
   g_string_free (string, TRUE);
 }
 
@@ -389,14 +382,6 @@ gcm_prefs_combo_sort_func_cb (GtkTreeModel *model,
 }
 
 static gboolean
-gcm_prefs_combo_set_default_cb (gpointer user_data)
-{
-  GtkWidget *widget = GTK_WIDGET (user_data);
-  gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
-  return FALSE;
-}
-
-static gboolean
 gcm_prefs_profile_exists_in_array (GPtrArray *array, CdProfile *profile)
 {
   CdProfile *profile_tmp;
@@ -413,7 +398,6 @@ gcm_prefs_profile_exists_in_array (GPtrArray *array, CdProfile *profile)
 
 static void
 gcm_prefs_add_profiles_suitable_for_devices (CcColorPanel *prefs,
-                                             GtkWidget *widget,
                                              GPtrArray *profiles)
 {
   CdProfile *profile_tmp;
@@ -421,20 +405,20 @@ gcm_prefs_add_profiles_suitable_for_devices (CcColorPanel *prefs,
   GError *error = NULL;
   GPtrArray *profile_array = NULL;
   GtkTreeIter iter;
-  GtkTreeModel *model;
+  GtkListStore *list_store;
   guint i;
   CcColorPanelPrivate *priv = prefs->priv;
 
-  /* clear existing entries */
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX (widget));
-  gtk_list_store_clear (GTK_LIST_STORE (model));
-  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model),
+  list_store = GTK_LIST_STORE(gtk_builder_get_object (prefs->priv->builder,
+                                                      "liststore_assign"));
+  gtk_list_store_clear (list_store);
+  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list_store),
                                         GCM_PREFS_COMBO_COLUMN_TEXT,
                                         GTK_SORT_ASCENDING);
-  gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model),
+  gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (list_store),
                                    GCM_PREFS_COMBO_COLUMN_TEXT,
                                    gcm_prefs_combo_sort_func_cb,
-                                   model, NULL);
+                                   list_store, NULL);
 
   /* get profiles */
   profile_array = cd_client_get_profiles_sync (priv->client,
@@ -484,17 +468,10 @@ gcm_prefs_add_profiles_suitable_for_devices (CcColorPanel *prefs,
 #endif
 
       /* add */
-      gcm_prefs_combobox_add_profile (widget,
+      gcm_prefs_combobox_add_profile (prefs,
                                       profile_tmp,
-                                      GCM_PREFS_ENTRY_TYPE_PROFILE,
                                       &iter);
     }
-
-  /* add a import entry */
-#if CD_CHECK_VERSION(0,1,12)
-  gcm_prefs_combobox_add_profile (widget, NULL, GCM_PREFS_ENTRY_TYPE_IMPORT, NULL);
-#endif
-  g_idle_add (gcm_prefs_combo_set_default_cb, widget);
 out:
   if (profile_array != NULL)
     g_ptr_array_unref (profile_array);
@@ -503,47 +480,17 @@ out:
 static void
 gcm_prefs_profile_add_cb (GtkWidget *widget, CcColorPanel *prefs)
 {
-  const gchar *title;
   GPtrArray *profiles;
   CcColorPanelPrivate *priv = prefs->priv;
 
   /* add profiles of the right kind */
-  widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
-                                               "combobox_profile"));
   profiles = cd_device_get_profiles (priv->current_device);
-  gcm_prefs_add_profiles_suitable_for_devices (prefs, widget, profiles);
+  gcm_prefs_add_profiles_suitable_for_devices (prefs, profiles);
 
-  /* set the title */
+  /* make insensitve until we have a selection */
   widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
-                                               "label_assign_title"));
-  switch (cd_device_get_kind (priv->current_device)) {
-    case CD_DEVICE_KIND_DISPLAY:
-      /* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
-      title = _("Available Profiles for Displays");
-      break;
-    case CD_DEVICE_KIND_SCANNER:
-      /* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
-      title = _("Available Profiles for Scanners");
-      break;
-    case CD_DEVICE_KIND_PRINTER:
-      /* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
-      title = _("Available Profiles for Printers");
-      break;
-    case CD_DEVICE_KIND_CAMERA:
-      /* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
-      title = _("Available Profiles for Cameras");
-      break;
-    case CD_DEVICE_KIND_WEBCAM:
-      /* TRANSLATORS: this is the dialog title in the 'Add profile' UI */
-      title = _("Available Profiles for Webcams");
-      break;
-    default:
-      /* TRANSLATORS: this is the dialog title in the 'Add profile' UI
-       * where the device type is not recognised */
-      title = _("Available Profiles");
-      break;
-  }
-  gtk_label_set_label (GTK_LABEL (widget), title);
+                                               "button_assign_ok"));
+  gtk_widget_set_sensitive (widget, FALSE);
 
   /* show the dialog */
   widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
@@ -716,6 +663,7 @@ gcm_prefs_button_assign_ok_cb (GtkWidget *widget, CcColorPanel *prefs)
   CdProfile *profile = NULL;
   gboolean ret = FALSE;
   GError *error = NULL;
+  GtkTreeSelection *selection;
   CcColorPanelPrivate *priv = prefs->priv;
 
   /* hide window */
@@ -723,13 +671,12 @@ gcm_prefs_button_assign_ok_cb (GtkWidget *widget, CcColorPanel *prefs)
                                                "dialog_assign"));
   gtk_widget_hide (widget);
 
-  /* get entry */
+  /* get the selected profile */
   widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
-                                               "combobox_profile"));
-  ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX(widget), &iter);
-  if (!ret)
+                                               "treeview_assign"));
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
+  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
     goto out;
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX(widget));
   gtk_tree_model_get (model, &iter,
                       GCM_PREFS_COMBO_COLUMN_PROFILE, &profile,
                       -1);
@@ -879,6 +826,23 @@ gcm_prefs_add_devices_columns (CcColorPanel *prefs,
 }
 
 static void
+gcm_prefs_add_profiles_columns (CcColorPanel *prefs,
+                                GtkTreeView *treeview)
+{
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+
+  /* text */
+  renderer = gtk_cell_renderer_text_new ();
+  column = gtk_tree_view_column_new ();
+  gtk_tree_view_column_pack_start (column, renderer, TRUE);
+  gtk_tree_view_column_add_attribute (column, renderer,
+                                      "markup", GCM_PREFS_COMBO_COLUMN_TEXT);
+  gtk_tree_view_column_set_expand (column, TRUE);
+  gtk_tree_view_append_column (treeview, column);
+}
+
+static void
 gcm_prefs_set_calibrate_button_sensitivity (CcColorPanel *prefs)
 {
   gboolean ret = FALSE;
@@ -975,11 +939,6 @@ gcm_prefs_device_clicked (CcColorPanel *prefs, CdDevice *device)
   g_debug ("selected device is: %s",
            cd_device_get_id (device));
 
-  /* make sure selectable */
-  widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
-                                               "combobox_profile"));
-  gtk_widget_set_sensitive (widget, TRUE);
-
   /* can we delete this device? */
   device_mode = cd_device_get_mode (priv->current_device);
   widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
@@ -1041,6 +1000,22 @@ gcm_prefs_profile_clicked (CcColorPanel *prefs, CdProfile *profile, CdDevice *de
 }
 
 static void
+gcm_prefs_profiles_treeview_clicked_cb (GtkTreeSelection *selection,
+                                        CcColorPanel *prefs)
+{
+  GtkWidget *widget;
+
+  /* get selection */
+  if (!gtk_tree_selection_get_selected (selection, NULL, NULL))
+    return;
+
+  /* as soon as anything is selected, make the Add button sensitive */
+  widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
+                                               "button_assign_ok"));
+  gtk_widget_set_sensitive (widget, TRUE);
+}
+
+static void
 gcm_prefs_devices_treeview_clicked_cb (GtkTreeSelection *selection,
                                        CcColorPanel *prefs)
 {
@@ -1119,6 +1094,21 @@ gcm_prefs_treeview_row_activated_cb (GtkTreeView *tree_view,
   gcm_prefs_profile_make_default_internal (prefs, model, &iter);
 }
 
+static void
+gcm_prefs_profiles_row_activated_cb (GtkTreeView *tree_view,
+                                     GtkTreePath *path,
+                                     GtkTreeViewColumn *column,
+                                     CcColorPanel *prefs)
+{
+  GtkTreeIter iter;
+  gboolean ret;
+
+  ret = gtk_tree_model_get_iter (gtk_tree_view_get_model (tree_view), &iter, path);
+  if (!ret)
+    return;
+  gcm_prefs_button_assign_ok_cb (NULL, prefs);
+}
+
 static const gchar *
 gcm_prefs_device_kind_to_sort (CdDeviceKind kind)
 {
@@ -1173,102 +1163,39 @@ out:
 }
 
 static void
-gcm_prefs_set_combo_simple_text (GtkWidget *combo_box)
-{
-  GtkCellRenderer *renderer;
-  GtkListStore *store;
-
-  store = gtk_list_store_new (GCM_PREFS_COMBO_COLUMN_NUM_COLUMNS,
-                              G_TYPE_STRING,
-                              CD_TYPE_PROFILE,
-                              G_TYPE_UINT);
-  gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box),
-                           GTK_TREE_MODEL (store));
-  g_object_unref (store);
-
-  renderer = gtk_cell_renderer_text_new ();
-  g_object_set (renderer,
-                "ellipsize", PANGO_ELLIPSIZE_END,
-                "wrap-mode", PANGO_WRAP_WORD_CHAR,
-                NULL);
-  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
-  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), renderer,
-                                  "text", GCM_PREFS_COMBO_COLUMN_TEXT,
-                                  NULL);
-}
-
-static void
-gcm_prefs_profile_combo_changed_cb (GtkWidget *widget,
-                                    CcColorPanel *prefs)
+gcm_prefs_button_assign_import_cb (GtkWidget *widget,
+                                   CcColorPanel *prefs)
 {
   GFile *file = NULL;
   GError *error = NULL;
-  gboolean ret;
   CdProfile *profile = NULL;
-  GtkTreeIter iter;
-  GtkTreeModel *model;
-  GcmPrefsEntryType entry_type;
   CcColorPanelPrivate *priv = prefs->priv;
 
-  /* no devices */
-  if (priv->current_device == NULL)
-    return;
-
-  /* no selection */
-  ret = gtk_combo_box_get_active_iter (GTK_COMBO_BOX(widget), &iter);
-  if (!ret)
-    return;
-
-  /* get entry */
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX(widget));
-  gtk_tree_model_get (model, &iter,
-                      GCM_PREFS_COMBO_COLUMN_TYPE, &entry_type,
-                      -1);
-
-  /* import */
-  if (entry_type == GCM_PREFS_ENTRY_TYPE_IMPORT)
+  file = gcm_prefs_file_chooser_get_icc_profile (prefs);
+  if (file == NULL)
     {
-      file = gcm_prefs_file_chooser_get_icc_profile (prefs);
-      if (file == NULL)
-        {
-          g_warning ("failed to get ICC file");
-          gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
-
-          /* if we've got no other existing profiles to choose, then
-           * just close the assign dialog */
-          gtk_combo_box_get_active_iter (GTK_COMBO_BOX(widget), &iter);
-          gtk_tree_model_get (model, &iter,
-                              GCM_PREFS_COMBO_COLUMN_TYPE, &entry_type,
-                              -1);
-          if (entry_type == GCM_PREFS_ENTRY_TYPE_IMPORT)
-            {
-              widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
-                                                           "dialog_assign"));
-              gtk_widget_hide (widget);
-            }
-          goto out;
-        }
+      g_warning ("failed to get ICC file");
+      widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
+                                                   "dialog_assign"));
+      gtk_widget_hide (widget);
+      goto out;
+    }
 
 #if CD_CHECK_VERSION(0,1,12)
-      profile = cd_client_import_profile_sync (priv->client,
-                                               file,
-                                               priv->cancellable,
-                                               &error);
-      if (profile == NULL)
-        {
-          g_warning ("failed to get imported profile: %s", error->message);
-          g_error_free (error);
-          goto out;
-        }
+  profile = cd_client_import_profile_sync (priv->client,
+                                           file,
+                                           priv->cancellable,
+                                           &error);
+  if (profile == NULL)
+    {
+      g_warning ("failed to get imported profile: %s", error->message);
+      g_error_free (error);
+      goto out;
+    }
 #endif
 
-      /* add to combobox */
-      gtk_list_store_append (GTK_LIST_STORE(model), &iter);
-      gtk_list_store_set (GTK_LIST_STORE(model), &iter,
-                          GCM_PREFS_COMBO_COLUMN_PROFILE, profile,
-                          -1);
-      gtk_combo_box_set_active_iter (GTK_COMBO_BOX (widget), &iter);
-    }
+  /* add to list view */
+  gcm_prefs_profile_add_cb (NULL, prefs);
 out:
   if (file != NULL)
     g_object_unref (file);
@@ -2453,6 +2380,23 @@ cc_color_panel_init (CcColorPanel *prefs)
   /* add columns to the tree view */
   gcm_prefs_add_devices_columns (prefs, GTK_TREE_VIEW (widget));
 
+  /* add columns to profile tree view */
+  widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
+                                               "treeview_assign"));
+  gcm_prefs_add_profiles_columns (prefs, GTK_TREE_VIEW (widget));
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
+  g_signal_connect (selection, "changed",
+                    G_CALLBACK (gcm_prefs_profiles_treeview_clicked_cb),
+                    prefs);
+  g_signal_connect (GTK_TREE_VIEW (widget), "row-activated",
+                    G_CALLBACK (gcm_prefs_profiles_row_activated_cb),
+                    prefs);
+
+  /* make larger by default */
+  widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
+                                               "scrolledwindow_assign"));
+  gtk_widget_set_size_request (widget, -1, 250);
+
   /* force to be at least ~6 rows high */
   widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
                                                "scrolledwindow_devices"));
@@ -2530,11 +2474,9 @@ cc_color_panel_init (CcColorPanel *prefs)
 
   /* setup icc profiles list */
   widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
-                                               "combobox_profile"));
-  gcm_prefs_set_combo_simple_text (widget);
-  gtk_widget_set_sensitive (widget, FALSE);
-  g_signal_connect (G_OBJECT (widget), "changed",
-                    G_CALLBACK (gcm_prefs_profile_combo_changed_cb), prefs);
+                                               "button_assign_import"));
+  g_signal_connect (widget, "clicked",
+                    G_CALLBACK (gcm_prefs_button_assign_import_cb), prefs);
 
   /* use a device client array */
   priv->client = cd_client_new ();
diff --git a/panels/color/color.ui b/panels/color/color.ui
index 3e8cc8f..7b90a41 100644
--- a/panels/color/color.ui
+++ b/panels/color/color.ui
@@ -1,125 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkDialog" id="dialog_assign">
-    <property name="can_focus">False</property>
-    <property name="border_width">5</property>
-    <property name="title"> </property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="window_position">center-on-parent</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="icon_name">gnome-color-manager</property>
-    <property name="type_hint">dialog</property>
-    <property name="skip_taskbar_hint">True</property>
-    <property name="skip_pager_hint">True</property>
-    <property name="transient_for">dialog_prefs</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox3">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area3">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="button_assign_cancel">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button_assign_ok">
-                <property name="label">gtk-add</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVBox" id="vbox5">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">9</property>
-            <child>
-              <object class="GtkHBox" id="hbox29">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <object class="GtkLabel" id="label_assign_title">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes" comments="Profiles that can be added to the device">Available Profiles</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkComboBox" id="combobox_profile">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="margin_right">5</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="0">button_assign_cancel</action-widget>
-      <action-widget response="0">button_assign_ok</action-widget>
-    </action-widgets>
-  </object>
   <object class="GtkWindow" id="dialog_prefs">
     <property name="can_focus">False</property>
     <property name="border_width">12</property>
@@ -171,7 +52,6 @@
                 <property name="receives_default">True</property>
                 <property name="has_tooltip">True</property>
                 <property name="tooltip_text" translatable="yes">Learn more about color management</property>
-                <property name="use_action_appearance">False</property>
                 <property name="relief">none</property>
                 <property name="xalign">0.50999999046325684</property>
                 <property name="uri">help:gnome-help/color-whyimportant</property>
@@ -224,7 +104,6 @@
                   <object class="GtkToolItem" id="left_button_group">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="use_action_appearance">False</property>
                     <child>
                       <object class="GtkBox" id="left_button_group_box">
                         <property name="visible">True</property>
@@ -233,10 +112,10 @@
                           <object class="GtkButton" id="toolbutton_device_add">
                             <property name="label" translatable="yes">Add device</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="receives_default">False</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes">Add a virtual device</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -249,10 +128,10 @@
                           <object class="GtkButton" id="toolbutton_device_remove">
                             <property name="label" translatable="yes">Delete device</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="receives_default">False</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes">Remove a device</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -264,10 +143,10 @@
                         <child>
                           <object class="GtkButton" id="toolbutton_device_default">
                             <property name="label" translatable="yes">Set for all users</property>
+                            <property name="can_focus">False</property>
                             <property name="receives_default">False</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes">Set this profile for all users on this computer</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -287,7 +166,6 @@
                   <object class="GtkToolItem" id="right_button_group">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="use_action_appearance">False</property>
                     <child>
                       <object class="GtkBox" id="right_button_group_box">
                         <property name="visible">True</property>
@@ -296,8 +174,8 @@
                           <object class="GtkButton" id="toolbutton_profile_add">
                             <property name="label" translatable="yes">Add profile</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -309,10 +187,10 @@
                         <child>
                           <object class="GtkButton" id="toolbutton_device_calibrate">
                             <property name="label" translatable="yes">Calibrateâ</property>
+                            <property name="can_focus">False</property>
                             <property name="receives_default">False</property>
                             <property name="has_tooltip">True</property>
                             <property name="tooltip_text" translatable="yes">Calibrate the device</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -324,8 +202,8 @@
                         <child>
                           <object class="GtkButton" id="toolbutton_profile_remove">
                             <property name="label" translatable="yes">Remove profile</property>
+                            <property name="can_focus">False</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -337,8 +215,8 @@
                         <child>
                           <object class="GtkButton" id="toolbutton_profile_view">
                             <property name="label" translatable="yes">View details</property>
+                            <property name="can_focus">False</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                           </object>
                           <packing>
@@ -371,6 +249,115 @@
       </object>
     </child>
   </object>
+  <object class="GtkDialog" id="dialog_assign">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="title"> Add Profile</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="icon_name">gnome-color-manager</property>
+    <property name="type_hint">dialog</property>
+    <property name="skip_taskbar_hint">True</property>
+    <property name="skip_pager_hint">True</property>
+    <property name="transient_for">dialog_prefs</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button_assign_import">
+                <property name="label" translatable="yes">Import File...</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button_assign_cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button_assign_ok">
+                <property name="label">gtk-add</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow_assign">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="border_width">5</property>
+            <property name="hscrollbar_policy">never</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTreeView" id="treeview_assign">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="model">liststore_assign</property>
+                <property name="headers_visible">False</property>
+                <property name="enable_search">False</property>
+                <property name="search_column">0</property>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection2"/>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">button_assign_import</action-widget>
+      <action-widget response="0">button_assign_cancel</action-widget>
+      <action-widget response="0">button_assign_ok</action-widget>
+    </action-widgets>
+  </object>
   <object class="GtkDialog" id="dialog_virtual">
     <property name="can_focus">False</property>
     <property name="border_width">15</property>
@@ -401,7 +388,6 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -416,7 +402,6 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -623,6 +608,16 @@
       <action-widget response="0">button_virtual_add</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkListStore" id="liststore_assign">
+    <columns>
+      <!-- column-name title -->
+      <column type="gchararray"/>
+      <!-- column-name profile -->
+      <column type="GObject"/>
+      <!-- column-name kind -->
+      <column type="guint"/>
+    </columns>
+  </object>
   <object class="GtkSizeGroup" id="sizegroup_buttons"/>
   <object class="GtkSizeGroup" id="sizegroup_combos"/>
   <object class="GtkSizeGroup" id="sizegroup_defaults"/>



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