Skip to content

Commit

Permalink
Fixed minor code-quality bugs, bumped the version
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Apr 15, 2023
1 parent 5e61800 commit 69c94f5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Amethyst/Amethyst.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<Description>Amethyst (Desktop) App</Description>
<PackageProjectUrl>k2vr.tech</PackageProjectUrl>
<!--AZ_BUILD_DATA<Version>AZ_BUILD_NUMBER</Version>AZ_BUILD_DATA-->
<FileVersion>1.2.1.3</FileVersion>
<AssemblyVersion>1.2.1.3</AssemblyVersion>
<FileVersion>1.2.1.4</FileVersion>
<AssemblyVersion>1.2.1.4</AssemblyVersion>
<RepositoryUrl>https://github.com/KinectToVR/Amethyst</RepositoryUrl>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Amethyst/Classes/AppData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

public static class AppData
{
public const uint InternalVersion = 5; // Amethyst version
public const uint InternalVersion = 6; // Amethyst version

public const uint ApiVersion = 0; // API version

// Internal version number
public static (string Display, string Internal)
VersionString { get; } = ("1.2.1.3", "AZ_BUILD_NUMBER");
VersionString { get; } = ("1.2.1.4", "AZ_BUILD_NUMBER");

// Application settings
public static AppSettings Settings { get; set; } = new();
Expand Down
2 changes: 1 addition & 1 deletion Amethyst/Classes/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public static async void MainLoop()
{
// Warning: this is meant to work as fire-and-forget
Logger.Info("[Main] Waiting for the start sem to open..");
Shared.Events.SemSignalStartMain.WaitOne();
Shared.Events.StartMainLoopEvent.WaitOne();

Logger.Info("[Main] Starting the main app loop now...");

Expand Down
6 changes: 3 additions & 3 deletions Amethyst/Classes/Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public static ManualResetEvent
ReloadInfoPageEvent,
ReloadPluginsPageEvent;

public static readonly Semaphore
SemSignalStartMain = new(0, 1);

public static readonly ManualResetEvent
StartMainLoopEvent = new(false);
public static void RequestInterfaceReload(bool all = true)
{
if (!General.GeneralTabSetupFinished)
Expand Down
2 changes: 1 addition & 1 deletion Amethyst/Pages/General.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private async Task Page_LoadedHandler()
if (!_generalPageLoadedOnce)
{
Logger.Info("Basic setup done! Starting the main loop now...");
Shared.Events.SemSignalStartMain.Release();
Shared.Events.StartMainLoopEvent.Set();

// Try auto-spawning trackers if stated so
if (Interfacing.IsServiceEndpointPresent && // If the driver's ok
Expand Down
1 change: 0 additions & 1 deletion Amethyst/Pages/Plugins.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@
FontWeight="SemiBold" FontSize="12"
Opacity="0.5"
Text="{x:Bind TrimString(Publisher, 30), Mode=OneWay}"
Tapped="{x:Bind ShowDeviceFolder, Mode=OneWay}"
ToolTipService.ToolTip="{x:Bind Folder, Mode=OneWay}"
ToolTipService.Placement="Bottom" />
</StackPanel>
Expand Down
8 changes: 6 additions & 2 deletions Amethyst/Schedulers/ShutdownController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using Amethyst.Classes;
Expand Down Expand Up @@ -27,8 +28,11 @@ public static async Task ExecuteAllTasks()
// First run all queued tasks waiting for us
Logger.Info("Running all actions queued for shutdown...");

Logger.Info("Preparing an immutable task list...");
var queuedShutdownTasks = ShutdownTasks.ToImmutableList();

Logger.Info("Executing tasks marked as priority...");
foreach (var task in ShutdownTasks.Where(x => x.Priority))
foreach (var task in queuedShutdownTasks.Where(x => x.Priority))
{
Logger.Info($"Starting task with name \"{task.Name}\"...");
try
Expand All @@ -45,7 +49,7 @@ public static async Task ExecuteAllTasks()
}

Logger.Info("Executing all other tasks now...");
foreach (var task in ShutdownTasks.Where(x => !x.Priority))
foreach (var task in queuedShutdownTasks.Where(x => !x.Priority))
{
Logger.Info($"Starting task with name \"{task.Name}\"...");
try
Expand Down

0 comments on commit 69c94f5

Please sign in to comment.