Merge remote-tracking branch 'upstream/master'
Merge from upstream
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
[](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).
|
||||
|
||||

|
||||
|
||||
|
||||
## What's new in gLabels-qt?
|
||||
## What's new in gLabels 4?
|
||||
|
||||
- Based on the Qt5 framework.
|
||||
- Updated UI based on typical workflows.
|
||||
- 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
|
||||
|
||||
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
|
||||
|
||||
- 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
|
||||
|
||||
There are currently no official releases of gLabels-qt.
|
||||
There are currently no official releases of gLabels 4.
|
||||
|
||||
### Continuous Integration Snapshots
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 187 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB |
@@ -24,6 +24,7 @@ set (glabels_sources
|
||||
MainWindow.cpp
|
||||
MergeView.cpp
|
||||
MiniPreviewPixmap.cpp
|
||||
NotebookUtil.cpp
|
||||
ObjectEditor.cpp
|
||||
PreferencesDialog.cpp
|
||||
PrintView.cpp
|
||||
|
||||
+78
-3
@@ -70,8 +70,6 @@ namespace glabels
|
||||
mContents = new QListWidget();
|
||||
mContents->setViewMode(QListView::ListMode);
|
||||
mContents->setMovement(QListView::Static);
|
||||
mContents->setMinimumWidth(96);
|
||||
mContents->setMaximumWidth(96);
|
||||
mContents->setSpacing(6);
|
||||
|
||||
// Pages widget
|
||||
@@ -86,27 +84,37 @@ namespace glabels
|
||||
// Add "Editor" page
|
||||
mPages->addWidget( editorPage );
|
||||
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);
|
||||
|
||||
// Add "Properties" page
|
||||
mPages->addWidget( propertiesPage );
|
||||
mPropertiesButton = new QListWidgetItem(mContents);
|
||||
mPropertiesButton->setText(tr("Properties"));
|
||||
mPropertiesButton->setToolTip( tr("Select <b>Properties</b> mode") );
|
||||
mPropertiesButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
// Add "Merge" page
|
||||
mPages->addWidget( mergePage );
|
||||
mMergeButton = new QListWidgetItem(mContents);
|
||||
mMergeButton->setText(tr("Merge"));
|
||||
mMergeButton->setToolTip( tr("Select <b>Merge</b> mode") );
|
||||
mMergeButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
// Add "Print" page
|
||||
mPages->addWidget( printPage );
|
||||
mPrintButton = new QListWidgetItem(mContents);
|
||||
mPrintButton->setText(tr("Print"));
|
||||
mPrintButton->setToolTip( tr("Select <b>Print</b> mode") );
|
||||
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
|
||||
mWelcomeButton->setSelected( true );
|
||||
mPages->setCurrentIndex(mContents->row(mWelcomeButton));
|
||||
@@ -246,6 +254,26 @@ namespace glabels
|
||||
fileSaveAsAction->setStatusTip( tr("Save current gLabels project to a different name") );
|
||||
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->setStatusTip( tr("Create custom templates") );
|
||||
connect( fileTemplateDesignerAction, SIGNAL(triggered()), this, SLOT(fileTemplateDesigner()) );
|
||||
@@ -517,6 +545,11 @@ namespace glabels
|
||||
fileMenu->addAction( fileSaveAction );
|
||||
fileMenu->addAction( fileSaveAsAction );
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->addAction( fileShowEditorPageAction );
|
||||
fileMenu->addAction( fileShowPropertiesPageAction );
|
||||
fileMenu->addAction( fileShowMergePageAction );
|
||||
fileMenu->addAction( fileShowPrintPageAction );
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->addAction( fileTemplateDesignerAction );
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->addAction( fileCloseAction );
|
||||
@@ -988,6 +1021,12 @@ namespace glabels
|
||||
setSelectionVerbsEnabled( isEditorPage && !mModel->isSelectionEmpty() );
|
||||
setMultiSelectionVerbsEnabled( isEditorPage && !mModel->isSelectionEmpty() && !mModel->isSelectionAtomic() );
|
||||
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
|
||||
///
|
||||
|
||||
@@ -92,6 +92,10 @@ namespace glabels
|
||||
void fileOpen();
|
||||
void fileSave();
|
||||
void fileSaveAs();
|
||||
void fileShowEditorPage();
|
||||
void fileShowPropertiesPage();
|
||||
void fileShowMergePage();
|
||||
void fileShowPrintPage();
|
||||
void fileTemplateDesigner();
|
||||
void fileClose();
|
||||
void fileExit();
|
||||
@@ -235,6 +239,10 @@ namespace glabels
|
||||
QAction* fileOpenAction;
|
||||
QAction* fileSaveAction;
|
||||
QAction* fileSaveAsAction;
|
||||
QAction* fileShowEditorPageAction;
|
||||
QAction* fileShowPropertiesPageAction;
|
||||
QAction* fileShowMergePageAction;
|
||||
QAction* fileShowPrintPageAction;
|
||||
QAction* fileTemplateDesignerAction;
|
||||
QAction* fileCloseAction;
|
||||
QAction* fileExitAction;
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
@@ -61,15 +61,15 @@ namespace glabels
|
||||
textVAlignGroup->addButton( textVAlignMiddleToggle, Qt::AlignVCenter );
|
||||
textVAlignGroup->addButton( textVAlignBottomToggle, Qt::AlignBottom );
|
||||
|
||||
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) );
|
||||
lineColorButton->init( tr("No line"), 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( tr("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( tr("Default"), QColor(0,0,0,255), QColor(0,0,0,255) );
|
||||
|
||||
textInsertFieldCombo->setName( "Insert Field" );
|
||||
barcodeInsertFieldCombo->setName( "Insert Field" );
|
||||
imageFieldCombo->setName( "Key" );
|
||||
textInsertFieldCombo->setName( tr("Insert Field") );
|
||||
barcodeInsertFieldCombo->setName( tr("Insert Field") );
|
||||
imageFieldCombo->setName( tr("Key") );
|
||||
|
||||
setEnabled( false );
|
||||
hidePages();
|
||||
@@ -351,9 +351,9 @@ namespace glabels
|
||||
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-box.svg") );
|
||||
titleLabel->setText( tr("Box object properties") );
|
||||
|
||||
notebook->addTab( lineFillPage, "line/fill" );
|
||||
notebook->addTab( posSizePage, "position/size" );
|
||||
notebook->addTab( shadowPage, "shadow" );
|
||||
notebook->addTab( lineFillPage, tr("line/fill") );
|
||||
notebook->addTab( posSizePage, tr("position/size") );
|
||||
notebook->addTab( shadowPage, tr("shadow") );
|
||||
|
||||
fillFrame->setVisible( true );
|
||||
sizeRectFrame->setVisible( true );
|
||||
@@ -372,9 +372,9 @@ namespace glabels
|
||||
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-ellipse.svg") );
|
||||
titleLabel->setText( tr("Ellipse object properties") );
|
||||
|
||||
notebook->addTab( lineFillPage, "line/fill" );
|
||||
notebook->addTab( posSizePage, "position/size" );
|
||||
notebook->addTab( shadowPage, "shadow" );
|
||||
notebook->addTab( lineFillPage, tr("line/fill") );
|
||||
notebook->addTab( posSizePage, tr("position/size") );
|
||||
notebook->addTab( shadowPage, tr("shadow") );
|
||||
|
||||
fillFrame->setVisible( true );
|
||||
sizeRectFrame->setVisible( true );
|
||||
@@ -393,9 +393,9 @@ namespace glabels
|
||||
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-image.svg") );
|
||||
titleLabel->setText( tr("Image object properties") );
|
||||
|
||||
notebook->addTab( imagePage, "image" );
|
||||
notebook->addTab( posSizePage, "position/size" );
|
||||
notebook->addTab( shadowPage, "shadow" );
|
||||
notebook->addTab( imagePage, tr("image") );
|
||||
notebook->addTab( posSizePage, tr("position/size") );
|
||||
notebook->addTab( shadowPage, tr("shadow") );
|
||||
|
||||
sizeRectFrame->setVisible( true );
|
||||
sizeOriginalSizeGroup->setVisible( true );
|
||||
@@ -413,9 +413,9 @@ namespace glabels
|
||||
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-line.svg") );
|
||||
titleLabel->setText( tr("Line object properties") );
|
||||
|
||||
notebook->addTab( lineFillPage, "line/fill" );
|
||||
notebook->addTab( posSizePage, "position/size" );
|
||||
notebook->addTab( shadowPage, "shadow" );
|
||||
notebook->addTab( lineFillPage, tr("line/fill") );
|
||||
notebook->addTab( posSizePage, tr("position/size") );
|
||||
notebook->addTab( shadowPage, tr("shadow") );
|
||||
|
||||
fillFrame->setVisible( false );
|
||||
sizeRectFrame->setVisible( false );
|
||||
@@ -434,9 +434,9 @@ namespace glabels
|
||||
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-text.svg") );
|
||||
titleLabel->setText( tr("Text object properties") );
|
||||
|
||||
notebook->addTab( textPage, "text" );
|
||||
notebook->addTab( posSizePage, "position/size" );
|
||||
notebook->addTab( shadowPage, "shadow" );
|
||||
notebook->addTab( textPage, tr("text") );
|
||||
notebook->addTab( posSizePage, tr("position/size") );
|
||||
notebook->addTab( shadowPage, tr("shadow") );
|
||||
|
||||
sizeRectFrame->setVisible( true );
|
||||
sizeOriginalSizeGroup->setVisible( false );
|
||||
@@ -453,8 +453,8 @@ namespace glabels
|
||||
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-barcode.svg") );
|
||||
titleLabel->setText( tr("Barcode object properties") );
|
||||
|
||||
notebook->addTab( barcodePage, "barcode" );
|
||||
notebook->addTab( posSizePage, "position/size" );
|
||||
notebook->addTab( barcodePage, tr("barcode") );
|
||||
notebook->addTab( posSizePage, tr("position/size") );
|
||||
|
||||
sizeRectFrame->setVisible( true );
|
||||
sizeOriginalSizeGroup->setVisible( false );
|
||||
@@ -479,7 +479,7 @@ namespace glabels
|
||||
mObject = nullptr;
|
||||
|
||||
titleImageLabel->setPixmap( QPixmap(":icons/24x24/actions/glabels-object-properties.svg") );
|
||||
titleLabel->setText( "Object properties" );
|
||||
titleLabel->setText( tr("Object properties") );
|
||||
setEnabled( false );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "SelectProductDialog.h"
|
||||
|
||||
#include "NotebookUtil.h"
|
||||
#include "TemplatePickerItem.h"
|
||||
|
||||
#include "model/Db.h"
|
||||
@@ -62,6 +63,8 @@ namespace glabels
|
||||
connect( check, SIGNAL(clicked()), this, SLOT(onCategoryCheckClicked()) );
|
||||
}
|
||||
|
||||
NotebookUtil::establishSize( modeNotebook );
|
||||
|
||||
QList<model::Template*> tmplates = model::Db::templates();
|
||||
templatePicker->setTemplates( tmplates );
|
||||
|
||||
|
||||
@@ -7,12 +7,16 @@ set_directory_properties (PROPERTIES CLEAN_NO_CUSTOM 1)
|
||||
include (TRANSLATION_FILES.txt)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
|
||||
+910
-169
File diff suppressed because it is too large
Load Diff
+895
-154
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user