mirror of
https://git.code.sf.net/p/zint/code
synced 2025-06-01 07:38:26 -04:00
- Add new symbology BARCODE_MAILMARK_2D (Royal Mail 2D Mailmark),
renaming previous BARCODE_MAILMARK (Royal Mail 4-State Mailmark) to BARCODE_MAILMARK_4S - backend_tcl: update TEA
This commit is contained in:
parent
1daa1ab0ab
commit
25dacb2949
38 changed files with 3769 additions and 3621 deletions
|
@ -18,11 +18,11 @@ else()
|
|||
qt5_wrap_ui(zint-qt_SRCS mainWindow.ui extCLI.ui extData.ui extScale.ui extSequence.ui extExport.ui)
|
||||
endif()
|
||||
|
||||
# grpAztec.ui grpC39.ui grpCodablockF.ui grpDotCode.ui grpMaxicode.ui grpQR.ui grpUPNQR.ui
|
||||
# grpC11.ui grpC49.ui grpCodeOne.ui grpDPD.ui grpMicroPDF.ui grpRMQR.ui grpVIN.ui
|
||||
# grpC128.ui grpC93.ui grpDAFT.ui grpGrid.ui grpMQR.ui grpUltra.ui
|
||||
# grpC16k.ui grpChannel.ui grpDBExtend.ui grpHX.ui grpMSICheck.ui grpUPCA.ui
|
||||
# grpC25.ui grpCodabar.ui grpDM.ui grpITF14.ui grpPDF417.ui grpUPCEAN.ui
|
||||
# grpAztec.ui grpC39.ui grpCodablockF.ui grpDotCode.ui grpMailmark2D.ui grpPDF417.ui grpUPCEAN.ui
|
||||
# grpC11.ui grpC49.ui grpCodeOne.ui grpDPD.ui grpMaxicode.ui grpQR.ui grpUPNQR.ui
|
||||
# grpC128.ui grpC93.ui grpDAFT.ui grpGrid.ui grpMicroPDF.ui grpRMQR.ui grpVIN.ui
|
||||
# grpC16k.ui grpChannel.ui grpDBExtend.ui grpHX.ui grpMQR.ui grpUltra.ui
|
||||
# grpC25.ui grpCodabar.ui grpDM.ui grpITF14.ui grpMSICheck.ui grpUPCA.ui
|
||||
|
||||
if(APPLE)
|
||||
# https://doc.qt.io/qt-5/appicon.html
|
||||
|
|
|
@ -46,6 +46,7 @@ FORMS += extCLI.ui \
|
|||
grpGrid.ui \
|
||||
grpHX.ui \
|
||||
grpITF14.ui \
|
||||
grpMailmark2D.ui \
|
||||
grpMaxicode.ui \
|
||||
grpMicroPDF.ui \
|
||||
grpMQR.ui \
|
||||
|
|
|
@ -38,6 +38,7 @@ FORMS += extCLI.ui \
|
|||
grpGrid.ui \
|
||||
grpHX.ui \
|
||||
grpITF14.ui \
|
||||
grpMailmark2D.ui \
|
||||
grpMaxicode.ui \
|
||||
grpMicroPDF.ui \
|
||||
grpMQR.ui \
|
||||
|
|
118
frontend_qt/grpMailmark2D.ui
Normal file
118
frontend_qt/grpMailmark2D.ui
Normal file
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>grpMailmark2D</class>
|
||||
<widget class="QWidget" name="grpMailmark2D">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>463</width>
|
||||
<height>339</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayoutMailmark2D">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayoutMailmark2D">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblMailmark2DSize">
|
||||
<property name="text">
|
||||
<string>Si&ze:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set height and width (H x W) of symbol</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbMailmark2DSize</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cmbMailmark2DSize">
|
||||
<property name="toolTip">
|
||||
<string>Set height and width (H x W) of symbol</string>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>21</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Automatic</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>24 x 24 (Zint 8) - Type 7</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32 x 32 (Zint 10) - Type 9</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16 x 48 (Zint 30) - Type 29</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblMailmark2DAutoSize">
|
||||
<property name="text">
|
||||
<string>Automatic Size:</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Selection criteria when considering
|
||||
automatic sizes
|
||||
(ignored if disabled)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horzLayoutMailmark2DAutoSizeChecks">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkMailmark2DRectangle">
|
||||
<property name="text">
|
||||
<string>Only Squa&re</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Only consider square versions 8 and 10 on automatic symbol
|
||||
size selection, suppressing rectangular version 30
|
||||
(ignored if disabled)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacerMailmark2D">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -127,8 +127,9 @@ static const struct bstyle_item bstyle_items[] = {
|
|||
{ QSL("POSTNET"), BARCODE_POSTNET },
|
||||
{ QSL("QR Code (ISO 18004) (and HIBC)"), BARCODE_QRCODE },
|
||||
{ QSL("Rectangular Micro QR (rMQR) (ISO 23941)"), BARCODE_RMQR },
|
||||
{ QSL("Royal Mail 4-state Barcode (RM4SCC)"), BARCODE_RM4SCC },
|
||||
{ QSL("Royal Mail 4-state Mailmark"), BARCODE_MAILMARK },
|
||||
{ QSL("Royal Mail 2D Mailmark (CMDM) (Data Matrix)"), BARCODE_MAILMARK_2D },
|
||||
{ QSL("Royal Mail 4-state Customer Code (RM4SCC)"), BARCODE_RM4SCC },
|
||||
{ QSL("Royal Mail 4-state Mailmark"), BARCODE_MAILMARK_4S },
|
||||
{ QSL("Telepen"), BARCODE_TELEPEN },
|
||||
{ QSL("Telepen Numeric"), BARCODE_TELEPEN_NUM },
|
||||
{ QSL("UK Plessey"), BARCODE_PLESSEY },
|
||||
|
@ -1831,6 +1832,18 @@ void MainWindow::change_options()
|
|||
connect(get_widget(QSL("spnDMStructAppID")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
||||
connect(get_widget(QSL("spnDMStructAppID2")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
||||
|
||||
} else if (symbology == BARCODE_MAILMARK_2D) {
|
||||
QFile file(QSL(":/grpMailmark2D.ui"));
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
m_optionWidget = uiload.load(&file);
|
||||
file.close();
|
||||
load_sub_settings(settings, symbology);
|
||||
structapp_ui_set();
|
||||
tabMain->insertTab(1, m_optionWidget, tr("2D M&ailmark"));
|
||||
connect(get_widget(QSL("cmbMailmark2DSize")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
|
||||
connect(get_widget(QSL("chkMailmark2DRectangle")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||
}
|
||||
|
||||
} else if (symbology == BARCODE_ITF14) {
|
||||
btype->setItemText(0, tr("Default (box, 5X width)"));
|
||||
QFile file(QSL(":/grpITF14.ui"));
|
||||
|
@ -2818,6 +2831,28 @@ void MainWindow::update_preview()
|
|||
}
|
||||
break;
|
||||
|
||||
case BARCODE_MAILMARK_2D:
|
||||
m_bc.bc.setSymbol(BARCODE_MAILMARK_2D);
|
||||
|
||||
if ((item_val = get_cmb_index(QSL("cmbMailmark2DSize")))) {
|
||||
m_bc.bc.setOption2(item_val == 1 ? 8 : item_val == 2 ? 10 : 30);
|
||||
}
|
||||
|
||||
if (!item_val) {
|
||||
// Suppressing rectangles only makes sense if in automatic size mode
|
||||
m_optionWidget->findChild<QLabel*>(QSL("lblMailmark2DAutoSize"))->setEnabled(true);
|
||||
m_optionWidget->findChild<QCheckBox*>(QSL("chkMailmark2DRectangle"))->setEnabled(true);
|
||||
if (m_optionWidget->findChild<QCheckBox*>(QSL("chkMailmark2DRectangle"))->isChecked()) {
|
||||
m_bc.bc.setOption3(DM_SQUARE);
|
||||
}
|
||||
} else {
|
||||
m_optionWidget->findChild<QLabel*>(QSL("lblMailmark2DAutoSize"))->setEnabled(false);
|
||||
m_optionWidget->findChild<QCheckBox*>(QSL("chkMailmark2DRectangle"))->setEnabled(false);
|
||||
m_bc.bc.setOption3(0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case BARCODE_ITF14:
|
||||
m_bc.bc.setSymbol(BARCODE_ITF14);
|
||||
if (get_chk_val(QSL("chkITF14NoQuietZones"))) {
|
||||
|
@ -3442,6 +3477,24 @@ void MainWindow::automatic_info_set()
|
|||
}
|
||||
}
|
||||
|
||||
} else if (symbology == BARCODE_MAILMARK_2D) {
|
||||
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbMailmark2DSize")))) {
|
||||
if (!isError && cmb->currentIndex() == 0) {
|
||||
const int r = m_bc.bc.encodedRows();
|
||||
const int w = m_bc.bc.encodedWidth();
|
||||
int z;
|
||||
if (r == w) {
|
||||
z = r <= 26 ? 8 : 10;
|
||||
cmb->setItemText(0, QString::asprintf("Automatic (%d x %d (Zint %d) - Type %d)", r, w, z, z - 1));
|
||||
} else {
|
||||
z = 30;
|
||||
cmb->setItemText(0, QString::asprintf("Automatic (%d x %d (Zint %d) - Type %d)", r, w, z, z - 1));
|
||||
}
|
||||
} else {
|
||||
cmb->setItemText(0, QSL("Automatic"));
|
||||
}
|
||||
}
|
||||
|
||||
} else if (symbology == BARCODE_DOTCODE) {
|
||||
if ((cmb = m_optionWidget->findChild<QComboBox*>(QSL("cmbDotCols")))) {
|
||||
if (!isError && cmb->currentIndex() == 0) {
|
||||
|
@ -4006,6 +4059,11 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
|
|||
settings.setValue(QSL("studio/bc/datamatrix/structapp_id2"), get_spn_val(QSL("spnDMStructAppID2")));
|
||||
break;
|
||||
|
||||
case BARCODE_MAILMARK_2D:
|
||||
settings.setValue(QSL("studio/bc/mailmark2d/size"), get_cmb_index(QSL("cmbMailmark2DSize")));
|
||||
settings.setValue(QSL("studio/bc/mailmark2d/chk_suppress_rect"), get_chk_val(QSL("chkMailmark2DRectangle")));
|
||||
break;
|
||||
|
||||
case BARCODE_ITF14:
|
||||
settings.setValue(QSL("studio/bc/itf14/chk_no_quiet_zones"), get_chk_val(QSL("chkITF14NoQuietZones")));
|
||||
break;
|
||||
|
@ -4409,6 +4467,11 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
|
|||
set_spn_from_setting(settings, QSL("studio/bc/datamatrix/structapp_id2"), QSL("spnDMStructAppID2"), 1);
|
||||
break;
|
||||
|
||||
case BARCODE_MAILMARK_2D:
|
||||
set_cmb_from_setting(settings, QSL("studio/bc/mailmark2d/size"), QSL("cmbMailmark2DSize"));
|
||||
set_chk_from_setting(settings, QSL("studio/bc/mailmark2d/chk_suppress_rect"), QSL("chkMailmark2DRectangle"));
|
||||
break;
|
||||
|
||||
case BARCODE_ITF14:
|
||||
set_chk_from_setting(settings, QSL("studio/bc/itf14/chk_no_quiet_zones"), QSL("chkITF14NoQuietZones"));
|
||||
break;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<file>grpGrid.ui</file>
|
||||
<file>grpHX.ui</file>
|
||||
<file>grpITF14.ui</file>
|
||||
<file>grpMailmark2D.ui</file>
|
||||
<file>grpMaxicode.ui</file>
|
||||
<file>grpMicroPDF.ui</file>
|
||||
<file>grpMQR.ui</file>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue