예제 #1
0
        public MainWindow()
        {
            InitializeComponent();


            SettingsHandler.InitializeNormalizationMethods();
            if (!FileMgr.CheckCustomPath())
            {
                MessageBox.Show("Could not write to given output path. Using own directory!", "Path");
            }

            selectedFilesDataGrid.CellEditEnding += DataGrid_CellEditEnding;

            double locationLeft = Settings.Default.Main_Window_Location_Left;
            double locationTop  = Settings.Default.Main_Window_Location_Top;

            if (locationLeft != 0 && locationTop != 0)
            {
                if (locationLeft < -1000 || locationLeft > 1000 || locationTop < -1000 || locationTop > 1000)
                {
                    WindowStartupLocation = WindowStartupLocation.CenterScreen;
                }
                else
                {
                    WindowStartupLocation = WindowStartupLocation.Manual;
                    Left = Settings.Default.Main_Window_Location_Left;
                    Top  = Settings.Default.Main_Window_Location_Top;
                }
            }


            versionLabel.Text    = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion;
            UpdateMenu.IsEnabled = Globals.ConnectionSuccessful ? true : false;
            if (!Globals.ConnectionSuccessful)
            {
                MessageBox.Show("There was a problem reaching the Remote Server\nUpdates will be disabled!\nCheck your internet and/or proxy settings!");
            }

            if (Globals.UpdateAvailable)
            {
                if (MessageBox.Show("Updates available!\nDo you want to start the Update?", "Update", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    UpdateHandler.StartUpdate();
                }
            }


            InitializeUIState();
            ComboBoxColumn.ItemsSource = SettingsHandler.GetStringNormalizationMethods();
        }
예제 #2
0
        private void SaveSettings(object sender, RoutedEventArgs e)
        {
            if (CustomFolderOutputCheckBox.IsChecked.Value && OutputpathBox.Text == "")
            {
                MessageBox.Show("You cannot save an empty output directory. Please choose a valid path!");
                CustomFolderOutputCheckBox.IsChecked = false;
                return;
            }

            if (CustomFolderOutputCheckBox.IsChecked.Value && !FileMgr.CheckCustomPath(OutputpathBox.Text))
            {
                MessageBox.Show("Directory is not writeable! Please choose another directory");
                CustomFolderOutputCheckBox.IsChecked = false;
                OutputpathBox.Text = "";
                return;
            }

            Settings.Default.CustomOutputPath       = OutputpathBox.Text;
            Settings.Default.CustomOutputPathActive = CustomFolderOutputCheckBox.IsChecked.Value;
            Settings.Default.Save();
        }