diff options
| author | daleharvey <daleharvey@users.sourceforge.net> | 2006-07-30 13:29:30 +0000 |
|---|---|---|
| committer | daleharvey <daleharvey@users.sourceforge.net> | 2006-07-30 13:29:30 +0000 |
| commit | 63d47acb4e5e82540ec7d316283326df5ceb42a2 (patch) | |
| tree | 482d3eb9d189a5b33f9c5dff580f4cb03d7d408f /src/jabber_whiteboard/session-manager.cpp | |
| parent | Fixed dates in ChangeLog (diff) | |
| download | inkscape-63d47acb4e5e82540ec7d316283326df5ceb42a2.tar.gz inkscape-63d47acb4e5e82540ec7d316283326df5ceb42a2.zip | |
working on session establishment
(bzr r1515)
Diffstat (limited to 'src/jabber_whiteboard/session-manager.cpp')
| -rw-r--r-- | src/jabber_whiteboard/session-manager.cpp | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index acb661caf..daab6bcbe 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -217,60 +217,57 @@ SessionManager::processXmppEvent(const Pedro::XmppEvent &event) * \param type Type of the session; i.e. private message or group chat. */ void -SessionManager::doShare(Glib::ustring const& to, SessionType type) +SessionManager::doShare(Glib::ustring const& to, State::SessionType type) { InkboardDocument* doc; SPDesktop* dt; - switch (type) + // Just create a new blank canvas for MUC sessions + if(type == State::WHITEBOARD_MUC) { - // Just create a new blank canvas for MUC sessions - case INKBOARD_MUC: + dt = createInkboardDesktop(to, type); - dt = createInkboardDesktop(to, type); + if (dt != NULL) + { + doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc); - if (dt != NULL) + if (doc != NULL) { - doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc); - - if (doc != NULL) - { - doc->startSessionNegotiation(); - } + doc->startSessionNegotiation(); } - break; + } + // Let the user pick the document which to start a peer ro peer session // with, or a blank one, then create a blank document, copy over the contents // and initialise session - case INKBOARD_PRIVATE: - default: + } else if (type== State::WHITEBOARD_PEER) { - ChooseDesktop dialog; - int result = dialog.run(); + ChooseDesktop dialog; + int result = dialog.run(); - if(result == Gtk::RESPONSE_OK) + if(result == Gtk::RESPONSE_OK) + { + SPDesktop *desktop = dialog.getDesktop(); + dt = createInkboardDesktop(to, type); + + if (dt != NULL) { - SPDesktop *desktop = dialog.getDesktop(); - dt = createInkboardDesktop(to, type); + doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc); - if (dt != NULL) + if (doc != NULL) { - doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc); - - if (doc != NULL) + if(desktop != NULL) { - if(desktop != NULL) - { - Inkscape::XML::Document *old_doc = sp_desktop_document(desktop)->rdoc; - doc->root()->mergeFrom(old_doc->root(),"id"); - } - - doc->startSessionNegotiation(); + Inkscape::XML::Document *old_doc = + sp_desktop_document(desktop)->rdoc; + doc->root()->mergeFrom(old_doc->root(),"id"); } + + doc->startSessionNegotiation(); } } - break; + } } } @@ -282,7 +279,7 @@ SessionManager::doShare(Glib::ustring const& to, SessionType type) * \return A pointer to the created desktop, or NULL if a new desktop could not be created. */ SPDesktop* -SessionManager::createInkboardDesktop(Glib::ustring const& to, SessionType type) +SessionManager::createInkboardDesktop(Glib::ustring const& to, State::SessionType type) { // Create document (sp_repr_document_new clone) SPDocument* doc = makeInkboardDocument(g_quark_from_static_string("xml"), "svg:svg", type, to); |
