diff --git a/ThorgApp/App.config b/ThorgApp/App.config
index 047516f..5af930f 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/App.xaml.cs b/ThorgApp/App.xaml.cs
index f8a6661..7f9136f 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));
@@ -113,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/Command/Provider.cs b/ThorgApp/Command/Provider.cs
index db285a8..bb80157 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 double? 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/DesignViewModel/CharityViewModel.cs b/ThorgApp/DesignViewModel/CharityViewModel.cs
new file mode 100644
index 0000000..06d48ea
--- /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 double CharityPercentage => 0.2f;
+ }
+}
diff --git a/ThorgApp/Interfaces/IProviderConfig.cs b/ThorgApp/Interfaces/IProviderConfig.cs
index b000754..5264bb6 100644
--- a/ThorgApp/Interfaces/IProviderConfig.cs
+++ b/ThorgApp/Interfaces/IProviderConfig.cs
@@ -25,6 +25,7 @@ public interface IProviderConfig : INotifyPropertyChanged
public void UpdateActiveCpuThreadsCount(int threadsCount);
void UpdateWalletAddress(string? walletAddress = null);
void UpdateNodeName(string? value);
+ void UpdateCharity(string? wallet, double? procentage);
Task Prepare(bool isGpuCapable, bool isLowMemoryMode);
}
diff --git a/ThorgApp/Properties/Settings.Designer.cs b/ThorgApp/Properties/Settings.Designer.cs
index 7b4d0dd..d27be7a 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.2.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -226,7 +226,7 @@ public string dialog_antivir_message {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("No worries though! We will soon release an update with support for cards that hav" +
"e less than 6B of RAM. Also, stay tuned for CPU support that is just around the " +
- "corner.\nTill then you can explore the app and get to know Thorg a bit better!")]
+ "corner.\r\nTill then you can explore the app and get to know Thorg a bit better!")]
public string dialog_gpu_message {
get {
return ((string)(this["dialog_gpu_message"]));
diff --git a/ThorgApp/Properties/Settings.settings b/ThorgApp/Properties/Settings.settings
index 56a796f..f4a17fa 100644
--- a/ThorgApp/Properties/Settings.settings
+++ b/ThorgApp/Properties/Settings.settings
@@ -66,15 +66,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/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/Src/ProviderConfigService.cs b/ThorgApp/Src/ProviderConfigService.cs
index afd7bd3..261c5d1 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
{
@@ -282,5 +282,20 @@ public async Task Prepare(bool isGpuCapable, bool isLowMemoryMode)
}
}
}
+
+ public void UpdateCharity(string? charityAccount, double? charityAmmount)
+ {
+ var config = Config ?? _provider.Config;
+ if (config != null)
+ {
+ config.CharityAccount = charityAccount;
+ config.CharityAmmount = charityAmmount;
+ _provider.Config = Config;
+ }
+ OnPropertyChanged("Config");
+ OnPropertyChanged("CharityWallet");
+ OnPropertyChanged("CharityAmmount");
+ }
+
}
}
diff --git a/ThorgApp/ThorgApp.csproj b/ThorgApp/ThorgApp.csproj
index aff5097..893e7ef 100644
--- a/ThorgApp/ThorgApp.csproj
+++ b/ThorgApp/ThorgApp.csproj
@@ -97,6 +97,7 @@
MSBuild:CompileDesigner
+
@@ -136,6 +137,9 @@
+
+ DashboardCharity.xaml
+ DashboardTRex.xaml
@@ -288,9 +292,11 @@
UsageDescription.xaml
+
+
@@ -339,6 +345,10 @@
DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
@@ -992,5 +1002,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ThorgApp/UI/Dashboard.xaml b/ThorgApp/UI/Dashboard.xaml
index a6c8f62..4753017 100644
--- a/ThorgApp/UI/Dashboard.xaml
+++ b/ThorgApp/UI/Dashboard.xaml
@@ -83,6 +83,7 @@
+
diff --git a/ThorgApp/UI/Dashboard.xaml.cs b/ThorgApp/UI/Dashboard.xaml.cs
index 9cf8881..2abdac4 100644
--- a/ThorgApp/UI/Dashboard.xaml.cs
+++ b/ThorgApp/UI/Dashboard.xaml.cs
@@ -47,6 +47,7 @@ public partial class Dashboard : Window
public Dashboard(DashboardSettingsAdv _dashboardSettingsAdv, INotificationService notificationService, IUserFeedbackService userFeedback, Interfaces.IProcessController processController, Src.SingleInstanceLock singleInstanceLock, Interfaces.IProviderConfig providerConfig, Src.BenchmarkService benchmarkService, Interfaces.IUserSettingsProvider userSettingsProvider, ViewModel.DashboardViewModel dashboardViewModel, NotificationBarViewModel notificationViewModel,
PhoenixMiner phoenixMiner, TRexMiner trexMiner)
{
+
_phoenixMiner = phoenixMiner;
_trexMiner = trexMiner;
diff --git a/ThorgApp/UI/DashboardCharity.xaml b/ThorgApp/UI/DashboardCharity.xaml
new file mode 100644
index 0000000..af5c156
--- /dev/null
+++ b/ThorgApp/UI/DashboardCharity.xaml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ThorgApp/UI/DashboardCharity.xaml.cs b/ThorgApp/UI/DashboardCharity.xaml.cs
new file mode 100644
index 0000000..be9e616
--- /dev/null
+++ b/ThorgApp/UI/DashboardCharity.xaml.cs
@@ -0,0 +1,110 @@
+
+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;
+using GolemUI.Src.AppNotificationService;
+using GolemUI.ViewModel.Dialogs;
+using System;
+
+namespace GolemUI
+{
+ public partial class DashboardCharity : UserControl
+ {
+ public CharityViewModel ViewModel;
+ INotificationService _notificationService;
+
+ public DashboardCharity(CharityViewModel viewModel, INotificationService notificationService)
+ {
+ InitializeComponent();
+ ViewModel = viewModel;
+ this.DataContext = this.ViewModel;
+ _notificationService = notificationService;
+
+ //Window mainWindow = Application.Current.MainWindow;
+ //mainWindow.SizeChanged += MainWindow_SizeChanged;
+ }
+
+ private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ var margin = CurrentPercentage.Margin;
+
+ //Point position = desiredElement.PointToScreen(new Point(0d, 0d));
+ Point minPosition = MinPercentage.PointToScreen(new Point(0d, 0d));
+ Point maxPosition = MaxPercentage.PointToScreen(new Point(0d, 0d));
+ Vector distance = ((Vector)maxPosition) - ((Vector)minPosition);
+ Vector offset = (Vector)(distance * ViewModel.CharityPercentage);
+
+ //Bit of magic numbering to make it look right
+ margin.Left = offset.X / 1.5 - 10;
+
+ CurrentPercentage.Margin = margin;
+ }
+
+ private void notifyAboutChanges()
+ {
+ BtnConfirmChanges.IsEnabled = true;
+ }
+
+ private void BtnWithdraw_Click(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CommitChanges();
+ BtnConfirmChanges.IsEnabled = false;
+ }
+
+ private void BtnCopyWalletAddress_Click(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.CharityWallet != null)
+ {
+ _notificationService.PushNotification(new SimpleNotificationObject(Src.AppNotificationService.Tag.Clipboard, "eth address has been copied to clipboard", expirationTimeInMs: 5000));
+ Clipboard.SetText(ViewModel.CharityWallet);
+ }
+ }
+
+ private void BtnEditWalletAddress_Click(object sender, RoutedEventArgs e)
+ {
+ var dlg = new UI.Dialogs.DlgEditAddress(ViewModel.EditModel);
+ dlg.Owner = Window.GetWindow(this);
+ ViewModel.RequestDarkBackgroundVisibilityChange(true);
+ if (dlg != null && dlg.Model != null && (dlg.ShowDialog() ?? false))
+ {
+ ViewModel.UpdateAddress(dlg.Model.ChangeAction, dlg.Model.NewAddress);
+ notifyAboutChanges();
+ }
+ ViewModel.RequestDarkBackgroundVisibilityChange(false);
+ }
+
+ private void slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
+ {
+ if (e.NewValue != ViewModel.CharityPercentage)
+ {
+ notifyAboutChanges();
+ }
+ ViewModel.CharityPercentage = e.NewValue;
+ var margin = CurrentPercentage.Margin;
+
+ Point minPosition = MinPercentage.PointToScreen(new Point(0d, 0d));
+ Point maxPosition = MaxPercentage.PointToScreen(new Point(0d, 0d));
+ Vector distance = ((Vector)maxPosition) - ((Vector)minPosition);
+ Vector offset = (Vector)(distance * ViewModel.CharityPercentage);
+
+ //Bit of magic numbering to make it look right
+ margin.Left = offset.X / 1.5 - 10;
+
+ CurrentPercentage.Margin = margin;
+ CurrentPercentage.Text = String.Format("{0:P0}", ViewModel.CharityPercentage);
+ }
+ }
+}
diff --git a/ThorgApp/UI/Icons/DefaultStyle/png/Charity.png b/ThorgApp/UI/Icons/DefaultStyle/png/Charity.png
new file mode 100644
index 0000000..d12a0e8
--- /dev/null
+++ b/ThorgApp/UI/Icons/DefaultStyle/png/Charity.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:653be96f4470a13f2a12ac30870f0a7776d408da7ed91cd7026334edbe006857
+size 412
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 @@
+
+