#include <qfile.h>
#include <qfileinfo.h>
#include <qtextstream.h>
+#include <qlabel.h>
+#include <qfont.h>
#ifdef WIN32
#include <windows.h>
return true;
if ( myModule )
- myModule->deactivateModule( activeStudy() );
-
+ {
+ if ( !myModule->deactivateModule( activeStudy() ) )
+ {
+ // ....
+ }
+ }
myModule = mod;
if ( myModule ){
prev = dm;
}
}
- myModule->activateModule( activeStudy() );
+ if ( !myModule->activateModule( activeStudy() ) )
+ {
+ myModule->setMenuShown( false );
+ myModule->setToolShown( false );
+ SUIT_MessageBox::error1( desktop(), tr( "ERROR_TLT" ), tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ), tr( "BUT_OK" ) );
+ myModule = 0;
+ return false;
+ }
}
updateCommandsStatus();
SUIT_MessageBox::error1( 0, tr( "Error" ), tr( "Can not load modules configuration file " ), tr( "Ok" ) );
}
-void CAM_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup )
+void CAM_Application::contextMenuPopup( const QString& type, QPopupMenu* thePopup, QString& title )
{
// to do : add common items for popup menu ( if they are exist )
if ( activeModule() )
- activeModule()->contextMenuPopup( type, thePopup );
+ activeModule()->contextMenuPopup( type, thePopup, title );
+}
+
+void CAM_Application::createEmptyStudy()
+{
+ SUIT_Study* study = activeStudy();
+
+ STD_Application::createEmptyStudy();
+
+ SUIT_Study* newStudy = activeStudy();
+ if ( study != newStudy )
+ {
+ CAM_Study* camStudy = dynamic_cast<CAM_Study*>( newStudy );
+ for ( ModuleListIterator it( myModules ); it.current(); ++it )
+ camStudy->insertDataModel( it.current()->dataModel() );
+ }
}