Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 13, 2023
1 parent 6f699b8 commit 159b1e0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
15 changes: 9 additions & 6 deletions src/Shared/Sucrose.Shared.Watchdog/DarkErrorMessageBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ public partial class DarkErrorMessageBox : Window
{
private static string Path = string.Empty;
private static string Text = string.Empty;
private static string Address = string.Empty;
private static string Source = string.Empty;

public DarkErrorMessageBox(string ErrorMessage, string LogPath, string HelpAddress = null, string HelpText = null)
public DarkErrorMessageBox(string ErrorMessage, string LogPath, string HelpSource = null, string HelpText = null)
{
InitializeComponent();

Path = LogPath;
Text = HelpText;
Address = HelpAddress;
Source = HelpSource;

SystemSounds.Hand.Play();

Help_Button.Content = Text ?? Help_Button.Content;
if (!string.IsNullOrEmpty(Source))
{
Help_Button.Content = Text;
}

Error_Message.Text += Environment.NewLine + ErrorMessage;

Expand All @@ -42,13 +45,13 @@ private void ShowButton_Click(object sender, RoutedEventArgs e)

private void HelpButton_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(Address))
if (string.IsNullOrEmpty(Source))
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Wiki}{SMR.ValueSeparator}{SMR.WikiWebsite}");
}
else
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Wiki}{SMR.ValueSeparator}{Address}");
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Wiki}{SMR.ValueSeparator}{Source}");
}
}

Expand Down
15 changes: 9 additions & 6 deletions src/Shared/Sucrose.Shared.Watchdog/LightErrorMessageBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@ public partial class LightErrorMessageBox : Window
{
private static string Path = string.Empty;
private static string Text = string.Empty;
private static string Address = string.Empty;
private static string Source = string.Empty;

public LightErrorMessageBox(string ErrorMessage, string LogPath, string HelpAddress = null, string HelpText = null)
public LightErrorMessageBox(string ErrorMessage, string LogPath, string HelpSource = null, string HelpText = null)
{
InitializeComponent();

Path = LogPath;
Text = HelpText;
Address = HelpAddress;
Source = HelpSource;

SystemSounds.Hand.Play();

Help_Button.Content = Text ?? Help_Button.Content;
if (!string.IsNullOrEmpty(Source))
{
Help_Button.Content = Text;
}

Error_Message.Text += Environment.NewLine + ErrorMessage;
}
Expand All @@ -38,13 +41,13 @@ private void ShowButton_Click(object sender, RoutedEventArgs e)

private void HelpButton_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(Address))
if (string.IsNullOrEmpty(Source))
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Wiki}{SMR.ValueSeparator}{SMR.WikiWebsite}");
}
else
{
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Wiki}{SMR.ValueSeparator}{Address}");
SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Wiki}{SMR.ValueSeparator}{Source}");
}
}

Expand Down
14 changes: 10 additions & 4 deletions src/Update/Sucrose.Update/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,24 @@ protected void Message(string Message)
{
HasError = false;

string Source = SUMI.Source;
string Path = SMMI.UpdateLogManager.LogFile();
string Text = SSRER.GetValue("Update", "HelpText");

switch (SUMM.Theme)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path, SUMI.Source, SSRER.GetValue("Update", "HelpText"));
DarkMessageBox.Topmost = true;
SSWDEMB DarkMessageBox = new(Message, Path, Source, Text)
{
Topmost = true
};
DarkMessageBox.ShowDialog();
break;
default:
SSWLEMB LightMessageBox = new(Message, Path, SUMI.Source, SSRER.GetValue("Update", "HelpText"));
LightMessageBox.Topmost = true;
SSWLEMB LightMessageBox = new(Message, Path, Source, Text)
{
Topmost = true
};
LightMessageBox.ShowDialog();
break;
}
Expand Down

0 comments on commit 159b1e0

Please sign in to comment.