mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Moved open terminal button to inside misc settings
Was too dangerous to have next to minimize
This commit is contained in:
parent
785e2fba5a
commit
da4865dc7e
@ -1,4 +1,4 @@
|
||||
using DynamicData;
|
||||
using DynamicData;
|
||||
using DynamicData.Binding;
|
||||
using ReactiveUI;
|
||||
using ReactiveUI.Fody.Helpers;
|
||||
@ -46,7 +46,6 @@ namespace Wabbajack
|
||||
public ICommand CopyVersionCommand { get; }
|
||||
public ICommand ShowLoginManagerVM { get; }
|
||||
public ICommand OpenSettingsCommand { get; }
|
||||
public ICommand OpenTerminalCommand { get; }
|
||||
|
||||
public string VersionDisplay { get; }
|
||||
|
||||
@ -142,21 +141,6 @@ namespace Wabbajack
|
||||
canExecute: this.WhenAny(x => x.ActivePane)
|
||||
.Select(active => !SettingsPane.IsValueCreated || !object.ReferenceEquals(active, SettingsPane.Value)),
|
||||
execute: () => NavigateTo(SettingsPane.Value));
|
||||
|
||||
OpenTerminalCommand = ReactiveCommand.CreateFromTask(() => OpenTerminal());
|
||||
|
||||
|
||||
}
|
||||
|
||||
private async Task OpenTerminal()
|
||||
{
|
||||
var process = new ProcessStartInfo
|
||||
{
|
||||
FileName = "cmd.exe",
|
||||
WorkingDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)
|
||||
};
|
||||
Process.Start(process);
|
||||
await ShutdownApplication();
|
||||
}
|
||||
|
||||
private static bool IsStartingFromModlist(out AbsolutePath modlistPath)
|
||||
@ -171,7 +155,6 @@ namespace Wabbajack
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void OpenInstaller(AbsolutePath path)
|
||||
{
|
||||
if (path == default) return;
|
||||
|
@ -1,8 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using ReactiveUI;
|
||||
using Wabbajack.Lib;
|
||||
|
||||
@ -16,6 +20,8 @@ namespace Wabbajack
|
||||
public FiltersSettings Filters { get; }
|
||||
public AuthorFilesVM AuthorFile { get; }
|
||||
|
||||
public ICommand OpenTerminalCommand { get; }
|
||||
|
||||
public SettingsVM(MainWindowVM mainWindowVM)
|
||||
: base(mainWindowVM)
|
||||
{
|
||||
@ -24,7 +30,18 @@ namespace Wabbajack
|
||||
Performance = mainWindowVM.Settings.Performance;
|
||||
AuthorFile = new AuthorFilesVM(this);
|
||||
Filters = mainWindowVM.Settings.Filters;
|
||||
OpenTerminalCommand = ReactiveCommand.CreateFromTask(() => OpenTerminal());
|
||||
}
|
||||
|
||||
private async Task OpenTerminal()
|
||||
{
|
||||
var process = new ProcessStartInfo
|
||||
{
|
||||
FileName = "cmd.exe",
|
||||
WorkingDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)
|
||||
};
|
||||
Process.Start(process);
|
||||
await MWVM.ShutdownApplication();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,14 +69,6 @@
|
||||
Height="17"
|
||||
Kind="Cog" />
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Margin="5,0"
|
||||
Command="{Binding OpenTerminalCommand}">
|
||||
<icon:PackIconMaterial
|
||||
Width="17"
|
||||
Height="17"
|
||||
Kind="Console" />
|
||||
</Button>
|
||||
</mahapps:WindowCommands>
|
||||
</mahapps:MetroWindow.RightWindowCommands>
|
||||
</mahapps:MetroWindow>
|
||||
|
@ -9,7 +9,7 @@
|
||||
xmlns:xwpf="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:TypeArguments="local:FiltersSettings"
|
||||
x:TypeArguments="local:SettingsVM"
|
||||
mc:Ignorable="d">
|
||||
<Border
|
||||
x:Name="PerformanceView"
|
||||
@ -42,6 +42,7 @@
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.Resources>
|
||||
<Style BasedOn="{StaticResource MainButtonStyle}" TargetType="Button">
|
||||
@ -78,6 +79,10 @@
|
||||
Name="ClearCefCache"
|
||||
Margin="0,5,0,0"
|
||||
Content="Clear In-App Browser Cache" />
|
||||
<Button Grid.Row="3"
|
||||
Name="OpenTerminal"
|
||||
Margin="0,5,0,0"
|
||||
Content="Open Terminal and Close WJ" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
@ -23,7 +23,7 @@ namespace Wabbajack
|
||||
/// <summary>
|
||||
/// Interaction logic for MiscSettingsView.xaml
|
||||
/// </summary>
|
||||
public partial class MiscSettingsView : ReactiveUserControl<FiltersSettings>
|
||||
public partial class MiscSettingsView : ReactiveUserControl<SettingsVM>
|
||||
{
|
||||
public MiscSettingsView()
|
||||
{
|
||||
@ -32,9 +32,12 @@ namespace Wabbajack
|
||||
this.WhenActivated(disposable =>
|
||||
{
|
||||
// Bind Values
|
||||
this.Bind(this.ViewModel, x => x.IsPersistent, x => x.FilterPersistCheckBox.IsChecked)
|
||||
this.BindStrict(this.ViewModel, x => x.Filters.IsPersistent, x => x.FilterPersistCheckBox.IsChecked)
|
||||
.DisposeWith(disposable);
|
||||
this.Bind(this.ViewModel, x => x.UseCompression, x => x.UseCompressionCheckBox.IsChecked)
|
||||
this.BindStrict(this.ViewModel, x => x.Filters.UseCompression, x => x.UseCompressionCheckBox.IsChecked)
|
||||
.DisposeWith(disposable);
|
||||
this.WhenAnyValue(x => x.ViewModel.OpenTerminalCommand)
|
||||
.BindToStrict(this, x => x.OpenTerminal.Command)
|
||||
.DisposeWith(disposable);
|
||||
|
||||
this.ClearCefCache.Click += (sender, args) => {Driver.ClearCache();};
|
||||
|
@ -34,8 +34,7 @@ namespace Wabbajack
|
||||
.DisposeWith(disposable);
|
||||
this.OneWayBindStrict(this.ViewModel, x => x.Performance, x => x.PerformanceView.ViewModel)
|
||||
.DisposeWith(disposable);
|
||||
this.OneWayBindStrict(this.ViewModel, x => x.Filters, x => x.MiscGalleryView.ViewModel)
|
||||
.DisposeWith(disposable);
|
||||
this.MiscGalleryView.ViewModel = this.ViewModel;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user