#include "SalomeApp_AboutDlg.h"
#include "SalomeApp_ModuleDlg.h"
#include "SalomeApp_PreferencesDlg.h"
+#include "SalomeApp_StudyPropertiesDlg.h"
#include "SalomeApp_GLSelector.h"
#include "SalomeApp_OBSelector.h"
0, desk, false, this, SLOT( onLoadScript() ) );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( LoadScriptId, fileMenu, 10, -1 );
+
+ createAction( PropertiesId, tr( "TOT_DESK_FILE_PROPERTIES" ), QIconSet(),
+ tr( "MEN_DESK_FILE_PROPERTIES" ), tr( "PRP_DESK_FILE_PROPERTIES" ),
+ 0, desk, false, this, SLOT( onProperties() ) );
+ createMenu( PropertiesId, fileMenu, 10, -1 );
+
// default icon for neutral point ('SALOME' module)
QPixmap defIcon = resMgr->loadPixmap( "SalomeApp", tr( "APP_DEFAULT_ICO" ) );
QAction* a = action( LoadScriptId );
if ( a )
a->setEnabled( activeStudy() );
+
+ a = action( PropertiesId );
+ if( a )
+ a->setEnabled( activeStudy() );
}
//=======================================================================
{
SUIT_ViewManager* aVM = viewManager( vmType );
SUIT_ViewManager* anActiveVM = CAM_Application::activeViewManager();
+
if ( anActiveVM && anActiveVM->getType() == vmType )
aVM = anActiveVM;
- else if ( aVM )
+
+ if ( aVM && create )
{
if ( !aVM->getActiveView() )
aVM->createView();
+ else
+ aVM->getActiveView()->setFocus();
}
else if ( create )
aVM = createViewManager( vmType );
+
return aVM;
}
itr.data()->activate( activeStudy()->id() );
}
}
+
+void SalomeApp_Application::onProperties()
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+ if( !study )
+ return;
+
+ _PTR(StudyBuilder) SB = study->studyDS()->NewBuilder();
+ SB->NewCommand();
+
+ SalomeApp_StudyPropertiesDlg aDlg( desktop() );
+ int res = aDlg.exec();
+ if( res==QDialog::Accepted && aDlg.isChanged() )
+ SB->CommitCommand();
+ else
+ SB->AbortCommand();
+
+ //study->updateCaptions();
+}