[ekiga/ds-gtk-application] Call History: Turn the book into an Actor.



commit c9a1d1a9ffbf3f4826efb3bc9b6ceb1dde67e265
Author: Damien Sandras <dsandras beip be>
Date:   Mon Mar 3 20:32:03 2014 +0100

    Call History: Turn the book into an Actor.

 .../components/call-history/history-book.cpp       |   13 +++++++++++++
 lib/engine/components/call-history/history-book.h  |    6 ++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/lib/engine/components/call-history/history-book.cpp 
b/lib/engine/components/call-history/history-book.cpp
index dedbbcd..a6a086c 100644
--- a/lib/engine/components/call-history/history-book.cpp
+++ b/lib/engine/components/call-history/history-book.cpp
@@ -82,6 +82,9 @@ History::Book::Book (Ekiga::ServiceCore& core):
   call_core->cleared_call.connect (boost::bind (&History::Book::on_cleared_call, this, _1, _2, _3));
 
   enforce_size_limit ();
+
+  /* Ready to take actions */
+  register_actions ();
 }
 
 History::Book::~Book ()
@@ -104,6 +107,16 @@ History::Book::visit_contacts (boost::function1<bool, Ekiga::ContactPtr> visitor
 }
 
 void
+History::Book::register_actions ()
+{
+  /* Add Actor actions */
+  add_action (ActionPtr (new Ekiga::Action ("history_book_clear",
+                                            _("Clear History"),
+                                            boost::bind (&History::Book::clear,
+                                                         this))));
+}
+
+void
 History::Book::add (xmlNodePtr node)
 {
   boost::shared_ptr<Ekiga::ContactCore> ccore = contact_core.lock ();
diff --git a/lib/engine/components/call-history/history-book.h 
b/lib/engine/components/call-history/history-book.h
index fce8c3f..58e4759 100644
--- a/lib/engine/components/call-history/history-book.h
+++ b/lib/engine/components/call-history/history-book.h
@@ -55,6 +55,7 @@ namespace History
 
   class Book:
     public Ekiga::Book,
+    public Ekiga::Actor,
     public boost::signals2::trackable
   {
   public:
@@ -78,6 +79,11 @@ namespace History
     const std::string get_icon () const
     { return "document-open-recent"; }
 
+
+    /* Actor api */
+    void register_actions ();
+
+
     /* more specific api */
 
     void add (const std::string & name,


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