-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialog.h
174 lines (145 loc) · 3.7 KB
/
dialog.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
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include<QDebug>
#include "Inventory.h"
#include "translator.h"
#include "imenubar.h"
#include "ipreferencespanel.h"
#include "MultiSellElement.h"
#include "MultiSellController.h"
#include "MultiBuyElement.h"
#include "ui_dialog.h"
#include "IConst.h"
#include "abbreviation.h"
#include <qlistwidget.h>
#include <QtCore>
#include <QtGui>
#include <QMessageBox>
#include <QInputDialog>
#include <QListWidgetItem>
#include <QPrintPreviewWidget>
#include <QtWidgets>
#include <ctime>
#include <QPrinter>
#include <QPrintDialog>
#include <QPainter>
#include <QPrintPreviewDialog>
#include <QCheckBox>
#include <fstream>
#include <stdlib.h>
#include <QCloseEvent>
#include <QFontMetrics>
#include <QAbstractItemDelegate>
#include <QContextMenuEvent>
#include <QSplitter>
#include <QListWidgetItem>
#include <iostream>
#include <QPrinter>
#include <sstream>
#include "utils.h"
QT_BEGIN_NAMESPACE
class QAction;
class QDialogButtonBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QMenu;
class QMenuBar;
class QPushButton;
class QTextEdit;
class QComboBox;
QT_END_NAMESPACE
namespace Ui {
class Dialog;
}
class Dialog : public QDialog
{
Q_OBJECT
public:
explicit Dialog(QWidget *parent = nullptr);
~Dialog();
void newFile();
void loadFile();
void save();
void saveAs();
void changeToEnglish();
void changeToChinese();
void changeToDarkMode();
void changeToLightMode();
void showPreferences();
void addVegetable();
void addCompany();
void addPerson();
void addUnit();
void removeCompany();
void removePerson();
void removeVegetable();
void removeUnit();
void printInventory();
void printHistory();
void printTransactions();
void writeInt(int temp, fstream* fio);
void writeString(string temp, fstream* fio);
int readInt(fstream* fio);
string readString(fstream* fio);
void changeLanguage();
Ui::Dialog *ui;
int needSave;
QFont font;
QPalette lightPalette;
QPalette darkPalette;
//QString lightStyleSheet;
//QString darkStyleSheet;
QString lightStyle;
QStyle* darkStyle;
public slots:
void on_Buy_clicked();
void on_Sell_clicked();
void printI(QPrinter* printer);
void printH(QPrinter* printer);
void printT(QPrinter* printer);
void deleteHistory();
void editHistory();
void undoHistory();
void deleteVege();
void on_Memo_2_textChanged();
static int compareCompany(History a, History b);
static int compareCustomer(History a, History b);
void on_Return_clicked();
void closeEvent(QCloseEvent *event);
void askSave();
void on_vegeList_itemClicked(QListWidgetItem *item);
void ListWidgetEditEnd(QWidget *editor, QAbstractItemDelegate::EndEditHint hint);
void slot1();
private slots:
void on_clearHistoryButton_clicked();
void on_dumpButton_clicked();
void on_clearReturnButton_clicked();
void dumpVege();
void on_vegeList_currentRowChanged(int currentRow);
void on_CalculateSold_clicked();
void on_searchButton_clicked();
private:
Inventory* inventory;
IPreferencesPanel *mPreferencesPanel;
Vegetable *currentVege;
int refresh;
QAction* deleteVegeAction;
QAction* undoHistoryAction;
QAction* deleteHistoryAction;
QAction* editHistoryAction;
QAction* dumpVegeAction;
Translator* mTranslator;
Abbreviation* mAbbreviator;
IMenuBar *menuBar;
Utils* utils;
int queryVeges();
struct myclass {
bool operator() (pair<int,int> i, pair<int,int> j) {
return (i.first>j.first);
}
} myobject;
void showSearchResults(string date, string company, string customer);
};
#endif // DIALOG_H