diff options
author | Gerald Combs <gerald@wireshark.org> | 2014-12-29 11:42:01 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2014-12-30 03:34:03 +0000 |
commit | 4556498f337d1a9cc4284167526280efa00810b5 (patch) | |
tree | 393ba6e17a82f8973de06738cc644cc4fdc02b2b /ui/qt/voip_calls_dialog.cpp | |
parent | b6ff338e81d4e1f42f2ec8cb90409dc17422f6c6 (diff) | |
download | wireshark-4556498f337d1a9cc4284167526280efa00810b5.tar.gz |
Qt: Convert more dialogs to WiresharkDialog.
Make the Sequence, IO Graph, Statistics Tree, and VoIP Calls dialogs
subclasses of WiresharkDialog.
Remove "Stats Tree" from Statistics Tree dialog titles. Don't complain
if the user opens more than one instance of the dialog.
Use the applicationName property in WiresharkApplication instead of a
separate variable.
Add a preexisting item to the IO Graph bug list (hovering when the file
is closed clears the graph).
Change-Id: I8411a25305d00b16e0d4a82fa50a9bad5c85b239
Reviewed-on: https://code.wireshark.org/review/6125
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/voip_calls_dialog.cpp')
-rw-r--r-- | ui/qt/voip_calls_dialog.cpp | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp index c8b9f7a359..7dfe664c2e 100644 --- a/ui/qt/voip_calls_dialog.cpp +++ b/ui/qt/voip_calls_dialog.cpp @@ -157,13 +157,13 @@ public: }; -VoipCallsDialog::VoipCallsDialog(QWidget *parent, capture_file *cf, bool all_flows) : - QDialog(parent), - ui(new Ui::VoipCallsDialog), - cap_file_(cf) +VoipCallsDialog::VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flows) : + WiresharkDialog(parent, cf), + ui(new Ui::VoipCallsDialog) { ui->setupUi(this); ui->callTreeWidget->sortByColumn(start_time_col_, Qt::AscendingOrder); + setWindowSubtitle(all_flows ? tr("SIP Flows") : tr("VoIP Calls")); ctx_menu_.addActions(QList<QAction *>() << ui->actionSelect_All); @@ -173,9 +173,7 @@ VoipCallsDialog::VoipCallsDialog(QWidget *parent, capture_file *cf, bool all_flo player_button_->setIcon(StockIcon("media-playback-start")); // XXX Use recent settings instead - if (parent) { - resize(parent->width() * 4 / 5, parent->height() * 2 / 3); - } + resize(parent.width() * 4 / 5, parent.height() * 2 / 3); memset (&tapinfo_, 0, sizeof(tapinfo_)); tapinfo_.tap_packet = tapPacket; @@ -191,10 +189,8 @@ VoipCallsDialog::VoipCallsDialog(QWidget *parent, capture_file *cf, bool all_flo updateWidgets(); - if (cap_file_) { - tapinfo_.session = cap_file_->epan; - cf_retap_packets(cap_file_); - } + tapinfo_.session = cap_file_.capFile()->epan; + cap_file_.retapPackets(); } VoipCallsDialog::~VoipCallsDialog() @@ -205,15 +201,11 @@ VoipCallsDialog::~VoipCallsDialog() sequence_analysis_info_free(tapinfo_.graph_analysis); } -void VoipCallsDialog::setCaptureFile(capture_file *cf) +void VoipCallsDialog::captureFileClosing() { - if (!cf) { // We only want to know when the file closes. - voip_calls_remove_all_tap_listeners(&tapinfo_); - cap_file_ = NULL; - tapinfo_.session = NULL; - } - emit captureFileChanged(cap_file_); - updateWidgets(); + voip_calls_remove_all_tap_listeners(&tapinfo_); + tapinfo_.session = NULL; + WiresharkDialog::captureFileClosing(); } void VoipCallsDialog::contextMenuEvent(QContextMenuEvent *event) @@ -436,7 +428,7 @@ void VoipCallsDialog::prepareFilter() void VoipCallsDialog::showSequence() { - if (!cap_file_) return; + if (file_closed_) return; QSet<guint16> selected_calls; foreach (QTreeWidgetItem *ti, ui->callTreeWidget->selectedItems()) { @@ -452,12 +444,10 @@ void VoipCallsDialog::showSequence() cur_ga_item = g_list_next(cur_ga_item); } - SequenceDialog *sequence_dialog = new SequenceDialog(this, cap_file_, tapinfo_.graph_analysis); + SequenceDialog *sequence_dialog = new SequenceDialog(*parentWidget(), cap_file_, tapinfo_.graph_analysis); // XXX This goes away when we close the VoIP Calls dialog. connect(sequence_dialog, SIGNAL(goToPacket(int)), this, SIGNAL(goToPacket(int))); - connect(this, SIGNAL(captureFileChanged(capture_file*)), - sequence_dialog, SLOT(setCaptureFile(capture_file*))); sequence_dialog->show(); } |