+QWizardPage* HYDROGUI_CalculationDlg::createGroupsPage() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
+ myGroups = new QListWidget( aPage );
+ myGroups->setSelectionMode( QListWidget::ExtendedSelection );
+ myGroups->setEditTriggers( QListWidget::NoEditTriggers );
+ myGroups->setViewMode( QListWidget::ListMode );
+ myGroups->setSortingEnabled( true );
+
+ myAvailableGroups = new QListWidget( aPage );
+ myAvailableGroups->setSelectionMode( QListWidget::ExtendedSelection );
+ myAvailableGroups->setEditTriggers( QListWidget::NoEditTriggers );
+ myAvailableGroups->setViewMode( QListWidget::ListMode );
+ myAvailableGroups->setSortingEnabled( true );
+
+ connect( myGroups, SIGNAL( itemSelectionChanged() ),
+ SIGNAL( groupsSelected() ) );
+
+ QFrame* aGroupsFrame = new QFrame( aPage );
+ QGridLayout* aGroupsLayout = new QGridLayout( aGroupsFrame );
+ aGroupsLayout->setMargin( 5 );
+ aGroupsLayout->setSpacing( 5 );
+ aGroupsFrame->setLayout( aGroupsLayout );
+
+ QFrame* aBtnsFrame = new QFrame( aGroupsFrame );
+ 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 );
+
+ QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_GROUPS" ), aGroupsFrame );
+ QLabel* anAvailableLabel = new QLabel( tr( "AVAILABLE_GROUPS" ), aGroupsFrame );
+
+ // Fill the objects frame with two lists, two labels and with buttons frame
+ aGroupsLayout->addWidget( anAvailableLabel, 0, 0, Qt::AlignHCenter );
+ aGroupsLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
+ aGroupsLayout->addWidget( myAvailableGroups, 1, 0, Qt::AlignHCenter );
+ aGroupsLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
+ aGroupsLayout->addWidget( myGroups, 1, 2, Qt::AlignHCenter );
+
+ // Fill the page
+ QGridLayout* aPageLayout = new QGridLayout( aPage );
+ aPageLayout->setMargin( 5 );
+ aPageLayout->setSpacing( 5 );
+ aPageLayout->setVerticalSpacing( 10 );
+ aPageLayout->addWidget( aGroupsFrame, 0, 0, Qt::AlignHCenter );
+
+ aPage->setLayout( aPageLayout );
+
+ connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addGroups() ) );
+ connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeGroups() ) );
+
+ return aPage;
+}
+