- Added "Options" drop button to the Summary Tab. Includes "Play File" and "Open Source/Dest directory" options
- Moved the encode status information onto the Summary Tab (only shown when encoding)
- Added placeholder buttons for Move up/down to make queue re-ordering more discoverable.
- Space optimisation
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Play File.\r
+ /// </summary>\r
+ public static string QueueView_PlayMediaFile {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_PlayMediaFile", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Quit HandBrake.\r
/// </summary>\r
<data name="MainView_ShowAddSelectionToQueue" xml:space="preserve">\r
<value>'Add Selection' to Queue</value>\r
</data>\r
+ <data name="QueueView_PlayMediaFile" xml:space="preserve">\r
+ <value>Play File</value>\r
+ </data>\r
</root>
\ No newline at end of file
using System.Diagnostics;\r
using System.IO;\r
using System.Linq;\r
+ using System.Runtime.CompilerServices;\r
using System.Windows;\r
\r
using Caliburn.Micro;\r
this.errorService = errorService;\r
this.Title = Resources.QueueViewModel_Queue;\r
this.JobsPending = Resources.QueueViewModel_NoEncodesPending;\r
- this.JobStatus = Resources.QueueViewModel_NoJobsPending;\r
+ this.JobStatus = string.Empty;\r
this.SelectedItems = new BindingList<QueueTask>();\r
this.DisplayName = "Queue";\r
this.IsQueueRunning = false;\r
{\r
this.jobStatus = value;\r
this.NotifyOfPropertyChange(() => this.JobStatus);\r
+ this.NotifyOfPropertyChange(() => this.IsJobStatusVisible);\r
}\r
}\r
\r
+ public bool IsJobStatusVisible => !string.IsNullOrEmpty(this.JobStatus);\r
+\r
/// <summary>\r
/// Gets or sets JobsPending.\r
/// </summary>\r
this.NotifyOfPropertyChange(() => this.CanRetryJob);\r
this.NotifyOfPropertyChange(() => this.CanEditJob);\r
this.NotifyOfPropertyChange(() => this.CanRemoveJob);\r
+ this.NotifyOfPropertyChange(() => this.CanPerformActionOnSource);\r
+ this.NotifyOfPropertyChange(() => this.CanPlayFile);\r
this.NotifyOfPropertyChange(() => this.StatsVisible);\r
}\r
}\r
\r
public bool CanRemoveJob => this.SelectedTask != null;\r
\r
+ public bool CanPerformActionOnSource => this.SelectedTask != null;\r
+\r
+ public bool CanPlayFile =>\r
+ this.SelectedTask != null && this.SelectedTask.Task.Destination != null && \r
+ this.SelectedTask.Status == QueueItemStatus.Completed && File.Exists(this.SelectedTask.Task.Destination);\r
+\r
public double ProgressValue\r
{\r
get => this.progressValue;\r
{\r
this.queueProcessor.Pause();\r
\r
- this.JobStatus = Resources.QueueViewModel_QueuePending;\r
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);\r
this.IsQueueRunning = false;\r
\r
task.Status = QueueItemStatus.Waiting;\r
this.queueProcessor.BackupQueue(null);\r
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);\r
- this.JobStatus = Resources.QueueViewModel_QueueReady;\r
this.NotifyOfPropertyChange(() => this.CanRetryJob);\r
}\r
\r
return;\r
}\r
\r
- this.JobStatus = Resources.QueueViewModel_QueueStarted;\r
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);\r
this.IsQueueRunning = true;\r
\r
mvm.EditQueueJob(task);\r
}\r
\r
+ public void OpenSourceDir()\r
+ {\r
+ this.OpenSourceDirectory(this.SelectedTask);\r
+\r
+ }\r
+\r
+ public void OpenDestDir()\r
+ {\r
+ this.OpenDestinationDirectory(this.SelectedTask);\r
+ }\r
+\r
public void OpenSourceDirectory(QueueTask task)\r
{\r
if (task != null)\r
}\r
}\r
\r
+ public void PlayFile()\r
+ {\r
+ if (this.SelectedTask != null && this.SelectedTask.Task != null && File.Exists(this.SelectedTask.Task.Destination))\r
+ {\r
+ Process.Start(this.SelectedTask.Task.Destination);\r
+ }\r
+ }\r
+\r
+ public void MoveUp()\r
+ {\r
+ this.errorService.ShowMessageBox("Not Implemented yet. You can drag / drop re-organise the queue for now.", "Coming Soon!", MessageBoxButton.OK, MessageBoxImage.Information);\r
+ }\r
+\r
+ public void MoveDown()\r
+ {\r
+ this.errorService.ShowMessageBox("Not Implemented yet. You can drag / drop re-organise the queue for now.", "Coming Soon!", MessageBoxButton.OK, MessageBoxImage.Information);\r
+ }\r
\r
#endregion\r
\r
this.queueProcessor.QueuePaused += this.QueueProcessor_QueuePaused;\r
\r
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);\r
- this.JobStatus = Resources.QueueViewModel_QueueReady;\r
\r
base.OnActivate();\r
}\r
\r
if (!queueProcessor.IsProcessing)\r
{\r
- this.JobStatus = Resources.QueueViewModel_QueueNotRunning;\r
this.IsQueueRunning = false;\r
}\r
\r
this.NotifyOfPropertyChange(() => this.CanRetryJob);\r
this.NotifyOfPropertyChange(() => this.CanEditJob);\r
this.NotifyOfPropertyChange(() => this.CanRemoveJob);\r
+ this.NotifyOfPropertyChange(() => this.CanPerformActionOnSource);\r
+ this.NotifyOfPropertyChange(() => this.CanPlayFile);\r
this.NotifyOfPropertyChange(() => this.StatsVisible);\r
this.HandleLogData();\r
}\r
/// </param>\r
private void queueProcessor_QueueCompleted(object sender, EventArgs e)\r
{\r
- this.JobStatus = Resources.QueueViewModel_QueueCompleted;\r
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);\r
this.IsQueueRunning = false;\r
this.NotifyOfPropertyChange(() => this.SelectedTask);\r
this.NotifyOfPropertyChange(() => this.StatsVisible);\r
this.NotifyOfPropertyChange(() => this.CanRetryJob);\r
+\r
+ this.JobStatus = string.Empty;\r
}\r
\r
/// <summary>\r
{\r
if (!this.queueProcessor.IsProcessing)\r
{\r
- this.JobStatus = Resources.QueueViewModel_LastJobFinished;\r
+ this.JobStatus = string.Empty;\r
}\r
}\r
\r
</Grid.ColumnDefinitions>
<TextBlock Text="{x:Static Properties:Resources.MainView_ShowQueue}" FontSize="28" VerticalAlignment="Center" FontFamily="Segoe UI Light" Margin="10,0,0,0" />
-
</Grid>
- <StackPanel Grid.Row="1" Margin="20,5,10,0" Visibility="{Binding IsNewQueueVisible, Converter={StaticResource boolToVisConverter}}">
- <TextBlock Text="{Binding JobsPending}" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis" />
- <TextBlock Text="{Binding JobStatus}" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis"/>
- </StackPanel>
-
- <Grid Grid.Row="2" Margin="0,10,0,0">
+ <Grid Grid.Row="2" Margin="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" MaxWidth="600" x:Name="leftTabPanel" />
<ColumnDefinition Width="5*" x:Name="rightTabPanel" />
<Border>
<Grid>
<Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
- <ListBox Tag="{Binding}" x:Name="queueJobs" Grid.Row="0" Margin="10,0,5,0"
+ <Grid Grid.Row="0" HorizontalAlignment="Stretch" Margin="15,0,5,5">
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Text="{Binding JobsPending}" Grid.Row="1" Grid.Column="0" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis"/>
+
+ <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
+ <Button Content="^" Width="20" Height="20" Margin="0" cal:Message.Attach="[Event Click] = [Action MoveUp]" />
+ <Button Content="v" Width="20" Height="20" Margin="5,0,0,0" cal:Message.Attach="[Event Click] = [Action MoveDown]" />
+ </StackPanel>
+ </Grid>
+
+ <ListBox Tag="{Binding}" x:Name="queueJobs" Grid.Row="1" Margin="10,0,5,0"
dd:DragDrop.DropHandler="{Binding}"
dd:DragDrop.IsDragSource="True"
</ListBox.ItemTemplate>
</ListBox>
- <Border BorderThickness="1,0,1,1" BorderBrush="DarkGray" Grid.Row="1" Margin="10,0,5,10" SnapsToDevicePixels="True" >
+ <Border BorderThickness="1,0,1,1" BorderBrush="DarkGray" Grid.Row="2" Margin="10,0,5,10" SnapsToDevicePixels="True" >
<Menu HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent"
AutomationProperties.Name="{x:Static Properties:Resources.QueueView_WhenDone}">
<MenuItem>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
+
+
+ <Button x:Name="queueOptionsDropButton" Margin="10,0,0,0" Click="QueueOptionsDropButton_OnClick"
+ AutomationProperties.Name="{x:Static Properties:Resources.QueueView_Options}" IsEnabled="{Binding CanPerformActionOnSource}">
+ <Button.Content>
+ <StackPanel Orientation="Horizontal">
+ <Image Width="20" Height="20" VerticalAlignment="Center" Margin="0,0,5,0"
+ Source="../Images/Advanced.png">
+ </Image>
+
+ <TextBlock Margin="0,0,5,0" Padding="0"
+ VerticalAlignment="Center"
+ Text="{x:Static Properties:Resources.QueueView_Options}" />
+
+ <Path Height="5" Margin="2,2,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"
+ Data="M 0 0 L 4 4 L 8 0 Z"
+ Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrowPreset" />
+ </StackPanel>
+ </Button.Content>
+
+ <Button.ContextMenu>
+ <ContextMenu cal:Action.TargetWithoutContext="{Binding DataContext, RelativeSource={RelativeSource Self}}">
+ <MenuItem Header="{x:Static Properties:Resources.QueueView_PlayMediaFile}" cal:Message.Attach="[Event Click] = [Action PlayFile]" />
+ <Separator />
+ <MenuItem Header="{x:Static Properties:Resources.QueueView_OpenSourceDir}" cal:Message.Attach="[Event Click] = [Action OpenSourceDir]" />
+ <MenuItem Header="{x:Static Properties:Resources.QueueView_OpenDestDir}" cal:Message.Attach="[Event Click] = [Action OpenDestDir]" />
+ </ContextMenu>
+ </Button.ContextMenu>
+ </Button>
</StackPanel>
- <Grid Style="{StaticResource LongToolTipHolder}" Margin="0,5,0,0" >
+ <TextBlock Text="{Binding JobStatus}" Visibility="{Binding IsJobStatusVisible, Converter={StaticResource boolToVisConverter}}"
+ Margin="0,15,10,5" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis" />
+
+ <Grid Style="{StaticResource LongToolTipHolder}" Margin="0,10,0,0" >
<Grid.Resources>
<Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="Margin" Value="0,5,0,5" />
private QueueTask mouseActiveQueueTask;
/// <summary>
- /// Initializes a new instance of the <see cref="Queue2View"/> class.
+ /// Initializes a new instance of the <see cref="QueueTwoContent"/> class.
/// </summary>
public QueueTwoContent()
{
{
((QueueViewModel)this.DataContext).OpenDestinationDirectory(this.mouseActiveQueueTask);
}
+
+ private void QueueOptionsDropButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ var button = sender as FrameworkElement;
+ if (button != null && button.ContextMenu != null)
+ {
+ button.ContextMenu.PlacementTarget = button;
+ button.ContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
+ button.ContextMenu.IsOpen = true;
+ }
+ }
}
}
\r
<StackPanel Grid.Row="1" Margin="10,20,10,0">\r
<TextBlock Text="{Binding JobsPending}" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis" />\r
- <TextBlock Text="{Binding JobStatus}" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis"/>\r
+ <TextBlock Text="{Binding JobStatus}" Visibility="{Binding IsJobStatusVisible, Converter={StaticResource boolToVisConverter}}" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis"/>\r
</StackPanel>\r
\r
<ListBox Grid.Row="2" Tag="{Binding}" x:Name="queueJobs"\r