加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mainwindow.h 2.78 KB
一键复制 编辑 原始数据 按行查看 历史
panxz 提交于 2014-02-21 22:25 . 过滤改为全url过滤
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui>
#include <QtCore>
#include <QtNetwork>
#include <QtWebKit>
#include "rytablemodel.h"
#include "proxy/rypipedata.h"
#include "rule/ryrulemanager.h"
#include "proxy/ryproxyserver.h"
#include "ryupdatechecker.h"
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();
QString getFileList();
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();
void onMessageFromOtherInstance();
void checkNewVersion();
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;
QActionGroup *_limitGroup;
QMenu *_requestLimitMenu;
QAction *_setMaxRequest15Act;
QAction *_setMaxRequest30Act;
QAction *_setMaxRequest100Act;
QAction *_setMaxRequest500Act;
QItemSelectionModel *_itemSelectModel;
RyUpdateChecker *checker;
bool isFirstTimeToggle;
QMutex proxyMutex;
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();
void on_actionCheckNew_triggered();
void loadConfigPage();
void onFilterTextChanged(QString);
};
#endif // MAINWINDOW_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化