ekiga r6467 - in trunk: lib/engine/presence/avahi lib/engine/presence/local-roster lib/engine/presence/skel src/endpoints



Author: jpuydt
Date: Thu Jul 17 12:34:24 2008
New Revision: 6467
URL: http://svn.gnome.org/viewvc/ekiga?rev=6467&view=rev

Log:
Added the possibility to get more information about a presentity when giving actions on it.

Modified:
   trunk/lib/engine/presence/avahi/avahi-presentity.cpp
   trunk/lib/engine/presence/local-roster/local-presentity.cpp
   trunk/lib/engine/presence/skel/presence-core.cpp
   trunk/lib/engine/presence/skel/presence-core.h
   trunk/src/endpoints/h323.cpp
   trunk/src/endpoints/h323.h
   trunk/src/endpoints/sip-dialect.cpp
   trunk/src/endpoints/sip-dialect.h
   trunk/src/endpoints/sip-presentity.cpp
   trunk/src/endpoints/sip.cpp
   trunk/src/endpoints/sip.h

Modified: trunk/lib/engine/presence/avahi/avahi-presentity.cpp
==============================================================================
--- trunk/lib/engine/presence/avahi/avahi-presentity.cpp	(original)
+++ trunk/lib/engine/presence/avahi/avahi-presentity.cpp	Thu Jul 17 12:34:24 2008
@@ -90,7 +90,7 @@
 bool
 Avahi::Presentity::populate_menu (Ekiga::MenuBuilder &builder)
 {
-  return core.populate_presentity_menu (url, builder);
+  return core.populate_presentity_menu (*this, url, builder);
 }
 
 void

Modified: trunk/lib/engine/presence/local-roster/local-presentity.cpp
==============================================================================
--- trunk/lib/engine/presence/local-roster/local-presentity.cpp	(original)
+++ trunk/lib/engine/presence/local-roster/local-presentity.cpp	Thu Jul 17 12:34:24 2008
@@ -186,7 +186,7 @@
 {
   bool populated = false;
 
-  populated = presence_core->populate_presentity_menu (uri, builder);
+  populated = presence_core->populate_presentity_menu (*this, uri, builder);
 
   if (populated)
     builder.add_separator ();

Modified: trunk/lib/engine/presence/skel/presence-core.cpp
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.cpp	(original)
+++ trunk/lib/engine/presence/skel/presence-core.cpp	Thu Jul 17 12:34:24 2008
@@ -166,7 +166,8 @@
 }
 
 bool
-Ekiga::PresenceCore::populate_presentity_menu (const std::string uri,
+Ekiga::PresenceCore::populate_presentity_menu (Presentity& presentity,
+					       const std::string uri,
 					       MenuBuilder &builder)
 {
   bool populated = false;
@@ -176,9 +177,7 @@
        iter != presentity_decorators.end ();
        iter++) {
 
-    if (populated)
-      builder.add_separator ();
-    populated = (*iter)->populate_menu (uri, builder);
+    populated = (*iter)->populate_menu (presentity, uri, builder);
   }
 
   return populated;

Modified: trunk/lib/engine/presence/skel/presence-core.h
==============================================================================
--- trunk/lib/engine/presence/skel/presence-core.h	(original)
+++ trunk/lib/engine/presence/skel/presence-core.h	Thu Jul 17 12:34:24 2008
@@ -61,10 +61,12 @@
     virtual ~PresentityDecorator () {}
 
     /** Completes the menu for actions available on an uri
+     * @param The presentity for which the action could be made available.
      * @param The uri for which actions could be made available.
      * @param A MenuBuilder object to populate.
      */
-    virtual bool populate_menu (const std::string /*uri*/,
+    virtual bool populate_menu (Presentity& /*presentity*/,
+				const std::string /*uri*/,
 				MenuBuilder &/*builder*/) = 0;
   };
 
@@ -230,7 +232,8 @@
      * @param The uri for which the decoration is needed.
      * @param The builder to populate.
      */
-    bool populate_presentity_menu (const std::string uri,
+    bool populate_presentity_menu (Presentity& presentity,
+				   const std::string uri,
 				   MenuBuilder &builder);
 
   private:

Modified: trunk/src/endpoints/h323.cpp
==============================================================================
--- trunk/src/endpoints/h323.cpp	(original)
+++ trunk/src/endpoints/h323.cpp	Thu Jul 17 12:34:24 2008
@@ -142,13 +142,14 @@
 }
 
 
-bool CallProtocolManager::populate_menu (const std::string uri,
+bool CallProtocolManager::populate_menu (Ekiga::Presentity& presentity,
+					 const std::string uri,
                                          Ekiga::MenuBuilder & builder)
 {
   std::map<std::string, std::string> uris; 
   uris [""] = uri;
 
-  return menu_builder_add_actions ("", uris, builder);
+  return menu_builder_add_actions (presentity.get_name (), uris, builder);
 }
 
 

Modified: trunk/src/endpoints/h323.h
==============================================================================
--- trunk/src/endpoints/h323.h	(original)
+++ trunk/src/endpoints/h323.h	Thu Jul 17 12:34:24 2008
@@ -68,7 +68,8 @@
       bool populate_menu (Ekiga::Contact &contact,
                           Ekiga::MenuBuilder &builder);
 
-      bool populate_menu (const std::string uri,
+      bool populate_menu (Ekiga::Presentity& presentity,
+			  const std::string uri,
                           Ekiga::MenuBuilder & builder);
 
       bool menu_builder_add_actions (const std::string & fullname,

Modified: trunk/src/endpoints/sip-dialect.cpp
==============================================================================
--- trunk/src/endpoints/sip-dialect.cpp	(original)
+++ trunk/src/endpoints/sip-dialect.cpp	Thu Jul 17 12:34:24 2008
@@ -86,12 +86,14 @@
 }
 
 bool
-SIP::Dialect::populate_menu (const std::string uri,
+SIP::Dialect::populate_menu (Ekiga::Presentity& presentity,
+			     const std::string uri,
 			     Ekiga::MenuBuilder &builder)
 {
   std::string action = _("Message");
+  std::string name = presentity.get_name ();
 
-  builder.add_action ("message", action, sigc::hide_return (sigc::bind (sigc::mem_fun (this, &SIP::Dialect::open_chat_with), uri, "FIXME", true)));
+  builder.add_action ("message", action, sigc::hide_return (sigc::bind (sigc::mem_fun (this, &SIP::Dialect::open_chat_with), uri, name, true)));
 
   return true;
 }

Modified: trunk/src/endpoints/sip-dialect.h
==============================================================================
--- trunk/src/endpoints/sip-dialect.h	(original)
+++ trunk/src/endpoints/sip-dialect.h	Thu Jul 17 12:34:24 2008
@@ -64,7 +64,8 @@
 
     bool populate_menu (Ekiga::MenuBuilder& builder);
 
-    bool populate_menu (const std::string uri,
+    bool populate_menu (Ekiga::Presentity& presentity,
+			const std::string uri,
 			Ekiga::MenuBuilder &builder);
 
   private:

Modified: trunk/src/endpoints/sip-presentity.cpp
==============================================================================
--- trunk/src/endpoints/sip-presentity.cpp	(original)
+++ trunk/src/endpoints/sip-presentity.cpp	Thu Jul 17 12:34:24 2008
@@ -103,9 +103,5 @@
 bool
 SIP::Presentity::populate_menu (Ekiga::MenuBuilder &builder)
 {
-  bool result = false;
-
-  result = presence_core->populate_presentity_menu (uri, builder);
-
-  return result;
+  return presence_core->populate_presentity_menu (*this, uri, builder);
 }

Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp	(original)
+++ trunk/src/endpoints/sip.cpp	Thu Jul 17 12:34:24 2008
@@ -174,13 +174,14 @@
 }
 
 
-bool CallProtocolManager::populate_menu (const std::string uri,
+bool CallProtocolManager::populate_menu (Ekiga::Presentity& presentity,
+					 const std::string uri,
                                          Ekiga::MenuBuilder & builder)
 {
   std::map<std::string, std::string> uris; 
   uris [""] = uri;
 
-  return menu_builder_add_actions ("", uris, builder);
+  return menu_builder_add_actions (presentity.get_name (), uris, builder);
 }
 
 

Modified: trunk/src/endpoints/sip.h
==============================================================================
--- trunk/src/endpoints/sip.h	(original)
+++ trunk/src/endpoints/sip.h	Thu Jul 17 12:34:24 2008
@@ -82,7 +82,8 @@
       bool populate_menu (Ekiga::Contact &contact,
                           Ekiga::MenuBuilder &builder);
 
-      bool populate_menu (const std::string uri,
+      bool populate_menu (Ekiga::Presentity& presentity,
+			  const std::string uri,
                           Ekiga::MenuBuilder & builder);
 
       bool menu_builder_add_actions (const std::string & fullname,



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