aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2010-06-21 17:08:30 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2010-06-21 17:24:37 +0800
commit783c15aecdb7aba0ef69c4a82dae0f391007185e (patch)
tree3e9cee69d51f093704777b749df653887d75d323 /src
parente7f7ba7259d1b668b0d1702687f7241581b74d87 (diff)
downloadgsoc2013-empathy-783c15aecdb7aba0ef69c4a82dae0f391007185e.tar
gsoc2013-empathy-783c15aecdb7aba0ef69c4a82dae0f391007185e.tar.gz
gsoc2013-empathy-783c15aecdb7aba0ef69c4a82dae0f391007185e.tar.bz2
gsoc2013-empathy-783c15aecdb7aba0ef69c4a82dae0f391007185e.tar.lz
gsoc2013-empathy-783c15aecdb7aba0ef69c4a82dae0f391007185e.tar.xz
gsoc2013-empathy-783c15aecdb7aba0ef69c4a82dae0f391007185e.tar.zst
gsoc2013-empathy-783c15aecdb7aba0ef69c4a82dae0f391007185e.zip
Delay setting both contact list values until the each is set.
Solves a loop in the notification code that caused things to get stuck.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-main-window.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index d57a7b240..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 */