Open video file now also has an 'Audio files' filter (as well as 'All files')

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1940 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-07-17 20:28:33 +00:00
parent 156b51cdf7
commit a86710122a
12 changed files with 39 additions and 10 deletions

View File

@ -57,7 +57,7 @@ namespace Nikse.SubtitleEdit.Forms
{
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFileTitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(false);
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{

View File

@ -22,7 +22,7 @@ namespace Nikse.SubtitleEdit.Forms
{
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFileTitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(false);
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{

View File

@ -3633,7 +3633,7 @@ namespace Nikse.SubtitleEdit.Forms
{
openFileDialog1.Title = _language.OpenVideoFile;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(false);
if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
{
_videoFileName = openFileDialog1.FileName;
@ -12002,7 +12002,8 @@ namespace Nikse.SubtitleEdit.Forms
openFileDialog1.InitialDirectory = Path.GetDirectoryName(_fileName);
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFileTitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(true);
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
@ -13192,7 +13193,7 @@ namespace Nikse.SubtitleEdit.Forms
{
string fileName = files[0];
string ext = Path.GetExtension(fileName).ToLower();
if (Utilities.GetVideoFileFilter().Contains(ext))
if (Utilities.GetVideoFileFilter(true).Contains(ext))
{
OpenVideo(fileName);
}

View File

@ -102,7 +102,7 @@ namespace Nikse.SubtitleEdit.Forms
{
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFileTitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(false);
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{

View File

@ -149,7 +149,7 @@ namespace Nikse.SubtitleEdit.Forms
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFileTitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(true);
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{

View File

@ -250,7 +250,7 @@ namespace Nikse.SubtitleEdit.Forms
{
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFileTitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(false);
openFileDialog1.FileName = string.Empty;
if (string.IsNullOrEmpty(openFileDialog1.InitialDirectory) && !string.IsNullOrEmpty(_videoFileName))
{

View File

@ -483,7 +483,7 @@ namespace Nikse.SubtitleEdit.Forms
openFileDialog1.InitialDirectory = Path.GetDirectoryName(_subtitleFileName);
openFileDialog1.Title = _languageGeneral.OpenVideoFileTitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.Filter = Utilities.GetVideoFileFilter(true);
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{

View File

@ -113,6 +113,7 @@ namespace Nikse.SubtitleEdit.Logic
SubtitleFiles = "Subtitle files",
AllFiles = "All files",
VideoFiles = "Video files",
AudioFiles = "Audio files",
OpenSubtitle = "Open subtitle...",
OpenVideoFile = "Open video file...",
OpenVideoFileTitle = "Open video file...",

View File

@ -19,6 +19,7 @@
public string SubtitleFiles { get; set; }
public string AllFiles { get; set; }
public string VideoFiles { get; set; }
public string AudioFiles { get; set; }
public string OpenSubtitle { get; set; }
public string OpenVideoFile { get; set; }
public string OpenVideoFileTitle { get; set; }

View File

@ -160,7 +160,7 @@ namespace Nikse.SubtitleEdit.Logic
return new List<string> { ".avi", ".mkv", ".wmv", ".mpg", ".mpeg", ".divx", ".mp4", ".asf", ".flv", ".mov", ".m4v", ".vob", ".ogv", ".webm", ".ts", ".m2ts" };
}
public static string GetVideoFileFilter()
public static string GetVideoFileFilter(bool includeAudioFiles)
{
var sb = new StringBuilder();
sb.Append(Configuration.Settings.Language.General.VideoFiles + "|");
@ -172,6 +172,8 @@ namespace Nikse.SubtitleEdit.Logic
sb.Append("*" + extension);
i++;
}
if (includeAudioFiles && !string.IsNullOrEmpty(Configuration.Settings.Language.General.AudioFiles))
sb.Append("|" + Configuration.Settings.Language.General.AudioFiles + "|*.mp3;*.wav;*.wma;*.ogg;*.mpa;*.ape;*.aiff;*.flac;*.aac");
sb.Append("|" + Configuration.Settings.Language.General.AllFiles + "|*.*");
return sb.ToString();
}

View File

@ -83,6 +83,12 @@
<DownloadLink>http://numbertext.org/tmp/dict-en.oxt</DownloadLink>
<Description>All English dictionaries (AU, CA, GB, US, ZA)</Description>
</Dictionary>
<Dictionary>
<EnglishName>Farsi (Persian)</EnglishName>
<NativeName>Persian/Farsi</NativeName>
<DownloadLink>http://downloads.sourceforge.net/project/aoo-extensions/2359/1/dict-fa.oxt?r=http%3A%2F%2Fextensions.openoffice.org%2Fen%2Fproject%2Fpersian-spellchecker-dictionary&amp;ts=1374091518&amp;use_mirror=garr</DownloadLink>
<Description>Farsi</Description>
</Dictionary>
<Dictionary>
<EnglishName>French</EnglishName>
<NativeName>Français</NativeName>
@ -203,6 +209,18 @@
<DownloadLink>http://extensions.libreoffice.org/extension-center/lower-sorbian-dictionary/releases/1.4.6/lower_sorbian_spelling_dictionary-1.4.6.oxt</DownloadLink>
<Description>Lower Sorbian dictionary 1.4.6</Description>
</Dictionary>
<Dictionary>
<EnglishName>Malay</EnglishName>
<NativeName>Malay</NativeName>
<DownloadLink>http://ftp.sunet.se/pub/Office/OpenOffice.org/contrib/dictionaries/ms_MY.zip</DownloadLink>
<Description>Malay Spellchecker v0.1 - 07/10/04</Description>
</Dictionary>
<Dictionary>
<EnglishName>Macedonian</EnglishName>
<NativeName>Macedonian</NativeName>
<DownloadLink>http://ftp.sunet.se/pub/Office/OpenOffice.org/contrib/dictionaries/mk_MK.zip</DownloadLink>
<Description>Macedonian dictionary was created by Taras Bendik</Description>
</Dictionary>
<Dictionary>
<EnglishName>Norwegian</EnglishName>
<NativeName>Norsk</NativeName>
@ -221,6 +239,12 @@
<DownloadLink>http://extensions.libreoffice.org/extension-center/vero-verificador-ortografico-e-hifenizador-em-portugues-do-brasil/pscreleasefolder.2012-01-04.1563120832/2.1/vero_pt_br_v210aoc.oxt</DownloadLink>
<Description>VERO - VERificador Ortográfico e hifenizador em Português do Brasil 2.1</Description>
</Dictionary>
<Dictionary>
<EnglishName>Portuguese (Portugal)</EnglishName>
<NativeName>Português</NativeName>
<DownloadLink>http://ftp.sunet.se/pub/Office/OpenOffice.org/contrib/dictionaries/pt_PT.zip</DownloadLink>
<Description>Versão 20.5.2002</Description>
</Dictionary>
<Dictionary>
<EnglishName>Romanian</EnglishName>
<NativeName>română</NativeName>