27 #include "../../../common/SystemApplicationSettings.h" 28 #include "../../../common/UserApplicationSettings.h" 29 #include "../../../core/utils/Platform.h" 30 #include "../../../qt/widgets/srs/SRSManagerDialog.h" 31 #include "../../../qt/widgets/utils/ColorPickerToolButton.h" 32 #include "../../../srs/Config.h" 33 #include "../ApplicationController.h" 36 #include "ui_GeneralConfigWidgetForm.h" 40 #include <QPushButton> 45 m_ui(new
Ui::GeneralConfigWidgetForm),
49 m_resumeText = tr(
"Changes the general configurations of the application.");
60 QMessageBox msgBox(
this);
62 msgBox.setText(tr(
"The system must be restarted for the changes to take effect."));
63 msgBox.setInformativeText(tr(
"Do you want to do it now?"));
64 msgBox.setWindowTitle(tr(
"Restart system"));
66 std::unique_ptr<QPushButton> restartButton;
67 restartButton.reset(msgBox.addButton(tr(
"Restart now"), QMessageBox::ActionRole));
69 std::unique_ptr<QPushButton> laterResButton;
70 laterResButton.reset(msgBox.addButton(tr(
"Restart later"), QMessageBox::DestructiveRole));
71 msgBox.addButton(QMessageBox::NoButton);
73 msgBox.setDefaultButton(restartButton.get());
77 if(msgBox.clickedButton() == restartButton.get())
84 QSettings settings(QSettings::IniFormat, QSettings::UserScope, qApp->organizationName(), qApp->applicationName());
89 hexColor.sprintf(
"#%02x%02x%02x%02x", color.alpha(), color.red(), color.green(), color.blue());
92 settings.setValue(
"color/selection_color", hexColor);
93 settings.setValue(
"toolbars/icon_size",
m_ui->m_toolBarIconSizeSpinBox->value());
94 settings.setValue(
"icon_theme/selected_theme",
m_ui->m_iconThemeComboBox->currentText());
107 ns =
"dpi.inpe.br.apf";
108 helpFile =
"apf/settings/generalconfig/GeneralConfig.html";
114 m_ui->m_defaultSRSToolButton->setIcon(QIcon::fromTheme(
"srs"));
121 QGridLayout* layout =
new QGridLayout(
m_ui->m_selectionColorFrame);
122 layout->setContentsMargins(0, 0, 0, 0);
123 layout->setSizeConstraint(QLayout::SetFixedSize);
127 QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::instance()->organizationName(), QApplication::instance()->applicationName());
135 QColor selectionColor = QColor(selectionColorName);
140 m_ui->m_toolBarIconSizeSpinBox->setValue(iconSize);
144 QDir iconThemesDir(iconThemesDirPath.c_str());
147 QStringList themes = iconThemesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
148 m_ui->m_iconThemeComboBox->clear();
149 m_ui->m_iconThemeComboBox->addItems(themes);
166 srsDialog.setWindowTitle(tr(
"Choose the Default SRS"));
168 if(srsDialog.exec() == QDialog::Rejected)
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
static T & getInstance()
It returns a reference to the singleton instance.
void setSelectionColor(const QColor &c)
Sets the application selection color.
TECOREEXPORT std::string FindInTerraLibPath(const std::string &path)
Returns the path relative to a directory or file in the context of TerraLib.