|
|
|
|
@ -634,16 +634,10 @@ namespace AM2RLauncher
|
|
|
|
|
log.Info("Use Custom Mirror option has been set to " + customMirrorCheck.Checked + ".");
|
|
|
|
|
CrossPlatformOperations.WriteToConfig("CustomMirrorEnabled", (bool)customMirrorCheck.Checked);
|
|
|
|
|
|
|
|
|
|
bool enabled = (bool)customMirrorCheck.Checked;
|
|
|
|
|
customMirrorTextBox.Enabled = enabled;
|
|
|
|
|
mirrorDropDown.Enabled = !enabled;
|
|
|
|
|
// Not sure why the dropdown menu needs this hack, but the textBox does not.
|
|
|
|
|
if (OS.IsWindows)
|
|
|
|
|
mirrorDropDown.TextColor = mirrorDropDown.Enabled ? colGreen : colInactive;
|
|
|
|
|
mirrorLabel.TextColor = !enabled ? colGreen : colInactive;
|
|
|
|
|
EnableMirrorControlsAccordingly();
|
|
|
|
|
|
|
|
|
|
// Create warning dialog when enabling
|
|
|
|
|
if (enabled)
|
|
|
|
|
if ((bool)customMirrorCheck.Checked)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(this, Text.WarningWindowText, Text.WarningWindowTitle, MessageBoxType.Warning);
|
|
|
|
|
currentMirror = customMirrorTextBox.Text;
|
|
|
|
|
@ -655,18 +649,6 @@ namespace AM2RLauncher
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO: why exactly do we need this?
|
|
|
|
|
/// <summary>Gets called when <see cref="customMirrorCheck"/> gets loaded.
|
|
|
|
|
/// Enables and changes colors for <see cref="customMirrorTextBox"/> and <see cref="mirrorDropDown"/> accordingly.</summary>
|
|
|
|
|
private void CustomMirrorCheckLoadComplete(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
bool enabled = (bool)customMirrorCheck.Checked;
|
|
|
|
|
customMirrorTextBox.Enabled = enabled;
|
|
|
|
|
mirrorDropDown.Enabled = !enabled;
|
|
|
|
|
if (OS.IsWindows)
|
|
|
|
|
mirrorDropDown.TextColor = mirrorDropDown.Enabled ? colGreen : colInactive;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If the <see cref="customMirrorTextBox"/> has lost focus, we set its text as the new <see cref="currentMirror"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
|