Move maxicode options to options tab

This commit is contained in:
hooper114 2009-05-26 23:07:16 +00:00
parent db87cda5a4
commit d593111979
5 changed files with 383 additions and 261 deletions

View File

@ -10,7 +10,8 @@ QT4_WRAP_CPP(QZint_frontend_SRCS mainwindow.h)
QT4_WRAP_UI(QZint_frontend_SRCS mainWindow.ui ) QT4_WRAP_UI(QZint_frontend_SRCS mainWindow.ui )
# grpAztec.ui grpC39.ui grpDM.ui grpMSICheck.ui # grpAztec.ui grpC39.ui grpDM.ui grpMSICheck.ui
# grpC128.ui grpChannel.ui grpMicroPDF.ui grpPDF417.ui # grpC128.ui grpChannel.ui grpMicroPDF.ui grpPDF417.ui
# grpC16k.ui grpCodablock.ui grpMQR.ui grpQR.ui) # grpC16k.ui grpCodablock.ui grpMQR.ui grpQR.ui
# grpMaxicode.ui)
QT4_ADD_RESOURCES(QZint_frontend_SRCS resources.qrc) QT4_ADD_RESOURCES(QZint_frontend_SRCS resources.qrc)

108
frontend_qt4/grpMaxicode.ui Normal file
View File

@ -0,0 +1,108 @@
<ui version="4.0" >
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>436</width>
<height>180</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<widget class="QWidget" name="gridLayoutWidget" >
<property name="geometry" >
<rect>
<x>18</x>
<y>15</y>
<width>400</width>
<height>69</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="1" >
<widget class="QComboBox" name="cmbMaxiMode" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex" >
<number>1</number>
</property>
<item>
<property name="text" >
<string>Structured Carrier Message (Mode 2 or 3)</string>
</property>
</item>
<item>
<property name="text" >
<string>Standard Symbol, SEC (Mode 4)</string>
</property>
</item>
<item>
<property name="text" >
<string>Full ECC Symbol (Mode 5)</string>
</property>
</item>
<item>
<property name="text" >
<string>Reader Program, SEC (Mode 6)</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="txtMaxiPrimary" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Primary Data Here!</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="lblMaxiMode" >
<property name="text" >
<string>Encoding Mode:</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="lblMaxiPrimary" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Primary Data:</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0" > <ui version="4.0" >
<class>mainWindow</class> <class>mainWindow</class>
<widget class="QWidget" name="mainWindow" > <widget class="QWidget" name="mainWindow" >
@ -6,10 +5,16 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>556</width> <width>749</width>
<height>893</height> <height>741</height>
</rect> </rect>
</property> </property>
<property name="maximumSize" >
<size>
<width>800</width>
<height>800</height>
</size>
</property>
<property name="windowTitle" > <property name="windowTitle" >
<string>Zint Barcode Studio</string> <string>Zint Barcode Studio</string>
</property> </property>
@ -20,7 +25,7 @@
<string>Preview</string> <string>Preview</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2" > <layout class="QGridLayout" name="gridLayout_2" >
<item row="0" column="0" rowspan="3" colspan="3"> <item rowspan="3" row="0" column="0" colspan="3" >
<widget class="QGraphicsView" name="view" > <widget class="QGraphicsView" name="view" >
<property name="minimumSize" > <property name="minimumSize" >
<size> <size>
@ -140,22 +145,55 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="bstyle"/> <widget class="QComboBox" name="bstyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QTabWidget" name="tabMain" > <widget class="QTabWidget" name="tabMain" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>350</height>
</size>
</property>
<property name="currentIndex" > <property name="currentIndex" >
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tabGeneral" > <widget class="QWidget" name="tabGeneral" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>727</width>
<height>248</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>General</string> <string>General</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_3" > <layout class="QVBoxLayout" name="verticalLayout_3" >
<item> <item>
<widget class="QGroupBox" name="grpData" > <widget class="QGroupBox" name="grpData" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" > <property name="title" >
<string>Data to Encode</string> <string>Data to Encode</string>
</property> </property>
@ -170,77 +208,29 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="grpMaxiCode">
<property name="title">
<string>Maxicode</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="lblMaxiMode">
<property name="text">
<string>Encoding Mode:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cmbMaxiMode">
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>Structured Carrier Message (Mode 2 or 3)</string>
</property>
</item>
<item>
<property name="text">
<string>Standard Symbol, SEC (Mode 4)</string>
</property>
</item>
<item>
<property name="text">
<string>Full ECC Symbol (Mode 5)</string>
</property>
</item>
<item>
<property name="text">
<string>Reader Program, SEC (Mode 6)</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblMaxiPrimary">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Primary Data:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtMaxiPrimary">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Primary Data Here!</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="grpComposite" > <widget class="QGroupBox" name="grpComposite" >
<property name="enabled" > <property name="enabled" >
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>400</height>
</size>
</property>
<property name="title" > <property name="title" >
<string>Composite Code</string> <string>Composite Code</string>
</property> </property>
@ -329,12 +319,24 @@
<property name="enabled" > <property name="enabled" >
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>60</height>
</size>
</property>
<property name="html" > <property name="html" >
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;Your Data Here!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans';">&lt;span style=" font-family:'Sans Serif';">Your Data Here!&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property> </property>
<property name="acceptRichText" > <property name="acceptRichText" >
<bool>false</bool> <bool>false</bool>
@ -349,6 +351,14 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabAppear" > <widget class="QWidget" name="tabAppear" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>534</width>
<height>324</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>Appearance</string> <string>Appearance</string>
</attribute> </attribute>

View File

@ -119,9 +119,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
connect(cmbCompType, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(cmbCompType, SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(rotateSlider, SIGNAL(valueChanged(int)), SLOT(scaleRotate())); connect(rotateSlider, SIGNAL(valueChanged(int)), SLOT(scaleRotate()));
connect(scaleSlider, SIGNAL(valueChanged(int)), SLOT(scaleRotate())); connect(scaleSlider, SIGNAL(valueChanged(int)), SLOT(scaleRotate()));
connect(cmbMaxiMode, SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(cmbMaxiMode, SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary()));
connect(txtMaxiPrimary, SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
connect(spnWhitespace, SIGNAL(valueChanged( int )), SLOT(update_preview())); connect(spnWhitespace, SIGNAL(valueChanged( int )), SLOT(update_preview()));
connect(btnAbout, SIGNAL(clicked( bool )), SLOT(about())); connect(btnAbout, SIGNAL(clicked( bool )), SLOT(about()));
connect(btnSave, SIGNAL(clicked( bool )), SLOT(save())); connect(btnSave, SIGNAL(clicked( bool )), SLOT(save()));
@ -397,12 +394,15 @@ void MainWindow::change_options()
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MAXICODE) if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MAXICODE)
{ {
QFile file(":/grpMaxiCode.ui"); QFile file(":/grpMaxicode.ui");
if (!file.open(QIODevice::ReadOnly)) if (!file.open(QIODevice::ReadOnly))
return; return;
m_optionWidget=uiload.load(&file); m_optionWidget=uiload.load(&file);
file.close(); file.close();
tabMain->insertTab(1,m_optionWidget,tr("Options")); tabMain->insertTab(1,m_optionWidget,tr("Options"));
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary()));
connect(m_optionWidget->findChild<QObject*>("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
} }
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CHANNEL) if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CHANNEL)
@ -486,12 +486,14 @@ void MainWindow::datamatrix_options()
void MainWindow::maxi_primary() void MainWindow::maxi_primary()
{ {
if(cmbMaxiMode->currentIndex() == 0) { if (metaObject()->enumerator(0).value(bstyle->currentIndex())!=BARCODE_MAXICODE)
lblMaxiPrimary->setEnabled(true); return;
txtMaxiPrimary->setEnabled(true); if(m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() == 0) {
m_optionWidget->findChild<QLabel*>("lblMaxiPrimary")->setEnabled(true);
m_optionWidget->findChild<QLineEdit*>("txtMaxiPrimary")->setEnabled(true);
} else { } else {
lblMaxiPrimary->setEnabled(false); m_optionWidget->findChild<QLabel*>("lblMaxiPrimary")->setEnabled(false);
txtMaxiPrimary->setEnabled(false); m_optionWidget->findChild<QLineEdit*>("txtMaxiPrimary")->setEnabled(false);
} }
} }
@ -713,13 +715,13 @@ void MainWindow::update_preview()
case BARCODE_MAXICODE: case BARCODE_MAXICODE:
m_bc.bc.setSymbol(BARCODE_MAXICODE); m_bc.bc.setSymbol(BARCODE_MAXICODE);
if(cmbMaxiMode->currentIndex() == 0) if(m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() == 0)
{ {
m_bc.bc.setSecurityLevel(2); m_bc.bc.setSecurityLevel(2);
m_bc.bc.setPrimaryMessage(txtMaxiPrimary->text()); m_bc.bc.setPrimaryMessage(m_optionWidget->findChild<QLineEdit*>("txtMaxiPrimary")->text());
} }
else else
m_bc.bc.setSecurityLevel(cmbMaxiMode->currentIndex() + 3); m_bc.bc.setSecurityLevel(m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() + 3);
break; break;
case BARCODE_CHANNEL: case BARCODE_CHANNEL:

View File

@ -11,6 +11,7 @@
<file>grpC128.ui</file> <file>grpC128.ui</file>
<file>grpChannel.ui</file> <file>grpChannel.ui</file>
<file>grpMicroPDF.ui</file> <file>grpMicroPDF.ui</file>
<file>grpMaxicode.ui</file>
<file>grpPDF417.ui</file> <file>grpPDF417.ui</file>
<file>grpC16k.ui</file> <file>grpC16k.ui</file>
<file>grpCodablock.ui</file> <file>grpCodablock.ui</file>