Skip to content

Commit 02e1e37

Browse files
author
Mich
committed
Added new actions, replaced pushButton "Scroll Down" with radioButton to better suit the insertText mode
1 parent c95a26e commit 02e1e37

File tree

3 files changed

+70
-42
lines changed

3 files changed

+70
-42
lines changed

src/mainwindow.cpp

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ void MainWindow::addLog(QString text)
880880
ui->textBrowserLogs->moveCursor(QTextCursor::MoveOperation::End, QTextCursor::MoveMode::MoveAnchor);
881881
ui->textBrowserLogs->insertPlainText(text);
882882

883-
if (!ui->pushButtonScrollToButtom->isChecked())
883+
if (!ui->radioButtonScrollToButtom->isChecked())
884884
ui->textBrowserLogs->verticalScrollBar()->setValue(sliderPos);
885885
}
886886
else if (ui->comboBoxAddTextMode->currentIndex() == 1)
@@ -917,7 +917,7 @@ void MainWindow::addLogBytes(QByteArray bytes, bool hexToBinary)
917917
ui->textBrowserLogs->moveCursor(QTextCursor::MoveOperation::End, QTextCursor::MoveMode::MoveAnchor);
918918
ui->textBrowserLogs->insertPlainText(bytesText);
919919

920-
if (!ui->pushButtonScrollToButtom->isChecked())
920+
if (!ui->radioButtonScrollToButtom->isChecked())
921921
ui->textBrowserLogs->verticalScrollBar()->setValue(sliderPos);
922922
}
923923
else if (ui->comboBoxAddTextMode->currentIndex() == 1)
@@ -1329,11 +1329,6 @@ void MainWindow::on_checkBoxAutoRefresh_toggled(bool checked)
13291329
}
13301330
}
13311331

1332-
void MainWindow::on_pushButtonScrollToButtom_clicked()
1333-
{
1334-
ui->textBrowserLogs->verticalScrollBar()->setValue(ui->textBrowserLogs->verticalScrollBar()->maximum());
1335-
}
1336-
13371332
void MainWindow::on_pushButtonClear_clicked()
13381333
{
13391334
ui->textBrowserLogs->clear();
@@ -2225,11 +2220,26 @@ void MainWindow::on_comboBoxAddTextMode_currentIndexChanged(int index)
22252220
{
22262221
if (index == 1)
22272222
{
2228-
ui->pushButtonScrollToButtom->setCheckable(false);
2229-
ui->pushButtonScrollToButtom->setChecked(false);
2223+
ui->radioButtonScrollToButtom->setCheckable(false);
2224+
ui->radioButtonScrollToButtom->setChecked(false);
22302225
}
22312226
else
22322227
{
2233-
ui->pushButtonScrollToButtom->setCheckable(true);
2228+
ui->radioButtonScrollToButtom->setCheckable(true);
22342229
}
22352230
}
2231+
2232+
void MainWindow::on_actionHide_parser_data_triggered()
2233+
{
2234+
ui->splitterGraphTable->setSizes({ui->splitterGraphTable->width(), 0});
2235+
}
2236+
2237+
void MainWindow::on_actionShow_parser_data_triggered()
2238+
{
2239+
ui->splitterGraphTable->setSizes({ui->splitterGraphTable->width(), ui->splitterGraphTable->height() / 2});
2240+
}
2241+
2242+
void MainWindow::on_radioButtonScrollToButtom_clicked()
2243+
{
2244+
ui->textBrowserLogs->verticalScrollBar()->setValue(ui->textBrowserLogs->verticalScrollBar()->maximum());
2245+
}

src/mainwindow.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ private slots:
122122
void on_pushButtonRAMClear_clicked();
123123
void on_pushButtonRefresh_clicked();
124124
void on_pushButtonSaveRAMBuffer_clicked();
125-
void on_pushButtonScrollToButtom_clicked();
126125
void on_pushButtonSend_clicked();
127126
void on_pushButtonSerialConnect_toggled(bool checked);
128127
void on_pushButtonSetDefaultLogPath_clicked();
@@ -141,9 +140,10 @@ private slots:
141140
void on_tracerShowPointValue(QMouseEvent *event);
142141
void on_updateSerialDeviceList();
143142
void on_toolButtonHideTable_clicked();
144-
145143
void on_comboBoxAddTextMode_currentIndexChanged(int index);
146-
144+
void on_actionHide_parser_data_triggered();
145+
void on_actionShow_parser_data_triggered();
146+
void on_radioButtonScrollToButtom_clicked();
147147
private:
148148
// QCompleter *completer;
149149
FileReader fileReader;

src/mainwindow.ui

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>1779</width>
9+
<width>1782</width>
1010
<height>722</height>
1111
</rect>
1212
</property>
@@ -1798,31 +1798,6 @@
17981798
</property>
17991799
</widget>
18001800
</item>
1801-
<item row="0" column="0">
1802-
<widget class="QPushButton" name="pushButtonScrollToButtom">
1803-
<property name="sizePolicy">
1804-
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
1805-
<horstretch>0</horstretch>
1806-
<verstretch>0</verstretch>
1807-
</sizepolicy>
1808-
</property>
1809-
<property name="minimumSize">
1810-
<size>
1811-
<width>0</width>
1812-
<height>0</height>
1813-
</size>
1814-
</property>
1815-
<property name="text">
1816-
<string>Scroll down</string>
1817-
</property>
1818-
<property name="checkable">
1819-
<bool>true</bool>
1820-
</property>
1821-
<property name="checked">
1822-
<bool>false</bool>
1823-
</property>
1824-
</widget>
1825-
</item>
18261801
<item row="1" column="0" colspan="2">
18271802
<widget class="QSpinBox" name="spinBoxMaxLines">
18281803
<property name="sizePolicy">
@@ -1863,6 +1838,31 @@
18631838
</property>
18641839
</widget>
18651840
</item>
1841+
<item row="0" column="0">
1842+
<widget class="QRadioButton" name="radioButtonScrollToButtom">
1843+
<property name="sizePolicy">
1844+
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
1845+
<horstretch>0</horstretch>
1846+
<verstretch>0</verstretch>
1847+
</sizepolicy>
1848+
</property>
1849+
<property name="minimumSize">
1850+
<size>
1851+
<width>0</width>
1852+
<height>0</height>
1853+
</size>
1854+
</property>
1855+
<property name="text">
1856+
<string>Scroll Down</string>
1857+
</property>
1858+
<property name="checkable">
1859+
<bool>true</bool>
1860+
</property>
1861+
<property name="checked">
1862+
<bool>false</bool>
1863+
</property>
1864+
</widget>
1865+
</item>
18661866
</layout>
18671867
</item>
18681868
</layout>
@@ -2525,7 +2525,7 @@ p, li { white-space: pre-wrap; }
25252525
<rect>
25262526
<x>0</x>
25272527
<y>0</y>
2528-
<width>1779</width>
2528+
<width>1782</width>
25292529
<height>27</height>
25302530
</rect>
25312531
</property>
@@ -2571,6 +2571,8 @@ p, li { white-space: pre-wrap; }
25712571
<addaction name="actionFull_text_view"/>
25722572
<addaction name="action50_50_view"/>
25732573
<addaction name="actionFull_chart"/>
2574+
<addaction name="actionShow_parser_data"/>
2575+
<addaction name="actionHide_parser_data"/>
25742576
</widget>
25752577
<widget class="QMenu" name="menuChange_visualisation">
25762578
<property name="title">
@@ -2658,7 +2660,7 @@ p, li { white-space: pre-wrap; }
26582660
<string>Plotter</string>
26592661
</property>
26602662
<property name="shortcut">
2661-
<string>Ctrl+4</string>
2663+
<string>Ctrl+6</string>
26622664
</property>
26632665
</action>
26642666
<action name="action3D_orientation">
@@ -2669,7 +2671,7 @@ p, li { white-space: pre-wrap; }
26692671
<string>3D Orientation</string>
26702672
</property>
26712673
<property name="shortcut">
2672-
<string>Ctrl+5</string>
2674+
<string>Ctrl+7</string>
26732675
</property>
26742676
</action>
26752677
<action name="actionPrint_Graph">
@@ -2700,6 +2702,22 @@ p, li { white-space: pre-wrap; }
27002702
<string>Application Info</string>
27012703
</property>
27022704
</action>
2705+
<action name="actionShow_parser_data">
2706+
<property name="text">
2707+
<string>Show parser data</string>
2708+
</property>
2709+
<property name="shortcut">
2710+
<string>Ctrl+4</string>
2711+
</property>
2712+
</action>
2713+
<action name="actionHide_parser_data">
2714+
<property name="text">
2715+
<string>Hide parser data</string>
2716+
</property>
2717+
<property name="shortcut">
2718+
<string>Ctrl+5</string>
2719+
</property>
2720+
</action>
27032721
</widget>
27042722
<layoutdefault spacing="6" margin="11"/>
27052723
<customwidgets>

0 commit comments

Comments
 (0)