-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQtWidgetsApplication.h
73 lines (64 loc) · 1.61 KB
/
QtWidgetsApplication.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
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_QtWidgetsApplication.h"
#include "Catcher.h"
#include "Dumper.h"
#include "Filter.h"
#include <QThread>
#include <QFileDialog>
enum ButtonStatus
{
WAITING,
CAPTURING
};
enum LineStatus
{
EDIT,
NOEDIT
};
class QtWidgetsApplication : public QMainWindow
{
Q_OBJECT
public:
explicit QtWidgetsApplication(QWidget* parent = nullptr);
~QtWidgetsApplication();
private:
Catcher *catcher;
Dumper* dumper;
Filter* filter;
QThread *catcherThread;
QThread* dumperThread;
QThread* filterThread;
Ui::QtWidgetsApplicationClass ui;
void InitComboBox();
void InitTableStyle();
void InitTreeStyle();
void InitTable2Style();
void InitContents();
void updateButtonStatus(ButtonStatus);
void showPacketMsg(Packet*);
QTreeWidgetItem* setProtoTree(ProtoMsg*, int);
void showPacketBytes(Packet*);
signals:
void startCatcherThread();
void stopCatcherThread();
void addCatcherDev(QString path);
void changeCatcherDev(int index);
void setDumperPath(QString path, QString tmpfile);
void startDumperThread();
void setFilterDev(QString path);
void setFilterStr(QString str);
void startFilterThread();
public slots:
void handleSelectDev(int index);
void handleStartCatcher();
void handleStopCatcher();
void handleImportFile();
void handlePacketCaptured(Packet* p);
void handleSelectPacket();
void handleSelectPacketItem();
void handleCatcherStopped();
void handleExportFile();
void handleSubmitFilter();
void handleFilterStopped();
};