summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-10-13 19:48:12 +0000
committersr55 <[email protected]>2012-10-13 19:48:12 +0000
commit029c9b1db2fbf86fc8ded15580cd8023e4b180fc (patch)
tree227743486b489e989f0b1c67234ebefa4316b10c /win/CS/HandBrakeWPF/ViewModels
parent2a18d05b52ea084b4bb968f3622872a8a08d83fa (diff)
WinGui: Refactor multi-instance support to use Process ID. Fix old log file cleanup function.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5016 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 70f62c435..4b90e8feb 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -15,6 +15,7 @@ namespace HandBrakeWPF.ViewModels
using System.Globalization;
using System.IO;
using System.Linq;
+ using System.Threading;
using System.Windows;
using System.Windows.Media.Imaging;
@@ -196,8 +197,6 @@ namespace HandBrakeWPF.ViewModels
public MainViewModel(IUserSettingService userSettingService, IScanServiceWrapper scanService, IEncodeServiceWrapper encodeService, IPresetService presetService,
IErrorService errorService, IShellViewModel shellViewModel, IUpdateService updateService, IDriveDetectService driveDetectService, INotificationService notificationService)
{
- GeneralUtilities.SetInstanceId();
-
this.scanService = scanService;
this.encodeService = encodeService;
this.presetService = presetService;
@@ -207,7 +206,6 @@ namespace HandBrakeWPF.ViewModels
this.driveDetectService = driveDetectService;
this.userSettingService = userSettingService;
this.queueProcessor = IoC.Get<IQueueProcessor>();
- this.queueProcessor.ResetInstanceId();
// Setup Properties
this.WindowTitle = "HandBrake";
@@ -825,6 +823,13 @@ namespace HandBrakeWPF.ViewModels
this.SourceMenu = this.GenerateSourceMenu();
this.driveDetectService.StartDetection(this.DriveTrayChanged);
+
+ // Log Cleaning
+ if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))
+ {
+ Thread clearLog = new Thread(() => GeneralUtilities.ClearLogFiles(30));
+ clearLog.Start();
+ }
}
/// <summary>