summaryrefslogtreecommitdiff
path: root/ui/qt/decode_as_dialog.cpp
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-02-21 09:40:18 -0500
committerMichael Mann <mmann78@netscape.net>2016-02-21 18:25:01 +0000
commit14881e72d63d25048464155c5e8cc43a51731b16 (patch)
tree400db7f546ac16b9c41d9397d1bde87e59411c86 /ui/qt/decode_as_dialog.cpp
parent8889be17d0767c4f18f63f448e594f736305a560 (diff)
downloadwireshark-14881e72d63d25048464155c5e8cc43a51731b16.tar.gz
tshark: load decode_as_entries file
With Wireshark 2.0, some dissector preferences were removed in favor of 'Decode As' functionality. But the settings saved in the GUI are not loaded in tshark, preventing their use without an explicit call to '-d' option. Let's load decode_as_entries file by default and have it overridden by the '-d' option if required. Ping-Bug: 12124 Change-Id: I134a424cb6cf8fc89b7096a659ef1605314a70a2 Reviewed-on: https://code.wireshark.org/review/13956 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/decode_as_dialog.cpp')
-rw-r--r--ui/qt/decode_as_dialog.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/qt/decode_as_dialog.cpp b/ui/qt/decode_as_dialog.cpp
index 0ba94aa556..a50f90d71a 100644
--- a/ui/qt/decode_as_dialog.cpp
+++ b/ui/qt/decode_as_dialog.cpp
@@ -27,6 +27,7 @@
#include "epan/epan_dissect.h"
#include "ui/decode_as_utils.h"
+#include "ui/simple_dialog.h"
#include <wsutil/utf8_entities.h>
#include "qt_ui_utils.h"
@@ -640,8 +641,15 @@ void DecodeAsDialog::on_buttonBox_clicked(QAbstractButton *button)
applyChanges();
break;
case QDialogButtonBox::Save:
+ {
+ gchar* err = NULL;
+
applyChanges();
- save_decode_as_entries();
+ if (save_decode_as_entries(&err) < 0) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err);
+ g_free(err);
+ }
+ }
break;
case QDialogButtonBox::Help:
wsApp->helpTopicAction(HELP_DECODE_AS_SHOW_DIALOG);