mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Compiler wired to show CPU status again
This commit is contained in:
@ -1,4 +1,6 @@
|
|||||||
using Microsoft.WindowsAPICodePack.Dialogs;
|
using DynamicData;
|
||||||
|
using DynamicData.Binding;
|
||||||
|
using Microsoft.WindowsAPICodePack.Dialogs;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using ReactiveUI.Fody.Helpers;
|
using ReactiveUI.Fody.Helpers;
|
||||||
using System;
|
using System;
|
||||||
@ -101,6 +103,19 @@ namespace Wabbajack
|
|||||||
.Select(compilation => compilation != null)
|
.Select(compilation => compilation != null)
|
||||||
.ObserveOnGuiThread()
|
.ObserveOnGuiThread()
|
||||||
.ToProperty(this, nameof(this.Compiling));
|
.ToProperty(this, nameof(this.Compiling));
|
||||||
|
|
||||||
|
// Compile progress updates and populate ObservableCollection
|
||||||
|
var subscription = this.WhenAny(x => x.Compiler.ActiveCompilation)
|
||||||
|
.SelectMany(c => c?.QueueStatus ?? Observable.Empty<CPUStatus>())
|
||||||
|
.ObserveOn(RxApp.TaskpoolScheduler)
|
||||||
|
.ToObservableChangeSet(x => x.ID)
|
||||||
|
.Batch(TimeSpan.FromMilliseconds(250), RxApp.TaskpoolScheduler)
|
||||||
|
.EnsureUniqueChanges()
|
||||||
|
.ObserveOn(RxApp.MainThreadScheduler)
|
||||||
|
.Sort(SortExpressionComparer<CPUStatus>.Ascending(s => s.ID), SortOptimisations.ComparesImmutableValuesOnly)
|
||||||
|
.Bind(this.MWVM.StatusList)
|
||||||
|
.Subscribe()
|
||||||
|
.DisposeWith(this.CompositeDisposable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user