]> granicus.if.org Git - handbrake/commitdiff
WinGui: Assorted Fixes
authorsr55 <sr55.hb@outlook.com>
Sun, 24 Jun 2012 12:30:28 +0000 (12:30 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 24 Jun 2012 12:30:28 +0000 (12:30 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4773 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/Views/PreviewView.xaml

index ff56be2dcf6c216cd8718c34992d12c359f202a0..59010c2a35b05df547fbd4c164107e4409438c29 100644 (file)
@@ -1,7 +1,11 @@
-/*  LanguageUtilities.cs $\r
-    This file is part of the HandBrake source code.\r
-    Homepage: <http://handbrake.fr/>.\r
-    It may be used under the terms of the GNU General Public License. */\r
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="LanguageUtilities.cs" company="HandBrake Project (http://handbrake.fr)">\r
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+//   Language Utilities\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
 \r
 namespace HandBrake.ApplicationServices.Utilities\r
 {\r
index a47b6c8c0bde80f78e69a6b928a47673caab0694..fe1e333eb7792a4923cf41937789de5e3f6761dd 100644 (file)
@@ -107,6 +107,11 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private string statusLabel;\r
 \r
+        /// <summary>\r
+        /// Program Status Label\r
+        /// </summary>\r
+        private string programStatusLabel;\r
+\r
         /// <summary>\r
         /// Backing field for the scanned source.\r
         /// </summary>\r
@@ -251,6 +256,27 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets or sets the Program Status Toolbar Label\r
+        /// This indicates the status of HandBrake\r
+        /// </summary>\r
+        public string ProgramStatusLabel\r
+        {\r
+            get\r
+            {\r
+                return string.IsNullOrEmpty(this.programStatusLabel) ? "Ready" : this.programStatusLabel;\r
+            }\r
+\r
+            set\r
+            {\r
+                if (!Equals(this.statusLabel, value))\r
+                {\r
+                    this.programStatusLabel = value;\r
+                    this.NotifyOfPropertyChange(() => this.ProgramStatusLabel);\r
+                }\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Gets or sets the Program Status Toolbar Label\r
         /// This indicates the status of HandBrake\r
@@ -913,7 +939,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             if (!this.IsEncoding)\r
             {\r
-                this.StatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.QueueManager.Count);\r
+                this.ProgramStatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.QueueManager.Count);\r
             }\r
         }\r
 \r
@@ -1463,7 +1489,6 @@ namespace HandBrakeWPF.ViewModels
                     this.StatusLabel = "Scanning source, please wait...";\r
                     this.ShowStatusWindow = true;\r
                 });\r
-            // TODO - Disable relevant parts of the UI.\r
         }\r
 \r
         /// <summary>\r
@@ -1480,7 +1505,7 @@ namespace HandBrakeWPF.ViewModels
             Execute.OnUIThread(\r
                 () =>\r
                 {\r
-                    this.StatusLabel =\r
+                    this.ProgramStatusLabel =\r
                         string.Format(\r
                             "{0:00.00}%,  FPS: {1:000.0},  Avg FPS: {2:000.0},  Time Remaining: {3},  Elapsed: {4:hh\\:mm\\:ss},  Pending Jobs {5}",\r
                             e.PercentComplete,\r
@@ -1506,7 +1531,7 @@ namespace HandBrakeWPF.ViewModels
             Execute.OnUIThread(\r
                () =>\r
                {\r
-                   this.StatusLabel = "Preparing to encode ...";\r
+                   this.ProgramStatusLabel = "Preparing to encode ...";\r
                    this.IsEncoding = true;\r
                });\r
 \r
@@ -1544,7 +1569,7 @@ namespace HandBrakeWPF.ViewModels
             Execute.OnUIThread(\r
                 () =>\r
                 {\r
-                    this.StatusLabel = "Queue Finished";\r
+                    this.ProgramStatusLabel = "Queue Finished";\r
                     this.IsEncoding = false;\r
                 });\r
 \r
index ff402a9ed18cef293e7d4b7b00f49d7ae3dd1d0e..bb2bff804099d4e7ca6125d2ad50b4d154da30e0 100644 (file)
@@ -1393,6 +1393,7 @@ namespace HandBrakeWPF.ViewModels
             this.SelectedLangaugesToMove = new BindingList<string>();\r
 \r
             IDictionary<string, string> langList = LanguageUtilities.MapLanguages();\r
+            langList = (from entry in langList orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value);\r
 \r
             this.selectedLangauges.Clear();\r
             foreach (string selectedItem in this.userSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages))\r
@@ -1553,7 +1554,7 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void LanguageMoveLeft()\r
         {\r
-            if (this.SelectedLangauges.Count > 0)\r
+            if (this.SelectedAvailableToMove.Count > 0)\r
             {\r
                 List<string> copiedList = SelectedAvailableToMove.ToList();\r
                 foreach (string item in copiedList)\r
@@ -1580,6 +1581,8 @@ namespace HandBrakeWPF.ViewModels
                     this.AvailableLanguages.Add(item);\r
                 }\r
             }\r
+\r
+            this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());\r
         }\r
 \r
         /// <summary>\r
@@ -1596,47 +1599,6 @@ namespace HandBrakeWPF.ViewModels
             this.SelectedLangauges.Clear();\r
         }\r
 \r
-        /// <summary>\r
-        ///  Audio List Language Move UP\r
-        /// </summary>\r
-        public void LanguageMoveUp()\r
-        {\r
-            List<string> langauges = this.SelectedLangauges.ToList();\r
-            foreach (string item in langauges)\r
-            {\r
-                if (this.SelectedLangaugesToMove.Contains(item))\r
-                {\r
-                    int index = this.SelectedLangauges.IndexOf(item);\r
-                    if (index != 0)\r
-                    {\r
-                        this.SelectedLangauges.Remove(item);\r
-                        this.SelectedLangauges.Insert(index - 1, item);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Audio List Language Move Down\r
-        /// </summary>\r
-        public void LanguageMoveDown()\r
-        {\r
-            List<string> langauges = this.SelectedLangauges.ToList();\r
-            int count = this.SelectedLangauges.Count;\r
-            foreach (string item in langauges)\r
-            {\r
-                if (this.SelectedLangaugesToMove.Contains(item))\r
-                {\r
-                    int index = this.SelectedLangauges.IndexOf(item);\r
-                    if ((index + 1) != count)\r
-                    {\r
-                        this.SelectedLangauges.Remove(item);\r
-                        this.SelectedLangauges.Insert(index + 1, item);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
         /// <summary>\r
         /// Browse - Log Path\r
         /// </summary>\r
index a4bce18636298d9ceec185d006cd8f75f9c61c13..1d00b3cf4971b0e039bed61a387c6bcd35ae14e7 100644 (file)
@@ -30,7 +30,6 @@
     <UserControl.Resources>\r
 \r
         <Style TargetType="Button">\r
-            <Setter Property="Foreground" Value="DarkOrange" />\r
             <Setter Property="FontWeight" Value="Bold" />\r
             <Setter Property="Padding" Value="5,1" />\r
             <Setter Property="FontSize" Value="11.5" />\r
@@ -38,7 +37,6 @@
         </Style>\r
 \r
         <Style x:Key="textBlockOrangeStyle" TargetType="TextBlock">\r
-            <Setter Property="Foreground" Value="DarkOrange" />\r
             <Setter Property="FontWeight" Value="Bold" />\r
             <Setter Property="Padding" Value="5,5" />\r
         </Style>\r
                    Padding="0"\r
                    >\r
             <Label VerticalAlignment="Center"\r
-                   Content="{Binding Path=StatusLabel}"\r
+                   Content="{Binding Path=ProgramStatusLabel}"\r
                    FontSize="11"\r
                    Padding="0,0,0,5"\r
                    />\r
index e6c94ef557b11a6ee872dba89730b9af1fc40e13..f1ac5df81ba53b20e98c328ea7c02eaa7b3fdf09 100644 (file)
@@ -2,11 +2,12 @@
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.caliburnproject.org"\r
         xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"\r
-              xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options" Background="White">\r
+              xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options"\r
+              xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"\r
+              Background="White">\r
 \r
     <UserControl.Resources>\r
         <Style TargetType="Button">\r
-            <Setter Property="Foreground" Value="DarkOrange" />\r
             <Setter Property="FontWeight" Value="Bold" />\r
             <Setter Property="Padding" Value="5,0.5" />\r
             <Setter Property="FontSize" Value="11.5" />\r
             <Border BorderThickness="0 0 0 1" BorderBrush="LightGray" Margin="0,0,0,10">\r
                 <TextBlock Text="Preferences" FontSize="16" />\r
             </Border>\r
-            \r
+\r
             <ListBox ItemsSource="{Binding OptionTabs}" SelectedItem="{Binding SelectedTab}"\r
                      BorderThickness="0" Background="Transparent">\r
             </ListBox>\r
-            \r
+\r
         </StackPanel>\r
 \r
         <ScrollViewer Grid.Column="1">\r
                                 <TextBox Name="vlcPath" Text="{Binding VLCPath}"  Width="250" />\r
                                 <Button Content="Browse" cal:Message.Attach="[Event Click] = [Action BrowseVlcPath]" Margin="5,0,0,0" Width="55"/>\r
                             </StackPanel>\r
-                            <TextBlock Text="This path is used for the video preview feature only." />\r
+                            <TextBlock Margin="30,0,0,0" Text="This path is used for the video preview feature only." />\r
 \r
                         </StackPanel>\r
                     </StackPanel>\r
                     <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
                         <TextBlock Text="Automatic Language Selection" FontSize="16" />\r
                     </Border>\r
-                    \r
+\r
                     <TextBlock Text="Audio and Subtitle Language Selection" Grid.Column="0" Margin="10,10,0,0" FontSize="14"/>\r
 \r
                     <Grid Margin="20,10,0,0" >\r
                                     <ColumnDefinition Width="*" />\r
                                     <ColumnDefinition Width="*" />\r
                                     <ColumnDefinition Width="*" />\r
-                                    <ColumnDefinition Width="*" />\r
                                 </Grid.ColumnDefinitions>\r
 \r
                                 <StackPanel Orientation="Vertical" Grid.Column="0">\r
                                 <StackPanel Orientation="Vertical" Grid.Column="2">\r
                                     <TextBlock Text="Selected Langauges"  Margin="0,0,0,5"/>\r
                                     <ListBox Name="selectedLangauges" ItemsSource="{Binding SelectedLangauges}" Helpers:ListBoxHelper.SelectedItems="{Binding SelectedLangaugesToMove}" \r
-                                             SelectionMode="Extended" Width="140" Height="140" />\r
+                                             SelectionMode="Extended" Width="140" Height="140"\r
+                                             dd:DragDrop.DropHandler="{Binding}"\r
+                                             dd:DragDrop.IsDragSource="True"\r
+                                             dd:DragDrop.IsDropTarget="True"/>\r
                                 </StackPanel>\r
-\r
-                                <DockPanel Grid.Column="3" Margin="10,0,10,0">\r
-                                    <StackPanel Orientation="Vertical" VerticalAlignment="Center">\r
-                                        <Button VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveUp]"  >\r
-                                            <Image Source="Images/arrow_up.png" Width="16" Height="16" />\r
-                                        </Button>\r
-                                        <Button VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveDown]"  >\r
-                                            <Image Source="Images/arrow_down.png" Width="16" Height="16" />\r
-                                        </Button>\r
-                                    </StackPanel>\r
-                                </DockPanel>\r
-\r
                             </Grid>\r
                         </StackPanel>\r
                     </Grid>\r
 \r
                 <StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"\r
                             Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Advanced'}">\r
-                    \r
+\r
                     <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">\r
                         <TextBlock Text="Advanced" FontSize="16" />\r
                     </Border>\r
                     <StackPanel Orientation="Vertical" Margin="0,10,0,20">\r
 \r
                         <TextBlock Text="Advanced Options" Grid.Column="0" FontSize="14" Margin="0,0,0,10"/>\r
-                        \r
+\r
                         <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">\r
                             <CheckBox Content="Prevent the system from sleeping while encoding" IsChecked="{Binding PreventSleep}" />\r
                             <CheckBox Content="Minimize to system tray (Requires Restart)" Visibility="Collapsed" IsChecked="{Binding MinimiseToTray}" />\r
                                 <TextBox Name="MinTitleLength" Text="{Binding MinLength}"  Width="120"/>\r
                                 <!-- Find a control for this-->\r
                             </StackPanel>\r
-                            <StackPanel Orientation="Horizontal" Grid.Column="1">\r
-                                <TextBlock Text="Priority Level:" VerticalAlignment="Center" />\r
+                            <StackPanel Orientation="Horizontal" Margin="0,5,0,0">\r
+                                <TextBlock Text="Priority Level:" Width="250" VerticalAlignment="Center" />\r
                                 <ComboBox Name="processPriorityLevel" ItemsSource="{Binding PriorityLevelOptions}" SelectedItem="{Binding SelectedPriority}" Width="120" />\r
                             </StackPanel>\r
 \r
 \r
                         <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">\r
                             <StackPanel Orientation="Horizontal" Grid.Column="1">\r
-                                <TextBlock Text="Log Verbosity Level:" VerticalAlignment="Center" />\r
+                                <TextBlock Text="Log Verbosity Level:" Width="250" VerticalAlignment="Center" />\r
                                 <ComboBox Name="logVerbosityLevel" ItemsSource="{Binding LogVerbosityOptions}" SelectedItem="{Binding SelectedVerbosity}" Width="120" />\r
                             </StackPanel>\r
 \r
-                            <CheckBox Content="Put a copy of individual encode logs in the same location as the encoded video" IsChecked="{Binding CopyLogToEncodeDirectory}" />\r
-                            <CheckBox Content="Put a copy of individual encode logs in a specified location: " IsChecked="{Binding CopyLogToSepcficedLocation}" />\r
+                            <CheckBox Content="Put a copy of individual encode logs in the same location as the encoded video" Margin="0,5,0,0" IsChecked="{Binding CopyLogToEncodeDirectory}" />\r
+                            <CheckBox Content="Put a copy of individual encode logs in a specified location: " Margin="0,5,0,0" IsChecked="{Binding CopyLogToSepcficedLocation}" />\r
                             <StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">\r
                                 <TextBlock Text="Log Path:" VerticalAlignment="Center" />\r
                                 <TextBox Width="120" Text="{Binding LogDirectory}" />\r
index e1ffbda19a7f0a62d9df58c3068bf03db822ad9d..19ff2c6c61fbf2104b3dc0c788471847f4cae53f 100644 (file)
@@ -14,7 +14,6 @@
 \r
     <Window.Resources>\r
         <Style TargetType="Button">\r
-            <Setter Property="Foreground" Value="DarkOrange" />\r
             <Setter Property="FontWeight" Value="Bold" />\r
             <Setter Property="Padding" Value="5,1" />\r
             <Setter Property="FontSize" Value="11.5" />\r