Merge remote-tracking branch 'upstream/master'

Merge from upstream
This commit is contained in:
Mario Blättermann
2018-06-02 00:16:56 +02:00
13 changed files with 2034 additions and 361 deletions
+6 -7
View File
@@ -1,6 +1,7 @@
![logo](glabels/icons/48x48/apps/glabels.svg)
![gLabels Label Designer](glabels/images/glabels-label-designer.png) ![gLabels Label Designer](glabels/images/glabels-label-designer.png)
![Cover Image](docs/images/cover-image.png)
[![Build Status](https://travis-ci.org/jimevins/glabels-qt.svg?branch=master)](https://travis-ci.org/jimevins/glabels-qt) [![Build Status](https://travis-ci.org/jimevins/glabels-qt.svg?branch=master)](https://travis-ci.org/jimevins/glabels-qt)
******************************************************************************* *******************************************************************************
@@ -9,20 +10,18 @@
gLabels-qt is the development version of the next major version of gLabels (4.0). gLabels-qt is the development version of the next major version of gLabels (4.0).
![screenshot](docs/images/screenshot.png)
## What's new in gLabels 4?
## What's new in gLabels-qt?
- Based on the Qt5 framework. - Based on the Qt5 framework.
- Updated UI based on typical workflows. - Updated UI based on typical workflows.
- Intended to be a cross-platform application. - Intended to be a cross-platform application.
* So far, it has been built and tested under both Linux, Windows 7, and Windows 10. (Windows testing is still very intermittent.) * So far, it has been built and tested under Linux, Windows 7, and Windows 10. (Windows testing is still very intermittent.)
## Status ## Status
gLabels-qt has been under off-and-on development for several years.. gLabels-qt has been under off-and-on development for several years.
It is still missing several features to bring it in parity with glabels-3.4. These include It is still missing several features to bring it in parity with glabels-3.4. These include
- Compatability with older glabels project files - Compatability with older glabels project files
@@ -33,7 +32,7 @@ It is still missing several features to bring it in parity with glabels-3.4. Th
### Latest Release ### Latest Release
There are currently no official releases of gLabels-qt. There are currently no official releases of gLabels 4.
### Continuous Integration Snapshots ### Continuous Integration Snapshots
Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

+1
View File
@@ -24,6 +24,7 @@ set (glabels_sources
MainWindow.cpp MainWindow.cpp
MergeView.cpp MergeView.cpp
MiniPreviewPixmap.cpp MiniPreviewPixmap.cpp
NotebookUtil.cpp
ObjectEditor.cpp ObjectEditor.cpp
PreferencesDialog.cpp PreferencesDialog.cpp
PrintView.cpp PrintView.cpp
+78 -3
View File
@@ -70,8 +70,6 @@ namespace glabels
mContents = new QListWidget(); mContents = new QListWidget();
mContents->setViewMode(QListView::ListMode); mContents->setViewMode(QListView::ListMode);
mContents->setMovement(QListView::Static); mContents->setMovement(QListView::Static);
mContents->setMinimumWidth(96);
mContents->setMaximumWidth(96);
mContents->setSpacing(6); mContents->setSpacing(6);
// Pages widget // Pages widget
@@ -86,27 +84,37 @@ namespace glabels
// Add "Editor" page // Add "Editor" page
mPages->addWidget( editorPage ); mPages->addWidget( editorPage );
mEditorButton = new QListWidgetItem(mContents); mEditorButton = new QListWidgetItem(mContents);
mEditorButton->setText(tr("Home")); mEditorButton->setText(tr("Edit"));
mEditorButton->setToolTip( tr("Select <b>Edit</b> mode") );
mEditorButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); mEditorButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
// Add "Properties" page // Add "Properties" page
mPages->addWidget( propertiesPage ); mPages->addWidget( propertiesPage );
mPropertiesButton = new QListWidgetItem(mContents); mPropertiesButton = new QListWidgetItem(mContents);
mPropertiesButton->setText(tr("Properties")); mPropertiesButton->setText(tr("Properties"));
mPropertiesButton->setToolTip( tr("Select <b>Properties</b> mode") );
mPropertiesButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); mPropertiesButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
// Add "Merge" page // Add "Merge" page
mPages->addWidget( mergePage ); mPages->addWidget( mergePage );
mMergeButton = new QListWidgetItem(mContents); mMergeButton = new QListWidgetItem(mContents);
mMergeButton->setText(tr("Merge")); mMergeButton->setText(tr("Merge"));
mMergeButton->setToolTip( tr("Select <b>Merge</b> mode") );
mMergeButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); mMergeButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
// Add "Print" page // Add "Print" page
mPages->addWidget( printPage ); mPages->addWidget( printPage );
mPrintButton = new QListWidgetItem(mContents); mPrintButton = new QListWidgetItem(mContents);
mPrintButton->setText(tr("Print")); mPrintButton->setText(tr("Print"));
mPrintButton->setToolTip( tr("Select <b>Print</b> mode") );
mPrintButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); mPrintButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
// Adjust width of list view based on its contents
mContents->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
mContents->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
mContents->setMinimumWidth( mContents->sizeHintForColumn(0) + 24 );
mContents->setMaximumWidth( mContents->sizeHintForColumn(0) + 24 );
// Set initial page selection // Set initial page selection
mWelcomeButton->setSelected( true ); mWelcomeButton->setSelected( true );
mPages->setCurrentIndex(mContents->row(mWelcomeButton)); mPages->setCurrentIndex(mContents->row(mWelcomeButton));
@@ -246,6 +254,26 @@ namespace glabels
fileSaveAsAction->setStatusTip( tr("Save current gLabels project to a different name") ); fileSaveAsAction->setStatusTip( tr("Save current gLabels project to a different name") );
connect( fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs()) ); connect( fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs()) );
fileShowEditorPageAction = new QAction( tr("&Edit") , this );
fileShowEditorPageAction->setShortcut( QKeySequence( Qt::CTRL + Qt::Key_1 ) );
fileShowEditorPageAction->setStatusTip( tr("Select project Edit mode") );
connect( fileShowEditorPageAction, SIGNAL(triggered()), this, SLOT(fileShowEditorPage()) );
fileShowPropertiesPageAction = new QAction( tr("P&roperties") , this );
fileShowPropertiesPageAction->setShortcut( QKeySequence( Qt::CTRL + Qt::Key_2 ) );
fileShowPropertiesPageAction->setStatusTip( tr("Select project Properties mode") );
connect( fileShowPropertiesPageAction, SIGNAL(triggered()), this, SLOT(fileShowPropertiesPage()) );
fileShowMergePageAction = new QAction( tr("&Merge") , this );
fileShowMergePageAction->setShortcut( QKeySequence( Qt::CTRL + Qt::Key_3 ) );
fileShowMergePageAction->setStatusTip( tr("Select project Merge mode") );
connect( fileShowMergePageAction, SIGNAL(triggered()), this, SLOT(fileShowMergePage()) );
fileShowPrintPageAction = new QAction( tr("&Print") , this );
fileShowPrintPageAction->setShortcut( QKeySequence::Print );
fileShowPrintPageAction->setStatusTip( tr("Select project Print mode") );
connect( fileShowPrintPageAction, SIGNAL(triggered()), this, SLOT(fileShowPrintPage()) );
fileTemplateDesignerAction = new QAction( tr("Product Template &Designer..."), this ); fileTemplateDesignerAction = new QAction( tr("Product Template &Designer..."), this );
fileTemplateDesignerAction->setStatusTip( tr("Create custom templates") ); fileTemplateDesignerAction->setStatusTip( tr("Create custom templates") );
connect( fileTemplateDesignerAction, SIGNAL(triggered()), this, SLOT(fileTemplateDesigner()) ); connect( fileTemplateDesignerAction, SIGNAL(triggered()), this, SLOT(fileTemplateDesigner()) );
@@ -517,6 +545,11 @@ namespace glabels
fileMenu->addAction( fileSaveAction ); fileMenu->addAction( fileSaveAction );
fileMenu->addAction( fileSaveAsAction ); fileMenu->addAction( fileSaveAsAction );
fileMenu->addSeparator(); fileMenu->addSeparator();
fileMenu->addAction( fileShowEditorPageAction );
fileMenu->addAction( fileShowPropertiesPageAction );
fileMenu->addAction( fileShowMergePageAction );
fileMenu->addAction( fileShowPrintPageAction );
fileMenu->addSeparator();
fileMenu->addAction( fileTemplateDesignerAction ); fileMenu->addAction( fileTemplateDesignerAction );
fileMenu->addSeparator(); fileMenu->addSeparator();
fileMenu->addAction( fileCloseAction ); fileMenu->addAction( fileCloseAction );
@@ -988,6 +1021,12 @@ namespace glabels
setSelectionVerbsEnabled( isEditorPage && !mModel->isSelectionEmpty() ); setSelectionVerbsEnabled( isEditorPage && !mModel->isSelectionEmpty() );
setMultiSelectionVerbsEnabled( isEditorPage && !mModel->isSelectionEmpty() && !mModel->isSelectionAtomic() ); setMultiSelectionVerbsEnabled( isEditorPage && !mModel->isSelectionEmpty() && !mModel->isSelectionAtomic() );
setPasteVerbsEnabled( isEditorPage && mModel->canPaste() ); setPasteVerbsEnabled( isEditorPage && mModel->canPaste() );
bool isWelcome = ( current == mWelcomeButton );
fileShowEditorPageAction->setEnabled( !isWelcome && (current != mEditorButton) );
fileShowPropertiesPageAction->setEnabled( !isWelcome && (current != mPropertiesButton) );
fileShowMergePageAction->setEnabled( !isWelcome && (current != mMergeButton) );
fileShowPrintPageAction->setEnabled( !isWelcome && (current != mPrintButton) );
} }
@@ -1036,6 +1075,42 @@ namespace glabels
} }
///
/// File->Show Editor Page
///
void MainWindow::fileShowEditorPage()
{
mContents->setCurrentItem( mEditorButton );
}
///
/// File->Show Properties Page
///
void MainWindow::fileShowPropertiesPage()
{
mContents->setCurrentItem( mPropertiesButton );
}
///
/// File->Show Merge Page
///
void MainWindow::fileShowMergePage()
{
mContents->setCurrentItem( mMergeButton );
}
///
/// File->Show Print Page
///
void MainWindow::fileShowPrintPage()
{
mContents->setCurrentItem( mPrintButton );
}
/// ///
/// File->Template Designer Action /// File->Template Designer Action
/// ///
+8
View File
@@ -92,6 +92,10 @@ namespace glabels
void fileOpen(); void fileOpen();
void fileSave(); void fileSave();
void fileSaveAs(); void fileSaveAs();
void fileShowEditorPage();
void fileShowPropertiesPage();
void fileShowMergePage();
void fileShowPrintPage();
void fileTemplateDesigner(); void fileTemplateDesigner();
void fileClose(); void fileClose();
void fileExit(); void fileExit();
@@ -235,6 +239,10 @@ namespace glabels
QAction* fileOpenAction; QAction* fileOpenAction;
QAction* fileSaveAction; QAction* fileSaveAction;
QAction* fileSaveAsAction; QAction* fileSaveAsAction;
QAction* fileShowEditorPageAction;
QAction* fileShowPropertiesPageAction;
QAction* fileShowMergePageAction;
QAction* fileShowPrintPageAction;
QAction* fileTemplateDesignerAction; QAction* fileTemplateDesignerAction;
QAction* fileCloseAction; QAction* fileCloseAction;
QAction* fileExitAction; QAction* fileExitAction;
+61
View File
@@ -0,0 +1,61 @@
/* NotebookUtil.cpp
*
* Copyright (C) 2015 Jim Evins <evins@snaught.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "NotebookUtil.h"
#include <QLayout>
namespace glabels
{
///
/// Establish notebook size based on largest page
///
void NotebookUtil::establishSize( QTabWidget* notebook )
{
// Establish size of notebook size based on its largest page.
// This may not be established until runtime, due to varying
// lengths of translated strings or may even be influenced by
// the current theme and fonts. Without doing this, the
// notebook may change size as tabs are selected for the first
// time, which can be very annoying.
// This hack shows the top-level window containing the notebook,
// then shows each page and invalidates the window's layout.
// Finally it re-hides the window without ever having
// relinquishing control to the Qt event loop.
QWidget* window = notebook->window();
int iTabSaved = notebook->currentIndex();
int nTabs = notebook->count();
window->show();
for ( int iTab = 0; iTab < nTabs; iTab++ )
{
notebook->setCurrentIndex( iTab );
window->layout()->invalidate();
}
window->hide();
notebook->setCurrentIndex( iTabSaved );
}
}
+40
View File
@@ -0,0 +1,40 @@
/* NotebookUtil.h
*
* Copyright (C) 2015 Jim Evins <evins@snaught.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef model_NotebookUtil_h
#define model_NotebookUtil_h
#include <QWidget>
#include <QTabWidget>
namespace glabels
{
namespace NotebookUtil
{
void establishSize( QTabWidget* notebook );
}
}
#endif // model_NotebookUtil_h
+26 -26
View File
@@ -61,15 +61,15 @@ namespace glabels
textVAlignGroup->addButton( textVAlignMiddleToggle, Qt::AlignVCenter ); textVAlignGroup->addButton( textVAlignMiddleToggle, Qt::AlignVCenter );
textVAlignGroup->addButton( textVAlignBottomToggle, Qt::AlignBottom ); textVAlignGroup->addButton( textVAlignBottomToggle, Qt::AlignBottom );
lineColorButton->init( "No line", QColor(0,0,0,0), QColor(0,0,0,255) ); lineColorButton->init( tr("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) ); fillColorButton->init( tr("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) ); textColorButton->init( tr("Default"), QColor(0,0,0,255), QColor(0,0,0,255) );
barcodeColorButton->init( "Default", QColor(0,0,0,255), QColor(0,0,0,255) ); barcodeColorButton->init( tr("Default"), QColor(0,0,0,255), QColor(0,0,0,255) );
shadowColorButton->init( "Default", QColor(0,0,0,255), QColor(0,0,0,255) ); shadowColorButton->init( tr("Default"), QColor(0,0,0,255), QColor(0,0,0,255) );
textInsertFieldCombo->setName( "Insert Field" ); textInsertFieldCombo->setName( tr("Insert Field") );
barcodeInsertFieldCombo->setName( "Insert Field" ); barcodeInsertFieldCombo->setName( tr("Insert Field") );
imageFieldCombo->setName( "Key" ); imageFieldCombo->setName( tr("Key") );
setEnabled( false ); setEnabled( false );
hidePages(); hidePages();
@@ -351,9 +351,9 @@ namespace glabels
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-box.svg") ); titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-box.svg") );
titleLabel->setText( tr("Box object properties") ); titleLabel->setText( tr("Box object properties") );
notebook->addTab( lineFillPage, "line/fill" ); notebook->addTab( lineFillPage, tr("line/fill") );
notebook->addTab( posSizePage, "position/size" ); notebook->addTab( posSizePage, tr("position/size") );
notebook->addTab( shadowPage, "shadow" ); notebook->addTab( shadowPage, tr("shadow") );
fillFrame->setVisible( true ); fillFrame->setVisible( true );
sizeRectFrame->setVisible( true ); sizeRectFrame->setVisible( true );
@@ -372,9 +372,9 @@ namespace glabels
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-ellipse.svg") ); titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-ellipse.svg") );
titleLabel->setText( tr("Ellipse object properties") ); titleLabel->setText( tr("Ellipse object properties") );
notebook->addTab( lineFillPage, "line/fill" ); notebook->addTab( lineFillPage, tr("line/fill") );
notebook->addTab( posSizePage, "position/size" ); notebook->addTab( posSizePage, tr("position/size") );
notebook->addTab( shadowPage, "shadow" ); notebook->addTab( shadowPage, tr("shadow") );
fillFrame->setVisible( true ); fillFrame->setVisible( true );
sizeRectFrame->setVisible( true ); sizeRectFrame->setVisible( true );
@@ -393,9 +393,9 @@ namespace glabels
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-image.svg") ); titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-image.svg") );
titleLabel->setText( tr("Image object properties") ); titleLabel->setText( tr("Image object properties") );
notebook->addTab( imagePage, "image" ); notebook->addTab( imagePage, tr("image") );
notebook->addTab( posSizePage, "position/size" ); notebook->addTab( posSizePage, tr("position/size") );
notebook->addTab( shadowPage, "shadow" ); notebook->addTab( shadowPage, tr("shadow") );
sizeRectFrame->setVisible( true ); sizeRectFrame->setVisible( true );
sizeOriginalSizeGroup->setVisible( true ); sizeOriginalSizeGroup->setVisible( true );
@@ -413,9 +413,9 @@ namespace glabels
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-line.svg") ); titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-line.svg") );
titleLabel->setText( tr("Line object properties") ); titleLabel->setText( tr("Line object properties") );
notebook->addTab( lineFillPage, "line/fill" ); notebook->addTab( lineFillPage, tr("line/fill") );
notebook->addTab( posSizePage, "position/size" ); notebook->addTab( posSizePage, tr("position/size") );
notebook->addTab( shadowPage, "shadow" ); notebook->addTab( shadowPage, tr("shadow") );
fillFrame->setVisible( false ); fillFrame->setVisible( false );
sizeRectFrame->setVisible( false ); sizeRectFrame->setVisible( false );
@@ -434,9 +434,9 @@ namespace glabels
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-text.svg") ); titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-text.svg") );
titleLabel->setText( tr("Text object properties") ); titleLabel->setText( tr("Text object properties") );
notebook->addTab( textPage, "text" ); notebook->addTab( textPage, tr("text") );
notebook->addTab( posSizePage, "position/size" ); notebook->addTab( posSizePage, tr("position/size") );
notebook->addTab( shadowPage, "shadow" ); notebook->addTab( shadowPage, tr("shadow") );
sizeRectFrame->setVisible( true ); sizeRectFrame->setVisible( true );
sizeOriginalSizeGroup->setVisible( false ); sizeOriginalSizeGroup->setVisible( false );
@@ -453,8 +453,8 @@ namespace glabels
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-barcode.svg") ); titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-barcode.svg") );
titleLabel->setText( tr("Barcode object properties") ); titleLabel->setText( tr("Barcode object properties") );
notebook->addTab( barcodePage, "barcode" ); notebook->addTab( barcodePage, tr("barcode") );
notebook->addTab( posSizePage, "position/size" ); notebook->addTab( posSizePage, tr("position/size") );
sizeRectFrame->setVisible( true ); sizeRectFrame->setVisible( true );
sizeOriginalSizeGroup->setVisible( false ); sizeOriginalSizeGroup->setVisible( false );
@@ -479,7 +479,7 @@ namespace glabels
mObject = nullptr; mObject = nullptr;
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-object-properties.svg") ); titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-object-properties.svg") );
titleLabel->setText( "Object properties" ); titleLabel->setText( tr("Object properties") );
setEnabled( false ); setEnabled( false );
} }
} }
+3
View File
@@ -20,6 +20,7 @@
#include "SelectProductDialog.h" #include "SelectProductDialog.h"
#include "NotebookUtil.h"
#include "TemplatePickerItem.h" #include "TemplatePickerItem.h"
#include "model/Db.h" #include "model/Db.h"
@@ -62,6 +63,8 @@ namespace glabels
connect( check, SIGNAL(clicked()), this, SLOT(onCategoryCheckClicked()) ); connect( check, SIGNAL(clicked()), this, SLOT(onCategoryCheckClicked()) );
} }
NotebookUtil::establishSize( modeNotebook );
QList<model::Template*> tmplates = model::Db::templates(); QList<model::Template*> tmplates = model::Db::templates();
templatePicker->setTemplates( tmplates ); templatePicker->setTemplates( tmplates );
+6 -2
View File
@@ -7,12 +7,16 @@ set_directory_properties (PROPERTIES CLEAN_NO_CUSTOM 1)
include (TRANSLATION_FILES.txt) include (TRANSLATION_FILES.txt)
qt5_create_translation (glabels_qm_files qt5_create_translation (glabels_qm_files
${CMAKE_SOURCE_DIR}/glabels ${GLABELS_TS_FILES} ${CMAKE_SOURCE_DIR}/glabels
${CMAKE_SOURCE_DIR}/model
${CMAKE_SOURCE_DIR}/backends
${GLABELS_TS_FILES}
OPTIONS -no-obsolete OPTIONS -no-obsolete
) )
qt5_create_translation (templates_qm_files qt5_create_translation (templates_qm_files
${CMAKE_CURRENT_BINARY_DIR}/template-strings.h ${TEMPLATES_TS_FILES} ${CMAKE_CURRENT_BINARY_DIR}/template-strings.h
${TEMPLATES_TS_FILES}
OPTIONS -no-obsolete -locations none OPTIONS -no-obsolete -locations none
) )
+910 -169
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff