-// LIGHT : sample (no-corba-engine) SALOME module
+// PARAVIS : ParaView wrapper SALOME module
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// Open File
aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_OPEN_FILE"), false );
createAction( OpenFileId, tr("TOP_OPEN_FILE"), QIcon(aPixmap),
- tr("MEN_OPEN_FILE"), tr("STB_OPEN_FILE"),
+ tr("MEN_OPEN"), tr("STB_OPEN_FILE"),
0, desk, false, &Implementation->Core, SLOT( onFileOpen() ) );
// Load State
tr("MEN_ENABLE_TOOLTIPS"), 0, desk );
aQtxAction->setStatusTip( tr( "PRP_APP_ENABLE_TOOLTIPS" ) );
aQtxAction->setCheckable(true);
+ aQtxAction->setChecked(true);
registerAction( EnableTooltipsId, aQtxAction );
}
int aPVMnu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1 );
createMenu( OpenFileId, aPVMnu, 5 );
+
+ // Recent Files
+ int aMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 );
+ QMenu* aMenu = menuMgr()->findMenu( aMenuId );
+ Implementation->RecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
+ connect( Implementation->RecentFilesMenu, SIGNAL( serverConnectFailed() ),
+ &Implementation->Core, SLOT( makeDefaultConnectionIfNoneExists() ) );
+ QList<QAction*> anActns = aMenu->actions();
+ for (int i = 0; i < anActns.size(); ++i)
+ createMenu( anActns.at(i), aMenuId );
+
+
createMenu( separator(), aPVMnu, -1, 5 );
createMenu( LoadStateId, aPVMnu, 15 );
// Install ParaView managers for "Sources" menu
QMenu* aRes = 0;
- aPVMnu = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60 );
- if ( (aRes = getMenu( aPVMnu )) ) {
+ mySourcesMenuId = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60 );
+ if ( (aRes = getMenu( mySourcesMenuId )) ) {
Implementation->Core.setSourceMenu( aRes );
connect( &Implementation->Core, SIGNAL( enableSourceCreate(bool) ),
aRes, SLOT( setEnabled(bool) ) );
// --- Menu "Filters"
// Install ParaView managers for "Filters" menu
- aPVMnu = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70 );
- if ( (aRes = getMenu( aPVMnu )) ) {
+ myFiltersMenuId = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70 );
+ if ( (aRes = getMenu( myFiltersMenuId )) ) {
Implementation->Core.setFilterMenu( aRes );
connect( &Implementation->Core, SIGNAL( enableFilterCreate(bool) ),
aRes, SLOT( setEnabled(bool) ) );
// --- Toolbar "Active Variable Controls"
aToolId = createTool( tr("TOOL_ACTIVE_VARIABLE_CONTROLS") );
+ QToolBar* aTB = toolMgr()->toolBar( aToolId );
createTool( ShowColorLegendId, aToolId );
colorScale->setRescaleAction( aQtxAction ); /// !!!
createTool( ResetRangeId, aToolId );
+ Implementation->Core.setupVariableToolbar(aTB);
+ QList<QAction*> anActns = aTB->actions();
+ for (int i = 0; i < anActns.size(); ++i)
+ if ( anActns.at(i) != action(ShowColorLegendId) ) {
+ createTool( anActns.at(i), aToolId );
+ connect( &Implementation->Core, SIGNAL( enableVariableToolbar(bool) ),
+ anActns.at(i), SLOT( setEnabled(bool) ) );
+ }
+
// --- Toolbar "Representation"
- QToolBar* aTB = toolMgr()->toolBar( createTool( tr("TOOL_REPRESENTATION") ) );
+ aToolId = createTool( tr("TOOL_REPRESENTATION") );
+ aTB = toolMgr()->toolBar( aToolId );
+
Implementation->Core.setupRepresentationToolbar(aTB);
- QList<QAction*> anActns = aTB->actions();
- for (int i = 0; i < anActns.size(); ++i)
+ anActns = aTB->actions();
+ for (int i = 0; i < anActns.size(); ++i) {
+ createTool( anActns.at(i), aToolId );
connect( &Implementation->Core, SIGNAL( enableVariableToolbar(bool) ),
anActns.at(i), SLOT( setEnabled(bool) ) );
+ }
// --- Toolbar "Camera Controls"
// --- Toolbar "Common Filters"
- aTB = toolMgr()->toolBar( createTool( tr("TOOL_COMMON_FILTERS") ) );
+ aToolId = createTool( tr("TOOL_COMMON_FILTERS") );
+ aTB = toolMgr()->toolBar( aToolId );
+
Implementation->Core.setupCommonFiltersToolbar(aTB);
- //QList<QAction*> anActns = aTB->actions();
- //for (int i = 0; i < anActns.size(); ++i)
- // createTool(anActns.at(i),aToolId); /// !!!
+ anActns = aTB->actions();
+ for (int i = 0; i < anActns.size(); ++i)
+ createTool( anActns.at(i), aToolId );
// --- Toolbar "Lookmarks"
- Implementation->Core.setupLookmarkToolbar(toolMgr()->toolBar(createTool( tr("TOOL_LOOKMARKS") )));
+ aToolId = createTool( tr("TOOL_LOOKMARKS") );
+ aTB = toolMgr()->toolBar(aToolId);
+
+ aTB->setContextMenuPolicy(Qt::CustomContextMenu);
+ aTB->setOrientation(Qt::Vertical);
+ aTB->setAllowedAreas(Qt::RightToolBarArea);
+ toolMgr()->mainWindow()->addToolBar(Qt::RightToolBarArea,aTB);
+ Implementation->Core.setupLookmarkToolbar(aTB);
}
/*!