empathy r1162 - in trunk: libempathy src



Author: xclaesse
Date: Fri Jun 13 11:13:49 2008
New Revision: 1162
URL: http://svn.gnome.org/viewvc/empathy?rev=1162&view=rev

Log:
Do not show the keypad when the media channel does not have the DTMF interface (Alban Crequy)


Modified:
   trunk/libempathy/empathy-tp-call.c
   trunk/src/empathy-call-window.c

Modified: trunk/libempathy/empathy-tp-call.c
==============================================================================
--- trunk/libempathy/empathy-tp-call.c	(original)
+++ trunk/libempathy/empathy-tp-call.c	Fri Jun 13 11:13:49 2008
@@ -25,6 +25,7 @@
 
 #include <telepathy-glib/proxy-subclass.h>
 #include <telepathy-glib/dbus.h>
+#include <telepathy-glib/_gen/telepathy-interfaces.h>
 
 #include <extensions/extensions.h>
 
@@ -61,6 +62,7 @@
   PROP_CHANNEL,
   PROP_CONTACT,
   PROP_IS_INCOMING,
+  PROP_HAS_DTMF,
   PROP_STATUS,
   PROP_AUDIO_STREAM,
   PROP_VIDEO_STREAM
@@ -571,6 +573,10 @@
     case PROP_IS_INCOMING:
       g_value_set_boolean (value, priv->is_incoming);
       break;
+    case PROP_HAS_DTMF:
+      g_value_set_boolean (value, tp_proxy_has_interface_by_id (priv->channel,
+          TP_IFACE_QUARK_CHANNEL_INTERFACE_DTMF));
+      break;
     case PROP_STATUS:
       g_value_set_uint (value, priv->status);
       break;
@@ -613,6 +619,10 @@
       g_param_spec_boolean ("is-incoming", "Is media stream incoming",
       "Is media stream incoming", FALSE, G_PARAM_READABLE |
       G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+  g_object_class_install_property (object_class, PROP_HAS_DTMF,
+      g_param_spec_boolean ("has-dtmf", "Has the media channel DTMF",
+      "Has the media channel DTMF", FALSE, G_PARAM_READABLE |
+      G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
   g_object_class_install_property (object_class, PROP_STATUS,
       g_param_spec_uint ("status", "Call status",
       "Call status", 0, 255, 0, G_PARAM_READABLE | G_PARAM_STATIC_NICK |

Modified: trunk/src/empathy-call-window.c
==============================================================================
--- trunk/src/empathy-call-window.c	(original)
+++ trunk/src/empathy-call-window.c	Fri Jun 13 11:13:49 2008
@@ -340,6 +340,7 @@
   EmpathyTpCallStream *audio_stream;
   EmpathyTpCallStream *video_stream;
   gboolean is_incoming;
+  gboolean has_dtmf;
   gchar *title;
 
   g_object_get (window->call,
@@ -348,6 +349,7 @@
       "video-stream", &video_stream,
       "contact", &contact,
       "is-incoming", &is_incoming,
+      "has-dtmf", &has_dtmf,
       NULL);
 
   if (video_stream->state > audio_stream->state)
@@ -359,6 +361,15 @@
       "is-incoming: %d video-stream direction: %d",
       window->status, stream_state, is_incoming, video_stream->direction);
 
+  if (has_dtmf)
+    {
+      gtk_widget_show (window->keypad_expander);
+    }
+  else
+    {
+      gtk_widget_hide (window->keypad_expander);
+    }
+
   /* Depending on the status we have to set:
    * - window's title
    * - status's label



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