}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Encode Time:.\r
+ /// </summary>\r
+ public static string QueueView_Duration {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_Duration", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to End Time:.\r
+ /// </summary>\r
+ public static string QueueView_EndTime {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_EndTime", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Export Queue for CLI.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Filesize: .\r
+ /// </summary>\r
+ public static string QueueView_FileSize {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_FileSize", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Hibernate.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to The log will be available after the encode completes..\r
+ /// </summary>\r
+ public static string QueueView_LogNotAvailableYet {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_LogNotAvailableYet", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Log off.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Paused Duration:.\r
+ /// </summary>\r
+ public static string QueueView_PausedDuration {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_PausedDuration", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Picture Settings:.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Start Time:.\r
+ /// </summary>\r
+ public static string QueueView_StartTime {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_StartTime", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Statistics.\r
+ /// </summary>\r
+ public static string QueueView_Statistics {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_Statistics", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Statistics will be available after an encode completes..\r
+ /// </summary>\r
+ public static string QueueView_StatsNotAvailableYet {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_StatsNotAvailableYet", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Subtitles:.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Summary.\r
+ /// </summary>\r
+ public static string QueueView_Summary {\r
+ get {\r
+ return ResourceManager.GetString("QueueView_Summary", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Suspend.\r
/// </summary>\r
<data name="Options_ShowExperimentalQueueDesign" xml:space="preserve">\r
<value>Show the new experimental queue design.</value>\r
</data>\r
+ <data name="QueueView_Duration" xml:space="preserve">\r
+ <value>Encode Time:</value>\r
+ </data>\r
+ <data name="QueueView_EndTime" xml:space="preserve">\r
+ <value>End Time:</value>\r
+ </data>\r
+ <data name="QueueView_FileSize" xml:space="preserve">\r
+ <value>Filesize: </value>\r
+ </data>\r
+ <data name="QueueView_PausedDuration" xml:space="preserve">\r
+ <value>Paused Duration:</value>\r
+ </data>\r
+ <data name="QueueView_StartTime" xml:space="preserve">\r
+ <value>Start Time:</value>\r
+ </data>\r
+ <data name="QueueView_LogNotAvailableYet" xml:space="preserve">\r
+ <value>The log will be available after the encode completes.</value>\r
+ </data>\r
+ <data name="QueueView_Statistics" xml:space="preserve">\r
+ <value>Statistics</value>\r
+ </data>\r
+ <data name="QueueView_StatsNotAvailableYet" xml:space="preserve">\r
+ <value>Statistics will be available after an encode completes.</value>\r
+ </data>\r
+ <data name="QueueView_Summary" xml:space="preserve">\r
+ <value>Summary</value>\r
+ </data>\r
</root>
\ No newline at end of file
{
get
{
+ if (this.endTime == DateTime.MinValue)
+ {
+ return TimeSpan.MinValue;
+ }
+
return this.EndTime - this.StartTime - this.PausedDuration;
}
}
private readonly IErrorService errorService;\r
private readonly IUserSettingService userSettingService;\r
private readonly IQueueProcessor queueProcessor;\r
- private bool isEncoding;\r
private string jobStatus;\r
private string jobsPending;\r
private string whenDoneAction;\r
this.SelectedItems = new BindingList<QueueTask>();\r
this.DisplayName = "Queue";\r
this.IsQueueRunning = false;\r
- \r
+\r
this.WhenDoneAction = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction);\r
}\r
\r
this.NotifyOfPropertyChange(() => this.CanRetryJob);\r
this.NotifyOfPropertyChange(() => this.CanEditJob);\r
this.NotifyOfPropertyChange(() => this.CanRemoveJob);\r
+ this.NotifyOfPropertyChange(() => this.StatsVisible);\r
}\r
}\r
\r
- public bool ShowLogTab { get; private set; }\r
-\r
public string ActivityLog { get; private set; }\r
\r
public bool CanRetryJob => this.SelectedTask != null && this.SelectedTask.Status != QueueItemStatus.Waiting;\r
\r
public bool IsInline { get; set; }\r
\r
+ public bool StatsVisible\r
+ {\r
+ get\r
+ {\r
+ if (this.SelectedTask != null &&\r
+ (this.selectedTask.Status == QueueItemStatus.Completed || this.selectedTask.Status == QueueItemStatus.Error))\r
+ {\r
+ return true;\r
+ }\r
+\r
+ return false;\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Public Methods\r
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);\r
this.IsQueueRunning = false;\r
\r
- MessageBox.Show(Resources.QueueViewModel_QueuePauseNotice, Resources.QueueViewModel_Queue, \r
+ MessageBox.Show(Resources.QueueViewModel_QueuePauseNotice, Resources.QueueViewModel_Queue,\r
MessageBoxButton.OK, MessageBoxImage.Information);\r
}\r
\r
{\r
MessageBoxResult result =\r
this.errorService.ShowMessageBox(\r
- Resources.QueueViewModel_JobCurrentlyRunningWarning, \r
- Resources.Warning, \r
- MessageBoxButton.YesNo, \r
+ Resources.QueueViewModel_JobCurrentlyRunningWarning,\r
+ Resources.Warning,\r
+ MessageBoxButton.YesNo,\r
MessageBoxImage.Question);\r
\r
if (result == MessageBoxResult.Yes)\r
public void Export()\r
{\r
SaveFileDialog dialog = new SaveFileDialog\r
- {\r
- Filter = "Json (*.json)|*.json", \r
- OverwritePrompt = true, \r
- DefaultExt = ".json", \r
- AddExtension = true\r
- };\r
+ {\r
+ Filter = "Json (*.json)|*.json",\r
+ OverwritePrompt = true,\r
+ DefaultExt = ".json",\r
+ AddExtension = true\r
+ };\r
\r
if (dialog.ShowDialog() == true)\r
{\r
public void EditJob(QueueTask task)\r
{\r
MessageBoxResult result = this.errorService.ShowMessageBox(\r
- Resources.QueueViewModel_EditConfrimation, \r
- "Modify Job?", \r
- MessageBoxButton.YesNo, \r
+ Resources.QueueViewModel_EditConfrimation,\r
+ "Modify Job?",\r
+ MessageBoxButton.YesNo,\r
MessageBoxImage.Question);\r
\r
if (result != MessageBoxResult.Yes)\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Open the Log file directory\r
+ /// </summary>\r
+ public void OpenLogDirectory()\r
+ {\r
+ string logDir = DirectoryUtilities.GetLogDirectory();\r
+ string windir = Environment.GetEnvironmentVariable("WINDIR");\r
+ Process prc = new Process { StartInfo = { FileName = windir + @"\explorer.exe", Arguments = logDir } };\r
+ prc.Start();\r
+ }\r
+\r
+ /// <summary>\r
+ /// Copy the log file to the system clipboard\r
+ /// </summary>\r
+ public void CopyLog()\r
+ {\r
+ try\r
+ {\r
+ Clipboard.SetDataObject(this.ActivityLog, true);\r
+ }\r
+ catch (Exception exc)\r
+ {\r
+ this.errorService.ShowError(Resources.Clipboard_Unavailable, Resources.Clipboard_Unavailable_Solution, exc);\r
+ }\r
+ }\r
+\r
private void HandleLogData()\r
{\r
- if (this.SelectedTask == null || this.SelectedTask.Status == QueueItemStatus.InProgress)\r
+ if (this.SelectedTask == null || this.SelectedTask.Status == QueueItemStatus.InProgress || this.SelectedTask.Status == QueueItemStatus.Waiting)\r
{\r
- this.ShowLogTab = false;\r
+ this.ActivityLog = ResourcesUI.QueueView_LogNotAvailableYet;\r
}\r
else\r
{\r
this.ActivityLog = logContent;\r
}\r
\r
- this.ShowLogTab = true;\r
}\r
}\r
catch (Exception exc)\r
{\r
Debug.WriteLine(exc);\r
- this.ShowLogTab = true;\r
this.ActivityLog = exc.ToString();\r
}\r
}\r
\r
- this.NotifyOfPropertyChange(() => this.ShowLogTab);\r
this.NotifyOfPropertyChange(() => this.ActivityLog);\r
}\r
\r
Execute.OnUIThread(() =>\r
{\r
string jobsPending = string.Format(Resources.Main_JobsPending_addon, this.queueProcessor.Count);\r
- this.IntermediateProgress = false; \r
+ this.IntermediateProgress = false;\r
\r
if (e.IsSubtitleScan)\r
{\r
this.NotifyOfPropertyChange(() => this.CanRetryJob);\r
this.NotifyOfPropertyChange(() => this.CanEditJob);\r
this.NotifyOfPropertyChange(() => this.CanRemoveJob);\r
+ this.NotifyOfPropertyChange(() => this.StatsVisible);\r
+ this.HandleLogData();\r
}\r
\r
/// <summary>\r
{\r
this.JobStatus = Resources.QueueViewModel_QueueStarted;\r
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);\r
- this.IsQueueRunning = true; \r
+ this.IsQueueRunning = true;\r
}\r
\r
private void QueueProcessor_QueuePaused(object sender, EventArgs e)\r
<TextBlock Text="{Binding Task.Destination, Converter={StaticResource filePathToFilenameConverter}}" />
</StackPanel>
- <ProgressBar Minimum="0" Height="4" Maximum="100" Name="pbStatus" Margin="0,0,5,0"
+ <ProgressBar Minimum="0" Height="4" Maximum="100" Name="pbStatus" Margin="0,2,5,0"
Value="{Binding DataContext.ProgressValue, ElementName=queueJobs}" IsIndeterminate="{Binding DataContext.IntermediateProgress, ElementName=queueJobs}"
Visibility="{Binding ShowEncodeProgress, Converter={StaticResource boolToVisConverter}}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
-
- <TabControl x:Name="summaryTabControl" Grid.Column="1" Margin="0,0,10,10">
- <TabItem Header="Summary" >
+
+ <TabControl x:Name="summaryTabControl" Grid.Column="1" Margin="0,0,10,10" >
+ <TabItem Header="{x:Static Properties:ResourcesUI.QueueView_Summary}" >
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="5,5,0,5">
<StackPanel Orientation="Vertical" Margin="5,5,0,5">
</StackPanel>
</ScrollViewer>
</TabItem>
+
+ <TabItem Header="{x:Static Properties:ResourcesUI.QueueView_Statistics}" >
+ <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="10,0,0,5">
+ <StackPanel>
+ <TextBlock Text="{x:Static Properties:ResourcesUI.QueueView_StatsNotAvailableYet}" Margin="0,10,0,0" Visibility="{Binding StatsVisible, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
+
+ <Grid Style="{StaticResource LongToolTipHolder}" Margin="0,5,0,0" Visibility="{Binding StatsVisible, Converter={StaticResource boolToVisConverter}}">
+ <Grid.Resources>
+ <Style TargetType="TextBlock">
+ <Setter Property="Margin" Value="0,5,0,5" />
+ </Style>
+ </Grid.Resources>
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" MinWidth="100" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:ResourcesUI.QueueView_StartTime}" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" />
+ <TextBlock Text="{Binding SelectedTask.Statistics.StartTime}" TextWrapping="Wrap" Grid.Row="0" Grid.Column="1" />
+
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:ResourcesUI.QueueView_EndTime}" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" />
+ <TextBlock Text="{Binding SelectedTask.Statistics.EndTime}" TextWrapping="Wrap" Grid.Row="1" Grid.Column="1" />
+
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:ResourcesUI.QueueView_PausedDuration}" VerticalAlignment="Top" Grid.Row="2" Grid.Column="0" />
+ <TextBlock Text="{Binding SelectedTask.Statistics.PausedDuration,StringFormat=hh\\:mm\\:ss}" TextWrapping="Wrap" Grid.Row="2" Grid.Column="1" />
+
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:ResourcesUI.QueueView_Duration}" VerticalAlignment="Top" Grid.Row="3" Grid.Column="0" />
+ <TextBlock Text="{Binding SelectedTask.Statistics.Duration,StringFormat=hh\\:mm\\:ss}" TextWrapping="Wrap" Grid.Row="3" Grid.Column="1" />
+
+ <TextBlock FontWeight="Bold" Text="{x:Static Properties:ResourcesUI.QueueView_FileSize}" VerticalAlignment="Top" Grid.Row="4" Grid.Column="0" />
+ <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1" >
+ <TextBlock Text="{Binding SelectedTask.Statistics.FinalFileSizeInMegaBytes}" TextWrapping="Wrap" />
+ <TextBlock Text=" MB" />
+ </StackPanel>
+
+ </Grid>
+
+ </StackPanel>
+ </ScrollViewer>
+ </TabItem>
+
+ <TabItem Header="{x:Static Properties:ResourcesUI.MainView_ActivityLog}">
+ <TextBox ScrollViewer.VerticalScrollBarVisibility="Visible" Text="{Binding ActivityLog, Mode=OneWay}" TextWrapping="Wrap" x:Name="logText">
+ <TextBox.ContextMenu>
+ <ContextMenu>
+ <MenuItem Header="{x:Static Properties:ResourcesUI.LogView_CopyClipboard}" cal:Message.Attach="[Event Click] = [Action CopyLog]" >
+ <MenuItem.Icon>
+ <Image Width="16" Source="../Images/copy.png" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <MenuItem Header="{x:Static Properties:ResourcesUI.LogView_OpenLogDir}" cal:Message.Attach="[Event Click] = [Action OpenLogDirectory]">
+ <MenuItem.Icon>
+ <Image Width="16" Source="../Images/folder.png" />
+ </MenuItem.Icon>
+ </MenuItem>
+ </ContextMenu>
+ </TextBox.ContextMenu>
+ </TextBox>
+ </TabItem>
</TabControl>
</Grid>