diff options
| author | daleharvey <daleharvey@users.sourceforge.net> | 2006-05-08 17:58:44 +0000 |
|---|---|---|
| committer | daleharvey <daleharvey@users.sourceforge.net> | 2006-05-08 17:58:44 +0000 |
| commit | a7a82a0fb60da5d6417caa8c4e01b1c8c2d2853e (patch) | |
| tree | 2ec4e02677a5e5dec30fe0ccaa2c3119ec30056d | |
| parent | comments explaining namespace mapping for the broken sodipodi namespace (diff) | |
| download | inkscape-a7a82a0fb60da5d6417caa8c4e01b1c8c2d2853e.tar.gz inkscape-a7a82a0fb60da5d6417caa8c4e01b1c8c2d2853e.zip | |
Persist User / Server / ChatServer name across succesful sessions (Given By Botty)
(bzr r773)
| -rw-r--r-- | src/jabber_whiteboard/chat-handler.cpp | 1 | ||||
| -rw-r--r-- | src/jabber_whiteboard/connection-establishment.cpp | 9 | ||||
| -rw-r--r-- | src/jabber_whiteboard/session-manager.cpp | 10 | ||||
| -rw-r--r-- | src/preferences-skeleton.h | 4 | ||||
| -rw-r--r-- | src/ui/dialog/whiteboard-connect.cpp | 5 | ||||
| -rw-r--r-- | src/ui/dialog/whiteboard-sharewithchat.cpp | 7 |
6 files changed, 35 insertions, 1 deletions
diff --git a/src/jabber_whiteboard/chat-handler.cpp b/src/jabber_whiteboard/chat-handler.cpp index bdb840066..b3e906508 100644 --- a/src/jabber_whiteboard/chat-handler.cpp +++ b/src/jabber_whiteboard/chat-handler.cpp @@ -137,6 +137,7 @@ ChatMessageHandler::parse(LmMessage* message) this->_sm->session_data->receive_queues[sender.raw()] = new ReceiveMessageQueue(this->_sm); } else { + //g_warning("hmm, who is chatting %s",chatter); // If the presence message is from ourselves, then we know that we // have successfully entered the chatroom _and_ have received the entire room roster, // and can therefore decide whether we need to synchronize with the rest of the room. diff --git a/src/jabber_whiteboard/connection-establishment.cpp b/src/jabber_whiteboard/connection-establishment.cpp index 5cc9e053d..2fb367bed 100644 --- a/src/jabber_whiteboard/connection-establishment.cpp +++ b/src/jabber_whiteboard/connection-establishment.cpp @@ -19,6 +19,8 @@ #include "file.h" #include "document.h" +#include "prefs-utils.h" + #include "xml/repr.h" #include "jabber_whiteboard/defines.h" @@ -90,6 +92,13 @@ SessionManager::sendRequestToChatroom(Glib::ustring const& server, Glib::ustring this->session_data->chat_server = server; this->session_data->chat_name = chatroom; + prefs_set_string_attribute("whiteboard.room", "name", chatroom.c_str()); + prefs_set_string_attribute("whiteboard.room", "server", server.c_str()); + //Commented out because you can use whiteboard.server.username + //prefs_set_string_attribute("whiteboard.room", "handle", handle.c_str()); + //store password here? + + this->setRecipient(String::ucompose("%1@%2", chatroom, server).data()); lm_message_unref(presence_req); diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index 5a7dda426..9a314842e 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -23,6 +23,8 @@ #include "gc-anchored.h" +#include "prefs-utils.h" + #include "xml/repr.h" #include "xml/node-observer.h" @@ -289,6 +291,14 @@ SessionManager::connectToServer(Glib::ustring const& server, Glib::ustring const this->_setVerbSensitivity(ESTABLISHED_CONNECTION); + //On successful connect, remember info + prefs_set_string_attribute("whiteboard.server", "name", server.c_str()); + prefs_set_string_attribute("whiteboard.server", "port", port.c_str()); + prefs_set_string_attribute("whiteboard.server", "username", username.c_str()); + prefs_set_int_attribute("whiteboard.server", "ssl", (usessl) ? 1 : 0); + //Option to store password here? + + return CONNECT_SUCCESS; } diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 2fed2b3df..92288cb65 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -247,6 +247,10 @@ static char const preferences_skeleton[] = " </group>\n" " </group>\n" " </group>\n" +" <group id = \"whiteboard\">\n" +" <group id = \"server\" name = \"jabber.org\" port = \"5222\" username = \"\" ssl = \"0\"/>\n" +" <group id = \"room\" name = \"inkboard\" server = \"gristle.org\"/>\n" +" </group>\n" "\n" "</inkscape>\n"; diff --git a/src/ui/dialog/whiteboard-connect.cpp b/src/ui/dialog/whiteboard-connect.cpp index 50f44e5f7..cb873b904 100644 --- a/src/ui/dialog/whiteboard-connect.cpp +++ b/src/ui/dialog/whiteboard-connect.cpp @@ -81,7 +81,10 @@ WhiteboardConnectDialogImpl::_construct() this->_labels[2].set_mnemonic_widget(this->_password); this->_labels[3].set_mnemonic_widget(this->_port); - this->_port.set_text("5222"); + this->_server.set_text(prefs_get_string_attribute("whiteboard.server", "name")); + this->_port.set_text(prefs_get_string_attribute("whiteboard.server", "port")); + this->_username.set_text(prefs_get_string_attribute("whiteboard.server", "username")); + this->_usessl.set_active((prefs_get_int_attribute("whiteboard.server", "ssl", 0) == 1) ? true : false); this->_layout.attach(this->_labels[0], 0, 1, 0, 1); this->_layout.attach(this->_labels[3], 2, 3, 0, 1); diff --git a/src/ui/dialog/whiteboard-sharewithchat.cpp b/src/ui/dialog/whiteboard-sharewithchat.cpp index 4c86b0dfa..eed9fa168 100644 --- a/src/ui/dialog/whiteboard-sharewithchat.cpp +++ b/src/ui/dialog/whiteboard-sharewithchat.cpp @@ -20,6 +20,8 @@ #include "inkscape.h" #include "desktop.h" +#include "prefs-utils.h" + #include "jabber_whiteboard/typedefs.h" #include "jabber_whiteboard/session-manager.h" #include "jabber_whiteboard/buddy-list-manager.h" @@ -80,6 +82,11 @@ WhiteboardShareWithChatroomDialogImpl::_construct() this->_labels[2].set_mnemonic_widget(this->_roompass); this->_labels[3].set_mnemonic_widget(this->_handle); + + this->_roomname.set_text(prefs_get_string_attribute("whiteboard.room", "name")); + this->_confserver.set_text(prefs_get_string_attribute("whiteboard.room", "server")); + this->_handle.set_text(prefs_get_string_attribute("whiteboard.server", "username")); + // Pack table this->_layout.attach(this->_labels[0], 0, 1, 0, 1); this->_layout.attach(this->_labels[1], 0, 1, 1, 2); |
