Replace WARN_ZPL_COMPAT with GS1NOCHECK_MODE

This commit is contained in:
gitlost 2021-07-13 17:39:03 +01:00
parent 7cc2095d3c
commit 2e84fd5157
21 changed files with 1157 additions and 707 deletions

View file

@ -22,7 +22,7 @@
<property name="minimumSize">
<size>
<width>400</width>
<height>460</height>
<height>480</height>
</size>
</property>
<property name="windowTitle">
@ -109,13 +109,13 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>300</height>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>300</height>
<height>320</height>
</size>
</property>
<property name="autoFillBackground">
@ -548,6 +548,37 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkRInit">
<property name="toolTip">
<string>Create reader initialisation/programming symbol
(ignored if disabled)</string>
</property>
<property name="text">
<string>&amp;Reader Init</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="chksLayout">
<item>
<spacer name="horizontalSpacer_chksLayout">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkEscape">
<property name="toolTip">
@ -607,13 +638,13 @@ as delimiters for GS1 Application Identifiers
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkRInit">
<widget class="QCheckBox" name="chkGS1NoCheck">
<property name="toolTip">
<string>Create reader initialisation/programming symbol
<string>Do not check GS1 data for validity
(ignored if disabled)</string>
</property>
<property name="text">
<string>&amp;Reader Init</string>
<string>GS1 &amp;No Check</string>
</property>
<property name="checked">
<bool>false</bool>

View file

@ -168,6 +168,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
chkData->setChecked(settings.value("studio/chk_data").toInt() ? true : false);
chkRInit->setChecked(settings.value("studio/chk_rinit").toInt() ? true : false);
chkGS1Parens->setChecked(settings.value("studio/chk_gs1parens").toInt() ? true : false);
chkGS1NoCheck->setChecked(settings.value("studio/chk_gs1nocheck").toInt() ? true : false);
chkAutoHeight->setChecked(settings.value("studio/appearance/autoheight", 1).toInt() ? true : false);
heightb->setValue(settings.value("studio/appearance/height", 50.0f).toFloat());
bwidth->setValue(settings.value("studio/appearance/border", 0).toInt());
@ -205,6 +206,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
connect(chkData, SIGNAL(stateChanged( int )), SLOT(update_preview()));
connect(chkRInit, SIGNAL(stateChanged( int )), SLOT(update_preview()));
connect(chkGS1Parens, SIGNAL(stateChanged( int )), SLOT(update_preview()));
connect(chkGS1NoCheck, SIGNAL(stateChanged( int )), SLOT(update_preview()));
connect(spnWhitespace, SIGNAL(valueChanged( int )), SLOT(update_preview()));
connect(spnVWhitespace, SIGNAL(valueChanged( int )), SLOT(update_preview()));
connect(btnAbout, SIGNAL(clicked( bool )), SLOT(about()));
@ -259,6 +261,7 @@ MainWindow::~MainWindow()
settings.setValue("studio/chk_data", chkData->isChecked() ? 1 : 0);
settings.setValue("studio/chk_rinit", chkRInit->isChecked() ? 1 : 0);
settings.setValue("studio/chk_gs1parens", chkGS1Parens->isChecked() ? 1 : 0);
settings.setValue("studio/chk_gs1nocheck", chkGS1NoCheck->isChecked() ? 1 : 0);
settings.setValue("studio/appearance/autoheight", chkAutoHeight->isChecked() ? 1 : 0);
settings.setValue("studio/appearance/height", heightb->value());
settings.setValue("studio/appearance/border", bwidth->value());
@ -1011,6 +1014,7 @@ void MainWindow::change_options()
cmbECI->setEnabled(m_bc.bc.supportsECI(symbology)); /* Will need checking again in update_preview() as encoding mode dependent (HIBC) */
chkGS1Parens->setEnabled(m_bc.bc.supportsGS1(symbology)); /* Ditto (GS1) */
chkGS1NoCheck->setEnabled(m_bc.bc.supportsGS1(symbology)); /* Ditto (GS1) */
chkRInit->setEnabled(m_bc.bc.supportsReaderInit(symbology)); /* Ditto (HIBC and GS1) */
chkAutoHeight->setEnabled(!m_bc.bc.isFixedRatio(symbology));
chkHRTShow->setEnabled(m_bc.bc.hasHRT(symbology));
@ -1612,6 +1616,7 @@ void MainWindow::update_preview()
lblECI->setEnabled(cmbECI->isEnabled());
}
chkGS1Parens->setEnabled(m_bc.bc.supportsGS1());
chkGS1NoCheck->setEnabled(m_bc.bc.supportsGS1());
chkRInit->setEnabled(m_bc.bc.supportsReaderInit() && (m_bc.bc.inputMode() & 0x07) != GS1_MODE);
if (!grpComposite->isHidden() && chkComposite->isChecked())
@ -1624,6 +1629,7 @@ void MainWindow::update_preview()
}
m_bc.bc.setECI(cmbECI->isEnabled() ? cmbECI->currentIndex() : 0);
m_bc.bc.setGS1Parens(chkGS1Parens->isEnabled() && chkGS1Parens->isChecked());
m_bc.bc.setGS1NoCheck(chkGS1NoCheck->isEnabled() && chkGS1NoCheck->isChecked());
m_bc.bc.setReaderInit(chkRInit->isEnabled() && chkRInit->isChecked());
m_bc.bc.setShowText(chkHRTShow->isEnabled() && chkHRTShow->isChecked());
m_bc.bc.setBorderType(btype->currentIndex());
@ -1933,6 +1939,7 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology) {
settings.setValue(QString("studio/bc/%1/chk_rinit").arg(name), chkRInit->isChecked() ? 1 : 0);
}
settings.setValue(QString("studio/bc/%1/chk_gs1parens").arg(name), chkGS1Parens->isChecked() ? 1 : 0);
settings.setValue(QString("studio/bc/%1/chk_gs1nocheck").arg(name), chkGS1NoCheck->isChecked() ? 1 : 0);
if (chkAutoHeight->isEnabled()) {
settings.setValue(QString("studio/bc/%1/appearance/autoheight").arg(name), chkAutoHeight->isChecked() ? 1 : 0);
settings.setValue(QString("studio/bc/%1/appearance/height").arg(name), heightb->value());
@ -2185,6 +2192,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology) {
chkRInit->setChecked(settings.value(QString("studio/bc/%1/chk_rinit").arg(name)).toInt() ? true : false);
}
chkGS1Parens->setChecked(settings.value(QString("studio/bc/%1/chk_gs1parens").arg(name)).toInt() ? true : false);
chkGS1NoCheck->setChecked(settings.value(QString("studio/bc/%1/chk_gs1nocheck").arg(name)).toInt() ? true : false);
if (chkAutoHeight->isEnabled()) {
chkAutoHeight->setChecked(settings.value(QString("studio/bc/%1/appearance/autoheight").arg(name), 1).toInt() ? true : false);
heightb->setValue(settings.value(QString("studio/bc/%1/appearance/height").arg(name), 50.0f).toFloat());