ui changes

This commit is contained in:
End 2020-08-14 03:37:33 +02:00
parent 075ada7d3e
commit 1b1f626c61
5 changed files with 265 additions and 62 deletions

View file

@ -18,7 +18,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(thread, SIGNAL (started()), worker, SLOT (process())); connect(thread, SIGNAL (started()), worker, SLOT (process()));
//connect(worker, SIGNAL (error(QString)), this, SLOT (errorString(QString))); //connect(worker, SIGNAL (error(QString)), this, SLOT (errorString(QString)));
connect(worker, SIGNAL (httpMessage(http::Flow)), current_session, SLOT (saveRequest(http::Flow)), Qt::QueuedConnection); connect(worker, SIGNAL (httpMessage(http::Flow)), current_session, SLOT (saveRequest(http::Flow)), Qt::QueuedConnection);
connect(worker, SIGNAL (httpMessage(http::Flow)), this, SLOT (updateHistory(http::Flow)), Qt::QueuedConnection); connect(worker, SIGNAL (httpMessage(http::Flow)), this, SLOT (updateHistory()), Qt::QueuedConnection);
thread->start(); thread->start();
ui->setupUi(this); ui->setupUi(this);
@ -41,10 +41,15 @@ MainWindow::~MainWindow()
delete ui; delete ui;
} }
void MainWindow::updateHistory(http::Flow flow) { void MainWindow::updateHistory() {
ui->historyHTTPTable->setItem(0,0,new QTableWidgetItem(QString::fromStdString(flow.request.server_conn_id))); //ui->historyHTTPTable->setItem(0,0,new QTableWidgetItem(QString::fromStdString(flow.request.server_conn_id)));
ui->historyHTTPTable->setItem(0,1,new QTableWidgetItem(QString::fromStdString(flow.request.method))); //ui->historyHTTPTable->setItem(0,1,new QTableWidgetItem(QString::fromStdString(flow.request.method)));
ui->historyHTTPTable->setItem(0,2,new QTableWidgetItem(QString::fromStdString(flow.request.host))); //ui->historyHTTPTable->setItem(0,2,new QTableWidgetItem(QString::fromStdString(flow.request.host)));
//ui->historyHTTPTable->setItem(0,3,new QTableWidgetItem(QString::number(data.ttl))); //ui->historyHTTPTable->setItem(0,3,new QTableWidgetItem(QString::number(data.ttl)));
ui->historyHTTPTable->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents); //ui->historyHTTPTable->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
}
void MainWindow::on_searchEdit_textEdited(const QString &arg1)
{
emit updateHistory();
} }

View file

@ -22,5 +22,7 @@ public:
MainWindow(QWidget *parent = nullptr); MainWindow(QWidget *parent = nullptr);
~MainWindow(); ~MainWindow();
public slots: public slots:
void updateHistory(http::Flow flow); void updateHistory();
private slots:
void on_searchEdit_textEdited(const QString &arg1);
}; };

View file

@ -6,86 +6,277 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>818</width>
<height>600</height> <height>644</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>MainWindow</string> <string>MainWindow</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QFormLayout" name="formLayout"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>800</width>
<height>600</height>
</size>
</property>
<property name="baseSize">
<size>
<width>800</width>
<height>600</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QFrame" name="frame_2"> <widget class="QSplitter" name="splitter_2">
<property name="frameShape"> <property name="sizePolicy">
<enum>QFrame::StyledPanel</enum> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="frameShadow"> <property name="minimumSize">
<enum>QFrame::Raised</enum> <size>
<width>800</width>
<height>200</height>
</size>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="orientation">
<item> <enum>Qt::Vertical</enum>
<widget class="QTreeView" name="treeView"/>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <widget class="QSplitter" name="splitter">
<enum>QFrame::Raised</enum> <property name="minimumSize">
</property> <size>
<layout class="QVBoxLayout" name="verticalLayout"> <width>800</width>
<item> <height>100</height>
<widget class="QWidget" name="widget" native="true"> </size>
<layout class="QGridLayout" name="gridLayout"> </property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QTabWidget" name="tabWidget_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<widget class="QWidget" name="tabWidget_2Page1" native="true">
<attribute name="title">
<string/>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTextEdit" name="textEdit"/> <widget class="QTreeView" name="treeView">
</item> <property name="sizePolicy">
<item row="0" column="1"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<widget class="QTextEdit" name="textEdit_2"/> <horstretch>0</horstretch>
</item> <verstretch>0</verstretch>
<item row="1" column="0"> </sizepolicy>
<widget class="QTextEdit" name="textEdit_3"/> </property>
</item> <property name="minimumSize">
<item row="1" column="1"> <size>
<widget class="QTextEdit" name="textEdit_4"/> <width>100</width>
<height>50</height>
</size>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </widget>
</layout> <widget class="QTabWidget" name="tabWidget">
</widget> <property name="sizePolicy">
</item> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<item row="1" column="0" colspan="2"> <horstretch>0</horstretch>
<widget class="QTabWidget" name="tabWidget"> <verstretch>0</verstretch>
<widget class="QWidget" name="tabWidgetPage1"> </sizepolicy>
<attribute name="title"> </property>
<string/> <property name="minimumSize">
</attribute> <size>
<layout class="QVBoxLayout" name="verticalLayout_2"> <width>600</width>
<item> <height>200</height>
<widget class="QTableWidget" name="historyHTTPTable"> </size>
<property name="gridStyle"> </property>
<enum>Qt::SolidLine</enum> <widget class="QWidget" name="tabWidgetPage1_2" native="true">
<attribute name="title">
<string/>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QSplitter" name="splitter_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QSplitter" name="splitter_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QTextEdit" name="textEdit">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
</widget>
<widget class="QTextEdit" name="textEdit_3"/>
</widget>
<widget class="QSplitter" name="splitter_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QTextEdit" name="textEdit_2"/>
<widget class="QTextEdit" name="textEdit_4"/>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>800</width>
<height>100</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<widget class="QWidget" name="tabWidgetPage1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string/>
</attribute>
<widget class="QTableWidget" name="historyHTTPTable">
<property name="geometry">
<rect>
<x>9</x>
<y>40</y>
<width>769</width>
<height>109</height>
</rect>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="gridStyle">
<enum>Qt::SolidLine</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
<widget class="QLineEdit" name="searchEdit">
<property name="geometry">
<rect>
<x>101</x>
<y>9</y>
<width>142</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QComboBox" name="searchBox">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>86</width>
<height>25</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>all</string>
</property> </property>
</widget> </item>
</item> <item>
</layout> <property name="text">
<string>ID</string>
</property>
</item>
<item>
<property name="text">
<string>Method</string>
</property>
</item>
<item>
<property name="text">
<string>URL</string>
</property>
</item>
<item>
<property name="text">
<string>Code</string>
</property>
</item>
<item>
<property name="text">
<string>Tags</string>
</property>
</item>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
</item> </item>
</layout> </layout>
<zorder>tabWidget</zorder>
<zorder>widget_2</zorder>
<zorder>splitter_2</zorder>
<zorder>widget</zorder>
<zorder>splitter</zorder>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>818</width>
<height>22</height> <height>22</height>
</rect> </rect>
</property> </property>

View file

@ -139,3 +139,7 @@ void Session::saveRequest(http::Flow flow) {
throw; throw;
} }
} }
void Session::saveResponse(http::Flow flow) {
throw;
}

View file

@ -94,6 +94,7 @@ public:
bool isLoaded(); bool isLoaded();
public slots: public slots:
void saveRequest(http::Flow flow); void saveRequest(http::Flow flow);
void saveResponse(http::Flow flow);
signals: signals:
}; };