diff --git a/shop/directsaleform.cpp b/shop/directsaleform.cpp new file mode 100644 index 0000000..af3cfbf --- /dev/null +++ b/shop/directsaleform.cpp @@ -0,0 +1,14 @@ +#include "directsaleform.h" +#include "ui_directsaleform.h" + +DirectSaleForm::DirectSaleForm(QWidget *parent) : + QDialog(parent), + ui(new Ui::DirectSaleForm) +{ + ui->setupUi(this); +} + +DirectSaleForm::~DirectSaleForm() +{ + delete ui; +} diff --git a/shop/directsaleform.h b/shop/directsaleform.h new file mode 100644 index 0000000..ce7b5c3 --- /dev/null +++ b/shop/directsaleform.h @@ -0,0 +1,23 @@ +#ifndef DIRECTSALEFORM_H +#define DIRECTSALEFORM_H + +#include +#include + +namespace Ui { +class DirectSaleForm; +} + +class DirectSaleForm : public QDialog +{ + Q_OBJECT + +public: + explicit DirectSaleForm(QWidget *parent = 0); + ~DirectSaleForm(); + +private: + Ui::DirectSaleForm *ui; +}; + +#endif // DIRECTSALEFORM_H diff --git a/shop/directsaleform.ui b/shop/directsaleform.ui new file mode 100644 index 0000000..da465b0 --- /dev/null +++ b/shop/directsaleform.ui @@ -0,0 +1,58 @@ + + + DirectSaleForm + + + + 0 + 0 + 400 + 136 + + + + Form + + + + + + Commodity Name + + + + + + + + + + Price + + + + + + + + + + Count + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + diff --git a/shop/receiptloadform.cpp b/shop/receiptloadform.cpp new file mode 100644 index 0000000..c14a808 --- /dev/null +++ b/shop/receiptloadform.cpp @@ -0,0 +1,14 @@ +#include "receiptloadform.h" +#include "ui_receiptloadform.h" + +ReceiptLoadForm::ReceiptLoadForm(QWidget *parent) : + QDialog(parent), + ui(new Ui::ReceiptLoadForm) +{ + ui->setupUi(this); +} + +ReceiptLoadForm::~ReceiptLoadForm() +{ + delete ui; +} diff --git a/shop/receiptloadform.h b/shop/receiptloadform.h new file mode 100644 index 0000000..ee2b703 --- /dev/null +++ b/shop/receiptloadform.h @@ -0,0 +1,22 @@ +#ifndef RECEIPTLOADFORM_H +#define RECEIPTLOADFORM_H + +#include + +namespace Ui { +class ReceiptLoadForm; +} + +class ReceiptLoadForm : public QDialog +{ + Q_OBJECT + +public: + explicit ReceiptLoadForm(QWidget *parent = 0); + ~ReceiptLoadForm(); + +private: + Ui::ReceiptLoadForm *ui; +}; + +#endif // RECEIPTLOADFORM_H diff --git a/shop/receiptloadform.ui b/shop/receiptloadform.ui new file mode 100644 index 0000000..4a29e36 --- /dev/null +++ b/shop/receiptloadform.ui @@ -0,0 +1,98 @@ + + + ReceiptLoadForm + + + + 0 + 0 + 454 + 483 + + + + Dialog + + + + + + Receipts + + + + + + + + + + + + Search + + + + + + + + + + Items + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ReceiptLoadForm + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ReceiptLoadForm + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/shop/receiptsaveform.cpp b/shop/receiptsaveform.cpp new file mode 100644 index 0000000..c341f95 --- /dev/null +++ b/shop/receiptsaveform.cpp @@ -0,0 +1,14 @@ +#include "receiptsaveform.h" +#include "ui_receiptsaveform.h" + +ReceiptSaveForm::ReceiptSaveForm(QWidget *parent) : + QDialog(parent), + ui(new Ui::ReceiptSaveForm) +{ + ui->setupUi(this); +} + +ReceiptSaveForm::~ReceiptSaveForm() +{ + delete ui; +} diff --git a/shop/receiptsaveform.h b/shop/receiptsaveform.h new file mode 100644 index 0000000..f280d28 --- /dev/null +++ b/shop/receiptsaveform.h @@ -0,0 +1,22 @@ +#ifndef RECEIPTSAVEFORM_H +#define RECEIPTSAVEFORM_H + +#include + +namespace Ui { +class ReceiptSaveForm; +} + +class ReceiptSaveForm : public QDialog +{ + Q_OBJECT + +public: + explicit ReceiptSaveForm(QWidget *parent = 0); + ~ReceiptSaveForm(); + +private: + Ui::ReceiptSaveForm *ui; +}; + +#endif // RECEIPTSAVEFORM_H diff --git a/shop/receiptsaveform.ui b/shop/receiptsaveform.ui new file mode 100644 index 0000000..e408356 --- /dev/null +++ b/shop/receiptsaveform.ui @@ -0,0 +1,128 @@ + + + ReceiptSaveForm + + + + 0 + 0 + 419 + 545 + + + + Dialog + + + + + + Existing Receipts + + + + + + Search + + + + + + + + + + + + + + + + GroupBox + + + + + + Name + + + + + + + + + + Description + + + + + + + + + + Search Contacts + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ReceiptSaveForm + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ReceiptSaveForm + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/shop/shop.cpp b/shop/shop.cpp index e1d782c..76cf3df 100644 --- a/shop/shop.cpp +++ b/shop/shop.cpp @@ -1,5 +1,6 @@ #include "shop.h" #include +#include "shopform.h" Shop::Shop() @@ -8,7 +9,7 @@ Shop::Shop() void Shop::initServiceUi() { - + m_ui = new ShopForm(); } QIcon Shop::pluginIcon() diff --git a/shop/shop.pro b/shop/shop.pro index 976c591..bf932d5 100644 --- a/shop/shop.pro +++ b/shop/shop.pro @@ -13,11 +13,21 @@ DEFINES += SHOP_LIBRARY\ _GLIBCXX_USE_CXX11_ABI=1 SOURCES += shop.cpp \ - data/voucher.cpp + data/voucher.cpp \ + shopform.cpp \ + directsaleform.cpp \ + temporaryreceiptsaveform.cpp \ + receiptsaveform.cpp \ + receiptloadform.cpp HEADERS += shop.h\ shop_global.h \ - data/voucher.h + data/voucher.h \ + shopform.h \ + directsaleform.h \ + temporaryreceiptsaveform.h \ + receiptsaveform.h \ + receiptloadform.h unix { target.path = /usr/lib @@ -56,3 +66,10 @@ DEPENDPATH += $$PWD/../qdecimal/src RESOURCES += \ shoprc.qrc +FORMS += \ + shopform.ui \ + directsaleform.ui \ + temporaryreceiptsaveform.ui \ + receiptsaveform.ui \ + receiptloadform.ui + diff --git a/shop/shopform.cpp b/shop/shopform.cpp new file mode 100644 index 0000000..1deeae4 --- /dev/null +++ b/shop/shopform.cpp @@ -0,0 +1,42 @@ +#include "shopform.h" +#include "ui_shopform.h" +#include "directsaleform.h" +#include "temporaryreceiptsaveform.h" +#include "receiptsaveform.h" +#include "receiptloadform.h" + +ShopForm::ShopForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::ShopForm) +{ + ui->setupUi(this); +} + +ShopForm::~ShopForm() +{ + delete ui; +} + +void ShopForm::on_directSale_clicked() +{ + DirectSaleForm *form = new DirectSaleForm(this); + form->show(); +} + +void ShopForm::on_temporarySaveButton_clicked() +{ + TemporaryReceiptSaveForm *form = new TemporaryReceiptSaveForm(this); + form->show(); +} + +void ShopForm::on_saveButton_clicked() +{ + ReceiptSaveForm *form = new ReceiptSaveForm; + form->show(); +} + +void ShopForm::on_loadButton_clicked() +{ + ReceiptLoadForm *form = new ReceiptLoadForm; + form->show(); +} diff --git a/shop/shopform.h b/shop/shopform.h new file mode 100644 index 0000000..9e5ca23 --- /dev/null +++ b/shop/shopform.h @@ -0,0 +1,31 @@ +#ifndef SHOPFORM_H +#define SHOPFORM_H + +#include + +namespace Ui { +class ShopForm; +} + +class ShopForm : public QWidget +{ + Q_OBJECT + +public: + explicit ShopForm(QWidget *parent = 0); + ~ShopForm(); + +private slots: + void on_directSale_clicked(); + + void on_temporarySaveButton_clicked(); + + void on_saveButton_clicked(); + + void on_loadButton_clicked(); + +private: + Ui::ShopForm *ui; +}; + +#endif // SHOPFORM_H diff --git a/shop/shopform.ui b/shop/shopform.ui new file mode 100644 index 0000000..f02cb6d --- /dev/null +++ b/shop/shopform.ui @@ -0,0 +1,201 @@ + + + ShopForm + + + + 0 + 0 + 959 + 531 + + + + Form + + + + + + + + + Commodity + + + + + + + + + + + + + + + + Count + + + + + + + false + + + QAbstractSpinBox::UpDownArrows + + + false + + + + + + + Add Item + + + + + + + + + + + + + + + + + + + Direct Sale + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Receipt + + + + + + + + + + + + + + + + + 75 + true + + + + Total + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 75 + true + + + + 0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + Temporary Save + + + + + + + Save + + + + + + + Load + + + + + + + Pay + + + + + + + + + + + + + + diff --git a/shop/temporaryreceiptsaveform.cpp b/shop/temporaryreceiptsaveform.cpp new file mode 100644 index 0000000..73820ce --- /dev/null +++ b/shop/temporaryreceiptsaveform.cpp @@ -0,0 +1,14 @@ +#include "temporaryreceiptsaveform.h" +#include "ui_temporaryreceiptsaveform.h" + +TemporaryReceiptSaveForm::TemporaryReceiptSaveForm(QWidget *parent) : + QDialog(parent), + ui(new Ui::TemporaryReceiptSaveForm) +{ + ui->setupUi(this); +} + +TemporaryReceiptSaveForm::~TemporaryReceiptSaveForm() +{ + delete ui; +} diff --git a/shop/temporaryreceiptsaveform.h b/shop/temporaryreceiptsaveform.h new file mode 100644 index 0000000..072e265 --- /dev/null +++ b/shop/temporaryreceiptsaveform.h @@ -0,0 +1,22 @@ +#ifndef TEMPORARYRECEIPTSAVEFORM_H +#define TEMPORARYRECEIPTSAVEFORM_H + +#include + +namespace Ui { +class TemporaryReceiptSaveForm; +} + +class TemporaryReceiptSaveForm : public QDialog +{ + Q_OBJECT + +public: + explicit TemporaryReceiptSaveForm(QWidget *parent = 0); + ~TemporaryReceiptSaveForm(); + +private: + Ui::TemporaryReceiptSaveForm *ui; +}; + +#endif // TEMPORARYRECEIPTSAVEFORM_H diff --git a/shop/temporaryreceiptsaveform.ui b/shop/temporaryreceiptsaveform.ui new file mode 100644 index 0000000..c36555f --- /dev/null +++ b/shop/temporaryreceiptsaveform.ui @@ -0,0 +1,74 @@ + + + TemporaryReceiptSaveForm + + + + 0 + 0 + 400 + 74 + + + + Dialog + + + + + + Temporary Receipt Name + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + TemporaryReceiptSaveForm + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + TemporaryReceiptSaveForm + reject() + + + 316 + 260 + + + 286 + 274 + + + + +