-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
196 lines (141 loc) · 5.01 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QList>
#include <QAction>
#include <QDebug>
#include <QFileInfo>
#include <QSignalMapper>
#include <QCloseEvent>
#include <QSqlRelationalTableModel>
#include <QSqlQueryModel>
#include <QSqlRecord>
#include <QDesktopServices>
#include "advqsortfilterproxymodel.h"
#include "advqsortfilterproxymodelcustomer.h"
#include <myintdelegate.h>
#include <myfloatdelegate.h>
#include <mycurrencycombodelegate.h>
#include <myemaillineeditdelegate.h>
#include <myphonelineeditdelegate.h>
#include <myimagedelegate.h>
#include <mynoeditdelegate.h>
#include "cartwidget.h"
#include "dialogshowcarts.h"
#include "dialogoptions.h"
#include "dialogshowproduct.h"
#include "dialogshowcustomer.h"
#include "QTranslator"
#include "osdb.h"
#include "updatecheck.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_actionNew_Database_triggered();
void on_actionOpen_Database_triggered();
void on_actionClose_Database_triggered();
void on_actionQuit_triggered();
void on_open_RecentFile(QString fileName);
void on_open_Cart(QString customerid);
void on_reopen_Cart(QString cartname);
void on_changed_CartName(QString newcartname);
void on_show_Carts(QString customerid);
void on_add_Cart(QString productid);
void on_show_Product(QString productid);
void on_show_Customer(QString customerid);
void on_loaded_Database();
void on_open_MailClient(QString mailaddress);
void on_actionSave_Database_triggered();
void on_actionRevert_Changes_triggered();
void on_actionNew_Entry_Pricelist_triggered();
void on_actionFill_with_Example_Data_triggered();
void on_tableViewCustomer_clicked(const QModelIndex &index);
void on_tableViewCustomer_customContextMenuRequested(const QPoint &pos);
void on_actionDelete_Entry_triggered();
void on_tabWidget_tabCloseRequested(int index);
void on_tableViewPricelist_customContextMenuRequested(const QPoint &pos);
void on_actionExportODF_triggered();
void on_actionOptions_triggered();
void on_lang_Changed(QString lang);
void on_actionAdd_to_Cart_triggered();
void on_actionRemove_From_Cart_triggered();
void on_actionShow_Carts_triggered();
void on_tabWidget_currentChanged(int index);
void on_actionNew_Cart_triggered();
void on_tableViewPricelist_doubleClicked(const QModelIndex &index);
void on_tableViewPricelist_clicked(const QModelIndex &index);
void on_updateNotify(const QString &latestVersion);
private:
Ui::MainWindow *ui;
osDb *osDatabase;
int maxRecentFiles;
int defaultStatusTimeout;
QTranslator translator;
QList<QAction*> recentFileActions;
QSqlRelationalTableModel *modelPricelist;
QSqlRelationalTableModel *modelCustomer;
QSqlRelationalTableModel *modelCart;
MyImageDelegate *imgDelegateProductImage;
MyIntDelegate *iDelegateProductId;
MyFloatDelegate *fDelegateArticleLength;
MyFloatDelegate *fDelegateArticleDepth;
MyFloatDelegate *fDelegateArticleWidth;
MyFloatDelegate *fDelegateArticleHeight;
MyFloatDelegate *fDelegateArticleWeight;
MyFloatDelegate *fDelegateArticleDiameter;
MyIntDelegate *iDelegatePackingUnit;
MyIntDelegate *iDelegateMinSellUnits;
MyFloatDelegate *fDelegatePriceUnit;
MyFloatDelegate *fDelegatePricePackage;
MyNoEditDelegate *noedDelegate;
MyCurrencyComboDelegate *cbxMyCurrencyComboDelegate;
MyEmailLineEditDelegate *emlMyEmailDelegate;
MyPhoneLineEditDelegate *phoMyPhoneDelegate;
const int tab_index_pricelist = 0;
const int tab_index_customer = 1;
const int tab_index_cart = 2;
MyIntDelegate *iDelegateCustomerId;
AdvQSortFilterProxyModel *proxymodelPricelist;
AdvQSortFilterProxyModelCustomer *proxymodelCustomer;
QAction *open_mailclient;
QMenu *emailAddressContextMenu;
QSignalMapper *signalMapperEmailAddress;
QAction *new_cart;
QAction *show_carts;
QMenu *cartContextMenu;
QSignalMapper *signalMapperCart;
QSignalMapper *signalMapperShowCart;
DialogShowCarts *diaShowCarts;
DialogOptions *diaOptions;
DialogShowproduct *diaShowproduct;
DialogShowcustomer *diaShowcustomer;
QAction *add_to_cart;
QAction *show_product;
QAction *show_customer;
QMenu *pricelistContextMenu;
QSignalMapper *signalMapperPricelist;
QSignalMapper *signalMapperShowProduct;
QSignalMapper *signalMapperShowCustomer;
CartWidget *cart_widget;
QHash<QString,QString> currentCartInfos;
void toggleInputEnabled(bool toggle);
void fillRecentFileHistory();
void submit(QSqlRelationalTableModel *model);
bool closeDatabase();
void closeEvent(QCloseEvent *); // Overriding the window's close event
updateCheck *uc;
QString currArch;
signals:
void databaseLoaded();
void retranslateSubDialogs();
};
#endif // MAINWINDOW_H