5.4.9.5 Beta
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
|
|
||||||
5.4.9.5 Beta (2021-??-??)
|
5.4.9.6 Beta (2021-??-??)
|
||||||
|
|
||||||
|
5.4.9.5 Beta (2021-08-25)
|
||||||
|
|
||||||
- Message boxes are themed.
|
- Message boxes are themed.
|
||||||
|
|
||||||
|
|||||||
@@ -150,32 +150,26 @@ namespace mpvnet
|
|||||||
|
|
||||||
public static void InvokeOnMainThread(Action action) => MainForm.Instance.BeginInvoke(action);
|
public static void InvokeOnMainThread(Action action) => MainForm.Instance.BeginInvoke(action);
|
||||||
|
|
||||||
public static void ShowInfo(string title, string msg = null)
|
public static void ShowInfo(string msg)
|
||||||
{
|
{
|
||||||
if (IsTerminalAttached)
|
if (IsTerminalAttached)
|
||||||
{
|
{
|
||||||
if (title != null)
|
|
||||||
Terminal.Write(title);
|
|
||||||
|
|
||||||
if (msg != null)
|
if (msg != null)
|
||||||
Terminal.Write(msg);
|
Terminal.Write(msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
InvokeOnMainThread(() => Msg.ShowInfo(title, msg));
|
InvokeOnMainThread(() => Msg.ShowInfo(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowError(string title, string msg = null)
|
public static void ShowError(string msg)
|
||||||
{
|
{
|
||||||
if (IsTerminalAttached)
|
if (IsTerminalAttached)
|
||||||
{
|
{
|
||||||
if (title != null)
|
|
||||||
Terminal.WriteError(title);
|
|
||||||
|
|
||||||
if (msg != null)
|
if (msg != null)
|
||||||
Terminal.WriteError(msg);
|
Terminal.WriteError(msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
InvokeOnMainThread(() => Msg.ShowError(title, msg));
|
InvokeOnMainThread(() => Msg.ShowError(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Core_Initialized()
|
static void Core_Initialized()
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace mpvnet
|
|||||||
ProcessHelp.ShellExecute(Core.ConfigFolder + "history.txt");
|
ProcessHelp.ShellExecute(Core.ConfigFolder + "history.txt");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Msg.ShowQuestion("Create history.txt file in config folder?",
|
if (Msg.ShowQuestion("Create history.txt file in config folder?" + BR2 +
|
||||||
"mpv.net will write the date, time and filename of opened files to it.") == MessageBoxResult.OK)
|
"mpv.net will write the date, time and filename of opened files to it.") == MessageBoxResult.OK)
|
||||||
|
|
||||||
File.WriteAllText(Core.ConfigFolder + "history.txt", "");
|
File.WriteAllText(Core.ConfigFolder + "history.txt", "");
|
||||||
@@ -220,7 +220,7 @@ namespace mpvnet
|
|||||||
if (string.IsNullOrEmpty(clipboard) || (!clipboard.Contains("://") && !File.Exists(clipboard)) ||
|
if (string.IsNullOrEmpty(clipboard) || (!clipboard.Contains("://") && !File.Exists(clipboard)) ||
|
||||||
clipboard.Contains("\n"))
|
clipboard.Contains("\n"))
|
||||||
{
|
{
|
||||||
App.ShowError("No URL found", "The clipboard does not contain a valid URL or file.");
|
App.ShowError("No URL found, the clipboard does not contain a valid URL or file.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,7 +432,7 @@ namespace mpvnet
|
|||||||
if (propValue.ContainsEx("${"))
|
if (propValue.ContainsEx("${"))
|
||||||
propValue += BR2 + Core.Expand(propValue);
|
propValue += BR2 + Core.Expand(propValue);
|
||||||
|
|
||||||
App.ShowInfo(prop + ": " +propValue);
|
App.ShowInfo(prop + ": " + propValue);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1163,7 +1163,7 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
System.Windows.MessageBoxResult result =
|
System.Windows.MessageBoxResult result =
|
||||||
Msg.ShowQuestion("Click Yes for Blu-ray and No for DVD.",
|
Msg.ShowQuestion("Click Yes for Blu-ray and No for DVD.",
|
||||||
null, System.Windows.MessageBoxButton.YesNoCancel);
|
System.Windows.MessageBoxButton.YesNoCancel);
|
||||||
|
|
||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using WpfControls = System.Windows.Controls;
|
|||||||
|
|
||||||
using static mpvnet.Native;
|
using static mpvnet.Native;
|
||||||
using static mpvnet.Global;
|
using static mpvnet.Global;
|
||||||
|
using MsgBoxEx;
|
||||||
|
|
||||||
namespace mpvnet
|
namespace mpvnet
|
||||||
{
|
{
|
||||||
@@ -1000,6 +1001,9 @@ namespace mpvnet
|
|||||||
|
|
||||||
WPF.Init();
|
WPF.Init();
|
||||||
App.UpdateWpfColors();
|
App.UpdateWpfColors();
|
||||||
|
MessageBoxEx.MessageForeground = Theme.Current.GetBrush("heading");
|
||||||
|
MessageBoxEx.MessageBackground = Theme.Current.GetBrush("background");
|
||||||
|
MessageBoxEx.ButtonBackground = Theme.Current.GetBrush("highlight");
|
||||||
ContextMenu = new WpfControls.ContextMenu();
|
ContextMenu = new WpfControls.ContextMenu();
|
||||||
ContextMenu.Closed += ContextMenu_Closed;
|
ContextMenu.Closed += ContextMenu_Closed;
|
||||||
BuildMenu();
|
BuildMenu();
|
||||||
|
|||||||
@@ -12,39 +12,40 @@ public class Msg
|
|||||||
{
|
{
|
||||||
private static readonly string WindowTitle = WinForms.Application.ProductName;
|
private static readonly string WindowTitle = WinForms.Application.ProductName;
|
||||||
|
|
||||||
public static void ShowInfo(object title, object content = null)
|
public static void ShowInfo(object title)
|
||||||
{
|
{
|
||||||
Show(title, content, MessageBoxImage.Information);
|
Show(title, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowError(object title, object content = null)
|
public static void ShowError(object title)
|
||||||
{
|
{
|
||||||
Show(title, content, MessageBoxImage.Error);
|
Show(title, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowWarning(object title, object content = null)
|
public static void ShowWarning(object title)
|
||||||
{
|
{
|
||||||
Show(title, content, MessageBoxImage.Warning);
|
Show(title, MessageBoxImage.Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageBoxResult ShowQuestion(object title, object content = null,
|
public static MessageBoxResult ShowQuestion(object title,
|
||||||
MessageBoxButton buttons = MessageBoxButton.OKCancel)
|
MessageBoxButton buttons = MessageBoxButton.OKCancel)
|
||||||
{
|
{
|
||||||
return Show(title, content, MessageBoxImage.Question, buttons);
|
return Show(title, MessageBoxImage.Question, buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowException(Exception exception)
|
public static void ShowException(Exception exception)
|
||||||
{
|
{
|
||||||
Show(exception, null, MessageBoxImage.Error);
|
Show(exception.Message, MessageBoxImage.Error, MessageBoxButton.OK, exception.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageBoxResult Show(
|
public static MessageBoxResult Show(
|
||||||
object title,
|
object title,
|
||||||
object content,
|
|
||||||
MessageBoxImage img,
|
MessageBoxImage img,
|
||||||
MessageBoxButton buttons = MessageBoxButton.OK)
|
MessageBoxButton buttons = MessageBoxButton.OK,
|
||||||
|
string details = null)
|
||||||
{
|
{
|
||||||
string msg = (title?.ToString().TrimEx() + BR2 + content?.ToString().TrimEx()).Trim();
|
string msg = title?.ToString().TrimEx();
|
||||||
|
MessageBoxEx.DetailsText = details;
|
||||||
return MessageBoxEx.OpenMessageBox(null, msg, WindowTitle, buttons, img);
|
return MessageBoxEx.OpenMessageBox(null, msg, WindowTitle, buttons, img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ namespace mpvnet
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
App.ShowError("Invalid Type", "Valid types are: bool or boolean, string, int or integer, float or double, nil or none or native");
|
App.ShowError("Invalid Type, valid types are: bool or boolean, string, int or integer, float or double, nil or none or native");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.4.9.4")]
|
[assembly: AssemblyVersion("5.4.9.5")]
|
||||||
[assembly: AssemblyFileVersion("5.4.9.4")]
|
[assembly: AssemblyFileVersion("5.4.9.5")]
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ namespace mpvnet
|
|||||||
ProcessHelp.ShellExecute(Path.GetDirectoryName(Core.ConfPath));
|
ProcessHelp.ShellExecute(Path.GetDirectoryName(Core.ConfPath));
|
||||||
|
|
||||||
void PreviewTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
|
void PreviewTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
|
||||||
Msg.ShowInfo("mpv.conf Preview", GetContent("mpv"));
|
Msg.ShowInfo("mpv.conf Preview" + BR2 + GetContent("mpv"));
|
||||||
|
|
||||||
void ShowManualTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
|
void ShowManualTextBlock_MouseUp(object sender, MouseButtonEventArgs e) =>
|
||||||
ProcessHelp.ShellExecute("https://mpv.io/manual/master/");
|
ProcessHelp.ShellExecute("https://mpv.io/manual/master/");
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
SearchControl.SearchTextBox.Text = "";
|
SearchControl.SearchTextBox.Text = "";
|
||||||
|
|
||||||
Msg.ShowInfo("Filtering",
|
Msg.ShowInfo("Filtering" + BR2 +
|
||||||
"Reduce the filter scope with:" + BR2 +
|
"Reduce the filter scope with:" + BR2 +
|
||||||
"i input" + BR2 +
|
"i input" + BR2 +
|
||||||
"m menu" + BR2 +
|
"m menu" + BR2 +
|
||||||
|
|||||||
@@ -159,8 +159,9 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Expander Grid.Row="4" Header="Details"
|
<Expander Grid.Row="4" Header=" Details"
|
||||||
IsExpanded="{Binding Path=Expanded}"
|
IsExpanded="{Binding Path=Expanded}"
|
||||||
|
Margin="3,8,0,0"
|
||||||
Visibility="{Binding Path=ShowDetailsBtn}"
|
Visibility="{Binding Path=ShowDetailsBtn}"
|
||||||
>
|
>
|
||||||
<Expander.Template>
|
<Expander.Template>
|
||||||
@@ -187,11 +188,10 @@
|
|||||||
Style="{StaticResource GroupBoxExpanderToggleButtonStyle}"
|
Style="{StaticResource GroupBoxExpanderToggleButtonStyle}"
|
||||||
IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
<ContentPresenter ContentSource="Header" RecognizesAccessKey="true"
|
<ContentPresenter ContentSource="Header" RecognizesAccessKey="true"
|
||||||
TextElement.Foreground="{Binding ElementName=textboxMessage, Path=Foreground}"
|
TextElement.Foreground="{Binding ElementName=textboxMessage, Path=Foreground}"
|
||||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||||
Grid.Column="1"
|
Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
/>
|
||||||
Margin="3,0,0,0" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<ContentPresenter x:Name="ExpandSite" Visibility="Collapsed" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
<ContentPresenter x:Name="ExpandSite" Visibility="Collapsed" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
Margin="{TemplateBinding Padding}"
|
Margin="{TemplateBinding Padding}"
|
||||||
|
|||||||
@@ -320,13 +320,6 @@ namespace MsgBoxEx
|
|||||||
|
|
||||||
protected virtual void Init(string msg, string title, MessageBoxButton buttons, MessageBoxImage image)
|
protected virtual void Init(string msg, string title, MessageBoxButton buttons, MessageBoxImage image)
|
||||||
{
|
{
|
||||||
if (Theme.Current != null)
|
|
||||||
{
|
|
||||||
MessageForeground = Theme.Current.GetBrush("heading");
|
|
||||||
MessageBackground = Theme.Current.GetBrush("background");
|
|
||||||
ButtonBackground = Theme.Current.GetBrush("highlight");
|
|
||||||
}
|
|
||||||
|
|
||||||
InitTop(msg, title);
|
InitTop(msg, title);
|
||||||
usingExButtons = false;
|
usingExButtons = false;
|
||||||
ButtonsEx = null;
|
ButtonsEx = null;
|
||||||
@@ -376,9 +369,6 @@ namespace MsgBoxEx
|
|||||||
|
|
||||||
private void InitBottom(MessageBoxImage image)
|
private void InitBottom(MessageBoxImage image)
|
||||||
{
|
{
|
||||||
// set the form's colors (you can also set these colors in your program's startup code
|
|
||||||
// (either in app.xaml.cs or MainWindow.cs) before you use the MessageBox for the
|
|
||||||
// first time
|
|
||||||
MessageBackground = (MessageBackground == null) ? new SolidColorBrush(Colors.White) : MessageBackground;
|
MessageBackground = (MessageBackground == null) ? new SolidColorBrush(Colors.White) : MessageBackground;
|
||||||
MessageForeground = (MessageForeground == null) ? new SolidColorBrush(Colors.Black) : MessageForeground;
|
MessageForeground = (MessageForeground == null) ? new SolidColorBrush(Colors.Black) : MessageForeground;
|
||||||
ButtonBackground = (ButtonBackground == null) ? new SolidColorBrush(ColorFromString("#cdcdcd")) : ButtonBackground;
|
ButtonBackground = (ButtonBackground == null) ? new SolidColorBrush(ColorFromString("#cdcdcd")) : ButtonBackground;
|
||||||
|
|||||||
@@ -99,45 +99,9 @@ namespace MsgBoxEx
|
|||||||
|
|
||||||
#region static configuration methods
|
#region static configuration methods
|
||||||
|
|
||||||
public static void SetMessageBackground(Color color)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MessageBackground = new SolidColorBrush(color);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message, ex.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetMessageForeground(Color color)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MessageForeground = new SolidColorBrush(color);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message, ex.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetButtonBackground(System.Windows.Media.Color color)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ButtonBackground = new SolidColorBrush(color);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message, ex.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Color ColorFromString(string colorString)
|
public static Color ColorFromString(string colorString)
|
||||||
{
|
{
|
||||||
Color wpfColor = System.Windows.Media.Colors.Black;
|
Color wpfColor = Colors.Black;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user