aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDeveloper Alexander <dev@alex-mails.de>2021-09-21 08:39:10 +0200
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-09-21 12:58:55 +0000
commit7866f43d8294bf9fc9a327c2d543352f8af4de7a (patch)
tree9d8e4823809a4870b55ffd405c45e416eb63e31f /ui
parent543ea3968c2acc34e36a9a3983274498046e621a (diff)
IO Graph: Add checkbox to prevent automatic rescans
Adds a checkbox 'Automatic Update' to the IO Graph to enable or disable rescans and recalculation of graph data temporarily. This is useful when you want to modify settings of multiple graphs without triggering a rescan with every change of a single setting. This becomes useful for large trace files in particular. Rescan or recalculation events are queued while 'Automatic Update' is not active. Checking 'Automatic Update' triggers the queued updates. The setting for 'Automatic Update' is stored in a preference. A german translation for 'Automatic Update' is included.
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/io_graph_dialog.cpp18
-rw-r--r--ui/qt/io_graph_dialog.h3
-rw-r--r--ui/qt/io_graph_dialog.ui20
3 files changed, 39 insertions, 2 deletions
diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp
index 53fd0b8925..97450a04fc 100644
--- a/ui/qt/io_graph_dialog.cpp
+++ b/ui/qt/io_graph_dialog.cpp
@@ -349,6 +349,8 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFi
close_bt->setDefault(true);
}
+ ui->automaticUpdateCheckBox->setChecked(prefs.gui_io_graph_automatic_update ? true : false);
+
stat_timer_ = new QTimer(this);
connect(stat_timer_, SIGNAL(timeout()), this, SLOT(updateStatistics()));
stat_timer_->start(stat_update_interval_);
@@ -1141,13 +1143,13 @@ void IOGraphDialog::updateStatistics()
{
if (!isVisible()) return;
- if (need_retap_ && !file_closed_) {
+ if (need_retap_ && !file_closed_ && prefs.gui_io_graph_automatic_update) {
need_retap_ = false;
cap_file_.retapPackets();
// The user might have closed the window while tapping, which means
// we might no longer exist.
} else {
- if (need_recalc_ && !file_closed_) {
+ if (need_recalc_ && !file_closed_ && prefs.gui_io_graph_automatic_update) {
need_recalc_ = false;
need_replot_ = true;
int enabled_graphs = 0;
@@ -1371,6 +1373,18 @@ void IOGraphDialog::on_logCheckBox_toggled(bool checked)
iop->replot();
}
+void IOGraphDialog::on_automaticUpdateCheckBox_toggled(bool checked)
+{
+ prefs.gui_io_graph_automatic_update = checked ? TRUE : FALSE;
+
+ prefs_main_write();
+
+ if(prefs.gui_io_graph_automatic_update)
+ {
+ updateStatistics();
+ }
+}
+
void IOGraphDialog::on_actionReset_triggered()
{
on_resetButton_clicked();
diff --git a/ui/qt/io_graph_dialog.h b/ui/qt/io_graph_dialog.h
index b2bf751d6d..cdf7b2174e 100644
--- a/ui/qt/io_graph_dialog.h
+++ b/ui/qt/io_graph_dialog.h
@@ -15,6 +15,8 @@
#include <glib.h>
#include "epan/epan_dissect.h"
+#include "epan/prefs.h"
+#include "ui/preference_utils.h"
#include "ui/io_graph_item.h"
@@ -224,6 +226,7 @@ private slots:
void on_resetButton_clicked();
void on_logCheckBox_toggled(bool checked);
+ void on_automaticUpdateCheckBox_toggled(bool checked);
void on_newToolButton_clicked();
void on_deleteToolButton_clicked();
void on_copyToolButton_clicked();
diff --git a/ui/qt/io_graph_dialog.ui b/ui/qt/io_graph_dialog.ui
index 6f4977de03..362ecf4e61 100644
--- a/ui/qt/io_graph_dialog.ui
+++ b/ui/qt/io_graph_dialog.ui
@@ -231,6 +231,26 @@
</widget>
</item>
<item>
+ <spacer name="horizontalSpacer_1">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="automaticUpdateCheckBox">
+ <property name="text">
+ <string>Automatic Update</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>