From 7f3adc818ba541ea6f4de0429c612efa2e7cc366 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Mon, 11 Nov 2013 23:48:45 -0500 Subject: [PATCH] Initial non-functioning implementation of NewLabelDialog. --- app/CMakeLists.txt | 11 +- app/File.cpp | 41 ++++++ app/File.h | 38 ++++++ app/MainWindow.cpp | 13 +- app/NewLabelDialog.cpp | 37 ++++++ app/NewLabelDialog.h | 44 ++++++ app/ui/NewLabelDialog.ui | 279 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 452 insertions(+), 11 deletions(-) create mode 100644 app/File.cpp create mode 100644 app/File.h create mode 100644 app/NewLabelDialog.cpp create mode 100644 app/NewLabelDialog.h create mode 100644 app/ui/NewLabelDialog.ui diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index a8464c3..59970a7 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -6,6 +6,7 @@ set (glabels_sources glabels_main.cpp BarcodeStyle.cpp ColorNode.cpp + File.cpp Help.cpp LabelModel.cpp LabelModelItem.cpp @@ -15,6 +16,7 @@ set (glabels_sources MergeRecord.cpp TemplatePicker.cpp TextNode.cpp + NewLabelDialog.cpp ) set (glabels_qobject_headers @@ -22,6 +24,11 @@ set (glabels_qobject_headers LabelModelItem.h MainWindow.h TemplatePicker.h + NewLabelDialog.h +) + +set (glabels_forms + ui/NewLabelDialog.ui ) set (glabels_resource_files @@ -30,12 +37,14 @@ set (glabels_resource_files ) 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}) include (${QT_USE_FILE}) include_directories ( + ${CMAKE_CURRENT_BINARY_DIR} ${glabels_qt_SOURCE_DIR} ) @@ -43,7 +52,7 @@ link_directories ( ${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 libglabels diff --git a/app/File.cpp b/app/File.cpp new file mode 100644 index 0000000..a7e2278 --- /dev/null +++ b/app/File.cpp @@ -0,0 +1,41 @@ +/* File.cpp + * + * Copyright (C) 2013 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 "File.h" + +#include "NewLabelDialog.h" + + +namespace gLabels +{ + + namespace File + { + + void newLabel( QWidget *parent ) + { + NewLabelDialog newDialog( parent ); + newDialog.exec(); + } + + } + +} + diff --git a/app/File.h b/app/File.h new file mode 100644 index 0000000..723034c --- /dev/null +++ b/app/File.h @@ -0,0 +1,38 @@ +/* File.h + * + * Copyright (C) 2013 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_File_h +#define glabels_File_h + + +#include + + +namespace gLabels +{ + + namespace File + { + void newLabel( QWidget *parent ); + } + +} + +#endif // glabels_File_h diff --git a/app/MainWindow.cpp b/app/MainWindow.cpp index 640c9dd..2e1a46b 100644 --- a/app/MainWindow.cpp +++ b/app/MainWindow.cpp @@ -27,11 +27,8 @@ #include #include "Icons.h" +#include "File.h" #include "Help.h" -///// TEMPORARY TESTING ///// -#include "TemplatePicker.h" -#include "libglabels/Db.h" -///////////////////////////// namespace gLabels { @@ -39,12 +36,8 @@ namespace gLabels MainWindow::MainWindow() { /////////////// TEMPORARY TESTING /////////////// -#if 0 +#if 1 QLabel *tmp = new QLabel( "Coming Soon..." ); -#else - TemplatePicker *tmp = new TemplatePicker(); - QList tmplates = libglabels::Db::templates(); - tmp->setTemplates( tmplates ); #endif setCentralWidget( tmp ); ///////////////////////////////////////////////// @@ -645,7 +638,7 @@ namespace gLabels void MainWindow::fileNew() { - std::cout << "ACTION: file->New" << std::endl; + File::newLabel( this ); } diff --git a/app/NewLabelDialog.cpp b/app/NewLabelDialog.cpp new file mode 100644 index 0000000..e31f49b --- /dev/null +++ b/app/NewLabelDialog.cpp @@ -0,0 +1,37 @@ +/* NewLabelDialog.cpp + * + * Copyright (C) 2013 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 "libglabels/Db.h" + + +namespace gLabels +{ + + NewLabelDialog::NewLabelDialog( QWidget *parent = 0 ) + { + setupUi( this ); + + QList tmplates = libglabels::Db::templates(); + templatePicker->setTemplates( tmplates ); + } + +} diff --git a/app/NewLabelDialog.h b/app/NewLabelDialog.h new file mode 100644 index 0000000..d4e59bc --- /dev/null +++ b/app/NewLabelDialog.h @@ -0,0 +1,44 @@ +/* NewLabelDialog.h + * + * Copyright (C) 2013 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_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 diff --git a/app/ui/NewLabelDialog.ui b/app/ui/NewLabelDialog.ui new file mode 100644 index 0000000..604af05 --- /dev/null +++ b/app/ui/NewLabelDialog.ui @@ -0,0 +1,279 @@ + + + NewLabelDialog + + + + 0 + 0 + 1036 + 735 + + + + Dialog + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 146 + 87 + + + + + 9 + + + + false + + + Page size + + + false + + + false + + + + + 10 + 20 + 121 + 21 + + + + + 50 + false + + + + ISO sizes + + + + + + 10 + 40 + 111 + 21 + + + + + 50 + false + + + + US sizes + + + + + + 10 + 60 + 111 + 21 + + + + + 50 + false + + + + Other + + + + + + + + + + + + + 12 + + + + + Preview + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + 0 + 0 + + + + + 250 + 350 + + + + Qt::AlignCenter + + + + + + + + + + + 0 + 0 + + + + Label Orientation + + + + 9 + + + + + + + + 0 + 0 + + + + Normal + + + + + + + + 0 + 0 + + + + Rotated + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Create + + + + + + + + + createButton + horizontalSpacer + orientationNormalRadio + orientationRotatedRadio + label + + label + groupBox_2 + groupBox_3 + templatePicker + searchEntry + groupBox + horizontalSpacer + + + + gLabels::TemplatePicker + QListWidget +
../../app/TemplatePicker.h
+
+
+ + +