[ekiga/ds-gtk-application] OpalCall: Added "answer" and "reject" Actions.



commit 32ada9f0d4edb0b991bc70bc5ef0165fd9ff54f0
Author: Damien Sandras <dsandras seconix com>
Date:   Sun Dec 7 15:51:29 2014 +0100

    OpalCall: Added "answer" and "reject" Actions.

 lib/engine/components/opal/opal-call.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index 5d689dc..2dfd2fd 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -117,11 +117,19 @@ Opal::Call::Call (Opal::CallManager& _manager,
 
   add_action (Ekiga::ActionPtr (new Ekiga::Action ("hangup", _("Hangup"),
                                                    boost::bind (&Call::hang_up, this))));
+  if (!is_outgoing () && !IsEstablished ()) {
+    add_action (Ekiga::ActionPtr (new Ekiga::Action ("answer", _("Answer"),
+                                                     boost::bind (&Call::answer, this))));
+    add_action (Ekiga::ActionPtr (new Ekiga::Action ("reject", _("Reject"),
+                                                     boost::bind (&Call::hang_up, this))));
+  }
 }
 
 Opal::Call::~Call ()
 {
   remove_action ("hangup");
+  remove_action ("reject");
+  remove_action ("answer");
   remove_action ("transfer");
   remove_action ("hold");
   remove_action ("transmit-video");
@@ -152,6 +160,8 @@ Opal::Call::answer ()
     PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
     if (connection != NULL) {
       connection->AcceptIncoming ();
+      remove_action ("reject");
+      remove_action ("answer");
     }
   }
 }
@@ -419,6 +429,8 @@ 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))));
+    remove_action ("answer");
+    remove_action ("reject");
 
     parse_info (connection);
     Ekiga::Runtime::run_in_main (boost::bind (&Opal::Call::emit_established_in_main, this));
@@ -740,7 +752,6 @@ Opal::Call::OnNoAnswerTimeout (PTimer &,
 void
 Opal::Call::emit_established_in_main ()
 {
-  std::cout << "Call Established " << this << std::endl << std::flush;
   established ();
 }
 


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