[ekiga/ds-gtk-application] Evolution: Ported Contact implementation to the Actor framework.



commit 378eaeb9bd6cddbc8f77c5bb81d77afe110fcfe7
Author: Damien Sandras <dsandras seconix com>
Date:   Sat Nov 29 12:13:44 2014 +0100

    Evolution: Ported Contact implementation to the Actor framework.

 plugins/evolution/evolution-contact.cpp |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/plugins/evolution/evolution-contact.cpp b/plugins/evolution/evolution-contact.cpp
index 5b2eeb3..0432404 100644
--- a/plugins/evolution/evolution-contact.cpp
+++ b/plugins/evolution/evolution-contact.cpp
@@ -64,6 +64,24 @@ Evolution::Contact::Contact (Ekiga::ServiceCore &_services,
 
   if (E_IS_CONTACT (_econtact))
     update_econtact (_econtact);
+
+  /* Actor stuff */
+  add_action (Ekiga::ActionPtr (new Ekiga::Action ("edit-contact", _("_Edit"),
+                                                   boost::bind (&Evolution::Contact::edit_action, this))));
+  add_action (Ekiga::ActionPtr (new Ekiga::Action ("remove-contact", _("_Remove"),
+                                                   boost::bind (&Evolution::Contact::remove_action, this))));
+
+  /* Pull actions */
+  boost::shared_ptr<Ekiga::ContactCore> core = services.get<Ekiga::ContactCore> ("contact-core");
+  if (core) {
+    for (unsigned int attr_type = 0; attr_type < ATTR_NUMBER; attr_type++) {
+
+      std::string attr_value = get_attribute_value (attr_type);
+      if (!attr_value.empty ()) {
+        core->pull_actions (actions, get_name (), attr_value);
+      }
+    }
+  }
 }
 
 Evolution::Contact::~Contact ()


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