aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/export_object_dialog.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-08-24 12:30:56 -0700
committerGerald Combs <gerald@wireshark.org>2015-08-26 15:04:28 +0000
commite234ce8804e6d27656d5db332ea521392be7d25f (patch)
tree3b5a3001b3ea56e40baff5eec7bc4b4e033ec83e /ui/qt/export_object_dialog.cpp
parentf7e9a795a8575c8170346e878b898efe1e5be304 (diff)
Rework tapping in Qt dialogs.
Add cf_cb_file_retap_started and cf_cb_file_retap_finished to file.[ch]. Add their associated signals to CaptureFile. Add registerTapListener and removeTapListeners to WiresharkDialog, which collect and automatically remove tap listeners. Add beginRetapPackets and endRetapPackets, which can be used to wrap critical sections so that we don't delete ourselves while tapping. Don't cancel tapping on close in WiresharkDialog. Use beginRetapPackets and endRetapPackets in WiresharkDialog and FollowStreamDialog. We will likely need to add them elsewhere. Update comments. Change-Id: I1788a6ade0817c31aa3419216df96be5e36b2178 Reviewed-on: https://code.wireshark.org/review/10261 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/export_object_dialog.cpp')
-rw-r--r--ui/qt/export_object_dialog.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/ui/qt/export_object_dialog.cpp b/ui/qt/export_object_dialog.cpp
index 4812486669..2da7bd5a03 100644
--- a/ui/qt/export_object_dialog.cpp
+++ b/ui/qt/export_object_dialog.cpp
@@ -31,9 +31,9 @@
#include "wireshark_application.h"
#include <QDialogButtonBox>
-#include <QPushButton>
-#include <QMessageBox>
#include <QFileDialog>
+#include <QMessageBox>
+#include <QPushButton>
extern "C" {
@@ -127,7 +127,7 @@ ExportObjectDialog::~ExportObjectDialog()
{
delete eo_ui_;
export_object_list_.eod = NULL;
- remove_tap_listener((void *)&export_object_list_);
+ removeTapListeners();
}
void ExportObjectDialog::addObjectEntry(export_object_entry_t *entry)
@@ -172,22 +172,11 @@ void ExportObjectDialog::resetObjects()
void ExportObjectDialog::show()
{
- GString *error_msg;
-
/* Data will be gathered via a tap callback */
- error_msg = register_tap_listener(tap_name_, (void *)&export_object_list_, NULL, 0,
- eo_reset,
- tap_packet_,
- NULL);
-
- if (error_msg) {
- QMessageBox::warning(
- this,
- tr("Tap registration error"),
- QString(tr("Unable to register ")) + name_ + QString(tr(" tap: ")) + error_msg->str,
- QMessageBox::Ok
- );
- g_string_free(error_msg, TRUE);
+ if (!registerTapListener(tap_name_, &export_object_list_, NULL, 0,
+ eo_reset,
+ tap_packet_,
+ NULL)) {
return;
}