annotate main.h @ 47:08c0d5116e82

More work.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 06 Apr 2017 16:03:13 +0300
parents 372c1be58996
children b86eb06070ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 //
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 // Syntilista - velkalistasovellus Kampus-kahvilaan
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 // Programmed and designed by Matti Hämäläinen <ccr@tnsp.org>
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 // (C) Copyright 2017 Tecnic Software productions (TNSP)
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 //
41
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
6 #ifndef SYNTILISTA_H
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
7 #define SYNTILISTA_H
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #include <QMainWindow>
17
d40345d63733 Implement some keyboard shortcuts.
Matti Hamalainen <ccr@tnsp.org>
parents: 15
diff changeset
10 #include <QShortcut>
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #include <QDialog>
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 #include <QtSql>
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 #include <QSqlQueryModel>
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 //
41
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
17 // Global application defines
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 //
41
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
19 #define APP_VENDOR "TNSP" // Vendor ID (for settings, etc.)
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
20 #define APP_ID "Kampus Syntilista" // Application ID (for settings)
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
21 #define APP_NAME "Café Kampus Syntilista" // Application title/name
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
22 #define APP_VERSION "0.2" // Version string
42
60ffa45b4014 Use #define APP_SQLITE_FILE for the application Sqlite3 database filename.
Matti Hamalainen <ccr@tnsp.org>
parents: 41
diff changeset
23 #define APP_SQLITE_FILE "syntilista.sqlite3" // SQLite3 database file name (without path)
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 //
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 // Custom SQL models
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 //
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 class PersonInfo : public QObject
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 {
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 Q_OBJECT
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 public:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 explicit PersonInfo()
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 {
5
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
36 id = -1;
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
37 firstName = "";
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
38 lastName = "";
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
39 extraInfo = "";
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
40 balance = 0;
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 }
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 ~PersonInfo()
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 {
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 }
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
5
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
47 void dump();
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
48
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 qint64 id;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 QString firstName, lastName, extraInfo;
5
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
51 double balance;
4
f2404a9987dc Cleaning up the code.
Matti Hamalainen <ccr@tnsp.org>
parents: 2
diff changeset
52 QDateTime added, updated;
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 };
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 class PersonSQLModel : public QSqlQueryModel
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 {
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 Q_OBJECT
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 private:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 public:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 PersonSQLModel(QObject *parent = 0);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67
13
ca5ce74c0563 Refactoring.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
68 int updatePerson(const PersonInfo &person);
ca5ce74c0563 Refactoring.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
69 int addPerson(const PersonInfo &person);
ca5ce74c0563 Refactoring.
Matti Hamalainen <ccr@tnsp.org>
parents: 12
diff changeset
70 int deletePerson(qint64 id);
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 void updateModel();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 };
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 class TransactionSQLModel : public QSqlQueryModel
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 {
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 Q_OBJECT
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 private:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 public:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 TransactionSQLModel(QObject *parent = 0);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 QVariant data(const QModelIndex &item, int role) const Q_DECL_OVERRIDE;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 void updateModel();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 };
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 //
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 // Main window
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 //
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 namespace Ui {
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 class SyntilistaMainWindow;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 class EditPerson;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 }
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 class SyntilistaMainWindow : public QMainWindow
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 {
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 Q_OBJECT
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 public:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 explicit SyntilistaMainWindow(QWidget *parent = 0);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 ~SyntilistaMainWindow();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 void statusMsg(const QString &msg);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 void readSettings();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 void saveSettings();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 void setActivePerson(qint64 id);
4
f2404a9987dc Cleaning up the code.
Matti Hamalainen <ccr@tnsp.org>
parents: 2
diff changeset
113 int addTransaction(qint64 id, double value, PersonInfo &info);
f2404a9987dc Cleaning up the code.
Matti Hamalainen <ccr@tnsp.org>
parents: 2
diff changeset
114 int addTransactionGUI(qint64 id, bool debt, double value);
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 void updatePersonList();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 PersonSQLModel *model_People;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 private slots:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 void on_button_AddPerson_clicked();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 void on_button_EditPerson_clicked();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 void on_button_ClearFilter_clicked();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 void on_button_Quit_clicked();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127
47
08c0d5116e82 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 46
diff changeset
128 void on_button_LogoImage_clicked();
08c0d5116e82 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 46
diff changeset
129
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 void on_button_AddDebt_clicked();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131
2
edc1e8cf6e2c Implement "pay debt in full" button.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
132 void on_button_PayDebt_clicked();
edc1e8cf6e2c Implement "pay debt in full" button.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
133
edc1e8cf6e2c Implement "pay debt in full" button.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
134 void on_button_PayFullDebt_clicked();
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 void on_edit_PersonFilter_textChanged(const QString &arg1);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 void on_tableview_People_doubleClicked(const QModelIndex &index);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 void selectedPersonChanged(const QModelIndex &, const QModelIndex &);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141
46
372c1be58996 Improve shortcuts functionality a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 42
diff changeset
142 void changeUIZoomIn();
372c1be58996 Improve shortcuts functionality a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 42
diff changeset
143 void changeUIZoomOut();
372c1be58996 Improve shortcuts functionality a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 42
diff changeset
144 void changeUIZoomReset();
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 void updateSortOrder(int index, Qt::SortOrder order);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147
6
0315a3b9f560 Implement person and transaction history deletion.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
148 void on_button_DeletePerson_clicked();
0315a3b9f560 Implement person and transaction history deletion.
Matti Hamalainen <ccr@tnsp.org>
parents: 5
diff changeset
149
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150 private:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 Ui::SyntilistaMainWindow *ui;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 TransactionSQLModel *model_Latest;
5
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
154 PersonInfo currPerson;
2
edc1e8cf6e2c Implement "pay debt in full" button.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
155
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 int peopleSortIndex;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 Qt::SortOrder peopleSortOrder;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 QString peopleFilter;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 };
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161
41
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
162 //
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
163 // Person edit / new person dialog
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
164 //
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 class EditPerson : public QDialog
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 {
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 Q_OBJECT
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 public:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 explicit EditPerson(QWidget *parent = 0);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 ~EditPerson();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
173 void statusMsg(const QString &msg);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 void clearForm();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 bool validateForm();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 void setPerson(qint64 id);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 private slots:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
180 void on_button_OK_clicked();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182 void on_button_Cancel_clicked();
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184 void on_edit_FirstName_textChanged(const QString &arg1);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186 void on_edit_LastName_textChanged(const QString &arg1);
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188 private:
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 Ui::EditPerson *ui;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190
5
a5a3baee3043 More cleanups and fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
191 PersonInfo selPerson;
0
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 TransactionSQLModel *model_Transactions;
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193 };
fec4d0c461f2 Initial import of the post-prototyping phase code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194
41
c953ee761af0 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
195 #endif // SYNTILISTA_H