From 123aefdab57c2bca9cf081865cf64151d9574213 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sat, 13 May 2017 21:57:11 +0200 Subject: [PATCH] Added wizard for camp records. --- camp/camp.pro | 9 +- camp/campgrid.cpp | 14 + camp/campgrid.h | 5 + camp/campwizard.cpp | 30 ++ camp/campwizard.h | 31 ++ camp/campwizard.ui | 721 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 807 insertions(+), 3 deletions(-) create mode 100644 camp/campwizard.cpp create mode 100644 camp/campwizard.h create mode 100644 camp/campwizard.ui diff --git a/camp/camp.pro b/camp/camp.pro index 8436342..4a09b07 100644 --- a/camp/camp.pro +++ b/camp/camp.pro @@ -31,7 +31,8 @@ SOURCES += camp.cpp \ data/sale.cpp \ settings/campsettingsform.cpp \ data/personprice.cpp \ - settings/campsettings.cpp + settings/campsettings.cpp \ + campwizard.cpp HEADERS += camp.h\ camp_global.h \ @@ -44,7 +45,8 @@ HEADERS += camp.h\ data/sale.h \ settings/campsettingsform.h \ data/personprice.h \ - settings/campsettings.h + settings/campsettings.h \ + campwizard.h include(../config_plugin.pri) @@ -87,4 +89,5 @@ RESOURCES += \ FORMS += \ campform.ui \ - settings/campsettingsform.ui + settings/campsettingsform.ui \ + campwizard.ui diff --git a/camp/campgrid.cpp b/camp/campgrid.cpp index 4c0c007..8560401 100644 --- a/camp/campgrid.cpp +++ b/camp/campgrid.cpp @@ -1,6 +1,20 @@ #include "campgrid.h" +#include "campwizard.h" CampGrid::CampGrid(QWidget *parent) : GridForm(parent) { setTableModel(new AutoTableModel); } + +void CampGrid::handleNewRecord() +{ + CampWizard *wizard = new CampWizard(); + wizard->setAttribute(Qt::WA_DeleteOnClose); + + wizard->show(); +} + +void CampGrid::handleEditRecord() +{ + +} diff --git a/camp/campgrid.h b/camp/campgrid.h index 409b2e5..ff36e96 100644 --- a/camp/campgrid.h +++ b/camp/campgrid.h @@ -9,6 +9,11 @@ class CampGrid : public GridForm { public: CampGrid(QWidget *parent = NULL); + + // IGridForm interface +protected: + void handleNewRecord(); + void handleEditRecord(); }; #endif // CAMPGRID_H diff --git a/camp/campwizard.cpp b/camp/campwizard.cpp new file mode 100644 index 0000000..f2cb170 --- /dev/null +++ b/camp/campwizard.cpp @@ -0,0 +1,30 @@ +#include "campwizard.h" +#include "ui_campwizard.h" + +CampWizard::CampWizard(QWidget *parent) : + QWizard(parent), + ui(new Ui::CampWizard) +{ + ui->setupUi(this); + + m_dataBinder = new ObjectBinder(this); + m_dataBinder->registerBinding(ui->start); + m_dataBinder->registerBinding(ui->end); +} + +CampWizard::~CampWizard() +{ + delete ui; +} + +void CampWizard::setData(const CampDataPtr &data) +{ + m_data = data; + + m_dataBinder->setData(data.data()); +} + +void CampWizard::on_btnAdd_clicked() +{ + +} diff --git a/camp/campwizard.h b/camp/campwizard.h new file mode 100644 index 0000000..bd0583d --- /dev/null +++ b/camp/campwizard.h @@ -0,0 +1,31 @@ +#ifndef CAMPWIZARD_H +#define CAMPWIZARD_H + +#include +#include "data/camp-data.h" +#include + +namespace Ui { +class CampWizard; +} + +class CampWizard : public QWizard +{ + Q_OBJECT + +public: + explicit CampWizard(QWidget *parent = 0); + ~CampWizard(); + + void setData(const CampDataPtr &data); + +private slots: + void on_btnAdd_clicked(); + +private: + Ui::CampWizard *ui; + CampDataPtr m_data; + ObjectBinder *m_dataBinder; +}; + +#endif // CAMPWIZARD_H diff --git a/camp/campwizard.ui b/camp/campwizard.ui new file mode 100644 index 0000000..901aded --- /dev/null +++ b/camp/campwizard.ui @@ -0,0 +1,721 @@ + + + CampWizard + + + Qt::ApplicationModal + + + + 0 + 0 + 948 + 684 + + + + Camp record + + + + :/icons/campPlugin.svg:/icons/campPlugin.svg + + + QWizard::ClassicStyle + + + + + + + + 0 + + + + + From + + + + + + + d. M. yyyy + + + true + + + + + + + To + + + + + + + d. M. yyyy + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + People + + + + + + + + + Existing address + + + + + + + Add + + + + :/icons/new.svg:/icons/new.svg + + + + + + + + 0 + 0 + + + + + 450 + 0 + + + + New address + + + true + + + false + + + + + + Title + + + + + + + + + + First name + + + + + + + + + + Last name + + + + + + + + + + Date of birth + + + + + + + d. MM. yyyy + + + true + + + + + + + ID card + + + + + + + + + + ZTP + + + + + + + Street + + + + + + + + + + House number + + + + + + + + + + ZIP code + + + + + + + + + + City + + + + + + + + + + Country + + + + + + + true + + + + + + + + + + + 0 + 0 + + + + true + + + + + + + + + + + 150 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + Remove + + + ... + + + + :/icons/remove.svg:/icons/remove.svg + + + + 24 + 24 + + + + true + + + + + + + false + + + Owner + + + ... + + + + :/icons/ok.svg:/icons/ok.svg + + + + 24 + 24 + + + + true + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + widget_9 + tableView + tablePeople + + + + + + + + + + + + + Services + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + ... + + + + + + + ... + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + Sale + + + + + + Apply sale + + + + + + + + + + + + + + + + + Summary + + + + + + + 0 + + + 0 + + + 0 + + + + + From: + + + + + + + TextLabel + + + + + + + To: + + + + + + + TextLabel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + Days: + + + + + + + TextLabel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + People: + + + + + + + + + + Services: + + + + + + + + + + + + + Sale: + + + + + + + TextLabel + + + + + + + + 75 + true + + + + Total: + + + + + + + + 75 + true + + + + TextLabel + + + + + + + + + + + + + Print + + + + :/icons/print.svg:/icons/print.svg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + start + end + address + groupNew + title + firstName + lastName + birthDate + idCardNumber + ztp + addressStreet + addressHouseNumber + addressZipCode + addressCity + country + btnAdd + btnRemove + btnOwner + tablePeople + toolButton + toolButton_2 + tableView_3 + tableView_4 + tableView_5 + pushButton_2 + checkBox_2 + sale + tableView_2 + + + + + + +