summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-09-30 10:51:41 +0200
committerAnders Broman <a.broman58@gmail.com>2016-10-03 05:00:30 +0000
commit1fbf831a6ba8eb46757ec93ecbe95efdf9020b3a (patch)
treef0a68c9876a80c29745d3d440ef7753642dbbdee /ui
parent54721903166d06734acb0d985e05f25125c98016 (diff)
downloadwireshark-1fbf831a6ba8eb46757ec93ecbe95efdf9020b3a.tar.gz
Qt: properly handle UAT changes on dialog close
Ensure that UAT changes are always applied, not just when pressing the OK/Cancel buttons, but also when closing the dialog via the window close button or by pressing Escape. Change-Id: I0f0b97588553c6b01a24dfde78218d0ce2667e2c Reviewed-on: https://code.wireshark.org/review/17993 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/uat_dialog.cpp6
-rw-r--r--ui/qt/uat_dialog.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/ui/qt/uat_dialog.cpp b/ui/qt/uat_dialog.cpp
index a68fe9d34c..cf703ea9d0 100644
--- a/ui/qt/uat_dialog.cpp
+++ b/ui/qt/uat_dialog.cpp
@@ -118,6 +118,8 @@ void UatDialog::setUat(epan_uat *uat)
if (uat_->help && strlen(uat_->help) > 0) {
help_button_->setEnabled(true);
}
+ connect(this, SIGNAL(rejected()), this, SLOT(rejectChanges()));
+ connect(this, SIGNAL(accepted()), this, SLOT(acceptChanges()));
}
setWindowTitle(title);
@@ -580,7 +582,7 @@ void UatDialog::applyChanges()
}
-void UatDialog::on_buttonBox_accepted()
+void UatDialog::acceptChanges()
{
if (!uat_) return;
@@ -599,7 +601,7 @@ void UatDialog::on_buttonBox_accepted()
}
}
-void UatDialog::on_buttonBox_rejected()
+void UatDialog::rejectChanges()
{
if (!uat_) return;
diff --git a/ui/qt/uat_dialog.h b/ui/qt/uat_dialog.h
index 2ab108bf2a..c86ab97818 100644
--- a/ui/qt/uat_dialog.h
+++ b/ui/qt/uat_dialog.h
@@ -61,11 +61,11 @@ private slots:
void enumPrefCurrentIndexChanged(int index);
void stringPrefTextChanged(const QString & text);
void stringPrefEditingFinished();
+ void acceptChanges();
+ void rejectChanges();
void on_newToolButton_clicked();
void on_deleteToolButton_clicked();
void on_copyToolButton_clicked();
- void on_buttonBox_accepted();
- void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
private: