From: mkr Date: Wed, 3 Dec 2008 11:55:59 +0000 (+0000) Subject: 1) 'Recent Files' submenu is added into 'File' menu. X-Git-Tag: PARAVIS_TEST~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b7e307c703ea8667c7af73f39d02dc66a6e73dd4;p=modules%2Fparavis.git 1) 'Recent Files' submenu is added into 'File' menu. 2) Use QtAssistant to show ParaView help pages (final version). 3) Save positions of toolbars and dockable widgets. --- diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 752c7ea7..20e85cea 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -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(); diff --git a/src/PVGUI/PVGUI_Module_actions.cxx b/src/PVGUI/PVGUI_Module_actions.cxx index 5df5d284..4b5ff1c2 100644 --- a/src/PVGUI/PVGUI_Module_actions.cxx +++ b/src/PVGUI/PVGUI_Module_actions.cxx @@ -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 ); diff --git a/src/PVGUI/PVGUI_Module_impl.h b/src/PVGUI/PVGUI_Module_impl.h index e4684a14..127a601a 100644 --- a/src/PVGUI/PVGUI_Module_impl.h +++ b/src/PVGUI/PVGUI_Module_impl.h @@ -32,6 +32,7 @@ #include #include +#include ////////////////////////////////////////////////////////////////////////////// // 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 AssistantClient; //Ui::MainWindow UI; pqMainWindowCore Core; - //pqRecentFilesMenu* RecentFilesMenu; + pqRecentFilesMenu* RecentFilesMenu; //pqViewMenu* ViewMenu; //pqViewMenu* ToolbarsMenu; //QLineEdit* CurrentTimeWidget; diff --git a/src/PVGUI/PVGUI_Module_widgets.cxx b/src/PVGUI/PVGUI_Module_widgets.cxx index 99188d94..fe50e027 100644 --- a/src/PVGUI/PVGUI_Module_widgets.cxx +++ b/src/PVGUI/PVGUI_Module_widgets.cxx @@ -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 ); diff --git a/src/PVGUI/resources/PARAVIS_msg_en.ts b/src/PVGUI/resources/PARAVIS_msg_en.ts index 9e16f2a4..0f585a35 100644 --- a/src/PVGUI/resources/PARAVIS_msg_en.ts +++ b/src/PVGUI/resources/PARAVIS_msg_en.ts @@ -183,6 +183,10 @@ STB_OPEN_FILE Open File + + MEN_RECENT_FILES + Recent Files + TOP_LOAD_STATE Load State