All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AddColumnDialog.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 #include "AddColumnDialog.h"
21 
22 #include "../../../datatype/SimpleProperty.h"
23 
24 #include <ui_AddColumnDialogForm.h>
25 
26 te::dt::Property* GetProperty(const QString& propertyType)
27 {
28  if(propertyType.compare(QObject::tr("Integer")))
30  else if(propertyType.compare(QObject::tr("Real")))
32  if(propertyType.compare(QObject::tr("String")))
34  if(propertyType.compare(QObject::tr("Date")))
36 
37  return 0;
38 }
39 
41 QDialog(parent)
42 {
43  m_ui.reset(new Ui::AddColumnDialogForm);
44  m_ui->setupUi(this);
45 
46  m_ui->m_helpBTN->setPageReference("widgets/table/addColumn.html");
47 
48  connect(m_ui->m_cancelBTN, SIGNAL(pressed()), SLOT(reject()));
49  connect(m_ui->m_okBTN, SIGNAL(pressed()), SLOT(accept()));
50 }
51 
53 {
54 }
55 
57 {
58  te::dt::Property* pr = GetProperty(m_ui->m_colTypeCBB->currentText());
59 
60  pr->setName(m_ui->m_colNameLNE->text().toStdString());
61 
62  return pr;
63 }
64 
66 {
67  m_ui->m_tblNameCBB->addItem(name.c_str());
68 }
An atomic property like an integer or double.
te::dt::Property * getNewProperty() const
std::auto_ptr< Ui::AddColumnDialogForm > m_ui
void setName(const std::string &name)
It sets the property name.
Definition: Property.h:136
A Qt dialog for inserting columns into a table.
void setTableName(const std::string &name)
te::dt::Property * GetProperty(const QString &propertyType)
It models a property definition.
Definition: Property.h:59