/// <summary>
        /// The on load.
        /// </summary>
        public override void OnLoad()
        {
            // Check the CLI Executable.
            CliCheckHelper.CheckCLIVersion();

            // Perform an update check if required
            // this.updateService.PerformStartupUpdateCheck(this.HandleUpdateCheckResults);

            // Setup the presets.
            this.presetService.Load();
            if (this.presetService.CheckIfPresetsAreOutOfDate())
            {
                if (!this.userSettingService.GetUserSetting <bool>(UserSettingConstants.PresetNotification))
                {
                    this.errorService.ShowMessageBox(
                        "HandBrake has determined your built-in presets are out of date... These presets will now be updated." +
                        Environment.NewLine +
                        "Your custom presets have not been updated so you may have to re-create these by deleting and re-adding them.",
                        "Preset Update",
                        MessageBoxButton.OK,
                        MessageBoxImage.Information);
                }
            }

            this.SelectedPreset = this.presetService.DefaultPreset;

            // Log Cleaning
            if (this.userSettingService.GetUserSetting <bool>(UserSettingConstants.ClearOldLogs))
            {
                var clearLog = new Thread(() => GeneralUtilities.ClearLogFiles(30));
                clearLog.Start();
            }
            base.OnLoad();
        }
示例#2
0
        /// <summary>
        /// Clear HandBrakes log directory.
        /// </summary>
        public void ClearLogHistory()
        {
            MessageBoxResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs",
                                                      MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                GeneralUtilities.ClearLogFiles(0);
                MessageBox.Show("HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
示例#3
0
        private void btn_clearLogs_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs",
                                                  MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                GeneralUtilities.ClearLogFiles(0);
                MessageBox.Show(this, "HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
        }