diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-11-22 16:00:08 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-11-22 16:00:08 +0800 |
commit | c637edc7059b1e3ed9413b9ca097abd4e307f30b (patch) | |
tree | 1ea4813daebbf4d8b286136d14cf9f5a4a70cd1c | |
parent | ac2b9a7a95a152f874bf250f4365072a3bc976e1 (diff) | |
parent | 3acbe74046df8d57fdf498acceacb2737be92d80 (diff) | |
download | gsoc2013-empathy-c637edc7059b1e3ed9413b9ca097abd4e307f30b.tar gsoc2013-empathy-c637edc7059b1e3ed9413b9ca097abd4e307f30b.tar.gz gsoc2013-empathy-c637edc7059b1e3ed9413b9ca097abd4e307f30b.tar.bz2 gsoc2013-empathy-c637edc7059b1e3ed9413b9ca097abd4e307f30b.tar.lz gsoc2013-empathy-c637edc7059b1e3ed9413b9ca097abd4e307f30b.tar.xz gsoc2013-empathy-c637edc7059b1e3ed9413b9ca097abd4e307f30b.tar.zst gsoc2013-empathy-c637edc7059b1e3ed9413b9ca097abd4e307f30b.zip |
Merge branch 'chat-resize-635022'
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 04e786253..a55d53e9d 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -100,6 +100,8 @@ struct _EmpathyChatPriv { /* Source func ID for update_misspelled_words () */ guint update_misspelled_words_id; + /* Source func ID for save_paned_pos_timeout () */ + guint save_paned_pos_id; GtkWidget *widget; GtkWidget *hpaned; @@ -2491,17 +2493,32 @@ conf_spell_checking_cb (GSettings *gsettings_chat, } static gboolean +save_paned_pos_timeout (gpointer data) +{ + EmpathyChat *self = data; + gint hpaned_pos; + + hpaned_pos = gtk_paned_get_position (GTK_PANED (self->priv->hpaned)); + + g_settings_set_int (self->priv->gsettings_ui, + EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS, + hpaned_pos); + + return FALSE; +} + +static gboolean chat_hpaned_pos_changed_cb (GtkWidget* hpaned, GParamSpec *spec, gpointer user_data) { EmpathyChat *chat = EMPATHY_CHAT (user_data); - gint hpaned_pos; - hpaned_pos = gtk_paned_get_position (GTK_PANED(hpaned)); - g_settings_set_int (chat->priv->gsettings_ui, - EMPATHY_PREFS_UI_CHAT_WINDOW_PANED_POS, - hpaned_pos); + if (chat->priv->save_paned_pos_id != 0) + g_source_remove (chat->priv->save_paned_pos_id); + + chat->priv->save_paned_pos_id = g_timeout_add_seconds (1, + save_paned_pos_timeout, chat); return TRUE; } @@ -2656,6 +2673,9 @@ chat_finalize (GObject *object) if (priv->update_misspelled_words_id != 0) g_source_remove (priv->update_misspelled_words_id); + if (priv->save_paned_pos_id != 0) + g_source_remove (priv->save_paned_pos_id); + g_object_unref (priv->gsettings_chat); g_object_unref (priv->gsettings_ui); |