ui changes
This commit is contained in:
		
							parent
							
								
									075ada7d3e
								
							
						
					
					
						commit
						1b1f626c61
					
				
					 5 changed files with 265 additions and 62 deletions
				
			
		| 
						 | 
				
			
			@ -18,7 +18,7 @@ MainWindow::MainWindow(QWidget *parent)
 | 
			
		|||
    connect(thread, SIGNAL (started()), worker, SLOT (process()));
 | 
			
		||||
    //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)), this, SLOT (updateHistory(http::Flow)), Qt::QueuedConnection);
 | 
			
		||||
    connect(worker, SIGNAL (httpMessage(http::Flow)), this, SLOT (updateHistory()), Qt::QueuedConnection);
 | 
			
		||||
    thread->start();
 | 
			
		||||
 | 
			
		||||
    ui->setupUi(this);
 | 
			
		||||
| 
						 | 
				
			
			@ -41,10 +41,15 @@ MainWindow::~MainWindow()
 | 
			
		|||
    delete ui;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void MainWindow::updateHistory(http::Flow flow) {
 | 
			
		||||
    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,2,new QTableWidgetItem(QString::fromStdString(flow.request.host)));
 | 
			
		||||
void MainWindow::updateHistory() {
 | 
			
		||||
    //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,2,new QTableWidgetItem(QString::fromStdString(flow.request.host)));
 | 
			
		||||
    //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();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,5 +22,7 @@ public:
 | 
			
		|||
    MainWindow(QWidget *parent = nullptr);
 | 
			
		||||
    ~MainWindow();
 | 
			
		||||
public slots:
 | 
			
		||||
    void updateHistory(http::Flow flow);
 | 
			
		||||
    void updateHistory();
 | 
			
		||||
private slots:
 | 
			
		||||
    void on_searchEdit_textEdited(const QString &arg1);
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										301
									
								
								mainwindow.ui
									
										
									
									
									
								
							
							
						
						
									
										301
									
								
								mainwindow.ui
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -6,86 +6,277 @@
 | 
			
		|||
   <rect>
 | 
			
		||||
    <x>0</x>
 | 
			
		||||
    <y>0</y>
 | 
			
		||||
    <width>800</width>
 | 
			
		||||
    <height>600</height>
 | 
			
		||||
    <width>818</width>
 | 
			
		||||
    <height>644</height>
 | 
			
		||||
   </rect>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="windowTitle">
 | 
			
		||||
   <string>MainWindow</string>
 | 
			
		||||
  </property>
 | 
			
		||||
  <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">
 | 
			
		||||
     <widget class="QFrame" name="frame_2">
 | 
			
		||||
      <property name="frameShape">
 | 
			
		||||
       <enum>QFrame::StyledPanel</enum>
 | 
			
		||||
     <widget class="QSplitter" name="splitter_2">
 | 
			
		||||
      <property name="sizePolicy">
 | 
			
		||||
       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
 | 
			
		||||
        <horstretch>0</horstretch>
 | 
			
		||||
        <verstretch>0</verstretch>
 | 
			
		||||
       </sizepolicy>
 | 
			
		||||
      </property>
 | 
			
		||||
      <property name="frameShadow">
 | 
			
		||||
       <enum>QFrame::Raised</enum>
 | 
			
		||||
      <property name="minimumSize">
 | 
			
		||||
       <size>
 | 
			
		||||
        <width>800</width>
 | 
			
		||||
        <height>200</height>
 | 
			
		||||
       </size>
 | 
			
		||||
      </property>
 | 
			
		||||
      <layout class="QHBoxLayout" name="horizontalLayout_2">
 | 
			
		||||
       <item>
 | 
			
		||||
        <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 name="orientation">
 | 
			
		||||
       <enum>Qt::Vertical</enum>
 | 
			
		||||
      </property>
 | 
			
		||||
      <property name="frameShadow">
 | 
			
		||||
       <enum>QFrame::Raised</enum>
 | 
			
		||||
      </property>
 | 
			
		||||
      <layout class="QVBoxLayout" name="verticalLayout">
 | 
			
		||||
       <item>
 | 
			
		||||
        <widget class="QWidget" name="widget" native="true">
 | 
			
		||||
         <layout class="QGridLayout" name="gridLayout">
 | 
			
		||||
      <widget class="QSplitter" name="splitter">
 | 
			
		||||
       <property name="minimumSize">
 | 
			
		||||
        <size>
 | 
			
		||||
         <width>800</width>
 | 
			
		||||
         <height>100</height>
 | 
			
		||||
        </size>
 | 
			
		||||
       </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">
 | 
			
		||||
           <widget class="QTextEdit" name="textEdit"/>
 | 
			
		||||
          </item>
 | 
			
		||||
          <item row="0" column="1">
 | 
			
		||||
           <widget class="QTextEdit" name="textEdit_2"/>
 | 
			
		||||
          </item>
 | 
			
		||||
          <item row="1" column="0">
 | 
			
		||||
           <widget class="QTextEdit" name="textEdit_3"/>
 | 
			
		||||
          </item>
 | 
			
		||||
          <item row="1" column="1">
 | 
			
		||||
           <widget class="QTextEdit" name="textEdit_4"/>
 | 
			
		||||
           <widget class="QTreeView" name="treeView">
 | 
			
		||||
            <property name="sizePolicy">
 | 
			
		||||
             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
 | 
			
		||||
              <horstretch>0</horstretch>
 | 
			
		||||
              <verstretch>0</verstretch>
 | 
			
		||||
             </sizepolicy>
 | 
			
		||||
            </property>
 | 
			
		||||
            <property name="minimumSize">
 | 
			
		||||
             <size>
 | 
			
		||||
              <width>100</width>
 | 
			
		||||
              <height>50</height>
 | 
			
		||||
             </size>
 | 
			
		||||
            </property>
 | 
			
		||||
           </widget>
 | 
			
		||||
          </item>
 | 
			
		||||
         </layout>
 | 
			
		||||
        </widget>
 | 
			
		||||
       </item>
 | 
			
		||||
      </layout>
 | 
			
		||||
     </widget>
 | 
			
		||||
    </item>
 | 
			
		||||
    <item row="1" column="0" colspan="2">
 | 
			
		||||
     <widget class="QTabWidget" name="tabWidget">
 | 
			
		||||
      <widget class="QWidget" name="tabWidgetPage1">
 | 
			
		||||
       <attribute name="title">
 | 
			
		||||
        <string/>
 | 
			
		||||
       </attribute>
 | 
			
		||||
       <layout class="QVBoxLayout" name="verticalLayout_2">
 | 
			
		||||
        <item>
 | 
			
		||||
         <widget class="QTableWidget" name="historyHTTPTable">
 | 
			
		||||
          <property name="gridStyle">
 | 
			
		||||
           <enum>Qt::SolidLine</enum>
 | 
			
		||||
       </widget>
 | 
			
		||||
       <widget class="QTabWidget" name="tabWidget">
 | 
			
		||||
        <property name="sizePolicy">
 | 
			
		||||
         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
 | 
			
		||||
          <horstretch>0</horstretch>
 | 
			
		||||
          <verstretch>0</verstretch>
 | 
			
		||||
         </sizepolicy>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="minimumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>600</width>
 | 
			
		||||
          <height>200</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
        <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>
 | 
			
		||||
         </widget>
 | 
			
		||||
        </item>
 | 
			
		||||
       </layout>
 | 
			
		||||
         </item>
 | 
			
		||||
         <item>
 | 
			
		||||
          <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>
 | 
			
		||||
    </item>
 | 
			
		||||
   </layout>
 | 
			
		||||
   <zorder>tabWidget</zorder>
 | 
			
		||||
   <zorder>widget_2</zorder>
 | 
			
		||||
   <zorder>splitter_2</zorder>
 | 
			
		||||
   <zorder>widget</zorder>
 | 
			
		||||
   <zorder>splitter</zorder>
 | 
			
		||||
  </widget>
 | 
			
		||||
  <widget class="QMenuBar" name="menubar">
 | 
			
		||||
   <property name="geometry">
 | 
			
		||||
    <rect>
 | 
			
		||||
     <x>0</x>
 | 
			
		||||
     <y>0</y>
 | 
			
		||||
     <width>800</width>
 | 
			
		||||
     <width>818</width>
 | 
			
		||||
     <height>22</height>
 | 
			
		||||
    </rect>
 | 
			
		||||
   </property>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -139,3 +139,7 @@ void Session::saveRequest(http::Flow flow) {
 | 
			
		|||
        throw;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Session::saveResponse(http::Flow flow) {
 | 
			
		||||
    throw;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -94,6 +94,7 @@ public:
 | 
			
		|||
    bool isLoaded();
 | 
			
		||||
public slots:
 | 
			
		||||
    void saveRequest(http::Flow flow);
 | 
			
		||||
    void saveResponse(http::Flow flow);
 | 
			
		||||
signals:
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue