Lines 233-239
Link Here
|
233 |
myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() ); |
233 |
myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() ); |
234 |
myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() ); |
234 |
myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() ); |
235 |
#endif |
235 |
#endif |
236 |
#ifndef DISABLE_PLOT2DKVIEWER |
236 |
#ifndef DISABLE_PLOT2DVIEWER |
237 |
myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, Plot2d_Viewer::Type() ); |
237 |
myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, Plot2d_Viewer::Type() ); |
238 |
myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, Plot2d_Viewer::Type() ); |
238 |
myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, Plot2d_Viewer::Type() ); |
239 |
myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, Plot2d_Viewer::Type() ); |
239 |
myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, Plot2d_Viewer::Type() ); |
Lines 522-572
Link Here
|
522 |
if ( modIcon.isNull() ) |
522 |
if ( modIcon.isNull() ) |
523 |
modIcon = QPixmap( imageEmptyIcon ); |
523 |
modIcon = QPixmap( imageEmptyIcon ); |
524 |
|
524 |
|
525 |
QToolBar* modTBar = new QtxToolBar( true, desk ); |
525 |
QStringList modList; |
526 |
modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) ); |
526 |
modules( modList, false ); |
|
|
527 |
|
528 |
if( modList.count()>1 ) |
529 |
{ |
530 |
QToolBar* modTBar = new QtxToolBar( true, desk ); |
531 |
modTBar->setLabel( tr( "INF_TOOLBAR_MODULES" ) ); |
527 |
|
532 |
|
528 |
QActionGroup* modGroup = new QActionGroup( this ); |
533 |
QActionGroup* modGroup = new QActionGroup( this ); |
529 |
modGroup->setExclusive( true ); |
534 |
modGroup->setExclusive( true ); |
530 |
modGroup->setUsesDropDown( true ); |
535 |
modGroup->setUsesDropDown( true ); |
531 |
|
|
|
532 |
a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ), |
533 |
tr( "PRP_APP_MODULE" ), 0, desk, true ); |
534 |
modGroup->add( a ); |
535 |
myActions.insert( QString(), a ); |
536 |
|
536 |
|
537 |
QMap<QString, QString> iconMap; |
537 |
a = createAction( -1, tr( "APP_NAME" ), defIcon, tr( "APP_NAME" ), |
538 |
moduleIconNames( iconMap ); |
538 |
tr( "PRP_APP_MODULE" ), 0, desk, true ); |
|
|
539 |
modGroup->add( a ); |
540 |
myActions.insert( QString(), a ); |
539 |
|
541 |
|
540 |
const int iconSize = 20; |
542 |
QMap<QString, QString> iconMap; |
|
|
543 |
moduleIconNames( iconMap ); |
541 |
|
544 |
|
542 |
modGroup->addTo( modTBar ); |
545 |
const int iconSize = 20; |
543 |
QObjectList *l = modTBar->queryList( "QComboBox" ); |
546 |
|
544 |
QObjectListIt oit( *l ); |
547 |
modGroup->addTo( modTBar ); |
545 |
while ( QObject* obj = oit.current() ) { |
548 |
QObjectList *l = modTBar->queryList( "QComboBox" ); |
546 |
QComboBox* cb = (QComboBox*)obj; |
549 |
QObjectListIt oit( *l ); |
547 |
if ( cb ) cb->setFocusPolicy( QWidget::NoFocus ); |
550 |
while ( QObject* obj = oit.current() ) { |
|
|
551 |
QComboBox* cb = (QComboBox*)obj; |
552 |
if ( cb ) cb->setFocusPolicy( QWidget::NoFocus ); |
548 |
++oit; |
553 |
++oit; |
549 |
} |
554 |
} |
550 |
delete l; |
555 |
delete l; |
551 |
|
556 |
|
552 |
modTBar->addSeparator(); |
557 |
modTBar->addSeparator(); |
553 |
|
558 |
|
554 |
QStringList modList; |
559 |
for ( it = modList.begin(); it != modList.end(); ++it ) |
555 |
modules( modList, false ); |
560 |
{ |
556 |
|
561 |
if ( !isLibExists( *it ) ) |
557 |
for ( it = modList.begin(); it != modList.end(); ++it ) |
562 |
continue; |
558 |
{ |
|
|
559 |
if ( !isLibExists( *it ) ) |
560 |
continue; |
561 |
|
563 |
|
562 |
QString iconName; |
564 |
QString iconName; |
563 |
if ( iconMap.contains( *it ) ) |
565 |
if ( iconMap.contains( *it ) ) |
564 |
iconName = iconMap[*it]; |
566 |
iconName = iconMap[*it]; |
565 |
|
567 |
|
566 |
QString modName = moduleName( *it ); |
568 |
QString modName = moduleName( *it ); |
567 |
|
569 |
|
568 |
QPixmap icon = resMgr->loadPixmap( modName, iconName, false ); |
570 |
QPixmap icon = resMgr->loadPixmap( modName, iconName, false ); |
569 |
if ( icon.isNull() ) |
571 |
if ( icon.isNull() ) |
570 |
{ |
572 |
{ |
571 |
icon = modIcon; |
573 |
icon = modIcon; |
572 |
printf( "****************************************************************\n" ); |
574 |
printf( "****************************************************************\n" ); |
Lines 574-589
Link Here
|
574 |
printf( "****************************************************************\n" ); |
576 |
printf( "****************************************************************\n" ); |
575 |
} |
577 |
} |
576 |
|
578 |
|
577 |
icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) ); |
579 |
icon.convertFromImage( icon.convertToImage().smoothScale( iconSize, iconSize, QImage::ScaleMin ) ); |
578 |
|
580 |
|
579 |
QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true ); |
581 |
QAction* a = createAction( -1, *it, icon, *it, tr( "PRP_MODULE" ).arg( *it ), 0, desk, true ); |
580 |
a->addTo( modTBar ); |
582 |
a->addTo( modTBar ); |
581 |
modGroup->add( a ); |
583 |
modGroup->add( a ); |
582 |
|
584 |
|
583 |
myActions.insert( *it, a ); |
585 |
myActions.insert( *it, a ); |
584 |
} |
586 |
} |
585 |
|
587 |
|
586 |
SUIT_Tools::simplifySeparators( modTBar ); |
588 |
SUIT_Tools::simplifySeparators( modTBar ); |
|
|
589 |
connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) ); |
590 |
} |
587 |
|
591 |
|
588 |
// New window |
592 |
// New window |
589 |
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 ); |
593 |
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, MenuWindowId, 100 ); |
Lines 609-616
Link Here
|
609 |
SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) ); |
613 |
SHIFT+Key_R, desk, false, this, SLOT( onRenameWindow() ) ); |
610 |
createMenu( RenameId, windowMenu, -1 ); |
614 |
createMenu( RenameId, windowMenu, -1 ); |
611 |
|
615 |
|
612 |
connect( modGroup, SIGNAL( selected( QAction* ) ), this, SLOT( onModuleActivation( QAction* ) ) ); |
|
|
613 |
|
614 |
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); |
616 |
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); |
615 |
createMenu( PreferencesId, fileMenu, 15, -1 ); |
617 |
createMenu( PreferencesId, fileMenu, 15, -1 ); |
616 |
createMenu( separator(), fileMenu, -1, 15, -1 ); |
618 |
createMenu( separator(), fileMenu, -1, 15, -1 ); |
Lines 1448-1454
Link Here
|
1448 |
} |
1450 |
} |
1449 |
|
1451 |
|
1450 |
/*!Protected SLOT. On study closed.*/ |
1452 |
/*!Protected SLOT. On study closed.*/ |
1451 |
void LightApp_Application::onStudyClosed( SUIT_Study* ) |
1453 |
void LightApp_Application::onStudyClosed( SUIT_Study* s ) |
1452 |
{ |
1454 |
{ |
1453 |
emit studyClosed(); |
1455 |
emit studyClosed(); |
1454 |
|
1456 |
|
Lines 1457-1463
Link Here
|
1457 |
|
1459 |
|
1458 |
activateModule( "" ); |
1460 |
activateModule( "" ); |
1459 |
|
1461 |
|
1460 |
saveWindowsGeometry(); |
1462 |
for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr ) |
|
|
1463 |
removeWindow( itr.key(), s->id() ); |
1461 |
} |
1464 |
} |
1462 |
|
1465 |
|
1463 |
/*!Protected SLOT.On desktop activated.*/ |
1466 |
/*!Protected SLOT.On desktop activated.*/ |
Lines 1560-1568
Link Here
|
1560 |
void LightApp_Application::beforeCloseDoc( SUIT_Study* s ) |
1563 |
void LightApp_Application::beforeCloseDoc( SUIT_Study* s ) |
1561 |
{ |
1564 |
{ |
1562 |
CAM_Application::beforeCloseDoc( s ); |
1565 |
CAM_Application::beforeCloseDoc( s ); |
1563 |
|
|
|
1564 |
for ( WindowMap::ConstIterator itr = myWindows.begin(); s && itr != myWindows.end(); ++itr ) |
1565 |
removeWindow( itr.key(), s->id() ); |
1566 |
} |
1566 |
} |
1567 |
|
1567 |
|
1568 |
/*!Update actions.*/ |
1568 |
/*!Update actions.*/ |