summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordaleharvey <daleharvey@users.sourceforge.net>2006-07-25 19:18:09 +0000
committerdaleharvey <daleharvey@users.sourceforge.net>2006-07-25 19:18:09 +0000
commit9e06f2988618e2b5d4542e803be46a1025bbd651 (patch)
treec301996211921cb6f53c6d3b798657134955c54a /src
parentunlibtoolize the build process (yay!) -- we haven't actually used libtool for... (diff)
downloadinkscape-9e06f2988618e2b5d4542e803be46a1025bbd651.tar.gz
inkscape-9e06f2988618e2b5d4542e803be46a1025bbd651.zip
session can be initlialised with a current document which is copied into the inkboard document
(bzr r1475)
Diffstat (limited to 'src')
-rw-r--r--src/jabber_whiteboard/session-manager.cpp62
1 files changed, 45 insertions, 17 deletions
diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp
index c8b2420e6..536bc8db4 100644
--- a/src/jabber_whiteboard/session-manager.cpp
+++ b/src/jabber_whiteboard/session-manager.cpp
@@ -218,30 +218,58 @@ SessionManager::processXmppEvent(const Pedro::XmppEvent &event)
void
SessionManager::doShare(Glib::ustring const& to, SessionType type)
{
- ChooseDesktop dialog;
- int result = dialog.run();
+ InkboardDocument* doc;
+ SPDesktop* dt;
- if(result == Gtk::RESPONSE_OK)
+ switch (type)
{
- InkboardDocument* doc;
- SPDesktop *desktop = dialog.getDesktop();
+ // Just create a new blank canvas for MUC sessions
+ case INKBOARD_MUC:
+
+ dt = createInkboardDesktop(to, type);
- if(desktop == NULL)
- {
- SPDesktop* dt = createInkboardDesktop(to, type);
if (dt != NULL)
{
- doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc);
+ doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc);
+
+ if (doc != NULL)
+ {
+ doc->startSessionNegotiation();
+ }
}
- }else
- {
- doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(desktop)->rdoc);
- }
+ break;
- if (doc != NULL)
- {
- doc->startSessionNegotiation();
- }
+ // 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:
+
+ ChooseDesktop dialog;
+ int result = dialog.run();
+
+ if(result == Gtk::RESPONSE_OK)
+ {
+ SPDesktop *desktop = dialog.getDesktop();
+ dt = createInkboardDesktop(to, type);
+
+ if (dt != NULL)
+ {
+ doc = dynamic_cast< InkboardDocument* >(sp_desktop_document(dt)->rdoc);
+
+ if (doc != NULL)
+ {
+ if(desktop != NULL)
+ {
+ Inkscape::XML::Document *old_doc = sp_desktop_document(desktop)->rdoc;
+ doc->root()->mergeFrom(old_doc->root(),"id");
+ }
+
+ doc->startSessionNegotiation();
+ }
+ }
+ }
+ break;
}
}