mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
Merge pull request #823 from ivandrofly/dir
Prevent directory drop with friendly msg
This commit is contained in:
commit
5cd24e650d
@ -1281,6 +1281,7 @@ Continue?</SubtitleAppendPrompt>
|
||||
<ErrorLoadBinaryZeroes>Sorry, this file contains only binary zeroes!
|
||||
|
||||
If you have edited this file with Subtitle Edit you might be alble to find a backup via the menu item File -> Restore auto-backup...</ErrorLoadBinaryZeroes>
|
||||
<ErrorDirectoryDropNotAllowed>Directory drop are not supported here.</ErrorDirectoryDropNotAllowed>
|
||||
<NoSupportEncryptedVobSub>Encrypted VobSub content is not supported.</NoSupportEncryptedVobSub>
|
||||
<NoSupportHereBluRaySup>Blu-ray sup files are not supported here.</NoSupportHereBluRaySup>
|
||||
<NoSupportHereDvdSup>DVD sup files are not supported here.</NoSupportHereDvdSup>
|
||||
|
@ -9612,7 +9612,15 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
openFileDialog1.InitialDirectory = dirName;
|
||||
|
||||
var fi = new FileInfo(fileName);
|
||||
string ext = Path.GetExtension(fileName).ToLower();
|
||||
|
||||
// Do not allow directory drop
|
||||
bool isDirectory = (File.GetAttributes(fi.FullName) & FileAttributes.Directory) == FileAttributes.Directory;
|
||||
if (isDirectory)
|
||||
{
|
||||
MessageBox.Show(_language.ErrorDirectoryDropNotAllowed, fi.Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
string ext = Path.GetExtension(fileName).ToLowerInvariant();
|
||||
|
||||
if (ext == ".mkv")
|
||||
{
|
||||
|
@ -1182,6 +1182,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
ErrorLoadSrr = "This file seems to be a ReScene .srr file - not a subtitle file.",
|
||||
ErrorLoadTorrent = "This file seems to be a BitTorrent file - not a subtitle file.",
|
||||
ErrorLoadBinaryZeroes = "Sorry, this file contains only binary zeroes!\r\n\r\nIf you have edited this file with Subtitle Edit you might be alble to find a backup via the menu item File -> Restore auto-backup...",
|
||||
ErrorDirectoryDropNotAllowed = "Directory drop are not supported here.",
|
||||
NoSupportEncryptedVobSub = "Encrypted VobSub content is not supported.",
|
||||
NoSupportHereBluRaySup = "Blu-ray sup files are not supported here.",
|
||||
NoSupportHereDvdSup = "DVD sup files are not supported here.",
|
||||
|
@ -2625,6 +2625,9 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
case "Main/ErrorLoadBinaryZeroes":
|
||||
language.Main.ErrorLoadBinaryZeroes = reader.Value;
|
||||
break;
|
||||
case "Main/ErrorDirectoryDropNotAllowed":
|
||||
language.Main.ErrorDirectoryDropNotAllowed = reader.Value;
|
||||
break;
|
||||
case "Main/NoSupportEncryptedVobSub":
|
||||
language.Main.NoSupportEncryptedVobSub = reader.Value;
|
||||
break;
|
||||
|
@ -1058,6 +1058,7 @@
|
||||
public string ErrorLoadSrr { get; set; }
|
||||
public string ErrorLoadTorrent { get; set; }
|
||||
public string ErrorLoadBinaryZeroes { get; set; }
|
||||
public string ErrorDirectoryDropNotAllowed { get; set; }
|
||||
public string NoSupportEncryptedVobSub { get; set; }
|
||||
public string NoSupportHereBluRaySup { get; set; }
|
||||
public string NoSupportHereDvdSup { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user