Code

Node tool: special case node duplication for endnodes - select new endnode
[inkscape.git] / src / jabber_whiteboard / pedrogui.cpp
index 3e8ee72a19e95b2951c2ef1b65c7c583000a543d..035fc5a2f9c9294fd1292dc719d1186e8778351b 100644 (file)
@@ -4,7 +4,7 @@
  * Authors:
  *   Bob Jamison
  *
- * Copyright (C) 2005 Bob Jamison
+ * Copyright (C) 2005-2008 Bob Jamison
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -24,6 +24,7 @@
 #include "jabber_whiteboard/pedrogui.h"
 #include "jabber_whiteboard/session-manager.h"
 
+#include <glibmm/i18n.h>
 
 #include <stdarg.h>
 
@@ -379,8 +380,8 @@ static const guint8 icon_xa[] =
 //#########################################################################
 
 
-void Roster::doubleClickCallback(const Gtk::TreeModel::Path &path,
-                   Gtk::TreeViewColumn *col)
+void Roster::doubleClickCallback(const Gtk::TreeModel::Path &/*path*/,
+                   Gtk::TreeViewColumn */*col*/)
 {
     Glib::RefPtr<Gtk::TreeModel> model = rosterView.get_model();
     Glib::RefPtr<Gtk::TreeSelection> sel = rosterView.get_selection();
@@ -698,8 +699,8 @@ void MessageList::postMessage(const DOMString &from, const DOMString &msg)
 //#########################################################################
 //# U S E R     L I S T
 //#########################################################################
-void UserList::doubleClickCallback(const Gtk::TreeModel::Path &path,
-                   Gtk::TreeViewColumn *col)
+void UserList::doubleClickCallback(const Gtk::TreeModel::Path &/*path*/,
+                   Gtk::TreeViewColumn */*col*/)
 {
     Glib::RefPtr<Gtk::TreeModel> model = userList.get_model();
     Glib::RefPtr<Gtk::TreeSelection> sel = userList.get_selection();
@@ -1091,7 +1092,7 @@ bool GroupChatWindow::receiveMessage(const DOMString &from,
 bool GroupChatWindow::receivePresence(const DOMString &fromNick,
                                       bool presence,
                                       const DOMString &show,
-                                      const DOMString &status)
+                                      const DOMString &/*status*/)
 {
 
     DOMString presStr = "";
@@ -1584,8 +1585,8 @@ void ConnectDialog::cancelCallback()
 
 
 void ConnectDialog::doubleClickCallback(
-                   const Gtk::TreeModel::Path &path,
-                   Gtk::TreeViewColumn *col)
+                   const Gtk::TreeModel::Path &/*path*/,
+                   Gtk::TreeViewColumn */*col*/)
 {
     Glib::RefPtr<Gtk::TreeModel> model = accountView.get_model();
     Glib::RefPtr<Gtk::TreeSelection> sel = accountView.get_selection();
@@ -1689,11 +1690,11 @@ bool ConnectDialog::doSetup()
     table.resize(6, 2);
     get_vbox()->pack_start(table);
 
-    parent.client.setHost("broadway.dynalias.com");
+    parent.client.setHost("enter server name");
     parent.client.setPort(5222);
     parent.client.setUsername("");
     parent.client.setPassword("");
-    parent.client.setResource("pedroXmpp");
+    parent.client.setResource("inkscape");
 
     hostLabel.set_text("Host");
     table.attach(hostLabel, 0, 1, 0, 1);
@@ -2048,24 +2049,26 @@ void PedroGui::error(const char *fmt, ...)
 {
     va_list args;
     va_start(args, fmt);
-    vsnprintf(writeBuf, writeBufLen, fmt, args);
+    gchar * buffer = g_strdup_vprintf(fmt, args);
     va_end(args) ;
 
-    Gtk::MessageDialog dlg(writeBuf,
+    Gtk::MessageDialog dlg(buffer,
                            false,
                            Gtk::MESSAGE_ERROR,
                            Gtk::BUTTONS_OK,
                            true);
     dlg.run();
+    g_free(buffer);
 }
 
 void PedroGui::status(const char *fmt, ...)
 {
     va_list args;
     va_start(args, fmt);
-    vsnprintf(writeBuf, writeBufLen, fmt, args);
+    gchar * buffer = g_strdup_vprintf(fmt, args);
     va_end(args) ;
-    messageList.postMessage("STATUS", writeBuf);
+    messageList.postMessage("STATUS", buffer);
+    g_free(buffer);
 }
 
 //################################
@@ -2114,7 +2117,7 @@ bool PedroGui::chatDeleteAll()
 
 bool PedroGui::chatMessage(const DOMString &from, const DOMString &data)
 {
-    if(data.size() < 1)
+    if(data.size() > 0)
     {
         std::vector<ChatWindow *>::iterator iter;
         for (iter=chats.begin() ; iter != chats.end() ; iter++)
@@ -2286,13 +2289,13 @@ void PedroGui::doEvent(const XmppEvent &event)
         case XmppEvent::EVENT_STATUS:
             {
             //printf("##### STATUS: %s\n", event.getData().c_str());
-            status(event.getData().c_str());
+            status("%s", event.getData().c_str());
             break;
             }
         case XmppEvent::EVENT_ERROR:
             {
             //printf("##### ERROR: %s\n", event.getData().c_str());
-            error(event.getData().c_str());
+            error("%s", event.getData().c_str());
             padlockDisable();
             break;
             }
@@ -2554,7 +2557,10 @@ void PedroGui::disconnectCallback()
 
 void PedroGui::quitCallback()
 {
-    Gtk::Main::quit();
+    client.disconnect();
+    hide();
+    //Severe overkill!  :-)
+    //Gtk::Main::quit();
 }
 
 
@@ -2616,11 +2622,13 @@ void PedroGui::sendFileCallback()
 void PedroGui::aboutCallback()
 {
     Gtk::AboutDialog dlg;
+    dlg.set_name("Inkboard");
     std::vector<Glib::ustring>authors;
-    authors.push_back("Bob Jamison");
+    authors.push_back("David Yip <yipdw@rose-hulman.edu>");
+    authors.push_back("Dale Harvey <harveyd@gmail.com>");
     dlg.set_authors(authors);
-    DOMString comments = "A simple XMPP gui client  ";
-    comments.append("Based on the Pedro XMPP client");
+    DOMString comments = _("Shared SVG whiteboard tool.");
+    comments.append(_("Based on the Pedro XMPP client"));
     dlg.set_comments(comments);
     dlg.set_version("1.0");
     dlg.run();