Compare commits

..

No commits in common. "e562d4a0ad4877febd3578d71f4b36876f87aa75" and "ecc4728e5e72f5c7e26540c9632f76ce538ceeea" have entirely different histories.

2 changed files with 36 additions and 27 deletions

View file

@ -5,19 +5,29 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PS2_Manager.Setup"
WindowStartupLocation="CenterScreen"
Title="Setup PS2 Manager"
SystemDecorations="None"
Title="Setup"
Height="349"
Width="598"
CanResize="False"
Background="#201c29"
Closing="Window_OnClosing">
<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 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>
</Window>

View file

@ -43,30 +43,29 @@ public partial class Setup : Window
{
Console.Info("Open Library Button Clicked");
settings.library_path.SetValue("");
var topLevel = TopLevel.GetTopLevel(this);
var path = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
while (String.IsNullOrEmpty(settings.library_path.GetValue<string>()))
{
Title = "Open Game Library",
AllowMultiple = false
});
try
{
if (!String.IsNullOrEmpty(path[0].Path.LocalPath))
var topLevel = TopLevel.GetTopLevel(this);
var path = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{
settings.library_path.SetValue(path[0].Path.LocalPath);
FinishSetup();
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);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
FinishSetup();
}
private void Window_OnClosing(object? sender, WindowClosingEventArgs e)
{
if(!this.SetupFinished) Environment.Exit(0);
if(!this.SetupFinished) e.Cancel = true;
}
}