Compare commits
2 commits
ecc4728e5e
...
e562d4a0ad
Author | SHA1 | Date | |
---|---|---|---|
e562d4a0ad | |||
d32c17dc1c |
2 changed files with 27 additions and 36 deletions
|
@ -5,29 +5,19 @@
|
|||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="PS2_Manager.Setup"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
SystemDecorations="None"
|
||||
Title="Setup"
|
||||
Title="Setup PS2 Manager"
|
||||
Height="349"
|
||||
Width="598"
|
||||
CanResize="False"
|
||||
Background="#201c29"
|
||||
Closing="Window_OnClosing">
|
||||
<Grid RowDefinitions="20, *">
|
||||
<Grid Grid.Row="0">
|
||||
<Border Background="#35313d"
|
||||
PointerPressed="WindowDrag">
|
||||
<Grid ColumnDefinitions="*, 20">
|
||||
<TextBlock Name="WindowTitle" FontSize="12" Text="Setup PS2 Manager" Padding="8,0,0,0" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" Margin="20">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Name="InfoText1" Text="Welcome to PS2 Manager" HorizontalAlignment="Center"/>
|
||||
<Separator/>
|
||||
<TextBlock Name="InfoText2" Text="First of all please select the path to your PS2 Game Library" HorizontalAlignment="Center"/>
|
||||
<Button Name="OpenLibraryButton" Content="Select Folder" HorizontalAlignment="Center" Margin="0,10"
|
||||
Click="OpenLibraryButton_OnClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid Margin="20">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Name="InfoText1" Text="Welcome to PS2 Manager" HorizontalAlignment="Center"/>
|
||||
<Separator/>
|
||||
<TextBlock Name="InfoText2" Text="First of all please select the path to your PS2 Game Library" HorizontalAlignment="Center"/>
|
||||
<Button Name="OpenLibraryButton" Content="Select Folder" HorizontalAlignment="Center" Margin="0,10"
|
||||
Click="OpenLibraryButton_OnClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
@ -43,29 +43,30 @@ public partial class Setup : Window
|
|||
{
|
||||
Console.Info("Open Library Button Clicked");
|
||||
settings.library_path.SetValue("");
|
||||
while (String.IsNullOrEmpty(settings.library_path.GetValue<string>()))
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
var path = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||
{
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
var path = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||
Title = "Open Game Library",
|
||||
AllowMultiple = false
|
||||
});
|
||||
try
|
||||
{
|
||||
if (!String.IsNullOrEmpty(path[0].Path.LocalPath))
|
||||
{
|
||||
Title = "Open Game Library",
|
||||
AllowMultiple = false
|
||||
});
|
||||
try
|
||||
{
|
||||
if (!String.IsNullOrEmpty(path[0].Path.LocalPath))
|
||||
settings.library_path.SetValue(path[0].Path.LocalPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
settings.library_path.SetValue(path[0].Path.LocalPath);
|
||||
FinishSetup();
|
||||
}
|
||||
|
||||
}
|
||||
FinishSetup();
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Window_OnClosing(object? sender, WindowClosingEventArgs e)
|
||||
{
|
||||
if(!this.SetupFinished) e.Cancel = true;
|
||||
if(!this.SetupFinished) Environment.Exit(0);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue