#include <QListWidget>
#include <QVBoxLayout>
#include <QToolButton>
+#include <QCheckBox>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SUIT_FileDlg.h>
HYDROGUI_ImportLandCoverDlg::HYDROGUI_ImportLandCoverDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
+: HYDROGUI_Wizard( theModule, theTitle )
{
+ addPage( createPage1() );
+ addPage( createPage2() );
+}
+
+QWizardPage* HYDROGUI_ImportLandCoverDlg::createPage1() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
myFileNameGroup = new QGroupBox( tr( "IMPORT_LANDCOVER_FROM_FILE" ) );
aLandcoverNameLayout->addWidget( aLandcoverNameLabel );
aLandcoverNameLayout->addWidget( myObjectName );
- QGroupBox* aPolygonsGroup = new QGroupBox( tr( "FOUNDED_POLYGONS" ), mainFrame() );
+ QGroupBox* aPolygonsGroup = new QGroupBox( tr( "FOUNDED_POLYGONS" ) );
myPolygons = new QListWidget( aPolygonsGroup );
myPolygons->setSelectionMode( QListWidget::ExtendedSelection );
myPolygons->setEditTriggers( QListWidget::NoEditTriggers );
QBoxLayout* aPolygonsLayout = new QVBoxLayout;
aPolygonsLayout->addWidget( myPolygons );
aPolygonsGroup->setLayout( aPolygonsLayout );
-
+
// Layout
- addWidget( myFileNameGroup );
- addWidget( myObjectNameGroup );
- addWidget( aPolygonsGroup );
+ QVBoxLayout* aPageLayout = new QVBoxLayout;
+ aPageLayout->setMargin( 5 );
+ aPageLayout->setSpacing( 5 );
+ aPageLayout->addWidget( myFileNameGroup );
+ aPageLayout->addWidget( myObjectNameGroup );
+ aPageLayout->addWidget( aPolygonsGroup );
+ aPage->setLayout( aPageLayout );
// Conections
connect( myPolygons, SIGNAL( itemSelectionChanged() ), this, SLOT( onItemSelectionChanged() ) );
- connect( aBrowseBtn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
+ connect( aBrowseBtn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
+
+ return aPage;
}
+QWizardPage* HYDROGUI_ImportLandCoverDlg::createPage2() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
+ myAttrNameGroup = new QGroupBox( "Available attributes" );
+
+ QCheckBox* anAttrCheckBox = new QCheckBox( "Use dBase attributes as a Strickler Types", myAttrNameGroup );
+
+ QBoxLayout* aFileNameLayout = new QHBoxLayout( myAttrNameGroup );
+ aFileNameLayout->setMargin( 5 );
+ aFileNameLayout->setSpacing( 5 );
+ aFileNameLayout->addWidget( anAttrCheckBox );
+
+
+ myDBFAttr = new QListWidget( aPage );
+ myDBFAttr->setSelectionMode( QListWidget::ExtendedSelection );
+ myDBFAttr->setEditTriggers( QListWidget::NoEditTriggers );
+ myDBFAttr->setViewMode( QListWidget::ListMode );
+ myDBFAttr->setSortingEnabled( false );
+
+ // Layout
+ QVBoxLayout* aPageLayout = new QVBoxLayout;
+ aPageLayout->setMargin( 5 );
+ aPageLayout->setSpacing( 5 );
+ aPageLayout->addWidget( myAttrNameGroup );
+ aPageLayout->addWidget( myDBFAttr );
+ aPage->setLayout( aPageLayout );
+ return aPage;
+}
+
+
+
HYDROGUI_ImportLandCoverDlg::~HYDROGUI_ImportLandCoverDlg()
{
}
#ifndef HYDROGUI_ImportLandCoverDlg_H
#define HYDROGUI_ImportLandCoverDlg_H
-#include "HYDROGUI_InputPanel.h"
+#include "HYDROGUI_Wizard.h"
class QListWidget;
class QLineEdit;
class QGroupBox;
-class HYDROGUI_ImportLandCoverDlg : public HYDROGUI_InputPanel
+class HYDROGUI_ImportLandCoverDlg : public HYDROGUI_Wizard
{
Q_OBJECT
void onItemSelectionChanged();
private:
+
+ QWizardPage* createPage1();
+ QWizardPage* createPage2();
+
QLineEdit* myFileName;
QGroupBox* myFileNameGroup;
QListWidget* myPolygons;
QGroupBox* myObjectNameGroup;
QLineEdit* myObjectName;
+ //second page
+ QGroupBox* myAttrNameGroup;
+ QListWidget* myDBFAttr;
+
+
};
#endif