[ekiga] Added some user interface for the group chat in the loudmouth code -- subtly commented out for now



commit ffed17bba3a4283bd13dc110f25eba71b22791e6
Author: Julien Puydt <jpuydt newton localdomain>
Date:   Wed Sep 14 11:43:42 2011 +0200

    Added some user interface for the group chat in the loudmouth code -- subtly commented out for now

 plugins/loudmouth/loudmouth-dialect.cpp |   28 +++++++++++++++++++++++++++-
 plugins/loudmouth/loudmouth-dialect.h   |    2 ++
 plugins/loudmouth/loudmouth-heap.cpp    |    1 +
 3 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/plugins/loudmouth/loudmouth-dialect.cpp b/plugins/loudmouth/loudmouth-dialect.cpp
index 915db76..3825271 100644
--- a/plugins/loudmouth/loudmouth-dialect.cpp
+++ b/plugins/loudmouth/loudmouth-dialect.cpp
@@ -35,6 +35,8 @@
 
 #include <glib/gi18n.h>
 
+#include "form-request-simple.h"
+
 #include "loudmouth-dialect.h"
 
 LM::Dialect::Dialect (Ekiga::ServiceCore& core_):
@@ -115,6 +117,7 @@ LM::Dialect::open_chat (PresentityPtr presentity)
 bool
 LM::Dialect::populate_menu (Ekiga::MenuBuilder& builder)
 {
+  return false; // FIXME: this is here until the feature is ready
   builder.add_action ("group_chat", _("Join a discussion group"),
 		      boost::bind (&LM::Dialect::group_chat_action, this));
 
@@ -124,5 +127,28 @@ LM::Dialect::populate_menu (Ekiga::MenuBuilder& builder)
 void
 LM::Dialect::group_chat_action ()
 {
-  //std::cout << __PRETTY_FUNCTION__ << std::endl;
+  boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new Ekiga::FormRequestSimple (boost::bind (&LM::Dialect::on_open_group_chat_submitted, this, _1, _2)));
+
+  request->title (_("Open a group chat room"));
+
+  request->instructions (_("Please provide a room name"));
+
+  request->text ("name", _("Room name"), "", _("The name of the room you want to enter"));
+
+  request->text ("pseudo", _("Pseudonym"), "FIXME", _("The pseudonym you'll have in the room"));
+
+  questions (request);
+}
+
+void
+LM::Dialect::on_open_group_chat_submitted (bool submitted,
+					   Ekiga::Form& result)
+{
+  if ( !submitted)
+    return;
+
+  std::string name = result.text ("name");
+  std::string pseudo = result.text ("pseudo");
+
+  std::cout << "Should enter the room '" << name << "' with pseudonym '" << pseudo << "'" << std::endl;
 }
diff --git a/plugins/loudmouth/loudmouth-dialect.h b/plugins/loudmouth/loudmouth-dialect.h
index 213bc16..77e7cea 100644
--- a/plugins/loudmouth/loudmouth-dialect.h
+++ b/plugins/loudmouth/loudmouth-dialect.h
@@ -64,6 +64,8 @@ namespace LM
     Ekiga::ServiceCore& core;
 
     void group_chat_action ();
+    void on_open_group_chat_submitted (bool submitted,
+				       Ekiga::Form& result);
   };
 
   typedef boost::shared_ptr<Dialect> DialectPtr;
diff --git a/plugins/loudmouth/loudmouth-heap.cpp b/plugins/loudmouth/loudmouth-heap.cpp
index 4e3748b..6726da6 100644
--- a/plugins/loudmouth/loudmouth-heap.cpp
+++ b/plugins/loudmouth/loudmouth-heap.cpp
@@ -136,6 +136,7 @@ bool
 LM::Heap::populate_menu (Ekiga::MenuBuilder& builder)
 {
   builder.add_action ("new", _("New _Contact"), boost::bind (&LM::Heap::add_item, this));
+  dialect->populate_menu (builder);
   return true;
 }
 



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