1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "HYDROGUI_ExportLandCoverMapDlg.h"
21 #include <SUIT_MessageBox.h>
24 #include <QVBoxLayout>
27 HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* theParent, const QStringList& AttrItems )
28 : QtxDialog( theParent, false, true, QtxDialog::OKCancel )
30 setWindowTitle( tr( "EXPORT_LANDCOVERMAP" ) );
31 setButtonPosition( Left, OK );
32 setButtonPosition( Right, Cancel );
34 myAttrCheckBox = new QCheckBox( tr( "Write Strickler Types as attributes values to DBF file" ), mainFrame() );
35 myAttrCheckBox->setChecked(false);
36 myAvFields = new QComboBox( mainFrame() );
37 myAvFields->setEnabled(false);
38 myAvFields->addItems( AttrItems );
40 QGridLayout* aLayout = new QGridLayout( mainFrame() );
41 aLayout->setMargin( 5 );
42 aLayout->setSpacing( 5 );
43 aLayout->addWidget( myAttrCheckBox, 0, 0 );
44 aLayout->addWidget( myAvFields, 1, 0, 1, 2 );
46 setMinimumSize( 300, 100 );
48 connect( myAttrCheckBox, SIGNAL(clicked(bool)), this, SLOT(onAttrCBChecked(bool)));
52 HYDROGUI_ExportLandCoverMapDlg::~HYDROGUI_ExportLandCoverMapDlg()
56 void HYDROGUI_ExportLandCoverMapDlg::onAttrCBChecked( bool theState )
59 myAvFields->setEnabled(true);
61 myAvFields->setEnabled(false);
64 QString HYDROGUI_ExportLandCoverMapDlg::getCurrentItem() const
66 return myAvFields->currentText();
69 bool HYDROGUI_ExportLandCoverMapDlg::getAttrCheckBoxState()
71 return myAttrCheckBox->isChecked();