+
+
+bool HYDROGUI_ImportLandCoverMapDlg::acceptCurrent() const
+{
+ //Check the state of the current page
+ int aCurrPage = getCurrentWizardIndex();
+ switch ( aCurrPage )
+ {
+ case 0:
+ {
+ //this method verifies first page
+ if (!CheckFirstPageFilling())
+ return false;
+ break;
+ }
+ case 1:
+ {
+ if (myDBFAttrListWidget->selectedItems().empty())
+ {
+ SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "LCM_IMPORT_WARNING" ), tr ("ATTRS_ISNT_SELECTED"));
+ return false;
+ }
+ break;
+ }
+ case 2: //last page
+ {
+ if (this->isPolygonListEmpty())
+ {
+ SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "LCM_IMPORT_WARNING" ), tr("POLYGONS_ISNT_SELECTED"));
+ return false;
+ }
+ break;
+ }
+ default:
+ return false;
+ }
+ return true;
+}
+
+void HYDROGUI_ImportLandCoverMapDlg::getValAttr2StricklerTypeCorr(QStringList& theAttrValues, QStringList& theST)
+{
+ int aRowCount = myCorrTableWidget->rowCount();
+ for (int i = 0; i < aRowCount; i++)
+ {
+ QTableWidgetItem* aTWI = myCorrTableWidget->item(i, 0);
+ theAttrValues.push_back(aTWI->text());
+ }
+
+ for (int i = 0; i < aRowCount; i++)
+ {
+ QWidget* aW = myCorrTableWidget->cellWidget(i, 1);
+ QComboBox* aCB = dynamic_cast<QComboBox*> (aW);
+ theST.push_back(aCB->currentText());
+ }
+}
+
+
+QVector<int> HYDROGUI_ImportLandCoverMapDlg::getSelectedPolygonIndices() const
+{
+ QVector<int> aSelectedIndices;
+
+ QModelIndexList aSelectedItems = myPolygonsListWidget->selectionModel()->selectedIndexes();
+ foreach( QModelIndex index, aSelectedItems ) {
+ aSelectedIndices << index.row();
+ }
+
+ return aSelectedIndices;
+}
+
+void HYDROGUI_ImportLandCoverMapDlg::onAttrCBChecked( bool theState )
+{
+ if (theState)
+ SetButtonsState ( false );
+ else
+ SetButtonsState ( true );
+}
+
+bool HYDROGUI_ImportLandCoverMapDlg::getAttrCheckBoxState() const
+{
+ return myAttrCheckBox->isChecked();
+}
+
+void HYDROGUI_ImportLandCoverMapDlg::onComboBoxColorChanged(int theInd)
+{
+ QComboBox* CB = qobject_cast<QComboBox*> (myCorrTableWidget->cellWidget(theInd, 1));
+ int aCurIndOfCB = CB->currentIndex();
+ myCorrTableWidget->item(theInd, 2)->setBackground(myStrColors[aCurIndOfCB]);
+}
+
+void HYDROGUI_ImportLandCoverMapDlg::setDbfState(bool theState)
+{
+ myDbfState = theState;
+}
+
+bool HYDROGUI_ImportLandCoverMapDlg::getDbfState() const
+{
+ return myDbfState;
+}
+
+int HYDROGUI_ImportLandCoverMapDlg::getCurrentWizardIndex() const
+{
+ return wizard()->currentIndex();
+}
+
+void HYDROGUI_ImportLandCoverMapDlg::setViewerState(bool theState)
+{
+ myUpdateViewerState = theState;
+}
+
+bool HYDROGUI_ImportLandCoverMapDlg::getViewerState() const
+{
+ return myUpdateViewerState;
+}
+
+bool HYDROGUI_ImportLandCoverMapDlg::isPolygonListEmpty() const
+{
+ return myPolygonsListWidget->selectedItems().empty();
+}
+
+bool HYDROGUI_ImportLandCoverMapDlg::CheckFirstPageFilling() const
+{
+ if (!this->getFirstPageState())
+ {
+ SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "LCM_IMPORT_WARNING" ), tr("FILE_ISNT_CHOSEN"));
+ return false;
+ }
+ if (this->isPolygonListEmpty())
+ {
+ SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "LCM_IMPORT_WARNING" ), tr("POLYGONS_ISNT_SELECTED"));
+ return false;
+ }
+ if (this->getAttrCheckBoxState() && !this->getDbfState())
+ {
+ SUIT_MessageBox::critical( module()->getApp()->desktop(), tr( "DBF_LOAD_ERROR" ), tr("DBF_LOAD_ERR_MESS"));
+ return false;
+ }
+ return true;
+}
\ No newline at end of file