aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-07 18:19:24 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 17:20:08 +0800
commit6e258dd8646083c5c17f71318901aad4f529d9ee (patch)
treefe1cdd63f0fca1d0632c6561c09715bac2525727 /src
parentb1008464fa6550f3958a4acad3b8fc5ee5457207 (diff)
downloadgsoc2013-empathy-6e258dd8646083c5c17f71318901aad4f529d9ee.tar
gsoc2013-empathy-6e258dd8646083c5c17f71318901aad4f529d9ee.tar.gz
gsoc2013-empathy-6e258dd8646083c5c17f71318901aad4f529d9ee.tar.bz2
gsoc2013-empathy-6e258dd8646083c5c17f71318901aad4f529d9ee.tar.lz
gsoc2013-empathy-6e258dd8646083c5c17f71318901aad4f529d9ee.tar.xz
gsoc2013-empathy-6e258dd8646083c5c17f71318901aad4f529d9ee.tar.zst
gsoc2013-empathy-6e258dd8646083c5c17f71318901aad4f529d9ee.zip
Factor out the block/set/unblock code
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index eac2bca26..d9bab64ea 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2904,6 +2904,20 @@ empathy_call_window_state_event_cb (GtkWidget *widget,
}
static void
+empathy_call_window_update_dialpad_menu (EmpathyCallWindow *window,
+ gboolean toggled)
+{
+ EmpathyCallWindowPriv *priv = GET_PRIV (window);
+
+ g_signal_handlers_block_by_func (priv->menu_dialpad,
+ empathy_call_window_dialpad_cb, window);
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (priv->menu_dialpad),
+ toggled);
+ g_signal_handlers_unblock_by_func (priv->menu_dialpad,
+ empathy_call_window_dialpad_cb, window);
+}
+
+static void
empathy_call_window_sidebar_toggled_cb (GtkToggleButton *toggle,
EmpathyCallWindow *window)
{
@@ -2946,12 +2960,7 @@ empathy_call_window_sidebar_toggled_cb (GtkToggleButton *toggle,
dialpad_shown = active && page == priv->dtmf_panel;
g_object_unref (page);
- g_signal_handlers_block_by_func (priv->menu_dialpad,
- empathy_call_window_dialpad_cb, window);
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (priv->menu_dialpad),
- (dialpad_shown));
- g_signal_handlers_unblock_by_func (priv->menu_dialpad,
- empathy_call_window_dialpad_cb, window);
+ empathy_call_window_update_dialpad_menu (window, dialpad_shown);
}
static void
@@ -3041,14 +3050,7 @@ empathy_call_window_sidebar_changed_cb (EmpathySidebar *sidebar,
GtkWidget *page;
g_object_get (sidebar, "current-page", &page, NULL);
-
- g_signal_handlers_block_by_func (priv->menu_dialpad,
- empathy_call_window_dialpad_cb, window);
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (priv->menu_dialpad),
- (page == priv->dtmf_panel));
- g_signal_handlers_unblock_by_func (priv->menu_dialpad,
- empathy_call_window_dialpad_cb, window);
-
+ empathy_call_window_update_dialpad_menu (window, page == priv->dtmf_panel);
g_object_unref (page);
}