[ekiga] Added an is_active method in the Ekiga::Account base class



commit f101162c2ec2f49265ed40d9ea04d86f1b57903e
Author: Julien Puydt <jpuydt gnome org>
Date:   Sun Jul 12 09:14:27 2009 +0200

    Added an is_active method in the Ekiga::Account base class
    
    Incredibly, the Opal::Account already had an implementation...

 lib/engine/account/account.h                       |   10 +++++++++-
 .../components/loudmouth/loudmouth-account.cpp     |    6 ++++++
 .../components/loudmouth/loudmouth-account.h       |    2 ++
 3 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/lib/engine/account/account.h b/lib/engine/account/account.h
index dc3f47e..aa11b94 100644
--- a/lib/engine/account/account.h
+++ b/lib/engine/account/account.h
@@ -74,11 +74,19 @@ namespace Ekiga
     /** Returns the status of the Ekiga::Account.
      * This function is purely virtual and should be implemented by the
      * Ekiga::Account descendant.
-     * @return The status of the Ekiga::Contact
+     * @return The status of the Ekiga::Account
      */
     virtual const std::string get_status () const = 0;
 
 
+    /** Returns a boolean indicating whether the account is active.
+     * (some people seem to have a hard time reading the status which says
+     * so much more than a boolean)
+     *
+     * @return Whether the account is active
+     */
+    virtual bool is_active () const = 0;
+
     /** Create the menu for that account and its actions.
      * This function is purely virtual and should be implemented by
      * the descendant of the Ekiga::Contact.
diff --git a/lib/engine/components/loudmouth/loudmouth-account.cpp b/lib/engine/components/loudmouth/loudmouth-account.cpp
index d863e02..126241b 100644
--- a/lib/engine/components/loudmouth/loudmouth-account.cpp
+++ b/lib/engine/components/loudmouth/loudmouth-account.cpp
@@ -373,6 +373,12 @@ LM::Account::get_status () const
   return status;
 }
 
+bool
+LM::Account::is_active () const
+{
+  return lm_connection_is_open (connection);
+}
+
 const std::string
 LM::Account::get_name () const
 {
diff --git a/lib/engine/components/loudmouth/loudmouth-account.h b/lib/engine/components/loudmouth/loudmouth-account.h
index 2167698..93c8a2c 100644
--- a/lib/engine/components/loudmouth/loudmouth-account.h
+++ b/lib/engine/components/loudmouth/loudmouth-account.h
@@ -67,6 +67,8 @@ namespace LM
 
     const std::string get_status () const;
 
+    bool is_active () const;
+
     bool populate_menu (Ekiga::MenuBuilder& builder);
 
     /* public only to be called by C callbacks */



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