-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.h
153 lines (131 loc) · 3.66 KB
/
frame.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
#ifndef FRAME_H
#define FRAME_H
#include <QFrame>
#include <QWidget>
#include <QMap>
#include <QTranslator>
#include <QSystemTrayIcon>
#ifdef WIN32
#include "windows.h"
#endif //zxlwin
namespace Ui {
class Frame;
}
class MainPage;
class AccountPage;
class TransferPage;
class BottomBar;
class LockPage;
class DelegatePage;
class TitleBar;
class QMenu;
class FunctionBar;
class ContactPage;
class UpgradePage;
class ApplyDelegatePage;
class ShowBottomBarWidget;
class ShadowWidget;
class WaitingForSync;
class Frame:public QFrame
{
Q_OBJECT
public:
Frame();
~Frame();
protected:
void mousePressEvent(QMouseEvent*event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *);
void updataView();
public slots:
void refresh();
void autoRefresh();
void shadowWidgetShow();
void shadowWidgetHide();
void blockchainStarted();
void setLanguage(QString);
void syncFinished();
void openWallet(QString result);
void walletListAccounts(QString result);
void walletAccountBalance(QString result);
void walletLock(QString result);
void refreshCombobox();
signals:
void delegateListUpdated();
void updateTotalBalance();
private slots:
void alreadyLogin();
void showAccountPage(QString);
void showTransferPage(QString);
void showLockPage();
void autoLock();
void autoUpdate();
void unlock();
void updateTimer();
void showDelegatePage();
void settingSaved();
void privateKeyImported();
void showMainPage();
void showTransferPage();
void showContactPage();
void showUpgradePage(QString);
void showApplyDelegatePage(QString name);
void showTransferPageWithAddress(QString);
void showWaittingForSyncWidget();
void showSelectAchainPathWidget();
void iconIsActived(QSystemTrayIcon::ActivationReason reason);
void showNormalAndActive();
void rebuild();
void scan();
void tokenQueryBalance(QString);
void tokenTransferTo(QString);
// void newAccount(QString name);
private:
bool mouse_press;
QPoint move_point;
MainPage* mainPage;
AccountPage* accountPage;
TransferPage* transferPage;
BottomBar* bottomBar;
QWidget* centralWidget;
LockPage* lockPage;
QTimer* timer;
QTimer* timerUpdate;
TitleBar* titleBar;
QString lastPage;
QString currentAccount;
int currentPageNum; // 0:mainPage 1:accountPage 2:delegatePgae 3:transferPage 4:contactPage
// 6: 7:upgradePage 8:applyDelegatePage
ShadowWidget* shadowWidget;
QSystemTrayIcon* trayIcon;
void createTrayIconActions();
void retranslateTrayIconUi();
void createTrayIcon();
QAction *minimizeAction;
QAction *restoreAction;
QAction *quitAction;
QMenu *trayIconMenu;
QMenu *trayIconMenuEmpty;//zxlrun
ShowBottomBarWidget* showBottomBarWidget;
WaitingForSync* waitingForSync;
#ifdef WIN32
RECT rtConfined; // 由于定义了 framelesswindowhint 为了不让鼠标拖动时能移到任务栏下 //zxlwin
RECT rtDefault; //zxlwin
#endif // WIN32
void getAccountInfo();
void startTimerForAutoRefresh(); // 自动刷新
QTimer* timerForAutoRefresh;
FunctionBar* functionBar;
void closeCurrentPage();
bool eventFilter(QObject *watched, QEvent *e);
void closeEvent(QCloseEvent* e);
void init();
void runUpdate();
ContactPage* contactPage;
UpgradePage* upgradePage;
ApplyDelegatePage* applyDelegatePage;
QTranslator translator; // 选择语言
QTranslator menuTranslator; // 右键菜单语言
QTranslator translatorForTextBrowser; // QTextBrowser的右键菜单翻译
};
#endif // FRAME_H