|
|
@ -1,13 +1,14 @@
|
|
|
|
using DiscordChatExporter.Core.Exporting;
|
|
|
|
using DiscordChatExporter.Core.Exporting;
|
|
|
|
|
|
|
|
using Microsoft.Win32;
|
|
|
|
using Tyrrrz.Settings;
|
|
|
|
using Tyrrrz.Settings;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DiscordChatExporter.Gui.Services;
|
|
|
|
namespace DiscordChatExporter.Gui.Services;
|
|
|
|
|
|
|
|
|
|
|
|
public class SettingsService : SettingsManager
|
|
|
|
public partial class SettingsService : SettingsManager
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public bool IsAutoUpdateEnabled { get; set; } = true;
|
|
|
|
public bool IsAutoUpdateEnabled { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsDarkModeEnabled { get; set; }
|
|
|
|
public bool IsDarkModeEnabled { get; set; } = IsDarkModeEnabledByDefault();
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsTokenPersisted { get; set; } = true;
|
|
|
|
public bool IsTokenPersisted { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
|
@ -35,4 +36,21 @@ public class SettingsService : SettingsManager
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool ShouldSerializeLastToken() => IsTokenPersisted;
|
|
|
|
public bool ShouldSerializeLastToken() => IsTokenPersisted;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public partial class SettingsService
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
private static bool IsDarkModeEnabledByDefault()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return Registry.CurrentUser.OpenSubKey(
|
|
|
|
|
|
|
|
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", false
|
|
|
|
|
|
|
|
)?.GetValue("AppsUseLightTheme") is 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|