ekiga r6506 - in trunk: . src/endpoints



Author: jpuydt
Date: Fri Jul 25 08:41:48 2008
New Revision: 6506
URL: http://svn.gnome.org/viewvc/ekiga?rev=6506&view=rev

Log:
Merge branch 'improvements'

* improvements:
  Made the "Chat" and "Message" actions available together everywhere
  Enable action on double-click in the address book views.

Conflicts:

	ChangeLog

Modified:
   trunk/ChangeLog
   trunk/src/endpoints/sip-dialect.cpp
   trunk/src/endpoints/sip-dialect.h
   trunk/src/endpoints/sip.cpp
   trunk/src/endpoints/sip.h

Modified: trunk/src/endpoints/sip-dialect.cpp
==============================================================================
--- trunk/src/endpoints/sip-dialect.cpp	(original)
+++ trunk/src/endpoints/sip-dialect.cpp	Fri Jul 25 08:41:48 2008
@@ -43,12 +43,6 @@
 		       sigc::slot<bool, std::string, std::string> sender_)
   : core(core_), sender(sender_)
 {
-  Ekiga::PresenceCore *presence_core = NULL;
-
-  presence_core =
-    dynamic_cast<Ekiga::PresenceCore *> (core.get ("presence-core"));
-
-  presence_core->add_presentity_decorator (*this);
 }
 
 SIP::Dialect::~Dialect ()
@@ -85,17 +79,11 @@
   return false;
 }
 
-bool
-SIP::Dialect::populate_menu (Ekiga::Presentity& presentity,
-			     const std::string uri,
-			     Ekiga::MenuBuilder &builder)
+void
+SIP::Dialect::start_chat_with (std::string uri,
+			       std::string name)
 {
-  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, name, true)));
-
-  return true;
+  (void)open_chat_with (uri, name, true);
 }
 
 SIP::SimpleChat*

Modified: trunk/src/endpoints/sip-dialect.h
==============================================================================
--- trunk/src/endpoints/sip-dialect.h	(original)
+++ trunk/src/endpoints/sip-dialect.h	Fri Jul 25 08:41:48 2008
@@ -43,9 +43,7 @@
 
 namespace SIP
 {
-  class Dialect:
-    public Ekiga::DialectImpl<SimpleChat>,
-    public Ekiga::PresentityDecorator
+  class Dialect: public Ekiga::DialectImpl<SimpleChat>
   {
   public:
     Dialect (Ekiga::ServiceCore& core_,
@@ -64,9 +62,8 @@
 
     bool populate_menu (Ekiga::MenuBuilder& builder);
 
-    bool populate_menu (Ekiga::Presentity& presentity,
-			const std::string uri,
-			Ekiga::MenuBuilder &builder);
+    void start_chat_with (std::string uri,
+			  std::string name);
 
   private:
     Ekiga::ServiceCore& core;

Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp	(original)
+++ trunk/src/endpoints/sip.cpp	Fri Jul 25 08:41:48 2008
@@ -186,7 +186,7 @@
 }
 
 
-bool CallProtocolManager::menu_builder_add_actions (const std::string& /*fullname*/,
+bool CallProtocolManager::menu_builder_add_actions (const std::string& fullname,
                                                     std::map<std::string,std::string> & uris,
                                                     Ekiga::MenuBuilder & builder)
 {
@@ -197,12 +197,19 @@
        iter != uris.end ();
        iter++) {
 
-    std::string action = _("Call");
+    std::string call_action = _("Call");
+    std::string msg_action = _("Message");
 
-    if (!iter->first.empty ())
-      action = action + " [" + iter->first + "]";
+    if (!iter->first.empty ()) {
 
-    builder.add_action ("call", action, sigc::bind (sigc::mem_fun (this, &CallProtocolManager::on_dial), iter->second));
+      call_action = call_action + " [" + iter->first + "]";
+      msg_action = msg_action + " [" + iter->first + "]";
+    }
+
+    builder.add_action ("call", call_action,
+			sigc::bind (sigc::mem_fun (this, &CallProtocolManager::on_dial), iter->second));
+    builder.add_action ("message", msg_action,
+			sigc::bind (sigc::mem_fun (this, &CallProtocolManager::on_message), iter->second, fullname));
 
     populated = true;
   }
@@ -974,3 +981,9 @@
 {
   endpoint.dial (uri);
 }
+
+void CallProtocolManager::on_message (std::string uri,
+				      std::string name)
+{
+  dialect->start_chat_with (uri, name);
+}

Modified: trunk/src/endpoints/sip.h
==============================================================================
--- trunk/src/endpoints/sip.h	(original)
+++ trunk/src/endpoints/sip.h	Fri Jul 25 08:41:48 2008
@@ -163,6 +163,8 @@
       /* Callbacks */
   private:
       void on_dial (std::string uri);
+      void on_message (std::string uri,
+		       std::string name);
 
       PMutex msgDataMutex;
       msgDict msgData;



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