summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorScott <[email protected]>2015-10-24 21:20:16 +0100
committerScott <[email protected]>2015-10-24 21:20:16 +0100
commita5e11c672683a315646ba78e74d6c4beb719bfd1 (patch)
tree4ceebf66ac6b431a3c6108dfaccf2304ed85b70d /win/CS
parent5453dde3e30ee93fd49a779e4b3ce40d0077e045 (diff)
Adding a "When Done" Label and Context Menu to the Main Screen status bar.
This should make it more obvious to users that they have a "When done" action turned on, especially when coming back to the app after a period of time.
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs9
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx3
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs2
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.resx2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs1
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs9
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs4
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml68
8 files changed, 88 insertions, 10 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs
index 4839b7d42..f7e495daa 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs
@@ -173,6 +173,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to When HandBrake has finished the current queue or encode it will perform this action..
+ /// </summary>
+ public static string MainView_WhenDone {
+ get {
+ return ResourceManager.GetString("MainView_WhenDone", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to None - Force pixel aspect ratio to 1:1.
///Loose - Align dimensions to chosen &apos;Alignment&apos; value
/// and pick pixel aspect ratio that preserves the
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx
index 536409cae..be3ea622d 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx
@@ -305,4 +305,7 @@ to make bitrate allocation decisions.</value>
VFR is not compatible with some players.</value>
</data>
+ <data name="MainView_WhenDone" xml:space="preserve">
+ <value>When HandBrake has finished the current queue or encode it will perform this action.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
index 766fb27ab..10afa9c83 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
@@ -1771,7 +1771,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to When Done::.
+ /// Looks up a localized string similar to When Done:.
/// </summary>
public static string QueueView_WhenDone {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
index f61aa17c6..2d9793240 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
@@ -553,7 +553,7 @@
<value>Video:</value>
</data>
<data name="QueueView_WhenDone" xml:space="preserve">
- <value>When Done::</value>
+ <value>When Done:</value>
</data>
<data name="StaticPreviewView_Duration" xml:space="preserve">
<value>Duration:</value>
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs
index 3530e84c1..cacfe079f 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs
@@ -14,5 +14,6 @@ namespace HandBrakeWPF.ViewModels.Interfaces
/// </summary>
public interface IQueueViewModel
{
+ void WhenDone(string action);
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index febfd5b00..8ecb46ae2 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1569,6 +1569,15 @@ namespace HandBrakeWPF.ViewModels
this.AlertWindowHeader = string.Empty;
}
+ /// <summary>
+ /// Pass on the "When Done" Action to the queue view model.
+ /// </summary>
+ /// <param name="action"></param>
+ public void WhenDone(string action)
+ {
+ this.QueueViewModel?.WhenDone(action);
+ }
+
#endregion
#region Main Window Public Methods
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 8b4d247c3..8167c1953 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -71,6 +71,8 @@ namespace HandBrakeWPF.ViewModels
this.JobStatus = Resources.QueueViewModel_NoJobsPending;
this.SelectedItems = new BindingList<QueueTask>();
this.DisplayName = "Queue";
+
+ this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction);
}
#endregion
@@ -391,8 +393,6 @@ namespace HandBrakeWPF.ViewModels
{
this.Load();
- this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction);
-
this.queueProcessor.QueueCompleted += this.queueProcessor_QueueCompleted;
this.queueProcessor.QueueChanged += this.QueueManager_QueueChanged;
this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeService_EncodeStatusChanged;
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index bfec2c3e6..7788275eb 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -7,6 +7,7 @@
xmlns:commands="clr-namespace:HandBrakeWPF.Commands"
xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
xmlns:cal="http://www.caliburnproject.org"
+ xmlns:attachedProperties="clr-namespace:HandBrakeWPF.AttachedProperties"
AllowDrop="True"
FontSize="11"
cal:Message.Attach="[Event Loaded] = [Action Load]"
@@ -531,7 +532,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Header="Presets"
- Margin="0,0,0,5"
+ Margin="0,0,5,5"
Visibility="{Binding IsPresetPanelShowing, Converter={StaticResource boolToVisConverter}}">
<Grid>
@@ -707,13 +708,68 @@
</Controls:AlertPanel>
<!-- Status Bar -->
- <StatusBar Grid.Row="2" Grid.ColumnSpan="2" MinHeight="32" >
- <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
- Width="100" Height="18" VerticalAlignment="Center"/>
- <Label VerticalAlignment="Center"
- Content="{Binding Path=ProgramStatusLabel}" />
+ <StatusBar Name="statusBar1" Height="32" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
+ <StatusBarItem>
+ <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
+ Width="100" Height="18" VerticalAlignment="Center" />
+ </StatusBarItem>
+ <StatusBarItem>
+ <TextBlock Text="{Binding Path=ProgramStatusLabel}" TextTrimming="CharacterEllipsis" />
+ </StatusBarItem>
+ <StatusBarItem HorizontalAlignment="Right" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_WhenDone}">
+ <Menu Background="Transparent">
+ <MenuItem>
+ <MenuItem.Header>
+ <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
+ <TextBlock VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:ResourcesUI.QueueView_WhenDone}" />
+ <TextBlock Margin="8,0,0,0" VerticalAlignment="Center" Text="{Binding QueueViewModel.WhenDoneAction}" />
+ <Path Height="5"
+ Margin="2,2,2,0"
+ Data="M 0 0 L 4 4 L 8 0 Z"
+ Fill="{DynamicResource GlyphBrush}" />
+ </StackPanel>
+ </MenuItem.Header>
+
+ <MenuItem x:Name="doNothing"
+ cal:Message.Attach="[Event Click] = [Action WhenDone(doNothing.Header)]"
+ Header="{x:Static Properties:ResourcesUI.QueueView_DoNothing}"
+ IsCheckable="True"
+ attachedProperties:MenuItemExtensions.GroupName="whenDone" />
+ <MenuItem x:Name="shutdown"
+ cal:Message.Attach="[Event Click] = [Action WhenDone(shutdown.Header)]"
+ Header="{x:Static Properties:ResourcesUI.QueueView_Shutdown}"
+ IsCheckable="True"
+ attachedProperties:MenuItemExtensions.GroupName="whenDone" />
+ <MenuItem x:Name="suspend"
+ cal:Message.Attach="[Event Click] = [Action WhenDone(suspend.Header)]"
+ Header="{x:Static Properties:ResourcesUI.QueueView_Suspend}"
+ IsCheckable="True"
+ attachedProperties:MenuItemExtensions.GroupName="whenDone" />
+ <MenuItem x:Name="hibernate"
+ cal:Message.Attach="[Event Click] = [Action WhenDone(hibernate.Header)]"
+ Header="{x:Static Properties:ResourcesUI.QueueView_Hibernate}"
+ IsCheckable="True"
+ attachedProperties:MenuItemExtensions.GroupName="whenDone" />
+ <MenuItem x:Name="lock"
+ cal:Message.Attach="[Event Click] = [Action WhenDone(lock.Header)]"
+ Header="{x:Static Properties:ResourcesUI.QueueView_LockSystem}"
+ IsCheckable="True"
+ attachedProperties:MenuItemExtensions.GroupName="whenDone" />
+ <MenuItem x:Name="logoff"
+ cal:Message.Attach="[Event Click] = [Action WhenDone(logoff.Header)]"
+ Header="{x:Static Properties:ResourcesUI.QueueView_Logoff}"
+ IsCheckable="True"
+ attachedProperties:MenuItemExtensions.GroupName="whenDone" />
+ <MenuItem x:Name="quit"
+ cal:Message.Attach="[Event Click] = [Action WhenDone(quit.Header)]"
+ Header="{x:Static Properties:ResourcesUI.QueueView_QuitHandBrake}"
+ IsCheckable="True"
+ attachedProperties:MenuItemExtensions.GroupName="whenDone" />
+ </MenuItem>
+ </Menu>
+ </StatusBarItem>
</StatusBar>
</Grid>
</UserControl>