virtual int id() const;
SUIT_DataObject* root() const;
- QString studyName() const;
+ virtual QString studyName() const;
SUIT_Application* application() const;
virtual bool isSaved() const;
int SalomeApp_Study::id() const
{
int id = -1;
- if ( myStudyDS )
+ if ( studyDS() )
id = studyDS()->StudyId();
return id;
}
+/*!
+ Get study name.
+*/
+QString SalomeApp_Study::studyName() const
+{
+ // redefined from SUIT_Study to update study name properly since
+ // it can be changed outside of GUI
+ // TEMPORARILY SOLUTION: better to be implemented with help of SALOMEDS observers
+ if ( studyDS() ) {
+ QString newName = studyDS()->Name().c_str();
+ if ( LightApp_Study::studyName() != newName ) {
+ SalomeApp_Study* that = const_cast<SalomeApp_Study*>( this );
+ that->setStudyName( newName );
+ ((SalomeApp_Application*)application())->updateDesktopTitle();
+ }
+ }
+ return LightApp_Study::studyName();
+}
+
/*!
Gets studyDS pointer.
*/
virtual ~SalomeApp_Study();
virtual int id() const;
+ virtual QString studyName() const;
virtual bool createDocument( const QString& );
virtual bool openDocument( const QString& );