[empathy: 3/9] call-window: Add 'details' pane containing encoding codecs (#599166)



commit f93c1b261ed44eff2bbaa99d8c10ebd39682ca27
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Jul 12 12:56:55 2010 +0200

    call-window: Add 'details' pane containing encoding codecs (#599166)
    
    The details pane has been inspired from totem's 'Properties' pane.

 src/empathy-call-window.c  |   63 ++++++++++
 src/empathy-call-window.ui |  276 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 339 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index a8d1c40..9a3783f 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -167,6 +167,11 @@ struct _EmpathyCallWindowPriv
 
   GtkWidget *dtmf_panel;
 
+  /* Details vbox */
+  GtkWidget *details_vbox;
+  GtkWidget *vcodec_encoding_label;
+  GtkWidget *acodec_encoding_label;
+
   GstElement *video_input;
   GstElement *audio_input;
   GstElement *audio_output;
@@ -1039,6 +1044,9 @@ empathy_call_window_init (EmpathyCallWindow *self)
     "camera_on", &priv->tool_button_camera_on,
     "action_camera_off",  &priv->action_camera,
     "action_camera_preview",  &priv->action_camera_preview,
+    "details_vbox",  &priv->details_vbox,
+    "vcodec_encoding_label", &priv->vcodec_encoding_label,
+    "acodec_encoding_label", &priv->acodec_encoding_label,
     NULL);
   g_free (filename);
 
@@ -1163,6 +1171,8 @@ empathy_call_window_init (EmpathyCallWindow *self)
 
   gtk_widget_set_sensitive (priv->dtmf_panel, FALSE);
 
+  empathy_sidebar_add_page (EMPATHY_SIDEBAR (priv->sidebar), _("Details"),
+    priv->details_vbox);
 
   gtk_widget_show_all (top_vbox);
 
@@ -1329,6 +1339,51 @@ empathy_call_window_setup_avatars (EmpathyCallWindow *self,
 }
 
 static void
+update_send_codec (EmpathyCallWindow *self,
+    gboolean audio)
+{
+  EmpathyCallWindowPriv *priv = GET_PRIV (self);
+  FsCodec *codec;
+  GtkWidget *widget;
+
+  if (audio)
+    {
+      codec = empathy_call_handler_get_send_audio_codec (priv->handler);
+      widget = priv->acodec_encoding_label;
+    }
+  else
+    {
+      codec = empathy_call_handler_get_send_video_codec (priv->handler);
+      widget = priv->vcodec_encoding_label;
+    }
+
+  if (codec == NULL)
+    return;
+
+  gtk_label_set_text (GTK_LABEL (widget), codec->encoding_name);
+}
+
+static void
+send_audio_codec_notify_cb (GObject *object,
+    GParamSpec *pspec,
+    gpointer user_data)
+{
+  EmpathyCallWindow *self = user_data;
+
+  update_send_codec (self, TRUE);
+}
+
+static void
+send_video_codec_notify_cb (GObject *object,
+    GParamSpec *pspec,
+    gpointer user_data)
+{
+  EmpathyCallWindow *self = user_data;
+
+  update_send_codec (self, FALSE);
+}
+
+static void
 empathy_call_window_constructed (GObject *object)
 {
   EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
@@ -1352,6 +1407,14 @@ empathy_call_window_constructed (GObject *object)
     }
   /* If call has InitialVideo, the preview will be started once the call has
    * been started (start_call()). */
+
+  update_send_codec (self, TRUE);
+  update_send_codec (self, FALSE);
+
+  tp_g_signal_connect_object (priv->handler, "notify::send-audio-codec",
+      G_CALLBACK (send_audio_codec_notify_cb), self, 0);
+  tp_g_signal_connect_object (priv->handler, "notify::send-video-codec",
+      G_CALLBACK (send_video_codec_notify_cb), self, 0);
 }
 
 static void empathy_call_window_dispose (GObject *object);
diff --git a/src/empathy-call-window.ui b/src/empathy-call-window.ui
index 0c0156d..7916ba1 100644
--- a/src/empathy-call-window.ui
+++ b/src/empathy-call-window.ui
@@ -238,4 +238,280 @@
           </packing>
         </child>
       </object>
+
+  <object class="GtkVBox" id="details_vbox">
+    <property name="border_width">6</property>
+    <property name="visible">False</property>
+    <property name="homogeneous">False</property>
+    <property name="spacing">18</property>
+    <property name="orientation">vertical</property>
+
+    <child>
+      <object class="GtkVBox" id="video_vbox">
+        <property name="visible">True</property>
+        <property name="homogeneous">False</property>
+        <property name="spacing">6</property>
+        <property name="orientation">vertical</property>
+
+        <child>
+    <object class="GtkLabel" id="video_label">
+      <property name="visible">True</property>
+      <property name="label" translatable="yes">Video</property>
+      <property name="use_underline">False</property>
+      <property name="use_markup">True</property>
+      <property name="justify">GTK_JUSTIFY_LEFT</property>
+      <property name="wrap">False</property>
+      <property name="selectable">False</property>
+      <property name="xalign">0</property>
+      <property name="yalign">0.5</property>
+      <property name="xpad">0</property>
+      <property name="ypad">0</property>
+      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+      <property name="width_chars">-1</property>
+      <property name="single_line_mode">False</property>
+      <property name="angle">0</property>
+      <attributes>
+        <attribute name="weight" value="bold"/>
+      </attributes>
+    </object>
+    <packing>
+      <property name="padding">0</property>
+      <property name="expand">True</property>
+      <property name="fill">True</property>
+    </packing>
+        </child>
+
+        <child>
+    <object class="GtkAlignment" id="alignment2">
+      <property name="visible">True</property>
+      <property name="xalign">0.5</property>
+      <property name="yalign">0.5</property>
+      <property name="xscale">1</property>
+      <property name="yscale">1</property>
+      <property name="top_padding">0</property>
+      <property name="bottom_padding">0</property>
+      <property name="left_padding">12</property>
+      <property name="right_padding">0</property>
+
+      <child>
+        <object class="GtkTable" id="video">
+          <property name="visible">True</property>
+          <property name="n_rows">4</property>
+          <property name="n_columns">2</property>
+          <property name="homogeneous">False</property>
+          <property name="row_spacing">6</property>
+          <property name="column_spacing">12</property>
+
+          <child>
+      <object class="GtkLabel" id="vcodec1_label">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">Encoding Codec:</property>
+        <property name="use_underline">False</property>
+        <property name="use_markup">True</property>
+        <property name="justify">GTK_JUSTIFY_LEFT</property>
+        <property name="wrap">False</property>
+        <property name="selectable">False</property>
+        <property name="xalign">0</property>
+        <property name="yalign">0.5</property>
+        <property name="xpad">0</property>
+        <property name="ypad">0</property>
+        <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+        <property name="width_chars">-1</property>
+        <property name="single_line_mode">False</property>
+        <property name="angle">0</property>
+        <attributes>
+                <attribute name="style" value="PANGO_STYLE_ITALIC"/>
+              </attributes>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="right_attach">1</property>
+        <property name="top_attach">1</property>
+        <property name="bottom_attach">2</property>
+        <property name="x_options">fill</property>
+        <property name="y_options"/>
+      </packing>
+          </child>
+
+          <child>
+
+      <object class="GtkLabel" id="vcodec_encoding_label">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="label" translatable="yes">Unknown</property>
+        <property name="use_underline">False</property>
+        <property name="use_markup">False</property>
+        <property name="justify">GTK_JUSTIFY_LEFT</property>
+        <property name="wrap">False</property>
+        <property name="selectable">True</property>
+        <property name="xalign">0</property>
+        <property name="yalign">0.5</property>
+        <property name="xpad">0</property>
+        <property name="ypad">0</property>
+        <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
+        <property name="width_chars">-1</property>
+        <property name="single_line_mode">False</property>
+        <property name="angle">0</property>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="right_attach">2</property>
+        <property name="top_attach">1</property>
+        <property name="bottom_attach">2</property>
+        <property name="x_options">expand|shrink|fill</property>
+        <property name="y_options"/>
+      </packing>
+          </child>
+
+        </object>
+      </child>
+    </object>
+    <packing>
+      <property name="padding">0</property>
+      <property name="expand">True</property>
+      <property name="fill">True</property>
+    </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="padding">0</property>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+      </packing>
+    </child>
+
+    <child>
+      <object class="GtkVBox" id="audio_vbox">
+        <property name="visible">True</property>
+        <property name="homogeneous">False</property>
+        <property name="spacing">6</property>
+        <property name="orientation">vertical</property>
+
+        <child>
+    <object class="GtkLabel" id="bvwp_audio_label">
+      <property name="visible">True</property>
+      <property name="label" translatable="yes">Audio</property>
+      <property name="use_underline">False</property>
+      <property name="use_markup">True</property>
+      <property name="justify">GTK_JUSTIFY_LEFT</property>
+      <property name="wrap">False</property>
+      <property name="selectable">False</property>
+      <property name="xalign">0</property>
+      <property name="yalign">0.5</property>
+      <property name="xpad">0</property>
+      <property name="ypad">0</property>
+      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+      <property name="width_chars">-1</property>
+      <property name="single_line_mode">False</property>
+      <property name="angle">0</property>
+      <attributes>
+        <attribute name="weight" value="bold"/>
+      </attributes>
+    </object>
+    <packing>
+      <property name="padding">0</property>
+      <property name="expand">True</property>
+      <property name="fill">True</property>
+    </packing>
+        </child>
+
+        <child>
+    <object class="GtkAlignment" id="alignment3">
+      <property name="visible">True</property>
+      <property name="xalign">0.5</property>
+      <property name="yalign">0.5</property>
+      <property name="xscale">1</property>
+      <property name="yscale">1</property>
+      <property name="top_padding">0</property>
+      <property name="bottom_padding">0</property>
+      <property name="left_padding">12</property>
+      <property name="right_padding">0</property>
+
+      <child>
+        <object class="GtkTable" id="audio">
+          <property name="visible">True</property>
+          <property name="n_rows">4</property>
+          <property name="n_columns">2</property>
+          <property name="homogeneous">False</property>
+          <property name="row_spacing">6</property>
+          <property name="column_spacing">12</property>
+
+          <child>
+      <object class="GtkLabel" id="acodec1_label">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">Encoding Codec:</property>
+        <property name="use_underline">False</property>
+        <property name="use_markup">True</property>
+        <property name="justify">GTK_JUSTIFY_LEFT</property>
+        <property name="wrap">False</property>
+        <property name="selectable">False</property>
+        <property name="xalign">0</property>
+        <property name="yalign">0.5</property>
+        <property name="xpad">0</property>
+        <property name="ypad">0</property>
+        <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+        <property name="width_chars">-1</property>
+        <property name="single_line_mode">False</property>
+        <property name="angle">0</property>
+        <attributes>
+                <attribute name="style" value="PANGO_STYLE_ITALIC"/>
+              </attributes>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="right_attach">1</property>
+        <property name="top_attach">0</property>
+        <property name="bottom_attach">1</property>
+        <property name="x_options">fill</property>
+        <property name="y_options"/>
+      </packing>
+          </child>
+
+          <child>
+      <object class="GtkLabel" id="acodec_encoding_label">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="label" translatable="yes">Unknown</property>
+        <property name="use_underline">False</property>
+        <property name="use_markup">False</property>
+        <property name="justify">GTK_JUSTIFY_LEFT</property>
+        <property name="wrap">False</property>
+        <property name="selectable">True</property>
+        <property name="xalign">0</property>
+        <property name="yalign">0.5</property>
+        <property name="xpad">0</property>
+        <property name="ypad">0</property>
+        <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
+        <property name="width_chars">-1</property>
+        <property name="single_line_mode">False</property>
+        <property name="angle">0</property>
+      </object>
+      <packing>
+        <property name="left_attach">1</property>
+        <property name="right_attach">2</property>
+        <property name="top_attach">0</property>
+        <property name="bottom_attach">1</property>
+        <property name="x_options">expand|shrink|fill</property>
+        <property name="y_options"/>
+      </packing>
+          </child>
+
+        </object>
+      </child>
+    </object>
+    <packing>
+      <property name="padding">0</property>
+      <property name="expand">True</property>
+      <property name="fill">True</property>
+    </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="padding">0</property>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+      </packing>
+    </child>
+  </object>
+
 </interface>



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