-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathClientPage.h
130 lines (98 loc) · 2.55 KB
/
ClientPage.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
#ifndef CLIENTPAGE_H
#define CLIENTPAGE_H
#include <QWidget>
#include <QVector>
#include "qtimemage.h"
class ProjectTreeWidget;
class QTreeWidgetItem;
class QGroupBox;
class Client;
class Project;
class ProjectPage;
class QMenu;
class QAction;
class QLabel;
class QSplitter;
class QShowEvent;
class QTimer;
class ClientReport;
/* Show the working UI for a single client */
class ClientPage : public QWidget {
Q_OBJECT
public:
ClientPage(QWidget *parent=0);
~ClientPage();
void setClient(int64_t client_id, int64_t currentProject_id);
int64_t client_id() const {return _client.id;}
int64_t currentProject_id();
signals:
void sig_doubleClickedProject(int64_t prj_id);
void sig_projectSelected(int64_t client_id, int64_t project_id);
public slots:
void showProject(int64_t prj_id);
void setBillingProject(int64_t prj_id);
private slots:
void refreshTimes();
void setCurrentItem();
void populate_projects();
void storeSettings();
void createProject();
void createSubproject();
void editProject();
void deleteProject();
void projectSelectionChanged();
void weeklyReport();
void monthlyReport();
void customReport();
void client_update(int64_t);
void project_insert(int64_t);
void project_update(int64_t);
void project_remove(int64_t);
#if 0
void event_insert(int64_t);
void event_update(int64_t);
void event_remove(int64_t);
#endif
protected:
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
private:
void _refreshTimes(
QTreeWidgetItem *parent,
const ClientReport *dayRpt,
const ClientReport *weekRpt,
const ClientReport *monthRpt,
const ClientReport *yearRpt
);
QTimer *_refreshTimer;
void _populate_project(QTreeWidgetItem *parent, QVector<int64_t> &prj_id_vec);
QTreeWidgetItem* findItem(int64_t prj_id, QTreeWidgetItem *parent=0);
struct {
int64_t id;
QGroupBox *gb;
QLabel *rate_lbl,
*charge_quantum_lbl,
*timeToday_lbl,
*timeWeek_lbl,
*timeMonth_lbl,
*timeYear_lbl;
struct {
QAction *weekly_act,
*monthly_act,
*custom_act;
QMenu *menu;
} report;
} _client;
QSplitter *_splt;
struct {
ProjectPage *page;
ProjectTreeWidget *trw;
QAction *create_act,
*createSubproject_act,
*edit_act,
*delete_act;
QMenu *menu;
} _project;
bool _do_storeSettings;
};
#endif // CLIENTPAGE_H