public SettingsWindow(Redshift.ExecutableError initialRedshiftErrorNote) { InitializeComponent(); LoadPosition(); LoadConfig(); ExecutableErrorState = initialRedshiftErrorNote; }
private bool CheckSettings() { Redshift.ExecutableError exeError = Redshift.CheckExecutable(RedshiftPath); if (exeError == Redshift.ExecutableError.Ok) { return(true); } SettingsWindow settingsWindow; if (Common.WindowExistsFocus(out settingsWindow)) { return(true); } settingsWindow = new SettingsWindow(); if (!(bool)settingsWindow.ShowDialog()) { return(false); } LoadSettings(); return(true); }
public SettingsWindow() { InitializeComponent(); LoadPosition(); LoadConfig(); ExecutableErrorState = Redshift.CheckExecutable(RedshiftPath.Text); SetOkButtonEnabled(); }
private void ButtonRedshift_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog { Title = "Redshift path", Filter = "Redshift|redshift.exe|All executables|*.exe", CheckFileExists = true }; if (File.Exists(RedshiftPath.Text)) { openFileDialog.InitialDirectory = Path.GetDirectoryName(RedshiftPath.Text); } if ((bool)openFileDialog.ShowDialog()) { Settings.Default.RedshiftAppPath = openFileDialog.FileName; ExecutableErrorState = Redshift.CheckExecutable(RedshiftPath.Text); } }
private void redshiftPath_LostFocus(object sender, RoutedEventArgs e) { ExecutableErrorState = Redshift.CheckExecutable(RedshiftPath.Text); }
private void ButtonRedshift_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = "Redshift path"; openFileDialog.Filter = "Redshift|redshift.exe|All executables|*.exe"; openFileDialog.CheckFileExists = true; if(File.Exists(RedshiftPath.Text)) { openFileDialog.InitialDirectory = Path.GetDirectoryName(RedshiftPath.Text); } if((bool)openFileDialog.ShowDialog()) { RedshiftPath.Text = openFileDialog.FileName; ExecutableErrorState = Redshift.CheckExecutable(RedshiftPath.Text); } }