All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 {
51 }
52 
54 {
55 }
56 
58 {
59  if(m_completeMode == HAVING_CHECKED_ITEMS)
60  return m_selectorW->hasCheckedDataSets();
61  else //if(m_completeMode == HAVING_SELECTED_ITEMS)
62  return m_selectorW->hasSelectedDataSets();
63 }
64 
66 {
67  m_selectorW->set(ds, useCheckableItems);
68 }
69 
70 std::list<te::da::DataSetTypePtr> te::qt::widgets::DataSetSelectorWizardPage::getCheckedDataSets() const
71 {
72  return m_selectorW->getCheckedDataSets();
73 }
74 
75 std::list<te::da::DataSetTypePtr> te::qt::widgets::DataSetSelectorWizardPage::getSelectedDataSets() const
76 {
77  return m_selectorW->getSelectedDataSets();
78 }
79 
81 {
82  m_completeMode = m;
83 }
84 
86 {
87  return m_selectorW.get();
88 }
89 
91 {
92  emit completeChanged();
93 }
94 
96 {
97  emit completeChanged();
98 }
99 
std::auto_ptr< DataSetSelectorWidget > m_selectorW
A wizard for selecting datasets from a data source.
DataSetSelectorWidget * getSelectorWidget() const
std::list< te::da::DataSetTypePtr > getCheckedDataSets() const
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