summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-04-01 17:32:36 +0000
committersr55 <[email protected]>2012-04-01 17:32:36 +0000
commitd022a7b868b924b9edc32fe84555c4b21ceda89a (patch)
tree9fcdd33bb62794f56bdc9726943894c06b6470bb /win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
parent649939589305d92e9d6edf3c28955dfa37774722 (diff)
WinGui: (WPF) User Setting Service fixes, Query Generation fixes, Logviewer live updates.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4580 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs40
1 files changed, 19 insertions, 21 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
index 8733445fd..7785552cd 100644
--- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
@@ -76,19 +76,11 @@ namespace HandBrakeWPF.ViewModels
this.SelectedMode = 0;
}
- /// <summary>
- /// Gets or sets Log.
- /// </summary>
public string Log
{
get
{
- return log;
- }
- set
- {
- log = value;
- this.NotifyOfPropertyChange("Log");
+ return this.SelectedMode == 0 ? this.encodeService.ActivityLog : this.scanService.ActivityLog;
}
}
@@ -115,7 +107,7 @@ namespace HandBrakeWPF.ViewModels
set
{
selectedMode = value;
- this.NotifyOfPropertyChange("SelectedMode");
+ this.NotifyOfPropertyChange(() => this.SelectedMode);
this.ChangeLogDisplay();
}
}
@@ -148,9 +140,21 @@ namespace HandBrakeWPF.ViewModels
this.scanService.ScanCompleted += scanService_ScanCompleted;
this.encodeService.EncodeStarted += encodeService_EncodeStarted;
this.encodeService.EncodeCompleted += encodeService_EncodeCompleted;
+ this.encodeService.EncodeStatusChanged += this.encodeService_EncodeStatusChanged;
+ this.scanService.ScanStatusChanged += this.scanService_ScanStatusChanged;
base.OnActivate();
}
+ private void scanService_ScanStatusChanged(object sender, ScanProgressEventArgs e)
+ {
+ this.NotifyOfPropertyChange(() => this.Log);
+ }
+
+ private void encodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)
+ {
+ this.NotifyOfPropertyChange(() => this.Log);
+ }
+
/// <summary>
/// Handle the OnDeactivate Caliburn Event
/// </summary>
@@ -170,7 +174,7 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void ChangeLogDisplay()
{
- this.Log = this.SelectedMode == 0 ? this.encodeService.ActivityLog : this.scanService.ActivityLog;
+ this.NotifyOfPropertyChange(() => this.Log);
}
/// <summary>
@@ -185,7 +189,7 @@ namespace HandBrakeWPF.ViewModels
private void encodeService_EncodeStarted(object sender, EventArgs e)
{
this.SelectedMode = 0;
- this.Log = this.encodeService.ActivityLog;
+ this.NotifyOfPropertyChange(() => this.Log);
}
/// <summary>
@@ -200,7 +204,7 @@ namespace HandBrakeWPF.ViewModels
private void scanService_ScanStared(object sender, EventArgs e)
{
this.SelectedMode = 1;
- this.Log = this.scanService.ActivityLog;
+ this.NotifyOfPropertyChange(() => this.Log);
}
/// <summary>
@@ -214,10 +218,7 @@ namespace HandBrakeWPF.ViewModels
/// </param>
private void scanService_ScanCompleted(object sender, ScanCompletedEventArgs e)
{
- if (this.SelectedMode == 1)
- {
- this.Log = this.scanService.ActivityLog;
- }
+ this.NotifyOfPropertyChange(() => this.Log);
}
/// <summary>
@@ -231,10 +232,7 @@ namespace HandBrakeWPF.ViewModels
/// </param>
private void encodeService_EncodeCompleted(object sender, EncodeCompletedEventArgs e)
{
- if (this.SelectedMode == 0)
- {
- this.Log = this.encodeService.ActivityLog;
- }
+ this.NotifyOfPropertyChange(() => this.Log);
}
}
} \ No newline at end of file