: SUIT_Application(),
myActiveViewMgr( 0 ),
myExitConfirm( true ),
- myEditEnabled( true )
+ myEditEnabled( true ),
+ myCustomPersistence( false )
{
setDesktop( new STD_MDIDesktop() );
}
/*!Put file name from file dialog to onOpenDoc(const QString&) function*/
void STD_Application::onOpenDoc()
{
+ if ( myCustomPersistence )
+ {
+ emit openDoc();
+ return;
+ }
+
// It is preferrable to use OS-specific file dialog box here !!!
QString aName = getFileName( true, QString(), getFileFilter(), QString(), 0 );
if ( aName.isNull() )
if ( !activeStudy() )
return;
+ if ( myCustomPersistence )
+ {
+ emit saveDoc();
+ return;
+ }
+
bool isOk = false;
if ( activeStudy()->isSaved() )
{
if ( !study )
return false;
+ if ( myCustomPersistence )
+ {
+ emit saveAsDoc();
+ return true;
+ }
+
bool isOk = false;
while ( !isOk )
{
updateDesktopTitle();
updateCommandsStatus();
}
+
+/*!
+ Replace standard SALOME persistence mechanism with custom one. If custom
+ persistence is set SALOME does not perform standard actions on open/save(as)
+ buttons pressing; it emits corresponding signal instead.
+ \sa isCustomPersistence
+*/
+void STD_Application::setCustomPersistence( const bool theVal )
+{
+ myCustomPersistence = theVal;
+}
+
+/*!
+ Check f lag of custom persistence
+ \sa setCustomPersistence
+*/
+bool STD_Application::isCustomPersistence() const
+{
+ return myCustomPersistence;
+}
virtual void updateDesktopTitle();
+ void setCustomPersistence( const bool );
+ bool isCustomPersistence() const;
+
signals:
/*!emit that view manager added*/
void viewManagerAdded( SUIT_ViewManager* );
/*!emit that view manager activated*/
void viewManagerActivated( SUIT_ViewManager* );
+ /*!*/
+ void openDoc();
+ void saveDoc();
+ void saveAsDoc();
+
public slots:
virtual void onNewDoc();
virtual bool onNewDoc( const QString& );
private:
bool myExitConfirm;
bool myEditEnabled;
+ bool myCustomPersistence;
};
#if defined WIN32