diff --git a/glabels/ObjectEditor.cpp b/glabels/ObjectEditor.cpp index 2d496a5..09c14a3 100644 --- a/glabels/ObjectEditor.cpp +++ b/glabels/ObjectEditor.cpp @@ -22,6 +22,7 @@ #include "LabelModel.h" #include "LabelModelObject.h" +#include "LabelModelBarcodeObject.h" #include "LabelModelBoxObject.h" #include "LabelModelEllipseObject.h" #include "LabelModelImageObject.h" @@ -62,6 +63,7 @@ namespace glabels lineColorButton->init( "No line", QColor(0,0,0,0), QColor(0,0,0,255) ); fillColorButton->init( "No fill", QColor(0,0,0,0), QColor(0,0,0,255) ); textColorButton->init( "Default", QColor(0,0,0,255), QColor(0,0,0,255) ); + barcodeColorButton->init( "Default", QColor(0,0,0,255), QColor(0,0,0,255) ); shadowColorButton->init( "Default", QColor(0,0,0,255), QColor(0,0,0,255) ); textInsertFieldCombo->setName( "Insert Field" ); @@ -240,6 +242,21 @@ namespace glabels } + void ObjectEditor::loadBarcodePage() + { + if ( mObject ) + { + mBlocked = true; + + barcodeShowTextCheck->setChecked( mObject->bcTextFlag() ); + barcodeChecksumCheck->setChecked( mObject->bcChecksumFlag() ); + barcodeColorButton->setColorNode( mObject->bcColorNode() ); + + mBlocked = false; + } + } + + void ObjectEditor::loadShadowPage() { if ( mObject ) @@ -412,6 +429,23 @@ namespace glabels setEnabled( true ); } + else if ( dynamic_cast(mObject) ) + { + titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-barcode.svg") ); + titleLabel->setText( tr("Barcode object properties") ); + + notebook->addTab( barcodePage, "barcode" ); + notebook->addTab( posSizePage, "position/size" ); + + sizeRectFrame->setVisible( true ); + sizeOriginalSizeGroup->setVisible( false ); + sizeLineFrame->setVisible( false ); + + loadBarcodePage(); + loadPositionPage(); + + setEnabled( true ); + } else { Q_ASSERT_X( false, "ObjectEditor::onSelectionChanged", "Invalid object" ); @@ -659,6 +693,21 @@ namespace glabels } + void ObjectEditor::onBarcodeControlsChanged() + { + if ( !mBlocked ) + { + mBlocked = true; + + mObject->setBcTextFlag( barcodeShowTextCheck->isChecked() ); + mObject->setBcChecksumFlag( barcodeChecksumCheck->isChecked() ); + mObject->setBcColorNode( barcodeColorButton->colorNode() ); + + mBlocked = false; + } + } + + void ObjectEditor::onResetImageSize() { mObject->setSize( mObject->naturalSize() ); diff --git a/glabels/ObjectEditor.h b/glabels/ObjectEditor.h index c66cecc..6a8f8a2 100644 --- a/glabels/ObjectEditor.h +++ b/glabels/ObjectEditor.h @@ -70,6 +70,7 @@ namespace glabels void loadRectSizePage(); void loadLineSizePage(); void loadTextPage(); + void loadBarcodePage(); void loadShadowPage(); @@ -93,6 +94,7 @@ namespace glabels void onLineSizeControlsChanged(); void onTextControlsChanged(); void onTextInsertFieldKeySelected( QString key ); + void onBarcodeControlsChanged(); void onResetImageSize(); void onShadowControlsChanged(); void onChanged(); diff --git a/glabels/ui/ObjectEditor.ui b/glabels/ui/ObjectEditor.ui index 4f94a6c..1897a96 100644 --- a/glabels/ui/ObjectEditor.ui +++ b/glabels/ui/ObjectEditor.ui @@ -7,7 +7,7 @@ 0 0 400 - 853 + 859 @@ -1574,7 +1574,7 @@ - :/icons/24x24/actions/glabels-object-properties.png + :/icons/24x24/actions/glabels-object-properties.png @@ -1602,6 +1602,9 @@ glabels::ColorButton QPushButton
ColorButton.h
+ + colorChanged() + glabels::FieldButton @@ -1652,8 +1655,8 @@ onTextControlsChanged() - 125 - 183 + 111 + 220 396 @@ -1668,8 +1671,8 @@ onTextControlsChanged() - 172 - 200 + 154 + 220 396 @@ -1684,8 +1687,8 @@ onTextControlsChanged() - 236 - 200 + 197 + 220 395 @@ -1700,8 +1703,8 @@ onTextControlsChanged() - 138 - 235 + 121 + 262 396 @@ -1716,8 +1719,8 @@ onTextControlsChanged() - 154 - 310 + 148 + 352 396 @@ -1732,8 +1735,8 @@ onTextControlsChanged() - 219 - 315 + 191 + 352 398 @@ -1748,8 +1751,8 @@ onTextControlsChanged() - 271 - 315 + 234 + 352 395 @@ -1764,8 +1767,8 @@ onTextControlsChanged() - 161 - 357 + 148 + 398 393 @@ -1780,8 +1783,8 @@ onTextControlsChanged() - 209 - 352 + 191 + 398 396 @@ -1796,8 +1799,8 @@ onTextControlsChanged() - 271 - 357 + 234 + 398 397 @@ -1812,8 +1815,8 @@ onTextControlsChanged() - 173 - 389 + 195 + 438 394 @@ -1821,134 +1824,6 @@ - - barcodeTypeCombo - currentIndexChanged(int) - ObjectEditor - onChanged() - - - 162 - 113 - - - 394 - 114 - - - - - barcodeShowTextCheck - toggled(bool) - ObjectEditor - onChanged() - - - 172 - 151 - - - 397 - 145 - - - - - barcodeChecksumCheck - toggled(bool) - ObjectEditor - onChanged() - - - 160 - 175 - - - 5 - 174 - - - - - barcodeColorButton - colorChanged() - ObjectEditor - onChanged() - - - 125 - 210 - - - 1 - 211 - - - - - barcodeLiteralRadio - toggled(bool) - ObjectEditor - onChanged() - - - 55 - 277 - - - 0 - 271 - - - - - barcodeKeyRadio - toggled(bool) - ObjectEditor - onChanged() - - - 57 - 387 - - - 2 - 391 - - - - - barcodeTextEdit - textChanged() - ObjectEditor - onChanged() - - - 333 - 299 - - - 0 - 312 - - - - - barcodeDigitsSpin - valueChanged(int) - ObjectEditor - onChanged() - - - 206 - 446 - - - 393 - 476 - - - lineWidthSpin valueChanged(double) @@ -1956,8 +1831,8 @@ onLineControlsChanged() - 119 - 117 + 182 + 135 392 @@ -1972,8 +1847,8 @@ onLineControlsChanged() - 105 - 150 + 129 + 175 1 @@ -1988,8 +1863,8 @@ onFillControlsChanged() - 146 - 236 + 128 + 260 6 @@ -2004,8 +1879,8 @@ onPositionControlsChanged() - 153 - 128 + 172 + 134 399 @@ -2020,8 +1895,8 @@ onPositionControlsChanged() - 112 - 160 + 172 + 174 325 @@ -2036,8 +1911,8 @@ onRectSizeControlsChanged() - 135 - 223 + 172 + 258 3 @@ -2052,8 +1927,8 @@ onRectSizeControlsChanged() - 98 - 262 + 172 + 298 0 @@ -2068,8 +1943,8 @@ onResetImageSize() - 228 - 323 + 201 + 368 4 @@ -2084,12 +1959,12 @@ onShadowControlsChanged() - 58 - 84 + 68 + 80 183 - -5 + 0 @@ -2100,8 +1975,8 @@ onShadowControlsChanged() - 125 - 127 + 172 + 136 398 @@ -2116,12 +1991,12 @@ onShadowControlsChanged() - 147 - 151 + 172 + 176 294 - -2 + 0 @@ -2132,11 +2007,11 @@ onShadowControlsChanged() - 106 - 194 + 128 + 216 - 405 + 399 410 @@ -2148,11 +2023,11 @@ onShadowControlsChanged() - 151 - 227 + 167 + 258 - 406 + 399 503 @@ -2164,8 +2039,8 @@ onLineSizeControlsChanged() - 144 - 386 + 172 + 452 5 @@ -2180,8 +2055,8 @@ onLineSizeControlsChanged() - 164 - 424 + 181 + 492 1 @@ -2196,8 +2071,8 @@ onImageFileButtonClicked() - 190 - 161 + 125 + 172 394 @@ -2212,8 +2087,8 @@ onImageKeySelected(QString) - 343 - 151 + 313 + 172 397 @@ -2244,8 +2119,8 @@ onTextInsertFieldKeySelected(QString) - 231 - 653 + 240 + 699 395 @@ -2253,6 +2128,134 @@ + + barcodeTypeCombo + textChanged(QString) + ObjectEditor + onBarcodeControlsChanged() + + + 102 + 116 + + + 399 + 144 + + + + + barcodeShowTextCheck + toggled(bool) + ObjectEditor + onBarcodeControlsChanged() + + + 123 + 159 + + + 4 + 167 + + + + + barcodeChecksumCheck + toggled(bool) + ObjectEditor + onBarcodeControlsChanged() + + + 94 + 187 + + + 1 + 197 + + + + + barcodeLiteralRadio + toggled(bool) + ObjectEditor + onBarcodeControlsChanged() + + + 68 + 302 + + + 5 + 331 + + + + + barcodeKeyRadio + toggled(bool) + ObjectEditor + onBarcodeControlsChanged() + + + 39 + 401 + + + 2 + 377 + + + + + barcodeDigitsSpin + valueChanged(int) + ObjectEditor + onBarcodeControlsChanged() + + + 216 + 485 + + + 397 + 532 + + + + + barcodeTextEdit + textChanged() + ObjectEditor + onBarcodeControlsChanged() + + + 242 + 333 + + + 4 + 369 + + + + + barcodeColorButton + colorChanged() + ObjectEditor + onBarcodeControlsChanged() + + + 89 + 227 + + + 1 + 454 + + + onChanged() @@ -2267,5 +2270,6 @@ onImageKeySelected(QString) onTextControlsChanged() onTextInsertFieldKeySelected(QString) + onBarcodeControlsChanged() diff --git a/translations/glabels_C.ts b/translations/glabels_C.ts index 78c204b..d20828f 100644 --- a/translations/glabels_C.ts +++ b/translations/glabels_C.ts @@ -1807,134 +1807,139 @@ glabels::ObjectEditor - + Original size - + Box object properties - + Ellipse object properties - + Image object properties - + Line object properties - + Text object properties - + + Barcode object properties + + + + Line - + Fill - + Image files (*.png *.jpg *.jpeg *.gif *.bmp *.pbm *.pgm *.ppm *.xbm *.xpm *.svg) - + All files (*) - + PNG - Portable Network Graphics (*.png) - + BMP - Windows Bitmap (*.bmp) - + GIF - Graphics Interchange Format (*.gif) - + JPEG - Joint Photographic Experts Group (*.jpg *.jpeg) - + PBM - Portable Bitmap (*.pbm) - + PGM - Portable Graymap (*.pgm) - + PPM - Portable Pixmap (*.ppm) - + SVG - Scalable Vector Graphics (*.svg) - + XBM - X11 Bitmap (*.xbm) - + XPM - X11 Pixmap (*.xpm) - + gLabels - Select image file - - + + Set image - + Move - + Size - + Text - + Shadow