misc
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
- Command line parser fix using list options with `-add` suffix.
|
- Command line parser fix using list options with `-add` suffix.
|
||||||
|
|
||||||
|
|
||||||
# v7.0.0.4 Beta (2023-12-19)
|
# v7.0.0.4 Beta (2023-12-19)
|
||||||
|
|
||||||
- When mpv.net is started for the first time from a new startup location,
|
- When mpv.net is started for the first time from a new startup location,
|
||||||
|
|||||||
@@ -8,14 +8,10 @@ public class WinMpvHelp
|
|||||||
{
|
{
|
||||||
public static void Setup()
|
public static void Setup()
|
||||||
{
|
{
|
||||||
string dir = RegistryHelp.GetString("PathEnvVarCheck"); // backward compatibility
|
if (RegistryHelp.GetString("PathEnvVarCheck") == Folder.Startup ||
|
||||||
|
RegistryHelp.GetString("Setup") == Folder.Startup ||
|
||||||
|
App.Settings.StartupFolder == Folder.Startup)
|
||||||
|
|
||||||
if (dir == Folder.Startup)
|
|
||||||
return;
|
|
||||||
|
|
||||||
dir = RegistryHelp.GetString("Setup");
|
|
||||||
|
|
||||||
if (dir == Folder.Startup)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User)!;
|
string path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.User)!;
|
||||||
@@ -53,6 +49,6 @@ public class WinMpvHelp
|
|||||||
Msg.ShowInfo("If you want to register file associations later," + BR +
|
Msg.ShowInfo("If you want to register file associations later," + BR +
|
||||||
"you can do so with the context menu (Settings/Setup).");
|
"you can do so with the context menu (Settings/Setup).");
|
||||||
|
|
||||||
RegistryHelp.SetString("Setup", Folder.Startup);
|
App.Settings.StartupFolder = Folder.Startup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -754,7 +754,7 @@ url = https://mpv.io/manual/master/#options-input-ipc-server
|
|||||||
name = language
|
name = language
|
||||||
file = mpvnet
|
file = mpvnet
|
||||||
default = system
|
default = system
|
||||||
directory = UI
|
directory = Appearance
|
||||||
help = User interface display language.\nmpv.net must be restarted after a change.\nInterested joining our translation team?:
|
help = User interface display language.\nmpv.net must be restarted after a change.\nInterested joining our translation team?:
|
||||||
url = https://app.transifex.com/stax76/teams/
|
url = https://app.transifex.com/stax76/teams/
|
||||||
option = system
|
option = system
|
||||||
@@ -765,7 +765,7 @@ option = german
|
|||||||
name = dark-mode
|
name = dark-mode
|
||||||
file = mpvnet
|
file = mpvnet
|
||||||
default = always
|
default = always
|
||||||
directory = UI
|
directory = Appearance
|
||||||
help = Changes between a light and dark theme.\nmpv.net must be restarted after a change.\nmpv.net specific option.
|
help = Changes between a light and dark theme.\nmpv.net must be restarted after a change.\nmpv.net specific option.
|
||||||
option = always
|
option = always
|
||||||
option = system Available on Windows 10 or higher
|
option = system Available on Windows 10 or higher
|
||||||
@@ -773,13 +773,13 @@ option = never
|
|||||||
|
|
||||||
name = dark-theme
|
name = dark-theme
|
||||||
file = mpvnet
|
file = mpvnet
|
||||||
directory = UI
|
directory = Appearance
|
||||||
url = https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md#color-theme
|
url = https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md#color-theme
|
||||||
help = Color theme used in dark mode.\nmpv.net must be restarted after a change.\nmpv.net specific option. Default: dark
|
help = Color theme used in dark mode.\nmpv.net must be restarted after a change.\nmpv.net specific option. Default: dark
|
||||||
|
|
||||||
name = light-theme
|
name = light-theme
|
||||||
file = mpvnet
|
file = mpvnet
|
||||||
directory = UI
|
directory = Appearance
|
||||||
url = https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md#color-theme
|
url = https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md#color-theme
|
||||||
help = Color theme used in light mode.\nmpv.net must be restarted after a change.\nmpv.net specific option. Default: light
|
help = Color theme used in light mode.\nmpv.net must be restarted after a change.\nmpv.net specific option. Default: light
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
|||||||
{
|
{
|
||||||
List<Setting> Settings = Conf.LoadConf(Properties.Resources.editor_conf.TrimEnd());
|
List<Setting> Settings = Conf.LoadConf(Properties.Resources.editor_conf.TrimEnd());
|
||||||
List<ConfItem> ConfItems = new List<ConfItem>();
|
List<ConfItem> ConfItems = new List<ConfItem>();
|
||||||
public ObservableCollection<string> FilterStrings { get; } = new();
|
|
||||||
string InitialContent;
|
string InitialContent;
|
||||||
string ThemeConf = GetThemeConf();
|
string ThemeConf = GetThemeConf();
|
||||||
string? _searchText;
|
string? _searchText;
|
||||||
List<NodeViewModel>? _nodes;
|
List<NodeViewModel>? _nodes;
|
||||||
|
bool _shown;
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
|
|
||||||
public ConfWindow()
|
public ConfWindow()
|
||||||
@@ -51,6 +51,8 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
|||||||
node.IsExpanded = true;
|
node.IsExpanded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<string> FilterStrings { get; } = new();
|
||||||
|
|
||||||
public Theme? Theme => Theme.Current;
|
public Theme? Theme => Theme.Current;
|
||||||
|
|
||||||
public string SearchText
|
public string SearchText
|
||||||
@@ -162,64 +164,6 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
|||||||
|
|
||||||
static string GetThemeConf() => Theme.DarkMode + App.DarkTheme + App.LightTheme;
|
static string GetThemeConf() => Theme.DarkMode + App.DarkTheme + App.LightTheme;
|
||||||
|
|
||||||
protected override void OnClosed(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnClosed(e);
|
|
||||||
App.Settings.ConfigEditorSearch = SearchText;
|
|
||||||
|
|
||||||
if (InitialContent == GetCompareString())
|
|
||||||
return;
|
|
||||||
|
|
||||||
foreach (Setting setting in Settings)
|
|
||||||
{
|
|
||||||
if (setting.Name == "libplacebo-opts")
|
|
||||||
{
|
|
||||||
setting.Value = GetKeyValueContent("libplacebo");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
File.WriteAllText(Player.ConfPath, GetContent("mpv"));
|
|
||||||
File.WriteAllText(App.ConfPath, GetContent("mpvnet"));
|
|
||||||
|
|
||||||
foreach (Setting it in Settings)
|
|
||||||
{
|
|
||||||
if (it.Value != it.StartValue)
|
|
||||||
{
|
|
||||||
if (it.File == "mpv")
|
|
||||||
{
|
|
||||||
Player.ProcessProperty(it.Name, it.Value);
|
|
||||||
Player.SetPropertyString(it.Name!, it.Value!);
|
|
||||||
}
|
|
||||||
else if (it.File == "mpvnet")
|
|
||||||
App.ProcessProperty(it.Name ?? "", it.Value ?? "", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Theme.Init();
|
|
||||||
Theme.UpdateWpfColors();
|
|
||||||
|
|
||||||
if (ThemeConf != GetThemeConf())
|
|
||||||
MessageBox.Show("Changed theme settings require mpv.net being restarted.", "Info");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool _shown;
|
|
||||||
|
|
||||||
protected override void OnContentRendered(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnContentRendered(e);
|
|
||||||
|
|
||||||
if (_shown)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_shown = true;
|
|
||||||
|
|
||||||
Application.Current.Dispatcher.BeginInvoke(() => {
|
|
||||||
SearchControl.SearchTextBox.SelectAll();
|
|
||||||
},
|
|
||||||
DispatcherPriority.Background);
|
|
||||||
}
|
|
||||||
|
|
||||||
string GetCompareString() => string.Join("", Settings.Select(item => item.Name + item.Value).ToArray());
|
string GetCompareString() => string.Join("", Settings.Select(item => item.Name + item.Value).ToArray());
|
||||||
|
|
||||||
void LoadConf(string file)
|
void LoadConf(string file)
|
||||||
@@ -466,6 +410,47 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
|||||||
i.Update();
|
i.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnClosed(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnClosed(e);
|
||||||
|
App.Settings.ConfigEditorSearch = SearchText;
|
||||||
|
|
||||||
|
if (InitialContent == GetCompareString())
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (Setting setting in Settings)
|
||||||
|
{
|
||||||
|
if (setting.Name == "libplacebo-opts")
|
||||||
|
{
|
||||||
|
setting.Value = GetKeyValueContent("libplacebo");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
File.WriteAllText(Player.ConfPath, GetContent("mpv"));
|
||||||
|
File.WriteAllText(App.ConfPath, GetContent("mpvnet"));
|
||||||
|
|
||||||
|
foreach (Setting it in Settings)
|
||||||
|
{
|
||||||
|
if (it.Value != it.StartValue)
|
||||||
|
{
|
||||||
|
if (it.File == "mpv")
|
||||||
|
{
|
||||||
|
Player.ProcessProperty(it.Name, it.Value);
|
||||||
|
Player.SetPropertyString(it.Name!, it.Value!);
|
||||||
|
}
|
||||||
|
else if (it.File == "mpvnet")
|
||||||
|
App.ProcessProperty(it.Name ?? "", it.Value ?? "", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Theme.Init();
|
||||||
|
Theme.UpdateWpfColors();
|
||||||
|
|
||||||
|
if (ThemeConf != GetThemeConf())
|
||||||
|
MessageBox.Show("Changed theme settings require mpv.net being restarted.", "Info");
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnKeyDown(KeyEventArgs e)
|
protected override void OnKeyDown(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnKeyDown(e);
|
base.OnKeyDown(e);
|
||||||
@@ -480,9 +465,22 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnPropertyChanged([CallerMemberName] string? name = null)
|
protected void OnPropertyChanged([CallerMemberName] string? name = null) =>
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||||
|
|
||||||
|
protected override void OnContentRendered(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnContentRendered(e);
|
||||||
|
|
||||||
|
if (_shown)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_shown = true;
|
||||||
|
|
||||||
|
Application.Current.Dispatcher.BeginInvoke(() => {
|
||||||
|
SearchControl.SearchTextBox.SelectAll();
|
||||||
|
},
|
||||||
|
DispatcherPriority.Background);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ public partial class MainForm : Form
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
if (Environment.OSVersion.Version >= new Version(10, 0, 18985) && Theme.DarkMode)
|
UpdateDarkMode();
|
||||||
DwmSetWindowAttribute(Handle, 20, new[] { 1 }, 4); // DWMWA_USE_IMMERSIVE_DARK_MODE = 20
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -125,6 +124,12 @@ public partial class MainForm : Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateDarkMode()
|
||||||
|
{
|
||||||
|
if (Environment.OSVersion.Version >= new Version(10, 0, 18985))
|
||||||
|
DwmSetWindowAttribute(Handle, 20, new[] { Theme.DarkMode ? 1 : 0 }, 4); // DWMWA_USE_IMMERSIVE_DARK_MODE = 20
|
||||||
|
}
|
||||||
|
|
||||||
void Player_ClientMessage(string[] args)
|
void Player_ClientMessage(string[] args)
|
||||||
{
|
{
|
||||||
if (Command.Current.Commands.ContainsKey(args[0]))
|
if (Command.Current.Commands.ContainsKey(args[0]))
|
||||||
@@ -1007,6 +1012,9 @@ public partial class MainForm : Form
|
|||||||
m.Result = SendMessage(MpvWindowHandle, m.Msg, m.WParam, m.LParam);
|
m.Result = SendMessage(MpvWindowHandle, m.Msg, m.WParam, m.LParam);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 0x001A: // WM_SETTINGCHANGE
|
||||||
|
UpdateDarkMode();
|
||||||
|
break;
|
||||||
case 0x51: // WM_INPUTLANGCHANGE
|
case 0x51: // WM_INPUTLANGCHANGE
|
||||||
ActivateKeyboardLayout(m.LParam, 0x00000100u /*KLF_SETFORPROCESS*/);
|
ActivateKeyboardLayout(m.LParam, 0x00000100u /*KLF_SETFORPROCESS*/);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ public class MainPlayer : MpvClient
|
|||||||
{
|
{
|
||||||
string name = pair.Name[..^4];
|
string name = pair.Name[..^4];
|
||||||
string separator = name.Contains("-file") || name.Contains("-path") ? ";" : ",";
|
string separator = name.Contains("-file") || name.Contains("-path") ? ";" : ",";
|
||||||
SetPropertyString(name, (GetPropertyString(name) + separator + pair.Value).TrimStart(','));
|
SetPropertyString(name, (GetPropertyString(name) + separator + pair.Value).TrimStart(',', ';'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public class AppSettings
|
|||||||
public Size WindowSize;
|
public Size WindowSize;
|
||||||
public string ConfigEditorSearch = "Video:";
|
public string ConfigEditorSearch = "Video:";
|
||||||
public string Mute = "no";
|
public string Mute = "no";
|
||||||
|
public string StartupFolder = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
class SettingsManager
|
class SettingsManager
|
||||||
|
|||||||
Reference in New Issue
Block a user