]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1104 BR_HYDRO_IMPS_WIN
authorisn <isn@opencascade.com>
Thu, 15 Dec 2016 17:19:50 +0000 (20:19 +0300)
committerisn <isn@opencascade.com>
Thu, 15 Dec 2016 17:19:50 +0000 (20:19 +0300)
src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h
src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index d99c13e4a83535de39e21cc95cb03a0a8078bb90..f72601fbd30526b3d8c418031e7e66e7379b2e1f 100644 (file)
@@ -415,6 +415,16 @@ bool HYDROGUI_ImportLandCoverMapDlg::getDbfState() const
   return myDbfState;
 }
 
+void HYDROGUI_ImportLandCoverMapDlg::setDbfRecordsNb(int theRecordsNbs)
+{
+  myDbfRecordsNbs = theRecordsNbs;
+}
+
+int HYDROGUI_ImportLandCoverMapDlg::getDbfRecordsNb() const
+{
+  return myDbfRecordsNbs;
+}
+
 int HYDROGUI_ImportLandCoverMapDlg::getCurrentWizardIndex() const
 {
   return wizard()->currentIndex();
@@ -452,5 +462,10 @@ bool HYDROGUI_ImportLandCoverMapDlg::CheckFirstPageFilling() const
      SUIT_MessageBox::critical( module()->getApp()->desktop(), tr( "DBF_LOAD_ERROR" ), tr("DBF_LOAD_ERR_MESS"));
      return false;
   }
+  if (this->getAttrCheckBoxState() && this->getDbfRecordsNb() == 0)
+  {
+     SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "DBF_NB_RECORDS_IS_NULL" ), tr("DBF_NB_RECORDS_IS_NULL_MESS"));
+     return false;
+  }
   return true;
 }
\ No newline at end of file
index 524f41a65455208e03e61538ae0cf007993059e3..c7378578294a2634fa3d39c662d03cfdcc04230d 100644 (file)
@@ -66,6 +66,10 @@ public:
 
   void                  setDbfState(bool theState);
   bool                  getDbfState() const;
+
+  void                  setDbfRecordsNb(int theRecordsNbs);
+  int                   getDbfRecordsNb() const;
+
   int                   getCurrentWizardIndex() const;
 
   void                  setViewerState(bool theState);
@@ -115,6 +119,7 @@ private:
   bool                  myFirstPageState;
   QVector<QColor>       myStrColors;
   bool                  myDbfState;
+  int                   myDbfRecordsNbs;
 
   bool                  myUpdateViewerState;
 };
index a2d3a09b55c1712992a782b2a07009923d61cb8d..5820dcfaa5c52c659e949e93c3a350ab332391d9 100644 (file)
@@ -188,6 +188,7 @@ void HYDROGUI_ImportLandCoverMapOp::onFileSelected()
       aPanel->setAttributeNames(myFieldList);
     }
     aPanel->setDbfState(DBF_Stat);
+    aPanel->setDbfRecordsNb(myImporter.DBF_GetNbRecords());
   }
   else
   {
index 3d162afbb4d30273465c5b6af9efdfd7f682495b..2dabcab2e592316f4ad69b2d57241504790b28e3 100644 (file)
@@ -2392,6 +2392,11 @@ file cannot be correctly imported for an Obstacle definition.</translation>
       <source>DBF_LOAD_ERROR</source>
       <translation>Cannot load DBF file</translation>
     </message>
+    <message>
+      <source>DBF_NB_RECORDS_IS_NULL</source>
+      <translation>DBF Warning</translation>
+    </message>
+
     <message>
       <source>FILE_ISNT_CHOSEN</source>
       <translation>File isn't chosen</translation>
@@ -2410,6 +2415,12 @@ file cannot be correctly imported for an Obstacle definition.</translation>
       <translation>Cannot open DBF file or it's corrupted</translation>
     </message>
 
+   <message>
+      <source>DBF_NB_RECORDS_IS_NULL_MESS</source>
+      <translation>Cannot use DBF data - number of records is null</translation>
+    </message>
+
+
   </context>
 
   <context>