diff options
author | sr55 <[email protected]> | 2012-06-24 12:30:28 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-06-24 12:30:28 +0000 |
commit | 8644f55a4e49256e684f92a30d50cd70a32339b4 (patch) | |
tree | f3a06e23d139452159f762bc11bfe3d7d019befb /win/CS/HandBrakeWPF | |
parent | b652ba78ab983eebfbe1409b255101a2226f10c8 (diff) |
WinGui: Assorted Fixes
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4773 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 35 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 46 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/OptionsView.xaml | 45 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/PreviewView.xaml | 1 |
5 files changed, 53 insertions, 78 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index a47b6c8c0..fe1e333eb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -108,6 +108,11 @@ namespace HandBrakeWPF.ViewModels private string statusLabel;
/// <summary>
+ /// Program Status Label
+ /// </summary>
+ private string programStatusLabel;
+
+ /// <summary>
/// Backing field for the scanned source.
/// </summary>
private Source scannedSource;
@@ -255,6 +260,27 @@ namespace HandBrakeWPF.ViewModels /// Gets or sets the Program Status Toolbar Label
/// This indicates the status of HandBrake
/// </summary>
+ public string ProgramStatusLabel
+ {
+ get
+ {
+ return string.IsNullOrEmpty(this.programStatusLabel) ? "Ready" : this.programStatusLabel;
+ }
+
+ set
+ {
+ if (!Equals(this.statusLabel, value))
+ {
+ this.programStatusLabel = value;
+ this.NotifyOfPropertyChange(() => this.ProgramStatusLabel);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Program Status Toolbar Label
+ /// This indicates the status of HandBrake
+ /// </summary>
public string StatusLabel
{
get
@@ -913,7 +939,7 @@ namespace HandBrakeWPF.ViewModels if (!this.IsEncoding)
{
- this.StatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.QueueManager.Count);
+ this.ProgramStatusLabel = string.Format("{0} Encodes Pending", this.queueProcessor.QueueManager.Count);
}
}
@@ -1463,7 +1489,6 @@ namespace HandBrakeWPF.ViewModels this.StatusLabel = "Scanning source, please wait...";
this.ShowStatusWindow = true;
});
- // TODO - Disable relevant parts of the UI.
}
/// <summary>
@@ -1480,7 +1505,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread(
() =>
{
- this.StatusLabel =
+ this.ProgramStatusLabel =
string.Format(
"{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}, Pending Jobs {5}",
e.PercentComplete,
@@ -1506,7 +1531,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread(
() =>
{
- this.StatusLabel = "Preparing to encode ...";
+ this.ProgramStatusLabel = "Preparing to encode ...";
this.IsEncoding = true;
});
@@ -1544,7 +1569,7 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread(
() =>
{
- this.StatusLabel = "Queue Finished";
+ this.ProgramStatusLabel = "Queue Finished";
this.IsEncoding = false;
});
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index ff402a9ed..bb2bff804 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1393,6 +1393,7 @@ namespace HandBrakeWPF.ViewModels this.SelectedLangaugesToMove = new BindingList<string>();
IDictionary<string, string> langList = LanguageUtilities.MapLanguages();
+ langList = (from entry in langList orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value);
this.selectedLangauges.Clear();
foreach (string selectedItem in this.userSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages))
@@ -1553,7 +1554,7 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void LanguageMoveLeft()
{
- if (this.SelectedLangauges.Count > 0)
+ if (this.SelectedAvailableToMove.Count > 0)
{
List<string> copiedList = SelectedAvailableToMove.ToList();
foreach (string item in copiedList)
@@ -1580,6 +1581,8 @@ namespace HandBrakeWPF.ViewModels this.AvailableLanguages.Add(item);
}
}
+
+ this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
}
/// <summary>
@@ -1597,47 +1600,6 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Audio List Language Move UP
- /// </summary>
- public void LanguageMoveUp()
- {
- List<string> langauges = this.SelectedLangauges.ToList();
- foreach (string item in langauges)
- {
- if (this.SelectedLangaugesToMove.Contains(item))
- {
- int index = this.SelectedLangauges.IndexOf(item);
- if (index != 0)
- {
- this.SelectedLangauges.Remove(item);
- this.SelectedLangauges.Insert(index - 1, item);
- }
- }
- }
- }
-
- /// <summary>
- /// Audio List Language Move Down
- /// </summary>
- public void LanguageMoveDown()
- {
- List<string> langauges = this.SelectedLangauges.ToList();
- int count = this.SelectedLangauges.Count;
- foreach (string item in langauges)
- {
- if (this.SelectedLangaugesToMove.Contains(item))
- {
- int index = this.SelectedLangauges.IndexOf(item);
- if ((index + 1) != count)
- {
- this.SelectedLangauges.Remove(item);
- this.SelectedLangauges.Insert(index + 1, item);
- }
- }
- }
- }
-
- /// <summary>
/// Browse - Log Path
/// </summary>
public void BrowseLogPath()
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index a4bce1863..1d00b3cf4 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -30,7 +30,6 @@ <UserControl.Resources>
<Style TargetType="Button">
- <Setter Property="Foreground" Value="DarkOrange" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="5,1" />
<Setter Property="FontSize" Value="11.5" />
@@ -38,7 +37,6 @@ </Style>
<Style x:Key="textBlockOrangeStyle" TargetType="TextBlock">
- <Setter Property="Foreground" Value="DarkOrange" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="5,5" />
</Style>
@@ -634,7 +632,7 @@ Padding="0"
>
<Label VerticalAlignment="Center"
- Content="{Binding Path=StatusLabel}"
+ Content="{Binding Path=ProgramStatusLabel}"
FontSize="11"
Padding="0,0,0,5"
/>
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index e6c94ef55..f1ac5df81 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -2,11 +2,12 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.caliburnproject.org"
xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"
- xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options" Background="White">
+ xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options"
+ xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
+ Background="White">
<UserControl.Resources>
<Style TargetType="Button">
- <Setter Property="Foreground" Value="DarkOrange" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="5,0.5" />
<Setter Property="FontSize" Value="11.5" />
@@ -53,11 +54,11 @@ <Border BorderThickness="0 0 0 1" BorderBrush="LightGray" Margin="0,0,0,10">
<TextBlock Text="Preferences" FontSize="16" />
</Border>
-
+
<ListBox ItemsSource="{Binding OptionTabs}" SelectedItem="{Binding SelectedTab}"
BorderThickness="0" Background="Transparent">
</ListBox>
-
+
</StackPanel>
<ScrollViewer Grid.Column="1">
@@ -118,7 +119,7 @@ <TextBox Name="vlcPath" Text="{Binding VLCPath}" Width="250" />
<Button Content="Browse" cal:Message.Attach="[Event Click] = [Action BrowseVlcPath]" Margin="5,0,0,0" Width="55"/>
</StackPanel>
- <TextBlock Text="This path is used for the video preview feature only." />
+ <TextBlock Margin="30,0,0,0" Text="This path is used for the video preview feature only." />
</StackPanel>
</StackPanel>
@@ -170,7 +171,7 @@ <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Automatic Language Selection" FontSize="16" />
</Border>
-
+
<TextBlock Text="Audio and Subtitle Language Selection" Grid.Column="0" Margin="10,10,0,0" FontSize="14"/>
<Grid Margin="20,10,0,0" >
@@ -201,7 +202,6 @@ <ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0">
@@ -225,20 +225,11 @@ <StackPanel Orientation="Vertical" Grid.Column="2">
<TextBlock Text="Selected Langauges" Margin="0,0,0,5"/>
<ListBox Name="selectedLangauges" ItemsSource="{Binding SelectedLangauges}" Helpers:ListBoxHelper.SelectedItems="{Binding SelectedLangaugesToMove}"
- SelectionMode="Extended" Width="140" Height="140" />
+ SelectionMode="Extended" Width="140" Height="140"
+ dd:DragDrop.DropHandler="{Binding}"
+ dd:DragDrop.IsDragSource="True"
+ dd:DragDrop.IsDropTarget="True"/>
</StackPanel>
-
- <DockPanel Grid.Column="3" Margin="10,0,10,0">
- <StackPanel Orientation="Vertical" VerticalAlignment="Center">
- <Button VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveUp]" >
- <Image Source="Images/arrow_up.png" Width="16" Height="16" />
- </Button>
- <Button VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveDown]" >
- <Image Source="Images/arrow_down.png" Width="16" Height="16" />
- </Button>
- </StackPanel>
- </DockPanel>
-
</Grid>
</StackPanel>
</Grid>
@@ -270,7 +261,7 @@ <StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"
Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Advanced'}">
-
+
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Advanced" FontSize="16" />
</Border>
@@ -278,7 +269,7 @@ <StackPanel Orientation="Vertical" Margin="0,10,0,20">
<TextBlock Text="Advanced Options" Grid.Column="0" FontSize="14" Margin="0,0,0,10"/>
-
+
<StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
<CheckBox Content="Prevent the system from sleeping while encoding" IsChecked="{Binding PreventSleep}" />
<CheckBox Content="Minimize to system tray (Requires Restart)" Visibility="Collapsed" IsChecked="{Binding MinimiseToTray}" />
@@ -295,8 +286,8 @@ <TextBox Name="MinTitleLength" Text="{Binding MinLength}" Width="120"/>
<!-- Find a control for this-->
</StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Column="1">
- <TextBlock Text="Priority Level:" VerticalAlignment="Center" />
+ <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
+ <TextBlock Text="Priority Level:" Width="250" VerticalAlignment="Center" />
<ComboBox Name="processPriorityLevel" ItemsSource="{Binding PriorityLevelOptions}" SelectedItem="{Binding SelectedPriority}" Width="120" />
</StackPanel>
@@ -327,12 +318,12 @@ <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
<StackPanel Orientation="Horizontal" Grid.Column="1">
- <TextBlock Text="Log Verbosity Level:" VerticalAlignment="Center" />
+ <TextBlock Text="Log Verbosity Level:" Width="250" VerticalAlignment="Center" />
<ComboBox Name="logVerbosityLevel" ItemsSource="{Binding LogVerbosityOptions}" SelectedItem="{Binding SelectedVerbosity}" Width="120" />
</StackPanel>
- <CheckBox Content="Put a copy of individual encode logs in the same location as the encoded video" IsChecked="{Binding CopyLogToEncodeDirectory}" />
- <CheckBox Content="Put a copy of individual encode logs in a specified location: " IsChecked="{Binding CopyLogToSepcficedLocation}" />
+ <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}" />
+ <CheckBox Content="Put a copy of individual encode logs in a specified location: " Margin="0,5,0,0" IsChecked="{Binding CopyLogToSepcficedLocation}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">
<TextBlock Text="Log Path:" VerticalAlignment="Center" />
<TextBox Width="120" Text="{Binding LogDirectory}" />
diff --git a/win/CS/HandBrakeWPF/Views/PreviewView.xaml b/win/CS/HandBrakeWPF/Views/PreviewView.xaml index e1ffbda19..19ff2c6c6 100644 --- a/win/CS/HandBrakeWPF/Views/PreviewView.xaml +++ b/win/CS/HandBrakeWPF/Views/PreviewView.xaml @@ -14,7 +14,6 @@ <Window.Resources>
<Style TargetType="Button">
- <Setter Property="Foreground" Value="DarkOrange" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="5,1" />
<Setter Property="FontSize" Value="11.5" />
|