private void btnNext_Click(object sender, EventArgs e) { if (!mNewPttConfiguration.Equals(mConfig.PTTConfiguration)) { mConfig.PTTConfiguration = mNewPttConfiguration; } mConfig.SaveConfig(); Host.SetupFinished(); }
private void BtnClose_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtNetworkLogin.Text)) { ShowError("VATSIM ID is required."); txtNetworkLogin.Select(); } else if (string.IsNullOrEmpty(txtNetworkPassword.Text)) { ShowError("VATSIM password is required."); txtNetworkPassword.Select(); } else if (string.IsNullOrEmpty(txtFullName.Text)) { ShowError("Name is required."); txtFullName.Select(); } else if (ddlServerName.SelectedIndex == -1) { ShowError("Please select a VATSIM server."); ddlServerName.Select(); } else { mConfig.DisableAudioEffects = chkDisableRadioEffects.Checked; mConfig.VatsimId = txtNetworkLogin.Text.Trim(); mConfig.VatsimPassword = txtNetworkPassword.Text.Trim(); mConfig.Name = txtFullName.Text; mConfig.HomeAirport = txtHomeAirport.Text; mConfig.ServerName = (ddlServerName.SelectedItem as NetworkServerItem).Text; mConfig.FlashTaskbarPrivateMessage = chkFlashPrivateMessage.Checked; mConfig.FlashTaskbarRadioMessage = chkFlashRadioMessage.Checked; mConfig.FlashTaskbarSelCal = chkFlashSelcal.Checked; mConfig.FlashTaskbarDisconnect = chkFlashDisconnect.Checked; mConfig.AutoSquawkModeC = chkAutoSquawkModeC.Checked; mConfig.KeepClientWindowVisible = chkKeepVisible.Checked; mConfig.CheckForUpdates = chkUpdates.Checked; mConfig.PlayGenericSelCalAlert = chkSelcalSound.Checked; mConfig.PlayRadioMessageAlert = chkRadioMessageSound.Checked; mConfig.UpdateChannel = (UpdateChannel)cbUpdateChannel.SelectedValue; mConfig.VhfEqualizer = (EqualizerPresets)vhfEqualizer.SelectedValue; mConfig.VolumeKnobsControlVolume = chkVolumeKnobVolume.Checked; mConfig.TcpPort = (int)spinPluginPort.Value; if (!mNewPttConfiguration.Equals(mConfig.PTTConfiguration)) { mConfig.PTTConfiguration = mNewPttConfiguration; } if (!mToggleDisplayConfig.Equals(mConfig.ToggleDisplayConfiguration)) { mConfig.ToggleDisplayConfiguration = mToggleDisplayConfig; } mConfig.SaveConfig(); ClientConfigChanged?.Invoke(this, EventArgs.Empty); Close(); } }