-
Notifications
You must be signed in to change notification settings - Fork 0
/
opensocks.h
57 lines (45 loc) · 1.04 KB
/
opensocks.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
#ifndef OPENSOCKS_H
#define OPENSOCKS_H
#include <QIcon>
#include <QTimer>
#include <QWidget>
QT_BEGIN_NAMESPACE
namespace Ui {
class OpenSocks;
}
QT_END_NAMESPACE
class QSystemTrayIcon;
class QMenu;
class OpenSocks : public QWidget
{
Q_OBJECT
public:
OpenSocks(QWidget *parent = nullptr);
~OpenSocks();
signals:
// void proxyStarted();
void proxyStopped();
protected:
void closeEvent(QCloseEvent *event) override;
void showEvent(QShowEvent *event) override;
private:
Ui::OpenSocks *ui;
bool proxyRunning, activeStop;
QSystemTrayIcon *trayIcon = nullptr;
QMenu *trayIconMenu;
QAction *actionStart, *actionStop, *actionQuit, *actionConfig;
QIcon icon = QIcon(":/assets/icon.png");
QTimer timer;
void center();
void createTrayActions();
void createTrayIcon();
void initConfig();
void afterShowOneTime();
void stopProxy();
void saveConfig();
private slots:
void startStopProxy();
void onProxyStopped();
void on_buttonLog_clicked();
};
#endif // OPENSOCKS_H