]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
"Open with" functionality named as "Activate Module"
authorvsv <vsv@opencascade.com>
Mon, 20 Jun 2005 13:31:22 +0000 (13:31 +0000)
committervsv <vsv@opencascade.com>
Mon, 20 Jun 2005 13:31:22 +0000 (13:31 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/resources/SalomeApp_msg_en.po

index 719b2f8c1ea6621701e715acf428bcfc477c5a33..d79353718785be02a6a0cf7921ea4be8092130b5 100644 (file)
@@ -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 )
index 622095e45729139e85b2ce169adbee23b373373a..459491f39365a18e8f460b095b1267fafcb27792 100644 (file)
@@ -161,6 +161,7 @@ private slots:
   void                                onMRUActivated( QString );
 
   void                                onPreferenceChanged( QString&, QString&, QString& );
+  void                                onOpenWith();
 
 private:
   void                                updateWindows();
index 7828472ee70e292c8b0cd9cf86cd31052b7982cd..43ed605f841c11b96d93997895a7a32dbd63a51c 100644 (file)
@@ -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"