Salome HOME
PARAVIS HTML docs
[modules/paravis.git] / src / PVGUI / PVGUI_Module_actions.cxx
index 5df5d284115df2eeac8bcc37d3b7762b54e230a2..c2469df2a8084af780c402d8598771111d68c002 100644 (file)
@@ -551,6 +551,18 @@ void PVGUI_Module::pvCreateMenus()
   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 );
@@ -621,8 +633,8 @@ void PVGUI_Module::pvCreateMenus()
 
   // 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) ) );
@@ -631,8 +643,8 @@ void PVGUI_Module::pvCreateMenus()
   // --- 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) ) );
@@ -785,12 +797,16 @@ void PVGUI_Module::pvCreateToolBars()
   
   // --- Toolbar "Representation"
 
-  aTB = toolMgr()->toolBar( createTool( tr("TOOL_REPRESENTATION") ) );
+  aToolId = createTool( tr("TOOL_REPRESENTATION") );
+  aTB = toolMgr()->toolBar( aToolId );
+
   Implementation->Core.setupRepresentationToolbar(aTB);
   anActns = aTB->actions();
-  for (int i = 0; i < anActns.size(); ++i)
+  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"
 
@@ -814,17 +830,23 @@ void PVGUI_Module::pvCreateToolBars()
 
   // --- 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"
 
-  aTB = 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);
 }