From 2272d35c16ae1d7e77e398d8020124655e0cd553 Mon Sep 17 00:00:00 2001 From: lincube Date: Wed, 1 Apr 2026 09:30:55 +0800 Subject: [PATCH] Revert "0.8.0.41" This reverts commit d054257db2dad55f4e6861b65c5fd4c2c05305b6. --- LanMountainDesktop/Assets/mining_qrcode.png | Bin 345 -> 0 bytes .../SuperMiningSettingsPageViewModel.cs | 130 --------- .../SuperMiningSettingsPage.axaml | 271 ------------------ .../SuperMiningSettingsPage.axaml.cs | 89 ------ .../Views/SettingsWindow.axaml.cs | 1 - 5 files changed, 491 deletions(-) delete mode 100644 LanMountainDesktop/Assets/mining_qrcode.png delete mode 100644 LanMountainDesktop/ViewModels/SuperMiningSettingsPageViewModel.cs delete mode 100644 LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml delete mode 100644 LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml.cs diff --git a/LanMountainDesktop/Assets/mining_qrcode.png b/LanMountainDesktop/Assets/mining_qrcode.png deleted file mode 100644 index 215ab19e2a87b88c8d5dd12ff31a81df7f652d82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 345 zcmV-f0jB_vjB(jlvK^6nYrJyZ!NC--vQ#)zr}72|2e z&IoR|u1cz@O6%8&rb-r0BL?+NmOq*hQJL6)r1IU2X5kR+osrnOF`qU7sBz*_HQyfOj$yiNQDGR+lN8{24yPMM$!&cAJ9O3Y<@)FC00000NkvXXu0mjfLw1%Y diff --git a/LanMountainDesktop/ViewModels/SuperMiningSettingsPageViewModel.cs b/LanMountainDesktop/ViewModels/SuperMiningSettingsPageViewModel.cs deleted file mode 100644 index 12cd798..0000000 --- a/LanMountainDesktop/ViewModels/SuperMiningSettingsPageViewModel.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; -using Avalonia.Media.Imaging; -using Avalonia.Platform; -using FluentIcons.Common; - -namespace LanMountainDesktop.ViewModels; - -public sealed class SuperMiningSettingsPageViewModel : INotifyPropertyChanged -{ - private double _hashRate = 125.6; - private string _coinsMined = "0.08923"; - private int _poolConnections = 98; - private double _miningProgress; - private string _miningStatus = "正在挖矿中..."; - private bool _showAprilFoolsHint; - private Bitmap? _qrCodeImage; - - public event PropertyChangedEventHandler? PropertyChanged; - - public Symbol ActionSymbol => Symbol.ArrowDownload; - - public double HashRate - { - get => _hashRate; - set - { - if (Math.Abs(_hashRate - value) > 0.01) - { - _hashRate = value; - OnPropertyChanged(); - } - } - } - - public string CoinsMined - { - get => _coinsMined; - set - { - if (_coinsMined != value) - { - _coinsMined = value; - OnPropertyChanged(); - } - } - } - - public int PoolConnections - { - get => _poolConnections; - set - { - if (_poolConnections != value) - { - _poolConnections = value; - OnPropertyChanged(); - } - } - } - - public double MiningProgress - { - get => _miningProgress; - set - { - if (Math.Abs(_miningProgress - value) > 0.1) - { - _miningProgress = value; - OnPropertyChanged(); - } - } - } - - public string MiningStatus - { - get => _miningStatus; - set - { - if (_miningStatus != value) - { - _miningStatus = value; - OnPropertyChanged(); - } - } - } - - public bool ShowAprilFoolsHint - { - get => _showAprilFoolsHint; - set - { - if (_showAprilFoolsHint != value) - { - _showAprilFoolsHint = value; - OnPropertyChanged(); - } - } - } - - public Bitmap? QrCodeImage - { - get => _qrCodeImage; - set - { - if (_qrCodeImage != value) - { - _qrCodeImage = value; - OnPropertyChanged(); - } - } - } - - public void LoadQrCodeImage() - { - try - { - var assets = AssetLoader.Open(new System.Uri("avares://LanMountainDesktop/Assets/mining_qrcode.png")); - QrCodeImage = new Bitmap(assets); - } - catch - { - } - } - - private void OnPropertyChanged([CallerMemberName] string? propertyName = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } -} diff --git a/LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml b/LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml deleted file mode 100644 index 0aed869..0000000 --- a/LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml.cs b/LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml.cs deleted file mode 100644 index 422c772..0000000 --- a/LanMountainDesktop/Views/SettingsPages/SuperMiningSettingsPage.axaml.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using Avalonia.Threading; -using LanMountainDesktop.PluginSdk; -using LanMountainDesktop.ViewModels; - -namespace LanMountainDesktop.Views.SettingsPages; - -[SettingsPageInfo( - "super-mining", - "超级挖矿", - SettingsPageCategory.About, - IconKey = "Savings", - SortOrder = 35, - TitleLocalizationKey = "settings.supermining.title", - DescriptionLocalizationKey = "settings.supermining.description", - HidePageTitle = true)] -public partial class SuperMiningSettingsPage : SettingsPageBase -{ - private readonly DispatcherTimer _updateTimer; - private readonly Random _random = new(); - private int _tickCount; - - public SuperMiningSettingsPage() - : this(new SuperMiningSettingsPageViewModel()) - { - } - - public SuperMiningSettingsPage(SuperMiningSettingsPageViewModel viewModel) - { - ViewModel = viewModel; - DataContext = ViewModel; - InitializeComponent(); - - ViewModel.LoadQrCodeImage(); - - _updateTimer = new DispatcherTimer - { - Interval = TimeSpan.FromSeconds(1) - }; - _updateTimer.Tick += OnUpdateTimerTick; - - Unloaded += OnUnloaded; - } - - public SuperMiningSettingsPageViewModel ViewModel { get; } - - public override void OnNavigatedTo(object? parameter) - { - base.OnNavigatedTo(parameter); - _updateTimer.Start(); - } - - private void OnUnloaded(object? sender, Avalonia.Interactivity.RoutedEventArgs e) - { - _updateTimer.Stop(); - } - - private void OnUpdateTimerTick(object? sender, EventArgs e) - { - _tickCount++; - - ViewModel.HashRate = 125.6 + _random.NextDouble() * 10 - 5; - ViewModel.MiningProgress = (ViewModel.MiningProgress + 1) % 100; - - if (_tickCount % 5 == 0) - { - var baseCoins = 0.08923; - var increment = _random.NextDouble() * 0.00001; - ViewModel.CoinsMined = (baseCoins + increment).ToString("F5"); - } - - ViewModel.PoolConnections = _random.Next(95, 100); - - var statuses = new[] - { - "正在挖矿中...", - "矿池连接稳定", - "正在提交份额...", - "算力优化中...", - "收益计算中..." - }; - ViewModel.MiningStatus = statuses[_tickCount % statuses.Length]; - - if (DateTime.Now.Month == 4 && DateTime.Now.Day == 1) - { - ViewModel.ShowAprilFoolsHint = true; - } - } -} diff --git a/LanMountainDesktop/Views/SettingsWindow.axaml.cs b/LanMountainDesktop/Views/SettingsWindow.axaml.cs index 6f6439b..8f35357 100644 --- a/LanMountainDesktop/Views/SettingsWindow.axaml.cs +++ b/LanMountainDesktop/Views/SettingsWindow.axaml.cs @@ -734,7 +734,6 @@ public partial class SettingsWindow : Window, ISettingsPageHostContext "Info" => Symbol.Info, "ArrowSync" => Symbol.ArrowSync, "Hourglass" => Symbol.Hourglass, - "Savings" => Symbol.Savings, _ => Symbol.Settings }; }