mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #509 from wabbajack-tools/remove-autoupdater-net
Remove AutoUpdater.NET
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
using AutoUpdaterDotNET;
|
using DynamicData;
|
||||||
using DynamicData;
|
|
||||||
using DynamicData.Binding;
|
using DynamicData.Binding;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using ReactiveUI.Fody.Helpers;
|
using ReactiveUI.Fody.Helpers;
|
||||||
@ -142,21 +141,6 @@ namespace Wabbajack
|
|||||||
execute: () => NavigateTo(SettingsPane.Value));
|
execute: () => NavigateTo(SettingsPane.Value));
|
||||||
|
|
||||||
OpenTerminalCommand = ReactiveCommand.Create(() => OpenTerminal());
|
OpenTerminalCommand = ReactiveCommand.Create(() => OpenTerminal());
|
||||||
|
|
||||||
// Latch onto update events and update GUI
|
|
||||||
AutoUpdater.CheckForUpdateEvent += (args) =>
|
|
||||||
{
|
|
||||||
UpdateAvailable = args?.IsUpdateAvailable ?? false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Trigger a query for updates soon after starting
|
|
||||||
Observable.Return(Unit.Default)
|
|
||||||
.Delay(TimeSpan.FromSeconds(3))
|
|
||||||
.ObserveOnGuiThread()
|
|
||||||
.Subscribe(_ =>
|
|
||||||
{
|
|
||||||
AutoUpdater.Start(@"https://www.wabbajack.org/current-version.xml");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OpenTerminal()
|
private void OpenTerminal()
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using AutoUpdaterDotNET;
|
using ReactiveUI;
|
||||||
using ReactiveUI;
|
|
||||||
using ReactiveUI.Fody.Helpers;
|
using ReactiveUI.Fody.Helpers;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -38,24 +37,6 @@ namespace Wabbajack
|
|||||||
|
|
||||||
CompileCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Compiler.Value));
|
CompileCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Compiler.Value));
|
||||||
BrowseCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Gallery.Value));
|
BrowseCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Gallery.Value));
|
||||||
|
|
||||||
UpdateCommand = ReactiveCommand.Create(
|
|
||||||
canExecute: mainVM.WhenAny(x => x.UpdateAvailable)
|
|
||||||
.ObserveOnGuiThread(),
|
|
||||||
execute: () =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (AutoUpdater.DownloadUpdate())
|
|
||||||
{
|
|
||||||
mainVM.ShutdownApplication();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception exception)
|
|
||||||
{
|
|
||||||
Utils.Error(exception, "Could not download update.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,25 +34,6 @@
|
|||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Rectangle.Fill>
|
</Rectangle.Fill>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
<Button
|
|
||||||
x:Name="UpdateAvailableButton"
|
|
||||||
Margin="6"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Style="{StaticResource TransparentBackgroundButtonStyle}">
|
|
||||||
<StackPanel Margin="5" Orientation="Horizontal">
|
|
||||||
<icon:PackIconMaterial
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Foreground="{StaticResource ComplementaryBrush}"
|
|
||||||
Kind="Download" />
|
|
||||||
<TextBlock
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
FontSize="14"
|
|
||||||
Foreground="{StaticResource ComplementaryBrush}"
|
|
||||||
Text="Update Available" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
<Grid Grid.Row="1" Margin="5,15">
|
<Grid Grid.Row="1" Margin="5,15">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
|
@ -37,15 +37,6 @@ namespace Wabbajack
|
|||||||
this.WhenAny(x => x.ViewModel.CompileCommand)
|
this.WhenAny(x => x.ViewModel.CompileCommand)
|
||||||
.BindToStrict(this, x => x.CompileButton.Command)
|
.BindToStrict(this, x => x.CompileButton.Command)
|
||||||
.DisposeWith(dispose);
|
.DisposeWith(dispose);
|
||||||
|
|
||||||
this.WhenAny(x => x.ViewModel.UpdateCommand)
|
|
||||||
.BindToStrict(this, x => x.UpdateAvailableButton.Command)
|
|
||||||
.DisposeWith(dispose);
|
|
||||||
this.WhenAny(x => x.ViewModel.UpdateCommand.CanExecute)
|
|
||||||
.Switch()
|
|
||||||
.Select(x => x ? Visibility.Visible : Visibility.Collapsed)
|
|
||||||
.BindToStrict(this, x => x.UpdateAvailableButton.Visibility)
|
|
||||||
.DisposeWith(dispose);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Autoupdater.NET.Official" Version="1.5.8" />
|
|
||||||
<PackageReference Include="CefSharp.Wpf" Version="79.1.350" />
|
<PackageReference Include="CefSharp.Wpf" Version="79.1.350" />
|
||||||
<PackageReference Include="DynamicData" Version="6.14.8" />
|
<PackageReference Include="DynamicData" Version="6.14.8" />
|
||||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="3.8.1" />
|
<PackageReference Include="Extended.Wpf.Toolkit" Version="3.8.1" />
|
||||||
|
Reference in New Issue
Block a user