diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-10-19 13:40:22 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-10-19 13:40:22 +0800 |
commit | c68091255ef12850aade51ce317292179515377f (patch) | |
tree | 86eb70ee78214f07e0d0c80c8a073991c1e9c0a7 /src/empathy-streamed-media-window.c | |
parent | 4df0759871f6539af24a5e88650f0c219cd0505a (diff) | |
download | gsoc2013-empathy-c68091255ef12850aade51ce317292179515377f.tar gsoc2013-empathy-c68091255ef12850aade51ce317292179515377f.tar.gz gsoc2013-empathy-c68091255ef12850aade51ce317292179515377f.tar.bz2 gsoc2013-empathy-c68091255ef12850aade51ce317292179515377f.tar.lz gsoc2013-empathy-c68091255ef12850aade51ce317292179515377f.tar.xz gsoc2013-empathy-c68091255ef12850aade51ce317292179515377f.tar.zst gsoc2013-empathy-c68091255ef12850aade51ce317292179515377f.zip |
Move dialpad into a widget of its own
Let's face it, the whole thing was getting a little unwieldly there in the
UI utils, and if we're going to be using it in more places, let's start by
abstracting it into a widget.
Diffstat (limited to 'src/empathy-streamed-media-window.c')
-rw-r--r-- | src/empathy-streamed-media-window.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/empathy-streamed-media-window.c b/src/empathy-streamed-media-window.c index 26bd689ac..27d288433 100644 --- a/src/empathy-streamed-media-window.c +++ b/src/empathy-streamed-media-window.c @@ -38,6 +38,7 @@ #include <libempathy/empathy-tp-contact-factory.h> #include <libempathy/empathy-utils.h> #include <libempathy-gtk/empathy-avatar-image.h> +#include <libempathy-gtk/empathy-dialpad-widget.h> #include <libempathy-gtk/empathy-ui-utils.h> #include <libempathy-gtk/empathy-sound-manager.h> #include <libempathy-gtk/empathy-geometry.h> @@ -335,26 +336,24 @@ empathy_streamed_media_window_setup_toolbar (EmpathyStreamedMediaWindow *self) } static void -dtmf_button_pressed_cb (GtkButton *button, EmpathyStreamedMediaWindow *window) +dtmf_start_tone_cb (EmpathyDialpadWidget *dialpad, + TpDTMFEvent event, + EmpathyStreamedMediaWindow *window) { EmpathyStreamedMediaWindowPriv *priv = GET_PRIV (window); EmpathyTpStreamedMedia *call; - GQuark button_quark; - TpDTMFEvent event; g_object_get (priv->handler, "tp-call", &call, NULL); - button_quark = g_quark_from_static_string (EMPATHY_DTMF_BUTTON_ID); - event = GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (button), - button_quark)); - empathy_tp_streamed_media_start_tone (call, event); g_object_unref (call); } static void -dtmf_button_released_cb (GtkButton *button, EmpathyStreamedMediaWindow *window) +dtmf_stop_tone_cb (EmpathyDialpadWidget *self, + TpDTMFEvent event, + EmpathyStreamedMediaWindow *window) { EmpathyStreamedMediaWindowPriv *priv = GET_PRIV (window); EmpathyTpStreamedMedia *call; @@ -1133,9 +1132,11 @@ empathy_streamed_media_window_init (EmpathyStreamedMediaWindow *self) ev_sidebar_add_page (EV_SIDEBAR (priv->sidebar), "video-input", _("Video input"), page); - priv->dtmf_panel = empathy_create_dtmf_dialpad (G_OBJECT (self), - G_CALLBACK (dtmf_button_pressed_cb), - G_CALLBACK (dtmf_button_released_cb)); + priv->dtmf_panel = empathy_dialpad_widget_new (); + g_signal_connect (priv->dtmf_panel, "start-tone", + G_CALLBACK (dtmf_start_tone_cb), self); + g_signal_connect (priv->dtmf_panel, "stop-tone", + G_CALLBACK (dtmf_stop_tone_cb), self); ev_sidebar_add_page (EV_SIDEBAR (priv->sidebar), "dialpad", _("Dialpad"), priv->dtmf_panel); |