Logo Search packages:      
Sourcecode: inkscape version File versions

void Inkscape::UI::View::View::setDocument ( SPDocument doc  )  [protected, virtual]

Disconnects the view from the document signals, connects the view to a new one, and emits the _document_set_signal on the view.

This is code comon to all subclasses and called from their setDocument() methods after they are done.

Parameters:
doc The new document to connect the view to.

Reimplemented in SPDesktop, and SPSVGView.

Definition at line 139 of file view.cpp.

References SPDocument::connectResized(), and SPDocument::connectURISet().

                                      {
    g_return_if_fail(doc != NULL);

    if (_doc) {
        _document_uri_set_connection.disconnect();
        _document_resized_connection.disconnect();
        inkscape_remove_document(_doc);
    }

    inkscape_add_document(doc);

    _doc = doc;
    _document_uri_set_connection = 
        _doc->connectURISet(sigc::bind(sigc::ptr_fun(&_onDocumentURISet), this));
    _document_resized_connection = 
        _doc->connectResized(sigc::bind(sigc::ptr_fun(&_onDocumentResized), this));
    _document_uri_set_signal.emit (SP_DOCUMENT_URI(_doc));
}


Generated by  Doxygen 1.6.0   Back to index