diff options
Diffstat (limited to 'src/empathy-preferences.c')
-rw-r--r-- | src/empathy-preferences.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c index 9dc7f58bf..3eb9e608d 100644 --- a/src/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -846,7 +846,8 @@ preferences_theme_variant_notify_cb (GSettings *gsettings, g_free (conf_name); } -static void +/* return TRUE if we added at least one variant */ +static gboolean preferences_theme_variants_fill (EmpathyPreferences *preferences, GHashTable *info) { @@ -856,6 +857,7 @@ preferences_theme_variants_fill (EmpathyPreferences *preferences, GPtrArray *variants; const gchar *default_variant; guint i; + gboolean result = FALSE; model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combobox_chat_theme_variant)); store = GTK_LIST_STORE (model); @@ -870,12 +872,16 @@ preferences_theme_variants_fill (EmpathyPreferences *preferences, COL_VARIANT_NAME, name, COL_VARIANT_DEFAULT, !tp_strdiff (name, default_variant), -1); + + result = TRUE; } /* Select the variant from the GSetting key */ preferences_theme_variant_notify_cb (priv->gsettings_chat, EMPATHY_PREFS_CHAT_THEME_VARIANT, preferences); + + return result; } static void @@ -943,11 +949,14 @@ preferences_theme_changed_cb (GtkComboBox *combo, EMPATHY_PREFS_CHAT_THEME, name); if (is_adium) { + gboolean variant; + g_settings_set_string (priv->gsettings_chat, EMPATHY_PREFS_CHAT_ADIUM_PATH, path); - preferences_theme_variants_fill (preferences, info); - gtk_widget_show (priv->hbox_chat_theme_variant); + + variant = preferences_theme_variants_fill (preferences, info); + gtk_widget_set_visible (priv->hbox_chat_theme_variant, variant); } else { gtk_widget_hide (priv->hbox_chat_theme_variant); } @@ -1283,9 +1292,12 @@ empathy_preferences_tab_to_string (EmpathyPreferencesTab tab) } GtkWidget * -empathy_preferences_new (GtkWindow *parent) +empathy_preferences_new (GtkWindow *parent, + gboolean shell_running) { - GtkWidget *self; + GtkWidget *self; + EmpathyPreferencesPriv *priv; + GtkWidget *notif_page; g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL); @@ -1296,6 +1308,19 @@ empathy_preferences_new (GtkWindow *parent) parent); } + /* when running in Gnome Shell we must hide these options since they + * are meaningless in that context: + * - 'Display incoming events in the notification area' (General->Behavior) + * - 'Notifications' tab + */ + priv = GET_PRIV (self); + if (shell_running) { + gtk_widget_hide (priv->checkbutton_events_notif_area); + notif_page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), + EMPATHY_PREFERENCES_TAB_NOTIFICATIONS); + gtk_widget_hide (notif_page); + } + return self; } |