summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrake.ApplicationServices/ServiceManager.cs13
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/PresetService.cs5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs40
-rw-r--r--win/CS/HandBrakeWPF/Views/LogView.xaml2
5 files changed, 36 insertions, 26 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/ServiceManager.cs b/win/CS/HandBrake.ApplicationServices/ServiceManager.cs
index e0ad65ae5..fba0e99b9 100644
--- a/win/CS/HandBrake.ApplicationServices/ServiceManager.cs
+++ b/win/CS/HandBrake.ApplicationServices/ServiceManager.cs
@@ -1,5 +1,9 @@
namespace HandBrake.ApplicationServices
{
+ using System;
+
+ using Caliburn.Micro;
+
using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.Interop;
@@ -26,6 +30,15 @@
{
get
{
+ try
+ {
+ return IoC.Get<IUserSettingService>();
+ }
+ catch (NullReferenceException)
+ {
+ // Hack until this legacy code for the forms gui is removed!
+ }
+
return userSettingService ?? (userSettingService = new UserSettingService());
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
index bd93dc043..ea2794fe7 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
@@ -3,9 +3,6 @@
Homepage: <http://handbrake.fr>.
It may be used under the terms of the GNU General Public License. */
-using HandBrake.ApplicationServices.Model.Encoding;
-using HandBrake.ApplicationServices.Utilities;
-
namespace HandBrake.ApplicationServices.Services
{
using System;
@@ -21,6 +18,8 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Utilities;
/// <summary>
/// The preset service manages HandBrake's presets
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index bbcb9c4f7..5572f8cb2 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -872,7 +872,7 @@ namespace HandBrake.ApplicationServices.Utilities
// Verbosity Level
int verbosity = UserSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity);
- query += string.Format(" --verbose= {0}", verbosity);
+ query += string.Format(" --verbose={0}", verbosity);
// LibDVDNav
if (UserSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav))
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
diff --git a/win/CS/HandBrakeWPF/Views/LogView.xaml b/win/CS/HandBrakeWPF/Views/LogView.xaml
index 24e05acdd..f1aea707d 100644
--- a/win/CS/HandBrakeWPF/Views/LogView.xaml
+++ b/win/CS/HandBrakeWPF/Views/LogView.xaml
@@ -28,7 +28,7 @@
</ComboBox>
</ToolBar>
- <TextBox AcceptsReturn="True" TextWrapping="Wrap" ScrollViewer.VerticalScrollBarVisibility="Visible" IsReadOnly="True" Grid.Row="1" Text="{Binding Log}" />
+ <TextBox AcceptsReturn="True" TextWrapping="Wrap" ScrollViewer.VerticalScrollBarVisibility="Visible" IsReadOnly="True" Grid.Row="1" Text="{Binding Log, Mode=OneWay}" />
</Grid>
</Grid>