fix #639
This commit is contained in:
@@ -385,8 +385,10 @@ public partial class MainForm : Form
|
|||||||
foreach (string path in App.Settings.RecentFiles)
|
foreach (string path in App.Settings.RecentFiles)
|
||||||
{
|
{
|
||||||
var file = AppClass.GetTitleAndPath(path);
|
var file = AppClass.GetTitleAndPath(path);
|
||||||
var menuItem = MenuHelp.Add(recentMenuItem.Items, file.Title.ShortPath(100))!;
|
var menuItem = MenuHelp.Add(recentMenuItem.Items, file.Title.ShortPath(100));
|
||||||
menuItem.Click += (sender, args) => Player.LoadFiles(new[] { file.Path }, true, false);
|
|
||||||
|
if (menuItem != null)
|
||||||
|
menuItem.Click += (sender, args) => Player.LoadFiles(new[] { file.Path }, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
recentMenuItem.Items.Add(new WpfControls.Separator());
|
recentMenuItem.Items.Add(new WpfControls.Separator());
|
||||||
@@ -416,9 +418,13 @@ public partial class MainForm : Form
|
|||||||
{
|
{
|
||||||
if (item.Length != TimeSpan.Zero)
|
if (item.Length != TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
var menuItem = MenuHelp.Add(titlesMenuItem.Items, $"Title {item.Index + 1}")!;
|
var menuItem = MenuHelp.Add(titlesMenuItem.Items, $"Title {item.Index + 1}");
|
||||||
menuItem.InputGestureText = item.Length.ToString();
|
|
||||||
menuItem.Click += (sender, args) => Player.SetBluRayTitle(item.Index);
|
if (menuItem != null)
|
||||||
|
{
|
||||||
|
menuItem.InputGestureText = item.Length.ToString();
|
||||||
|
menuItem.Click += (sender, args) => Player.SetBluRayTitle(item.Index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -432,13 +438,16 @@ public partial class MainForm : Form
|
|||||||
{
|
{
|
||||||
if (!profile.StartsWith("extension."))
|
if (!profile.StartsWith("extension."))
|
||||||
{
|
{
|
||||||
var menuItem = MenuHelp.Add(profilesMenuItem.Items, profile)!;
|
var menuItem = MenuHelp.Add(profilesMenuItem.Items, profile);
|
||||||
|
|
||||||
menuItem.Click += (sender, args) =>
|
if (menuItem != null)
|
||||||
{
|
{
|
||||||
Player.CommandV("show-text", profile);
|
menuItem.Click += (sender, args) =>
|
||||||
Player.CommandV("apply-profile", profile);
|
{
|
||||||
};
|
Player.CommandV("show-text", profile);
|
||||||
|
Player.CommandV("apply-profile", profile);
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,15 +460,19 @@ public partial class MainForm : Form
|
|||||||
|
|
||||||
foreach (var pair in Player.AudioDevices)
|
foreach (var pair in Player.AudioDevices)
|
||||||
{
|
{
|
||||||
var menuItem = MenuHelp.Add(audioDevicesMenuItem.Items, pair.Value)!;
|
var menuItem = MenuHelp.Add(audioDevicesMenuItem.Items, pair.Value);
|
||||||
menuItem.IsChecked = pair.Name == Player.GetPropertyString("audio-device");
|
|
||||||
|
|
||||||
menuItem.Click += (sender, args) =>
|
if (menuItem != null)
|
||||||
{
|
{
|
||||||
Player.SetPropertyString("audio-device", pair.Name);
|
menuItem.IsChecked = pair.Name == Player.GetPropertyString("audio-device");
|
||||||
Player.CommandV("show-text", pair.Value);
|
|
||||||
App.Settings.AudioDevice = pair.Name;
|
menuItem.Click += (sender, args) =>
|
||||||
};
|
{
|
||||||
|
Player.SetPropertyString("audio-device", pair.Name);
|
||||||
|
Player.CommandV("show-text", pair.Value);
|
||||||
|
App.Settings.AudioDevice = pair.Name;
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,9 +486,13 @@ public partial class MainForm : Form
|
|||||||
{
|
{
|
||||||
foreach (Binding binding in customBindings)
|
foreach (Binding binding in customBindings)
|
||||||
{
|
{
|
||||||
var menuItem = MenuHelp.Add(customMenuItem.Items, binding.Comment)!;
|
var menuItem = MenuHelp.Add(customMenuItem.Items, binding.Comment);
|
||||||
menuItem.Click += (sender, args) => Player.Command(binding.Command);
|
|
||||||
menuItem.InputGestureText = binding.Input;
|
if (menuItem != null)
|
||||||
|
{
|
||||||
|
menuItem.Click += (sender, args) => Player.Command(binding.Command);
|
||||||
|
menuItem.InputGestureText = binding.Input;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -889,7 +906,7 @@ public partial class MainForm : Form
|
|||||||
path = path + "|" + title;
|
path = path + "|" + title;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(path) && path != @"bd://" && path != @"dvd://")
|
if (!string.IsNullOrEmpty(path) && path != "-" && path != @"bd://" && path != @"dvd://")
|
||||||
{
|
{
|
||||||
if (App.Settings.RecentFiles.Contains(path))
|
if (App.Settings.RecentFiles.Contains(path))
|
||||||
App.Settings.RecentFiles.Remove(path);
|
App.Settings.RecentFiles.Remove(path);
|
||||||
|
|||||||
Reference in New Issue
Block a user