Пример #1
0
        private void ShowMainWindow()
        {
            //Set defaults for GPUs
            if (Settings.Default.FirstLaunch)
            {
                if (MiningOperations.HasNVidia)
                {
                    Settings.Default.GPUMining = (byte)MiningOperations.GpuMiningSettings.NVidia;
                }
                else if (MiningOperations.HasAmd)
                {
                    Settings.Default.GPUMining = (byte)MiningOperations.GpuMiningSettings.Amd;
                }
                else
                {
                    Settings.Default.CPUMining = true;
                    Settings.Default.GPUMining = (byte)MiningOperations.GpuMiningSettings.None;
                }
                Settings.Default.GrsWalletAddress = MiningOperations.GetAddress();
                Settings.Default.FirstLaunch      = false;
                Settings.Default.Save();
            }
            MainWindow main = new MainWindow {
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };

            main.Show();
        }
 private void UxGetWalletAddressTxt_Click(object sender, RoutedEventArgs e)
 {
     if (!MiningOperations.WalletFileExists)
     {
         StartingGuide guide = new StartingGuide {
             WindowStartupLocation = WindowStartupLocation.CenterOwner,
             Owner = this,
         };
         guide.FromMainWindow = true;
         guide.ShowDialog();
     }
     else
     {
         if (TxtAddress.Text == MiningOperations.GetAddress())
         {
             return;
         }
         var messageBoxResult = MessageBox.Show(this, "Warning: Resetting your mining address will reset your rewards. Are you sure?", "Address Warning", MessageBoxButton.YesNo);
         if (messageBoxResult == MessageBoxResult.Yes)
         {
             TxtAddress.Text = MiningOperations.GetAddress();
         }
     }
 }
        private void PopulatePage()
        {
            if (Debugger.IsAttached)
            {
                Settings.Default.P2PoolSettings        = null;
                Settings.Default.CustomSettings        = null;
                Settings.Default.MiningPoolHubSettings = null;
                Settings.Default.SuprNovaSettings      = null;
            }


            uxIntervalSlider.Value          = Settings.Default.MineIntensity;
            TxtAddress.Text                 = string.IsNullOrEmpty(Settings.Default.GrsWalletAddress) ? MiningOperations.GetAddress() : Settings.Default.GrsWalletAddress;
            uxPoolSelectorDdl.SelectedIndex = Settings.Default.SelectedMiningPool;
            TxtPool.Text                 = MiningOperations.GetAddressForPool((MiningOperations.MiningPools)uxPoolSelectorDdl.SelectedIndex);
            TxtUsername.Text             = Settings.Default.MiningPoolUsername;
            TxtPassword.Text             = Settings.Default.MiningPoolPassword;
            uxAutoIntensityChk.IsChecked = Settings.Default.UseAutoIntensity;
            UxIntensityTxt.Text          = Settings.Default.MineIntensity.ToString();
            UxCpuTgl.IsChecked           = Settings.Default.CPUMining;
            uxnVidiaRb.IsChecked         = (MiningOperations.GpuMiningSettings)Settings.Default.GPUMining == MiningOperations.GpuMiningSettings.NVidia;
            uxnAMDRb.IsChecked           = (MiningOperations.GpuMiningSettings)Settings.Default.GPUMining == MiningOperations.GpuMiningSettings.Amd;


            WpCustom3.Visibility = uxnAMDRb.IsChecked == true ? Visibility.Visible : Visibility.Collapsed;

            if (uxAutoIntensityChk.IsChecked == true)
            {
                UxIntensityTxt.Visibility   = Visibility.Collapsed;
                uxIntervalSlider.Visibility = Visibility.Collapsed;
            }
            else
            {
                UxIntensityTxt.Visibility   = Visibility.Visible;
                uxIntervalSlider.Visibility = Visibility.Visible;
            }

            if (Settings.Default.P2PoolSettings == null)
            {
                Settings.Default.P2PoolSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.P2Pool),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.P2Pool),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.P2Pool)
                };
            }
            if (Settings.Default.CustomSettings == null)
            {
                Settings.Default.CustomSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.Custom),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.Custom),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.Custom)
                };
            }
            if (Settings.Default.MiningPoolHubSettings == null)
            {
                Settings.Default.MiningPoolHubSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.MiningPoolHub),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.MiningPoolHub),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.MiningPoolHub)
                };
            }
            if (Settings.Default.SuprNovaSettings == null)
            {
                Settings.Default.SuprNovaSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.Suprnova),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.Suprnova),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.Suprnova)
                };
            }
            Settings.Default.Save();
        }
Пример #4
0
        private void Populate()
        {
            if (File.Exists(MiningOperations.WalletFolder))
            {
                uxStepContent.Text =
                    "Groestlcoin EasyMiner has detected your receiving address from your default Electrum-GRS wallet. You can change this at any time if required." + Environment.NewLine + Environment.NewLine + "Receiving Address: " + MiningOperations.GetAddress();
                uxCheckInstallBtn.Visibility = Visibility.Collapsed;
                uxStepContent2.Visibility    = Visibility.Collapsed;
                uxStepContent3.Visibility    = Visibility.Collapsed;
            }
            else
            {
                uxStepContent2.Inlines.Clear();
                StringBuilder sb = new StringBuilder();
                sb.Append("Groestlcoin EasyMiner will automatically detect a receiving address from your Electrum-GRS Wallet.");
                sb.Append("You can download the Electrum-GRS Wallet from here:" + Environment.NewLine);
                uxStepContent.Text           = sb.ToString();
                uxCheckInstallBtn.Visibility = Visibility.Visible;
                uxStepContent2.Visibility    = Visibility.Visible;
                uxStepContent3.Visibility    = Visibility.Visible;
                Hyperlink link = new Hyperlink {
                    NavigateUri = new Uri("https://www.groestlcoin.org/groestlcoin-electrum-wallet/"),
                    Foreground  = Brushes.White
                };
                link.RequestNavigate += (sender, args) => {
                    System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(args.Uri.AbsoluteUri));
                    args.Handled = true;
                };
                link.Inlines.Add("Electrum GRS");
                uxStepContent2.Inlines.Add(link);
                uxStepContent3.Text =
                    "Install the Electrum-GRS Wallet. Once it is installed, click 'Check Electrum Install'. This should find your receiving address.";

                if (Attempts >= 5)
                {
                    System.Windows.MessageBox.Show(
                        "Electrum-GRS has not been found. Please ensure you have the latest Electrum-GRS wallet installed.");
                }
            }


            if (MiningOperations.HasNVidia)
            {
                uxHardwareTxt.Text = "Setup has detected that you are using an nVidia graphics card. This will be automatically set. If this is wrong, please change before starting to mine.";
            }
            else if (MiningOperations.HasAmd)
            {
                uxHardwareTxt.Text = "Setup has detected that you are using an AMD graphics card. This will be automatically set. If this is wrong, please change before starting to mine.";
            }
            else
            {
                uxHardwareTxt.Text = "Setup has not detected any graphics card. CPU mining will be automatically set. If this is wrong, please change before starting to mine.";
            }
        }