DataSetSelectorWizardPage.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/dataset/selector/DataSetSelectorWizardPage.cpp
22 
23  \brief ...
24 */
25 
26 // TerraLib
27 #include "../../datasource/explorer/DataSetItem.h"
28 #include "../explorer/DataSetTreeView.h"
29 #include "DataSetSelectorWidget.h"
31 
32 // Qt
33 #include <QVBoxLayout>
34 
36  : QWizardPage(parent),
37  m_completeMode(HAVING_CHECKED_ITEMS)
38 {
39  m_selectorW.reset(new DataSetSelectorWidget(this));
40 
41  QVBoxLayout* layout = new QVBoxLayout(this);
42 
43  layout->addWidget(m_selectorW.get());
44 
45  connect(m_selectorW->getTreeView(), SIGNAL(toggled(DataSetItem*)), this, SLOT(onDataSetToggled(DataSetItem*)));
46  connect(m_selectorW->getTreeView(), SIGNAL(clicked(DataSetItem*)), this, SLOT(onDataSetClicked(DataSetItem*)));
47 }
48 
50  default;
51 
53 {
54 }
55 
57 {
59  return m_selectorW->hasCheckedDataSets();
60  else //if(m_completeMode == HAVING_SELECTED_ITEMS)
61  return m_selectorW->hasSelectedDataSets();
62 }
63 
65 {
66  m_selectorW->set(ds, useCheckableItems);
67 }
68 
69 std::list<te::da::DataSetTypePtr> te::qt::widgets::DataSetSelectorWizardPage::getCheckedDataSets() const
70 {
71  return m_selectorW->getCheckedDataSets();
72 }
73 
74 std::list<te::da::DataSetTypePtr> te::qt::widgets::DataSetSelectorWizardPage::getSelectedDataSets() const
75 {
76  return m_selectorW->getSelectedDataSets();
77 }
78 
80 {
81  m_completeMode = m;
82 }
83 
85 {
86  return m_selectorW.get();
87 }
88 
90 {
91  emit completeChanged();
92 }
93 
95 {
96  emit completeChanged();
97 }
98 
static te::dt::Date ds(2010, 01, 01)
A wizard for selecting datasets from a data source.
DataSetSelectorWidget * getSelectorWidget() const
std::list< te::da::DataSetTypePtr > getCheckedDataSets() const
std::unique_ptr< DataSetSelectorWidget > m_selectorW
void set(const te::da::DataSourceInfoPtr &ds, bool useCheckableItems=false)
A wizard for selecting datasets from a data source.
std::list< te::da::DataSetTypePtr > getSelectedDataSets() const
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr