summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/ISummaryViewModel.cs3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs22
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs10
4 files changed, 38 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
index 919a62170..06a22ae01 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
@@ -33,5 +33,8 @@ namespace HandBrakeWPF.ViewModels.Interfaces
/// Gets or sets a value indicating whether is open.
/// </summary>
bool IsOpen { get; set; }
+
+ void PreviousPreview();
+ void NextPreview();
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISummaryViewModel.cs
index 8ed5deb78..67d51a823 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISummaryViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISummaryViewModel.cs
@@ -19,5 +19,8 @@ namespace HandBrakeWPF.ViewModels.Interfaces
event EventHandler<OutputFormatChangedEventArgs> OutputFormatChanged;
void SetContainer(OutputFormat container);
void UpdateDisplayedInfo();
+
+ void PreviousPreview();
+ void NextPreview();
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
index 7359d2fd6..6f5fc6e5d 100644
--- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
@@ -426,6 +426,27 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public bool IsOpen { get; set; }
+ public void NextPreview()
+ {
+ int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount);
+ if ((this.SelectedPreviewImage + 1) == maxPreview)
+ {
+ return;
+ }
+
+ this.SelectedPreviewImage = this.SelectedPreviewImage + 1;
+ }
+
+ public void PreviousPreview()
+ {
+ if (this.SelectedPreviewImage < 1)
+ {
+ return;
+ }
+
+ this.SelectedPreviewImage = this.SelectedPreviewImage - 1;
+ }
+
/// <summary>
/// The update preview frame.
/// </summary>
@@ -667,6 +688,7 @@ namespace HandBrakeWPF.ViewModels
this.encodeService.Start(((QueueTask)state).Task, ((QueueTask)state).Configuration);
this.userSettingService.SetUserSetting(UserSettingConstants.LastPreviewDuration, this.Duration);
}
+
#endregion
#region Event Handlers
diff --git a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
index a0e4b2a78..90676cc0e 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
@@ -358,6 +358,11 @@ namespace HandBrakeWPF.ViewModels
public void NextPreview()
{
int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount);
+ if (this.selectedPreview == maxPreview)
+ {
+ return;
+ }
+
this.selectedPreview = this.selectedPreview + 1;
this.UpdatePreviewFrame();
this.PreviewInfo = string.Format(ResourcesUI.SummaryView_PreviewInfo, this.selectedPreview, maxPreview);
@@ -369,6 +374,11 @@ namespace HandBrakeWPF.ViewModels
public void PreviousPreview()
{
int maxPreview = this.userSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount);
+ if (this.selectedPreview <= 1)
+ {
+ return;
+ }
+
this.selectedPreview = this.selectedPreview - 1;
this.UpdatePreviewFrame();
this.PreviewInfo = string.Format(ResourcesUI.SummaryView_PreviewInfo, this.selectedPreview, maxPreview);