From e800ff6b746bebdf2ac9db56f8baa1f530166c8c Mon Sep 17 00:00:00 2001 From: Patryk Wysocki Date: Fri, 13 May 2022 13:25:40 +0200 Subject: [PATCH 01/17] Merge --- ThorgApp/App.config | 2 +- ThorgApp/App.xaml.cs | 1 + ThorgApp/Command/Provider.cs | 12 ++ ThorgApp/Interfaces/IProviderConfig.cs | 2 + ThorgApp/Properties/Settings.Designer.cs | 4 +- ThorgApp/Properties/Settings.settings | 2 +- ThorgApp/Src/ProviderConfigService.cs | 24 +++ ThorgApp/ThorgApp.csproj | 17 +- ThorgApp/UI/DashboardCharity.xaml | 264 +++++++++++++++++++++++ ThorgApp/UI/DashboardCharity.xaml.cs | 32 +++ ThorgApp/ViewModel/SettingsViewModel.cs | 2 +- 11 files changed, 356 insertions(+), 6 deletions(-) create mode 100644 ThorgApp/UI/DashboardCharity.xaml create mode 100644 ThorgApp/UI/DashboardCharity.xaml.cs diff --git a/ThorgApp/App.config b/ThorgApp/App.config index 047516f..1cefab4 100644 --- a/ThorgApp/App.config +++ b/ThorgApp/App.config @@ -92,7 +92,7 @@ www.golem.network - False + True False diff --git a/ThorgApp/App.xaml.cs b/ThorgApp/App.xaml.cs index f8a6661..9a4e736 100644 --- a/ThorgApp/App.xaml.cs +++ b/ThorgApp/App.xaml.cs @@ -106,6 +106,7 @@ private void ConfigureServices(IServiceCollection services) services.AddTransient(typeof(ViewModel.CustomControls.NotificationBarViewModel)); services.AddTransient(typeof(ViewModel.StatisticsViewModel)); services.AddTransient(typeof(ViewModel.TRexViewModel)); + services.AddTransient(typeof(ViewModel.CharityViewModel)); services.AddTransient(typeof(DashboardMain)); services.AddTransient(typeof(NotificationBar)); diff --git a/ThorgApp/Command/Provider.cs b/ThorgApp/Command/Provider.cs index db285a8..1674ec3 100644 --- a/ThorgApp/Command/Provider.cs +++ b/ThorgApp/Command/Provider.cs @@ -49,6 +49,10 @@ public class Config [JsonProperty("account")] public string? Account { get; set; } + [JsonProperty("charity_wallet")] + public string? CharityAccount { get; set; } + [JsonProperty("charity_percentage")] + public float? CharityAmmount { get; set; } } @@ -199,6 +203,14 @@ public Config? Config { cmd.Append(" --account \"").Append(value.Account).Append('"'); } + if (value.CharityAccount != null) + { + cmd.Append(" --charity-wallet \"").Append(value.CharityAccount).Append('"'); + } + if(value.CharityAmmount != null) + { + cmd.Append(" --charity-percentage \"").Append(value.CharityAmmount).Append('"'); + } var _none = this.ExecToText(cmd.ToString()); } } diff --git a/ThorgApp/Interfaces/IProviderConfig.cs b/ThorgApp/Interfaces/IProviderConfig.cs index b000754..18fa7b0 100644 --- a/ThorgApp/Interfaces/IProviderConfig.cs +++ b/ThorgApp/Interfaces/IProviderConfig.cs @@ -25,6 +25,8 @@ public interface IProviderConfig : INotifyPropertyChanged public void UpdateActiveCpuThreadsCount(int threadsCount); void UpdateWalletAddress(string? walletAddress = null); void UpdateNodeName(string? value); + void UpdateCharityWallet(string? value); + void UpdateCharityPercentage(float? value); Task Prepare(bool isGpuCapable, bool isLowMemoryMode); } diff --git a/ThorgApp/Properties/Settings.Designer.cs b/ThorgApp/Properties/Settings.Designer.cs index 7b4d0dd..506ee25 100644 --- a/ThorgApp/Properties/Settings.Designer.cs +++ b/ThorgApp/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace GolemUI.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -88,7 +88,7 @@ public string GolemWebPage { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool OpenConsoleProvider { get { return ((bool)(this["OpenConsoleProvider"])); diff --git a/ThorgApp/Properties/Settings.settings b/ThorgApp/Properties/Settings.settings index 56a796f..7f65b09 100644 --- a/ThorgApp/Properties/Settings.settings +++ b/ThorgApp/Properties/Settings.settings @@ -24,7 +24,7 @@ www.golem.network - False + True False diff --git a/ThorgApp/Src/ProviderConfigService.cs b/ThorgApp/Src/ProviderConfigService.cs index afd7bd3..ac3aaa9 100644 --- a/ThorgApp/Src/ProviderConfigService.cs +++ b/ThorgApp/Src/ProviderConfigService.cs @@ -282,5 +282,29 @@ public async Task Prepare(bool isGpuCapable, bool isLowMemoryMode) } } } + + public void UpdateCharityWallet(string value) + { + var config = Config ?? _provider.Config; + if (config != null) + { + config.CharityAccount = value; + _provider.Config = Config; + } + OnPropertyChanged("Config"); + OnPropertyChanged("CharityWallet"); + } + + public void UpdateCharityPercentage(float? value) + { + var config = Config ?? _provider.Config; + if (config != null) + { + config.CharityAmmount = value; + _provider.Config = Config; + } + OnPropertyChanged("Config"); + OnPropertyChanged("CharityAmmount"); + } } } diff --git a/ThorgApp/ThorgApp.csproj b/ThorgApp/ThorgApp.csproj index aff5097..f2765bc 100644 --- a/ThorgApp/ThorgApp.csproj +++ b/ThorgApp/ThorgApp.csproj @@ -97,7 +97,9 @@ MSBuild:Compile Designer + + @@ -132,10 +134,14 @@ + + + DashboardCharity.xaml + DashboardTRex.xaml @@ -288,9 +294,11 @@ UsageDescription.xaml + + @@ -339,6 +347,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -992,5 +1004,8 @@ + + + - \ No newline at end of file + diff --git a/ThorgApp/UI/DashboardCharity.xaml b/ThorgApp/UI/DashboardCharity.xaml new file mode 100644 index 0000000..81e63e5 --- /dev/null +++ b/ThorgApp/UI/DashboardCharity.xaml @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ThorgApp/UI/DashboardCharity.xaml.cs b/ThorgApp/UI/DashboardCharity.xaml.cs new file mode 100644 index 0000000..164ce3c --- /dev/null +++ b/ThorgApp/UI/DashboardCharity.xaml.cs @@ -0,0 +1,32 @@ + +using GolemUI.ViewModel; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using GolemUI.Interfaces; +using GolemUI.Model; + +namespace GolemUI +{ + public partial class DashboardCharity : UserControl + { + public CharityViewModel ViewModel; + + public DashboardCharity(CharityViewModel viewModel) + { + InitializeComponent(); + ViewModel = viewModel; + this.DataContext = this.ViewModel; + } + } +} diff --git a/ThorgApp/ViewModel/SettingsViewModel.cs b/ThorgApp/ViewModel/SettingsViewModel.cs index 54a2bbd..f9ee387 100644 --- a/ThorgApp/ViewModel/SettingsViewModel.cs +++ b/ThorgApp/ViewModel/SettingsViewModel.cs @@ -533,7 +533,7 @@ public string? NodeName { NodeNameHasChanged = true; _providerConfig?.UpdateNodeName(value); - NotifyChange("NodeName"); + //NotifyChange("NodeName"); } } public double? ExpectedProfit From fbfa771a2befa4065691643df6ea7bda461a3201 Mon Sep 17 00:00:00 2001 From: Patryk Wysocki Date: Fri, 13 May 2022 13:26:35 +0200 Subject: [PATCH 02/17] Validation and view model --- ThorgApp/DesignViewModel/CharityViewModel.cs | 15 +++++ .../Validators/PercentageValueValidator.cs | 34 +++++++++++ ThorgApp/ViewModel/CharityViewModel.cs | 56 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 ThorgApp/DesignViewModel/CharityViewModel.cs create mode 100644 ThorgApp/Validators/PercentageValueValidator.cs create mode 100644 ThorgApp/ViewModel/CharityViewModel.cs diff --git a/ThorgApp/DesignViewModel/CharityViewModel.cs b/ThorgApp/DesignViewModel/CharityViewModel.cs new file mode 100644 index 0000000..1d8d2b6 --- /dev/null +++ b/ThorgApp/DesignViewModel/CharityViewModel.cs @@ -0,0 +1,15 @@ +using GolemUI.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GolemUI.DesignViewModel +{ + public class CharityViewModel + { + public string CharityWallet => "xearwag0ag5s4ge8"; + public float CharityPercentage => 0.2f; + } +} diff --git a/ThorgApp/Validators/PercentageValueValidator.cs b/ThorgApp/Validators/PercentageValueValidator.cs new file mode 100644 index 0000000..28e8f65 --- /dev/null +++ b/ThorgApp/Validators/PercentageValueValidator.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; + +namespace GolemUI.Validators +{ + public class PercentageValueValidator : ValidationRule + { + public override ValidationResult Validate(object value, CultureInfo cultureInfo) + { + var text = value as string; + float valueFloat = 0.0f; + + var result = float.TryParse(text, out valueFloat); + + if (result == false) + { + return new ValidationResult(false, "Failed to parse as float"); + } + + if (valueFloat < 0.0f || valueFloat > 1.0f) + { + return new ValidationResult(false, "Value is not between 0.0 and 1.0"); + } + + + return ValidationResult.ValidResult; + } + } +} diff --git a/ThorgApp/ViewModel/CharityViewModel.cs b/ThorgApp/ViewModel/CharityViewModel.cs new file mode 100644 index 0000000..0cf9b9c --- /dev/null +++ b/ThorgApp/ViewModel/CharityViewModel.cs @@ -0,0 +1,56 @@ +using GolemUI.Command; +using GolemUI.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GolemUI.ViewModel +{ + public class CharityViewModel : INotifyPropertyChanged, IDisposable, IDialogInvoker, ISavableLoadableDashboardPage + { + public event PropertyChangedEventHandler PropertyChanged; + public event RequestDarkBackgroundEventHandler DarkBackgroundRequested; + public event PageChangeRequestedEvent PageChangeRequested; + + public void Dispose() + { + throw new NotImplementedException(); + } + + public void LoadData() + { + //throw new NotImplementedException(); + } + + public void SaveData() + { + //throw new NotImplementedException(); + } + + public float? CharityPercentage + { + get => settingsProvider.Config.CharityAmmount; + set + { + settingsProvider.UpdateCharityPercentage(value); + } + } + public string CharityWallet + { + get => settingsProvider.Config.CharityAccount; + set + { + settingsProvider.UpdateCharityWallet(value); + } + } + + private IProviderConfig settingsProvider; + public CharityViewModel(IProviderConfig _settingsProvider) + { + settingsProvider = _settingsProvider; + } + } +} From c38ec74f48155fa4bb06856223e516715d5e3a20 Mon Sep 17 00:00:00 2001 From: Patryk Wysocki Date: Mon, 16 May 2022 08:46:08 +0200 Subject: [PATCH 03/17] Format --- ThorgApp/App.config | 6 +++--- ThorgApp/Command/Provider.cs | 2 +- ThorgApp/Src/ProviderConfigService.cs | 20 ++++++++++---------- ThorgApp/ThorgApp.csproj | 4 +--- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/ThorgApp/App.config b/ThorgApp/App.config index 1cefab4..fe2dc6a 100644 --- a/ThorgApp/App.config +++ b/ThorgApp/App.config @@ -134,15 +134,15 @@ n1.mining-proxy.imapp.pl:8073 - Your antivirus is blocking Thorg's mining module called “EthDcrMiner64.exe”. If you do not have antivirus software installed you can unblock this by going to your Windows Security settings, and then clicking on Virus and Threat Protections. + Your antivirus is blocking Thorg's mining module called “EthDcrMiner64.exe”. If you do not have antivirus software installed you can unblock this by going to your Windows Security settings, and then clicking on Virus and Threat Protections. If it doesn't help you might want to restart Thorg after changing settings in your antivirus. - No worries though! We will soon release an update with support for cards that have less than 6B of RAM. Also, stay tuned for CPU support that is just around the corner. + No worries though! We will soon release an update with support for cards that have less than 6B of RAM. Also, stay tuned for CPU support that is just around the corner. Till then you can explore the app and get to know Thorg a bit better! - Thorg is most suited for addresses that the user has custody of, compared to some other individual than the Thorg user (such as a centralized exchange) having custody of the address. + Thorg is most suited for addresses that the user has custody of, compared to some other individual than the Thorg user (such as a centralized exchange) having custody of the address. Most exchanges do not support L2 payments like Polygon that Thorg uses. Please change your wallet address to one that you're in control of, such as MetaMask. diff --git a/ThorgApp/Command/Provider.cs b/ThorgApp/Command/Provider.cs index 1674ec3..a4a8be5 100644 --- a/ThorgApp/Command/Provider.cs +++ b/ThorgApp/Command/Provider.cs @@ -207,7 +207,7 @@ public Config? Config { cmd.Append(" --charity-wallet \"").Append(value.CharityAccount).Append('"'); } - if(value.CharityAmmount != null) + if (value.CharityAmmount != null) { cmd.Append(" --charity-percentage \"").Append(value.CharityAmmount).Append('"'); } diff --git a/ThorgApp/Src/ProviderConfigService.cs b/ThorgApp/Src/ProviderConfigService.cs index ac3aaa9..d72d996 100644 --- a/ThorgApp/Src/ProviderConfigService.cs +++ b/ThorgApp/Src/ProviderConfigService.cs @@ -164,11 +164,11 @@ public async Task Prepare(bool isGpuCapable, bool isLowMemoryMode) { "invalid-share", 0m }, { "hash-rate", 0m } }), out _args, out _info); -/* if (isGpuCapable) - { - _provider.ActivatePreset("hminer"); - changedProperties.Add("IsMiningActive"); - }*/ + /* if (isGpuCapable) + { + _provider.ActivatePreset("hminer"); + changedProperties.Add("IsMiningActive"); + }*/ } else { @@ -195,11 +195,11 @@ public async Task Prepare(bool isGpuCapable, bool isLowMemoryMode) { "invalid-share", 0m }, { "hash-rate", 0m } }), out _args, out _info); - /* if (isGpuCapable) - { - _provider.ActivatePreset("gminer"); - changedProperties.Add("IsMiningActive"); - }*/ + /* if (isGpuCapable) + { + _provider.ActivatePreset("gminer"); + changedProperties.Add("IsMiningActive"); + }*/ } else { diff --git a/ThorgApp/ThorgApp.csproj b/ThorgApp/ThorgApp.csproj index f2765bc..62afc05 100644 --- a/ThorgApp/ThorgApp.csproj +++ b/ThorgApp/ThorgApp.csproj @@ -99,7 +99,6 @@ - @@ -134,7 +133,6 @@ - @@ -1008,4 +1006,4 @@ - + \ No newline at end of file From 6758cc20dbb7fc9340c466a9edf3b68ccacb65b6 Mon Sep 17 00:00:00 2001 From: Patryk Wysocki Date: Mon, 16 May 2022 12:17:03 +0200 Subject: [PATCH 04/17] Added some missing code --- ThorgApp/App.xaml.cs | 1 + ThorgApp/ThorgApp.csproj | 3 --- ThorgApp/UI/Dashboard.xaml | 1 + ThorgApp/ViewModel/DashboardViewModel.cs | 13 +++++++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ThorgApp/App.xaml.cs b/ThorgApp/App.xaml.cs index 9a4e736..7f9136f 100644 --- a/ThorgApp/App.xaml.cs +++ b/ThorgApp/App.xaml.cs @@ -114,6 +114,7 @@ private void ConfigureServices(IServiceCollection services) services.AddTransient(typeof(DashboardSettingsAdv)); services.AddTransient(typeof(DashboardStatistics)); services.AddTransient(typeof(DashboardTRex)); + services.AddTransient(typeof(DashboardCharity)); services.AddTransient(typeof(SettingsViewModel)); services.AddTransient(typeof(SettingsAdvViewModel)); diff --git a/ThorgApp/ThorgApp.csproj b/ThorgApp/ThorgApp.csproj index 62afc05..de3502e 100644 --- a/ThorgApp/ThorgApp.csproj +++ b/ThorgApp/ThorgApp.csproj @@ -1002,8 +1002,5 @@ - - - \ No newline at end of file diff --git a/ThorgApp/UI/Dashboard.xaml b/ThorgApp/UI/Dashboard.xaml index a6c8f62..82881ed 100644 --- a/ThorgApp/UI/Dashboard.xaml +++ b/ThorgApp/UI/Dashboard.xaml @@ -83,6 +83,7 @@ + diff --git a/ThorgApp/ViewModel/DashboardViewModel.cs b/ThorgApp/ViewModel/DashboardViewModel.cs index 93340c0..f735ad8 100644 --- a/ThorgApp/ViewModel/DashboardViewModel.cs +++ b/ThorgApp/ViewModel/DashboardViewModel.cs @@ -25,7 +25,8 @@ public enum DashboardPages PageDashboardBenchmark, PageDashboardWallet, PageDashboardStatistics, - PageDashboardTRex + PageDashboardTRex, + PageDashboardCharity } @@ -36,6 +37,7 @@ public enum DashboardPages public DashboardSettingsAdv DashboardSettingsAdv { get; set; } public DashboardWallet DashboardWallet { get; set; } public DashboardTRex DashboardTRex { get; set; } + public DashboardCharity DashboardCharity { get; set; } public DashboardStatistics? DashboardStatistics { get; set; } private DashboardPages _selectedPage; @@ -53,6 +55,7 @@ public int SelectedPage DashboardPages.PageDashboardWallet => 3, DashboardPages.PageDashboardStatistics => 4, DashboardPages.PageDashboardTRex => 5, + DashboardPages.PageDashboardCharity => 6, _ => -1, }; } @@ -78,6 +81,10 @@ public int SelectedPage { SwitchPage(DashboardPages.PageDashboardTRex); } + else if (value == 6) + { + SwitchPage(DashboardPages.PageDashboardCharity); + } else { Debug.Fail("No such page"); @@ -106,7 +113,7 @@ public bool DarkBackgroundVisible private readonly IRemoteSettingsProvider _remoteSettingsProvider; - public DashboardViewModel(DashboardSettings dashboardSettings, DashboardMain dashboardMain, DashboardSettingsAdv dashboardSettingsAdv, DashboardWallet dashboardWallet, IRemoteSettingsProvider remoteSettingsProvider, DashboardStatistics? dashboardStatistics, DashboardTRex dashboardTRex + public DashboardViewModel(DashboardSettings dashboardSettings, DashboardMain dashboardMain, DashboardSettingsAdv dashboardSettingsAdv, DashboardWallet dashboardWallet, IRemoteSettingsProvider remoteSettingsProvider, DashboardStatistics? dashboardStatistics, DashboardTRex dashboardTRex, DashboardCharity dashboardChar ) { _remoteSettingsProvider = remoteSettingsProvider; @@ -120,12 +127,14 @@ public DashboardViewModel(DashboardSettings dashboardSettings, DashboardMain das DashboardWallet = dashboardWallet; DashboardSettings = dashboardSettings; DashboardTRex = dashboardTRex; + DashboardCharity = dashboardChar; _pages.Add(DashboardPages.PageDashboardMain, new DashboardPage(DashboardMain, DashboardMain.Model)); _pages.Add(DashboardPages.PageDashboardSettings, new DashboardPage(DashboardSettings, DashboardSettings.ViewModel)); _pages.Add(DashboardPages.PageDashboardWallet, new DashboardPage(DashboardWallet, DashboardWallet.Model)); _pages.Add(DashboardPages.PageDashboardSettingsAdv, new DashboardPage(DashboardSettingsAdv, DashboardSettingsAdv.ViewModel)); _pages.Add(DashboardPages.PageDashboardTRex, new DashboardPage(DashboardTRex, DashboardTRex.ViewModel)); + _pages.Add(DashboardPages.PageDashboardCharity, new DashboardPage(DashboardCharity, DashboardCharity.ViewModel)); if (DashboardStatistics != null) { From bd6faf04c8dcf4a6c1ec0cc99edb73a98d4c61d1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Rekucki Date: Mon, 16 May 2022 15:41:36 +0200 Subject: [PATCH 05/17] added charity icon --- ThorgApp/Interfaces/IProviderConfig.cs | 3 +- ThorgApp/Src/ProviderConfigService.cs | 17 +++------ ThorgApp/ThorgApp.csproj | 3 ++ ThorgApp/UI/Dashboard.xaml | 2 +- .../UI/Icons/DefaultStyle/png/Charity.png | 3 ++ .../UI/Themes/Buttons/NavSidepanelButton.xaml | 36 +++++++++++++++++++ ThorgApp/ViewModel/CharityViewModel.cs | 16 +++++---- 7 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 ThorgApp/UI/Icons/DefaultStyle/png/Charity.png diff --git a/ThorgApp/Interfaces/IProviderConfig.cs b/ThorgApp/Interfaces/IProviderConfig.cs index 18fa7b0..8f61f42 100644 --- a/ThorgApp/Interfaces/IProviderConfig.cs +++ b/ThorgApp/Interfaces/IProviderConfig.cs @@ -25,8 +25,7 @@ public interface IProviderConfig : INotifyPropertyChanged public void UpdateActiveCpuThreadsCount(int threadsCount); void UpdateWalletAddress(string? walletAddress = null); void UpdateNodeName(string? value); - void UpdateCharityWallet(string? value); - void UpdateCharityPercentage(float? value); + void UpdateCharity(string? wallet, float? procentage); Task Prepare(bool isGpuCapable, bool isLowMemoryMode); } diff --git a/ThorgApp/Src/ProviderConfigService.cs b/ThorgApp/Src/ProviderConfigService.cs index d72d996..db2ee8c 100644 --- a/ThorgApp/Src/ProviderConfigService.cs +++ b/ThorgApp/Src/ProviderConfigService.cs @@ -283,28 +283,19 @@ public async Task Prepare(bool isGpuCapable, bool isLowMemoryMode) } } - public void UpdateCharityWallet(string value) + public void UpdateCharity(string? charityAccount, float? charityAmmount) { var config = Config ?? _provider.Config; if (config != null) { - config.CharityAccount = value; + config.CharityAccount = charityAccount; + config.CharityAmmount = charityAmmount; _provider.Config = Config; } OnPropertyChanged("Config"); OnPropertyChanged("CharityWallet"); - } - - public void UpdateCharityPercentage(float? value) - { - var config = Config ?? _provider.Config; - if (config != null) - { - config.CharityAmmount = value; - _provider.Config = Config; - } - OnPropertyChanged("Config"); OnPropertyChanged("CharityAmmount"); } + } } diff --git a/ThorgApp/ThorgApp.csproj b/ThorgApp/ThorgApp.csproj index de3502e..a9e843a 100644 --- a/ThorgApp/ThorgApp.csproj +++ b/ThorgApp/ThorgApp.csproj @@ -1002,5 +1002,8 @@ + + + \ No newline at end of file diff --git a/ThorgApp/UI/Dashboard.xaml b/ThorgApp/UI/Dashboard.xaml index 82881ed..f2662c6 100644 --- a/ThorgApp/UI/Dashboard.xaml +++ b/ThorgApp/UI/Dashboard.xaml @@ -83,7 +83,7 @@ - + diff --git a/ThorgApp/UI/Icons/DefaultStyle/png/Charity.png b/ThorgApp/UI/Icons/DefaultStyle/png/Charity.png new file mode 100644 index 0000000..a7abcfe --- /dev/null +++ b/ThorgApp/UI/Icons/DefaultStyle/png/Charity.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50404b64ba5441b784e44ce195c99c1a185b15ffb46390454583b8ec50d0f36a +size 995 diff --git a/ThorgApp/UI/Themes/Buttons/NavSidepanelButton.xaml b/ThorgApp/UI/Themes/Buttons/NavSidepanelButton.xaml index 5db2277..a4247b6 100644 --- a/ThorgApp/UI/Themes/Buttons/NavSidepanelButton.xaml +++ b/ThorgApp/UI/Themes/Buttons/NavSidepanelButton.xaml @@ -94,6 +94,42 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + From 9a156f294097b27989c7a87d73bef99390505392 Mon Sep 17 00:00:00 2001 From: Patryk Wysocki Date: Wed, 18 May 2022 09:14:16 +0200 Subject: [PATCH 07/17] Finishing layout and logic --- ThorgApp/Src/BenchmarkService.cs | 1 - ThorgApp/UI/DashboardCharity.xaml | 5 ++- ThorgApp/UI/DashboardCharity.xaml.cs | 32 +++++++++++++++- ThorgApp/ViewModel/CharityViewModel.cs | 51 +++++++++++++++++++------- 4 files changed, 72 insertions(+), 17 deletions(-) diff --git a/ThorgApp/Src/BenchmarkService.cs b/ThorgApp/Src/BenchmarkService.cs index 502ae11..874e5b7 100644 --- a/ThorgApp/Src/BenchmarkService.cs +++ b/ThorgApp/Src/BenchmarkService.cs @@ -14,7 +14,6 @@ using System.Windows; using GolemUI.Miners.Phoenix; using GolemUI.Miners.TRex; -using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox; namespace GolemUI.Src { diff --git a/ThorgApp/UI/DashboardCharity.xaml b/ThorgApp/UI/DashboardCharity.xaml index 2e8503f..e90f510 100644 --- a/ThorgApp/UI/DashboardCharity.xaml +++ b/ThorgApp/UI/DashboardCharity.xaml @@ -111,13 +111,13 @@ - - - - + - - - - -