[ekiga] Opal: Added a missed call notification.



commit 409b16b2f8e8092fd33acfb7da9bd91a972bb1b4
Author: Damien Sandras <dsandras beip be>
Date:   Sat Apr 21 18:15:35 2012 +0200

    Opal: Added a missed call notification.

 lib/engine/components/opal/opal-call.cpp |   11 +++++++++--
 lib/engine/components/opal/opal-call.h   |    9 ++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index fff4a5c..6c5d536 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -92,11 +92,12 @@ private:
 
 
 Opal::Call::Call (OpalManager& _manager,
-		  const Ekiga::ServiceCore& _core,
+		  Ekiga::ServiceCore& _core,
 		  const std::string& uri)
   : OpalCall (_manager), Ekiga::Call (), core (_core), remote_uri (uri),
     call_setup(false), jitter(0), outgoing(false)
 {
+  notification_core = core.get<Ekiga::NotificationCore> ("notification-core");
   re_a_bytes = tr_a_bytes = re_v_bytes = tr_v_bytes = 0.0;
   last_v_tick = last_a_tick = PTime ();
   total_a =
@@ -632,7 +633,7 @@ Opal::Call::DoSetUp (OpalConnection & connection)
 
 void
 Opal::Call::OnNoAnswerTimeout (PTimer &,
-                               INT) 
+                               INT)
 {
   if (!is_outgoing ()) {
 
@@ -670,7 +671,13 @@ Opal::Call::emit_established_in_main ()
 void
 Opal::Call::emit_missed_in_main ()
 {
+  std::stringstream msg;
+
   missed ();
+  msg << _("Missed call from") << " " << get_remote_party_name ();
+  boost::shared_ptr<Ekiga::Notification> notif (new Ekiga::Notification (Ekiga::Notification::Warning,
+                                                                         _("Missed call"), msg.str ()));
+  notification_core->push_notification (notif);
 }
 
 void
diff --git a/lib/engine/components/opal/opal-call.h b/lib/engine/components/opal/opal-call.h
index b7c9f44..a2bc650 100644
--- a/lib/engine/components/opal/opal-call.h
+++ b/lib/engine/components/opal/opal-call.h
@@ -42,6 +42,8 @@
 #include "services.h"
 #include "call.h"
 
+#include "notification-core.h"
+
 #ifndef __OPAL_CALL_H__
 #define __OPAL_CALL_H__
 
@@ -57,7 +59,7 @@ namespace Opal {
 
 public:
 
-    Call (OpalManager &_manager, const Ekiga::ServiceCore& _core, const std::string & uri);
+    Call (OpalManager &_manager, Ekiga::ServiceCore& _core, const std::string & uri);
 
     ~Call ();
 
@@ -94,7 +96,7 @@ public:
 
     /** Forward an incoming call after the given delay
      * @param delay the delay after which we forward
-     * @param uri is the uri to forward to 
+     * @param uri is the uri to forward to
      */
     void set_no_answer_forward (unsigned delay, const std::string & uri);
 
@@ -218,7 +220,8 @@ private:
     /*
      * Variables
      */
-    const Ekiga::ServiceCore& core;
+    Ekiga::ServiceCore& core;
+    boost::shared_ptr<Ekiga::NotificationCore> notification_core;
 
     std::string local_party_name;
     std::string remote_party_name;



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