diff options
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r-- | src/empathy-main-window.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index 3a6bf0ae4..9b818bc4c 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -792,22 +792,32 @@ main_window_view_contacts_list_size_cb (GtkRadioAction *action, GtkRadioAction *current, EmpathyMainWindow *window) { - gint value; + GSettings *gsettings_ui; + gint value; value = gtk_radio_action_get_current_value (action); + /* create a new GSettings, so we can delay the setting until both + * values are set */ + gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA); - g_settings_set_boolean (window->gsettings_ui, + DEBUG ("radio button toggled, value = %i", value); + + g_settings_delay (gsettings_ui); + g_settings_set_boolean (gsettings_ui, EMPATHY_PREFS_UI_SHOW_AVATARS, value == CONTACT_LIST_NORMAL_SIZE_WITH_AVATARS); - g_settings_set_boolean (window->gsettings_ui, + g_settings_set_boolean (gsettings_ui, EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST, value == CONTACT_LIST_COMPACT_SIZE); + g_settings_apply (gsettings_ui); empathy_contact_list_store_set_show_avatars (window->list_store, value == CONTACT_LIST_NORMAL_SIZE_WITH_AVATARS); empathy_contact_list_store_set_is_compact (window->list_store, value == CONTACT_LIST_COMPACT_SIZE); + + g_object_unref (gsettings_ui); } static void main_window_notify_show_protocols_cb (GSettings *gsettings, @@ -825,7 +835,7 @@ main_window_notify_contact_list_size_cb (GSettings *gsettings, const gchar *key, EmpathyMainWindow *window) { - gint value = CONTACT_LIST_NORMAL_SIZE_WITH_AVATARS; + gint value; if (g_settings_get_boolean (gsettings, EMPATHY_PREFS_UI_COMPACT_CONTACT_LIST)) { @@ -837,6 +847,8 @@ main_window_notify_contact_list_size_cb (GSettings *gsettings, value = CONTACT_LIST_NORMAL_SIZE; } + DEBUG ("setting changed, value = %i", value); + /* By changing the value of the GtkRadioAction, it emits a signal that calls main_window_view_contacts_list_size_cb which updates the contacts list */ @@ -1536,6 +1548,8 @@ empathy_main_window_show (void) EMPATHY_LIVE_SEARCH (window->search_bar)); gtk_box_pack_start (GTK_BOX (window->main_vbox), window->search_bar, FALSE, TRUE, 0); + g_signal_connect_swapped (window->window, "map", + G_CALLBACK (gtk_widget_grab_focus), window->list_view); /* Load user-defined accelerators. */ main_window_accels_load (); |