Skip to content

Commit 017345e

Browse files
Fixes for the select buttons and path
1 parent dac8a56 commit 017345e

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

MSURandomizer/MSURandomizer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
9-
<Version>2.0.0-rc.4</Version>
9+
<Version>2.0.0-rc.7</Version>
1010
<ApplicationIcon>MSURandomizerIcon.ico</ApplicationIcon>
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1212
<PackageId>MattEqualsCoder.MSURandomizer.Avalonia</PackageId>

MSURandomizer/Services/MsuWindowService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,16 @@ public bool GenerateMsu(out string error, out bool openContinuousWindow, out Msu
288288

289289
public bool ShouldOpenMonitorWindow => userOptions.MsuUserOptions.OpenMonitorWindow;
290290

291+
public void SetMsuBasePath(string? msuBasePath)
292+
{
293+
if (string.IsNullOrEmpty(msuBasePath) || !Directory.Exists(msuBasePath))
294+
{
295+
return;
296+
}
297+
298+
userOptions.MsuUserOptions.DefaultMsuPath = msuBasePath;
299+
}
300+
291301
public MsuType? GetMsuType(string msuTypeName)
292302
{
293303
return msuTypeService.GetMsuType(msuTypeName);

MSURandomizer/ViewModels/MsuWindowViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public class MsuWindowViewModel : ViewModelBase
6666
[Reactive]
6767
[ReactiveLinkedProperties(nameof(HasGitHubUrl))]
6868
public string? GitHubUrl { get; set; }
69+
70+
[Reactive]
71+
public bool IsSingleSelectionMode { get; set; }
6972

7073
public bool IsSelectMsuEnabled => MsuCount > 0 && !AreMsusLoading && !IsMsuMonitorActive;
7174

MSURandomizer/Views/MsuWindow.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
>
4040
</controls:EnumComboBox>
4141
</StackPanel>
42-
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="5" MinWidth="100">
42+
<StackPanel Orientation="Vertical" Grid.Column="2" Margin="5" MinWidth="100" IsVisible="{Binding !IsSingleSelectionMode}">
4343
<TextBlock></TextBlock>
4444
<Button Name="SelectAllButton"
4545
Click="SelectAllButton_OnClick"
@@ -48,7 +48,7 @@
4848
Select All
4949
</Button>
5050
</StackPanel>
51-
<StackPanel Orientation="Vertical" Grid.Column="3" Margin="5" MinWidth="100">
51+
<StackPanel Orientation="Vertical" Grid.Column="3" Margin="5" MinWidth="100" IsVisible="{Binding !IsSingleSelectionMode}">
5252
<TextBlock></TextBlock>
5353
<Button Name="SelectNoneButton"
5454
Click="SelectNoneButton_OnClick"

MSURandomizer/Views/MsuWindow.axaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ public MsuWindow()
6464

6565
public bool DialogResult;
6666

67-
public void ShowDialog(Window window, bool isSingleSelect)
67+
public void ShowDialog(Window window, bool isSingleSelect, string? msuBasePath = null)
6868
{
69+
_model.IsSingleSelectionMode = isSingleSelect;
70+
_service?.SetMsuBasePath(msuBasePath);
6971
MsuList.SetIsSingleSelectionMode(isSingleSelect);
7072
ShowDialog(window);
7173
}

0 commit comments

Comments
 (0)