Initial non-functioning implementation of NewLabelDialog.
This commit is contained in:
+10
-1
@@ -6,6 +6,7 @@ set (glabels_sources
|
|||||||
glabels_main.cpp
|
glabels_main.cpp
|
||||||
BarcodeStyle.cpp
|
BarcodeStyle.cpp
|
||||||
ColorNode.cpp
|
ColorNode.cpp
|
||||||
|
File.cpp
|
||||||
Help.cpp
|
Help.cpp
|
||||||
LabelModel.cpp
|
LabelModel.cpp
|
||||||
LabelModelItem.cpp
|
LabelModelItem.cpp
|
||||||
@@ -15,6 +16,7 @@ set (glabels_sources
|
|||||||
MergeRecord.cpp
|
MergeRecord.cpp
|
||||||
TemplatePicker.cpp
|
TemplatePicker.cpp
|
||||||
TextNode.cpp
|
TextNode.cpp
|
||||||
|
NewLabelDialog.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set (glabels_qobject_headers
|
set (glabels_qobject_headers
|
||||||
@@ -22,6 +24,11 @@ set (glabels_qobject_headers
|
|||||||
LabelModelItem.h
|
LabelModelItem.h
|
||||||
MainWindow.h
|
MainWindow.h
|
||||||
TemplatePicker.h
|
TemplatePicker.h
|
||||||
|
NewLabelDialog.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set (glabels_forms
|
||||||
|
ui/NewLabelDialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
set (glabels_resource_files
|
set (glabels_resource_files
|
||||||
@@ -30,12 +37,14 @@ set (glabels_resource_files
|
|||||||
)
|
)
|
||||||
|
|
||||||
qt4_wrap_cpp (glabels_moc_sources ${glabels_qobject_headers})
|
qt4_wrap_cpp (glabels_moc_sources ${glabels_qobject_headers})
|
||||||
|
qt4_wrap_ui (glabels_forms_headers ${glabels_forms})
|
||||||
qt4_add_resources(glabels_qrc_sources ${glabels_resource_files})
|
qt4_add_resources(glabels_qrc_sources ${glabels_resource_files})
|
||||||
|
|
||||||
include (${QT_USE_FILE})
|
include (${QT_USE_FILE})
|
||||||
|
|
||||||
|
|
||||||
include_directories (
|
include_directories (
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${glabels_qt_SOURCE_DIR}
|
${glabels_qt_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -43,7 +52,7 @@ link_directories (
|
|||||||
${glabels_qt_SOURCE_DIR}/libglabels
|
${glabels_qt_SOURCE_DIR}/libglabels
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable (glabels-qt ${glabels_sources} ${glabels_moc_sources} ${glabels_qrc_sources})
|
add_executable (glabels-qt ${glabels_sources} ${glabels_moc_sources} ${glabels_qrc_sources} ${glabels_forms_headers})
|
||||||
|
|
||||||
target_link_libraries (glabels-qt
|
target_link_libraries (glabels-qt
|
||||||
libglabels
|
libglabels
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* File.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 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 "File.h"
|
||||||
|
|
||||||
|
#include "NewLabelDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace gLabels
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace File
|
||||||
|
{
|
||||||
|
|
||||||
|
void newLabel( QWidget *parent )
|
||||||
|
{
|
||||||
|
NewLabelDialog newDialog( parent );
|
||||||
|
newDialog.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
/* File.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 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 glabels_File_h
|
||||||
|
#define glabels_File_h
|
||||||
|
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
|
namespace gLabels
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace File
|
||||||
|
{
|
||||||
|
void newLabel( QWidget *parent );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // glabels_File_h
|
||||||
+3
-10
@@ -27,11 +27,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "Icons.h"
|
#include "Icons.h"
|
||||||
|
#include "File.h"
|
||||||
#include "Help.h"
|
#include "Help.h"
|
||||||
///// TEMPORARY TESTING /////
|
|
||||||
#include "TemplatePicker.h"
|
|
||||||
#include "libglabels/Db.h"
|
|
||||||
/////////////////////////////
|
|
||||||
|
|
||||||
namespace gLabels
|
namespace gLabels
|
||||||
{
|
{
|
||||||
@@ -39,12 +36,8 @@ namespace gLabels
|
|||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
{
|
{
|
||||||
/////////////// TEMPORARY TESTING ///////////////
|
/////////////// TEMPORARY TESTING ///////////////
|
||||||
#if 0
|
#if 1
|
||||||
QLabel *tmp = new QLabel( "Coming Soon..." );
|
QLabel *tmp = new QLabel( "Coming Soon..." );
|
||||||
#else
|
|
||||||
TemplatePicker *tmp = new TemplatePicker();
|
|
||||||
QList<libglabels::Template*> tmplates = libglabels::Db::templates();
|
|
||||||
tmp->setTemplates( tmplates );
|
|
||||||
#endif
|
#endif
|
||||||
setCentralWidget( tmp );
|
setCentralWidget( tmp );
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
@@ -645,7 +638,7 @@ namespace gLabels
|
|||||||
|
|
||||||
void MainWindow::fileNew()
|
void MainWindow::fileNew()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: file->New" << std::endl;
|
File::newLabel( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/* NewLabelDialog.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 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 "NewLabelDialog.h"
|
||||||
|
|
||||||
|
#include "libglabels/Db.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace gLabels
|
||||||
|
{
|
||||||
|
|
||||||
|
NewLabelDialog::NewLabelDialog( QWidget *parent = 0 )
|
||||||
|
{
|
||||||
|
setupUi( this );
|
||||||
|
|
||||||
|
QList<libglabels::Template*> tmplates = libglabels::Db::templates();
|
||||||
|
templatePicker->setTemplates( tmplates );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/* NewLabelDialog.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 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 glabels_NewLabelDialog_h
|
||||||
|
#define glabels_NewLabelDialog_h
|
||||||
|
|
||||||
|
#include "ui_NewLabelDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace gLabels
|
||||||
|
{
|
||||||
|
|
||||||
|
class NewLabelDialog : public QDialog, public Ui_NewLabelDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
NewLabelDialog( QWidget *parent );
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // glabels_NewLabelDialog_h
|
||||||
@@ -0,0 +1,279 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>NewLabelDialog</class>
|
||||||
|
<widget class="QDialog" name="NewLabelDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1036</width>
|
||||||
|
<height>735</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="searchEntry">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>146</width>
|
||||||
|
<height>87</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Page size</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QRadioButton" name="pageSizeIsoRadio">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>121</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>ISO sizes</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QRadioButton" name="pageSizeUsRadio">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>111</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>US sizes</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QRadioButton" name="pageSizeOtherRadio">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>60</y>
|
||||||
|
<width>111</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Other</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="gLabels::TemplatePicker" name="templatePicker"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>12</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="title">
|
||||||
|
<string>Preview</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QGraphicsView" name="previewGraphicsView">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>250</width>
|
||||||
|
<height>350</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Label Orientation</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="orientationNormalRadio">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Normal</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="orientationRotatedRadio">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Rotated</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="createButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Create</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<zorder>createButton</zorder>
|
||||||
|
<zorder>horizontalSpacer</zorder>
|
||||||
|
<zorder>orientationNormalRadio</zorder>
|
||||||
|
<zorder>orientationRotatedRadio</zorder>
|
||||||
|
<zorder>label</zorder>
|
||||||
|
<zorder></zorder>
|
||||||
|
<zorder>label</zorder>
|
||||||
|
<zorder>groupBox_2</zorder>
|
||||||
|
<zorder>groupBox_3</zorder>
|
||||||
|
<zorder>templatePicker</zorder>
|
||||||
|
<zorder>searchEntry</zorder>
|
||||||
|
<zorder>groupBox</zorder>
|
||||||
|
<zorder>horizontalSpacer</zorder>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>gLabels::TemplatePicker</class>
|
||||||
|
<extends>QListWidget</extends>
|
||||||
|
<header>../../app/TemplatePicker.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user