[ekiga/ds-gtk-application] Call: Moved transmit-video action to Opal::Call.



commit 8577c1f6f97bef697e48dfa804c4a0266652225f
Author: Damien Sandras <dsandras seconix com>
Date:   Sun Nov 2 16:47:52 2014 +0100

    Call: Moved transmit-video action to Opal::Call.
    
    This allows the Action to be dynamically added/removed when there is
    video for the call. It allows removing directly calls to the Ekiga::Call
    API.

 lib/engine/components/opal/opal-call.cpp    |    6 ++++++
 lib/engine/gui/gtk-frontend/call-window.cpp |   20 +-------------------
 2 files changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index 7a47b9d..5d689dc 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -124,6 +124,7 @@ Opal::Call::~Call ()
   remove_action ("hangup");
   remove_action ("transfer");
   remove_action ("hold");
+  remove_action ("transmit-video");
 }
 
 void
@@ -418,6 +419,7 @@ Opal::Call::OnEstablished (OpalConnection & connection)
                                                      boost::bind (&Call::toggle_hold, this))));
     add_action (Ekiga::ActionPtr (new Ekiga::Action ("transfer", _("Transfer"),
                                                      boost::bind (&Call::transfer, this))));
+
     parse_info (connection);
     Ekiga::Runtime::run_in_main (boost::bind (&Opal::Call::emit_established_in_main, this));
   }
@@ -630,6 +632,10 @@ Opal::Call::OnOpenMediaStream (OpalMediaStream & stream)
   is_transmitting = !stream.IsSource ();
 
   Ekiga::Runtime::run_in_main (boost::bind (boost::ref (stream_opened), stream_name, type, is_transmitting));
+
+  if (type == Ekiga::Call::Video)
+    add_action (Ekiga::ActionPtr (new Ekiga::Action ("transmit-video", _("Transmit Video"),
+                                                     boost::bind (&Call::toggle_stream_pause, this, 
Ekiga::Call::Video))));
 }
 
 
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index e1a6ac3..3206438 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -192,10 +192,6 @@ static void show_video_settings_cb (G_GNUC_UNUSED GSimpleAction *action,
                                     G_GNUC_UNUSED GVariant *parameter,
                                     gpointer data);
 
-static void toggle_video_stream_pause_cb (G_GNUC_UNUSED GSimpleAction *action,
-                                          G_GNUC_UNUSED GVariant *parameter,
-                                          gpointer data);
-
 static void audio_volume_changed_cb (GtkAdjustment * /*adjustment*/,
                                      gpointer data);
 
@@ -435,8 +431,7 @@ static GActionEntry win_entries[] =
     { "audio-volume-settings", show_audio_settings_cb, NULL, NULL, NULL, 0 },
     { "video-color-settings", show_video_settings_cb, NULL, NULL, NULL, 0 },
     { "show-extended-video",  show_extended_video_window_cb, NULL, NULL, NULL, 0 },
-    { "enable-fullscreen", fullscreen_changed_cb, NULL, NULL, NULL, 0 },
-    { "transmit-video", toggle_video_stream_pause_cb, NULL, "true", NULL, 0 }
+    { "enable-fullscreen", fullscreen_changed_cb, NULL, NULL, NULL, 0 }
 };
 /**/
 
@@ -504,18 +499,6 @@ show_video_settings_cb (G_GNUC_UNUSED GSimpleAction *action,
 }
 
 static void
-toggle_video_stream_pause_cb (G_GNUC_UNUSED GSimpleAction *action,
-                              G_GNUC_UNUSED GVariant *parameter,
-                              gpointer data)
-{
-  EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
-
-  if (self->priv->current_call)
-    self->priv->current_call->toggle_stream_pause (Ekiga::Call::Video);
-}
-
-
-static void
 audio_volume_changed_cb (GtkAdjustment * /*adjustment*/,
                          gpointer data)
 {
@@ -2011,7 +1994,6 @@ ekiga_call_window_init_gui (EkigaCallWindow *self)
   gtk_widget_set_tooltip_text (GTK_WIDGET (button),
                                _("Transfer the current call"));
 
-
   /* Menu button */
   button = gtk_menu_button_new ();
   g_object_set (G_OBJECT (button), "use-popover", true, NULL);


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