aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2017-11-17 14:39:03 +0100
committerAnders Broman <a.broman58@gmail.com>2017-11-18 07:23:48 +0000
commit18d49f467d21741394190c0b15f9430df14f4c19 (patch)
tree0d4637ebac5c794a45716c9be11eb0ccb0f664d4 /ui
parented68e05014018672ba6675c8b970b4471fbb68c5 (diff)
Qt: Properly reset the byteview
Reset the byteview on every load of a capture file, and on every start/reset of a capture Change-Id: I0edd30ffddc64484bc6f009d99dfc6fc1a3ceb59 Reviewed-on: https://code.wireshark.org/review/24468 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/byte_view_tab.cpp20
-rw-r--r--ui/qt/byte_view_tab.h2
-rw-r--r--ui/qt/main_window.cpp2
-rw-r--r--ui/qt/main_window.h1
4 files changed, 24 insertions, 1 deletions
diff --git a/ui/qt/byte_view_tab.cpp b/ui/qt/byte_view_tab.cpp
index cff7d1a109..04f15a75d6 100644
--- a/ui/qt/byte_view_tab.cpp
+++ b/ui/qt/byte_view_tab.cpp
@@ -65,6 +65,24 @@ void ByteViewTab::connectToMainWindow()
connect(wsApp->mainWindow(), SIGNAL(frameSelected(int)), this, SLOT(selectedFrameChanged(int)));
connect(wsApp->mainWindow(), SIGNAL(setCaptureFile(capture_file*)), this, SLOT(setCaptureFile(capture_file*)));
connect(wsApp->mainWindow(), SIGNAL(fieldSelected(FieldInformation *)), this, SLOT(selectedFieldChanged(FieldInformation *)));
+
+ connect(wsApp->mainWindow(), SIGNAL(captureActive(int)), this, SLOT(captureActive(int)));
+}
+
+void ByteViewTab::captureActive(int cap)
+{
+ if ( cap == 0 )
+ {
+ QList<ByteViewText *> allBVTs = findChildren<ByteViewText *>();
+ if ( allBVTs.count() > 0 )
+ {
+ ByteViewText * bvt = allBVTs.at(0);
+ tvbuff_t * stored = VariantPointer<tvbuff_t>::asPtr(bvt->property(tvb_data_property));
+
+ if ( ! stored )
+ selectedFrameChanged(-1);
+ }
+ }
}
void ByteViewTab::addTab(const char *name, tvbuff_t *tvb) {
@@ -273,6 +291,8 @@ void ByteViewTab::selectedFieldChanged(FieldInformation *selected)
void ByteViewTab::setCaptureFile(capture_file *cf)
{
+ selectedFrameChanged(-1);
+
cap_file_ = cf;
}
diff --git a/ui/qt/byte_view_tab.h b/ui/qt/byte_view_tab.h
index 19737dd383..a0e8903ace 100644
--- a/ui/qt/byte_view_tab.h
+++ b/ui/qt/byte_view_tab.h
@@ -76,6 +76,8 @@ private slots:
void byteViewTextMarked(int);
void connectToMainWindow();
+
+ void captureActive(int);
};
#endif // BYTE_VIEW_TAB_H
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 72bfeb2ba5..78dde5cf5f 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -518,7 +518,7 @@ MainWindow::MainWindow(QWidget *parent) :
main_ui_->statusBar, SLOT(highlightedFieldChanged(FieldInformation *)));
connect(this, SIGNAL(fieldSelected(FieldInformation *)),
main_ui_->statusBar, SLOT(selectedFieldChanged(FieldInformation *)));
-
+ connect(wsApp, SIGNAL(captureActive(int)), this, SIGNAL(captureActive(int)));
createByteViewDialog();
diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h
index 307fd4dd4d..b722ae2061 100644
--- a/ui/qt/main_window.h
+++ b/ui/qt/main_window.h
@@ -272,6 +272,7 @@ signals:
void fieldHighlight(FieldInformation *);
void frameSelected(int);
+ void captureActive(int);
public slots:
// in main_window_slots.cpp