You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.9 KiB
C++

#ifndef SHOPFORM_H
#define SHOPFORM_H
#include <QWidget>
#include <QList>
#include <QScopedPointer>
#include <QMenu>
#include "data/shop-data.h"
#include <autotablemodel.h>
#include "settings/shopsettings.h"
class ShopItem;
class IShopItem;
namespace Ui {
class ShopForm;
}
class ShopForm : public QWidget
{
Q_OBJECT
public:
explicit ShopForm(QWidget *parent = 0);
~ShopForm();
void setEetStatusText(const QString &statusText);
void setupForm();
private slots:
void on_directSale_clicked();
void on_temporarySaveButton_clicked();
void on_saveButton_clicked();
void on_loadButton_clicked();
void onCountChanged(int oldCount = 0);
void on_receiptCombo_currentIndexChanged(int index);
void on_payButton_clicked();
void on_btnFav_clicked();
void on_showPaidButton_clicked();
void on_btnAddItem_clicked();
void on_commoditySearch_textChanged(const QString &text);
void on_lblEetState_linkActivated(const QString &link);
void on_commoditySearch_returnPressed();
void on_actionDelete_items_triggered();
void on_actualReceipt_customContextMenuRequested(const QPoint &pos);
private:
Ui::ShopForm *ui;
QSharedPointer<Voucher> m_voucher;
AutoTableModel<VoucherItem> *m_itemsModel;
AutoTableModel<IShopItem> *m_commodityModel;
bool m_itemFound;
QScopedPointer<QMenu> m_itemCtxMenu;
void loadLast();
void loadButtons(const ShopSettingsPtr& settings);
void loadFavCatButtons(const QString& category);
void loadCatButtons();
void clearFavButtons();
void fillReceiptCombo();
void createVoucher();
void doTempSave(bool comboChanged);
void changeReceipt();
void connectItemSignals();
void createEmptyVoucher();
void addItem(const QSharedPointer<IShopItem>& item, int count);
void setTotalText();
void recalculate();
void updateItemCount(VoucherItem *item, int oldCount);
};
#endif // SHOPFORM_H