From 3681c0f18f4911b3fa53b977576ce84009ce23ad Mon Sep 17 00:00:00 2001 From: Mbucari Date: Tue, 28 Mar 2023 14:06:28 -0600 Subject: [PATCH] Final walkthrough tweaks --- .../LibationAvalonia/Views/MainWindow.Settings.cs | 3 +++ Source/LibationAvalonia/Views/MainWindow.axaml | 1 + Source/LibationAvalonia/Walkthrough.cs | 8 +++++--- .../Configuration.PersistentSettings.cs | 2 +- Source/LibationWinForms/Form1.Designer.cs | 10 ++++++++++ Source/LibationWinForms/Form1.Settings.cs | 3 +++ Source/LibationWinForms/Walkthrough.cs | 15 +++++++++------ 7 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Source/LibationAvalonia/Views/MainWindow.Settings.cs b/Source/LibationAvalonia/Views/MainWindow.Settings.cs index 2a99fd97..0989855d 100644 --- a/Source/LibationAvalonia/Views/MainWindow.Settings.cs +++ b/Source/LibationAvalonia/Views/MainWindow.Settings.cs @@ -16,6 +16,9 @@ namespace LibationAvalonia.Views public async void aboutToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) => await MessageBox.Show($"Libation {AppScaffolding.LibationScaffolding.Variety}{Environment.NewLine}Version {AppScaffolding.LibationScaffolding.BuildVersion}", $"Libation v{AppScaffolding.LibationScaffolding.BuildVersion}"); + public async void tourToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) + => await new Walkthrough(this).RunAsync(); + public void launchHangoverToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) { try diff --git a/Source/LibationAvalonia/Views/MainWindow.axaml b/Source/LibationAvalonia/Views/MainWindow.axaml index f640fbb5..13380bbb 100644 --- a/Source/LibationAvalonia/Views/MainWindow.axaml +++ b/Source/LibationAvalonia/Views/MainWindow.axaml @@ -128,6 +128,7 @@ + diff --git a/Source/LibationAvalonia/Walkthrough.cs b/Source/LibationAvalonia/Walkthrough.cs index d5a380e3..2ca2b28a 100644 --- a/Source/LibationAvalonia/Walkthrough.cs +++ b/Source/LibationAvalonia/Walkthrough.cs @@ -41,7 +41,7 @@ namespace LibationAvalonia private async Task ShowAccountDialog() { - if (await OkCancelMessageBox("First, add you Audible account(s).", "Add Accounts") is not DialogResult.OK) return false; + if (await OkCancelMessageBox("First, add your Audible account(s).", "Add Accounts") is not DialogResult.OK) return false; await Task.Delay(750); await flashControlAsync(MainForm.settingsToolStripMenuItem); @@ -134,9 +134,11 @@ namespace LibationAvalonia await flashControlAsync(MainForm.importToolStripMenuItem); await InvokeAsync(MainForm.importToolStripMenuItem.Open); await Task.Delay(500); + await flashControlAsync(scanItem); await InvokeAsync(() => scanItem.IsSelected = true); await Task.Delay(500); + await InvokeAsync(() => scanItem.RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent))); await InvokeAsync(MainForm.importToolStripMenuItem.Close); @@ -181,6 +183,7 @@ namespace LibationAvalonia await flashControlAsync(MainForm.filterBtn); await InvokeAsync(MainForm.filterBtn.Focus); await Task.Delay(500); + await InvokeAsync(() => MainForm.filterBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); await Task.Delay(1000); @@ -204,9 +207,8 @@ namespace LibationAvalonia await Task.Delay(750); await flashControlAsync(MainForm.addQuickFilterBtn); - await Task.Delay(750); - await InvokeAsync(() => MainForm.addQuickFilterBtn.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))); + await Task.Delay(750); await flashControlAsync(MainForm.quickFiltersToolStripMenuItem); await InvokeAsync(MainForm.quickFiltersToolStripMenuItem.Open); diff --git a/Source/LibationFileManager/Configuration.PersistentSettings.cs b/Source/LibationFileManager/Configuration.PersistentSettings.cs index 5145bdb2..70443f7b 100644 --- a/Source/LibationFileManager/Configuration.PersistentSettings.cs +++ b/Source/LibationFileManager/Configuration.PersistentSettings.cs @@ -192,7 +192,7 @@ namespace LibationFileManager } [Description("Indicates that this is the first time Libation has been run")] - public bool FirstLaunch { get => true; set => SetNonString(value); } + public bool FirstLaunch { get => GetNonString(defaultValue: true); set => SetNonString(value); } [Description("When liberating books and there is an error, Libation should:")] public BadBookAction BadBook { get => GetNonString(defaultValue: BadBookAction.Ask); set => SetNonString(value); } diff --git a/Source/LibationWinForms/Form1.Designer.cs b/Source/LibationWinForms/Form1.Designer.cs index 0ad937e1..7546ae76 100644 --- a/Source/LibationWinForms/Form1.Designer.cs +++ b/Source/LibationWinForms/Form1.Designer.cs @@ -70,6 +70,7 @@ this.accountsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.basicSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.tourToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.upgradePb = new System.Windows.Forms.ToolStripProgressBar(); @@ -386,6 +387,7 @@ this.openTrashBinToolStripMenuItem, this.launchHangoverToolStripMenuItem, this.toolStripSeparator2, + this.tourToolStripMenuItem, this.aboutToolStripMenuItem}); this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); @@ -410,6 +412,13 @@ this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(130, 6); // + // tourToolStripMenuItem + // + this.tourToolStripMenuItem.Name = "tourToolStripMenuItem"; + this.tourToolStripMenuItem.Size = new System.Drawing.Size(133, 22); + this.tourToolStripMenuItem.Text = "Take a Guided &Tour of Libation"; + this.tourToolStripMenuItem.Click += new System.EventHandler(this.tourToolStripMenuItem_Click); + // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; @@ -664,6 +673,7 @@ private System.Windows.Forms.ToolStripMenuItem removeAllAccountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removeSomeAccountsToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem tourToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem scanningToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem autoScanLibraryToolStripMenuItem; diff --git a/Source/LibationWinForms/Form1.Settings.cs b/Source/LibationWinForms/Form1.Settings.cs index 5f6240d3..ce8b61c5 100644 --- a/Source/LibationWinForms/Form1.Settings.cs +++ b/Source/LibationWinForms/Form1.Settings.cs @@ -15,6 +15,9 @@ namespace LibationWinForms private void aboutToolStripMenuItem_Click(object sender, EventArgs e) => MessageBox.Show($"Libation {AppScaffolding.LibationScaffolding.Variety}{Environment.NewLine}Version {AppScaffolding.LibationScaffolding.BuildVersion}", $"Libation v{AppScaffolding.LibationScaffolding.BuildVersion}"); + private async void tourToolStripMenuItem_Click(object sender, EventArgs e) + => await new Walkthrough(this).RunAsync(); + private void launchHangoverToolStripMenuItem_Click(object sender, EventArgs e) { try diff --git a/Source/LibationWinForms/Walkthrough.cs b/Source/LibationWinForms/Walkthrough.cs index a22debc4..a2500c00 100644 --- a/Source/LibationWinForms/Walkthrough.cs +++ b/Source/LibationWinForms/Walkthrough.cs @@ -37,7 +37,7 @@ namespace LibationWinForms private async Task ShowAccountDialog() { - if (OkCancelMessageBox("First, add you Audible account(s).", "Add Accounts") is not DialogResult.OK) return false; + if (OkCancelMessageBox("First, add your Audible account(s).", "Add Accounts") is not DialogResult.OK) return false; await Task.Delay(750); await flashControlAsync(MainForm.settingsToolStripMenuItem); @@ -62,8 +62,8 @@ namespace LibationWinForms await Task.Delay(750); await flashControlAsync(MainForm.settingsToolStripMenuItem); MainForm.Invoke(MainForm.settingsToolStripMenuItem.ShowDropDown); - await Task.Delay(500); + await flashControlAsync(MainForm.basicSettingsToolStripMenuItem); MainForm.Invoke(MainForm.basicSettingsToolStripMenuItem.Select); await Task.Delay(500); @@ -128,9 +128,11 @@ namespace LibationWinForms await flashControlAsync(MainForm.importToolStripMenuItem); MainForm.Invoke(MainForm.importToolStripMenuItem.ShowDropDown); await Task.Delay(500); + await flashControlAsync(scanItem); MainForm.Invoke(scanItem.Select); await Task.Delay(500); + MainForm.Invoke(scanItem.PerformClick); var tcs = new TaskCompletionSource(); @@ -175,6 +177,7 @@ namespace LibationWinForms await flashControlAsync(MainForm.filterBtn); MainForm.Invoke(MainForm.filterBtn.Select); await Task.Delay(500); + MainForm.Invoke(MainForm.filterBtn.PerformClick); await Task.Delay(1000); @@ -196,24 +199,24 @@ namespace LibationWinForms if (OkCancelMessageBox("Queries that you perform regularly can be added to 'Quick Filters'", "Quick Filters") is not DialogResult.OK) return false; MainForm.Invoke(() => MainForm.filterSearchTb.Text = firstAuthor); + await Task.Delay(750); await flashControlAsync(MainForm.addQuickFilterBtn); - await Task.Delay(750); - MainForm.Invoke(MainForm.addQuickFilterBtn.PerformClick); + await Task.Delay(750); await flashControlAsync(MainForm.quickFiltersToolStripMenuItem); MainForm.Invoke(MainForm.quickFiltersToolStripMenuItem.ShowDropDown); await Task.Delay(500); - MainForm.Invoke(MainForm.editQuickFiltersToolStripMenuItem.Select); await flashControlAsync(MainForm.editQuickFiltersToolStripMenuItem); + MainForm.Invoke(MainForm.editQuickFiltersToolStripMenuItem.Select); await Task.Delay(500); var editQuickFilters = MainForm.Invoke(() => new EditQuickFilters()); editQuickFilters.Shown += (_, _) => MessageBox.Show(editQuickFilters, "From here you can edit, delete, and change the order of Quick Filters", "Editing Quick Filters"); - MainForm.Invoke(editQuickFilters.ShowDialog); + return true; }