diff --git a/glabels/CMakeLists.txt b/glabels/CMakeLists.txt index b8fe177..4deacee 100644 --- a/glabels/CMakeLists.txt +++ b/glabels/CMakeLists.txt @@ -34,17 +34,18 @@ set (glabels_sources MergeField.cpp MergePropertyEditor.cpp MergeRecord.cpp - NewLabelDialog.cpp ObjectEditor.cpp Outline.cpp PageRenderer.cpp PrintView.cpp + PropertiesView.cpp Preview.cpp PreviewOverlayItem.cpp + SelectProductDialog.cpp + SimplePreview.cpp TemplatePicker.cpp TemplatePickerItem.cpp TextNode.cpp - SimplePreview.cpp View.cpp XmlLabelCreator.cpp XmlLabelParser.cpp @@ -70,20 +71,22 @@ set (glabels_qobject_headers MainWindow.h Merge.h MergePropertyEditor.h - NewLabelDialog.h ObjectEditor.h PrintView.h + PropertiesView.h Preview.h + SelectProductDialog.h SimplePreview.h TemplatePicker.h View.h ) set (glabels_forms - ui/NewLabelDialog.ui - ui/ObjectEditor.ui ui/MergePropertyEditor.ui + ui/ObjectEditor.ui ui/PrintView.ui + ui/PropertiesView.ui + ui/SelectProductDialog.ui ) set (glabels_resource_files diff --git a/glabels/File.cpp b/glabels/File.cpp index a4d7f17..bf1d58f 100644 --- a/glabels/File.cpp +++ b/glabels/File.cpp @@ -22,7 +22,7 @@ #include "MainWindow.h" #include "LabelModel.h" -#include "NewLabelDialog.h" +#include "libglabels/Db.h" #include "XmlLabelParser.h" #include "XmlLabelCreator.h" #include "FileUtil.h" @@ -40,27 +40,15 @@ namespace glabels /// void File::newLabel( MainWindow *window ) { - NewLabelDialog newDialog( window ); - newDialog.exec(); + // @TODO lookup latest template, if none default based on locale + const libglabels::Template* tmplate = libglabels::Db::lookupTemplateFromBrandPart( "Avery", "5159" ); + LabelModel* label = new LabelModel(); + label->setTmplate( tmplate ); + label->setRotate( false ); - const libglabels::Template* tmplate = newDialog.tmplate(); - if ( tmplate ) - { - LabelModel* label = new LabelModel(); - label->setTmplate( tmplate ); - label->setRotate( newDialog.rotate() ); - - if ( window->isEmpty() ) - { - window->setModel( label ); - } - else - { - MainWindow *newWindow = new MainWindow(); - newWindow->setModel( label ); - newWindow->show(); - } - } + MainWindow *newWindow = new MainWindow(); + newWindow->setModel( label ); + newWindow->show(); } diff --git a/glabels/File.h b/glabels/File.h index 50a557b..37e5055 100644 --- a/glabels/File.h +++ b/glabels/File.h @@ -37,7 +37,7 @@ namespace glabels Q_OBJECT public: - static void newLabel( MainWindow *window ); + static void newLabel( MainWindow *window = 0 ); static void open( MainWindow *window ); static bool save( MainWindow *window ); static bool saveAs( MainWindow *window ); diff --git a/glabels/MainWindow.cpp b/glabels/MainWindow.cpp index 8378591..7789e01 100644 --- a/glabels/MainWindow.cpp +++ b/glabels/MainWindow.cpp @@ -33,6 +33,7 @@ #include #include "libglabels/Db.h" +#include "PropertiesView.h" #include "View.h" #include "ObjectEditor.h" #include "MergePropertyEditor.h" @@ -63,11 +64,13 @@ namespace glabels createMenus(); createToolBars(); + QWidget* propertiesPage = createPropertiesPage(); QWidget* editorPage = createEditorPage(); QWidget* mergePage = createMergePage(); QWidget* printPage = createPrintPage(); mNotebook = new QTabWidget(); + mNotebook->addTab( propertiesPage, "Properties" ); mNotebook->addTab( editorPage, "Editor" ); mNotebook->addTab( mergePage, "Merge" ); mNotebook->addTab( printPage, "Print" ); @@ -111,6 +114,7 @@ namespace glabels void MainWindow::setModel( LabelModel *label ) { mModel = label; + mPropertiesView->setModel( mModel ); mView->setModel( mModel ); mObjectEditor->setModel( mModel ); mPrintView->setModel( mModel ); @@ -618,6 +622,17 @@ namespace glabels } + /// + /// Create Properties Page + /// + QWidget* MainWindow::createPropertiesPage() + { + mPropertiesView = new PropertiesView(); + + return mPropertiesView; + } + + /// /// Create Editor Page /// diff --git a/glabels/MainWindow.h b/glabels/MainWindow.h index a328aec..4a0f798 100644 --- a/glabels/MainWindow.h +++ b/glabels/MainWindow.h @@ -36,6 +36,7 @@ namespace glabels { // Forward References class LabelModel; + class PropertiesView; class View; class ObjectEditor; class MergePropertyEditor; @@ -154,6 +155,7 @@ namespace glabels void createToolBars(); void createStatusBar(); + QWidget* createPropertiesPage(); QWidget* createEditorPage(); QWidget* createMergePage(); QWidget* createPrintPage(); @@ -200,6 +202,7 @@ namespace glabels QTabWidget* mNotebook; LabelModel* mModel; + PropertiesView* mPropertiesView; QScrollArea* mViewScrollArea; View* mView; ObjectEditor* mObjectEditor; diff --git a/glabels/NewLabelDialog.cpp b/glabels/NewLabelDialog.cpp deleted file mode 100644 index 5c8de34..0000000 --- a/glabels/NewLabelDialog.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* NewLabelDialog.cpp - * - * Copyright (C) 2013-2016 Jim Evins - * - * This file is part of gLabels-qt. - * - * gLabels-qt is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * gLabels-qt is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with gLabels-qt. If not, see . - */ - -#include "NewLabelDialog.h" - -#include - -#include "libglabels/Db.h" -#include "TemplatePickerItem.h" - - -namespace glabels -{ - - /// - /// Constructor - /// - NewLabelDialog::NewLabelDialog( QWidget *parent ) - : QDialog(parent), mCanceled(false) - { - setupUi( this ); - - // TODO: Set default based on locale and/or saved preferences - // Perhaps move to checkboxes - pageSizeIsoCheck->setChecked( false ); - pageSizeUsCheck->setChecked( true ); - pageSizeOtherCheck->setChecked( true ); - - QList tmplates = libglabels::Db::templates(); - templatePicker->setTemplates( tmplates ); - - templatePicker->applyFilter( searchEntry->text(), - pageSizeIsoCheck->isChecked(), - pageSizeUsCheck->isChecked(), - pageSizeOtherCheck->isChecked() ); - - similarBrowser->setAttribute(Qt::WA_TranslucentBackground); - similarBrowser->viewport()->setAutoFillBackground(false); - - selectionStackedWidget->setCurrentIndex( 0 ); - } - - /// - /// Get selected template - /// - const libglabels::Template* NewLabelDialog::tmplate() const - { - if ( !mCanceled ) - { - return templatePicker->selectedTemplate(); - } - else - { - return 0; - } - } - - - /// - /// Get rotation selection - /// - bool NewLabelDialog::rotate() const - { - return orientationRotatedRadio->isChecked(); - } - - - /// - /// Search Entry Text Changed Slot - /// - void NewLabelDialog::onSearchEntryTextChanged() - { - templatePicker->applyFilter( searchEntry->text(), - pageSizeIsoCheck->isChecked(), - pageSizeUsCheck->isChecked(), - pageSizeOtherCheck->isChecked() ); - } - - - /// - /// Search Entry Text Changed Slot - /// - void NewLabelDialog::onSearchClearButtonClicked() - { - searchEntry->setText( "" ); - } - - - /// - /// Page Size Check Toggled Slot - /// - void NewLabelDialog::onPageSizeCheckToggled() - { - templatePicker->applyFilter( searchEntry->text(), - pageSizeIsoCheck->isChecked(), - pageSizeUsCheck->isChecked(), - pageSizeOtherCheck->isChecked() ); - } - - - /// - /// Template Picker Selection Changed Slot - /// - void NewLabelDialog::onTemplatePickerSelectionChanged() - { - orientationNormalRadio->setChecked( true ); - - const libglabels::Template *tmplate = templatePicker->selectedTemplate(); - - if ( tmplate == NULL ) - { - createButton->setEnabled( false ); - selectionStackedWidget->setCurrentIndex( 0 ); - } - else - { - createButton->setEnabled( true ); - selectionStackedWidget->setCurrentIndex( 1 ); - - const libglabels::Frame *frame = tmplate->frames().first(); - - simplePreview->setTemplate( tmplate ); - simplePreview->setRotate( false ); - - const libglabels::Vendor *vendor = libglabels::Db::lookupVendorFromName( tmplate->brand() ); - if ( (vendor != NULL) && (vendor->url() != NULL) ) - { - QString markup = "" + vendor->name() + ""; - vendorLabel->setText( markup ); - } - else - { - vendorLabel->setText( tmplate->brand() ); - } - - if ( tmplate->productUrl() != NULL ) - { - QString markup = "" + tmplate->part() + ""; - partLabel->setText( markup ); - } - else - { - partLabel->setText( tmplate->part() ); - } - - descriptionLabel->setText( tmplate->description() ); - - QString pgSizeString = libglabels::Db::lookupPaperNameFromId( tmplate->paperId() ); - pageSizeLabel->setText( pgSizeString ); - - QString labelSizeString = frame->sizeDescription( libglabels::Distance::Units::IN ); - labelSizeLabel->setText( labelSizeString ); - - QString layoutString = frame->layoutDescription(); - layoutLabel->setText( layoutString ); - - QStringList list = libglabels::Db::getNameListOfSimilarTemplates( tmplate->name() ); - if ( list.isEmpty() ) - { - similarLabel->hide(); - similarBrowser->hide(); - } - else - { - similarLabel->show(); - similarBrowser->show(); - - QString similarListString; - foreach ( QString name, list ) - { - similarListString += name + "\n"; - } - similarBrowser->setText( similarListString ); - } - - orientationGroupBox->setEnabled( frame->w() != frame->h() ); - } - } - - - /// - /// Orientation Radio Button Toggled Slot - /// - void NewLabelDialog::onOrientationRadioToggled() - { - simplePreview->setRotate( orientationRotatedRadio->isChecked() ); - } - - - /// - /// Create Button Clicked Slot - /// - void NewLabelDialog::onCreateButtonClicked() - { - close(); - } - - - /// - /// Cancel Button Clicked Slot - /// - void NewLabelDialog::onCancelButtonClicked() - { - mCanceled = true; - close(); - } - -} diff --git a/glabels/PropertiesView.cpp b/glabels/PropertiesView.cpp new file mode 100644 index 0000000..96756f5 --- /dev/null +++ b/glabels/PropertiesView.cpp @@ -0,0 +1,193 @@ +/* PropertiesView.cpp + * + * Copyright (C) 2016 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gLabels-qt is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gLabels-qt. If not, see . + */ + +#include "PropertiesView.h" + +#include "LabelModel.h" + +#include "libglabels/Db.h" +#include "SelectProductDialog.h" +#include + + +namespace glabels +{ + + /// + /// Constructor + /// + PropertiesView::PropertiesView( QWidget *parent ) + : QWidget(parent), mModel(0) + { + setupUi( this ); + + similarBrowser->setAttribute(Qt::WA_TranslucentBackground); + similarBrowser->viewport()->setAutoFillBackground(false); + } + + + /// + /// Destructor + /// + PropertiesView::~PropertiesView() + { + } + + + /// + /// Set Model + /// + void PropertiesView::setModel( LabelModel* model ) + { + mModel = model; + + connect( mModel, SIGNAL(sizeChanged()), this, SLOT(onLabelSizeChanged()) ); + + onLabelSizeChanged(); + } + + + /// + /// Label size changed handler + /// + void PropertiesView::onLabelSizeChanged() + { + const libglabels::Template *tmplate = mModel->tmplate(); + const libglabels::Frame *frame = tmplate->frames().first(); + bool isRotated = mModel->rotate(); + + preview->setTemplate( tmplate ); + preview->setRotate( isRotated ); + + const libglabels::Vendor *vendor = libglabels::Db::lookupVendorFromName( tmplate->brand() ); + if ( (vendor != NULL) && (vendor->url() != NULL) ) + { + QString markup = "" + vendor->name() + ""; + vendorLabel->setText( markup ); + } + else + { + vendorLabel->setText( tmplate->brand() ); + } + + if ( tmplate->productUrl() != NULL ) + { + QString markup = "" + tmplate->part() + ""; + partLabel->setText( markup ); + } + else + { + partLabel->setText( tmplate->part() ); + } + + descriptionLabel->setText( tmplate->description() ); + + QString pgSizeString = libglabels::Db::lookupPaperNameFromId( tmplate->paperId() ); + pageSizeLabel->setText( pgSizeString ); + + QString labelSizeString = frame->sizeDescription( libglabels::Distance::Units::IN ); + labelSizeLabel->setText( labelSizeString ); + + QString layoutString = frame->layoutDescription(); + layoutLabel->setText( layoutString ); + + QStringList list = libglabels::Db::getNameListOfSimilarTemplates( tmplate->name() ); + if ( list.isEmpty() ) + { + similarProductsGroupBox->hide(); + similarProductsNullBox->show(); + } + else + { + similarProductsGroupBox->show(); + similarProductsNullBox->hide(); + + QString similarListString; + foreach ( QString name, list ) + { + similarListString += name + "\n"; + } + similarBrowser->setText( similarListString ); + } + + orientationCombo->setEnabled( frame->w() != frame->h() ); + if ( frame->w() == frame->h() ) + { + orientationCombo->setCurrentIndex(0); + } + else if ( frame->w() > frame->h() ) + { + orientationCombo->setCurrentIndex( isRotated ? 1 : 0 ); + } + else + { + orientationCombo->setCurrentIndex( isRotated ? 0 : 1 ); + } + } + + + /// + /// Form changed handler + /// + void PropertiesView::onFormChanged() + { + const libglabels::Template *tmplate = mModel->tmplate(); + const libglabels::Frame *frame = tmplate->frames().first(); + + if ( frame->w() == frame->h() ) + { + mModel->setRotate( false ); + } + else if ( frame->w() > frame->h() ) + { + int index = orientationCombo->currentIndex(); + mModel->setRotate( index == 1 ); + } + else + { + int index = orientationCombo->currentIndex(); + mModel->setRotate( index == 0 ); + } + } + + + /// + /// Change Product Button Clicked handler + /// + void PropertiesView::onChangeProductButtonClicked() + { + SelectProductDialog selectProductDialog( this ); + selectProductDialog.exec(); + + const libglabels::Template* tmplate = selectProductDialog.tmplate(); + if ( tmplate ) + { + mModel->setTmplate( tmplate ); + + // Don't rotate circular or round labels + const libglabels::Frame *frame = tmplate->frames().first(); + if ( frame->w() == frame->h() ) + { + mModel->setRotate( false ); + } + } + } + +} diff --git a/glabels/PropertiesView.h b/glabels/PropertiesView.h new file mode 100644 index 0000000..d959149 --- /dev/null +++ b/glabels/PropertiesView.h @@ -0,0 +1,73 @@ +/* PropertiesView.h + * + * Copyright (C) 2016 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gLabels-qt is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gLabels-qt. If not, see . + */ + +#ifndef glabels_PropertiesView_h +#define glabels_PropertiesView_h + +#include "ui_PropertiesView.h" + + +namespace glabels +{ + class LabelModel; // Forward reference + + + /// + /// Properties View Widget + /// + class PropertiesView : public QWidget, public Ui_PropertiesView + { + Q_OBJECT + + + ///////////////////////////////// + // Life Cycle + ///////////////////////////////// + public: + PropertiesView( QWidget *parent = 0 ); + ~PropertiesView(); + + + ///////////////////////////////// + // Public methods + ///////////////////////////////// + void setModel( LabelModel* model ); + + + ///////////////////////////////// + // Slots + ///////////////////////////////// + private slots: + void onLabelSizeChanged(); + void onFormChanged(); + void onChangeProductButtonClicked(); + + + ///////////////////////////////// + // Private Data + ///////////////////////////////// + private: + LabelModel* mModel; + + }; + +} + +#endif // glabels_PropertiesView_h diff --git a/glabels/SelectProductDialog.cpp b/glabels/SelectProductDialog.cpp new file mode 100644 index 0000000..66ff7bc --- /dev/null +++ b/glabels/SelectProductDialog.cpp @@ -0,0 +1,133 @@ +/* SelectProductDialog.cpp + * + * Copyright (C) 2013-2016 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gLabels-qt is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gLabels-qt. If not, see . + */ + +#include "SelectProductDialog.h" + +#include + +#include "libglabels/Db.h" +#include "TemplatePickerItem.h" + + +namespace glabels +{ + + /// + /// Constructor + /// + SelectProductDialog::SelectProductDialog( QWidget *parent ) + : QDialog(parent), mCanceled(false) + { + setupUi( this ); + + // TODO: Set default based on locale and/or saved preferences + // Perhaps move to checkboxes + pageSizeIsoCheck->setChecked( false ); + pageSizeUsCheck->setChecked( true ); + pageSizeOtherCheck->setChecked( true ); + + QList tmplates = libglabels::Db::templates(); + templatePicker->setTemplates( tmplates ); + + templatePicker->applyFilter( searchEntry->text(), + pageSizeIsoCheck->isChecked(), + pageSizeUsCheck->isChecked(), + pageSizeOtherCheck->isChecked() ); + } + + /// + /// Get selected template + /// + const libglabels::Template* SelectProductDialog::tmplate() const + { + if ( !mCanceled ) + { + return templatePicker->selectedTemplate(); + } + else + { + return 0; + } + } + + + /// + /// Search Entry Text Changed Slot + /// + void SelectProductDialog::onSearchEntryTextChanged() + { + templatePicker->applyFilter( searchEntry->text(), + pageSizeIsoCheck->isChecked(), + pageSizeUsCheck->isChecked(), + pageSizeOtherCheck->isChecked() ); + } + + + /// + /// Search Entry Text Changed Slot + /// + void SelectProductDialog::onSearchClearButtonClicked() + { + searchEntry->setText( "" ); + } + + + /// + /// Page Size Check Toggled Slot + /// + void SelectProductDialog::onPageSizeCheckToggled() + { + templatePicker->applyFilter( searchEntry->text(), + pageSizeIsoCheck->isChecked(), + pageSizeUsCheck->isChecked(), + pageSizeOtherCheck->isChecked() ); + } + + + /// + /// Template Picker Selection Changed Slot + /// + void SelectProductDialog::onTemplatePickerSelectionChanged() + { + const libglabels::Template *tmplate = templatePicker->selectedTemplate(); + + selectButton->setEnabled( tmplate != NULL ); + } + + + /// + /// Select Button Clicked Slot + /// + void SelectProductDialog::onSelectButtonClicked() + { + close(); + } + + + /// + /// Cancel Button Clicked Slot + /// + void SelectProductDialog::onCancelButtonClicked() + { + mCanceled = true; + close(); + } + +} diff --git a/glabels/NewLabelDialog.h b/glabels/SelectProductDialog.h similarity index 77% rename from glabels/NewLabelDialog.h rename to glabels/SelectProductDialog.h index 8bf3d78..a4f0da1 100644 --- a/glabels/NewLabelDialog.h +++ b/glabels/SelectProductDialog.h @@ -1,6 +1,6 @@ -/* NewLabelDialog.h +/* SelectProductDialog.h * - * Copyright (C) 2013 Jim Evins + * Copyright (C) 2013-2016 Jim Evins * * This file is part of gLabels-qt. * @@ -18,10 +18,10 @@ * along with gLabels-qt. If not, see . */ -#ifndef glabels_NewLabelDialog_h -#define glabels_NewLabelDialog_h +#ifndef glabels_SelectProductDialog_h +#define glabels_SelectProductDialog_h -#include "ui_NewLabelDialog.h" +#include "ui_SelectProductDialog.h" namespace glabels @@ -30,7 +30,7 @@ namespace glabels /// /// New Label Dialog Widget /// - class NewLabelDialog : public QDialog, public Ui_NewLabelDialog + class SelectProductDialog : public QDialog, public Ui_SelectProductDialog { Q_OBJECT @@ -39,14 +39,13 @@ namespace glabels // Life Cycle ///////////////////////////////// public: - NewLabelDialog( QWidget *parent = 0 ); + SelectProductDialog( QWidget *parent = 0 ); ///////////////////////////////// // Accessors ///////////////////////////////// const libglabels::Template* tmplate() const; - bool rotate() const; ///////////////////////////////// @@ -57,8 +56,7 @@ namespace glabels void onSearchClearButtonClicked(); void onPageSizeCheckToggled(); void onTemplatePickerSelectionChanged(); - void onOrientationRadioToggled(); - void onCreateButtonClicked(); + void onSelectButtonClicked(); void onCancelButtonClicked(); @@ -72,4 +70,4 @@ namespace glabels } -#endif // glabels_NewLabelDialog_h +#endif // glabels_SelectProductDialog_h diff --git a/glabels/glabels_main.cpp b/glabels/glabels_main.cpp index 3b26009..39db4c8 100644 --- a/glabels/glabels_main.cpp +++ b/glabels/glabels_main.cpp @@ -1,6 +1,6 @@ /* glabels_main.cpp * - * Copyright (C) 2011 Jim Evins + * Copyright (C) 2013-2016 Jim Evins * * This file is part of gLabels-qt. * @@ -21,7 +21,7 @@ #include -#include "MainWindow.h" +#include "File.h" #include "libglabels/Db.h" using namespace glabels; @@ -46,8 +46,7 @@ int main( int argc, char **argv ) #endif ///////////////////////////////// - MainWindow mainWin; - mainWin.show(); + File::newLabel(); return app.exec(); } diff --git a/glabels/icons.qrc b/glabels/icons.qrc index 2702f15..a12dea9 100644 --- a/glabels/icons.qrc +++ b/glabels/icons.qrc @@ -66,6 +66,9 @@ icons/24x24/actions/fallback-zoom-out.png icons/24x24/apps/glabels.png icons/32x32/apps/glabels.png + icons/32x32/actions/horizontal-orientation.png + icons/32x32/actions/select-product.png + icons/32x32/actions/vertical-orientation.png icons/48x48/apps/glabels.png icons/scalable/apps/glabels.svg diff --git a/glabels/icons/32x32/actions/horizontal-orientation.png b/glabels/icons/32x32/actions/horizontal-orientation.png new file mode 100644 index 0000000..c08ad06 Binary files /dev/null and b/glabels/icons/32x32/actions/horizontal-orientation.png differ diff --git a/glabels/icons/32x32/actions/select-product.png b/glabels/icons/32x32/actions/select-product.png new file mode 100644 index 0000000..1ca76c3 Binary files /dev/null and b/glabels/icons/32x32/actions/select-product.png differ diff --git a/glabels/icons/32x32/actions/vertical-orientation.png b/glabels/icons/32x32/actions/vertical-orientation.png new file mode 100644 index 0000000..05eebfb Binary files /dev/null and b/glabels/icons/32x32/actions/vertical-orientation.png differ diff --git a/glabels/ui/NewLabelDialog.ui b/glabels/ui/NewLabelDialog.ui deleted file mode 100644 index 8e74ac2..0000000 --- a/glabels/ui/NewLabelDialog.ui +++ /dev/null @@ -1,633 +0,0 @@ - - - NewLabelDialog - - - - 0 - 0 - 991 - 720 - - - - Dialog - - - - - - - - - - - - Search - - - - - - - 0 - 0 - - - - Search - - - - - - - - - - - :/icons/16x16/actions/edit-clear.png:/icons/16x16/actions/edit-clear.png - - - - 16 - 16 - - - - true - - - - - - - - - - - 0 - 0 - - - - - 146 - 87 - - - - - 9 - - - - false - - - Page size - - - false - - - false - - - - - - ISO sizes - - - - - - - US sizes - - - - - - - Other - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - false - - - - - - - - 0 - 0 - - - - 1 - - - - - - - 12 - - - 9 - - - - - false - - - - 10 - 75 - true - - - - No selection - - - Qt::AlignCenter - - - - - - - - - - - - - QLayout::SetFixedSize - - - 12 - - - - - - 0 - 0 - - - - - 250 - 350 - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Vendor: - - - - - - - TextLabel - - - - - - - Part #: - - - - - - - TextLabel - - - - - - - Description: - - - - - - - TextLabel - - - false - - - - - - - Page size: - - - - - - - TextLabel - - - - - - - Label size: - - - - - - - TextLabel - - - - - - - Layout: - - - - - - - TextLabel - - - - - - - Similar to: - - - - - - - - 0 - 0 - - - - - 150 - 16777215 - - - - false - - - false - - - QFrame::NoFrame - - - false - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - Orientation - - - - - - - - - 0 - 0 - - - - Normal - - - - - - - - 0 - 0 - - - - Rotated - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &Cancel - - - - - - - false - - - C&reate - - - - - - - - - - - - glabels::TemplatePicker - QListWidget -
TemplatePicker.h
-
- - glabels::SimplePreview - QGraphicsView -
SimplePreview.h
-
-
- - - - - - searchEntry - textChanged(QString) - NewLabelDialog - onSearchEntryTextChanged() - - - 69 - 48 - - - 2 - 53 - - - - - searchClearButton - clicked() - NewLabelDialog - onSearchClearButtonClicked() - - - 177 - 52 - - - 190 - 7 - - - - - pageSizeIsoCheck - toggled(bool) - NewLabelDialog - onPageSizeCheckToggled() - - - 78 - 116 - - - 3 - 110 - - - - - pageSizeUsCheck - toggled(bool) - NewLabelDialog - onPageSizeCheckToggled() - - - 52 - 145 - - - 8 - 144 - - - - - pageSizeOtherCheck - toggled(bool) - NewLabelDialog - onPageSizeCheckToggled() - - - 37 - 170 - - - 10 - 188 - - - - - templatePicker - itemSelectionChanged() - NewLabelDialog - onTemplatePickerSelectionChanged() - - - 232 - 550 - - - 244 - 697 - - - - - orientationRotatedRadio - toggled(bool) - NewLabelDialog - onOrientationRadioToggled() - - - 901 - 637 - - - 982 - 617 - - - - - orientationNormalRadio - toggled(bool) - NewLabelDialog - onOrientationRadioToggled() - - - 807 - 644 - - - 982 - 592 - - - - - createButton - clicked() - NewLabelDialog - onCreateButtonClicked() - - - 951 - 699 - - - 985 - 671 - - - - - cancelButton - clicked() - NewLabelDialog - onCancelButtonClicked() - - - 837 - 692 - - - 767 - 704 - - - - - - onSearchClearButtonClicked() - onPageSizeCheckToggled() - onTemplatePickerSelectionChanged() - onOrientationRadioToggled() - onCreateButtonClicked() - onSearchEntryTextChanged() - onCancelButtonClicked() - -
diff --git a/glabels/ui/PropertiesView.ui b/glabels/ui/PropertiesView.ui new file mode 100644 index 0000000..f4bec41 --- /dev/null +++ b/glabels/ui/PropertiesView.ui @@ -0,0 +1,403 @@ + + + PropertiesView + + + + 0 + 0 + 793 + 769 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Form + + + + + + + + + 0 + 0 + + + + + + + + Qt::Vertical + + + + + + + + + + 0 + 0 + + + + + 300 + 0 + + + + Product + + + + + + + + + 0 + 0 + + + + Vendor: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + Part #: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + Description: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + Page size: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + Label size: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + 0 + 0 + + + + Layout: + + + + + + + + 0 + 0 + + + + TextLabel + + + + + + + + + text-align:left; padding:3px; + + + Select another product + + + + :/icons/32x32/actions/select-product.png:/icons/32x32/actions/select-product.png + + + + 32 + 32 + + + + + + + + + + + + 0 + 0 + + + + Orientation + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + Horizontal orientation + + + + :/icons/32x32/actions/horizontal-orientation.png:/icons/32x32/actions/horizontal-orientation.png + + + + + Vertical orientation + + + + :/icons/32x32/actions/vertical-orientation.png:/icons/32x32/actions/vertical-orientation.png + + + + + + + + + + + + + + 0 + 0 + + + + Similar Products + + + + + + + 0 + 0 + + + + false + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + glabels::SimplePreview + QGraphicsView +
SimplePreview.h
+ 1 +
+
+ + + + + + orientationCombo + currentIndexChanged(int) + PropertiesView + onFormChanged() + + + 671 + 283 + + + 723 + 285 + + + + + changeProductButton + clicked() + PropertiesView + onChangeProductButtonClicked() + + + 684 + 192 + + + 728 + 201 + + + + + + onChangeProductButtonClicked() + onFormChanged() + +
diff --git a/glabels/ui/SelectProductDialog.ui b/glabels/ui/SelectProductDialog.ui new file mode 100644 index 0000000..549fa1b --- /dev/null +++ b/glabels/ui/SelectProductDialog.ui @@ -0,0 +1,332 @@ + + + SelectProductDialog + + + + 0 + 0 + 690 + 720 + + + + Dialog + + + + + + + + + + + + Search + + + + + + + 0 + 0 + + + + Search + + + + + + + + + + + :/icons/16x16/actions/edit-clear.png:/icons/16x16/actions/edit-clear.png + + + + 16 + 16 + + + + true + + + + + + + + + + + 0 + 0 + + + + + 146 + 87 + + + + + 9 + + + + false + + + Page size + + + false + + + false + + + + + + ISO sizes + + + + + + + US sizes + + + + + + + Other + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + false + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Cancel + + + + + + + false + + + &Select + + + + + + + + + + + + glabels::TemplatePicker + QListWidget +
TemplatePicker.h
+
+
+ + + + + + searchEntry + textChanged(QString) + SelectProductDialog + onSearchEntryTextChanged() + + + 69 + 48 + + + 2 + 53 + + + + + searchClearButton + clicked() + SelectProductDialog + onSearchClearButtonClicked() + + + 177 + 52 + + + 190 + 7 + + + + + pageSizeIsoCheck + toggled(bool) + SelectProductDialog + onPageSizeCheckToggled() + + + 78 + 116 + + + 3 + 110 + + + + + pageSizeUsCheck + toggled(bool) + SelectProductDialog + onPageSizeCheckToggled() + + + 52 + 145 + + + 8 + 144 + + + + + pageSizeOtherCheck + toggled(bool) + SelectProductDialog + onPageSizeCheckToggled() + + + 37 + 170 + + + 10 + 188 + + + + + templatePicker + itemSelectionChanged() + SelectProductDialog + onTemplatePickerSelectionChanged() + + + 232 + 550 + + + 244 + 697 + + + + + cancelButton + clicked() + SelectProductDialog + onCancelButtonClicked() + + + 587 + 708 + + + 689 + 704 + + + + + selectButton + clicked() + SelectProductDialog + onSelectButtonClicked() + + + 660 + 689 + + + 687 + 682 + + + + + + onSearchClearButtonClicked() + onPageSizeCheckToggled() + onTemplatePickerSelectionChanged() + onOrientationRadioToggled() + onSearchEntryTextChanged() + onCancelButtonClicked() + onSelectButtonClicked() + +