From 20777152d7bfeca11a1477e4b472e3a3606c9de9 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 5 Nov 2009 12:38:28 +0000 Subject: factor out empathy_call_window_stream_error --- src/empathy-call-window.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 64e72b130..8bbc9c391 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -1526,10 +1526,11 @@ media_stream_error_to_txt (EmpathyCallWindow *self, } static void -empathy_call_window_audio_stream_error (EmpathyTpCall *call, +empathy_call_window_stream_error (EmpathyCallWindow *self, guint code, const gchar *msg, - EmpathyCallWindow *self) + const gchar *icon, + const gchar *title) { gchar *desc; @@ -1537,26 +1538,28 @@ empathy_call_window_audio_stream_error (EmpathyTpCall *call, if (desc == NULL) return; - display_error (self, "gnome-stock-mic", _("Can't establish audio stream"), - desc); + display_error (self, icon, title, desc); g_free (desc); } static void -empathy_call_window_video_stream_error (EmpathyTpCall *call, +empathy_call_window_audio_stream_error (EmpathyTpCall *call, guint code, const gchar *msg, EmpathyCallWindow *self) { - gchar *desc; - - desc = media_stream_error_to_txt (self, code); - if (desc == NULL) - return; + empathy_call_window_stream_error (self, code, msg, + "gnome-stock-mic", _("Can't establish audio stream")); +} - display_error (self, "camera-web", _("Can't establish video stream"), - desc); - g_free (desc); +static void +empathy_call_window_video_stream_error (EmpathyTpCall *call, + guint code, + const gchar *msg, + EmpathyCallWindow *self) +{ + empathy_call_window_stream_error (self, code, msg, + "camera-web", _("Can't establish video stream")); } static gboolean -- cgit v1.2.3