ProjectWidget.cpp
Go to the documentation of this file.
1 //TerraLib Includes
2 #include "../Utils.h"
3 #include "ui_ProjectWidgetForm.h"
4 #include "ProjectWidget.h"
5 
6 
7 #include <terralib/qt/af/Utils.h>
8 
10  : AbstractSettingWidget(parent),
11  m_ui(new Ui::ProjectWidgetForm)
12 {
13  m_ui->setupUi(this);
14 
15  m_resumeText = tr("Default author for new projects.");
16 
17  connect(m_ui->m_authorLineEdit, SIGNAL(textChanged(const QString&)), SLOT(authorChanged(const QString&)));
18  connect(m_ui->m_numRecentProjectsSpinBox, SIGNAL(valueChanged(int)), SLOT(maxSavedChanged(int)));
19  connect(m_ui->m_lastProjectRadioButton, SIGNAL(clicked()), SLOT(onOpeningOptionChanged()));
20  connect(m_ui->m_noneProjectRadioButton, SIGNAL(clicked()), SLOT(onOpeningOptionChanged()));
21 
22  resetState();
23 }
24 
25 void ProjectWidget::getHelpInformations(QString& ns, QString& helpFile)
26 {
27  ns = "dpi.inpe.br.apf";
28  helpFile = "apf/settings/project/ProjectConfig.html";
29 }
30 
32 {
33  delete m_ui;
34 }
35 
37 {
38  QString author = m_ui->m_authorLineEdit->text();
39  int maxSaved = m_ui->m_numRecentProjectsSpinBox->value();
40 
41  SaveProjectInformationsOnSettings(author, maxSaved);
42 
43  SaveOpenLastProjectOnSettings(m_ui->m_lastProjectRadioButton->isChecked());
44 
46 }
47 
49 {
50  QString author;
51  int maxSaved;
52 
53  GetProjectInformationsFromSettings(author, maxSaved);
54 
55  m_ui->m_authorLineEdit->setText(author);
56  m_ui->m_numRecentProjectsSpinBox->setValue(maxSaved);
57 
59 }
60 
61 void ProjectWidget::authorChanged(const QString& /*text*/)
62 {
64 }
65 
67 {
69 }
70 
72 {
74 }
virtual void getHelpInformations(QString &ns, QString &helpFile)
void GetProjectInformationsFromSettings(QString &defaultAuthor, int &maxSaved)
ProjectWidget(QWidget *parent=0)
void authorChanged(const QString &text)
void SaveOpenLastProjectOnSettings(bool openLast)
Utility routines for the TerraLib Application Framework module.
Ui::ProjectWidgetForm * m_ui
Definition: ProjectWidget.h:70
void onOpeningOptionChanged()
A frame for setting project options.
void maxSavedChanged(int i)
void SaveProjectInformationsOnSettings(const QString &defaultAuthor, const int &maxSaved)
virtual void changeApplyButtonState(const bool &state)
Indicates that there&#39;s unsaved information. Use this method after each change in informations of the ...