summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2021-02-14 14:55:34 +0000
committersr55 <[email protected]>2021-02-14 14:55:34 +0000
commitbc74648ccab7f8fd78e27d004fef244e4d9182a6 (patch)
treea9000e92db3a4adb22576037af08a41afb603cfb /win/CS/HandBrakeWPF/ViewModels
parent678b423b632a842763b7ca10d6eee03efc898674 (diff)
WinGui: Minor UI/UX tweaks.
- Tab Section titles removed from single purpose tabs (Chapters, Subtitle, Audio, Filters). Was unnecessary and frees up some space. - A number of labels updated for consistency with the mac UI - Added "Open preview" button to the Dimensions tab. - Added "Source Preview" label to the Summary tab to try avoid confusion as to what this is for. - Better job status display (HB Error codes with text description) on queue summary.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs27
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs48
2 files changed, 41 insertions, 34 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 8ad8ab6cf..2d28fc9a5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -13,6 +13,10 @@ namespace HandBrakeWPF.ViewModels
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
+ using System.Linq;
+ using System.Windows;
+
+ using Caliburn.Micro;
using HandBrake.Interop.Interop;
using HandBrake.Interop.Interop.Interfaces.Model.Picture;
@@ -25,12 +29,15 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.Utilities;
using HandBrakeWPF.ViewModelItems.Filters;
using HandBrakeWPF.ViewModels.Interfaces;
+ using HandBrakeWPF.Views;
using EncodeTask = Services.Encode.Model.EncodeTask;
using Size = Model.Picture.Size;
public class PictureSettingsViewModel : ViewModelBase, IPictureSettingsViewModel
{
+ private readonly IWindowManager windowManager;
+
private string displaySize;
private bool heightControlEnabled = true;
private bool showCustomAnamorphicControls;
@@ -48,8 +55,9 @@ namespace HandBrakeWPF.ViewModels
private PictureSettingsResLimitModes selectedPictureSettingsResLimitMode;
- public PictureSettingsViewModel(IStaticPreviewViewModel staticPreviewViewModel)
+ public PictureSettingsViewModel(IStaticPreviewViewModel staticPreviewViewModel, IWindowManager windowManager)
{
+ this.windowManager = windowManager;
this.StaticPreviewViewModel = staticPreviewViewModel;
this.StaticPreviewViewModel.SetPictureSettingsInstance(this);
this.sourceResolution = new Size(0, 0);
@@ -660,7 +668,22 @@ namespace HandBrakeWPF.ViewModels
return true;
}
- /* Protected and Private Methods */
+ /* Protected and Private Methods */
+
+ public void OpenPreviewWindow()
+ {
+ if (!string.IsNullOrEmpty(this.Task.Source) && !this.StaticPreviewViewModel.IsOpen)
+ {
+ this.StaticPreviewViewModel.IsOpen = true;
+ this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task, this.scannedSource);
+ this.windowManager.ShowWindow(this.StaticPreviewViewModel);
+ }
+ else if (this.StaticPreviewViewModel.IsOpen)
+ {
+ Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(StaticPreviewView));
+ window?.Focus();
+ }
+ }
protected virtual void OnTabStatusChanged(TabStatusEventArgs e)
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 8292a6d43..549b23304 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -60,14 +60,15 @@ namespace HandBrakeWPF.ViewModels
public bool IsQueueRunning
{
- get
- {
- return this.isQueueRunning;
- }
+ get => this.isQueueRunning;
set
{
- if (value == this.isQueueRunning) return;
+ if (value == this.isQueueRunning)
+ {
+ return;
+ }
+
this.isQueueRunning = value;
this.NotifyOfPropertyChange(() => this.IsQueueRunning);
}
@@ -75,10 +76,7 @@ namespace HandBrakeWPF.ViewModels
public string JobsPending
{
- get
- {
- return this.jobsPending;
- }
+ get => this.jobsPending;
set
{
@@ -89,10 +87,7 @@ namespace HandBrakeWPF.ViewModels
public WhenDone WhenDoneAction
{
- get
- {
- return this.whenDoneAction;
- }
+ get => this.whenDoneAction;
set
{
@@ -101,26 +96,21 @@ namespace HandBrakeWPF.ViewModels
}
}
- public ObservableCollection<QueueTask> QueueTasks
- {
- get
- {
- return this.queueProcessor.Queue;
- }
- }
+ public ObservableCollection<QueueTask> QueueTasks => this.queueProcessor.Queue;
public BindingList<QueueTask> SelectedItems { get; }
public QueueTask SelectedTask
{
- get
- {
- return this.selectedTask;
- }
+ get => this.selectedTask;
set
{
- if (Equals(value, this.selectedTask)) return;
+ if (Equals(value, this.selectedTask))
+ {
+ return;
+ }
+
this.selectedTask = value;
this.NotifyOfPropertyChange(() => this.SelectedTask);
this.HandleLogData();
@@ -135,13 +125,7 @@ namespace HandBrakeWPF.ViewModels
}
}
- public bool JobInfoVisible
- {
- get
- {
- return SelectedItems.Count == 1;
- }
- }
+ public bool JobInfoVisible => SelectedItems.Count == 1;
public int SelectedTabIndex { get; set; }