added option for automatic shutdown & temporarily removed some debugging info

This commit is contained in:
WeeXnes 2023-10-05 21:57:42 +02:00
parent 2225790af2
commit 17931a3103
5 changed files with 38 additions and 7 deletions

View file

@ -21,11 +21,11 @@ namespace WeeXnes.Core
public static class Formatting
{
public static string success_char = "";
public static string warning_char = "";
public static string info_char = "";
public static string error_char = "";
public static string writeline_char = "";
public static string success_char = "";
public static string warning_char = "";
public static string info_char = "";
public static string error_char = "";
public static string writeline_char = "";
}
}

View file

@ -8,7 +8,7 @@ namespace WeeXnes.Core
{
public class Information
{
public const string Version = "4.4.4";
public const string Version = "4.4.5";
public const string EncryptionHash = "8zf5#RdyQ]$4x4_";
public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest";
}

View file

@ -103,6 +103,15 @@
</Grid>
<StackPanel Orientation="Vertical" Name="MiscOptions" Margin="0,0,0,5">
<Label Content="set automatic shutdown" HorizontalAlignment="Center"/>
<ui:NumberBox Name="ShutdownTimer"/>
<ui:Button Content="Set" HorizontalAlignment="Stretch" Margin="0,5,0,5" Click="TimedShutdown_OnClick"/>
<ui:Button Content="Reset" HorizontalAlignment="Stretch" Click="ResetShutdown_OnClick"/>
</StackPanel>
<StackPanel Orientation="Vertical" Visibility="Collapsed" Name="DebugOptions">
<Label Content="Debug" HorizontalAlignment="Center"/>
<ui:CardAction Icon="ErrorCircle24"

View file

@ -146,5 +146,27 @@ namespace WeeXnes.Views.Settings
{
Functions.ThrowTestException(new ArithmeticException());
}
private void TimedShutdown_OnClick(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/C shutdown -s -t " + (Convert.ToInt32(ShutdownTimer.Value)*60).ToString();
process.StartInfo = startInfo;
process.Start();
}
private void ResetShutdown_OnClick(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/C shutdown -a";
process.StartInfo = startInfo;
process.Start();
}
}
}

View file

@ -4,7 +4,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Version>4.4.4</Version>
<Version>4.4.5</Version>
<ProjectGuid>{4B33CEE7-C74D-43B9-B99A-8B273D5195BC}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>WeeXnes</RootNamespace>