Do not launch settings dialog after installation
This commit is contained in:
parent
a71ccbac6e
commit
cdf1a01457
@ -39,18 +39,15 @@ namespace LibationAvalonia
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Task<List<DataLayer.LibraryBook>> LibraryTask;
|
public static Task<List<DataLayer.LibraryBook>> LibraryTask;
|
||||||
public static bool SetupRequired;
|
|
||||||
|
|
||||||
public override void OnFrameworkInitializationCompleted()
|
public override void OnFrameworkInitializationCompleted()
|
||||||
{
|
{
|
||||||
LoadStyles();
|
|
||||||
|
|
||||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||||
{
|
{
|
||||||
if (SetupRequired)
|
var config = Configuration.Instance;
|
||||||
{
|
|
||||||
var config = Configuration.Instance;
|
|
||||||
|
|
||||||
|
if (!config.LibationSettingsAreValid)
|
||||||
|
{
|
||||||
var defaultLibationFilesDir = Configuration.UserProfile;
|
var defaultLibationFilesDir = Configuration.UserProfile;
|
||||||
|
|
||||||
// check for existing settings in default location
|
// check for existing settings in default location
|
||||||
@ -90,7 +87,25 @@ namespace LibationAvalonia
|
|||||||
if (setupDialog.IsNewUser)
|
if (setupDialog.IsNewUser)
|
||||||
{
|
{
|
||||||
Configuration.SetLibationFiles(Configuration.UserProfile);
|
Configuration.SetLibationFiles(Configuration.UserProfile);
|
||||||
ShowSettingsWindow(desktop, setupDialog.Config, OnSettingsCompleted);
|
setupDialog.Config.Books = Path.Combine(Configuration.UserProfile, nameof(Configuration.Books));
|
||||||
|
|
||||||
|
if (setupDialog.Config.LibationSettingsAreValid)
|
||||||
|
{
|
||||||
|
var theme
|
||||||
|
= setupDialog.SelectedTheme.Content is nameof(ThemeVariant.Dark)
|
||||||
|
? nameof(ThemeVariant.Dark)
|
||||||
|
: nameof(ThemeVariant.Light);
|
||||||
|
|
||||||
|
setupDialog.Config.SetString(theme, nameof(ThemeVariant));
|
||||||
|
|
||||||
|
|
||||||
|
await RunMigrationsAsync(setupDialog.Config);
|
||||||
|
LibraryTask = Task.Run(() => DbContexts.GetLibrary_Flat_NoTracking(includeParents: true));
|
||||||
|
AudibleUtilities.AudibleApiStorage.EnsureAccountsSettingsFileExists();
|
||||||
|
ShowMainWindow(desktop);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
await CancelInstallation();
|
||||||
}
|
}
|
||||||
else if (setupDialog.IsReturningUser)
|
else if (setupDialog.IsReturningUser)
|
||||||
{
|
{
|
||||||
@ -130,40 +145,6 @@ namespace LibationAvalonia
|
|||||||
AppScaffolding.LibationScaffolding.RunPostMigrationScaffolding(config);
|
AppScaffolding.LibationScaffolding.RunPostMigrationScaffolding(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowSettingsWindow(IClassicDesktopStyleApplicationLifetime desktop, Configuration config, Action<IClassicDesktopStyleApplicationLifetime, SettingsDialog, Configuration> OnClose)
|
|
||||||
{
|
|
||||||
config.Books ??= Path.Combine(Configuration.UserProfile, "Books");
|
|
||||||
|
|
||||||
var settingsDialog = new SettingsDialog();
|
|
||||||
desktop.MainWindow = settingsDialog;
|
|
||||||
settingsDialog.RestoreSizeAndLocation(Configuration.Instance);
|
|
||||||
settingsDialog.Show();
|
|
||||||
|
|
||||||
void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
||||||
{
|
|
||||||
settingsDialog.Closing -= WindowClosing;
|
|
||||||
e.Cancel = true;
|
|
||||||
OnClose?.Invoke(desktop, settingsDialog, config);
|
|
||||||
}
|
|
||||||
settingsDialog.Closing += WindowClosing;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void OnSettingsCompleted(IClassicDesktopStyleApplicationLifetime desktop, SettingsDialog settingsDialog, Configuration config)
|
|
||||||
{
|
|
||||||
if (config.LibationSettingsAreValid)
|
|
||||||
{
|
|
||||||
await RunMigrationsAsync(config);
|
|
||||||
LibraryTask = Task.Run(() => DbContexts.GetLibrary_Flat_NoTracking(includeParents: true));
|
|
||||||
AudibleUtilities.AudibleApiStorage.EnsureAccountsSettingsFileExists();
|
|
||||||
ShowMainWindow(desktop);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
await CancelInstallation();
|
|
||||||
|
|
||||||
settingsDialog.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void ShowLibationFilesDialog(IClassicDesktopStyleApplicationLifetime desktop, Configuration config, Action<IClassicDesktopStyleApplicationLifetime, LibationFilesDialog, Configuration> OnClose)
|
private void ShowLibationFilesDialog(IClassicDesktopStyleApplicationLifetime desktop, Configuration config, Action<IClassicDesktopStyleApplicationLifetime, LibationFilesDialog, Configuration> OnClose)
|
||||||
{
|
{
|
||||||
var libationFilesDialog = new LibationFilesDialog();
|
var libationFilesDialog = new LibationFilesDialog();
|
||||||
@ -200,11 +181,23 @@ namespace LibationAvalonia
|
|||||||
MessageBoxIcon.Question);
|
MessageBoxIcon.Question);
|
||||||
|
|
||||||
if (continueResult == DialogResult.Yes)
|
if (continueResult == DialogResult.Yes)
|
||||||
ShowSettingsWindow(desktop, config, OnSettingsCompleted);
|
{
|
||||||
|
config.Books = Path.Combine(libationFilesDialog.SelectedDirectory, nameof(Configuration.Books));
|
||||||
|
|
||||||
|
if (config.LibationSettingsAreValid)
|
||||||
|
{
|
||||||
|
await RunMigrationsAsync(config);
|
||||||
|
LibraryTask = Task.Run(() => DbContexts.GetLibrary_Flat_NoTracking(includeParents: true));
|
||||||
|
AudibleUtilities.AudibleApiStorage.EnsureAccountsSettingsFileExists();
|
||||||
|
ShowMainWindow(desktop);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
await CancelInstallation();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
await CancelInstallation();
|
await CancelInstallation();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
libationFilesDialog.Close();
|
libationFilesDialog.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,11 +223,11 @@ namespace LibationAvalonia
|
|||||||
|
|
||||||
private static void LoadStyles()
|
private static void LoadStyles()
|
||||||
{
|
{
|
||||||
ProcessQueueBookFailedBrush = AvaloniaUtils.GetBrushFromResources("ProcessQueueBookFailedBrush");
|
ProcessQueueBookFailedBrush = AvaloniaUtils.GetBrushFromResources(nameof(ProcessQueueBookFailedBrush));
|
||||||
ProcessQueueBookCompletedBrush = AvaloniaUtils.GetBrushFromResources("ProcessQueueBookCompletedBrush");
|
ProcessQueueBookCompletedBrush = AvaloniaUtils.GetBrushFromResources(nameof(ProcessQueueBookCompletedBrush));
|
||||||
ProcessQueueBookCancelledBrush = AvaloniaUtils.GetBrushFromResources("ProcessQueueBookCancelledBrush");
|
ProcessQueueBookCancelledBrush = AvaloniaUtils.GetBrushFromResources(nameof(ProcessQueueBookCancelledBrush));
|
||||||
SeriesEntryGridBackgroundBrush = AvaloniaUtils.GetBrushFromResources("SeriesEntryGridBackgroundBrush");
|
SeriesEntryGridBackgroundBrush = AvaloniaUtils.GetBrushFromResources(nameof(SeriesEntryGridBackgroundBrush));
|
||||||
ProcessQueueBookDefaultBrush = AvaloniaUtils.GetBrushFromResources("ProcessQueueBookDefaultBrush");
|
ProcessQueueBookDefaultBrush = AvaloniaUtils.GetBrushFromResources(nameof(ProcessQueueBookDefaultBrush));
|
||||||
HyperlinkVisited = AvaloniaUtils.GetBrushFromResources(nameof(HyperlinkVisited));
|
HyperlinkVisited = AvaloniaUtils.GetBrushFromResources(nameof(HyperlinkVisited));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
|
||||||
MinWidth="500" MinHeight="450"
|
MinWidth="500" MinHeight="450"
|
||||||
|
Width="500" Height="450"
|
||||||
x:Class="LibationAvalonia.Dialogs.EditReplacementChars"
|
x:Class="LibationAvalonia.Dialogs.EditReplacementChars"
|
||||||
Title="Illegal Character Replacement"
|
Title="Illegal Character Replacement"
|
||||||
Icon="/Assets/libation.ico">
|
Icon="/Assets/libation.ico">
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
Width="800" Height="450"
|
||||||
x:Class="LibationAvalonia.Dialogs.EditTemplateDialog"
|
x:Class="LibationAvalonia.Dialogs.EditTemplateDialog"
|
||||||
xmlns:dialogs="clr-namespace:LibationAvalonia.Dialogs"
|
xmlns:dialogs="clr-namespace:LibationAvalonia.Dialogs"
|
||||||
Icon="/Assets/libation.ico"
|
Icon="/Assets/libation.ico"
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="500"
|
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="500"
|
||||||
x:Class="LibationAvalonia.Dialogs.ImageDisplayDialog"
|
x:Class="LibationAvalonia.Dialogs.ImageDisplayDialog"
|
||||||
MinWidth="500" MinHeight="500"
|
MinWidth="500" MinHeight="500"
|
||||||
|
Width="500" Height="520"
|
||||||
Title="Cover"
|
Title="Cover"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/Assets/libation.ico">
|
Icon="/Assets/libation.ico">
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
Title="Liberated status: Whether the book has been downloaded"
|
Title="Liberated status: Whether the book has been downloaded"
|
||||||
MinHeight="100" MaxHeight="165"
|
MinHeight="100" MaxHeight="165"
|
||||||
MinWidth="600" MaxWidth="800"
|
MinWidth="600" MaxWidth="800"
|
||||||
|
Width="600"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/Assets/libation.ico">
|
Icon="/Assets/libation.ico">
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
Title="Liberated status: Whether the book has been downloaded"
|
Title="Liberated status: Whether the book has been downloaded"
|
||||||
MinWidth="400" MinHeight="120"
|
MinWidth="400" MinHeight="120"
|
||||||
MaxWidth="400" MaxHeight="120"
|
MaxWidth="400" MaxHeight="120"
|
||||||
|
Width="400" Height="120"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/Assets/libation.ico">
|
Icon="/Assets/libation.ico">
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="185"
|
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="185"
|
||||||
x:Class="LibationAvalonia.Dialogs.ScanAccountsDialog"
|
x:Class="LibationAvalonia.Dialogs.ScanAccountsDialog"
|
||||||
MinWidth="500" MinHeight="160"
|
MinWidth="500" MinHeight="160"
|
||||||
MaxWidth="500" MaxHeight="185"
|
Width="500" Height="200"
|
||||||
Title="Which Accounts?"
|
Title="Which Accounts?"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/Assets/libation.ico">
|
Icon="/Assets/libation.ico">
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
mc:Ignorable="d" d:DesignWidth="950" d:DesignHeight="650"
|
mc:Ignorable="d" d:DesignWidth="950" d:DesignHeight="650"
|
||||||
MinWidth="950" MinHeight="650"
|
MinWidth="950" MinHeight="650"
|
||||||
MaxWidth="950" MaxHeight="650"
|
MaxWidth="950" MaxHeight="650"
|
||||||
|
Width="950" Height="650"
|
||||||
x:Class="LibationAvalonia.Dialogs.SearchSyntaxDialog"
|
x:Class="LibationAvalonia.Dialogs.SearchSyntaxDialog"
|
||||||
Title="Filter Options"
|
Title="Filter Options"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="750"
|
mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="750"
|
||||||
MinWidth="900" MinHeight="700"
|
MinWidth="900" MinHeight="700"
|
||||||
|
Width="900" Height="700"
|
||||||
x:Class="LibationAvalonia.Dialogs.SettingsDialog"
|
x:Class="LibationAvalonia.Dialogs.SettingsDialog"
|
||||||
xmlns:controls="clr-namespace:LibationAvalonia.Controls"
|
xmlns:controls="clr-namespace:LibationAvalonia.Controls"
|
||||||
Title="Edit Settings"
|
Title="Edit Settings"
|
||||||
|
|||||||
@ -3,14 +3,16 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="350"
|
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="350"
|
||||||
MinWidth="500" MinHeight="350"
|
|
||||||
MaxWidth="500" MaxHeight="350"
|
|
||||||
x:Class="LibationAvalonia.Dialogs.SetupDialog"
|
x:Class="LibationAvalonia.Dialogs.SetupDialog"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
|
Width="500" Height="350"
|
||||||
Icon="/Assets/libation.ico"
|
Icon="/Assets/libation.ico"
|
||||||
Title="Welcome to Libation">
|
Title="Welcome to Libation">
|
||||||
|
|
||||||
<Grid Margin="10" ColumnDefinitions="*" RowDefinitions="*,Auto,Auto">
|
<Grid
|
||||||
|
Margin="10"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
RowDefinitions="*,Auto,Auto">
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" TextWrapping="Wrap" Text="This appears to be your first time using Libation or a previous setup was incomplete.
|
<TextBlock Grid.Row="0" TextWrapping="Wrap" Text="This appears to be your first time using Libation or a previous setup was incomplete.
|
||||||


|


|
||||||
@ -22,17 +24,47 @@
|
|||||||

Download your entire library from the "Liberate" tab or
|

Download your entire library from the "Liberate" tab or
|
||||||

liberate your books one at a time by clicking the stoplight." />
|

liberate your books one at a time by clicking the stoplight." />
|
||||||
|
|
||||||
<Button
|
<Grid
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Width="480"
|
HorizontalAlignment="Stretch"
|
||||||
Margin="0,0,0,10"
|
ColumnDefinitions="*,Auto"
|
||||||
Click="NewUser_Click">
|
Margin="0,0,0,10">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
Padding="0,20"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
Click="NewUser_Click">
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
FontSize="18"
|
||||||
|
TextAlignment="Center"
|
||||||
|
Text="NEW USER"/>
|
||||||
|
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Grid.Column="1"
|
||||||
|
RowDefinitions="*,*">
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
TextAlignment="Center"
|
VerticalAlignment="Top"
|
||||||
Text="NEW USER

Choose Settings"/>
|
Text="Theme: " />
|
||||||
|
|
||||||
</Button>
|
<ComboBox
|
||||||
|
Grid.Row="1"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
SelectedIndex="0"
|
||||||
|
SelectedItem="{Binding SelectedTheme, Mode=OneWayToSource}">
|
||||||
|
<ComboBox.Items>
|
||||||
|
<ComboBoxItem Content="Light" />
|
||||||
|
<ComboBoxItem Content="Dark" />
|
||||||
|
</ComboBox.Items>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
|
|||||||
@ -7,10 +7,12 @@ namespace LibationAvalonia.Dialogs
|
|||||||
{
|
{
|
||||||
public bool IsNewUser { get; private set; }
|
public bool IsNewUser { get; private set; }
|
||||||
public bool IsReturningUser { get; private set; }
|
public bool IsReturningUser { get; private set; }
|
||||||
|
public ComboBoxItem SelectedTheme { get; set; }
|
||||||
public Configuration Config { get; init; }
|
public Configuration Config { get; init; }
|
||||||
public SetupDialog()
|
public SetupDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NewUser_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
public void NewUser_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
x:Class="LibationAvalonia.Dialogs.TagsBatchDialog"
|
x:Class="LibationAvalonia.Dialogs.TagsBatchDialog"
|
||||||
MinWidth="630" MinHeight="110"
|
MinWidth="630" MinHeight="110"
|
||||||
MaxWidth="630" MaxHeight="110"
|
MaxWidth="630" MaxHeight="110"
|
||||||
|
Width="630" Height="110"
|
||||||
Title="Replace Tags"
|
Title="Replace Tags"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/Assets/libation.ico">
|
Icon="/Assets/libation.ico">
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
x:Class="LibationAvalonia.Dialogs.TrashBinDialog"
|
x:Class="LibationAvalonia.Dialogs.TrashBinDialog"
|
||||||
xmlns:controls="clr-namespace:LibationAvalonia.Controls"
|
xmlns:controls="clr-namespace:LibationAvalonia.Controls"
|
||||||
MinWidth="630" MinHeight="480"
|
MinWidth="630" MinHeight="480"
|
||||||
|
Width="630" Height="480"
|
||||||
Title="Trash Bin"
|
Title="Trash Bin"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Icon="/Assets/libation.ico">
|
Icon="/Assets/libation.ico">
|
||||||
|
|||||||
@ -43,8 +43,6 @@ namespace LibationAvalonia
|
|||||||
// Migrations which must occur before configuration is loaded for the first time. Usually ones which alter the Configuration
|
// Migrations which must occur before configuration is loaded for the first time. Usually ones which alter the Configuration
|
||||||
var config = LibationScaffolding.RunPreConfigMigrations();
|
var config = LibationScaffolding.RunPreConfigMigrations();
|
||||||
|
|
||||||
App.SetupRequired = !config.LibationSettingsAreValid;
|
|
||||||
|
|
||||||
//Start as much work in parallel as possible.
|
//Start as much work in parallel as possible.
|
||||||
var classicLifetimeTask = Task.Run(() => new ClassicDesktopStyleApplicationLifetime());
|
var classicLifetimeTask = Task.Run(() => new ClassicDesktopStyleApplicationLifetime());
|
||||||
var appBuilderTask = Task.Run(BuildAvaloniaApp);
|
var appBuilderTask = Task.Run(BuildAvaloniaApp);
|
||||||
@ -55,7 +53,7 @@ namespace LibationAvalonia
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if (!App.SetupRequired)
|
if (config.LibationSettingsAreValid)
|
||||||
{
|
{
|
||||||
if (!RunDbMigrations(config))
|
if (!RunDbMigrations(config))
|
||||||
return;
|
return;
|
||||||
@ -63,7 +61,7 @@ namespace LibationAvalonia
|
|||||||
App.LibraryTask = Task.Run(() => DbContexts.GetLibrary_Flat_NoTracking(includeParents: true));
|
App.LibraryTask = Task.Run(() => DbContexts.GetLibrary_Flat_NoTracking(includeParents: true));
|
||||||
}
|
}
|
||||||
|
|
||||||
(appBuilderTask.GetAwaiter().GetResult()).SetupWithLifetime(classicLifetimeTask.GetAwaiter().GetResult());
|
appBuilderTask.GetAwaiter().GetResult().SetupWithLifetime(classicLifetimeTask.GetAwaiter().GetResult());
|
||||||
|
|
||||||
classicLifetimeTask.Result.Start(null);
|
classicLifetimeTask.Result.Start(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,64 +29,61 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupDialog));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupDialog));
|
||||||
this.welcomeLbl = new System.Windows.Forms.Label();
|
welcomeLbl = new System.Windows.Forms.Label();
|
||||||
this.newUserBtn = new System.Windows.Forms.Button();
|
newUserBtn = new System.Windows.Forms.Button();
|
||||||
this.returningUserBtn = new System.Windows.Forms.Button();
|
returningUserBtn = new System.Windows.Forms.Button();
|
||||||
this.SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// welcomeLbl
|
// welcomeLbl
|
||||||
//
|
//
|
||||||
this.welcomeLbl.AutoSize = true;
|
welcomeLbl.AutoSize = true;
|
||||||
this.welcomeLbl.Location = new System.Drawing.Point(14, 10);
|
welcomeLbl.Location = new System.Drawing.Point(14, 10);
|
||||||
this.welcomeLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
welcomeLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
this.welcomeLbl.Name = "welcomeLbl";
|
welcomeLbl.Name = "welcomeLbl";
|
||||||
this.welcomeLbl.Size = new System.Drawing.Size(449, 135);
|
welcomeLbl.Size = new System.Drawing.Size(449, 135);
|
||||||
this.welcomeLbl.TabIndex = 0;
|
welcomeLbl.TabIndex = 0;
|
||||||
this.welcomeLbl.Text = resources.GetString("welcomeLbl.Text");
|
welcomeLbl.Text = resources.GetString("welcomeLbl.Text");
|
||||||
//
|
//
|
||||||
// newUserBtn
|
// newUserBtn
|
||||||
//
|
//
|
||||||
this.newUserBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
newUserBtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
newUserBtn.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||||
this.newUserBtn.Location = new System.Drawing.Point(18, 156);
|
newUserBtn.Location = new System.Drawing.Point(18, 156);
|
||||||
this.newUserBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
newUserBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||||
this.newUserBtn.Name = "newUserBtn";
|
newUserBtn.Name = "newUserBtn";
|
||||||
this.newUserBtn.Size = new System.Drawing.Size(462, 66);
|
newUserBtn.Size = new System.Drawing.Size(462, 66);
|
||||||
this.newUserBtn.TabIndex = 2;
|
newUserBtn.TabIndex = 2;
|
||||||
this.newUserBtn.Text = "NEW USER\r\n\r\nChoose settings";
|
newUserBtn.Text = "NEW USER";
|
||||||
this.newUserBtn.UseVisualStyleBackColor = true;
|
newUserBtn.UseVisualStyleBackColor = true;
|
||||||
this.newUserBtn.Click += new System.EventHandler(this.newUserBtn_Click);
|
newUserBtn.Click += newUserBtn_Click;
|
||||||
//
|
//
|
||||||
// returningUserBtn
|
// returningUserBtn
|
||||||
//
|
//
|
||||||
this.returningUserBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
returningUserBtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
returningUserBtn.Location = new System.Drawing.Point(18, 228);
|
||||||
this.returningUserBtn.Location = new System.Drawing.Point(18, 228);
|
returningUserBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||||
this.returningUserBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
returningUserBtn.Name = "returningUserBtn";
|
||||||
this.returningUserBtn.Name = "returningUserBtn";
|
returningUserBtn.Size = new System.Drawing.Size(462, 66);
|
||||||
this.returningUserBtn.Size = new System.Drawing.Size(462, 66);
|
returningUserBtn.TabIndex = 3;
|
||||||
this.returningUserBtn.TabIndex = 3;
|
returningUserBtn.Text = "RETURNING USER\r\n\r\nI have previously installed Libation. This is an upgrade or re-install";
|
||||||
this.returningUserBtn.Text = "RETURNING USER\r\n\r\nI have previously installed Libation. This is an upgrade or re-" +
|
returningUserBtn.UseVisualStyleBackColor = true;
|
||||||
"install";
|
returningUserBtn.Click += returningUserBtn_Click;
|
||||||
this.returningUserBtn.UseVisualStyleBackColor = true;
|
|
||||||
this.returningUserBtn.Click += new System.EventHandler(this.returningUserBtn_Click);
|
|
||||||
//
|
//
|
||||||
// SetupDialog
|
// SetupDialog
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(493, 308);
|
ClientSize = new System.Drawing.Size(493, 308);
|
||||||
this.Controls.Add(this.returningUserBtn);
|
Controls.Add(returningUserBtn);
|
||||||
this.Controls.Add(this.newUserBtn);
|
Controls.Add(newUserBtn);
|
||||||
this.Controls.Add(this.welcomeLbl);
|
Controls.Add(welcomeLbl);
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||||
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||||
this.Name = "SetupDialog";
|
Name = "SetupDialog";
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
this.Text = "Welcome to Libation";
|
Text = "Welcome to Libation";
|
||||||
this.ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
this.PerformLayout();
|
PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<root>
|
||||||
<root>
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
|||||||
@ -142,12 +142,6 @@ namespace LibationWinForms
|
|||||||
// if 'new user' was clicked, or if 'returning user' chose new install: show basic settings dialog
|
// if 'new user' was clicked, or if 'returning user' chose new install: show basic settings dialog
|
||||||
config.Books ??= Path.Combine(defaultLibationFilesDir, "Books");
|
config.Books ??= Path.Combine(defaultLibationFilesDir, "Books");
|
||||||
|
|
||||||
if (new SettingsDialog().ShowDialog() != DialogResult.OK)
|
|
||||||
{
|
|
||||||
CancelInstallation();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.LibationSettingsAreValid)
|
if (config.LibationSettingsAreValid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user