All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MultiResolutionDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 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 terralib/qt/widgets/raster/MultiResolutionDialog.cpp
22 
23  \brief A dialog to create multi resolution over a raster.
24 */
25 
26 // TerraLib
27 #include "../../../common/Translator.h"
28 #include "../Exception.h"
29 #include "MultiResolutionDialog.h"
30 #include "MultiResolutionWidget.h"
31 #include "ui_MultiResolutionDialogForm.h"
32 #include "ui_MultiResolutionWidgetForm.h"
33 
34 // Qt
35 #include <QMessageBox>
36 #include <QGridLayout>
37 
39  : QDialog(parent, f),
40  m_ui(new Ui::MultiResolutionDialogForm)
41 {
42 // add controls
43  m_ui->setupUi(this);
44 
45  m_ui->m_imgLabel->setPixmap(QIcon::fromTheme("raster-multiresolution-hint").pixmap(112,48));
46 
47 //add widget
48  m_widget.reset(new MultiResolutionWidget(m_ui->m_widget, f));
49 
50  QGridLayout* layout = new QGridLayout(m_ui->m_widget);
51  layout->addWidget(m_widget.get());
52  layout->setContentsMargins(0,0,0,0);
53  m_ui->m_widget->setLayout(layout);
54 
55 // connect signal and slots
56  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
57 
58  m_ui->m_helpPushButton->setPageReference("widgets/raster/raster_multiresolution.html");
59 }
60 
62 {
63 }
64 
66 {
67  return m_widget.get();
68 }
69 
70 void te::qt::widgets::MultiResolutionDialog::setLayerList(std::list<te::map::AbstractLayerPtr>& layerList)
71 {
72  m_widget->setLayerList(layerList);
73 }
74 
76 {
77  bool res = m_widget->createMultiResolution();
78 
79  if(!res)
80  return;
81 
82  accept();
83 }
std::auto_ptr< MultiResolutionWidget > m_widget
A widget to create multi resolution over a raster.
A dialog to create multi resolution over a raster.
std::auto_ptr< Ui::MultiResolutionDialogForm > m_ui
A widget to create multi resolution over a raster.
MultiResolutionWidget * getWidget() const
MultiResolutionDialog(QWidget *parent=0, Qt::WindowFlags f=0)
void setLayerList(std::list< te::map::AbstractLayerPtr > &layerList)