[ekiga] Opal::Account: Use the new NotificationCore.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Opal::Account: Use the new NotificationCore.
- Date: Thu, 19 Apr 2012 16:03:27 +0000 (UTC)
commit 86b75b2dd7c9ef06fa68a5d8c347cb3f1898905e
Author: Damien Sandras <dsandras beip be>
Date: Sun Apr 15 16:17:44 2012 +0200
Opal::Account: Use the new NotificationCore.
This mechanism is used to notify account failures.
lib/engine/components/opal/opal-account.cpp | 9 ++++++++-
lib/engine/components/opal/opal-account.h | 2 ++
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 3367e80..9827718 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -64,6 +64,7 @@ Opal::Account::Account (Ekiga::ServiceCore & _core,
: core (_core)
{
endpoint = core.get<Sip::EndPoint> ("opal-sip-endpoint");
+ notification_core = core.get<Ekiga::NotificationCore> ("notification-core");
dead = false;
state = Unregistered;
status = _("Unregistered");
@@ -155,6 +156,8 @@ Opal::Account::Account (Ekiga::ServiceCore & _core,
: core (_core)
{
endpoint = core.get<Sip::EndPoint> ("opal-sip-endpoint");
+ notification_core = core.get<Ekiga::NotificationCore> ("notification-core");
+
dead = false;
state = Unregistered;
status = "";
@@ -658,8 +661,12 @@ Opal::Account::handle_registration_event (RegistrationState state_,
status = _("Could not register");
if (!info.empty ())
status = status + " (" + info + ")";
- if ( !failed_registration_already_notified)
+ if (!failed_registration_already_notified) {
updated ();
+ boost::shared_ptr<Ekiga::Notification> notif (new Ekiga::Notification (Ekiga::Notification::Error, get_name (), status));
+ notification_core->push_notification (notif);
+
+ }
failed_registration_already_notified = true;
break;
default:
diff --git a/lib/engine/components/opal/opal-account.h b/lib/engine/components/opal/opal-account.h
index 6c9989a..067d0ad 100644
--- a/lib/engine/components/opal/opal-account.h
+++ b/lib/engine/components/opal/opal-account.h
@@ -40,6 +40,7 @@
#include <opal/pres_ent.h>
+#include "notification-core.h"
#include "presence-core.h"
#include "personal-details.h"
#include "bank-impl.h"
@@ -212,6 +213,7 @@ private:
Ekiga::ServiceCore & core;
boost::shared_ptr<Sip::EndPoint> endpoint;
+ boost::shared_ptr<Ekiga::NotificationCore> notification_core;
};
typedef boost::shared_ptr<Account> AccountPtr;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]