From: vsv Date: Mon, 20 Jun 2005 13:31:22 +0000 (+0000) Subject: "Open with" functionality named as "Activate Module" X-Git-Tag: T3_0_0_a4~69 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2be8b9e24a79876f0039eaf6f26052ca8b37510d;p=modules%2Fgui.git "Open with" functionality named as "Activate Module" --- 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"