summaryrefslogtreecommitdiff
path: root/ui/qt
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-02-29 13:29:19 -0800
committerGuy Harris <guy@alum.mit.edu>2016-03-01 02:00:25 +0000
commitc0b29fcddd6eb9c7956ff63836a71a1d90169daa (patch)
tree458c0fc4056dcfac80054d019587272ddea84fcb /ui/qt
parentbe3af7c9643d502e4d2a9f2aa20ff2f3dc1fa75a (diff)
downloadwireshark-c0b29fcddd6eb9c7956ff63836a71a1d90169daa.tar.gz
Add a #define for the wildcard pattern that matches all files.
It's *.* on Windows, but just * on UN*X; add a header that provides the definition, and use it instead of hardwiring *.*. Call the entry "All Files", that being the conventional name, rather than "Any File", whilst we're at it. Change-Id: I7c29324fc5b41e93c150e1ec67f1529f171dc6a3 Reviewed-on: https://code.wireshark.org/review/14243 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/capture_file_dialog.cpp16
-rw-r--r--ui/qt/extcap_argument_file.cpp4
-rw-r--r--ui/qt/main_window_slots.cpp5
3 files changed, 13 insertions, 12 deletions
diff --git a/ui/qt/capture_file_dialog.cpp b/ui/qt/capture_file_dialog.cpp
index 6bf27fcd03..3b659557f8 100644
--- a/ui/qt/capture_file_dialog.cpp
+++ b/ui/qt/capture_file_dialog.cpp
@@ -36,6 +36,7 @@
#include "../../epan/prefs.h"
#include "../../wsutil/filesystem.h"
#include "../../wsutil/nstime.h"
+#include "ui/all_files_wildcard.h"
#include <wireshark_application.h>
@@ -344,11 +345,11 @@ QString CaptureFileDialog::fileType(int ft, bool extension_globs)
extensions_list = wtap_get_file_extensions_list(ft, TRUE);
if (extensions_list == NULL) {
/* This file type doesn't have any particular extension
- conventionally used for it, so we'll just use "*"
- as the pattern, as this is UN*X, where "*.*" only
- matches files that have an extension. (On Windows,
- it matches all files, but this isn't Windows.) */
- filter += "*";
+ conventionally used for it, so we'll just use a
+ wildcard that matches all file names - even those
+ with no extension, so we don't need to worry about
+ compressed file extensions. */
+ filter += ALL_FILES_WILDCARD;
} else {
GSList *extension;
/* Construct the list of patterns. */
@@ -388,10 +389,7 @@ QStringList CaptureFileDialog::buildFileOpenTypeList() {
* the filter will be a bit long, so it *really* shouldn't be shown.
* What about other platforms?
*/
- /*
- * Add the "All Files" entry. As per the above, we use *, not *.*.
- */
- filters << QString(tr("All Files (*)"));
+ filters << QString(tr("All Files (" ALL_FILES_WILDCARD ")"));
/*
* Add an "All Capture Files" entry, with all the extensions we
diff --git a/ui/qt/extcap_argument_file.cpp b/ui/qt/extcap_argument_file.cpp
index 3c99ae05cc..5e538036bb 100644
--- a/ui/qt/extcap_argument_file.cpp
+++ b/ui/qt/extcap_argument_file.cpp
@@ -38,6 +38,8 @@
#include <epan/prefs.h>
#include <color_utils.h>
+#include <ui/all_files_wildcard.h>
+
#include <extcap_parser.h>
ExtcapArgumentFileSelection::ExtcapArgumentFileSelection (extcap_arg * argument) :
@@ -107,7 +109,7 @@ void ExtcapArgumentFileSelection::openFileDialog()
if (QFileInfo(filename).exists())
workingDir = QFileInfo(filename).dir();
- QString fileExt(tr("Any File (*.*)"));
+ QString fileExt(tr("All Files (" ALL_FILES_WILDCARD ")"));
if ( _argument->fileextension != NULL )
{
QString givenExt = QString().fromUtf8(_argument->fileextension);
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 134fb8444d..66770d8b0b 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -70,6 +70,7 @@
#include "ui/recent_utils.h"
#include "ui/ssl_key_export.h"
#include "ui/ui_util.h"
+#include "ui/all_files_wildcard.h"
#include "ui/qt/simple_dialog.h"
#ifdef HAVE_SOFTWARE_UPDATE
@@ -1731,7 +1732,7 @@ void MainWindow::on_actionFileExportPacketBytes_triggered()
file_name = QFileDialog::getSaveFileName(this,
wsApp->windowTitleString(tr("Export Selected Packet Bytes")),
wsApp->lastOpenDir().canonicalPath(),
- tr("Raw data (*.bin *.dat *.raw);;Any File (*.*)")
+ tr("Raw data (*.bin *.dat *.raw);;All Files (" ALL_FILES_WILDCARD ")")
);
if (file_name.length() > 0) {
@@ -1806,7 +1807,7 @@ void MainWindow::on_actionFileExportSSLSessionKeys_triggered()
file_name = QFileDialog::getSaveFileName(this,
save_title,
wsApp->lastOpenDir().canonicalPath(),
- tr("SSL Session Keys (*.keys *.txt);;Any File (*.*)")
+ tr("SSL Session Keys (*.keys *.txt);;All Files (" ALL_FILES_WILDCARD ")")
);
if (file_name.length() > 0) {
gchar *keylist;