Skip to content

Commit

Permalink
Use * instead of *.* as 'any file' wildcard
Browse files Browse the repository at this point in the history
On linux (and probably macos), *.* will only show files with an extension, where we want it to actually show all files, extension or no

Fixes #1665
  • Loading branch information
sirjuddington committed Dec 24, 2024
1 parent cf97476 commit 8e0ff3a
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Archive/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ string Archive::fileExtensionString() const
}

// No extension (probably unknown type)
return "Any File|*.*";
return "Any File|*";
}

// -----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/MainEditor/EntryOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ bool entryoperations::exportEntry(ArchiveEntry* entry)
if (filedialog::saveFile(
info,
"Export Entry \"" + entry->name() + "\"",
"Any File (*.*)|*.*",
"Any File (*.*)|*",
maineditor::windowWx(),
fn.GetFullName().ToStdString()))
entry->exportFile(info.filenames[0]); // Export entry if ok was clicked
Expand All @@ -234,7 +234,7 @@ bool entryoperations::exportEntries(const vector<ArchiveEntry*>& entries, const
// Run save files dialog
filedialog::FDInfo info;
if (filedialog::saveFiles(
info, "Export Multiple Entries (Filename is ignored)", "Any File (*.*)|*.*", maineditor::windowWx()))
info, "Export Multiple Entries (Filename is ignored)", "Any File (*.*)|*", maineditor::windowWx()))
{
// Go through the selected entries
for (auto& entry : entries)
Expand Down
2 changes: 1 addition & 1 deletion src/MainEditor/UI/ArchiveManagerPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ bool ArchiveManagerPanel::handleAction(string_view id)
{
// Create extensions string
wxString extensions = app::archiveManager().getArchiveExtensionsString();
extensions += "|All Files (*.*)|*.*";
extensions += "|All Files (*.*)|*";

// Open a file browser dialog that allows multiple selection
// and filters by wad, zip and pk3 file extensions
Expand Down
4 changes: 2 additions & 2 deletions src/MainEditor/UI/ArchivePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ bool ArchivePanel::importFiles()

// Run open files dialog
filedialog::FDInfo info;
if (filedialog::openFiles(info, "Choose files to import", "Any File (*.*)|*.*", this))
if (filedialog::openFiles(info, "Choose files to import", "Any File (*.*)|*", this))
{
// Get the entry index of the last selected list item
auto dir = entry_tree_->currentSelectedDir();
Expand Down Expand Up @@ -1753,7 +1753,7 @@ bool ArchivePanel::importEntry()
{
// Run open file dialog
filedialog::FDInfo info;
if (filedialog::openFile(info, "Import Entry \"" + entry->name() + "\"", "Any File (*.*)|*.*", this))
if (filedialog::openFile(info, "Import Entry \"" + entry->name() + "\"", "Any File (*.*)|*", this))
{
// Preserve gfx offset if needed
Vec2i offset;
Expand Down
2 changes: 1 addition & 1 deletion src/MainEditor/UI/TextureXEditor/PatchTablePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void PatchTablePanel::addPatchFromFile()
auto etypes = EntryType::allTypes();

// Go through types
wxString ext_filter = "All files (*.*)|*.*|";
wxString ext_filter = "All files (*.*)|*|";
for (auto& etype : etypes)
{
// If the type is a valid image type, add its extension filter
Expand Down
2 changes: 1 addition & 1 deletion src/MainEditor/UI/TextureXEditor/TextureXPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ void TextureXPanel::newTextureFromFile()
auto etypes = EntryType::allTypes();

// Go through types
wxString ext_filter = "All files (*.*)|*.*|";
wxString ext_filter = "All files (*.*)|*|";
for (auto& etype : etypes)
{
// If the type is a valid image type, add its extension filter
Expand Down
2 changes: 1 addition & 1 deletion src/UI/Controls/FileLocationPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FileLocationPanel : public wxPanel
const wxString& path,
bool editable = true,
const wxString& browse_caption = "Browse File",
const wxString& browse_extensions = "All Files|*.*",
const wxString& browse_extensions = "All Files|*",
const wxString& browse_default_filename = "");

wxString location() const;
Expand Down
4 changes: 2 additions & 2 deletions src/UI/Dialogs/Preferences/NodesPrefsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ void NodesPrefsPanel::onBtnBrowse(wxCommandEvent& e)

// Setup extension
#ifdef __WXMSW__
auto ext = fmt::format("{}.exe|{}.exe|All Files (*.*)|*.*", builder.exe, builder.exe);
auto ext = fmt::format("{}.exe|{}.exe|All Files (*.*)|*", builder.exe, builder.exe);
#else
auto ext = fmt::format("{}|{}|All Files (*.*)|*.*", builder.exe, builder.exe);
auto ext = fmt::format("{}|{}|All Files (*.*)|*", builder.exe, builder.exe);
#endif

// Browse for exe
Expand Down
2 changes: 1 addition & 1 deletion src/Utility/SFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ string filedialog::executableExtensionString()
if (app::platform() == app::Platform::Windows)
return "Executable Files (*.exe)|*.exe";
else
return "Executable Files|*.*";
return "Executable Files|*";
}

// -----------------------------------------------------------------------------
Expand Down

0 comments on commit 8e0ff3a

Please sign in to comment.