diff options
author | sr55 <[email protected]> | 2018-09-22 19:45:24 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-09-22 19:45:24 +0100 |
commit | c0ab54be2370f7ddd889738a425e8076d76c9043 (patch) | |
tree | 5b49b176cce9ea765538239aa5189a7c721529e2 /win/CS/HandBrakeWPF/ViewModels | |
parent | ebc64438a1c1621f9aef1d38f166419ed5b6e92c (diff) |
WinGui: Implementing the new queue design. This is currently experimental and has to be explicitly enabled in preferences -> General #1087
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
4 files changed, 93 insertions, 9 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs index 4f455d373..2e1de25a4 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IQueueViewModel.cs @@ -15,6 +15,13 @@ namespace HandBrakeWPF.ViewModels.Interfaces public interface IQueueViewModel
{
/// <summary>
+ /// Temporary variable to toggle the new style experimental queue.
+ /// </summary>
+ bool IsNewQueueVisible { set; }
+
+ bool IsInline { set; }
+
+ /// <summary>
/// The when done action after a queue completes.
/// </summary>
/// <param name="action">
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 447810846..980e52531 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1400,6 +1400,10 @@ namespace HandBrakeWPF.ViewModels public void OpenQueueWindow()
{
bool showQueueInline = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowQueueInline);
+ bool showNewQueue = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowExperimentalQueue); ;
+
+ this.QueueViewModel.IsNewQueueVisible = showNewQueue;
+ this.QueueViewModel.IsInline = showQueueInline;
if (showQueueInline)
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 75e6d9da7..fb9cf5228 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -88,7 +88,6 @@ namespace HandBrakeWPF.ViewModels private bool showAdvancedTab;
private bool removePunctuation;
private bool resetWhenDoneAction;
-
private bool enableQuickSyncDecoding;
private bool showQueueInline;
private bool pauseOnLowDiskspace;
@@ -96,16 +95,13 @@ namespace HandBrakeWPF.ViewModels private bool useQsvDecodeForNonQsvEnc;
private bool showStatusInTitleBar;
private bool showPreviewOnSummaryTab;
-
private string whenDoneAudioFile;
private bool playSoundWhenDone;
private bool playSoundWhenQueueDone;
-
private bool enableQuickSyncEncoding;
-
- private bool enableVceEncoder;
-
+ private bool enableVceEncoder;
private bool enableNvencEncoder;
+ private bool showExperimentalQueue;
#endregion
@@ -369,6 +365,17 @@ namespace HandBrakeWPF.ViewModels }
}
+ public bool ShowExperimentalQueue
+ {
+ get => this.showExperimentalQueue;
+ set
+ {
+ if (value == this.showExperimentalQueue) return;
+ this.showExperimentalQueue = value;
+ this.NotifyOfPropertyChange(() => this.ShowExperimentalQueue);
+ }
+ }
+
/// <summary>
/// Gets or sets a value indicating whether to show encode status in the tile bar.
/// </summary>
@@ -1357,7 +1364,8 @@ namespace HandBrakeWPF.ViewModels this.WhenDoneAudioFileFullPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenDoneAudioFile);
this.PlaySoundWhenDone = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PlaySoundWhenDone);
this.PlaySoundWhenQueueDone = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PlaySoundWhenQueueDone);
-
+ this.ShowExperimentalQueue = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowExperimentalQueue);
+
// #############################
// Output Settings
// #############################
@@ -1518,13 +1526,17 @@ namespace HandBrakeWPF.ViewModels this.userSettingService.SetUserSetting(UserSettingConstants.SendFile, this.SendFileAfterEncode);
this.userSettingService.SetUserSetting(UserSettingConstants.SendFileToArgs, this.Arguments);
this.userSettingService.SetUserSetting(UserSettingConstants.ResetWhenDoneAction, this.ResetWhenDoneAction);
- this.userSettingService.SetUserSetting(UserSettingConstants.ShowQueueInline, this.ShowQueueInline);
this.userSettingService.SetUserSetting(UserSettingConstants.ShowStatusInTitleBar, this.ShowStatusInTitleBar);
this.userSettingService.SetUserSetting(UserSettingConstants.ShowPreviewOnSummaryTab, this.ShowPreviewOnSummaryTab);
this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenDone, this.PlaySoundWhenDone);
this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenQueueDone, this.PlaySoundWhenQueueDone);
this.userSettingService.SetUserSetting(UserSettingConstants.WhenDoneAudioFile, this.WhenDoneAudioFileFullPath);
+ /* Experiments */
+ this.userSettingService.SetUserSetting(UserSettingConstants.ShowQueueInline, this.ShowQueueInline);
+ this.userSettingService.SetUserSetting(UserSettingConstants.ShowExperimentalQueue, this.ShowExperimentalQueue);
+
+
/* Output Files */
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles);
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNameFormat, this.AutonameFormat);
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 57ebd2830..aefcf2980 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -47,8 +47,10 @@ namespace HandBrakeWPF.ViewModels private string jobsPending;
private string whenDoneAction;
private QueueTask selectedTask;
-
private bool isQueueRunning;
+ private double progressValue;
+ private bool intermediateProgress;
+ private bool showEncodeProgress;
#endregion
@@ -183,6 +185,10 @@ namespace HandBrakeWPF.ViewModels this.selectedTask = value;
this.NotifyOfPropertyChange(() => this.SelectedTask);
this.HandleLogData();
+
+ this.NotifyOfPropertyChange(() => this.CanRetryJob);
+ this.NotifyOfPropertyChange(() => this.CanEditJob);
+ this.NotifyOfPropertyChange(() => this.CanRemoveJob);
}
}
@@ -190,6 +196,49 @@ namespace HandBrakeWPF.ViewModels public string ActivityLog { get; private set; }
+ public bool CanRetryJob => this.SelectedTask != null && this.SelectedTask.Status != QueueItemStatus.Waiting;
+
+ public bool CanEditJob => this.SelectedTask != null;
+
+ public bool CanRemoveJob => this.SelectedTask != null;
+
+ public double ProgressValue
+ {
+ get => this.progressValue;
+ set
+ {
+ if (value == this.progressValue) return;
+ this.progressValue = value;
+ this.NotifyOfPropertyChange(() => this.ProgressValue);
+ }
+ }
+
+ public bool IntermediateProgress
+ {
+ get => this.intermediateProgress;
+ set
+ {
+ if (value == this.intermediateProgress) return;
+ this.intermediateProgress = value;
+ this.NotifyOfPropertyChange(() => this.IntermediateProgress);
+ }
+ }
+
+ public bool ShowEncodeProgress
+ {
+ get => this.showEncodeProgress;
+ set
+ {
+ if (value == this.showEncodeProgress) return;
+ this.showEncodeProgress = value;
+ this.NotifyOfPropertyChange(() => this.ShowEncodeProgress);
+ }
+ }
+
+ public bool IsNewQueueVisible { get; set; }
+
+ public bool IsInline { get; set; }
+
#endregion
#region Public Methods
@@ -376,6 +425,7 @@ namespace HandBrakeWPF.ViewModels task.Status = QueueItemStatus.Waiting;
this.queueProcessor.BackupQueue(null);
this.JobsPending = string.Format(Resources.QueueViewModel_JobsPending, this.queueProcessor.Count);
+ this.NotifyOfPropertyChange(() => this.CanRetryJob);
}
/// <summary>
@@ -611,6 +661,8 @@ namespace HandBrakeWPF.ViewModels Execute.OnUIThread(() =>
{
string jobsPending = string.Format(Resources.Main_JobsPending_addon, this.queueProcessor.Count);
+ this.IntermediateProgress = false;
+
if (e.IsSubtitleScan)
{
this.JobStatus = string.Format(Resources.MainViewModel_EncodeStatusChanged_SubScan_StatusLabel,
@@ -620,14 +672,18 @@ namespace HandBrakeWPF.ViewModels e.EstimatedTimeLeft,
e.ElapsedTime,
jobsPending);
+
+ this.ProgressValue = e.PercentComplete;
}
else if (e.IsMuxing)
{
this.JobStatus = ResourcesUI.MainView_Muxing;
+ this.IntermediateProgress = true;
}
else if (e.IsSearching)
{
this.JobStatus = string.Format(ResourcesUI.MainView_ProgressStatusWithTask, ResourcesUI.MainView_Searching, e.PercentComplete, e.EstimatedTimeLeft, jobsPending);
+ this.ProgressValue = e.PercentComplete;
}
else
{
@@ -641,6 +697,7 @@ namespace HandBrakeWPF.ViewModels e.EstimatedTimeLeft,
e.ElapsedTime,
jobsPending);
+ this.ProgressValue = e.PercentComplete;
}
});
}
@@ -663,6 +720,10 @@ namespace HandBrakeWPF.ViewModels this.JobStatus = Resources.QueueViewModel_QueueNotRunning;
this.IsQueueRunning = false;
}
+
+ this.NotifyOfPropertyChange(() => this.CanRetryJob);
+ this.NotifyOfPropertyChange(() => this.CanEditJob);
+ this.NotifyOfPropertyChange(() => this.CanRemoveJob);
}
/// <summary>
|