X-Git-Url: https://git.0d.be/?p=empathy.git;a=blobdiff_plain;f=src%2Fempathy-preferences.c;h=6775d4a245bb5f7c88a00e3a5cfe9c3abd57c6ee;hp=9dc7f58bf39f4ae48e3baecd5e89053719e60a17;hb=4f470e26bafd3d2717b20af5e8846c114a2785d7;hpb=2021c145e0c5eb6aa9eda91d58d54b13007113ad diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c index 9dc7f58b..6775d4a2 100644 --- a/src/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -83,8 +82,6 @@ struct _EmpathyPreferencesPriv { GtkWidget *checkbutton_notifications_contact_signin; GtkWidget *checkbutton_notifications_contact_signout; - GtkWidget *scale_call_volume; - GtkWidget *adj_call_volume; GtkWidget *echo_cancellation; GtkWidget *treeview_spell_checker; @@ -272,12 +269,6 @@ preferences_setup_widgets (EmpathyPreferences *preferences) "active", G_SETTINGS_BIND_DEFAULT); - g_settings_bind (priv->gsettings_call, - EMPATHY_PREFS_CALL_SOUND_VOLUME, - priv->adj_call_volume, - "value", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind (priv->gsettings_call, EMPATHY_PREFS_CALL_ECHO_CANCELLATION, priv->echo_cancellation, @@ -846,7 +837,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 +848,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 +863,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 +940,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); } @@ -1099,13 +1099,6 @@ preferences_themes_setup (EmpathyPreferences *preferences) preferences); } -static gchar * -preferences_call_format_volume_cb (GtkScale *scale, - gdouble value) -{ - return g_strdup_printf ("%g%%", value); -} - static void empathy_preferences_response (GtkDialog *widget, gint response) @@ -1153,8 +1146,6 @@ empathy_preferences_init (EmpathyPreferences *preferences) GtkBuilder *gui; gchar *filename; GtkWidget *page; - GtkWidget *call_volume_scale_box; - GtkWidget *call_volume_bar_box; priv = preferences->priv = G_TYPE_INSTANCE_GET_PRIVATE (preferences, EMPATHY_TYPE_PREFERENCES, EmpathyPreferencesPriv); @@ -1197,10 +1188,6 @@ empathy_preferences_init (EmpathyPreferences *preferences) "checkbutton_location_resource_network", &priv->checkbutton_location_resource_network, "checkbutton_location_resource_cell", &priv->checkbutton_location_resource_cell, "checkbutton_location_resource_gps", &priv->checkbutton_location_resource_gps, - "call_volume_scale_box", &call_volume_scale_box, - "call_volume_bar_box", &call_volume_bar_box, - "call_volume_scale", &priv->scale_call_volume, - "call_volume_adjustment", &priv->adj_call_volume, "call_echo_cancellation", &priv->echo_cancellation, NULL); g_free (filename); @@ -1226,15 +1213,6 @@ empathy_preferences_init (EmpathyPreferences *preferences) preferences, 0); preferences_preview_theme_changed_cb (priv->theme_manager, preferences); - g_signal_connect (priv->scale_call_volume, "format-value", - G_CALLBACK (preferences_call_format_volume_cb), - preferences); - -#ifndef HAVE_CALL - gtk_widget_hide (call_volume_scale_box); - gtk_widget_hide (call_volume_bar_box); -#endif - preferences_themes_setup (preferences); preferences_setup_widgets (preferences); @@ -1283,9 +1261,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 +1277,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; }