Ejemplo n.º 1
0
 public SettingsWindow(Redshift.ExecutableError initialRedshiftErrorNote)
 {
     InitializeComponent();
     LoadPosition();
     LoadConfig();
     ExecutableErrorState = initialRedshiftErrorNote;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public SettingsWindow()
 {
     InitializeComponent();
     LoadPosition();
     LoadConfig();
     ExecutableErrorState = Redshift.CheckExecutable(RedshiftPath.Text);
     SetOkButtonEnabled();
 }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
 private void redshiftPath_LostFocus(object sender, RoutedEventArgs e)
 {
     ExecutableErrorState = Redshift.CheckExecutable(RedshiftPath.Text);
 }
Ejemplo n.º 6
0
        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);
              }
        }
Ejemplo n.º 7
0
 private void redshiftPath_LostFocus(object sender, RoutedEventArgs e)
 {
     ExecutableErrorState = Redshift.CheckExecutable(RedshiftPath.Text);
 }