GUI: fix quietzones, compliantheight per symbology setting/saving

GUI: DATAMATRIX: move automatic size checkboxs to under Size and add label
This commit is contained in:
gitlost 2021-10-13 15:31:28 +01:00
parent 72eac41c34
commit 0b8c488853
2 changed files with 61 additions and 32 deletions

View File

@ -290,6 +290,54 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="lblDMAutoSize">
<property name="text">
<string>Automatic Size:</string>
</property>
<property name="toolTip">
<string>Selection criteria when considering
automatic sizes
Normally DMRE sizes are not considered,
but other rectangular versions are
(ignored if disabled)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horzLayoutDMAutoSizeChecks">
<item>
<widget class="QCheckBox" name="chkDMRectangle">
<property name="text">
<string>Only Squa&amp;re</string>
</property>
<property name="toolTip">
<string>Only consider square versions on automatic symbol
size selection, suppressing rectangular versions
(ignored if disabled)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkDMRE">
<property name="text">
<string>Allo&amp;w DMRE</string>
</property>
<property name="toolTip">
<string>Consider Data Matrix Rectangular Extension (DMRE)
versions on automatic symbol size selection
(ignored if disabled)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -344,36 +392,6 @@ the data with a slash &quot;/&quot;</string>
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="chkDMRectangle">
<property name="text">
<string>Suppress &amp;Rectangular Symbols in Automatic Mode</string>
</property>
<property name="toolTip">
<string>Only consider square versions on automatic symbol
size selection
(ignored if disabled)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkDMRE">
<property name="text">
<string>Allo&amp;w DMRE in Automatic Mode</string>
</property>
<property name="toolTip">
<string>Consider DMRE versions on automatic symbol
size selection
(ignored if disabled)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="chkDMGSSep"> <widget class="QCheckBox" name="chkDMGSSep">
<property name="text"> <property name="text">

View File

@ -1830,6 +1830,7 @@ void MainWindow::update_preview()
if (get_cmb_index(QSL("cmbDM200Size")) == 0) { if (get_cmb_index(QSL("cmbDM200Size")) == 0) {
// Suppressing rectangles or allowing DMRE only makes sense if in automatic size mode // Suppressing rectangles or allowing DMRE only makes sense if in automatic size mode
m_optionWidget->findChild<QLabel*>(QSL("lblDMAutoSize"))->setEnabled(true);
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->setEnabled(true); m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->setEnabled(true);
if (m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->isChecked()) { if (m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->isChecked()) {
m_bc.bc.setOption3(DM_SQUARE); m_bc.bc.setOption3(DM_SQUARE);
@ -1842,6 +1843,7 @@ void MainWindow::update_preview()
m_bc.bc.setOption3(0); m_bc.bc.setOption3(0);
} }
} else { } else {
m_optionWidget->findChild<QLabel*>(QSL("lblDMAutoSize"))->setEnabled(false);
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->setEnabled(false); m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRectangle"))->setEnabled(false);
m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRE"))->setEnabled(false); m_optionWidget->findChild<QCheckBox*>(QSL("chkDMRE"))->setEnabled(false);
m_bc.bc.setOption3(0); m_bc.bc.setOption3(0);
@ -2626,6 +2628,10 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
QSL("studio/bc/%1/appearance/autoheight").arg(name), chkAutoHeight->isChecked() ? 1 : 0); QSL("studio/bc/%1/appearance/autoheight").arg(name), chkAutoHeight->isChecked() ? 1 : 0);
settings.setValue(QSL("studio/bc/%1/appearance/height").arg(name), heightb->value()); settings.setValue(QSL("studio/bc/%1/appearance/height").arg(name), heightb->value());
} }
if (chkCompliantHeight->isEnabled()) {
settings.setValue(
QSL("studio/bc/%1/appearance/compliantheight").arg(name), chkCompliantHeight->isChecked() ? 1 : 0);
}
settings.setValue(QSL("studio/bc/%1/appearance/border").arg(name), bwidth->value()); settings.setValue(QSL("studio/bc/%1/appearance/border").arg(name), bwidth->value());
settings.setValue(QSL("studio/bc/%1/appearance/whitespace").arg(name), spnWhitespace->value()); settings.setValue(QSL("studio/bc/%1/appearance/whitespace").arg(name), spnWhitespace->value());
settings.setValue(QSL("studio/bc/%1/appearance/vwhitespace").arg(name), spnVWhitespace->value()); settings.setValue(QSL("studio/bc/%1/appearance/vwhitespace").arg(name), spnVWhitespace->value());
@ -2972,6 +2978,10 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
QSL("studio/bc/%1/appearance/autoheight").arg(name), 1).toInt() ? true : false); QSL("studio/bc/%1/appearance/autoheight").arg(name), 1).toInt() ? true : false);
heightb->setValue(settings.value(QSL("studio/bc/%1/appearance/height").arg(name), 50.0f).toFloat()); heightb->setValue(settings.value(QSL("studio/bc/%1/appearance/height").arg(name), 50.0f).toFloat());
} }
if (chkCompliantHeight->isEnabled()) {
chkCompliantHeight->setChecked(settings.value(
QSL("studio/bc/%1/appearance/compliantheight").arg(name), 1).toInt() ? true : false);
}
bwidth->setValue(settings.value(QSL("studio/bc/%1/appearance/border").arg(name), 0).toInt()); bwidth->setValue(settings.value(QSL("studio/bc/%1/appearance/border").arg(name), 0).toInt());
spnWhitespace->setValue(settings.value(QSL("studio/bc/%1/appearance/whitespace").arg(name), 0).toInt()); spnWhitespace->setValue(settings.value(QSL("studio/bc/%1/appearance/whitespace").arg(name), 0).toInt());
spnVWhitespace->setValue(settings.value(QSL("studio/bc/%1/appearance/vwhitespace").arg(name), 0).toInt()); spnVWhitespace->setValue(settings.value(QSL("studio/bc/%1/appearance/vwhitespace").arg(name), 0).toInt());
@ -2984,6 +2994,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
QSL("studio/bc/%1/appearance/chk_hrt_show").arg(name), 1).toInt() ? true : false); QSL("studio/bc/%1/appearance/chk_hrt_show").arg(name), 1).toInt() ? true : false);
} }
chkCMYK->setChecked(settings.value(QSL("studio/bc/%1/appearance/cmyk").arg(name), 0).toInt() ? true : false); chkCMYK->setChecked(settings.value(QSL("studio/bc/%1/appearance/cmyk").arg(name), 0).toInt() ? true : false);
chkQuietZones->setChecked(settings.value(QSL("studio/bc/%1/appearance/chk_quietzones").arg(name), 0).toInt() ? true : false);
cmbRotate->setCurrentIndex(settings.value(QSL("studio/bc/%1/appearance/rotate").arg(name), 0).toInt()); cmbRotate->setCurrentIndex(settings.value(QSL("studio/bc/%1/appearance/rotate").arg(name), 0).toInt());
if (symbology == BARCODE_DOTCODE || chkDotty->isEnabled()) { if (symbology == BARCODE_DOTCODE || chkDotty->isEnabled()) {
chkDotty->setChecked(settings.value( chkDotty->setChecked(settings.value(