diff options
author | sr55 <[email protected]> | 2013-03-05 20:12:21 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-03-05 20:12:21 +0000 |
commit | 4ff95a7b1eac44a1577010e1cf3eaf8fa89c679d (patch) | |
tree | f604015295c72573850412eca55b9fd037e59976 /win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs | |
parent | 99fd7e4c1828a837203a9f351ab2df9e30f27216 (diff) |
WinGui: Show the two log files as tabs rather than a combobox selection. Makes it more obvious that there are two logs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5306 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs | 87 |
1 files changed, 16 insertions, 71 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs index 4c97ab412..5bf95d22f 100644 --- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs @@ -36,10 +36,6 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private readonly IScanServiceWrapper scanService;
- /// <summary>
- /// Backing field for the selected mode
- /// </summary>
- private int selectedMode;
#endregion
/// <summary>
@@ -56,46 +52,32 @@ namespace HandBrakeWPF.ViewModels this.encodeService = encodeService;
this.scanService = scanService;
this.Title = "Log Viewer";
-
- this.SelectedMode = this.encodeService.IsEncoding ? 0 : 1;
}
/// <summary>
- /// Gets Log.
+ /// Gets or sets the selected tab.
/// </summary>
- public string Log
- {
- get
- {
- return this.SelectedMode == 0 ? this.encodeService.ActivityLog : this.scanService.ActivityLog;
- }
- }
+ public int SelectedTab { get; set; }
/// <summary>
- /// Gets LogModes.
+ /// Gets Log.
/// </summary>
- public IEnumerable<string> LogModes
+ public string ScanLog
{
get
{
- return new List<string> { "Encode Log", "Scan Log" };
+ return this.scanService.ActivityLog;
}
}
/// <summary>
- /// Gets or sets SelectedMode.
+ /// Gets the encodelog.
/// </summary>
- public int SelectedMode
+ public string EncodeLog
{
get
{
- return selectedMode;
- }
- set
- {
- selectedMode = value;
- this.NotifyOfPropertyChange(() => this.SelectedMode);
- this.ChangeLogDisplay();
+ return this.encodeService.ActivityLog;
}
}
@@ -115,7 +97,7 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void CopyLog()
{
- Clipboard.SetDataObject(this.Log, true);
+ Clipboard.SetDataObject(this.SelectedTab == 0 ? this.ScanLog : this.EncodeLog, true);
}
/// <summary>
@@ -123,13 +105,14 @@ namespace HandBrakeWPF.ViewModels /// </summary>
protected override void OnActivate()
{
- this.scanService.ScanStared += ScanServiceScanStared;
this.scanService.ScanCompleted += ScanServiceScanCompleted;
- this.encodeService.EncodeStarted += EncodeServiceEncodeStarted;
this.encodeService.EncodeCompleted += EncodeServiceEncodeCompleted;
this.encodeService.EncodeStatusChanged += this.EncodeServiceEncodeStatusChanged;
this.scanService.ScanStatusChanged += this.ScanServiceScanStatusChanged;
base.OnActivate();
+
+ this.NotifyOfPropertyChange(() => this.ScanLog);
+ this.NotifyOfPropertyChange(() => this.EncodeLog);
}
/// <summary>
@@ -143,7 +126,7 @@ namespace HandBrakeWPF.ViewModels /// </param>
private void ScanServiceScanStatusChanged(object sender, ScanProgressEventArgs e)
{
- this.NotifyOfPropertyChange(() => this.Log);
+ this.NotifyOfPropertyChange(() => this.ScanLog);
}
/// <summary>
@@ -157,7 +140,7 @@ namespace HandBrakeWPF.ViewModels /// </param>
private void EncodeServiceEncodeStatusChanged(object sender, EncodeProgressEventArgs e)
{
- this.NotifyOfPropertyChange(() => this.Log);
+ this.NotifyOfPropertyChange(() => this.EncodeLog);
}
/// <summary>
@@ -168,9 +151,7 @@ namespace HandBrakeWPF.ViewModels /// </param>
protected override void OnDeactivate(bool close)
{
- this.scanService.ScanStared -= ScanServiceScanStared;
this.scanService.ScanCompleted -= ScanServiceScanCompleted;
- this.encodeService.EncodeStarted -= EncodeServiceEncodeStarted;
this.encodeService.EncodeCompleted -= EncodeServiceEncodeCompleted;
this.encodeService.EncodeStatusChanged -= this.EncodeServiceEncodeStatusChanged;
this.scanService.ScanStatusChanged -= this.ScanServiceScanStatusChanged;
@@ -179,42 +160,6 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Change the Log Display
- /// </summary>
- private void ChangeLogDisplay()
- {
- this.NotifyOfPropertyChange(() => this.Log);
- }
-
- /// <summary>
- /// Encode Started Event Handler
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void EncodeServiceEncodeStarted(object sender, EventArgs e)
- {
- this.SelectedMode = 0;
- }
-
- /// <summary>
- /// Scan Started Event Handler
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void ScanServiceScanStared(object sender, EventArgs e)
- {
- this.SelectedMode = 1;
- }
-
- /// <summary>
/// Scan Completed Event Handler.
/// </summary>
/// <param name="sender">
@@ -225,7 +170,7 @@ namespace HandBrakeWPF.ViewModels /// </param>
private void ScanServiceScanCompleted(object sender, ScanCompletedEventArgs e)
{
- this.NotifyOfPropertyChange(() => this.Log);
+ this.NotifyOfPropertyChange(() => this.ScanLog);
}
/// <summary>
@@ -239,7 +184,7 @@ namespace HandBrakeWPF.ViewModels /// </param>
private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e)
{
- this.NotifyOfPropertyChange(() => this.Log);
+ this.NotifyOfPropertyChange(() => this.EncodeLog);
}
}
}
\ No newline at end of file |