if ( aName.isNull() )
return;
+ onOpenDoc( aName );
+}
+
+bool STD_Application::onOpenDoc( const QString& aName )
+{
+ bool res = true;
if ( !activeStudy() )
{
// if no study - open in current desktop
createEmptyStudy();
- activeStudy()->openDocument( aName );
+ res = activeStudy()->openDocument( aName );
updateDesktopTitle();
updateCommandsStatus();
}
{
aApp = startApplication( 0, 0 );
if ( aApp )
- aApp->useFile( aName );
+ res = aApp->useFile( aName );
}
else
aApp->desktop()->setActiveWindow();
}
+ return res;
}
void STD_Application::beforeCloseDoc( SUIT_Study* )
}
}
-void STD_Application::useFile(const QString& theFileName)
+bool STD_Application::useFile(const QString& theFileName)
{
- SUIT_Application::useFile(theFileName);
+ bool res = SUIT_Application::useFile(theFileName);
updateDesktopTitle();
updateCommandsStatus();
+ return res;
}
void STD_Application::updateDesktopTitle()
virtual QString applicationName() const;
virtual bool isPossibleToClose();
- virtual void useFile( const QString& );
+ virtual bool useFile( const QString& );
virtual void createEmptyStudy();
public slots:
virtual void onNewDoc();
- virtual void onOpenDoc();
virtual void onCloseDoc();
virtual void onSaveDoc();
virtual bool onSaveAsDoc();
+
+ virtual void onOpenDoc();
+ virtual bool onOpenDoc( const QString& );
+
virtual void onExit();
+
virtual void onCut();
virtual void onCopy();
virtual void onPaste();
+
virtual void onViewStatusBar( bool );
+
virtual void onHelpAbout();
+
virtual void onDesktopClosing( SUIT_Desktop*, QCloseEvent* );
virtual void onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* );
desktop()->show();
}
-void SUIT_Application::useFile( const QString& theFileName )
+bool SUIT_Application::useFile( const QString& theFileName )
{
createEmptyStudy();
if ( activeStudy() )
- activeStudy()->openDocument( theFileName );
+ return activeStudy()->openDocument( theFileName );
}
void SUIT_Application::createEmptyStudy()
virtual void start();
//! Loads document <theFileName> into active Study. If Study is empty - creates it.
- virtual void useFile( const QString& );
+ virtual bool useFile( const QString& );
//! Creates new empty Study if active Study = 0
virtual void createEmptyStudy();