color: After removing a profile select the device so the UI is correct

Resolves https://bugzilla.gnome.org/show_bug.cgi?id=661658
This commit is contained in:
Richard Hughes 2011-10-13 17:03:51 +01:00
parent 5f6b8f0da9
commit 00fb703054

View file

@ -1720,11 +1720,13 @@ out:
static void static void
gcm_prefs_device_changed_cb (CdDevice *device, CcColorPanel *prefs) gcm_prefs_device_changed_cb (CdDevice *device, CcColorPanel *prefs)
{ {
const gchar *id;
gboolean ret;
gchar *id_tmp;
GtkTreeIter iter; GtkTreeIter iter;
GtkTreeModel *model; GtkTreeModel *model;
const gchar *id; GtkTreeSelection *selection;
gchar *id_tmp; GtkWidget *widget;
gboolean ret;
CcColorPanelPrivate *priv = prefs->priv; CcColorPanelPrivate *priv = prefs->priv;
/* get first element */ /* get first element */
@ -1741,7 +1743,15 @@ gcm_prefs_device_changed_cb (CdDevice *device, CcColorPanel *prefs)
GCM_PREFS_COLUMN_DEVICE_PATH, &id_tmp, GCM_PREFS_COLUMN_DEVICE_PATH, &id_tmp,
-1); -1);
if (g_strcmp0 (id_tmp, id) == 0) if (g_strcmp0 (id_tmp, id) == 0)
{
/* populate device, and then select it */
gcm_prefs_device_set_model_by_iter (prefs, device, &iter); gcm_prefs_device_set_model_by_iter (prefs, device, &iter);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
"treeview_devices"));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
gtk_tree_selection_select_iter (selection, &iter);
}
g_free (id_tmp); g_free (id_tmp);
} while (gtk_tree_model_iter_next (model, &iter)); } while (gtk_tree_model_iter_next (model, &iter));
} }