myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() );
myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() );
#endif
-#ifndef DISABLE_PLOT2DKVIEWER
+#ifndef DISABLE_PLOT2DVIEWER
myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, Plot2d_Viewer::Type() );
myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, Plot2d_Viewer::Type() );
myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, Plot2d_Viewer::Type() );
if ( modIcon.isNull() )
modIcon = QPixmap( imageEmptyIcon );
- QToolBar* modTBar = new QtxToolBar( true, desk );
- modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
+ QStringList modList;
+ modules( modList, false );
- QActionGroup* modGroup = new QActionGroup( this );
- modGroup->setExclusive( true );
- modGroup->setUsesDropDown( true );
+ if( modList.count()>1 )
+ {
+ QToolBar* modTBar = new QtxToolBar( true, desk );
+ modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) );
- a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
- tr( "PRP_APP_MODULE" ), 0, desk, true );
- modGroup->add( a );
- myActions.insert( QString(), a );
+ QActionGroup* modGroup = new QActionGroup( this );
+ modGroup->setExclusive( true );
+ modGroup->setUsesDropDown( true );
- QMap<QString, QString> iconMap;
- moduleIconNames( iconMap );
+ a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ),
+ tr( "PRP_APP_MODULE" ), 0, desk, true );
+ modGroup->add( a );
+ myActions.insert( QString(), a );
- const int iconSize = 20;
+ QMap<QString, QString> iconMap;
+ moduleIconNames( iconMap );
- modGroup->addTo( modTBar );
- QObjectList *l = modTBar->queryList( "QComboBox" );
- QObjectListIt oit( *l );
- while ( QObject* obj = oit.current() ) {
- QComboBox* cb = (QComboBox*)obj;
- if ( cb ) cb->setFocusPolicy( QWidget::NoFocus );
+ const int iconSize = 20;
+
+ modGroup->addTo( modTBar );
+ QObjectList *l = modTBar->queryList( "QComboBox" );
+ QObjectListIt oit( *l );
+ while ( QObject* obj = oit.current() ) {
+ QComboBox* cb = (QComboBox*)obj;
+ if ( cb ) cb->setFocusPolicy( QWidget::NoFocus );
++oit;
- }
- delete l;
+ }
+ delete l;
- modTBar->addSeparator();
+ modTBar->addSeparator();
- QStringList modList;
- modules( modList, false );
-
- for ( it = modList.begin(); it != modList.end(); ++it )
- {
- if ( !isLibExists( *it ) )
- continue;
+ for ( it = modList.begin(); it != modList.end(); ++it )
+ {
+ if ( !isLibExists( *it ) )
+ continue;
- QString iconName;
- if ( iconMap.contains( *it ) )
- iconName = iconMap[*it];
+ QString iconName;
+ if ( iconMap.contains( *it ) )
+ iconName = iconMap[*it];
- QString modName = moduleName( *it );
+ QString modName = moduleName( *it );
- QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
- if ( icon.isNull() )
+ QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
+ if ( icon.isNull() )
{
icon = modIcon;
printf( "****************************************************************\n" );
printf( "****************************************************************\n" );
}
- icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
+ icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) );
- QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
- a->addTo( modTBar );
- modGroup->add( a );
+ QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true );
+ a->addTo( modTBar );
+ modGroup->add( a );
- myActions.insert( *it, a );
- }
+ myActions.insert( *it, a );
+ }
- SUIT_Tools::simplifySeparators( modTBar );
+ SUIT_Tools::simplifySeparators( modTBar );
+ connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
+ }
// New window
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 );
SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) );
createMenu( RenameId, windowMenu, -1 );
- connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) );
-
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( PreferencesId, fileMenu, 15, -1 );
createMenu( separator(), fileMenu, -1, 15, -1 );
}
/*!Protected SLOT. On study closed.*/
-void LightApp_Application::onStudyClosed( SUIT_Study* )
+void LightApp_Application::onStudyClosed( SUIT_Study* s )
{
emit studyClosed();
activateModule( "" );
- saveWindowsGeometry();
+ for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
+ removeWindow( itr.key(), s->id() );
}
/*!Protected SLOT.On desktop activated.*/
void LightApp_Application::beforeCloseDoc( SUIT_Study* s )
{
CAM_Application::beforeCloseDoc( s );
-
- for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr )
- removeWindow( itr.key(), s->id() );
}
/*!Update actions.*/