Updated LogsTab design

This commit is contained in:
Valentino Orlandi 2022-06-25 21:17:40 +02:00
parent b6cf9682d4
commit 2e131ed46a
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
3 changed files with 128 additions and 119 deletions

View File

@ -42,11 +42,13 @@ MainWindow::MainWindow(QWidget *parent)
this->script_font_family,
this->font_size );
// TreeView for the LogFiles
this->ui->checkAllLogFiles->setFont( this->FONTS["main_small"] );
this->ui->listLogFiles->setFont( this->FONTS["main"] );
// parent font for every tab
this->ui->CrapTabs->setFont( this->FONTS["main_big"] );
// initialize the TextBrowser for the LogFiles
// TreeView for the LogFiles
this->ui->checkBox_LogFiles_CheckAll->setFont( this->FONTS["main_small"] );
this->ui->listLogFiles->setFont( this->FONTS["main"] );
// TextBrowser for the LogFiles
this->TB.wide_lines = false;
this->TB.color_scheme = 1;
this->TB.font_size = this->font_size;
@ -55,8 +57,7 @@ MainWindow::MainWindow(QWidget *parent)
this->TB.font_family,
this->TB.font_size );
this->ui->textLogFiles->setFont( this->TB.font );
// get a fresh list of log files
// get a fresh list of LogFiles
this->ui->listLogFiles->header()->resizeSection(0,200);
this->ui->listLogFiles->header()->resizeSection(1,100);
this->on_buttonRefreshList_clicked();
@ -128,13 +129,13 @@ void MainWindow::on_buttonRefreshList_clicked()
}
void MainWindow::on_checkAllLogFiles_stateChanged(int arg1)
void MainWindow::on_checkBox_LogFiles_CheckAll_stateChanged(int arg1)
{
Qt::CheckState new_state;
if ( this->ui->checkAllLogFiles->checkState() == Qt::CheckState::Checked ) {
if ( this->ui->checkBox_LogFiles_CheckAll->checkState() == Qt::CheckState::Checked ) {
// check all
new_state = Qt::CheckState::Checked;
} else if ( this->ui->checkAllLogFiles->checkState() == Qt::CheckState::Unchecked ) {
} else if ( this->ui->checkBox_LogFiles_CheckAll->checkState() == Qt::CheckState::Unchecked ) {
// un-check all
new_state = Qt::CheckState::Unchecked;
} else {
@ -192,11 +193,11 @@ void MainWindow::on_listLogFiles_itemChanged(QTreeWidgetItem *item, int column)
++i;
}
if ( n_checked == 0 ) {
this->ui->checkAllLogFiles->setCheckState(Qt::CheckState::Unchecked);
this->ui->checkBox_LogFiles_CheckAll->setCheckState(Qt::CheckState::Unchecked);
} else if ( n_checked == this->craplog.getLogsListSize() ) {
this->ui->checkAllLogFiles->setCheckState(Qt::CheckState::Checked);
this->ui->checkBox_LogFiles_CheckAll->setCheckState(Qt::CheckState::Checked);
} else {
this->ui->checkAllLogFiles->setCheckState(Qt::CheckState::PartiallyChecked);
this->ui->checkBox_LogFiles_CheckAll->setCheckState(Qt::CheckState::PartiallyChecked);
}
}

View File

@ -25,7 +25,7 @@ public:
private slots:
void on_buttonViewFile_clicked();
void on_checkAllLogFiles_stateChanged(int arg1);
void on_checkBox_LogFiles_CheckAll_stateChanged(int arg1);
void on_buttonRefreshList_clicked();

View File

@ -76,7 +76,7 @@
<item>
<widget class="QToolBox" name="LogBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -88,12 +88,15 @@
<number>9</number>
</property>
<widget class="QWidget" name="LogBoxFiles">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>722</width>
<height>395</height>
<height>441</height>
</rect>
</property>
<property name="sizePolicy">
@ -103,20 +106,23 @@
</sizepolicy>
</property>
<attribute name="label">
<string>Files</string>
<string>Log Files</string>
</attribute>
<attribute name="toolTip">
<string>Select which log files to use</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkAllLogFiles">
<widget class="QCheckBox" name="checkBox_LogFiles_CheckAll">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Toggle/untoggle selection for all files</string>
</property>
@ -170,6 +176,9 @@
</item>
<item row="0" column="4" rowspan="3">
<widget class="QTextBrowser" name="textLogFiles">
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
@ -354,102 +363,13 @@ hr { height: 1px; border-width: 0; }
</item>
</layout>
</widget>
<widget class="QWidget" name="LogBoxArgs">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>722</width>
<height>395</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="label">
<string>Options</string>
</attribute>
<attribute name="toolTip">
<string>Define the options to apply while parsing logs</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="minimumSize">
<size>
<width>704</width>
<height>377</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>702</width>
<height>375</height>
</rect>
</property>
<widget class="QRadioButton" name="radioButton_DefaultSettings">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>281</width>
<height>30</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="text">
<string>use default configuration</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QRadioButton" name="radioButton_CustomSettings">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>281</width>
<height>30</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="text">
<string>use custom settings</string>
</property>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="LogBoxStart">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>722</width>
<height>395</height>
<height>441</height>
</rect>
</property>
<property name="sizePolicy">
@ -459,8 +379,106 @@ hr { height: 1px; border-width: 0; }
</sizepolicy>
</property>
<attribute name="label">
<string>Start</string>
<string>Make Statistics</string>
</attribute>
<attribute name="toolTip">
<string>Parse the selected files to make statistics</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>192</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>START</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextBrowser" name="textBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>256</height>
</size>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
hr { height: 1px; border-width: 0; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:16pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Performances&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:14pt; font-weight:700;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Total size parsed: 234 KB&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Total logs size: 222 KB&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Number of lines: 1000&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Used size: 200 KB&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Access logs size: 50 KB&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Number of lines: 300&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Error logs size: 150 KB&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Number of lines: 695&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Discarded size: 22 KB&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; Number of lines: 5&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGraphicsView" name="graphicsView">
<property name="minimumSize">
<size>
<width>0</width>
<height>256</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
@ -477,7 +495,7 @@ hr { height: 1px; border-width: 0; }
<string notr="true"></string>
</attribute>
<attribute name="toolTip">
<string>View your statisticsView your statistics</string>
<string>View your statistics</string>
</attribute>
</widget>
<widget class="QWidget" name="Up">
@ -521,16 +539,6 @@ hr { height: 1px; border-width: 0; }
<height>27</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="title">
<string>Utilities</string>
</property>
<addaction name="actionCrapnote"/>
</widget>
<addaction name="menuFile"/>
</widget>
<action name="actionCrapnote">
<property name="text">