improved error handling

This commit is contained in:
Frank Skare
2019-08-01 11:47:01 +02:00
parent d90025e8fe
commit 8626b8283f
10 changed files with 20 additions and 29 deletions

View File

@@ -1,13 +1,12 @@
### ### 5.1
- 'Tools > Execute mpv command' was removed, - 'Tools > Execute mpv command' was replaced with [mpv-repl](https://github.com/rossy/mpv-repl)
[mpv-repl](https://github.com/rossy/mpv-repl) is currently the best choice
- many [wiki pages](https://github.com/stax76/mpv.net/wiki) were improved - many [wiki pages](https://github.com/stax76/mpv.net/wiki) were improved
- the logo/icon had a very small cosmetic change - the logo/icon had a very small cosmetic change
- the help in the context menu was improved, - the help in the context menu was improved,
for quick access consider the command palette (F1 key) for quick access consider the command palette (F1 key)
- config options specific to mpv.net are now available from the command line - config options specific to mpv.net are now available from the command line
- the input editor no longer as known limitations, 'alt gr' and ctrl+alt are working now - the input editor no longer has known limitations, 'alt gr' and ctrl+alt are working now
- the help in the input editor was simplified and the filter logic was improved - the help in the input editor was simplified and the filter logic was improved
- fixed issue in file associations causing mpv.net not to appear in OS default apps - fixed issue in file associations causing mpv.net not to appear in OS default apps
- 'Tools > Manage File Associations' was replaced by 'Tools > OS Setup', - 'Tools > Manage File Associations' was replaced by 'Tools > OS Setup',
@@ -25,18 +24,14 @@
- it's now enforced that mpv properties on the command line and in - it's now enforced that mpv properties on the command line and in
the mpv.conf config file are lowercase, if not a error is shown the mpv.conf config file are lowercase, if not a error is shown
- gpu-api vulkan was not working if media files were opened via - gpu-api vulkan was not working if media files were opened via
command line (that included Explorer), Vulkan unlike d3d11 and opengl command line (that included Explorer)
requires a window being visible, this is now satisfied with a
workaround, it's only possible showing a window with default size
first as defines by autofit. Vulkan has few issues, usually the auto option
which uses d3d11 is better! Using Vulkan the mpv.net setting
- new setting minimum-aspect-ratio added, minimum aspect ratio for the window, - new setting minimum-aspect-ratio added, minimum aspect ratio for the window,
this was previously hard coded to 1.3 this was previously hard coded to 1.3
- new setting auto-load-folder added, for single files automatically load - new setting auto-load-folder added, for single files automatically load
the entire directory into the playlist, previously this was forced, the entire directory into the playlist, previously this was forced,
now it can be disabled now it can be disabled
- new setting themed-menu added, follow theme color in context menu, - new setting themed-menu added, follow theme color in context menu,
default: no, UI related settings have now a separate UI tab in the config editor default: no. UI related settings have now a separate UI tab in the config editor
### 5.0 ### 5.0

View File

@@ -29,8 +29,8 @@ namespace ScriptingExtension // the file name of extensions must end with 'Exten
scriptFiles.AddRange(Directory.GetFiles(mp.ConfigFolder + "scripts", "*.cs")); scriptFiles.AddRange(Directory.GetFiles(mp.ConfigFolder + "scripts", "*.cs"));
if (Directory.Exists(PathHelp.StartupPath + "scripts")) if (Directory.Exists(PathHelp.StartupPath + "scripts"))
foreach (string file in Directory.GetFiles(PathHelp.StartupPath + "scripts", "*.cs")) foreach (string path in Directory.GetFiles(PathHelp.StartupPath + "scripts", "*.cs"))
App.UnknownModule(file); scriptFiles.AddRange(Directory.GetFiles(PathHelp.StartupPath + "scripts", "*.cs"));
if (scriptFiles.Count == 0) return; if (scriptFiles.Count == 0) return;
CSScriptLibrary.CSScript.EvaluatorConfig.Engine = EvaluatorEngine.CodeDom; CSScriptLibrary.CSScript.EvaluatorConfig.Engine = EvaluatorEngine.CodeDom;

BIN
img/Avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -100,11 +100,6 @@ namespace mpvnet
} }
} }
public static void UnknownModule(string path)
{
Msg.ShowError("Failed to load script or extension", "Only scripts and extensions that ship with mpv.net are allowed in <startup>\\scripts or <startup>\\extensions.\n\nUser scripts or extensions have to use <config folder>\\scripts or <config folder>\\extensions.\n\nNever copy a new mpv.net version over a old mpv.net version.\n\nNever install a new mpv.net version on top of a old mpv.net version.\n\n" + path);
}
public static bool ProcessProperty(string name, string value) public static bool ProcessProperty(string name, string value)
{ {
switch (name) switch (name)

View File

@@ -16,7 +16,7 @@ namespace mpvnet
{ {
switch (id) switch (id)
{ {
case "manage-file-associations": ManageFileAssociations(); break; case "manage-file-associations": ManageFileAssociations(); break; // deprecated 2019
case "cycle-audio": CycleAudio(); break; case "cycle-audio": CycleAudio(); break;
case "load-audio": LoadAudio(); break; case "load-audio": LoadAudio(); break;
case "load-sub": LoadSubtitle(); break; case "load-sub": LoadSubtitle(); break;

View File

@@ -30,7 +30,7 @@ namespace mpvnet
if (knownExtensions.Contains(Path.GetFileName(path))) if (knownExtensions.Contains(Path.GetFileName(path)))
catalog.Catalogs.Add(new DirectoryCatalog(path, "*Extension.dll")); catalog.Catalogs.Add(new DirectoryCatalog(path, "*Extension.dll"));
else else
App.UnknownModule(path); Msg.ShowError("Failed to load extension", path + "\n\nOnly extensions that ship with mpv.net are allowed in <startup>\\extensions\n\nUser extensions have to use <config folder>\\extensions\n\nNever copy or install a new mpv.net version over a old mpv.net version.");
} }
} }

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.0.0.0")] [assembly: AssemblyVersion("5.1.0.0")]
[assembly: AssemblyFileVersion("5.0.0.0")] [assembly: AssemblyFileVersion("5.1.0.0")]

View File

@@ -150,6 +150,7 @@
F1 script-message mpv.net show-command-palette #menu: Tools > Show All Commands F1 script-message mpv.net show-command-palette #menu: Tools > Show All Commands
h script-message mpv.net show-history #menu: Tools > Show History h script-message mpv.net show-history #menu: Tools > Show History
Ctrl+r script-message-to repl type "" #menu: Tools > Show REPL
l ab-loop #menu: Tools > Set/clear A-B loop points l ab-loop #menu: Tools > Set/clear A-B loop points
L cycle-values loop-file "inf" "no" #menu: Tools > Toggle infinite file looping L cycle-values loop-file "inf" "no" #menu: Tools > Toggle infinite file looping
Ctrl+h cycle-values hwdec "auto" "no" #menu: Tools > Toggle Hardware Decoding Ctrl+h cycle-values hwdec "auto" "no" #menu: Tools > Toggle Hardware Decoding

View File

@@ -311,6 +311,9 @@ namespace mpvnet
{ {
if (WindowState != FormWindowState.Maximized || FormBorderStyle != FormBorderStyle.None) if (WindowState != FormWindowState.Maximized || FormBorderStyle != FormBorderStyle.None)
{ {
if (WindowState == FormWindowState.Maximized)
WindowState = FormWindowState.Minimized;
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
WindowState = FormWindowState.Maximized; WindowState = FormWindowState.Maximized;
} }

View File

@@ -235,15 +235,12 @@ namespace mpvnet
string[] startupScripts = Directory.GetFiles(PathHelp.StartupPath + "Scripts"); string[] startupScripts = Directory.GetFiles(PathHelp.StartupPath + "Scripts");
foreach (string path in startupScripts) foreach (string path in startupScripts)
if (path.EndsWith(".lua") || path.EndsWith(".js")) if ((path.EndsWith(".lua") || path.EndsWith(".js")) && KnownScripts.Contains(Path.GetFileName(path)))
if (KnownScripts.Contains(Path.GetFileName(path)))
commandv("load-script", $"{path}"); commandv("load-script", $"{path}");
else
App.UnknownModule(path);
} }
} }
public static string[] KnownScripts { get; } = { "osc-visibility.js", "show-playlist.js", "seek-show-position.py" }; public static string[] KnownScripts { get; } = { "osc-visibility.js", "show-playlist.js", "seek-show-position.py", "repl.lua" };
public static void LoadScripts() public static void LoadScripts()
{ {
@@ -259,7 +256,7 @@ namespace mpvnet
PowerShellScript.Init(path); PowerShellScript.Init(path);
} }
else else
App.UnknownModule(path); Msg.ShowError("Failed to load script", path + "\n\nOnly scripts that ship with mpv.net are allowed in <startup>\\scripts\n\nUser scripts have to use <config folder>\\scripts\n\nNever copy or install a new mpv.net version over a old mpv.net version.");
} }
} }