Add Configurations property change notifications
This commit is contained in:
parent
f09baa1318
commit
1f7000c2c9
26 changed files with 531 additions and 259 deletions
|
|
@ -93,7 +93,7 @@ namespace LibationAvalonia
|
|||
saveState.Width = (int)form.Bounds.Size.Width;
|
||||
saveState.Height = (int)form.Bounds.Size.Height;
|
||||
|
||||
config.SetObject(form.GetType().Name, saveState);
|
||||
config.SetNonString(saveState, form.GetType().Name);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace LibationAvalonia.Views
|
|||
public void ToggleQueueHideBtn_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
SetQueueCollapseState(_viewModel.QueueOpen);
|
||||
Configuration.Instance.SetObject(nameof(_viewModel.QueueOpen), _viewModel.QueueOpen);
|
||||
Configuration.Instance.SetNonString(_viewModel.QueueOpen, nameof(_viewModel.QueueOpen));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Dinah.Core;
|
|||
using LibationFileManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace LibationAvalonia.Views
|
||||
|
|
@ -13,6 +14,7 @@ namespace LibationAvalonia.Views
|
|||
public partial class MainWindow
|
||||
{
|
||||
private InterruptableTimer autoScanTimer;
|
||||
private IDisposable cancellation;
|
||||
|
||||
private void Configure_ScanAuto()
|
||||
{
|
||||
|
|
@ -53,7 +55,11 @@ namespace LibationAvalonia.Views
|
|||
AccountsSettingsPersister.Saved += accountsPostSave;
|
||||
|
||||
// when autoscan setting is changed, update menu checkbox and run autoscan
|
||||
Configuration.Instance.AutoScanChanged += startAutoScan;
|
||||
Configuration.Instance.PropertyChanged += (_, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(Configuration.Instance.AutoScan))
|
||||
startAutoScan();
|
||||
};
|
||||
}
|
||||
|
||||
private List<(string AccountId, string LocaleName)> preSaveDefaultAccounts;
|
||||
|
|
|
|||
|
|
@ -97,13 +97,13 @@ namespace LibationAvalonia.Views
|
|||
const string ignoreUpdate = "IgnoreUpdate";
|
||||
var config = Configuration.Instance;
|
||||
|
||||
if (config.GetObject(ignoreUpdate)?.ToString() == upgradeProperties.LatestRelease.ToString())
|
||||
if (config.GetString(ignoreUpdate) == upgradeProperties.LatestRelease.ToString())
|
||||
return;
|
||||
|
||||
var notificationResult = await new UpgradeNotification(upgradeProperties).ShowDialog<DialogResult>(this);
|
||||
|
||||
if (notificationResult == DialogResult.Ignore)
|
||||
config.SetObject(ignoreUpdate, upgradeProperties.LatestRelease.ToString());
|
||||
config.SetString(upgradeProperties.LatestRelease.ToString(), ignoreUpdate);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue