All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProjectWidget.cpp
Go to the documentation of this file.
1 #include "ui_ProjectWidgetForm.h"
2 #include "ProjectWidget.h"
3 
4 #include "../Utils.h"
5 
7  : AbstractSettingWidget(parent),
8  m_ui(new Ui::ProjectWidgetForm)
9 {
10  m_ui->setupUi(this);
11 
12  m_resumeText = tr("Default author for new projects.");
13 
14  connect(m_ui->m_authorLineEdit, SIGNAL(textChanged(const QString&)), SLOT(authorChanged(const QString&)));
15  connect(m_ui->m_numRecentProjectsSpinBox, SIGNAL(valueChanged(int)), SLOT(maxSavedChanged(int)));
16  connect(m_ui->m_lastProjectRadioButton, SIGNAL(clicked()), SLOT(onOpeningOptionChanged()));
17  connect(m_ui->m_noneProjectRadioButton, SIGNAL(clicked()), SLOT(onOpeningOptionChanged()));
18 
19  resetState();
20 }
21 
22 void te::qt::af::ProjectWidget::getHelpInformations(QString& ns, QString& helpFile)
23 {
24  ns = "dpi.inpe.br.apf";
25  helpFile = "apf/settings/project/ProjectConfig.html";
26 }
27 
29 {
30  delete m_ui;
31 }
32 
34 {
35  QString author = m_ui->m_authorLineEdit->text();
36  int maxSaved = m_ui->m_numRecentProjectsSpinBox->value();
37 
38  SaveProjectInformationsOnSettings(author, maxSaved);
39 
40  SaveOpenLastProjectOnSettings(m_ui->m_lastProjectRadioButton->isChecked());
41 
42  changeApplyButtonState(false);
43 }
44 
46 {
47  QString author;
48  int maxSaved;
49 
50  GetProjectInformationsFromSettings(author, maxSaved);
51 
52  m_ui->m_authorLineEdit->setText(author);
53  m_ui->m_numRecentProjectsSpinBox->setValue(maxSaved);
54 
55  changeApplyButtonState(false);
56 }
57 
59 {
60  changeApplyButtonState(true);
61 }
62 
64 {
65  changeApplyButtonState(true);
66 }
67 
69 {
70  changeApplyButtonState(true);
71 }
void authorChanged(const QString &text)
TEQTAFEXPORT void SaveOpenLastProjectOnSettings(bool openLast)
Definition: Utils.cpp:594
virtual void getHelpInformations(QString &ns, QString &helpFile)
Ui::ProjectWidgetForm * m_ui
Definition: ProjectWidget.h:76
TEQTAFEXPORT void SaveProjectInformationsOnSettings(const QString &defaultAuthor, const int &maxSaved)
Definition: Utils.cpp:577
A frame for setting Table options.
TEQTAFEXPORT void GetProjectInformationsFromSettings(QString &defaultAuthor, int &maxSaved)
Definition: Utils.cpp:567
ProjectWidget(QWidget *parent=0)
A frame for setting project options.