[empathy] factor out empathy_call_window_stream_error



commit 20777152d7bfeca11a1477e4b472e3a3606c9de9
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Nov 5 12:38:28 2009 +0000

    factor out empathy_call_window_stream_error

 src/empathy-call-window.c |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 64e72b1..8bbc9c3 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]