MechanicsDocument *DocManager::createMechanicsDocument() { MechanicsDocument *document = new MechanicsDocument( untitledName(Document::dt_mechanics) ); handleNewDocument(document); if ( KTLConfig::raiseItemSelectors() ) KTechlab::self()->showToolView( KTechlab::self()->toolView( MechanicsSelector::toolViewIdentifier() ) ); return document; }
FlowCodeDocument *DocManager::createFlowCodeDocument() { FlowCodeDocument *document = new FlowCodeDocument( untitledName(Document::dt_flowcode) ); handleNewDocument(document); if ( KTLConfig::raiseItemSelectors() ) KTechlab::self()->showToolView( KTechlab::self()->toolView( FlowPartSelector::toolViewIdentifier() ) ); return document; }
CircuitDocument *DocManager::createCircuitDocument() { CircuitDocument *document = new CircuitDocument( untitledName(Document::dt_circuit) ); handleNewDocument(document); if ( KTLConfig::raiseItemSelectors() ) KTechlab::self()->showToolView( KTechlab::self()->toolView( ComponentSelector::toolViewIdentifier() ) ); return document; }
FlowCodeDocument *DocManager::openFlowCodeFile( const KURL &url, ViewArea *viewArea ) { FlowCodeDocument *document = new FlowCodeDocument( url.fileName().remove(url.directory()) ); if ( !document->openURL(url) ) { KMessageBox::sorry( 0, i18n("Could not open FlowCode file \"%1\"").arg(url.prettyURL()) ); document->deleteLater(); return 0; } handleNewDocument( document, viewArea ); emit fileOpened(url); return document; }
CircuitDocument *DocManager::openCircuitFile( const KUrl &url, ViewArea *viewArea ) { CircuitDocument *document = new CircuitDocument( url.fileName().remove(url.directory()) ); if ( !document->openURL(url) ) { KMessageBox::sorry( 0l, i18n("Could not open Circuit file \"%1\"", url.prettyUrl()) ); document->deleteLater(); return 0l; } handleNewDocument( document, viewArea ); emit fileOpened(url); return document; }
TextDocument *DocManager::createTextDocument() { TextDocument *document = TextDocument::constructTextDocument( untitledName(Document::dt_text) ); handleNewDocument(document); return document; }