+QWizardPage* HYDROGUI_CalculationDlg::createLandCoversPage() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
+ // Splitter
+ myLandCoverSplitter = new QSplitter(Qt::Vertical);
+
+ // Top of the page
+ QWidget* aTopContainer = new QWidget;
+
+ // Combo-box to choose Strickler table name
+ QLabel* aStricklerTableLabel = new QLabel( tr( "STRICKLER_TABLE" ), aPage );
+ myStricklerTableName = new QComboBox( aPage );
+ myStricklerTableName->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ connect( myStricklerTableName, SIGNAL( activated( const QString & ) ),
+ SIGNAL( StricklerTableSelected( const QString & ) ) );
+
+ // Mode selector (auto/manual)
+ QGroupBox* aModeGroup = new QGroupBox( tr( "MODE" ) );
+
+ QRadioButton* aManualRB = new QRadioButton( tr( "MANUAL" ), mainFrame() );
+ QRadioButton* anAutoRB = new QRadioButton( tr( "AUTO" ), mainFrame() );
+
+ myLandCoverModeButtons = new QButtonGroup( mainFrame() );
+ myLandCoverModeButtons->addButton( anAutoRB, HYDROData_CalculationCase::AUTOMATIC );
+ myLandCoverModeButtons->addButton( aManualRB, HYDROData_CalculationCase::MANUAL );
+
+ QBoxLayout* aModeSelectorLayout = new QHBoxLayout;
+ aModeSelectorLayout->setMargin( 5 );
+ aModeSelectorLayout->setSpacing( 5 );
+ aModeSelectorLayout->addWidget( anAutoRB );
+ aModeSelectorLayout->addWidget( aManualRB );
+ aModeGroup->setLayout( aModeSelectorLayout );
+
+ // Available land covers
+ QLabel* aLandCoversLabel = new QLabel( tr( "CALCULATION_REFERENCE_LAND_COVERS" ) );
+ myAvailableLandCovers = new QListWidget( aPage );
+ myAvailableLandCovers->setSelectionMode( QListWidget::ExtendedSelection );
+ myAvailableLandCovers->setEditTriggers( QListWidget::NoEditTriggers );
+ myAvailableLandCovers->setViewMode( QListWidget::ListMode );
+ myAvailableLandCovers->setSortingEnabled( true );
+
+ // Included land covers
+ QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_LAND_COVERS" ) );
+ myLandCovers = new HYDROGUI_OrderedListWidget( aPage, 16 );
+ myLandCovers->setHiddenObjectsShown(true);
+ myLandCovers->setVisibilityIconShown(false);
+ myLandCovers->setContentsMargins(QMargins());
+
+ // Include/Exclude buttons
+ QFrame* aBtnsFrame = new QFrame;
+ QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
+ aBtnsLayout->setMargin( 5 );
+ aBtnsLayout->setSpacing( 5 );
+ aBtnsFrame->setLayout( aBtnsLayout );
+ QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
+ QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
+
+ // Fill the butons frame with two buttons
+ aBtnsLayout->addWidget( anAddBtn );
+ aBtnsLayout->addWidget( aRemoveBtn );
+ aBtnsLayout->addStretch( 1 );
+
+ // Land covers frame
+ QFrame* aLandCoversFrame = new QFrame( aPage );
+ aLandCoversFrame->setFrameStyle( QFrame::Panel | QFrame::Raised );
+ QGridLayout* aLandCoversLayout = new QGridLayout( aLandCoversFrame );
+ aLandCoversLayout->setMargin( 5 );
+ aLandCoversLayout->setSpacing( 5 );
+ aLandCoversFrame->setLayout( aLandCoversLayout );
+
+ // Fill the land covers frame with two lists, two labels and with buttons frame
+ aLandCoversLayout->addWidget( aLandCoversLabel, 0, 0, Qt::AlignHCenter );
+ aLandCoversLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
+ aLandCoversLayout->addWidget( myAvailableLandCovers, 1, 0 );
+ aLandCoversLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
+ aLandCoversLayout->addWidget( myLandCovers, 1, 2 );
+
+ // Fill the top layout of the page
+ QGridLayout* aTopLayout = new QGridLayout;
+ aTopLayout->setMargin( 5 );
+ aTopLayout->setSpacing( 5 );
+ aTopLayout->setVerticalSpacing( 10 );
+ aTopLayout->addWidget( aStricklerTableLabel, 0, 0, Qt::AlignHCenter );
+ aTopLayout->addWidget( myStricklerTableName, 0, 1 );
+ aTopLayout->addWidget( aModeGroup, 1, 0, 1, 2 );
+ aTopLayout->addWidget( aLandCoversFrame, 2, 0, 1, 2 );
+
+ aTopContainer->setLayout( aTopLayout );
+
+ // Add the top of the page to the splitter
+ myLandCoverSplitter->insertWidget(0, aTopContainer);
+ myLandCoverSplitter->setStretchFactor(0, 2);
+
+ // Bottom of the page
+ myLandCoverPriorityWidget = new HYDROGUI_PriorityWidget( mainFrame() );
+ HYDROGUI_PriorityTableModel* aModel =
+ dynamic_cast<HYDROGUI_PriorityTableModel*>( myLandCoverPriorityWidget->getTable()->model() );
+ if ( aModel )
+ aModel->setColumnCount( 3 );
+
+ QGroupBox* aPriorityGroup = new QGroupBox( tr( "PRIORITY" ) );
+ QBoxLayout* aPriorityLayout = new QHBoxLayout;
+ aPriorityLayout->setMargin( 5 );
+ aPriorityLayout->setSpacing( 5 );
+ aPriorityLayout->addWidget( myLandCoverPriorityWidget );
+ aPriorityGroup->setLayout( aPriorityLayout );
+
+ // Add the bottom of the page to the splitter
+ myLandCoverSplitter->insertWidget(1, aPriorityGroup);
+ myLandCoverSplitter->setStretchFactor(1, 1);
+
+ // Page layout
+ QVBoxLayout* aPageLayout = new QVBoxLayout;
+ aPageLayout->setMargin( 5 );
+ aPageLayout->setSpacing( 5 );
+ aPageLayout->addWidget( myLandCoverSplitter );
+
+ aPage->setLayout( aPageLayout );
+
+ // Create selector
+ if ( module() ) {
+ HYDROGUI_ListSelector* aListSelector =
+ new HYDROGUI_ListSelector( myLandCovers, module()->getApp()->selectionMgr() );
+ aListSelector->setAutoBlock( true );
+ }
+
+ // Connections
+ connect( myLandCoverModeButtons, SIGNAL( buttonClicked( int ) ), SIGNAL( changeLandCoverMode( int ) ) );
+ connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addLandCovers() ) );
+ connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeLandCovers() ) );
+
+ connect( myLandCovers, SIGNAL( orderLandCoverChanged() ), SLOT( onOrderLandCoverChanged() ) );
+
+ return aPage;
+}
+