void SalomeApp_Application::onAboutRefresh()
{
- SalomeApp_DataModel* dm = 0;
- if ( activeModule() )
- {
- CAM_DataModel* camDM = activeModule()->dataModel();
+ for ( ModuleListIterator it = modules(); it.current(); ++it )
+ {
+ CAM_DataModel* camDM = it.current()->dataModel();
if ( camDM && camDM->inherits( "SalomeApp_DataModel" ) )
- dm = (SalomeApp_DataModel*)camDM;
+ ((SalomeApp_DataModel*)camDM)->update();
}
-
- if ( dm )
- dm->update();
}
void SalomeApp_Application::setActiveStudy( SUIT_Study* study )
{
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;
}
filtersList.append(tr("PYTHON_FILES_FILTER"));
filtersList.append(tr("ALL_FILES_FILTER"));
- QString aFile = SUIT_FileDlg::getFileName(desktop(), "", filtersList, tr("TOT_DESK_FILE_LOAD_SCRIPT"), true, false);
+ QString aFile = SUIT_FileDlg::getFileName(desktop(), "", filtersList, tr("TOT_DESK_FILE_LOAD_SCRIPT"), true, true );
if(!aFile.isEmpty()) {
QString command = QString("execfile(\"%1\")").arg(aFile);
//study->updateCaptions();
}
+
+QString SalomeApp_Application::getFileName( bool open )
+{
+ QStringList filtersList;
+ filtersList.append( getFileFilter() );
+ QString initial = open ? QString( "" ) : ( activeStudy() ? activeStudy()->studyName() : QString( "" ) );
+ return SUIT_FileDlg::getFileName( desktop(), initial, filtersList, QString::null, open, true );
+}