Added wizard for camp records.

master
Josef Rokos 8 years ago
parent cd4d58749a
commit 123aefdab5

@ -31,7 +31,8 @@ SOURCES += camp.cpp \
data/sale.cpp \ data/sale.cpp \
settings/campsettingsform.cpp \ settings/campsettingsform.cpp \
data/personprice.cpp \ data/personprice.cpp \
settings/campsettings.cpp settings/campsettings.cpp \
campwizard.cpp
HEADERS += camp.h\ HEADERS += camp.h\
camp_global.h \ camp_global.h \
@ -44,7 +45,8 @@ HEADERS += camp.h\
data/sale.h \ data/sale.h \
settings/campsettingsform.h \ settings/campsettingsform.h \
data/personprice.h \ data/personprice.h \
settings/campsettings.h settings/campsettings.h \
campwizard.h
include(../config_plugin.pri) include(../config_plugin.pri)
@ -87,4 +89,5 @@ RESOURCES += \
FORMS += \ FORMS += \
campform.ui \ campform.ui \
settings/campsettingsform.ui settings/campsettingsform.ui \
campwizard.ui

@ -1,6 +1,20 @@
#include "campgrid.h" #include "campgrid.h"
#include "campwizard.h"
CampGrid::CampGrid(QWidget *parent) : GridForm<CampData>(parent) CampGrid::CampGrid(QWidget *parent) : GridForm<CampData>(parent)
{ {
setTableModel(new AutoTableModel<CampData>); setTableModel(new AutoTableModel<CampData>);
} }
void CampGrid::handleNewRecord()
{
CampWizard *wizard = new CampWizard();
wizard->setAttribute(Qt::WA_DeleteOnClose);
wizard->show();
}
void CampGrid::handleEditRecord()
{
}

@ -9,6 +9,11 @@ class CampGrid : public GridForm<CampData>
{ {
public: public:
CampGrid(QWidget *parent = NULL); CampGrid(QWidget *parent = NULL);
// IGridForm interface
protected:
void handleNewRecord();
void handleEditRecord();
}; };
#endif // CAMPGRID_H #endif // CAMPGRID_H

@ -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()
{
}

@ -0,0 +1,31 @@
#ifndef CAMPWIZARD_H
#define CAMPWIZARD_H
#include <QWizard>
#include "data/camp-data.h"
#include <objectbinder.h>
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

@ -0,0 +1,721 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CampWizard</class>
<widget class="QWizard" name="CampWizard">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>948</width>
<height>684</height>
</rect>
</property>
<property name="windowTitle">
<string>Camp record</string>
</property>
<property name="windowIcon">
<iconset resource="camprc.qrc">
<normaloff>:/icons/campPlugin.svg</normaloff>:/icons/campPlugin.svg</iconset>
</property>
<property name="wizardStyle">
<enum>QWizard::ClassicStyle</enum>
</property>
<widget class="QWizardPage" name="peoplePage">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>From</string>
</property>
</widget>
</item>
<item>
<widget class="QDateEdit" name="start">
<property name="displayFormat">
<string>d. M. yyyy</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>To</string>
</property>
</widget>
</item>
<item>
<widget class="QDateEdit" name="end">
<property name="displayFormat">
<string>d. M. yyyy</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item>
<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>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>People</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Existing address</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="btnAdd">
<property name="text">
<string>Add</string>
</property>
<property name="icon">
<iconset resource="../core/rc.qrc">
<normaloff>:/icons/new.svg</normaloff>:/icons/new.svg</iconset>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QGroupBox" name="groupNew">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>New address</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="title"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>First name</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="firstName"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Last name</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lastName"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Date of birth</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDateEdit" name="birthDate">
<property name="displayFormat">
<string>d. MM. yyyy</string>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>ID card</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="idCardNumber"/>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="ztp">
<property name="text">
<string>ZTP</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Street</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="addressStreet"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>House number</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="addressHouseNumber"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>ZIP code</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="addressZipCode"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>City</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="addressCity"/>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Country</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QComboBox" name="country">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QComboBox" name="address">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_8" native="true">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget_9" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<spacer name="horizontalSpacer_6">
<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="QToolButton" name="btnRemove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Remove</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../core/rc.qrc">
<normaloff>:/icons/remove.svg</normaloff>:/icons/remove.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnOwner">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Owner</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../core/rc.qrc">
<normaloff>:/icons/ok.svg</normaloff>:/icons/ok.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTableView" name="tablePeople"/>
</item>
</layout>
<zorder>widget_9</zorder>
<zorder>tableView</zorder>
<zorder>tablePeople</zorder>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="servicePage">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Services</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QTableView" name="tableView_2"/>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<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>
<item>
<widget class="QToolButton" name="toolButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<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>
</widget>
</item>
<item>
<widget class="QTableView" name="tableView_3"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Sale</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string>Apply sale</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QComboBox" name="sale"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="finishPage">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Summary</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_16">
<property name="text">
<string>From:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_18">
<property name="text">
<string>To:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_19">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_20">
<property name="text">
<string>Days:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_21">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_14">
<property name="text">
<string>People:</string>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="tableView_4"/>
</item>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Services:</string>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="tableView_5"/>
</item>
<item>
<widget class="QWidget" name="widget_6" native="true">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Sale:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_24">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Total:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_25">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_7" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>Print</string>
</property>
<property name="icon">
<iconset resource="../core/rc.qrc">
<normaloff>:/icons/print.svg</normaloff>:/icons/print.svg</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
<tabstops>
<tabstop>start</tabstop>
<tabstop>end</tabstop>
<tabstop>address</tabstop>
<tabstop>groupNew</tabstop>
<tabstop>title</tabstop>
<tabstop>firstName</tabstop>
<tabstop>lastName</tabstop>
<tabstop>birthDate</tabstop>
<tabstop>idCardNumber</tabstop>
<tabstop>ztp</tabstop>
<tabstop>addressStreet</tabstop>
<tabstop>addressHouseNumber</tabstop>
<tabstop>addressZipCode</tabstop>
<tabstop>addressCity</tabstop>
<tabstop>country</tabstop>
<tabstop>btnAdd</tabstop>
<tabstop>btnRemove</tabstop>
<tabstop>btnOwner</tabstop>
<tabstop>tablePeople</tabstop>
<tabstop>toolButton</tabstop>
<tabstop>toolButton_2</tabstop>
<tabstop>tableView_3</tabstop>
<tabstop>tableView_4</tabstop>
<tabstop>tableView_5</tabstop>
<tabstop>pushButton_2</tabstop>
<tabstop>checkBox_2</tabstop>
<tabstop>sale</tabstop>
<tabstop>tableView_2</tabstop>
</tabstops>
<resources>
<include location="../core/rc.qrc"/>
<include location="camprc.qrc"/>
</resources>
<connections/>
</ui>
Loading…
Cancel
Save