Salome HOME
refs #550: fix crash when myObject is NULL
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationDlg.cxx
index 0718b48b3858ad1c74525bcd46b00278ee877501..c23683e9ac1c16eccefef716e6131012acc106fe 100644 (file)
@@ -1,8 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
@@ -338,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;
 }
@@ -412,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();
@@ -736,5 +738,10 @@ void  HYDROGUI_CalculationDlg::setRules( const HYDROData_ListOfRules& theRules )
  */
 void HYDROGUI_CalculationDlg::onOrderChanged()
 {
-  myPriorityWidget->setObjects( getGeometryObjects() );
-}
\ No newline at end of file
+  bool isConfirmed = true;
+  emit orderChanged( isConfirmed );
+  if( isConfirmed )
+    myPriorityWidget->setObjects( getGeometryObjects() );
+  else
+    myGeomObjects->undoLastMove();
+}