From: isn Date: Thu, 15 Dec 2016 17:19:50 +0000 (+0300) Subject: refs #1104 X-Git-Tag: Salome_8_3_Hydro_1_1rc1~63^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=db4df10d85e1808b95f1f68b358e7b3ddf8d360b;p=modules%2Fhydro.git refs #1104 --- diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx index d99c13e4..f72601fb 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx @@ -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 diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h index 524f41a6..c7378578 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h @@ -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 myStrColors; bool myDbfState; + int myDbfRecordsNbs; bool myUpdateViewerState; }; diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx index a2d3a09b..5820dcfa 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx @@ -188,6 +188,7 @@ void HYDROGUI_ImportLandCoverMapOp::onFileSelected() aPanel->setAttributeNames(myFieldList); } aPanel->setDbfState(DBF_Stat); + aPanel->setDbfRecordsNb(myImporter.DBF_GetNbRecords()); } else { diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 3d162afb..2dabcab2 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -2392,6 +2392,11 @@ file cannot be correctly imported for an Obstacle definition. DBF_LOAD_ERROR Cannot load DBF file + + DBF_NB_RECORDS_IS_NULL + DBF Warning + + FILE_ISNT_CHOSEN File isn't chosen @@ -2410,6 +2415,12 @@ file cannot be correctly imported for an Obstacle definition. Cannot open DBF file or it's corrupted + + DBF_NB_RECORDS_IS_NULL_MESS + Cannot use DBF data - number of records is null + + +