public OptionsDialogViewModel(IUpdater updateService) { this.updater = updateService; this.updater.UpdateDownloadProgress += this.OnUpdateDownloadProgress; this.updater.UpdateStateChanged += this.OnUpdateStateChanged; this.updatesEnabledConfig = Config.UpdatesEnabled; this.defaultPath = Config.AutoNameOutputFolder; this.customFormat = Config.AutoNameCustomFormat; this.customFormatString = Config.AutoNameCustomFormatString; this.outputToSourceDirectory = Config.OutputToSourceDirectory; this.preserveFolderStructureInBatch = Config.PreserveFolderStructureInBatch; this.useCustomPreviewFolder = Config.UseCustomPreviewFolder; this.previewOutputFolder = Config.PreviewOutputFolder; this.whenFileExists = CustomConfig.WhenFileExists; this.whenFileExistsBatch = CustomConfig.WhenFileExistsBatch; this.minimizeToTray = Config.MinimizeToTray; this.useCustomVideoPlayer = Config.UseCustomVideoPlayer; this.customVideoPlayer = Config.CustomVideoPlayer; this.playSoundOnCompletion = Config.PlaySoundOnCompletion; this.useCustomCompletionSound = Config.UseCustomCompletionSound; this.customCompletionSound = Config.CustomCompletionSound; this.autoAudio = CustomConfig.AutoAudio; this.audioLanguageCode = Config.AudioLanguageCode; this.autoAudioAll = Config.AutoAudioAll; this.autoSubtitle = CustomConfig.AutoSubtitle; this.autoSubtitleBurnIn = Config.AutoSubtitleBurnIn; this.autoSubtitleLanguageDefault = Config.AutoSubtitleLanguageDefault; this.autoSubtitleLanguageBurnIn = Config.AutoSubtitleLanguageBurnIn; this.subtitleLanguageCode = Config.SubtitleLanguageCode; this.autoSubtitleOnlyIfDifferent = Config.AutoSubtitleOnlyIfDifferent; this.autoSubtitleAll = Config.AutoSubtitleAll; this.workerProcessPriority = Config.WorkerProcessPriority; this.logVerbosity = Config.LogVerbosity; this.copyLogToOutputFolder = Config.CopyLogToOutputFolder; this.previewCount = Config.PreviewCount; this.rememberPreviousFiles = Config.RememberPreviousFiles; this.showAudioTrackNameField = Config.ShowAudioTrackNameField; this.keepScansAfterCompletion = Config.KeepScansAfterCompletion; this.dxvaDecoding = Config.DxvaDecoding; this.enableLibDvdNav = Config.EnableLibDvdNav; this.deleteSourceFilesOnClearingCompleted = Config.DeleteSourceFilesOnClearingCompleted; this.preserveModifyTimeFiles = Config.PreserveModifyTimeFiles; this.resumeEncodingOnRestart = Config.ResumeEncodingOnRestart; this.useWorkerProcess = Config.UseWorkerProcess; this.minimumTitleLengthSeconds = Config.MinimumTitleLengthSeconds; this.autoPauseProcesses = new ObservableCollection<string>(); this.videoFileExtensions = Config.VideoFileExtensions; List<string> autoPauseList = CustomConfig.AutoPauseProcesses; if (autoPauseList != null) { foreach (string process in autoPauseList) { this.autoPauseProcesses.Add(process); } } // List of language codes and names: http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx this.languageChoices = new List<InterfaceLanguage> { new InterfaceLanguage { CultureCode = string.Empty, Display = OptionsRes.UseOSLanguage }, new InterfaceLanguage { CultureCode = "en-US", Display = "English" }, new InterfaceLanguage { CultureCode = "cs-CZ", Display = "čeština / Czech" }, new InterfaceLanguage { CultureCode = "de-DE", Display = "Deutsch / German" }, new InterfaceLanguage { CultureCode = "es-ES", Display = "Español / Spanish" }, new InterfaceLanguage { CultureCode = "eu-ES", Display = "Euskara / Basque" }, new InterfaceLanguage { CultureCode = "fr-FR", Display = "Français / French" }, new InterfaceLanguage { CultureCode = "it-IT", Display = "italiano / Italian" }, new InterfaceLanguage { CultureCode = "hu-HU", Display = "Magyar / Hungarian" }, new InterfaceLanguage { CultureCode = "pl-PL", Display = "polski / Polish" }, new InterfaceLanguage { CultureCode = "pt-PT", Display = "Português / Portuguese" }, new InterfaceLanguage { CultureCode = "pt-BR", Display = "Português (Brasil) / Portuguese (Brazil)" }, new InterfaceLanguage { CultureCode = "tr-TR", Display = "Türkçe / Turkish" }, new InterfaceLanguage { CultureCode = "ru-RU", Display = "русский / Russian" }, new InterfaceLanguage { CultureCode = "zh-Hans", Display = "中文(简体) / Chinese (Simplified)" }, new InterfaceLanguage { CultureCode = "zh-Hant", Display = "中文(繁體) / Chinese (Traditional)" }, new InterfaceLanguage { CultureCode = "ja-JP", Display = "日本語 / Japanese" }, }; this.priorityChoices = new List<ComboChoice> { new ComboChoice("High", OptionsRes.Priority_High), new ComboChoice("AboveNormal", OptionsRes.Priority_AboveNormal), new ComboChoice("Normal", OptionsRes.Priority_Normal), new ComboChoice("BelowNormal", OptionsRes.Priority_BelowNormal), new ComboChoice("Idle", OptionsRes.Priority_Idle), }; this.interfaceLanguage = this.languageChoices.FirstOrDefault(l => l.CultureCode == Config.InterfaceLanguageCode); if (this.interfaceLanguage == null) { this.interfaceLanguage = this.languageChoices[0]; } this.playerChoices = Players.All; if (this.playerChoices.Count > 0) { this.selectedPlayer = this.playerChoices[0]; foreach (IVideoPlayer player in this.playerChoices) { if (player.Id == Config.PreferredPlayer) { this.selectedPlayer = player; break; } } } #if !BETA var betaInfoWorker = new BackgroundWorker(); betaInfoWorker.DoWork += (o, e) => { this.betaInfo = Updater.GetUpdateInfo(true); }; betaInfoWorker.RunWorkerCompleted += (o, e) => { this.betaInfoAvailable = false; if (this.betaInfo != null) { if (Utilities.CompareVersions(this.betaInfo.LatestVersion, Utilities.CurrentVersion) > 0) { this.betaInfoAvailable = true; } } this.RaisePropertyChanged(() => this.BetaChangelogUrl); this.RaisePropertyChanged(() => this.BetaSectionVisible); }; betaInfoWorker.RunWorkerAsync(); #endif this.SelectedTabIndex = Config.OptionsDialogLastTab; this.RefreshUpdateStatus(); }
public OptionsDialogViewModel(IUpdater updateService) { this.updater = updateService; this.updater.UpdateDownloadProgress += this.OnUpdateDownloadProgress; this.updater.UpdateStateChanged += this.OnUpdateStateChanged; this.updatesEnabledConfig = Config.UpdatesEnabled; this.defaultPath = Config.AutoNameOutputFolder; this.customFormat = Config.AutoNameCustomFormat; this.customFormatString = Config.AutoNameCustomFormatString; this.outputToSourceDirectory = Config.OutputToSourceDirectory; this.preserveFolderStructureInBatch = Config.PreserveFolderStructureInBatch; this.useCustomPreviewFolder = Config.UseCustomPreviewFolder; this.previewOutputFolder = Config.PreviewOutputFolder; this.whenFileExists = CustomConfig.WhenFileExists; this.whenFileExistsBatch = CustomConfig.WhenFileExistsBatch; this.minimizeToTray = Config.MinimizeToTray; this.useCustomVideoPlayer = Config.UseCustomVideoPlayer; this.customVideoPlayer = Config.CustomVideoPlayer; this.playSoundOnCompletion = Config.PlaySoundOnCompletion; this.useCustomCompletionSound = Config.UseCustomCompletionSound; this.customCompletionSound = Config.CustomCompletionSound; this.autoAudio = CustomConfig.AutoAudio; this.audioLanguageCode = Config.AudioLanguageCode; this.autoAudioAll = Config.AutoAudioAll; this.autoSubtitle = CustomConfig.AutoSubtitle; this.autoSubtitleBurnIn = Config.AutoSubtitleBurnIn; this.autoSubtitleLanguageDefault = Config.AutoSubtitleLanguageDefault; this.autoSubtitleLanguageBurnIn = Config.AutoSubtitleLanguageBurnIn; this.subtitleLanguageCode = Config.SubtitleLanguageCode; this.autoSubtitleOnlyIfDifferent = Config.AutoSubtitleOnlyIfDifferent; this.autoSubtitleAll = Config.AutoSubtitleAll; this.workerProcessPriority = Config.WorkerProcessPriority; this.logVerbosity = Config.LogVerbosity; this.copyLogToOutputFolder = Config.CopyLogToOutputFolder; this.previewCount = Config.PreviewCount; this.rememberPreviousFiles = Config.RememberPreviousFiles; this.showAudioTrackNameField = Config.ShowAudioTrackNameField; this.keepScansAfterCompletion = Config.KeepScansAfterCompletion; this.dxvaDecoding = Config.DxvaDecoding; this.enableLibDvdNav = Config.EnableLibDvdNav; this.deleteSourceFilesOnClearingCompleted = Config.DeleteSourceFilesOnClearingCompleted; this.preserveModifyTimeFiles = Config.PreserveModifyTimeFiles; this.resumeEncodingOnRestart = Config.ResumeEncodingOnRestart; this.useWorkerProcess = Config.UseWorkerProcess; this.minimumTitleLengthSeconds = Config.MinimumTitleLengthSeconds; this.autoPauseProcesses = new ObservableCollection <string>(); this.videoFileExtensions = Config.VideoFileExtensions; List <string> autoPauseList = CustomConfig.AutoPauseProcesses; if (autoPauseList != null) { foreach (string process in autoPauseList) { this.autoPauseProcesses.Add(process); } } // List of language codes and names: http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx this.languageChoices = new List <InterfaceLanguage> { new InterfaceLanguage { CultureCode = string.Empty, Display = OptionsRes.UseOSLanguage }, new InterfaceLanguage { CultureCode = "en-US", Display = "English" }, new InterfaceLanguage { CultureCode = "cs-CZ", Display = "čeština / Czech" }, new InterfaceLanguage { CultureCode = "de-DE", Display = "Deutsch / German" }, new InterfaceLanguage { CultureCode = "es-ES", Display = "Español / Spanish" }, new InterfaceLanguage { CultureCode = "eu-ES", Display = "Euskara / Basque" }, new InterfaceLanguage { CultureCode = "fr-FR", Display = "Français / French" }, new InterfaceLanguage { CultureCode = "it-IT", Display = "italiano / Italian" }, new InterfaceLanguage { CultureCode = "hu-HU", Display = "Magyar / Hungarian" }, new InterfaceLanguage { CultureCode = "pl-PL", Display = "polski / Polish" }, new InterfaceLanguage { CultureCode = "pt-PT", Display = "Português / Portuguese" }, new InterfaceLanguage { CultureCode = "pt-BR", Display = "Português (Brasil) / Portuguese (Brazil)" }, new InterfaceLanguage { CultureCode = "tr-TR", Display = "Türkçe / Turkish" }, new InterfaceLanguage { CultureCode = "ru-RU", Display = "русский / Russian" }, new InterfaceLanguage { CultureCode = "zh-Hans", Display = "中文(简体) / Chinese (Simplified)" }, new InterfaceLanguage { CultureCode = "zh-Hant", Display = "中文(繁體) / Chinese (Traditional)" }, new InterfaceLanguage { CultureCode = "ja-JP", Display = "日本語 / Japanese" }, }; this.priorityChoices = new List <ComboChoice> { new ComboChoice("High", OptionsRes.Priority_High), new ComboChoice("AboveNormal", OptionsRes.Priority_AboveNormal), new ComboChoice("Normal", OptionsRes.Priority_Normal), new ComboChoice("BelowNormal", OptionsRes.Priority_BelowNormal), new ComboChoice("Idle", OptionsRes.Priority_Idle), }; this.interfaceLanguage = this.languageChoices.FirstOrDefault(l => l.CultureCode == Config.InterfaceLanguageCode); if (this.interfaceLanguage == null) { this.interfaceLanguage = this.languageChoices[0]; } this.playerChoices = Players.All; if (this.playerChoices.Count > 0) { this.selectedPlayer = this.playerChoices[0]; foreach (IVideoPlayer player in this.playerChoices) { if (player.Id == Config.PreferredPlayer) { this.selectedPlayer = player; break; } } } #if !BETA var betaInfoWorker = new BackgroundWorker(); betaInfoWorker.DoWork += (o, e) => { this.betaInfo = Updater.GetUpdateInfo(true); }; betaInfoWorker.RunWorkerCompleted += (o, e) => { this.betaInfoAvailable = false; if (this.betaInfo != null) { if (Utilities.CompareVersions(this.betaInfo.LatestVersion, Utilities.CurrentVersion) > 0) { this.betaInfoAvailable = true; } } this.RaisePropertyChanged(() => this.BetaChangelogUrl); this.RaisePropertyChanged(() => this.BetaSectionVisible); }; betaInfoWorker.RunWorkerAsync(); #endif this.SelectedTabIndex = Config.OptionsDialogLastTab; this.RefreshUpdateStatus(); }