mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-25 07:24:14 +00:00
Replace Tyrrrz.Settings with Cogwheel
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Cogwheel;
|
||||
using DiscordChatExporter.Core.Exporting;
|
||||
using Microsoft.Win32;
|
||||
using Tyrrrz.Settings;
|
||||
|
||||
namespace DiscordChatExporter.Gui.Services;
|
||||
|
||||
public partial class SettingsService : SettingsManager
|
||||
public partial class SettingsService : SettingsBase
|
||||
{
|
||||
public bool IsUkraineSupportMessageEnabled { get; set; } = true;
|
||||
|
||||
@@ -38,13 +39,18 @@ public partial class SettingsService : SettingsManager
|
||||
public string? LastAssetsDirPath { get; set; }
|
||||
|
||||
public SettingsService()
|
||||
: base(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Settings.dat"))
|
||||
{
|
||||
Configuration.StorageSpace = StorageSpace.Instance;
|
||||
Configuration.SubDirectoryPath = "";
|
||||
Configuration.FileName = "Settings.dat";
|
||||
}
|
||||
|
||||
public bool ShouldSerializeLastToken() => IsTokenPersisted;
|
||||
public override void Save()
|
||||
{
|
||||
// Clear token if it's not supposed to be persisted
|
||||
if (!IsTokenPersisted)
|
||||
LastToken = null;
|
||||
|
||||
base.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public partial class SettingsService
|
||||
|
||||
Reference in New Issue
Block a user