forked from AlloyTeam/Rythem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
107 lines (86 loc) · 2.39 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "rytablemodel.h"
#include "proxy/rypipedata.h"
#include <QSettings>
#include <QWebFrame>
#include <QFileDialog>
#include <QDebug>
#include <QScriptEngine>
#include <QScriptValue>
#include <QItemSelection>
#include "rule/ryrulemanager.h"
#include "proxy/ryproxyserver.h"
#include <QScriptEngine>
using namespace rule;
namespace Ui {
class MainWindow;
}
class RyPipeData;
class RyTableSortFilterProxyModel;
class QItemSelectionModel;
class RyJsBridge:public QObject{
Q_OBJECT
public:
RyJsBridge();
public slots:
QString doAction(int action,const QString msg,quint64 groupId=0);
QString getFile();
QString getDir();
QString getConfigs();
signals:
void ruleChanged(int action,QString json);
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent=0);
~MainWindow();
public slots:
void onNewPipe(RyPipeData_ptr);
void onPipeUpdate(RyPipeData_ptr);
void toggleProxy();
void onItemDoubleClicked(QModelIndex);
void onSelectionChange(QItemSelection selected,QItemSelection deselected);
void onWaterfallActionTriggered();
public:
typedef struct __proxyInfo{
int enable;
QString proxyString;
QString pacUrl;
QString isUsingPac;
}ProxyInfo;
RyTableModel *pipeTableModel;
RyTableSortFilterProxyModel *sortFilterProxyModel;
private:
Ui::MainWindow *ui;
RyJsBridge *_jsBridge;
void createMenus();
RyProxyServer *_server;
bool _isUsingCapture;
ProxyInfo _previousProxyInfo;
QMenu *_fileMenu;
QMenu *_filterMenu;
QAction *_importSessionsAct;
QAction *_filterNoImagesAct;
QAction *_filterNo304sAct;
QAction *_filterShowMatchOnlyAct;
QAction *_captureAct;
QAction *_hideConnectTunnelAct;
QItemSelectionModel *_itemSelectModel;
protected:
void closeEvent(QCloseEvent *event);
void contextMenuEvent(QContextMenuEvent *event);
QSettings proxySetting;
private slots:
void addJsObject();
void onAction(QAction*);
void on_actionLongCache_triggered();
void toggleCapture();
void importSessions();
void onActionRemoveAll();
void on_actionDebug_triggered();
};
#endif // MAINWINDOW_H