Salome HOME
bug #702
authorisn <isn@opencascade.com>
Tue, 17 Nov 2015 12:49:22 +0000 (15:49 +0300)
committerisn <isn@opencascade.com>
Tue, 17 Nov 2015 12:49:22 +0000 (15:49 +0300)
src/HYDROData/HYDROData_LandCoverMap.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h
src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 1187916c6dbf3742c3dd1183261a87c6154a517d..33a705cd434ca9dc6ba2940c3d3350c118eb910d 100644 (file)
@@ -939,7 +939,7 @@ QStringList HYDROData_LandCoverMap::DumpToPython( const QString&       thePyScri
   QString aDbfFileName = thePyScriptPath;
   aDbfFileName.replace( ".py", ".dbf" );
 
-  ExportSHP( aShpFileName, true, 1 );
+  ExportSHP( aShpFileName, true, 0.1 );
 
   QString anAttr = "CODE_06"; //TODO: some custom choice
   QStringList anAttrValues, aTypes;
index 82e4b9d703bf2c846b771be3e8d2606d296cc23e..134239b8282cdccd24e5258fff55a6f45c1913c6 100644 (file)
@@ -83,7 +83,7 @@ QWizardPage* HYDROGUI_ImportLandCoverMapDlg::createPage1() {
   aLandcoverNameLayout->addWidget( aLandcoverNameLabel );
   aLandcoverNameLayout->addWidget( myObjectName );
 
-  QGroupBox* aPolygonsGroup = new QGroupBox( tr( "FOUNDED_POLYGONS" ) );
+  QGroupBox* aPolygonsGroup = new QGroupBox( tr( "FOUND_POLYGONS" ) );
   myPolygonsListWidget = new QListWidget( aPolygonsGroup );
   myPolygonsListWidget->setSelectionMode( QListWidget::ExtendedSelection );
   myPolygonsListWidget->setEditTriggers( QListWidget::NoEditTriggers );
@@ -196,8 +196,10 @@ void HYDROGUI_ImportLandCoverMapDlg::setSelectedPolygonNames( const QStringList&
 }
 
 void HYDROGUI_ImportLandCoverMapDlg::onItemSelectionChanged()
-{
-  emit selectionChanged( getSelectedPolygonNames() );
+{ 
+  int aCurIndex = GetCurrentWizardIndex();
+  if (aCurIndex == 0)
+    emit selectionChanged( getSelectedPolygonNames() );
 }
 
 QStringList HYDROGUI_ImportLandCoverMapDlg::getSelectedPolygonNames() const
@@ -310,7 +312,7 @@ void HYDROGUI_ImportLandCoverMapDlg::setFirstPageState(bool theState)
 bool HYDROGUI_ImportLandCoverMapDlg::acceptCurrent() const
 {
   //Check the state of the current page
-  int aCurrPage = wizard()->currentIndex();
+  int aCurrPage = GetCurrentWizardIndex();
   switch ( aCurrPage )
   {
     case 0:
@@ -341,6 +343,15 @@ bool HYDROGUI_ImportLandCoverMapDlg::acceptCurrent() const
       }
       break;
     }
+    case 2: //last page
+    {
+      if (myPolygonsListWidget->selectedItems().empty())
+      {
+        SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "LCM_IMPORT_WARNING" ), tr("POLYGONS_ISNT_SELECTED"));
+        return false;
+      }
+      break;
+    }
     default:
      return false;
   }
@@ -405,4 +416,9 @@ void HYDROGUI_ImportLandCoverMapDlg::setDbfState(bool theState)
 bool HYDROGUI_ImportLandCoverMapDlg::getDbfState() const
 {
   return myDbfState;
+}
+
+int HYDROGUI_ImportLandCoverMapDlg::GetCurrentWizardIndex() const
+{
+  return wizard()->currentIndex();
 }
\ No newline at end of file
index e7992563e586a2e349dd18b6b1964412f9c1d8c5..2e7a7c0d08c9754a8c1c59ffe412a09d16bf366e 100644 (file)
@@ -62,6 +62,7 @@ public:
 
   void                  setDbfState(bool theState);
   bool                  getDbfState() const;
+  int                   GetCurrentWizardIndex() const;
 
   void                  FillCorrespondenceTable(const QStringList& theFirstColumn, 
                                                 const QStringList& theSecondColumn,
index 3e77bd374e1adc2b21688298ea200698fa9efa6f..5f35ec26ead97c9ef8f2a90cb63d78058c17399b 100644 (file)
@@ -330,6 +330,12 @@ void HYDROGUI_ImportLandCoverMapOp::onViewerSelectionChanged()
   if ( !aPanel )
     return;
 
+  int aCurIndex = -1;
+  aCurIndex = aPanel->GetCurrentWizardIndex();
+
+  if (aCurIndex != 0)
+    return;
+
   OCCViewer_ViewManager* aViewManager = getPreviewManager();
   Handle(AIS_InteractiveContext) aCtx = NULL;
   if ( aViewManager ) {
index cf5b2b4de5aa950fb54b27683db4af16538c75e5..16d67a97c45b854ea73aa941cbe363ed2ad6f3de 100644 (file)
@@ -2334,8 +2334,8 @@ file cannot be correctly imported for an Obstacle definition.</translation>
       <translation>Name</translation>
     </message>
     <message>
-      <source>FOUNDED_POLYGONS</source>
-      <translation>Founded polygons:</translation>
+      <source>FOUND_POLYGONS</source>
+      <translation>Found polygons:</translation>
     </message>
     <message>
       <source>USE_DBF_AS_ST</source>