53 #include "ui_seamlymepreferencesconfigurationpage.h"
54 #include "../../mapplication.h"
55 #include "../vmisc/vseamlymesettings.h"
56 #include "../vpatterndb/variables/vmeasurement.h"
57 #include "../vpatterndb/pmsystems.h"
63 , m_langChanged(false)
64 , m_systemChanged(false)
65 , m_defGradationChanged(false)
70 connect(
ui->langCombo,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
this, [
this]()
76 ui->osOptionCheck->setText(tr(
"With OS options") + QString(
" (%1)").arg(QLocale().decimalPoint()));
77 ui->osOptionCheck->setChecked(
qApp->SeamlyMeSettings()->GetOsSeparator());
81 ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(
ui->systemBookValueLabel->font()).lineSpacing());
82 connect(
ui->systemCombo,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
this, [
this]()
84 m_systemChanged = true;
85 QString text = qApp->TrVars()->PMSystemAuthor(ui->systemCombo->currentData().toString());
86 ui->systemAuthorValueLabel->setText(text);
87 ui->systemAuthorValueLabel->setToolTip(text);
89 text = qApp->TrVars()->PMSystemBook(ui->systemCombo->currentData().toString());
90 ui->systemBookValueLabel->setPlainText(text);
94 int index =
ui->systemCombo->findData(
qApp->SeamlyMeSettings()->GetPMSystemCode());
97 ui->systemCombo->setCurrentIndex(index);
101 connect(
ui->resetWarningsButton, &QPushButton::released, []()
103 VSeamlyMeSettings *settings = qApp->SeamlyMeSettings();
105 settings->setConfirmFormatRewriting(true);
109 ui->toolBarStyle_CheckBox->setChecked(
qApp->SeamlyMeSettings()->getToolBarStyle());
113 index =
ui->defHeightCombo->findText(QString().setNum(
qApp->SeamlyMeSettings()->GetDefHeight()));
116 ui->defHeightCombo->setCurrentIndex(index);
119 auto DefGradationChanged = [
this]()
124 connect(
ui->defHeightCombo,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
this,
125 DefGradationChanged);
128 index =
ui->defSizeCombo->findText(QString().setNum(
qApp->SeamlyMeSettings()->GetDefSize()));
131 ui->defSizeCombo->setCurrentIndex(index);
133 connect(
ui->defHeightCombo,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
this,
134 DefGradationChanged);
153 const QString locale = qvariant_cast<QString>(
ui->langCombo->currentData());
157 const QString code = qvariant_cast<QString>(
ui->systemCombo->currentData());
161 qApp->loadTranslations(locale);
162 qApp->processEvents();
165 qApp->RetranslateTables();
166 qApp->retranslateGroups();
171 settings->
SetDefHeight(
ui->defHeightCombo->currentText().toInt());
172 settings->
SetDefSize(
ui->defSizeCombo->currentText().toInt());
180 if (event->type() == QEvent::LanguageChange)
186 QWidget::changeEvent(event);
192 ui->osOptionCheck->setText(tr(
"With OS options") + QString(
" (%1)").arg(QLocale().decimalPoint()));
bool m_defGradationChanged
Ui::SeamlyMePreferencesConfigurationPage * ui
virtual void changeEvent(QEvent *event) Q_DECL_OVERRIDE
SeamlyMePreferencesConfigurationPage(QWidget *parent=nullptr)
virtual ~SeamlyMePreferencesConfigurationPage()
void SetPMSystemCode(const QString &value)
void setToolBarStyle(const bool &value)
void SetOsSeparator(const bool &value)
void SetLocale(const QString &value)
static QStringList WholeListSizes(Unit patternUnit)
static QStringList WholeListHeights(Unit patternUnit)
void SetDefHeight(int value)
void SetDefSize(int value)
void InitLanguages(QComboBox *combobox)
void InitPMSystems(QComboBox *systemCombo)