BuilderOutputWizardPage.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21 \file src/terraMobilePlugin/qt/BuilderOutputWizardPage.cpp
22 
23 \brief This interface is used to get the output parameters for GeoPackage Builder wizard operation.
24 */
25 
26 // TerraLib
28 #include "ui_BuilderOutputWizardPageForm.h"
29 
30 // Qt
31 #include <QFileDialog>
32 
34 : QWizardPage(parent),
35 m_ui(new Ui::BuilderOutputWizardPageForm)
36 {
37  // setup controls
38  m_ui->setupUi(this);
39 
40  //configure page
41  this->setTitle(tr("GeoPackage Builder Output Parameters"));
42  this->setSubTitle(tr("Used to set the output parameters to build the geopackage file."));
43 
44  //connect slots
45  connect(m_ui->m_dirToolButton, SIGNAL(pressed()), this, SLOT(onDirToolButtonPressed()));
46 }
47 
49 {
50 
51 }
52 
54 {
55  if (m_ui->m_geopackageFileNameLineEdit->text().isEmpty())
56  return false;
57 
58  return true;
59 }
60 
62 {
63  if (!m_ui->m_geopackageFileNameLineEdit->text().isEmpty())
64  return m_ui->m_geopackageFileNameLineEdit->text().toUtf8().data();
65 
66  return "";
67 }
68 
69 //m_gpkgDescLineEdit
70 
72 {
73  if (!m_ui->m_gpkgDescLineEdit->text().isEmpty())
74  return m_ui->m_gpkgDescLineEdit->text().toUtf8().data();
75 
76  return "";
77 }
78 
80 {
81  return m_ui->m_visibleAreaCheckBox->isChecked();
82 }
83 
85 {
86  m_ui->m_logPlainTextEdit->appendPlainText(QString::fromUtf8(msg.c_str()));
87  this->repaint();
88 }
89 
91 {
92  QString fileName = QFileDialog::getSaveFileName(this, tr("Save as..."), QString(), tr("Geopackage (*.gpkg *.GPKG);;"), 0, QFileDialog::DontConfirmOverwrite);
93 
94  if (fileName.isEmpty())
95  return;
96 
97  m_ui->m_geopackageFileNameLineEdit->setText(fileName);
98 
99  emit completeChanged();
100 }
std::auto_ptr< Ui::BuilderOutputWizardPageForm > m_ui