X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fjabber_whiteboard%2Fsession-manager.cpp;h=60d0b73781a47d1bbb7d4247af9496a4f70dfbe3;hb=9dc68827cbd515262ecb8d5ae8547d9e82c72e00;hp=b46aacaaef4f96ca8bafa327a30678c6ffd54e45;hpb=072de79e6270f4137fa48a8a73491e8a0904d8f8;p=inkscape.git diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index b46aacaae..60d0b7378 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -4,6 +4,7 @@ * Authors: * David Yip * Bob Jamison (Pedro port) + * Abhishek Sharma * * Copyright (c) 2005 Authors * @@ -29,9 +30,6 @@ #include "ui/view/view-widget.h" -#include "application/application.h" -#include "application/editor.h" - #include "document-private.h" #include "interface.h" #include "sp-namedview.h" @@ -59,15 +57,15 @@ SessionManager *sessionManagerInstance = NULL; void SessionManager::showClient() { - SessionManager::instance().gui.show(); + SessionManager::instance().gui.show(); } -SessionManager& -SessionManager::instance() +SessionManager &SessionManager::instance() { - if (!sessionManagerInstance) + if (!sessionManagerInstance) { sessionManagerInstance = new SessionManager(); - return *sessionManagerInstance; + } + return *sessionManagerInstance; } SessionManager::SessionManager() @@ -229,8 +227,8 @@ SessionManager::processWhiteboardEvent(Pedro::XmppEvent const& event) { Pedro::Element* root = event.getDOM(); if (root == NULL) { - g_warning("Received null DOM; ignoring message."); - return; + g_warning("Received null DOM; ignoring message."); + return; } Pedro::DOMString session = root->getTagAttribute("wb", "session"); @@ -299,11 +297,11 @@ SessionManager::checkInvitationQueue() if (invitations.size() > 0) { // There's an invitation to process; process it. - Invitation invitation = invitations.front(); + Invitation invitation = invitations.front(); Glib::ustring from = invitation.first; Glib::ustring sessionId = invitation.second; - Glib::ustring primary = + Glib::ustring primary = "" + String::ucompose(_("%1 has invited you to a whiteboard session."), from) + "\n\n" + @@ -381,25 +379,16 @@ makeInkboardDocument(int code, gchar const* rootname, State::SessionType type, G // in file.cpp. // // \see sp_file_new -SPDesktop* -makeInkboardDesktop(SPDocument* doc) +SPDesktop *makeInkboardDesktop(SPDocument* doc) { - SPDesktop* dt; + SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); + g_return_val_if_fail(dtw != NULL, NULL); + doc->doUnref(); - if (NSApplication::Application::getNewGui()) - dt = NSApplication::Editor::createDesktop(doc); - - else - { - SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); - g_return_val_if_fail(dtw != NULL, NULL); - doc->doUnref(); - - sp_create_window(dtw, TRUE); - dt = static_cast(dtw->view); - sp_namedview_window_from_document(dt); - sp_namedview_update_layers_from_document(dt); - } + sp_create_window(dtw, TRUE); + SPDesktop *dt = static_cast(dtw->view); + sp_namedview_window_from_document(dt); + sp_namedview_update_layers_from_document(dt); return dt; } @@ -418,4 +407,4 @@ makeInkboardDesktop(SPDocument* doc) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :