Created QrEncode barcode backend.
This commit is contained in:
+17
-1
@@ -5,6 +5,11 @@ cmake_minimum_required (VERSION 2.8.12)
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
project (glabels)
|
project (glabels)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Path for locally defined cmake modules
|
||||||
|
#
|
||||||
|
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||||
|
|
||||||
|
|
||||||
#=======================================
|
#=======================================
|
||||||
# Version Information
|
# Version Information
|
||||||
@@ -44,6 +49,11 @@ endif ()
|
|||||||
|
|
||||||
find_package(ZLIB 1.2 REQUIRED)
|
find_package(ZLIB 1.2 REQUIRED)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Optional dependencies
|
||||||
|
#
|
||||||
|
find_package (LibQrencode QUIET)
|
||||||
|
|
||||||
|
|
||||||
#=======================================
|
#=======================================
|
||||||
# Subdirectories
|
# Subdirectories
|
||||||
@@ -67,10 +77,16 @@ message (STATUS "C++ Compiler ............ " ${CMAKE_CXX_COMPILER_ID} " " ${CMAK
|
|||||||
message (STATUS "Qt version .............. " ${Qt5Core_VERSION})
|
message (STATUS "Qt version .............. " ${Qt5Core_VERSION})
|
||||||
message (STATUS "zlib version ............ " ${ZLIB_VERSION_STRING})
|
message (STATUS "zlib version ............ " ${ZLIB_VERSION_STRING})
|
||||||
|
|
||||||
|
if (LIBQRENCODE_FOUND)
|
||||||
|
message (STATUS "qrencode (optional)...... " ${LIBQRENCODE_VERSION_STRING})
|
||||||
|
else (LIBQRENCODE_FOUND)
|
||||||
|
message (STATUS "qrencode (optional)...... No.")
|
||||||
|
endif (LIBQRENCODE_FOUND)
|
||||||
|
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
message (STATUS "MinGW location .......... " ${MINGW_BASE_DIR})
|
message (STATUS "MinGW location .......... " ${MINGW_BASE_DIR})
|
||||||
message (STATUS "MinGW Qt location ....... " ${QT_BASE_DIR})
|
message (STATUS "MinGW Qt location ....... " ${QT_BASE_DIR})
|
||||||
endif ()
|
endif (MINGW)
|
||||||
|
|
||||||
message (STATUS "")
|
message (STATUS "")
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# - Try to find the LibQrencode QRCode generator library
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# LIBQRENCODE_FOUND - System has LibQrencode
|
||||||
|
# LIBQRENCODE_INCLUDE_DIR - The LibQrencode include directory
|
||||||
|
# LIBQRENCODE_LIBRARIES - The libraries needed to use LibQrencode
|
||||||
|
# LIBQRENCODE_DEFINITIONS - Compiler switches required for using LibQrencode
|
||||||
|
# LIBQRENCODE_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibQrencode
|
||||||
|
# LIBQRENCODE_VERSION_STRING - the version of LibQrencode found
|
||||||
|
|
||||||
|
# use pkg-config to get the directories and then use these values with find_path() and find_library()
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
PKG_CHECK_MODULES(PC_LIBQRENCODE QUIET libqrencode)
|
||||||
|
set(LIBQRENCODE_DEFINITIONS ${PC_LIBQRENCODE_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(LIBQRENCODE_INCLUDE_DIR NAMES qrencode.h
|
||||||
|
HINTS
|
||||||
|
${PC_LIBQRENCODE_INCLUDEDIR}
|
||||||
|
${PC_LIBQRENCODE_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES libqrencode
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(LIBQRENCODE_LIBRARIES NAMES qrencode libqrencode
|
||||||
|
HINTS
|
||||||
|
${PC_LIBQRENCODE_LIBDIR}
|
||||||
|
${PC_LIBQRENCODE_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PC_LIBQRENCODE_VERSION)
|
||||||
|
set(LIBQRENCODE_VERSION_STRING ${PC_LIBQRENCODE_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LIBQRENCODE_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibQrencode
|
||||||
|
REQUIRED_VARS LIBQRENCODE_LIBRARIES LIBQRENCODE_INCLUDE_DIR
|
||||||
|
VERSION_VAR LIBQRENCODE_VERSION_STRING)
|
||||||
|
|
||||||
|
mark_as_advanced(LIBQRENCODE_INCLUDE_DIR LIBQRENCODE_LIBRARIES)
|
||||||
+39
-14
@@ -20,6 +20,12 @@
|
|||||||
|
|
||||||
#include "BarcodeBackends.h"
|
#include "BarcodeBackends.h"
|
||||||
|
|
||||||
|
#include "glbarcode/Factory.h"
|
||||||
|
|
||||||
|
#if HAVE_QRENCODE
|
||||||
|
#include "BarcodeBackends/QrEncode.h"
|
||||||
|
#endif // HAVE_QRENCODE
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
@@ -27,9 +33,8 @@ namespace glabels
|
|||||||
//
|
//
|
||||||
// Static data
|
// Static data
|
||||||
//
|
//
|
||||||
BarcodeBackends::BackendMap BarcodeBackends::mBackendIdMap;
|
QStringList BarcodeBackends::mBackendIdList;
|
||||||
BarcodeBackends::BackendMap BarcodeBackends::mBackendNameMap;
|
QMap<QString,QString> BarcodeBackends::mBackendNameMap;
|
||||||
QList<QString> BarcodeBackends::mBackendNameList;
|
|
||||||
|
|
||||||
QList<BarcodeStyle> BarcodeBackends::mStyleList;
|
QList<BarcodeStyle> BarcodeBackends::mStyleList;
|
||||||
|
|
||||||
@@ -66,11 +71,20 @@ namespace glabels
|
|||||||
registerStyle( "onecode", "", tr("USPS Intelligent Mail"),
|
registerStyle( "onecode", "", tr("USPS Intelligent Mail"),
|
||||||
false, false, true, false, "12345678901234567890", false, 20 );
|
false, false, true, false, "12345678901234567890", false, 20 );
|
||||||
|
|
||||||
registerStyle( "datamatrix", "", tr("DataMatrix"),
|
registerStyle( "datamatrix", "", tr("IEC16022 (DataMatrix)"),
|
||||||
false, false, true, false, "1234567890AB", false, 12 );
|
false, false, true, false, "1234567890AB", false, 12 );
|
||||||
|
|
||||||
registerStyle( "qrcode", "", tr("QRCode"),
|
#if HAVE_QRENCODE
|
||||||
|
//
|
||||||
|
// Libqrencode backend
|
||||||
|
//
|
||||||
|
registerBackend( "qrencode", "QREncode" );
|
||||||
|
|
||||||
|
glbarcode::Factory::registerType( "qrencode::qrcode", barcode::QrEncode::createQrCode );
|
||||||
|
|
||||||
|
registerStyle( "qrcode", "qrencode", tr("IEC18004 (QRCode)"),
|
||||||
false, false, true, false, "1234567890AB", false, 12 );
|
false, false, true, false, "1234567890AB", false, 12 );
|
||||||
|
#endif // HAVE_QRENCODE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +100,18 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const QStringList& BarcodeBackends::backendList()
|
||||||
|
{
|
||||||
|
return mBackendIdList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString BarcodeBackends::backendName( const QString& backendId )
|
||||||
|
{
|
||||||
|
return mBackendNameMap[ backendId ];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const QList<BarcodeStyle>& BarcodeBackends::styleList()
|
const QList<BarcodeStyle>& BarcodeBackends::styleList()
|
||||||
{
|
{
|
||||||
return mStyleList;
|
return mStyleList;
|
||||||
@@ -112,29 +138,28 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BarcodeBackends::registerBackend( QString& id, QString& name)
|
void BarcodeBackends::registerBackend( const QString& backendId, const QString& backendName )
|
||||||
{
|
{
|
||||||
mBackendNameList.append( name );
|
mBackendIdList.append( backendId );
|
||||||
mBackendIdMap.insert( id, name );
|
mBackendNameMap[ backendId ] = backendName;
|
||||||
mBackendNameMap.insert( name, id );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BarcodeBackends::registerStyle( const char* id,
|
void BarcodeBackends::registerStyle( const QString& id,
|
||||||
const char* backendId,
|
const QString& backendId,
|
||||||
const QString& name,
|
const QString& name,
|
||||||
bool canText,
|
bool canText,
|
||||||
bool textOptional,
|
bool textOptional,
|
||||||
bool canChecksum,
|
bool canChecksum,
|
||||||
bool checksumOptional,
|
bool checksumOptional,
|
||||||
const char* defaultDigits,
|
const QString& defaultDigits,
|
||||||
bool canFreeForm,
|
bool canFreeForm,
|
||||||
int preferedN )
|
int preferedN )
|
||||||
{
|
{
|
||||||
BarcodeStyle style( QString(id), QString(backendId), name,
|
BarcodeStyle style( id, backendId, name,
|
||||||
canText, textOptional,
|
canText, textOptional,
|
||||||
canChecksum, checksumOptional,
|
canChecksum, checksumOptional,
|
||||||
QString(defaultDigits),
|
defaultDigits,
|
||||||
canFreeForm, preferedN );
|
canFreeForm, preferedN );
|
||||||
|
|
||||||
mStyleList.append( style );
|
mStyleList.append( style );
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ namespace glabels
|
|||||||
// Public Methods
|
// Public Methods
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
|
static const QStringList& backendList();
|
||||||
|
static QString backendName( const QString& backendId );
|
||||||
static const QList<BarcodeStyle>& styleList();
|
static const QList<BarcodeStyle>& styleList();
|
||||||
static const BarcodeStyle& defaultStyle();
|
static const BarcodeStyle& defaultStyle();
|
||||||
static const BarcodeStyle& style( const QString& backendId, const QString& StyleId );
|
static const BarcodeStyle& style( const QString& backendId, const QString& StyleId );
|
||||||
@@ -63,16 +65,16 @@ namespace glabels
|
|||||||
// Private Methods
|
// Private Methods
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
static void registerBackend( QString &id, QString &name);
|
static void registerBackend( const QString &backendId, const QString &backendName );
|
||||||
|
|
||||||
static void registerStyle( const char* id,
|
static void registerStyle( const QString& id,
|
||||||
const char* backendId,
|
const QString& backendId,
|
||||||
const QString& name,
|
const QString& name,
|
||||||
bool canText,
|
bool canText,
|
||||||
bool textOptional,
|
bool textOptional,
|
||||||
bool canChecksum,
|
bool canChecksum,
|
||||||
bool checksumOptional,
|
bool checksumOptional,
|
||||||
const char* defaultDigits,
|
const QString& defaultDigits,
|
||||||
bool canFreeForm,
|
bool canFreeForm,
|
||||||
int preferedN );
|
int preferedN );
|
||||||
|
|
||||||
@@ -80,10 +82,8 @@ namespace glabels
|
|||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// Private Members
|
// Private Members
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
typedef QMap<QString,QString> BackendMap;
|
static QStringList mBackendIdList;
|
||||||
static BackendMap mBackendIdMap;
|
static QMap<QString,QString> mBackendNameMap;
|
||||||
static BackendMap mBackendNameMap;
|
|
||||||
static QList<QString> mBackendNameList;
|
|
||||||
|
|
||||||
static QList<BarcodeStyle> mStyleList;
|
static QList<BarcodeStyle> mStyleList;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#=======================================
|
||||||
|
# Sources
|
||||||
|
#=======================================
|
||||||
|
set (barcode_sources
|
||||||
|
QrEncode.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library (Barcode STATIC
|
||||||
|
${barcode_sources}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#=======================================
|
||||||
|
# Where to find stuff
|
||||||
|
#=======================================
|
||||||
|
include_directories (
|
||||||
|
)
|
||||||
|
|
||||||
|
link_directories (
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#=======================================
|
||||||
|
# Subdirectories
|
||||||
|
#=======================================
|
||||||
|
|
||||||
|
|
||||||
|
#=======================================
|
||||||
|
# Install
|
||||||
|
#=======================================
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
/* QrEncode.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if HAVE_QRENCODE
|
||||||
|
|
||||||
|
#include "QrEncode.h"
|
||||||
|
|
||||||
|
#include "qrencode.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
namespace barcode
|
||||||
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Static QrCode barcode creation method
|
||||||
|
*/
|
||||||
|
glbarcode::Barcode* QrEncode::createQrCode()
|
||||||
|
{
|
||||||
|
return new QrEncode();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* QrEncode data validation, implements glbarcode::Barcode2dBase::validate()
|
||||||
|
*/
|
||||||
|
bool QrEncode::validate( const std::string& rawData )
|
||||||
|
{
|
||||||
|
if ( rawData.size() == 0 )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* QrEncode data encoding, implements glbarcode::Barcode2dBase::encode()
|
||||||
|
*/
|
||||||
|
bool QrEncode::encode( const std::string& cookedData, glbarcode::Matrix<bool>& encodedData )
|
||||||
|
{
|
||||||
|
QRcode *qrcode = QRcode_encodeString( cookedData.c_str(), 0, QR_ECLEVEL_M, QR_MODE_8, 1 );
|
||||||
|
if ( qrcode == NULL )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int w = qrcode->width;
|
||||||
|
encodedData.resize( w, w );
|
||||||
|
|
||||||
|
|
||||||
|
for ( int iy = 0; iy < w; iy++ )
|
||||||
|
{
|
||||||
|
for ( int ix = 0; ix < w; ix++ )
|
||||||
|
{
|
||||||
|
encodedData[iy][ix] = qrcode->data[ iy*w + ix ] & 0x01;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QRcode_free( qrcode );
|
||||||
|
QRcode_clearCache();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // HAVE_QRENCODE
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
/* QrEncode.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 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 barcode_QrEncode_h
|
||||||
|
#define barcode_QrEncode_h
|
||||||
|
|
||||||
|
|
||||||
|
#include "glbarcode/Barcode2dBase.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
namespace barcode
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LibQREncode barcode backend
|
||||||
|
*
|
||||||
|
* Implements glbarcode::Barcode2dBase.
|
||||||
|
*/
|
||||||
|
class QrEncode : public glbarcode::Barcode2dBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static Barcode* createQrCode();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool validate( const std::string& rawData ) override;
|
||||||
|
|
||||||
|
bool encode( const std::string& cookedData,
|
||||||
|
glbarcode::Matrix<bool>& encodedData ) override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // barcode_QrEncode_h
|
||||||
+24
-4
@@ -36,11 +36,31 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
foreach ( const BarcodeStyle& bcStyle, BarcodeBackends::styleList() )
|
foreach ( const BarcodeStyle& bcStyle, BarcodeBackends::styleList() )
|
||||||
{
|
{
|
||||||
BarcodeMenuItem* bcMenuItem = new BarcodeMenuItem( bcStyle );
|
if ( bcStyle.backendId() == "" )
|
||||||
connect( bcMenuItem, SIGNAL(activated(const BarcodeStyle&)),
|
{
|
||||||
this, SLOT(onMenuItemActivated(const BarcodeStyle&)) );
|
BarcodeMenuItem* bcMenuItem = new BarcodeMenuItem( bcStyle );
|
||||||
|
connect( bcMenuItem, SIGNAL(activated(const BarcodeStyle&)),
|
||||||
|
this, SLOT(onMenuItemActivated(const BarcodeStyle&)) );
|
||||||
|
|
||||||
addAction( bcMenuItem );
|
addAction( bcMenuItem );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( const QString& backendId, BarcodeBackends::backendList() )
|
||||||
|
{
|
||||||
|
QMenu* subMenu = addMenu( BarcodeBackends::backendName( backendId ) );
|
||||||
|
|
||||||
|
foreach ( const BarcodeStyle& bcStyle, BarcodeBackends::styleList() )
|
||||||
|
{
|
||||||
|
if ( bcStyle.backendId() == backendId )
|
||||||
|
{
|
||||||
|
BarcodeMenuItem* bcMenuItem = new BarcodeMenuItem( bcStyle );
|
||||||
|
connect( bcMenuItem, SIGNAL(activated(const BarcodeStyle&)),
|
||||||
|
this, SLOT(onMenuItemActivated(const BarcodeStyle&)) );
|
||||||
|
|
||||||
|
subMenu->addAction( bcMenuItem );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,22 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Full ID Property Getter
|
||||||
|
///
|
||||||
|
QString BarcodeStyle::fullId() const
|
||||||
|
{
|
||||||
|
if ( mBackendId == "" )
|
||||||
|
{
|
||||||
|
return mId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return mBackendId + "::" + mId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Backend ID Property Getter
|
/// Backend ID Property Getter
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ namespace glabels
|
|||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
const QString& id() const;
|
const QString& id() const;
|
||||||
|
|
||||||
|
QString fullId() const;
|
||||||
|
|
||||||
const QString& backendId() const;
|
const QString& backendId() const;
|
||||||
|
|
||||||
const QString& name() const;
|
const QString& name() const;
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ endif ()
|
|||||||
# Uncomment to build with pedantic flags
|
# Uncomment to build with pedantic flags
|
||||||
#add_compile_options (-Werror -Wall -Wpedantic)
|
#add_compile_options (-Werror -Wall -Wpedantic)
|
||||||
|
|
||||||
|
if (${LIBQRENCODE_FOUND})
|
||||||
|
add_definitions (-DHAVE_QRENCODE=1)
|
||||||
|
else (${LIBQRENCODE_FOUND})
|
||||||
|
set (LIBQRENCODE_INCLUDE_DIR "")
|
||||||
|
set (LIBQRENCODE_LIBRARIES "")
|
||||||
|
endif (${LIBQRENCODE_FOUND})
|
||||||
|
|
||||||
|
|
||||||
#=======================================
|
#=======================================
|
||||||
# Auto-generate Version.h
|
# Auto-generate Version.h
|
||||||
@@ -177,6 +184,7 @@ add_executable (glabels-qt WIN32
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries (glabels-qt
|
target_link_libraries (glabels-qt
|
||||||
|
Barcode
|
||||||
Merge
|
Merge
|
||||||
glbarcode
|
glbarcode
|
||||||
${Qt5Widgets_LIBRARIES}
|
${Qt5Widgets_LIBRARIES}
|
||||||
@@ -184,6 +192,7 @@ target_link_libraries (glabels-qt
|
|||||||
${Qt5Xml_LIBRARIES}
|
${Qt5Xml_LIBRARIES}
|
||||||
${Qt5Svg_LIBRARIES}
|
${Qt5Svg_LIBRARIES}
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
|
${LIBQRENCODE_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -197,6 +206,7 @@ include_directories (
|
|||||||
${Qt5PrintSupport_INCLUDE_DIRS}
|
${Qt5PrintSupport_INCLUDE_DIRS}
|
||||||
${Qt5Xml_INCLUDE_DIRS}
|
${Qt5Xml_INCLUDE_DIRS}
|
||||||
${Qt5Svg_INCLUDE_DIRS}
|
${Qt5Svg_INCLUDE_DIRS}
|
||||||
|
${LIBQRENCODE_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories (
|
link_directories (
|
||||||
@@ -206,6 +216,7 @@ link_directories (
|
|||||||
#=======================================
|
#=======================================
|
||||||
# Subdirectories
|
# Subdirectories
|
||||||
#=======================================
|
#=======================================
|
||||||
|
add_subdirectory (BarcodeBackends)
|
||||||
add_subdirectory (Merge)
|
add_subdirectory (Merge)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -363,10 +363,10 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
delete mEditorBarcode;
|
delete mEditorBarcode;
|
||||||
}
|
}
|
||||||
mEditorBarcode = glbarcode::Factory::createBarcode( mBcStyle.id().toStdString() );
|
mEditorBarcode = glbarcode::Factory::createBarcode( mBcStyle.fullId().toStdString() );
|
||||||
if ( !mEditorBarcode )
|
if ( !mEditorBarcode )
|
||||||
{
|
{
|
||||||
qWarning() << "Invalid barcode style" << mBcStyle.id() << "using \"code39\".";
|
qWarning() << "Invalid barcode style" << mBcStyle.fullId() << "using \"code39\".";
|
||||||
mBcStyle = BarcodeBackends::defaultStyle();
|
mBcStyle = BarcodeBackends::defaultStyle();
|
||||||
mEditorBarcode = glbarcode::Factory::createBarcode( mBcStyle.id().toStdString() );
|
mEditorBarcode = glbarcode::Factory::createBarcode( mBcStyle.id().toStdString() );
|
||||||
}
|
}
|
||||||
@@ -382,10 +382,10 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
delete mEditorDefaultBarcode;
|
delete mEditorDefaultBarcode;
|
||||||
}
|
}
|
||||||
mEditorDefaultBarcode = glbarcode::Factory::createBarcode( mBcStyle.id().toStdString() );
|
mEditorDefaultBarcode = glbarcode::Factory::createBarcode( mBcStyle.fullId().toStdString() );
|
||||||
if ( !mEditorDefaultBarcode )
|
if ( !mEditorDefaultBarcode )
|
||||||
{
|
{
|
||||||
qWarning() << "Invalid barcode style" << mBcStyle.id() << "using \"code39\".";
|
qWarning() << "Invalid barcode style" << mBcStyle.fullId() << "using \"code39\".";
|
||||||
mBcStyle = BarcodeBackends::defaultStyle();
|
mBcStyle = BarcodeBackends::defaultStyle();
|
||||||
mEditorDefaultBarcode = glbarcode::Factory::createBarcode( mBcStyle.id().toStdString() );
|
mEditorDefaultBarcode = glbarcode::Factory::createBarcode( mBcStyle.id().toStdString() );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
cmake_minimum_required (VERSION 2.8.12)
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# gLabels Merge subsystem
|
|
||||||
###############################################################################
|
|
||||||
project (Merge CXX)
|
|
||||||
|
|
||||||
|
|
||||||
#=======================================
|
#=======================================
|
||||||
# Sources
|
# Sources
|
||||||
#=======================================
|
#=======================================
|
||||||
|
|||||||
+20
-20
@@ -744,65 +744,65 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>glabels::BarcodeBackends</name>
|
<name>glabels::BarcodeBackends</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="51"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="56"/>
|
||||||
<source>POSTNET (any)</source>
|
<source>POSTNET (any)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="54"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="59"/>
|
||||||
<source>POSTNET-5 (ZIP only)</source>
|
<source>POSTNET-5 (ZIP only)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="57"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="62"/>
|
||||||
<source>POSTNET-9 (ZIP+4)</source>
|
<source>POSTNET-9 (ZIP+4)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="60"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="65"/>
|
||||||
<source>POSTNET-11 (DPBC)</source>
|
<source>POSTNET-11 (DPBC)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="63"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="68"/>
|
||||||
<source>CEPNET</source>
|
<source>CEPNET</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="66"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="71"/>
|
||||||
<source>USPS Intelligent Mail</source>
|
<source>USPS Intelligent Mail</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="39"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="74"/>
|
||||||
|
<source>IEC16022 (DataMatrix)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../glabels/BarcodeBackends.cpp" line="85"/>
|
||||||
|
<source>IEC18004 (QRCode)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../glabels/BarcodeBackends.cpp" line="44"/>
|
||||||
<source>Code 39</source>
|
<source>Code 39</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="42"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="47"/>
|
||||||
<source>Code 39 Extended</source>
|
<source>Code 39 Extended</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="45"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="50"/>
|
||||||
<source>UPC-A</source>
|
<source>UPC-A</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="48"/>
|
<location filename="../glabels/BarcodeBackends.cpp" line="53"/>
|
||||||
<source>EAN-13</source>
|
<source>EAN-13</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="69"/>
|
|
||||||
<source>DataMatrix</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../glabels/BarcodeBackends.cpp" line="72"/>
|
|
||||||
<source>QRCode</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>glabels::ColorPaletteDialog</name>
|
<name>glabels::ColorPaletteDialog</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user