From 2be8b9e24a79876f0039eaf6f26052ca8b37510d Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 20 Jun 2005 13:31:22 +0000 Subject: [PATCH] "Open with" functionality named as "Activate Module" --- src/SalomeApp/SalomeApp_Application.cxx | 16 ++++++++++++++++ src/SalomeApp/SalomeApp_Application.h | 1 + src/SalomeApp/resources/SalomeApp_msg_en.po | 3 +++ 3 files changed, 20 insertions(+) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 719b2f8c1..d79353718 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -582,6 +582,21 @@ void SalomeApp_Application::onRefresh() updateObjectBrowser( true ); } + +void SalomeApp_Application::onOpenWith() +{ + QApplication::setOverrideCursor( Qt::waitCursor ); + SALOME_ListIO aList; + SalomeApp_SelectionMgr* mgr = selectionMgr(); + mgr->selectedObjects(aList); + if (aList.Extent() > 1) return; + Handle(SALOME_InteractiveObject) aIObj = aList.First(); + QString aModuleName(aIObj->getComponentDataType()); + QString aModuleTitle = moduleTitle(aModuleName); + activateModule(aModuleTitle); + QApplication::restoreOverrideCursor(); +} + void SalomeApp_Application::setActiveStudy( SUIT_Study* study ) { CAM_Application::setActiveStudy( study ); @@ -1432,6 +1447,7 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t CAM_Application::contextMenuPopup( type, thePopup, title ); thePopup->insertSeparator(); thePopup->insertItem( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) ); + thePopup->insertItem( tr( "MEN_OPENWITH" ), this, SLOT( onOpenWith() ) ); } void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 622095e45..459491f39 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -161,6 +161,7 @@ private slots: void onMRUActivated( QString ); void onPreferenceChanged( QString&, QString&, QString& ); + void onOpenWith(); private: void updateWindows(); diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.po b/src/SalomeApp/resources/SalomeApp_msg_en.po index 7828472ee..43ed605f8 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.po +++ b/src/SalomeApp/resources/SalomeApp_msg_en.po @@ -116,6 +116,9 @@ msgstr "Edits study properties" msgid "SalomeApp_Application::MEN_REFRESH" msgstr "Refresh" +msgid "SalomeApp_Application::MEN_OPENWITH" +msgstr "Activate Module" + //======================================================================================= msgid "SalomeApp_Application::MEN_WINDOWS_NEW" -- 2.39.2