From d8459d8930911b45409371a58f75357a5d2cc986 Mon Sep 17 00:00:00 2001 From: Graham Bloice Date: Wed, 27 Jun 2018 19:28:49 +0100 Subject: packet export: Add default file extension Adds a default file extension when exporting packet dissection in various formats: text -> txt postscript -> ps csv -> csv pdml -> pdml psml -> psml c arrays -> c json -> json Change-Id: Ie5d942a3c694abd8edf9df184f6e219d4b870a1b Reviewed-on: https://code.wireshark.org/review/28490 Reviewed-by: Graham Bloice Petri-Dish: Graham Bloice Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- ui/qt/export_dissection_dialog.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ui/qt/export_dissection_dialog.cpp') diff --git a/ui/qt/export_dissection_dialog.cpp b/ui/qt/export_dissection_dialog.cpp index 3d09b38785..210858a7b1 100644 --- a/ui/qt/export_dissection_dialog.cpp +++ b/ui/qt/export_dissection_dialog.cpp @@ -33,6 +33,19 @@ #include #include "wireshark_application.h" +#if !defined(Q_OS_WIN) +static const QStringList export_extensions = QStringList() + << "" + << "txt" + << "" + << "csv" + << "psml" + << "pdml" + << "c" + << "json"; + +#endif + ExportDissectionDialog::ExportDissectionDialog(QWidget *parent, capture_file *cap_file, export_type_e export_type): QFileDialog(parent), export_type_(export_type), @@ -242,6 +255,7 @@ void ExportDissectionDialog::exportTypeChanged(QString name_filter) } checkValidity(); + setDefaultSuffix(export_extensions[export_type_]); } void ExportDissectionDialog::checkValidity() -- cgit v1.2.3