예제 #1
0
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;
}
예제 #2
0
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;
}
예제 #3
0
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;
}
예제 #4
0
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;
}
예제 #5
0
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;
}
예제 #6
0
TextDocument *DocManager::createTextDocument()
{
	TextDocument *document = TextDocument::constructTextDocument( untitledName(Document::dt_text) );
	handleNewDocument(document);
	return document;
}