]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
LC-Import GUI-Wizard #1
authorisn <isn@opencascade.com>
Tue, 20 Oct 2015 12:40:51 +0000 (15:40 +0300)
committerisn <isn@opencascade.com>
Tue, 20 Oct 2015 13:07:35 +0000 (16:07 +0300)
src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h

index 40a4b72146ab32f9d2adea71609f5ddbb78e9987..0e1f4772440cceca7a50447d20381f3d0c4d8aeb 100644 (file)
 #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" ) );
@@ -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()
 {
 }
index 67482a903bb15e2cdab2610e0b18409a0608a884..581956dacd3a5d07fad5c0cbbf77682200bfa01e 100644 (file)
 #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