WinGui: (WPF) Wiring up the Subtitles Auto-selection and Point-to-Point on the main...
authorsr55 <sr55.hb@outlook.com>
Sun, 4 Mar 2012 14:59:30 +0000 (14:59 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 4 Mar 2012 14:59:30 +0000 (14:59 +0000)
Also fixed the subtitles key defaults.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4494 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
win/CS/HandBrakeWPF/UserSettingConstants.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
win/CS/HandBrakeWPF/defaultsettings.xml
win/CS/defaultsettings.xml

index 9ad24a1f9648beb83ba99fe567e2e6f8dfd8956a..c15b9db0200f1d2e210bb5f482452f9a7e94b097 100644 (file)
@@ -82,7 +82,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
         {\r
             get\r
             {\r
-                return this.SrtFileName != "-";\r
+                return this.SrtFileName != "-" && this.SrtFileName != null;\r
             }\r
         }\r
 \r
index 91d4d5357c07af92437692037618da9970d59c8e..a018c99001247e1592d705e75e5296200a3db205 100644 (file)
@@ -416,6 +416,11 @@ namespace HandBrake.ApplicationServices.Utilities
         /// </param>\r
         public static void Export(string path, Preset preset)\r
         {\r
+            if (string.IsNullOrEmpty(path))\r
+            {\r
+                return;\r
+            }\r
+\r
             EncodeTask parsed = QueryParserUtility.Parse(preset.Query);\r
             XmlTextWriter xmlWriter = new XmlTextWriter(path, Encoding.UTF8) { Formatting = Formatting.Indented };\r
 \r
index ad0da6e70382bb3979a1c430869a2f94ebd473ff..99c31b74a4929025e15279e4dcfd8a25034b1b6b 100644 (file)
@@ -24,13 +24,11 @@ namespace HandBrakeWPF
         public const string AutoNameFormat = "autoNameFormat";\r
         public const string VLC_Path = "VLC_Path";\r
         public const string MainWindowMinimize = "MainWindowMinimize";\r
-        public const string QueryEditorTab = "QueryEditorTab";\r
         public const string PresetNotification = "presetNotification";\r
         public const string TrayIconAlerts = "trayIconAlerts";\r
         public const string LastUpdateCheckDate = "lastUpdateCheckDate";\r
         public const string DaysBetweenUpdateCheck = "daysBetweenUpdateCheck";\r
         public const string UseM4v = "useM4v";\r
-        public const string PromptOnUnmatchingQueries = "PromptOnUnmatchingQueries";\r
         public const string NativeLanguage = "NativeLanguage";\r
         public const string NativeLanguageForSubtitles = "NativeLanguageSubtitles";\r
         public const string DubMode = "DubMode";\r
index 7d64cfb5e92e19d3a0486bd523405773a83a4386..e8e584f6002e47b908ee6ec0df2469b5636b3f4e 100644 (file)
@@ -23,7 +23,6 @@ namespace HandBrakeWPF.ViewModels
     using HandBrake.ApplicationServices;\r
     using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Model.Encoding;\r
-    using HandBrake.ApplicationServices.Model.General;\r
     using HandBrake.ApplicationServices.Parsing;\r
     using HandBrake.ApplicationServices.Services;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
@@ -231,7 +230,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             set\r
             {\r
-                if (!object.Equals(this.windowName, value))\r
+                if (!Equals(this.windowName, value))\r
                 {\r
                     this.windowName = value;\r
                 }\r
@@ -251,7 +250,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             set\r
             {\r
-                if (!object.Equals(this.programStatusLabel, value))\r
+                if (!Equals(this.programStatusLabel, value))\r
                 {\r
                     this.programStatusLabel = value;\r
                     this.NotifyOfPropertyChange("ProgramStatusLabel");\r
@@ -334,7 +333,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             set\r
             {\r
-                if (!object.Equals(this.sourceLabel, value))\r
+                if (!Equals(this.sourceLabel, value))\r
                 {\r
                     this.sourceLabel = value;\r
                     this.NotifyOfPropertyChange("SourceLabel");\r
@@ -394,6 +393,17 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets a value indicating whether ShowTextEntryForPointToPointMode.\r
+        /// </summary>\r
+        public bool ShowTextEntryForPointToPointMode\r
+        {\r
+            get\r
+            {\r
+                return this.SelectedPointToPoint != PointToPointMode.Chapters;\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Gets StartEndRangeItems.\r
         /// </summary>\r
@@ -406,7 +416,7 @@ namespace HandBrakeWPF.ViewModels
                     return null;\r
                 }\r
 \r
-                return this.SelectedTitle.Chapters.Select(item => item.ChapterNumber).Select(dummy => (int)dummy).ToList();\r
+                return this.SelectedTitle.Chapters.Select(item => item.ChapterNumber).Select(dummy => dummy).ToList();\r
             }\r
         }\r
 \r
@@ -509,7 +519,7 @@ namespace HandBrakeWPF.ViewModels
             }\r
             set\r
             {\r
-                if (!object.Equals(this.selectedTitle, value))\r
+                if (!Equals(this.selectedTitle, value))\r
                 {\r
                     this.selectedTitle = value;\r
 \r
@@ -604,7 +614,8 @@ namespace HandBrakeWPF.ViewModels
             set\r
             {\r
                 this.CurrentTask.PointToPointMode = value;\r
-                this.NotifyOfPropertyChange("SelectedPointToPoint");\r
+                this.NotifyOfPropertyChange(() => SelectedPointToPoint);\r
+                this.NotifyOfPropertyChange(() => ShowTextEntryForPointToPointMode);\r
             }\r
         }\r
 \r
@@ -620,8 +631,8 @@ namespace HandBrakeWPF.ViewModels
             set\r
             {\r
                 this.selectedOutputFormat = value;\r
-                this.NotifyOfPropertyChange("SelectedOutputFormat");\r
-                this.NotifyOfPropertyChange("IsMkv");\r
+                this.NotifyOfPropertyChange(() => SelectedOutputFormat);\r
+                this.NotifyOfPropertyChange(() => IsMkv);\r
                 this.SetExtension(string.Format(".{0}", this.selectedOutputFormat.ToString().ToLower())); // TODO, tidy up\r
             }\r
         }\r
@@ -1110,12 +1121,16 @@ namespace HandBrakeWPF.ViewModels
         /// </returns>\r
         private string DurationCalculation()\r
         {\r
+            if (this.selectedTitle == null)\r
+            {\r
+                return "--:--:--";\r
+            }\r
+\r
             double startEndDuration = this.SelectedEndPoint - this.SelectedStartPoint;\r
             switch (this.SelectedPointToPoint)\r
             {\r
                 case PointToPointMode.Chapters:\r
                     return this.SelectedTitle.CalculateDuration(this.SelectedStartPoint, this.SelectedEndPoint).ToString();\r
-                    break;\r
                 case PointToPointMode.Seconds:\r
                     return TimeSpan.FromSeconds(startEndDuration).ToString();\r
                 case PointToPointMode.Frames:\r
index 4a9dd8aa490a3b30747c9d4f355cae958a548807..673579915a1126459ecb60ce8e1ac37b81faa744 100644 (file)
@@ -148,11 +148,6 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private bool enableGuiTooltips;\r
 \r
-        /// <summary>\r
-        /// The enable query editor.\r
-        /// </summary>\r
-        private bool enableQueryEditor;\r
-\r
         /// <summary>\r
         /// The growl after encode.\r
         /// </summary>\r
@@ -203,11 +198,6 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private BindingList<string> priorityLevelOptions = new BindingList<string>();\r
 \r
-        /// <summary>\r
-        /// The prompt on different query.\r
-        /// </summary>\r
-        private bool promptOnDifferentQuery;\r
-\r
         /// <summary>\r
         /// The remove underscores.\r
         /// </summary>\r
@@ -1039,40 +1029,6 @@ namespace HandBrakeWPF.ViewModels
 \r
         #region Advanced\r
 \r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether EnableQueryEditor.\r
-        /// </summary>\r
-        public bool EnableQueryEditor\r
-        {\r
-            get\r
-            {\r
-                return this.enableQueryEditor;\r
-            }\r
-\r
-            set\r
-            {\r
-                this.enableQueryEditor = value;\r
-                this.NotifyOfPropertyChange("EnableQueryEditor");\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether PromptOnDifferentQuery.\r
-        /// </summary>\r
-        public bool PromptOnDifferentQuery\r
-        {\r
-            get\r
-            {\r
-                return this.promptOnDifferentQuery;\r
-            }\r
-\r
-            set\r
-            {\r
-                this.promptOnDifferentQuery = value;\r
-                this.NotifyOfPropertyChange("PromptOnDifferentQuery");\r
-            }\r
-        }\r
-\r
         /// <summary>\r
         /// Gets or sets ConstantQualityGranularity.\r
         /// </summary>\r
@@ -1435,8 +1391,6 @@ namespace HandBrakeWPF.ViewModels
             // Minimise to Tray\r
             this.displayStatusMessagesTrayIcon = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.TrayIconAlerts);\r
             this.minimiseToTray = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize);\r
-            this.enableQueryEditor = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.QueryEditorTab);\r
-            this.promptOnDifferentQuery = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PromptOnUnmatchingQueries);\r
             this.disablePresetUpdateCheckNotification = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PresetNotification);\r
             this.showCliWindow = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.ShowCLI);\r
 \r
@@ -1676,8 +1630,6 @@ namespace HandBrakeWPF.ViewModels
             /* Advanced */\r
             userSettingService.SetUserSetting(UserSettingConstants.MainWindowMinimize, this.MinimiseToTray);\r
             userSettingService.SetUserSetting(UserSettingConstants.TrayIconAlerts, this.DisplayStatusMessagesTrayIcon);\r
-            userSettingService.SetUserSetting(UserSettingConstants.QueryEditorTab, this.EnableQueryEditor);\r
-            userSettingService.SetUserSetting(UserSettingConstants.PromptOnUnmatchingQueries, this.PromptOnDifferentQuery);\r
             userSettingService.SetUserSetting(UserSettingConstants.PresetNotification, this.DisablePresetUpdateCheckNotification);\r
             userSettingService.SetUserSetting(ASUserSettingConstants.ShowCLI, this.ShowCliWindow);\r
             userSettingService.SetUserSetting(ASUserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);\r
index 13aabe5e8ff21cb2443f8c75bae06f6aa88bdf45..cc882b1604cbfd3595c1f2b2d9c143666341e2e4 100644 (file)
@@ -11,6 +11,7 @@ namespace HandBrakeWPF.ViewModels
 {\r
     using System.Collections.Generic;\r
     using System.Collections.ObjectModel;\r
+    using System.Collections.Specialized;\r
     using System.ComponentModel.Composition;\r
     using System.Linq;\r
 \r
@@ -96,7 +97,6 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public IEnumerable<string> CharacterCodes { get; set; }\r
 \r
-\r
         /// <summary>\r
         /// Gets or sets SourceTracks.\r
         /// </summary>\r
@@ -122,19 +122,7 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void Add()\r
         {\r
-            if (this.SourceTracks != null)\r
-            {\r
-                Subtitle source = this.SourceTracks.FirstOrDefault();\r
-                if (source != null)\r
-                {\r
-                    SubtitleTrack track = new SubtitleTrack\r
-                    {\r
-                        SubtitleType = SubtitleType.VobSub\r
-                    };\r
-\r
-                    this.SubtitleTracks.Add(track);\r
-                }\r
-            }\r
+            this.Add(null);\r
         }\r
 \r
         /// <summary>\r
@@ -187,6 +175,8 @@ namespace HandBrakeWPF.ViewModels
         {\r
             this.SourceTracks = title.Subtitles;\r
             this.SubtitleTracks = task.SubtitleTracks;\r
+\r
+            this.AutomaticSubtitleSelection();\r
         }\r
 \r
         /// <summary>\r
@@ -199,6 +189,155 @@ namespace HandBrakeWPF.ViewModels
         {\r
             // We don't currently support subtitles within presets.\r
         }\r
+        \r
+        /// <summary>\r
+        /// Automatic Subtitle Selection based on user preferences.\r
+        /// </summary>\r
+        public void AutomaticSubtitleSelection()\r
+        {\r
+            this.SubtitleTracks.Clear();\r
+\r
+            // New DUB Settings\r
+            int mode = UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeSubtitle);\r
+            switch (mode)\r
+            {\r
+                case 1: // Adding all remaining subtitle tracks\r
+                    this.AddAllRemaining();\r
+                    break;\r
+                case 2: // Adding only the first or preferred first subtitle track.\r
+                    this.Add();\r
+                    break;\r
+                case 3: // Selected Languages Only\r
+                    this.AddAllRemainingForSelectedLanguages();\r
+                    break;\r
+                case 4: // Prefered Only\r
+                    this.AddForPreferredLanaguages(true);\r
+                    break;\r
+                case 5: // Prefered Only All\r
+                    this.AddForPreferredLanaguages(false);\r
+                    break;\r
+            }\r
+\r
+            // Add all closed captions if enabled.\r
+            this.AddAllClosedCaptions();\r
+        }\r
+\r
+        #endregion\r
+\r
+        #region Private Methods\r
+\r
+        /// <summary>\r
+        /// Add a subtitle track.\r
+        /// The Source track is set based on the following order. If null, it will skip to the next option.\r
+        ///   1. Passed in Subitle param\r
+        ///   2. First preferred Subtitle from source\r
+        ///   3. First subtitle from source.\r
+        /// Will not add a subtitle if the source has none.\r
+        /// </summary>\r
+        /// <param name="subtitle">\r
+        /// The subtitle. Use null to add preferred, or first from source (based on user preference)\r
+        /// </param>\r
+        private void Add(Subtitle subtitle)\r
+        {\r
+            if (this.SourceTracks != null)\r
+            {\r
+                string preferred = UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguageForSubtitles);\r
+\r
+                Subtitle source = subtitle ?? (this.SourceTracks.FirstOrDefault(l => l.Language == preferred) ??\r
+                                               this.SourceTracks.FirstOrDefault());\r
+\r
+                if (source != null)\r
+                {\r
+                    SubtitleTrack track = new SubtitleTrack\r
+                    {\r
+                        SubtitleType = SubtitleType.VobSub,\r
+                        SourceTrack = source,\r
+                    };\r
+\r
+                    this.SubtitleTracks.Add(track);\r
+                }\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Add all the remaining subtitle tracks.\r
+        /// </summary>\r
+        private void AddAllRemaining()\r
+        {\r
+            foreach (Subtitle subtitle in this.SourceTitlesSubset(null))\r
+            {\r
+                this.Add(subtitle);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Add all remaining tracks for the users preferred and selected languages\r
+        /// </summary>\r
+        private void AddAllRemainingForSelectedLanguages()\r
+        {\r
+            // Get a list of subtitle tracks that match the users lanaguages\r
+            StringCollection userSelectedLanguages = UserSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages);\r
+            userSelectedLanguages.Add(UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguageForSubtitles));\r
+            List<Subtitle> availableTracks  = this.SourceTracks.Where(subtitle => userSelectedLanguages.Contains(subtitle.Language)).ToList();\r
+\r
+            foreach (Subtitle subtitle in this.SourceTitlesSubset(availableTracks))\r
+            {\r
+                this.Add(subtitle);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Add all tracks for the preferred languages settings.\r
+        /// </summary>\r
+        /// <param name="firstOnly">\r
+        /// The first only.\r
+        /// </param>\r
+        private void AddForPreferredLanaguages(bool firstOnly)\r
+        {\r
+            string preferred = UserSettingService.GetUserSetting<string>(\r
+                UserSettingConstants.NativeLanguageForSubtitles);\r
+\r
+            foreach (Subtitle subtitle in this.SourceTitlesSubset(null))\r
+            {\r
+                if (subtitle.Language == preferred)\r
+                {\r
+                    this.Add(subtitle);\r
+                    if (firstOnly)\r
+                    {\r
+                        break;\r
+                    }\r
+                }\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Add all closed captions not already on the list.\r
+        /// </summary>\r
+        private void AddAllClosedCaptions()\r
+        {\r
+            if (UserSettingService.GetUserSetting<bool>(UserSettingConstants.UseClosedCaption))\r
+            {\r
+                foreach (Subtitle subtitle in this.SourceTitlesSubset(null).Where(s => s.SubtitleType == SubtitleType.CC))\r
+                {\r
+                    this.Add(subtitle);\r
+                }\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets a list of Source subtitle tracks that are not currently used.\r
+        /// </summary>\r
+        /// <param name="subtitles">\r
+        /// The subtitles. (Optional).  If null, works on the full source subtitle collection\r
+        /// </param>\r
+        /// <returns>\r
+        /// An IEnumerable collection of subtitles\r
+        /// </returns>\r
+        private IEnumerable<Subtitle> SourceTitlesSubset(IEnumerable<Subtitle> subtitles)\r
+        {\r
+            return subtitles != null ? subtitles.Where(subtitle => !this.SubtitleTracks.Any(track => track.SourceTrack == subtitle)).ToList() \r
+                                     : this.SourceTracks.Where(subtitle => !this.SubtitleTracks.Any(track => track.SourceTrack == subtitle)).ToList();\r
+        }\r
 \r
         #endregion\r
     }\r
index 37a11a0167e7535e1817002bd82997ba6ed31789..e39625785d904a73e059fe90de742830a923a309 100644 (file)
                             <ComboBox Name="Angles" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding Angles}"  SelectedItem="{Binding SelectedAngle}"/>\r
 \r
                             <ComboBox Name="PointToPointMode" Margin="8,0,0,0" MinWidth="80" ItemsSource="{Binding RangeMode}" SelectedItem="{Binding SelectedPointToPoint}" />\r
-                            <ComboBox Name="StartPoint" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding StartEndRangeItems}" SelectedItem="{Binding SelectedStartPoint}" />\r
+                            \r
+                            <ComboBox Name="StartPoint" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding StartEndRangeItems}" SelectedItem="{Binding SelectedStartPoint}"\r
+                                      Visibility="{Binding ShowTextEntryForPointToPointMode,Converter={StaticResource boolToVisConverter}, ConverterParameter=true}"/>\r
+                            <TextBox Name="StartPointText" Margin="8,0,0,0" MinWidth="60" Text="{Binding SelectedStartPoint}"\r
+                                     Visibility="{Binding ShowTextEntryForPointToPointMode, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"/>\r
+                            \r
                             <Label Content="through" Margin="8,0,0,0" />\r
-                            <ComboBox Name="EndPoint" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding StartEndRangeItems}" SelectedItem="{Binding SelectedEndPoint}" />\r
+                            <ComboBox Name="EndPoint" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding StartEndRangeItems}" SelectedItem="{Binding SelectedEndPoint}"\r
+                                      Visibility="{Binding ShowTextEntryForPointToPointMode, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}"/>\r
+                            <TextBox Name="EndPointText" Margin="8,0,0,0" MinWidth="60" Text="{Binding SelectedEndPoint}" \r
+                                     Visibility="{Binding ShowTextEntryForPointToPointMode, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
+                            \r
                             <Label Content="Duration" Margin="8,0,0,0" />\r
                             <Label Content="{Binding Duration}" Margin="8,0,0,0" />\r
                         </StackPanel>\r
                         <StackPanel Orientation="Horizontal">\r
                             <Label Content="File" Margin="8,0,0,0" />\r
                             <TextBox Name="Destination" Margin="8,0,0,0" Width="600" Text="{Binding CurrentTask.Destination}" />\r
-                            <Button Name="DestinationBrowser" Margin="8,0,0,0" Padding="8,0,8,0" Content="Browse" Micro:Message.Attach="[Event Click] = [Action BrowseDestination]" />\r
+                            <Button Name="DestinationBrowser" Margin="8,0,0,0" Content="Browse" Micro:Message.Attach="[Event Click] = [Action BrowseDestination]" />\r
                         </StackPanel>\r
                     </StackPanel>\r
 \r
index 006b6e1abe5b0235cf22dad2a7772e8271b236e3..cc5d5f77505212559dd718e4d8c8141ef4a53785 100644 (file)
                         <StackPanel Orientation="Vertical" Grid.Column="1">\r
                             <CheckBox Content="Minimize to system tray (Requires Restart)" IsChecked="{Binding MinimiseToTray}" />\r
                             <CheckBox Content="Display status messages from tray icon (balloon popups)" IsChecked="{Binding DisplayStatusMessagesTrayIcon}" />\r
-                            <CheckBox Content="Enable 'Query Editor' tab (Requires Restart)" IsChecked="{Binding EnableQueryEditor}" />\r
-                            <CheckBox Content="Prompt when a manual query does not match GUI settings" Margin="10,0,0,5" IsChecked="{Binding PromptOnDifferentQuery}" />\r
                             <CheckBox Content="Disable built-in preset update notification" IsChecked="{Binding DisablePresetUpdateCheckNotification}" />\r
                             <CheckBox Content="Show CLI window (Allows you to cleanly exit encode with ctrl-c)" IsChecked="{Binding ShowCliWindow}" />\r
                             <StackPanel Orientation="Horizontal" Margin="0,10,0,0">\r
index 898d5df645e82b02b4b2bf7117ca117a03ddb4f7..0492fcaedbe80a153f7c4db91a230533bfa9a795 100644 (file)
@@ -74,7 +74,7 @@
                             <!-- Row 1-->\r
 \r
                             <TextBlock Text="Source" FontWeight="Bold" Grid.Column="0" VerticalAlignment="Center" />\r
-                            <ComboBox Width="100" ItemsSource="{Binding DataContext.SourceTracks, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" \r
+                            <ComboBox Width="120" ItemsSource="{Binding DataContext.SourceTracks, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" \r
                                       SelectedItem="{Binding SourceTrack}" Grid.Column="1" Margin="5,0,5,0" Height="22" />\r
                             <TextBlock Text="Forced Only" FontWeight="Bold" Grid.Column="2" VerticalAlignment="Center" />\r
                             <CheckBox Grid.Column="3" IsChecked="{Binding Forced}" VerticalAlignment="Center" Margin="5,0,5,0"/>\r
 \r
                             <!-- Row 2-->\r
                             <TextBlock Text="Language" FontWeight="Bold" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center"/>\r
-                            <ComboBox Width="100" Grid.Column="1" ItemsSource="{Binding DataContext.Langauges, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" SelectedItem="{Binding SrtLang}" Margin="5,0,5,0" Grid.Row="1" Height="22" />\r
+                            <ComboBox Width="120" Grid.Column="1" \r
+                                      ItemsSource="{Binding DataContext.Langauges, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" \r
+                                      SelectedItem="{Binding SrtLang}" Margin="5,0,5,0" Grid.Row="1" Height="22"\r
+                                      IsEnabled="{Binding IsSrtSubtitle}"/>\r
                             <TextBlock Text="Char Code" FontWeight="Bold" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center"/>\r
-                            <ComboBox Width="100" Grid.Column="3" ItemsSource="{Binding DataContext.CharacterCodes, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" SelectedItem="{Binding SrtCharCode}" Grid.Row="1" Margin="5,0,5,0" Height="22" />\r
+                            <ComboBox Width="100" Grid.Column="3" \r
+                                      ItemsSource="{Binding DataContext.CharacterCodes, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" \r
+                                      SelectedItem="{Binding SrtCharCode}" Grid.Row="1" Margin="5,0,5,0" Height="22" \r
+                                      IsEnabled="{Binding IsSrtSubtitle}" />\r
                             <TextBlock Text="Offset (ms)" FontWeight="Bold" Grid.Column="4" Grid.Row="1" VerticalAlignment="Center"/>\r
-                            <NumericUpDown:NumericUpDown Width="45" Value="{Binding SrtOffset}" Grid.Row="1" Grid.Column="5" HorizontalAlignment="Left"  Margin="5,0,5,0" />\r
+                            <NumericUpDown:NumericUpDown Width="65" Value="{Binding SrtOffset}" Grid.Row="1" Grid.Column="5" HorizontalAlignment="Left" \r
+                                                         IsEnabled="{Binding IsSrtSubtitle}" Margin="5,0,5,0" />\r
 \r
                         </Grid>\r
 \r
index f9acde1ce9cd590670d177e10069d1cb4ef20e45..ce18ff68094bf41e883c9a69c3142fd861723753 100644 (file)
   </item>\r
   <item>\r
     <key>\r
-      <string>NativeLanguageForSubtitles</string>\r
+      <string>NativeLanguageSubtitles</string>\r
     </key>\r
     <value>\r
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">Any</anyType>\r
index f9acde1ce9cd590670d177e10069d1cb4ef20e45..ce18ff68094bf41e883c9a69c3142fd861723753 100644 (file)
   </item>\r
   <item>\r
     <key>\r
-      <string>NativeLanguageForSubtitles</string>\r
+      <string>NativeLanguageSubtitles</string>\r
     </key>\r
     <value>\r
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">Any</anyType>\r