color: Refresh toolbar buttons when profile has changed
https://bugzilla.gnome.org/show_bug.cgi?id=724499 Signed-off-by: Richard Hughes <richard@hughsie.com>
This commit is contained in:
parent
2b17ddc7d6
commit
08b8c1b55e
1 changed files with 20 additions and 2 deletions
|
@ -103,6 +103,8 @@ enum {
|
||||||
/* max number of devices and profiles to cause auto-expand at startup */
|
/* max number of devices and profiles to cause auto-expand at startup */
|
||||||
#define GCM_PREFS_MAX_DEVICES_PROFILES_EXPANDED 5
|
#define GCM_PREFS_MAX_DEVICES_PROFILES_EXPANDED 5
|
||||||
|
|
||||||
|
static void gcm_prefs_refresh_toolbar_buttons (CcColorPanel *panel);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcm_prefs_combobox_add_profile (CcColorPanel *prefs,
|
gcm_prefs_combobox_add_profile (CcColorPanel *prefs,
|
||||||
CdProfile *profile,
|
CdProfile *profile,
|
||||||
|
@ -1065,7 +1067,7 @@ gcm_prefs_profile_remove_cb (GtkWidget *widget, CcColorPanel *prefs)
|
||||||
static void
|
static void
|
||||||
gcm_prefs_make_profile_default_cb (GObject *object,
|
gcm_prefs_make_profile_default_cb (GObject *object,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
gpointer user_data)
|
CcColorPanel *prefs)
|
||||||
{
|
{
|
||||||
CdDevice *device = CD_DEVICE (object);
|
CdDevice *device = CD_DEVICE (object);
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
|
@ -1081,6 +1083,10 @@ gcm_prefs_make_profile_default_cb (GObject *object,
|
||||||
error->message);
|
error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gcm_prefs_refresh_toolbar_buttons (prefs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1921,11 +1927,23 @@ static void
|
||||||
gcm_prefs_list_box_row_selected_cb (GtkListBox *list_box,
|
gcm_prefs_list_box_row_selected_cb (GtkListBox *list_box,
|
||||||
GtkListBoxRow *row,
|
GtkListBoxRow *row,
|
||||||
CcColorPanel *panel)
|
CcColorPanel *panel)
|
||||||
|
{
|
||||||
|
gcm_prefs_refresh_toolbar_buttons (panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gcm_prefs_refresh_toolbar_buttons (CcColorPanel *panel)
|
||||||
{
|
{
|
||||||
CdProfile *profile = NULL;
|
CdProfile *profile = NULL;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
CcColorPanelPrivate *priv = panel->priv;
|
CcColorPanelPrivate *priv = panel->priv;
|
||||||
gboolean is_device = CC_IS_COLOR_DEVICE (row);
|
GtkListBoxRow *row;
|
||||||
|
gboolean is_device;
|
||||||
|
|
||||||
|
/* get the selected profile */
|
||||||
|
row = gtk_list_box_get_selected_row (priv->list_box);
|
||||||
|
|
||||||
|
is_device = CC_IS_COLOR_DEVICE (row);
|
||||||
|
|
||||||
/* nothing selected */
|
/* nothing selected */
|
||||||
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
|
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue