mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
GUI: data dialog: convert Line Feeds if escaping on input, escape on output
and set Escaped flag; fix tooltip that they're converted to spaces; sequence dialog: re-organize to put Create Sequence stuff only in groupbox and put Import -> From File and Clear at bottom, similar to data dialog; mainwindow: use new Escaped flag from data dialog and set checkbox and statusbar message accordingly
This commit is contained in:
parent
c0e1af9859
commit
f943893d6d
@ -43,6 +43,7 @@ Changes
|
||||
- CODE16K/CODE49: add min rows option
|
||||
- GUI: add CLI equivalent dialog (#163)
|
||||
- Add ZBarcode_BarcodeName()
|
||||
- GUI: data dialog: convert Line Feeds if escaping on input, escape on output
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
@ -556,6 +556,18 @@ private slots:
|
||||
" --height=11.7 --heightperrow --noquietzones --rows=4 --separator=2 --small"
|
||||
<< "" << "";
|
||||
|
||||
QTest::newRow("BARCODE_CODE49") << true << 0.0f << ""
|
||||
<< BARCODE_CODE49 << UNICODE_MODE // symbology-inputMode
|
||||
<< "12345678901234567890" << "" // text-primary
|
||||
<< 30.0f << -1 << 0 << 0 << 1.0f << false << 0.8f // height-dotSize
|
||||
<< 5.0f << 0 << 0 << "" << QColor(Qt::black) << QColor(Qt::white) // guardDescent-bgColor
|
||||
<< false << 0 << 0 << 0 << 0 << 0 // cmyk-fontSetting
|
||||
<< true << false << false << false << true << 0 // showText-rotateAngle
|
||||
<< 0 << false << false << false << WARN_DEFAULT << false // eci-debug
|
||||
<< "zint -b 24 --compliantheight -d '12345678901234567890'"
|
||||
<< "zint.exe -b 24 --compliantheight -d \"12345678901234567890\""
|
||||
<< "" << "";
|
||||
|
||||
QTest::newRow("BARCODE_CODABLOCKF") << true << 0.0f << ""
|
||||
<< BARCODE_CODABLOCKF << (DATA_MODE | ESCAPE_MODE) // symbology-inputMode
|
||||
<< "T\\n\\xA0t\\\"" << "" // text-primary
|
||||
@ -682,6 +694,18 @@ private slots:
|
||||
" --rows=10 --scale=10 --secure=3 --structapp=1,2"
|
||||
<< "" << "";
|
||||
|
||||
QTest::newRow("BARCODE_ITF14") << true << 0.0f << ""
|
||||
<< BARCODE_ITF14 << UNICODE_MODE // symbology-inputMode
|
||||
<< "9212320967145" << "" // text-primary
|
||||
<< 30.0f << -1 << 0 << 0 << 1.0f << false << 0.8f // height-dotSize
|
||||
<< 5.0f << 0 << 0 << "" << QColor(Qt::black) << QColor(Qt::white) // guardDescent-bgColor
|
||||
<< false << 0 << 0 << 0 << 0 << 0 // cmyk-fontSetting
|
||||
<< true << false << false << false << true << 0 // showText-rotateAngle
|
||||
<< 0 << false << false << false << WARN_DEFAULT << false // eci-debug
|
||||
<< "zint -b 89 --compliantheight -d '9212320967145'"
|
||||
<< "zint.exe -b 89 --compliantheight -d \"9212320967145\""
|
||||
<< "" << "";
|
||||
|
||||
QTest::newRow("BARCODE_MAXICODE") << true << 0.0f << ""
|
||||
<< BARCODE_MAXICODE << (UNICODE_MODE | ESCAPE_MODE) // symbology-inputMode
|
||||
<< "152382802840001"
|
||||
|
@ -1707,7 +1707,7 @@ border width of 5. This behaviour can be overridden by using the --bind option
|
||||
(or adding BARCODE_BIND to symbol->output_options). Similarly the border width
|
||||
can be overridden using --border= (or by setting symbol->border_width). If a
|
||||
symbol with no border is required this can be achieved by explicitly setting
|
||||
the border type to bind (or box) and setting the border width to 0.
|
||||
the border type to box (or bind) and setting the border width to 0.
|
||||
|
||||
6.1.2.7 Deutsche Post Leitcode
|
||||
------------------------------
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include "cliwindow.h"
|
||||
#include "barcodeitem.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
// Shorthand
|
||||
#define QSL QStringLiteral
|
||||
|
@ -24,13 +24,16 @@
|
||||
#include <QStringList>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "datawindow.h"
|
||||
|
||||
// Shorthand
|
||||
#define QSL QStringLiteral
|
||||
|
||||
DataWindow::DataWindow(const QString &input) : Valid(false)
|
||||
static const int tempMessageTimeout = 2000;
|
||||
|
||||
DataWindow::DataWindow(const QString &input, bool isEscaped) : Valid(false), Escaped(false)
|
||||
{
|
||||
setupUi(this);
|
||||
QSettings settings;
|
||||
@ -48,7 +51,26 @@ DataWindow::DataWindow(const QString &input) : Valid(false)
|
||||
btnDataClear->setIcon(clearIcon);
|
||||
btnOK->setIcon(okIcon);
|
||||
|
||||
txtDataInput->setPlainText(input);
|
||||
if (isEscaped && input.contains(QSL("\\n"))) {
|
||||
// Substitute escaped Line Feeds with actual Line Feeds
|
||||
QString out;
|
||||
out.reserve(input.length());
|
||||
int lastPosn = 0;
|
||||
QRegularExpression escRE(QSL("\\\\(?:[0EabtnvfreGR\\\\]|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})"));
|
||||
QRegularExpressionMatchIterator matchI = escRE.globalMatch(input);
|
||||
while (matchI.hasNext()) {
|
||||
QRegularExpressionMatch match = matchI.next();
|
||||
if (match.captured(0) == QSL("\\n")) {
|
||||
out += input.mid(lastPosn, match.capturedStart(0) - lastPosn) + '\n';
|
||||
lastPosn = match.capturedEnd(0);
|
||||
}
|
||||
}
|
||||
out += input.mid(lastPosn);
|
||||
txtDataInput->setPlainText(out);
|
||||
statusBarData->showMessage(tr("Converted LFs"), tempMessageTimeout);
|
||||
} else {
|
||||
txtDataInput->setPlainText(input);
|
||||
}
|
||||
txtDataInput->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
|
||||
|
||||
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(close()));
|
||||
@ -75,6 +97,11 @@ void DataWindow::okay()
|
||||
{
|
||||
Valid = true;
|
||||
DataOutput = txtDataInput->toPlainText();
|
||||
if (DataOutput.contains('\n')) {
|
||||
// Escape Line Feeds
|
||||
DataOutput.replace('\n', QSL("\\n"));
|
||||
Escaped = true;
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
@ -88,9 +115,7 @@ void DataWindow::from_file()
|
||||
QString filename;
|
||||
QFile file;
|
||||
QByteArray outstream;
|
||||
QString escape_string;
|
||||
|
||||
open_dialog.setWindowTitle("Open File");
|
||||
open_dialog.setWindowTitle("Import File");
|
||||
open_dialog.setDirectory(settings.value("studio/default_dir",
|
||||
QDir::toNativeSeparators(QDir::homePath())).toString());
|
||||
|
||||
@ -110,22 +135,27 @@ void DataWindow::from_file()
|
||||
|
||||
/* Allow some non-printing (control) characters to be read from file
|
||||
by converting them to escape sequences */
|
||||
escape_string.clear();
|
||||
escape_string.append(QString(outstream));
|
||||
QString escape_string(outstream); // Converts to UTF-8 (NOTE: QString can't handle embedded NULs)
|
||||
|
||||
escape_string.replace((QChar)'\\', (QString)"\\\\", Qt::CaseInsensitive);
|
||||
escape_string.replace((QChar)0x04, (QString)"\\E", Qt::CaseInsensitive); /* End of Transmission */
|
||||
escape_string.replace((QChar)'\a', (QString)"\\a", Qt::CaseInsensitive); /* Bell */
|
||||
escape_string.replace((QChar)'\b', (QString)"\\b", Qt::CaseInsensitive); /* Backspace */
|
||||
escape_string.replace((QChar)'\t', (QString)"\\t", Qt::CaseInsensitive); /* Horizontal tab */
|
||||
escape_string.replace((QChar)'\v', (QString)"\\v", Qt::CaseInsensitive); /* Vertical tab */
|
||||
escape_string.replace((QChar)'\f', (QString)"\\f", Qt::CaseInsensitive); /* Form feed */
|
||||
escape_string.replace((QChar)'\r', (QString)"\\r", Qt::CaseInsensitive); /* Carriage return */
|
||||
escape_string.replace((QChar)0x1b, (QString)"\\e", Qt::CaseInsensitive); /* Escape */
|
||||
escape_string.replace((QChar)0x1d, (QString)"\\G", Qt::CaseInsensitive); /* Group Separator */
|
||||
escape_string.replace((QChar)0x1e, (QString)"\\R", Qt::CaseInsensitive); /* Record Separator */
|
||||
QRegularExpression escRE(QSL("[\\x04\\x07\\x08\\x09\\x0B\\x0C\\x0D\\x1B\\x1D\\x1E\\x5C]"));
|
||||
if (escape_string.contains(escRE)) {
|
||||
escape_string.replace((QChar)'\\', QSL("\\\\"));
|
||||
escape_string.replace((QChar)0x04, QSL("\\E")); /* End of Transmission */
|
||||
escape_string.replace((QChar)'\a', QSL("\\a")); /* Bell (0x07) */
|
||||
escape_string.replace((QChar)'\b', QSL("\\b")); /* Backspace (0x08) */
|
||||
escape_string.replace((QChar)'\t', QSL("\\t")); /* Horizontal tab (0x09) */
|
||||
// Leaving Line Feed (0x0A)
|
||||
escape_string.replace((QChar)'\v', QSL("\\v")); /* Vertical tab (0x0B) */
|
||||
escape_string.replace((QChar)'\f', QSL("\\f")); /* Form feed (0x0C) */
|
||||
escape_string.replace((QChar)'\r', QSL("\\r")); /* Carriage return (0x0D) */
|
||||
escape_string.replace((QChar)0x1b, QSL("\\e")); /* Escape */
|
||||
escape_string.replace((QChar)0x1d, QSL("\\G")); /* Group Separator */
|
||||
escape_string.replace((QChar)0x1e, QSL("\\R")); /* Record Separator */
|
||||
Escaped = true;
|
||||
statusBarData->showMessage(tr("Escaped data"), tempMessageTimeout);
|
||||
}
|
||||
|
||||
txtDataInput->setPlainText(QString(escape_string));
|
||||
txtDataInput->setPlainText(escape_string);
|
||||
file.close();
|
||||
|
||||
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
||||
|
@ -28,10 +28,11 @@ class DataWindow : public QDialog, private Ui::DataDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DataWindow(const QString &input);
|
||||
DataWindow(const QString &input, bool isEscaped);
|
||||
~DataWindow();
|
||||
|
||||
bool Valid;
|
||||
bool Escaped;
|
||||
QString DataOutput;
|
||||
|
||||
private slots:
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>429</width>
|
||||
<width>500</width>
|
||||
<height>333</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -27,8 +27,7 @@
|
||||
<string>&Data</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Input data. Line Feeds (0xA0) will
|
||||
be converted to spaces</string>
|
||||
<string>Input data</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>txtDataInput</cstring>
|
||||
@ -56,7 +55,7 @@ be converted to spaces</string>
|
||||
<string>&From File...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Get input data from a file. Certain characters <br/>will be converted to escape sequences
|
||||
<string>Import input data from a file. Certain characters <br/>will be converted to escape sequences
|
||||
<table cellspacing="3">
|
||||
<tr><td>End of Transmission (0x04)</td><td>&nbsp;\E</td></tr>
|
||||
<tr><td>Bell (0x07)</td><td>&nbsp;\a</td></tr>
|
||||
@ -70,7 +69,7 @@ be converted to spaces</string>
|
||||
<tr><td>Record Separator (0x1E)</td><td>&nbsp;\R</td></tr>
|
||||
<tr><td>Backslash (0x5C)</td><td>&nbsp;\\</td></tr>
|
||||
</table>
|
||||
Note that Line Feed (0x0A) is not included</string>
|
||||
Note that Line Feeds (0x0A) are not included,<br/> but any present will be escaped on update</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -85,9 +84,9 @@ Note that Line Feed (0x0A) is not included</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<widget class="QStatusBar" name="statusBarData">
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@ -95,7 +94,7 @@ Note that Line Feed (0x0A) is not included</string>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnOK">
|
||||
@ -103,7 +102,8 @@ Note that Line Feed (0x0A) is not included</string>
|
||||
<string> &OK</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Close window and update input data</string>
|
||||
<string>Close window and update input data
|
||||
Line Feeds (0xA0) will be escaped as "\n"</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -24,205 +24,174 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horzLayoutSeq">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSeqCreate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Create Sequence</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vertLayoutSeqCreate">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horzLayoutSeqCreate">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="vertLayoutSeqCreateLbls">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSeqStartVal">
|
||||
<property name="toolTip">
|
||||
<string>Start sequence at this value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Start Value:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spnSeqStartVal</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSeqEndVal">
|
||||
<property name="toolTip">
|
||||
<string>End sequence at this value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>End &Value:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spnSeqEndVal</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSeqIncVal">
|
||||
<property name="toolTip">
|
||||
<string>Go from start to end in steps of this amount</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Increment &By:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spnSeqIncVal</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSeqFormat">
|
||||
<property name="toolTip">
|
||||
<string>Format sequence using special characters<table cellspacing="3">
|
||||
<tr><td>#</td><td>Number or space</td></tr>
|
||||
<tr><td>$</td><td>Number or '0'</td></tr>
|
||||
<tr><td>*</td><td>Number or '*'</td></tr>
|
||||
<tr><td>Other</td><td>Insert literally</td></tr>
|
||||
</table></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Format:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>linSeqFormat</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSeqCreate">
|
||||
<property name="toolTip">
|
||||
<string>Create a data sequence</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sequence:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSeqImport">
|
||||
<property name="toolTip">
|
||||
<string>Get a data sequence from a file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sequence File:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSeqExport">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save the symbols to files</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Generate Bar Codes:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<layout class="QVBoxLayout" name="vertLayoutSeqCreate">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSeqCreate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Create Sequence</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Generate a sequence</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayoutSeqCreate">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblSeqStartVal">
|
||||
<property name="toolTip">
|
||||
<string>Start sequence at this value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Start Value:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spnSeqStartVal</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="vertLayoutSeqCreateVals">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spnSeqStartVal">
|
||||
<property name="toolTip">
|
||||
<string>Start sequence at this value</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spnSeqEndVal">
|
||||
<property name="toolTip">
|
||||
<string>End sequence at this value</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spnSeqIncVal">
|
||||
<property name="toolTip">
|
||||
<string>Go from start to end in steps of this amount</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="linSeqFormat">
|
||||
<property name="toolTip">
|
||||
<string>Format sequence using special characters<table cellspacing="3">
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="spnSeqStartVal">
|
||||
<property name="toolTip">
|
||||
<string>Start sequence at this value</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblSeqEndVal">
|
||||
<property name="toolTip">
|
||||
<string>End sequence at this value</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>End &Value:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spnSeqEndVal</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="spnSeqEndVal">
|
||||
<property name="toolTip">
|
||||
<string>End sequence at this value</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lblSeqIncVal">
|
||||
<property name="toolTip">
|
||||
<string>Go from start to end in steps of this amount</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Increment &By:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>spnSeqIncVal</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="spnSeqIncVal">
|
||||
<property name="toolTip">
|
||||
<string>Go from start to end in steps of this amount</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblSeqFormat">
|
||||
<property name="toolTip">
|
||||
<string>Format sequence using special characters<table cellspacing="3">
|
||||
<tr><td>#</td><td>Number or space</td></tr>
|
||||
<tr><td>$</td><td>Number or '0'</td></tr>
|
||||
<tr><td>*</td><td>Number or '*'</td></tr>
|
||||
<tr><td>Other</td><td>Insert literally</td></tr>
|
||||
</table></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>F&ormat:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>linSeqFormat</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="linSeqFormat">
|
||||
<property name="toolTip">
|
||||
<string>Format sequence using special characters<table cellspacing="3">
|
||||
<tr><td>#</td><td>Number or space</td></tr>
|
||||
<tr><td>$</td><td>Number or '0'</td></tr>
|
||||
<tr><td>*</td><td>Number or '*'</td></tr>
|
||||
<tr><td>Other</td><td>Insert literally</td></tr>
|
||||
</table></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>$$$$$$</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horzLayoutSeqCreateBtn">
|
||||
<item>
|
||||
<spacer name="horzSpacerSeqCreateBtn">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>$$$$$$</string>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSeqCreate">
|
||||
<property name="toolTip">
|
||||
<string>Create a data sequence</string>
|
||||
<string>Generate a data sequence</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Crea&te</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSeqImport">
|
||||
<property name="toolTip">
|
||||
<string>Get a data sequence from a file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Import...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSeqExport">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save the symbols to files</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Export...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="vertSpacerCreate">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSeqPreview">
|
||||
@ -256,6 +225,26 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horzLayoutSeqBtns">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSeqFromFile">
|
||||
<property name="toolTip">
|
||||
<string>Import a data sequence from a file</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&From File...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSeqClear">
|
||||
<property name="toolTip">
|
||||
<string>Clear the sequence data</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string> C&lear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horzSpacerSeqBtns">
|
||||
<property name="orientation">
|
||||
@ -270,12 +259,15 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSeqClear">
|
||||
<widget class="QPushButton" name="btnSeqExport">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Clear the sequence data</string>
|
||||
<string>Save the symbols to files</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string> C&lear</string>
|
||||
<string>&Export...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -478,13 +478,18 @@ void MainWindow::help()
|
||||
|
||||
void MainWindow::open_data_dialog()
|
||||
{
|
||||
DataWindow dlg(txtData->text());
|
||||
DataWindow dlg(txtData->text(), chkEscape->isChecked());
|
||||
(void) dlg.exec();
|
||||
if (dlg.Valid) {
|
||||
const bool updated = txtData->text() != dlg.DataOutput;
|
||||
txtData->setText(dlg.DataOutput);
|
||||
if (updated) {
|
||||
statusBar->showMessage(tr("Updated data"), tempMessageTimeout);
|
||||
if (dlg.Escaped && !chkEscape->isChecked()) {
|
||||
chkEscape->setChecked(true);
|
||||
statusBar->showMessage(tr("Set \"Parse Escapes\", updated data"), tempMessageTimeout);
|
||||
} else {
|
||||
statusBar->showMessage(tr("Updated data"), tempMessageTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ SequenceWindow::SequenceWindow(BarcodeItem *bc) : m_bc(bc)
|
||||
connect(btnSeqClear, SIGNAL( clicked( bool )), SLOT(clear_preview()));
|
||||
connect(btnSeqCreate, SIGNAL( clicked( bool )), SLOT(create_sequence()));
|
||||
connect(txtSeqPreview, SIGNAL( textChanged()), SLOT(check_generate()));
|
||||
connect(btnSeqImport, SIGNAL( clicked( bool )), SLOT(import()));
|
||||
connect(btnSeqFromFile, SIGNAL( clicked( bool )), SLOT(from_file()));
|
||||
connect(btnSeqExport, SIGNAL( clicked( bool )), SLOT(generate_sequence()));
|
||||
}
|
||||
|
||||
@ -166,14 +166,12 @@ void SequenceWindow::check_generate()
|
||||
preview_copy = txtSeqPreview->toPlainText();
|
||||
if (preview_copy.isEmpty()) {
|
||||
btnSeqExport->setEnabled(false);
|
||||
lblSeqExport->setEnabled(false);
|
||||
} else {
|
||||
btnSeqExport->setEnabled(true);
|
||||
lblSeqExport->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SequenceWindow::import()
|
||||
void SequenceWindow::from_file()
|
||||
{
|
||||
QSettings settings;
|
||||
#if QT_VERSION < 0x60000
|
||||
|
@ -39,7 +39,7 @@ private slots:
|
||||
void clear_preview();
|
||||
void create_sequence();
|
||||
void check_generate();
|
||||
void import();
|
||||
void from_file();
|
||||
void generate_sequence();
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user