#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SUIT_FileDlg.h>
-
+#include <HYDROGUI_Module.h>
+#include <SUIT_MessageBox.h>
+#include <LightApp_Application.h>
#include <QTableWidget>
#include <QHeaderView>
#include <QComboBox>
+#include <QStackedWidget>
HYDROGUI_ImportLandCoverMapDlg::HYDROGUI_ImportLandCoverMapDlg( HYDROGUI_Module* theModule, const QString& theTitle )
: HYDROGUI_Wizard( theModule, theTitle )
addPage( createPage1() );
addPage( createPage2() );
addPage( createPage3() );
+ myFirstPageState = false;
}
QWizardPage* HYDROGUI_ImportLandCoverMapDlg::createPage1() {
myDBFAttr->addItems( theAttrNames );
}
-void HYDROGUI_ImportLandCoverMapDlg::removePolygonNames( const QStringList& theNames )
+/*void HYDROGUI_ImportLandCoverMapDlg::removePolygonNames( const QStringList& theNames )
{
QList<QListWidgetItem*> aFoundItems;
delete anItem;
}
}
-}
+}*/
void HYDROGUI_ImportLandCoverMapDlg::setSelectedPolygonNames( const QStringList& theNames )
{
{
return myDBFAttr->selectedItems().first()->text();
}
+
+void HYDROGUI_ImportLandCoverMapDlg::setFirstPageState(bool bState)
+{
+ myFirstPageState = bState;
+}
+
+bool HYDROGUI_ImportLandCoverMapDlg::acceptCurrent() const
+{
+ //Check the state of curent page
+ int CurrPage = wizard()->currentIndex();
+ switch ( CurrPage )
+ {
+ case 0:
+ {
+ if (!myFirstPageState)
+ return false;
+ break;
+ }
+ case 1:
+ {
+ if (this->myDBFAttr->selectedItems().empty())
+ return false;
+ break;
+ }
+ default:
+ return false;
+ }
+ return true;
+
+}
+
+void HYDROGUI_ImportLandCoverMapDlg::GetAttribute2StricklerCorr(QStringList& AttrValues, QStringList& ST)
+{
+ int aRowCount = myTableW->rowCount();
+ for (int i = 0; i < aRowCount; i++)
+ {
+ QTableWidgetItem* aTWI = myTableW->item(i, 0);
+ AttrValues.push_back(aTWI->text());
+ }
+
+ for (int i = 0; i < aRowCount; i++)
+ {
+ QWidget* aW = myTableW->cellWidget(i, 1);
+ QComboBox* aCB = dynamic_cast<QComboBox*> (aW);
+ ST.push_back(aCB->currentText());
+ }
+}
+
+
+QVector<int> HYDROGUI_ImportLandCoverMapDlg::getSelectedPolygonIndices() const
+{
+ QVector<int> aSelectedIndices;
+
+ QModelIndexList aSelectedItems = myPolygons->selectionModel()->selectedIndexes();
+ foreach( QModelIndex index, aSelectedItems ) {
+ aSelectedIndices << index.row();
+ }
+
+ return aSelectedIndices;
+}
\ No newline at end of file