]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
1) 'Recent Files' submenu is added into 'File' menu.
authormkr <mkr@opencascade.com>
Wed, 3 Dec 2008 11:55:59 +0000 (11:55 +0000)
committermkr <mkr@opencascade.com>
Wed, 3 Dec 2008 11:55:59 +0000 (11:55 +0000)
2) Use QtAssistant to show ParaView help pages (final version).
3) Save positions of toolbars and dockable widgets.

src/PVGUI/PVGUI_Module.cxx
src/PVGUI/PVGUI_Module_actions.cxx
src/PVGUI/PVGUI_Module_impl.h
src/PVGUI/PVGUI_Module_widgets.cxx
src/PVGUI/resources/PARAVIS_msg_en.ts

index 752c7ea7a1a79ca0f82c69062ae5cc2d5808c024..20e85cea3c1e4f32cb3f8cf693bec1544740e1b7 100644 (file)
@@ -557,31 +557,29 @@ void PVGUI_Module::makeAssistant()
   
   const char* assistantName = "assistant";
 #ifdef WNT
-  const char* extString = ".exe";
   const char* binDir = "\\";
   const char* binDir1 = "\\..\\";
 #else
-  const char* extString = "";
-  const char* binDir = "/";
-  const char* binDir1 = "/";
+  const char* binDir = "/bin/";
+  const char* binDir1 = "/bin/bin/";
 #endif
 
-  QString assistantProgName;
-  assistantProgName = assistantProgName + assistantName + extString;
-
-  QString helper = QCoreApplication::applicationDirPath() + binDir + QString("pqClientDocFinder.txt");
+  QString helper = QString(getenv("PVHOME")) + binDir + QString("pqClientDocFinder.txt");
   if(!QFile::exists(helper))
-    helper = QCoreApplication::applicationDirPath() + binDir1 + QString("pqClientDocFinder.txt");
+    helper = QString(getenv("PVHOME")) + binDir1 + QString("pqClientDocFinder.txt");
   if(QFile::exists(helper)) {
     QFile file(helper);
     if(file.open(QIODevice::ReadOnly)) {
-      assistantExe = file.readLine().trimmed() + assistantProgName;
+      assistantExe = file.readLine().trimmed();
       profileFile = file.readLine().trimmed();
+      // CMake escapes spaces, we need to unescape those.
+      assistantExe.replace("\\ ", " ");
+      profileFile.replace("\\ ", " ");
     }
   }
 
   if(assistantExe.isEmpty()) {
-    assistantExe = ::Locate(assistantProgName);
+    assistantExe = ::Locate(assistantName);//assistantExe = ::Locate(assistantProgName);
     /*
     QString assistant = QCoreApplication::applicationDirPath();
     assistant += QDir::separator();
index 5df5d284115df2eeac8bcc37d3b7762b54e230a2..4b5ff1c279012645ecf04e4891959f2bf3a0bcc7 100644 (file)
@@ -551,6 +551,14 @@ void PVGUI_Module::pvCreateMenus()
   int aPVMnu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1 );
 
   createMenu( OpenFileId, aPVMnu, 5 );
+
+  // Recent Files
+  Implementation->RecentFilesMenu =
+    new pqRecentFilesMenu( *menuMgr()->findMenu( createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 ) ),
+                          getApp()->desktop() );
+  connect( Implementation->RecentFilesMenu, SIGNAL( serverConnectFailed() ),
+          &Implementation->Core,           SLOT( makeDefaultConnectionIfNoneExists() ) );
+
   createMenu( separator(), aPVMnu, -1, 5 );
 
   createMenu( LoadStateId, aPVMnu, 15 );
index e4684a145db348fff253a904e9eea0165040d823..127a601abada6670ed422d970ad88c49d8305834 100644 (file)
@@ -32,6 +32,7 @@
 #include <QPointer>
 
 #include <pqMainWindowCore.h>
+#include <pqRecentFilesMenu.h>
 
 //////////////////////////////////////////////////////////////////////////////
 // PVGUI_Module::pqImplementation
@@ -41,8 +42,8 @@ class PVGUI_Module::pqImplementation
  public:
   pqImplementation(QWidget* parent) :
     AssistantClient(0),
-    Core(parent)//,
-    //RecentFilesMenu(0),
+    Core(parent),
+    RecentFilesMenu(0)//,
     //ViewMenu(0),
     //ToolbarsMenu(0)
   {
@@ -61,7 +62,7 @@ class PVGUI_Module::pqImplementation
   QPointer<QAssistantClient> AssistantClient;
   //Ui::MainWindow UI;
   pqMainWindowCore Core;
-  //pqRecentFilesMenu* RecentFilesMenu;
+  pqRecentFilesMenu* RecentFilesMenu;
   //pqViewMenu* ViewMenu;
   //pqViewMenu* ToolbarsMenu;
   //QLineEdit* CurrentTimeWidget;
index 99188d9406de4fa2bcdd3aba471853d4fb07fe5e..fe50e027bf8471fc57603fb4109f80c4662e378a 100644 (file)
@@ -51,6 +51,7 @@ void PVGUI_Module::setupDockWidgets()
 
   // See ParaView src/Applications/Client/MainWindow.cxx
   QDockWidget* pipelineBrowserDock = new QDockWidget( tr( "Pipeline Browser" ), desk );
+  pipelineBrowserDock->setObjectName("pipelineBrowserDock");
   pipelineBrowserDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
   desk->addDockWidget( Qt::LeftDockWidgetArea, pipelineBrowserDock );
   Implementation->Core.setupPipelineBrowser( pipelineBrowserDock );
@@ -58,6 +59,7 @@ void PVGUI_Module::setupDockWidgets()
   Implementation->Core.pipelineMenu().setModels(browser->getModel(), browser->getSelectionModel());
 
   QDockWidget* objectInspectorDock = new QDockWidget( tr( "Object Inspector" ), desk );
+  objectInspectorDock->setObjectName("objectInspectorDock");
   objectInspectorDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
   desk->addDockWidget( Qt::LeftDockWidgetArea, objectInspectorDock );
   pqProxyTabWidget* const proxyTab = Implementation->Core.setupProxyTabWidget( objectInspectorDock );
@@ -69,16 +71,19 @@ void PVGUI_Module::setupDockWidgets()
           this,                           SLOT( onPostAccept() ) );
   
   QDockWidget* statisticsViewDock  = new QDockWidget( tr( "Statistics View" ), desk );
+  statisticsViewDock->setObjectName("statisticsViewDock");
   statisticsViewDock->setAllowedAreas( Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
   desk->addDockWidget( Qt::BottomDockWidgetArea, statisticsViewDock );
   Implementation->Core.setupStatisticsView( statisticsViewDock );
 
   QDockWidget* animationPanelDock  = new QDockWidget( tr( "Animation Inspector" ), desk );
+  animationPanelDock->setObjectName("animationPanelDock");
   desk->addDockWidget( Qt::LeftDockWidgetArea, animationPanelDock );
   pqAnimationPanel* animation_panel = Implementation->Core.setupAnimationPanel( animationPanelDock );
   animation_panel->setCurrentTimeToolbar(toolMgr()->toolBar(createTool( tr("TOOL_CURRENT_TIME_CONTROLS") )));
 
   QDockWidget* lookmarkBrowserDock = new QDockWidget( tr( "Lookmark Browser" ), desk );
+  lookmarkBrowserDock->setObjectName("lookmarkBrowserDock");
   QSizePolicy sp( QSizePolicy::Preferred, QSizePolicy::Preferred );
   sp.setHorizontalStretch( 0 );
   sp.setVerticalStretch( 0 );
@@ -88,20 +93,24 @@ void PVGUI_Module::setupDockWidgets()
   Implementation->Core.setupLookmarkBrowser( lookmarkBrowserDock );
 
   QDockWidget* lookmarkInspectorDock = new QDockWidget( tr( "Lookmark Inspector" ), desk );
+  lookmarkInspectorDock->setObjectName("lookmarkInspectorDock");
   lookmarkInspectorDock->setAllowedAreas( Qt::RightDockWidgetArea );
   desk->addDockWidget( Qt::RightDockWidgetArea, lookmarkInspectorDock );
   Implementation->Core.setupLookmarkInspector( lookmarkInspectorDock );
 
   QDockWidget* comparativePanelDock  = new QDockWidget( tr( "Comparative View Inspector" ), desk );
+  comparativePanelDock->setObjectName("comparativePanelDock");
   desk->addDockWidget( Qt::LeftDockWidgetArea, comparativePanelDock );
   pqComparativeVisPanel* cv_panel    = new pqComparativeVisPanel( comparativePanelDock );
   comparativePanelDock->setWidget(cv_panel);
 
   QDockWidget* animationViewDock     = new QDockWidget( tr( "Animation View" ), desk );
+  animationViewDock->setObjectName("animationViewDock");
   desk->addDockWidget( Qt::BottomDockWidgetArea, animationViewDock );
   Implementation->Core.setupAnimationView( animationViewDock );
 
   QDockWidget* selectionInspectorDock = new QDockWidget( tr( "Selection Inspector" ), desk );
+  selectionInspectorDock->setObjectName("selectionInspectorDock");
   selectionInspectorDock->setAllowedAreas( Qt::AllDockWidgetAreas );
   desk->addDockWidget( Qt::LeftDockWidgetArea, selectionInspectorDock );
   Implementation->Core.setupSelectionInspector( selectionInspectorDock );
index 9e16f2a481b8fa5ce07cc23d00cd32f1ab46cd41..0f585a350259779217bc89acfd32ddcd0c964d2f 100644 (file)
         <source>STB_OPEN_FILE</source>
         <translation>Open File</translation>
     </message>
+    <message>
+        <source>MEN_RECENT_FILES</source>
+        <translation>Recent Files</translation>
+    </message>
     <message>
         <source>TOP_LOAD_STATE</source>
         <translation>Load State</translation>