diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp index 7f507a9e9..0dd1fa4ec 100644 --- a/src/app/core/vsettings.cpp +++ b/src/app/core/vsettings.cpp @@ -42,6 +42,7 @@ const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral(" const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements"); const QString VSettings::SettingPathsPattern = QStringLiteral("paths/pattern"); +const QString VSettings::SettingPathsLayout = QStringLiteral("paths/layout"); const QString VSettings::SettingPatternUser = QStringLiteral("pattern/user"); const QString VSettings::SettingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput"); @@ -185,6 +186,18 @@ void VSettings::SetPathPattern(const QString &value) setValue(SettingPathsPattern, value); } +//--------------------------------------------------------------------------------------------------------------------- +QString VSettings::GetPathLayout() const +{ + return value(SettingPathsLayout, QDir::homePath()).toString(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VSettings::SetPathLayout(const QString &value) +{ + setValue(SettingPathsLayout, value); +} + //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetUser() const { diff --git a/src/app/core/vsettings.h b/src/app/core/vsettings.h index 7a21b56c6..cb240b73c 100644 --- a/src/app/core/vsettings.h +++ b/src/app/core/vsettings.h @@ -65,6 +65,9 @@ public: QString GetPathPattern() const; void SetPathPattern(const QString &value); + QString GetPathLayout() const; + void SetPathLayout(const QString &value); + QString GetUser() const; void SetUser(const QString &value); @@ -128,6 +131,7 @@ private: static const QString SettingPathsIndividualMeasurements; static const QString SettingPathsPattern; + static const QString SettingPathsLayout; static const QString SettingPatternUser; static const QString SettingPatternGraphicalOutput; diff --git a/src/app/dialogs/app/configpages/pathpage.cpp b/src/app/dialogs/app/configpages/pathpage.cpp index bf2a8e686..fd55446a7 100644 --- a/src/app/dialogs/app/configpages/pathpage.cpp +++ b/src/app/dialogs/app/configpages/pathpage.cpp @@ -64,6 +64,7 @@ void PathPage::Apply() { qApp->getSettings()->SetPathIndividualMeasurements(pathTable->item(0, 1)->text()); qApp->getSettings()->SetPathPattern(pathTable->item(1, 1)->text()); + qApp->getSettings()->SetPathLayout(pathTable->item(2, 1)->text()); } //--------------------------------------------------------------------------------------------------------------------- @@ -125,10 +126,11 @@ QGroupBox *PathPage::PathGroup() return pathGroup; } +//--------------------------------------------------------------------------------------------------------------------- void PathPage::InitTable() { pathTable = new QTableWidget(); - pathTable->setRowCount(2); + pathTable->setRowCount(3); pathTable->setColumnCount(2); pathTable->verticalHeader()->setVisible(false); pathTable->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -145,6 +147,9 @@ void PathPage::InitTable() pathTable->setItem(1, 0, new QTableWidgetItem(tr("Patterns"))); pathTable->setItem(1, 1, new QTableWidgetItem(qApp->getSettings()->GetPathPattern())); + pathTable->setItem(2, 0, new QTableWidgetItem(tr("Layout"))); + pathTable->setItem(2, 1, new QTableWidgetItem(qApp->getSettings()->GetPathLayout())); + pathTable->verticalHeader()->setDefaultSectionSize(20); pathTable->resizeColumnsToContents(); pathTable->resizeRowsToContents(); diff --git a/src/app/dialogs/app/dialogsavelayout.cpp b/src/app/dialogs/app/dialogsavelayout.cpp index dec9d2d02..3a427a76b 100644 --- a/src/app/dialogs/app/dialogsavelayout.cpp +++ b/src/app/dialogs/app/dialogsavelayout.cpp @@ -29,6 +29,8 @@ #include "dialogsavelayout.h" #include "ui_dialogsavelayout.h" #include "../options.h" +#include "../../core/vapplication.h" +#include "../../core/vsettings.h" #include #include @@ -49,6 +51,8 @@ DialogSaveLayout::DialogSaveLayout(const QMap &formates, int c ui->lineEditFileName->setValidator(validator); ui->lineEditFileName->setText(fileName); + ui->lineEditPath->setText(qApp->getSettings()->GetPathLayout()); + QMap::const_iterator i = formates.constBegin(); while (i != formates.constEnd()) { diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp index fe3974934..30649add5 100644 --- a/src/app/tablewindow.cpp +++ b/src/app/tablewindow.cpp @@ -30,6 +30,7 @@ #include "ui_tablewindow.h" #include "widgets/vtablegraphicsview.h" #include "core/vapplication.h" +#include "core/vsettings.h" #include "../../libs/vobj/vobjpaintdevice.h" #include "../dialogs/app/dialoglayoutsettings.h" #include "../../libs/vlayout/vlayoutgenerator.h" @@ -174,8 +175,9 @@ void TableWindow::SaveLayout() QString suf = dialog.Formate(); suf.replace(".", ""); - QString path = dialog.Path(); - QString mask = dialog.FileName(); + const QString path = dialog.Path(); + qApp->getSettings()->SetPathLayout(path); + const QString mask = dialog.FileName(); for (int i=0; i < scenes.size(); ++i) {