summaryrefslogtreecommitdiff
path: root/ui/qt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-02-13 16:18:57 -0800
committerGerald Combs <gerald@wireshark.org>2015-02-14 00:19:58 +0000
commitb5a3b65f7aefa7af82f6d4927de91f151d209b3c (patch)
treebeed86ba522ce101884a84dd68ea3b79a70c32af /ui/qt
parentf85d1c801d0fd49950a13bf134102ff04582f17d (diff)
downloadwireshark-b5a3b65f7aefa7af82f6d4927de91f151d209b3c.tar.gz
Qt: Fix side effects of recent WiresharkDialog changes.
Quit the application when the main window closes. This cleans up any other top-level windows that might be open. Don't dereference a NULL pointer when opening the sequence dialog from the VoIP calls dialog. Change-Id: I9902d40ead1c5f2e541b6d79f3d957228e4e9687 Reviewed-on: https://code.wireshark.org/review/7107 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/main_window.cpp2
-rw-r--r--ui/qt/voip_calls_dialog.cpp5
-rw-r--r--ui/qt/voip_calls_dialog.h1
-rw-r--r--ui/qt/wireshark_dialog.cpp2
-rw-r--r--ui/qt/wireshark_dialog.h1
5 files changed, 7 insertions, 4 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 7db42d879b..8df4344915 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -536,6 +536,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
// Make sure we kill any open dumpcap processes.
delete main_welcome_;
+ // One of the many places we assume one main window.
if(!wsApp->isInitialized()) {
// If we're still initializing, QCoreApplication::quit() won't
// exit properly because we are not in the event loop. This
@@ -544,6 +545,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
// instead so that we can do a normal exit here.
exit(0);
}
+ wsApp->quit();
}
const int min_sensible_dimension = 200;
diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp
index c32acde626..e520b6707c 100644
--- a/ui/qt/voip_calls_dialog.cpp
+++ b/ui/qt/voip_calls_dialog.cpp
@@ -160,7 +160,8 @@ public:
VoipCallsDialog::VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flows) :
WiresharkDialog(parent, cf),
- ui(new Ui::VoipCallsDialog)
+ ui(new Ui::VoipCallsDialog),
+ parent_(parent)
{
ui->setupUi(this);
ui->callTreeWidget->sortByColumn(start_time_col_, Qt::AscendingOrder);
@@ -450,7 +451,7 @@ void VoipCallsDialog::showSequence()
cur_ga_item = g_list_next(cur_ga_item);
}
- SequenceDialog *sequence_dialog = new SequenceDialog(*parentWidget(), cap_file_, tapinfo_.graph_analysis);
+ SequenceDialog *sequence_dialog = new SequenceDialog(parent_, 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)));
diff --git a/ui/qt/voip_calls_dialog.h b/ui/qt/voip_calls_dialog.h
index 439ed3a9a2..4de3b42aa4 100644
--- a/ui/qt/voip_calls_dialog.h
+++ b/ui/qt/voip_calls_dialog.h
@@ -66,6 +66,7 @@ protected slots:
private:
Ui::VoipCallsDialog *ui;
+ QWidget &parent_;
voip_calls_tapinfo_t tapinfo_;
QPushButton *prepare_button_;
QPushButton *sequence_button_;
diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp
index 1428323057..ca91182028 100644
--- a/ui/qt/wireshark_dialog.cpp
+++ b/ui/qt/wireshark_dialog.cpp
@@ -37,7 +37,7 @@
// To do:
// - Use a dynamic property + Q_PROPERTY for the subtitle.
-
+// - Save and load recent geometry.
WiresharkDialog::WiresharkDialog(QWidget &, CaptureFile &capture_file) :
QDialog(NULL, Qt::Window),
diff --git a/ui/qt/wireshark_dialog.h b/ui/qt/wireshark_dialog.h
index 9c34d430ca..9c5ed7d4f5 100644
--- a/ui/qt/wireshark_dialog.h
+++ b/ui/qt/wireshark_dialog.h
@@ -56,7 +56,6 @@ private:
QString subtitle_;
private slots:
-
};
#endif // WIRESHARK_DIALOG_H