From 883fcee9452fd4ac5e854e08551703e6dbc6678f Mon Sep 17 00:00:00 2001 From: isn Date: Tue, 20 Oct 2015 15:40:51 +0300 Subject: [PATCH] LC-Import GUI-Wizard #1 --- src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx | 61 +++++++++++++++++--- src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h | 13 ++++- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx index 40a4b721..0e1f4772 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx @@ -24,14 +24,23 @@ #include #include #include +#include #include #include #include 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" ) ); @@ -62,7 +71,7 @@ HYDROGUI_ImportLandCoverDlg::HYDROGUI_ImportLandCoverDlg( HYDROGUI_Module* theMo 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 ); @@ -72,17 +81,55 @@ HYDROGUI_ImportLandCoverDlg::HYDROGUI_ImportLandCoverDlg( HYDROGUI_Module* theMo 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() { } diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h b/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h index 67482a90..581956da 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h @@ -20,13 +20,13 @@ #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 @@ -62,6 +62,10 @@ public slots: void onItemSelectionChanged(); private: + + QWizardPage* createPage1(); + QWizardPage* createPage2(); + QLineEdit* myFileName; QGroupBox* myFileNameGroup; QListWidget* myPolygons; @@ -69,6 +73,11 @@ private: QGroupBox* myObjectNameGroup; QLineEdit* myObjectName; + //second page + QGroupBox* myAttrNameGroup; + QListWidget* myDBFAttr; + + }; #endif -- 2.39.2