]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #534: creation of a new region via popup
authorasl <asl@opencascade.com>
Tue, 19 May 2015 12:56:59 +0000 (15:56 +0300)
committerasl <asl@opencascade.com>
Tue, 19 May 2015 12:56:59 +0000 (15:56 +0300)
src/HYDROGUI/HYDROGUI_CalculationDlg.cxx
src/HYDROGUI/HYDROGUI_CalculationDlg.h
src/HYDROGUI/HYDROGUI_DataBrowser.cxx
src/HYDROGUI/HYDROGUI_DataBrowser.h
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 8bd9bfa84248ece8d63e536b2916f8b2c5f0902f..49d6188827c69f86837afd2322ef17ba0e9c8110 100644 (file)
@@ -334,6 +334,7 @@ QWizardPage* HYDROGUI_CalculationDlg::createZonesPage() {
   connect( myBrowser, 
       SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
       SLOT( onZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
+  connect( myBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewRegion() ) );
 
   return aPage;
 }
@@ -408,6 +409,11 @@ void HYDROGUI_CalculationDlg::onZonesDropped( const QList<SUIT_DataObject*>& the
   }
 }
 
+void HYDROGUI_CalculationDlg::OnNewRegion()
+{
+  emit createRegion( myBrowser->getSelected() );
+}
+
 void HYDROGUI_CalculationDlg::onMergeTypeSelected( int theIndex )
 {
   int aType = myBathymetryChoice->itemData( theIndex ).toInt();
@@ -733,4 +739,4 @@ void  HYDROGUI_CalculationDlg::setRules( const HYDROData_ListOfRules& theRules )
 void HYDROGUI_CalculationDlg::onOrderChanged()
 {
   myPriorityWidget->setObjects( getGeometryObjects() );
-}
\ No newline at end of file
+}
index ba2fb2cbd9e36f1bc58dc27a1a44b28b8f12dd9e..3578ec12aa9cd4581e83babe715df5b670c1cb0c 100644 (file)
@@ -123,6 +123,9 @@ protected:
 
   virtual bool               acceptCurrent() const;
 
+protected slots:
+  void OnNewRegion();
+
 private:
   QList<Handle(HYDROData_Object)> getGeometryObjects();
 
index e213ea2e905a25e861c975cd433ca215d8834b2d..4a553e045db07a6f924de937252923a98a19c5b9 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <QObject>
 #include <QShortcut>
+#include <QMenu>
 
 class SUIT_DataBrowser;
 class LightApp_DataObject;
@@ -274,7 +275,7 @@ HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, SUIT_Dat
   treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH);
   treeView()->hideColumn( SUIT_DataObject::VisibilityId );
   treeView()->hideColumn( LightApp_DataObject::EntryId );
-  //RKV: connectPopupRequest( theModule->getApp(), SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
+  connectPopupRequest( theModule->getApp(), SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
 }
 
 HYDROGUI_DataBrowser::~HYDROGUI_DataBrowser()
@@ -316,4 +317,10 @@ void HYDROGUI_DataBrowser::setReadOnly( const bool theIsReadOnly )
       aShortcut->setEnabled( !theIsReadOnly );
     }
   }
-}
\ No newline at end of file
+}
+
+void HYDROGUI_DataBrowser::createPopupMenu( QMenu* theMenu )
+{
+  theMenu->clear();
+  theMenu->addAction( tr( "ZONE_TO_NEW_REGION" ), this, SIGNAL( newRegion() ) );
+}
index adbf77d791638721ca49808f7f68eebe9e4a95dd..decdcbed02195f146a31d583760474326dc157fa 100644 (file)
@@ -49,8 +49,13 @@ public:
 
 signals:
   void             dropped( const QList<SUIT_DataObject*>& theList, 
-    SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
+                            SUIT_DataObject* theTargetParent,
+                            int theTargetRow, Qt::DropAction theDropAction );
   void             dataChanged();
+  void             newRegion();
+
+protected:
+  virtual void createPopupMenu( QMenu* );
 
 private:
   HYDROGUI_Module* myModule;
index 996a948d956ad7d6056eb80241baa2d65cbcc657..180ef84214bc395fc161eef28628f37e8181f4b7 100644 (file)
@@ -349,6 +349,10 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <source>ALTITUDE_COLUMN</source>
       <translation>Altitude.Object</translation>
     </message>
+    <message>
+      <source>ZONE_TO_NEW_REGION</source>
+      <translation>Create a new region</translation>
+    </message>
   </context>
 
   <context>