From d593111979f8c4c2646627806b15c02fea5875a2 Mon Sep 17 00:00:00 2001 From: hooper114 Date: Tue, 26 May 2009 23:07:16 +0000 Subject: [PATCH] Move maxicode options to options tab --- frontend_qt4/CMakeLists.txt | 3 +- frontend_qt4/grpMaxicode.ui | 108 ++++++++ frontend_qt4/mainWindow.ui | 506 ++++++++++++++++++------------------ frontend_qt4/mainwindow.cpp | 26 +- frontend_qt4/resources.qrc | 1 + 5 files changed, 383 insertions(+), 261 deletions(-) create mode 100644 frontend_qt4/grpMaxicode.ui diff --git a/frontend_qt4/CMakeLists.txt b/frontend_qt4/CMakeLists.txt index 13489942..a4d531e0 100644 --- a/frontend_qt4/CMakeLists.txt +++ b/frontend_qt4/CMakeLists.txt @@ -10,7 +10,8 @@ QT4_WRAP_CPP(QZint_frontend_SRCS mainwindow.h) QT4_WRAP_UI(QZint_frontend_SRCS mainWindow.ui ) # grpAztec.ui grpC39.ui grpDM.ui grpMSICheck.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) diff --git a/frontend_qt4/grpMaxicode.ui b/frontend_qt4/grpMaxicode.ui new file mode 100644 index 00000000..03ac5a9c --- /dev/null +++ b/frontend_qt4/grpMaxicode.ui @@ -0,0 +1,108 @@ + + Form + + + + 0 + 0 + 436 + 180 + + + + + 0 + 0 + + + + Form + + + + + 18 + 15 + 400 + 69 + + + + + + + + 0 + 0 + + + + 1 + + + + Structured Carrier Message (Mode 2 or 3) + + + + + Standard Symbol, SEC (Mode 4) + + + + + Full ECC Symbol (Mode 5) + + + + + Reader Program, SEC (Mode 6) + + + + + + + + false + + + + 0 + 0 + + + + Primary Data Here! + + + + + + + Encoding Mode: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + Primary Data: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + diff --git a/frontend_qt4/mainWindow.ui b/frontend_qt4/mainWindow.ui index f0aa0f19..a7628100 100644 --- a/frontend_qt4/mainWindow.ui +++ b/frontend_qt4/mainWindow.ui @@ -1,28 +1,33 @@ - - + mainWindow - - + + 0 0 - 556 - 893 + 749 + 741 - + + + 800 + 800 + + + Zint Barcode Studio - + - - + + Preview - - - - + + + + 0 300 @@ -30,16 +35,16 @@ - - - + + + ... - - + + :/zoomout.png:/zoomout.png - + 22 22 @@ -47,35 +52,35 @@ - - - + + + 50 - + 400 - + 100 - + Qt::Vertical - + true - + false - - - - + + + + :/zoomin.png:/zoomin.png - + 22 22 @@ -83,13 +88,13 @@ - - - - + + + + :/rotateleft.png:/rotateleft.png - + 22 22 @@ -97,23 +102,23 @@ - - - + + + 360 - + Qt::Horizontal - - - - + + + + :/rotateright.png:/rotateright.png - + 22 22 @@ -125,44 +130,77 @@ - + - - + + &Symbology: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + bstyle - + + + + 0 + 0 + + + - - + + + + 0 + 0 + + + + + 16777215 + 350 + + + 0 - - + + + + 0 + 0 + 727 + 248 + + + General - + - - + + + + 0 + 0 + + + Data to Encode - + - - + + Your Data Here! @@ -171,95 +209,47 @@ - - - Maxicode - - - - - - Encoding Mode: - - - - - - - 1 - - - - Structured Carrier Message (Mode 2 or 3) - - - - - Standard Symbol, SEC (Mode 4) - - - - - Full ECC Symbol (Mode 5) - - - - - Reader Program, SEC (Mode 6) - - - - - - - - false - - - Primary Data: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - false - - - Primary Data Here! - - - - - - - - - + + true - + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 400 + + + Composite Code - + - + - - + + &Add 2D Component - - + + Qt::Horizontal - + 40 20 @@ -268,40 +258,40 @@ - - + + false - + Component T&ype: - + cmbCompType - - + + false - + Automatic - + CC-A - + CC-B - + CC-C @@ -310,33 +300,45 @@ - + - - + + false - + &2D Component Data: - + txtComposite - - + + false - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">Your Data Here!</span></p></body></html> + + + 0 + 0 + - + + + 16777215 + 60 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<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';"><span style=" font-family:'Sans Serif';">Your Data Here!</span></p></body></html> + + false @@ -348,112 +350,120 @@ p, li { white-space: pre-wrap; } - - + + + + 0 + 0 + 534 + 324 + + + Appearance - + - + - - - - + + + + Height: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - + + + X - + - + 300 - + 50 - - - + + + Border width: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - + + + X - + 0 - + 16 - + 0 - - - + + + Whitespace: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - + + + X - - - + + + Printing Scale: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - + + + - + 2 - + 0.500000000000000 - + 99.500000000000000 - + 0.500000000000000 - + 1.000000000000000 @@ -461,46 +471,46 @@ p, li { white-space: pre-wrap; } - - - - + + + + Border type: - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + - + No border - + Bind - + Box - - - + + + Backgound Colour - - - + + + Foreground Colour @@ -510,11 +520,11 @@ p, li { white-space: pre-wrap; } - - + + Qt::Vertical - + 20 228 @@ -527,20 +537,20 @@ p, li { white-space: pre-wrap; } - + - - + + About - - + + Qt::Horizontal - + 288 20 @@ -549,25 +559,25 @@ p, li { white-space: pre-wrap; } - - + + Save - - + + false - + Copy - - + + E&xit @@ -586,7 +596,7 @@ p, li { white-space: pre-wrap; } view - + @@ -595,11 +605,11 @@ p, li { white-space: pre-wrap; } rotateSlider subtractStep() - + 29 265 - + 76 265 @@ -611,11 +621,11 @@ p, li { white-space: pre-wrap; } rotateSlider addStep() - + 491 260 - + 431 260 @@ -627,11 +637,11 @@ p, li { white-space: pre-wrap; } scaleSlider addStep() - + 532 231 - + 528 191 @@ -643,11 +653,11 @@ p, li { white-space: pre-wrap; } scaleSlider subtractStep() - + 530 56 - + 530 94 diff --git a/frontend_qt4/mainwindow.cpp b/frontend_qt4/mainwindow.cpp index 07588ba3..0e48a36c 100644 --- a/frontend_qt4/mainwindow.cpp +++ b/frontend_qt4/mainwindow.cpp @@ -119,9 +119,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl) connect(cmbCompType, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); connect(rotateSlider, 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(btnAbout, SIGNAL(clicked( bool )), SLOT(about())); connect(btnSave, SIGNAL(clicked( bool )), SLOT(save())); @@ -397,12 +394,15 @@ void MainWindow::change_options() if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MAXICODE) { - QFile file(":/grpMaxiCode.ui"); + QFile file(":/grpMaxicode.ui"); if (!file.open(QIODevice::ReadOnly)) return; m_optionWidget=uiload.load(&file); file.close(); tabMain->insertTab(1,m_optionWidget,tr("Options")); + connect(m_optionWidget->findChild("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(m_optionWidget->findChild("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary())); + connect(m_optionWidget->findChild("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview())); } if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CHANNEL) @@ -486,12 +486,14 @@ void MainWindow::datamatrix_options() void MainWindow::maxi_primary() { - if(cmbMaxiMode->currentIndex() == 0) { - lblMaxiPrimary->setEnabled(true); - txtMaxiPrimary->setEnabled(true); + if (metaObject()->enumerator(0).value(bstyle->currentIndex())!=BARCODE_MAXICODE) + return; + if(m_optionWidget->findChild("cmbMaxiMode")->currentIndex() == 0) { + m_optionWidget->findChild("lblMaxiPrimary")->setEnabled(true); + m_optionWidget->findChild("txtMaxiPrimary")->setEnabled(true); } else { - lblMaxiPrimary->setEnabled(false); - txtMaxiPrimary->setEnabled(false); + m_optionWidget->findChild("lblMaxiPrimary")->setEnabled(false); + m_optionWidget->findChild("txtMaxiPrimary")->setEnabled(false); } } @@ -713,13 +715,13 @@ void MainWindow::update_preview() case BARCODE_MAXICODE: m_bc.bc.setSymbol(BARCODE_MAXICODE); - if(cmbMaxiMode->currentIndex() == 0) + if(m_optionWidget->findChild("cmbMaxiMode")->currentIndex() == 0) { m_bc.bc.setSecurityLevel(2); - m_bc.bc.setPrimaryMessage(txtMaxiPrimary->text()); + m_bc.bc.setPrimaryMessage(m_optionWidget->findChild("txtMaxiPrimary")->text()); } else - m_bc.bc.setSecurityLevel(cmbMaxiMode->currentIndex() + 3); + m_bc.bc.setSecurityLevel(m_optionWidget->findChild("cmbMaxiMode")->currentIndex() + 3); break; case BARCODE_CHANNEL: diff --git a/frontend_qt4/resources.qrc b/frontend_qt4/resources.qrc index fd3ffb98..a257cb37 100644 --- a/frontend_qt4/resources.qrc +++ b/frontend_qt4/resources.qrc @@ -11,6 +11,7 @@ grpC128.ui grpChannel.ui grpMicroPDF.ui + grpMaxicode.ui grpPDF417.ui grpC16k.ui grpCodablock.ui