mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
Dropping mkv file on list view will now start subtitle import
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@257 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
7d95942fbb
commit
79315b999f
@ -396,7 +396,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
SubtitleListview1.SelectIndexAndEnsureVisible(_subtitle.GetIndex(paragraph));
|
||||
}
|
||||
|
||||
|
||||
private void VideoPositionChanged(object sender, EventArgs e)
|
||||
{
|
||||
TimeUpDown tud = (TimeUpDown)sender;
|
||||
@ -609,7 +608,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
toolStripButtonToogleWaveForm.ToolTipText = _language.Menu.ToolBar.ShowHideWaveForm;
|
||||
toolStripButtonToogleVideo.ToolTipText = _language.Menu.ToolBar.ShowHideVideo;
|
||||
|
||||
|
||||
toolStripMenuItemDelete.Text = _language.Menu.ContextMenu.Delete;
|
||||
insertLineToolStripMenuItem.Text = _language.Menu.ContextMenu.InsertFirstLine;
|
||||
toolStripMenuItemInsertBefore.Text = _language.Menu.ContextMenu.InsertBefore;
|
||||
@ -4543,6 +4541,35 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
var fi = new FileInfo(fileName);
|
||||
string ext = Path.GetExtension(fileName).ToLower();
|
||||
|
||||
if (ext == ".mkv")
|
||||
{
|
||||
bool isValid;
|
||||
var matroska = new Matroska();
|
||||
var subtitleList = matroska.GetMatroskaSubtitleTracks(fileName, out isValid);
|
||||
if (isValid)
|
||||
{
|
||||
if (subtitleList.Count == 0)
|
||||
{
|
||||
MessageBox.Show(_language.NoSubtitlesFound);
|
||||
}
|
||||
else if (subtitleList.Count > 1)
|
||||
{
|
||||
MatroskaSubtitleChooser subtitleChooser = new MatroskaSubtitleChooser();
|
||||
subtitleChooser.Initialize(subtitleList);
|
||||
if (subtitleChooser.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
LoadMatroskaSubtitle(subtitleList[subtitleChooser.SelectedIndex], fileName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadMatroskaSubtitle(subtitleList[0], fileName);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (fi.Length < 1024 * 1024 * 2) // max 2 mb
|
||||
{
|
||||
OpenSubtitle(fileName, null);
|
||||
|
Loading…
Reference in New Issue
Block a user