summaryrefslogtreecommitdiff
path: root/ui/gtk/simple_dialog.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-04-29 00:25:23 +0200
committerAnders Broman <a.broman58@gmail.com>2014-04-29 04:11:57 +0000
commitb086b783c2106bb24ebce425f97dd86036ccbb13 (patch)
tree96fcdd2790d219548c466cd56b76c517969a35bb /ui/gtk/simple_dialog.c
parent65700bd2e0f57855866846e30ec5361434af8e3f (diff)
downloadwireshark-b086b783c2106bb24ebce425f97dd86036ccbb13.tar.gz
gtk: fix glib assert for dialogs without cancel
Dialogs with only "Save" and "Don't save" buttons do not have a default cancel action. Check for the existence of an OK button before registering one. This fixes three warnings when trying to trying to overwrite preferences with unknown keys. Change-Id: Ie583c40d3db8405d94b8d77710a7fb6556eac89d Reviewed-on: https://code.wireshark.org/review/1423 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/gtk/simple_dialog.c')
-rw-r--r--ui/gtk/simple_dialog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/gtk/simple_dialog.c b/ui/gtk/simple_dialog.c
index b47df24712..8498f312c2 100644
--- a/ui/gtk/simple_dialog.c
+++ b/ui/gtk/simple_dialog.c
@@ -259,7 +259,7 @@ display_simple_dialog(gint type, gint btn_mask, char *message)
if(!bt) {
if(yes_bt) {
window_set_cancel_button(win, yes_bt, simple_dialog_cancel_cb);
- } else {
+ } else if (ok_bt) {
window_set_cancel_button(win, ok_bt, simple_dialog_cancel_cb);
}
}