From d1f2633f478b3d1ec153ae324d8a70b30bde6092 Mon Sep 17 00:00:00 2001 From: Christopher Oezbek Date: Tue, 13 May 2025 15:15:47 +0200 Subject: [PATCH] Label Import select all supported formats rather than just txt. (cherry picked from commit c0689cca8d66722a03bfed25c12d028381f90c0d) --- libraries/lib-label-track/LabelTrack.cpp | 1 + libraries/lib-label-track/LabelTrack.h | 1 + src/LabelDialog.cpp | 4 ++-- src/menus/FileMenus.cpp | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/lib-label-track/LabelTrack.cpp b/libraries/lib-label-track/LabelTrack.cpp index 48e513104..123a1511d 100644 --- a/libraries/lib-label-track/LabelTrack.cpp +++ b/libraries/lib-label-track/LabelTrack.cpp @@ -47,6 +47,7 @@ for drawing different aspects of the label and its text box. const FileNames::FileType LabelTrack::SubripFiles{ XO("SubRip text file"), { wxT("srt") }, true }; const FileNames::FileType LabelTrack::WebVTTFiles{ XO("WebVTT file"), { wxT("vtt") }, true }; +const FileNames::FileType LabelTrack::AllSupportedFiles{ XO("Supported label file"), { wxT("srt"), wxT("txt") }, true }; EnumSetting LabelStyleSetting { wxT("/FileFormats/LabelStyleChoice"), diff --git a/libraries/lib-label-track/LabelTrack.h b/libraries/lib-label-track/LabelTrack.h index 55f914f28..dcd079616 100644 --- a/libraries/lib-label-track/LabelTrack.h +++ b/libraries/lib-label-track/LabelTrack.h @@ -130,6 +130,7 @@ class LABEL_TRACK_API LabelTrack final static const FileNames::FileType SubripFiles; static const FileNames::FileType WebVTTFiles; + static const FileNames::FileType AllSupportedFiles; private: Track::Holder Clone(bool backup) const override; diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 438878b48..bec0dba2b 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -632,8 +632,8 @@ void LabelDialog::OnImport(wxCommandEvent & WXUNUSED(event)) XO("Select a text file containing labels"), wxEmptyString, // Path wxT(""), // Name - wxT("txt"), // Extension - { FileNames::TextFiles, LabelTrack::SubripFiles, FileNames::AllFiles }, + wxT(""), // Extension + { LabelTrack::AllSupportedFiles, FileNames::TextFiles, LabelTrack::SubripFiles, FileNames::AllFiles }, wxRESIZE_BORDER, // Flags this); // Parent diff --git a/src/menus/FileMenus.cpp b/src/menus/FileMenus.cpp index b1d1e3592..79527edfa 100644 --- a/src/menus/FileMenus.cpp +++ b/src/menus/FileMenus.cpp @@ -385,8 +385,8 @@ void OnImportLabels(const CommandContext &context) XO("Select a text file containing labels"), wxEmptyString, // Path wxT(""), // Name - wxT("txt"), // Extension - { FileNames::TextFiles, LabelTrack::SubripFiles, FileNames::AllFiles }, + wxT(""), // Extension + { LabelTrack::AllSupportedFiles, FileNames::TextFiles, LabelTrack::SubripFiles, FileNames::AllFiles }, wxRESIZE_BORDER, // Flags &window); // Parent