private void ButtonSettings_Click(object sender, EventArgs e) { var settings = new Form_Settings(); SetChildFormCenter(settings); settings.ShowDialog(); if (settings.IsChange && settings.IsChangeSaved && settings.IsRestartNeeded) { MessageBox.Show( International.GetText("Form_Main_Restart_Required_Msg"), International.GetText("Form_Main_Restart_Required_Title"), MessageBoxButtons.OK, MessageBoxIcon.Information); var pHandle = new Process { StartInfo = { FileName = Application.ExecutablePath } }; pHandle.Start(); Close(); } else if (settings.IsChange && settings.IsChangeSaved) { InitLocalization(); InitMainConfigGuiData(); } }
private void buttonSettings_Click(object sender, EventArgs e) { Form_Settings Settings = new Form_Settings(); SetChildFormCenter(Settings); Settings.ShowDialog(); if (Settings.IsChange && Settings.IsChangeSaved && Settings.IsRestartNeeded) { MessageBox.Show( International.GetText("Form_Main_Restart_Required_Msg"), International.GetText("Form_Main_Restart_Required_Title"), MessageBoxButtons.OK, MessageBoxIcon.Information); Process PHandle = new Process(); PHandle.StartInfo.FileName = Application.ExecutablePath; PHandle.Start(); Close(); } else if (Settings.IsChange && Settings.IsChangeSaved) { InitLocalization(); InitMainConfigGUIData(); UpdateGlobalRate(); // update currency changes } }
private void ButtonSettings_Click(object sender, EventArgs e) { var settings = new Form_Settings(); SetChildFormCenter(settings); settings.ShowDialog(); if (settings.IsChange && settings.IsChangeSaved && settings.IsRestartNeeded) { MessageBox.Show( Tr("Settings change requires NiceHash Miner Legacy to restart."), Tr("Restart Notice"), MessageBoxButtons.OK, MessageBoxIcon.Information); var pHandle = new Process { StartInfo = { FileName = Application.ExecutablePath } }; pHandle.Start(); Close(); } else if (settings.IsChange && settings.IsChangeSaved) { InitLocalization(); InitMainConfigGuiData(); } }
private void buttonSettings_Click(object sender, EventArgs e) { if (!Config.ConfigData.UseNewSettingsPage) { Process PHandle = new Process(); PHandle.StartInfo.FileName = Application.ExecutablePath; PHandle.StartInfo.Arguments = "-config"; PHandle.Start(); Close(); } else { Form_Settings Settings = new Form_Settings(); Settings.ShowDialog(); if (Settings.ret == 1) { return; } Process PHandle = new Process(); PHandle.StartInfo.FileName = Application.ExecutablePath; PHandle.Start(); Close(); } }
private void ButtonSettings_Click(object sender, EventArgs e) { using (var settings = new Form_Settings()) { SetChildFormCenter(settings); ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Settings; settings.ShowDialog(); ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Main; if (settings.IsRestartNeeded) { if (!settings.SetDefaults) { MessageBox.Show( Tr("Settings change requires {0} to restart.", NHMProductInfo.Name), Tr("Restart Notice"), MessageBoxButtons.OK, MessageBoxIcon.Information); } ApplicationStateManager.RestartProgram(); return; } } InitMainConfigGuiData(); // TODO check this later IdleCheckManager.StartIdleCheck(ConfigManager.GeneralConfig.IdleCheckType, IdleCheck); }
private void button4_Click(object sender, EventArgs e) { if (MessageBox.Show("Editing additional settings is for advanced users.\r\n\r\nIf " + ProductName + " crashes due to bad config value you can restore it by deleting 'config.json' file.\r\n\r\nContinue with editing settings?", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No) { return; } if (!Config.ConfigData.UseNewSettingsPage) { Process PHandle = new Process(); PHandle.StartInfo.FileName = Application.ExecutablePath; PHandle.StartInfo.Arguments = "-config"; PHandle.Start(); Close(); } else { Form_Settings Settings = new Form_Settings(); Settings.ShowDialog(); Settings = null; // Update GUI if (Config.ConfigData.Location >= 0 && Config.ConfigData.Location < MiningLocation.Length) { comboBox1.SelectedIndex = Config.ConfigData.Location; } else { comboBox1.SelectedIndex = 0; } textBox1.Text = Config.ConfigData.BitcoinAddress; textBox2.Text = Config.ConfigData.WorkerName; MessageBox.Show(Application.ProductName + " will exit now. This new settings dialog is still in beta and " + Application.ProductName + " needs to restart to take effect.", "Restarting " + Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); Process PHandle = new Process(); PHandle.StartInfo.FileName = Application.ExecutablePath; PHandle.Start(); Close(); } }