diff --git a/LRReader.Shared/ApiConnection.cs b/LRReader.Shared/ApiConnection.cs index cd340501..f94db9ad 100644 --- a/LRReader.Shared/ApiConnection.cs +++ b/LRReader.Shared/ApiConnection.cs @@ -202,7 +202,7 @@ public static async Task GetError(this RestResponse restRespon } }*/ - private static void ShowNotification(string title, string? content) => WeakReferenceMessenger.Default.Send(new ShowNotification(title, content)); + private static void ShowNotification(string title, string? content) => WeakReferenceMessenger.Default.Send(new ShowNotification(title, content, severity: NotificationSeverity.Error)); } } diff --git a/LRReader.Shared/Messages/Events.cs b/LRReader.Shared/Messages/Events.cs index d547b23e..843e4a5f 100644 --- a/LRReader.Shared/Messages/Events.cs +++ b/LRReader.Shared/Messages/Events.cs @@ -20,16 +20,24 @@ public struct Notification public string? Content { get; } public int Duration { get; } - public Notification(string title, string? content, int duration) + public NotificationSeverity Severity { get; } + + public Notification(string title, string? content, int duration, NotificationSeverity severity = NotificationSeverity.Informational) { Title = title; Content = content; Duration = duration; + Severity = severity; } } + public enum NotificationSeverity + { + Informational, Success, Warning, Error + } + public class ShowNotification : ValueChangedMessage { - public ShowNotification(string title, string? content, int duration = 5000) : base(new Notification(title, content, duration)) { } + public ShowNotification(string title, string? content, int duration = 5000, NotificationSeverity severity = NotificationSeverity.Informational) : base(new Notification(title, content, duration, severity)) { } } } diff --git a/LRReader.Shared/Models/Main/Archive.cs b/LRReader.Shared/Models/Main/Archive.cs index 8ad28efe..ffa08f2c 100644 --- a/LRReader.Shared/Models/Main/Archive.cs +++ b/LRReader.Shared/Models/Main/Archive.cs @@ -22,6 +22,7 @@ public class Archive : IEquatable public string title { get; set; } = null!; public int pagecount { get; set; } public int progress { get; set; } + public int? lastreadtime { get; set; } [JsonIgnore] public string TagsClean { get; set; } = null!; [JsonIgnore] diff --git a/LRReader.Shared/Providers/ArchivesProvider.cs b/LRReader.Shared/Providers/ArchivesProvider.cs index 2894e36a..3fedc1b1 100644 --- a/LRReader.Shared/Providers/ArchivesProvider.cs +++ b/LRReader.Shared/Providers/ArchivesProvider.cs @@ -110,7 +110,7 @@ public static async Task Validate() if (!string.IsNullOrEmpty(r.ErrorMessage)) { - WeakReferenceMessenger.Default.Send(new ShowNotification("Network Error", r.ErrorMessage)); + WeakReferenceMessenger.Default.Send(new ShowNotification("Network Error", r.ErrorMessage, severity: NotificationSeverity.Error)); return null; } switch (r.StatusCode) @@ -128,7 +128,7 @@ public static async Task Validate() return download; default: var error = await r.GetError(); - WeakReferenceMessenger.Default.Send(new ShowNotification(error.operation, error.error)); + WeakReferenceMessenger.Default.Send(new ShowNotification(error.operation, error.error, severity: NotificationSeverity.Error)); return null; } } diff --git a/LRReader.Shared/Providers/CategoriesProvider.cs b/LRReader.Shared/Providers/CategoriesProvider.cs index 6777bca9..87c72e6f 100644 --- a/LRReader.Shared/Providers/CategoriesProvider.cs +++ b/LRReader.Shared/Providers/CategoriesProvider.cs @@ -54,7 +54,7 @@ public static async Task Validate() if (!string.IsNullOrEmpty(r.ErrorMessage)) { - WeakReferenceMessenger.Default.Send(new ShowNotification("Network Error", r.ErrorMessage)); + WeakReferenceMessenger.Default.Send(new ShowNotification("Network Error", r.ErrorMessage, severity: NotificationSeverity.Error)); return null; } if (result.OK) @@ -63,7 +63,7 @@ public static async Task Validate() } else { - WeakReferenceMessenger.Default.Send(new ShowNotification(result?.Error?.operation ?? "", result?.Error?.error)); + WeakReferenceMessenger.Default.Send(new ShowNotification(result?.Error?.operation ?? "", result?.Error?.error, severity: NotificationSeverity.Error)); return null; } } diff --git a/LRReader.Shared/Providers/DatabaseProvider.cs b/LRReader.Shared/Providers/DatabaseProvider.cs index 6a7e6dd0..1f7700d3 100644 --- a/LRReader.Shared/Providers/DatabaseProvider.cs +++ b/LRReader.Shared/Providers/DatabaseProvider.cs @@ -72,7 +72,7 @@ public static async Task DropDatabase() if (!string.IsNullOrEmpty(r.ErrorMessage)) { - WeakReferenceMessenger.Default.Send(new ShowNotification("Network Error", r.ErrorMessage)); + WeakReferenceMessenger.Default.Send(new ShowNotification("Network Error", r.ErrorMessage, severity: NotificationSeverity.Error)); return null; } switch (r.StatusCode) @@ -85,7 +85,7 @@ public static async Task DropDatabase() return download; default: var error = await r.GetError(); - WeakReferenceMessenger.Default.Send(new ShowNotification(error.operation, error.error)); + WeakReferenceMessenger.Default.Send(new ShowNotification(error.operation, error.error, severity: NotificationSeverity.Error)); return null; } } diff --git a/LRReader.Shared/Services/Archives.cs b/LRReader.Shared/Services/Archives.cs index 2af79cb7..c7231a7c 100644 --- a/LRReader.Shared/Services/Archives.cs +++ b/LRReader.Shared/Services/Archives.cs @@ -140,7 +140,7 @@ public async Task DeleteArchive(string id) var result = await ArchivesProvider.DeleteArchive(id); if (result == null) { - WeakReferenceMessenger.Default.Send(new ShowNotification("Unable to delete archive", "", 0)); + WeakReferenceMessenger.Default.Send(new ShowNotification("Unable to delete archive", "", 0, NotificationSeverity.Error)); return false; } if (result.success) @@ -154,7 +154,7 @@ public async Task DeleteArchive(string id) } else { - WeakReferenceMessenger.Default.Send(new ShowNotification("An error ocurred while deleting archive", "Metadata has been deleted, remove file manually.", 0)); + WeakReferenceMessenger.Default.Send(new ShowNotification("An error ocurred while deleting archive", "Metadata has been deleted, remove file manually.", 0, NotificationSeverity.Warning)); } return true; } diff --git a/LRReader.Shared/ViewModels/ArchiveEditViewModel.cs b/LRReader.Shared/ViewModels/ArchiveEditViewModel.cs index 20de108d..84998d82 100644 --- a/LRReader.Shared/ViewModels/ArchiveEditViewModel.cs +++ b/LRReader.Shared/ViewModels/ArchiveEditViewModel.cs @@ -195,7 +195,7 @@ private async Task UsePlugin() } else { - WeakReferenceMessenger.Default.Send(new ShowNotification("Error while fetching tags", result.error, 0)); + WeakReferenceMessenger.Default.Send(new ShowNotification("Error while fetching tags", result.error, 0, NotificationSeverity.Error)); } } Saving = false; diff --git a/LRReader.Shared/ViewModels/ArchivesPageViewModel.cs b/LRReader.Shared/ViewModels/ArchivesPageViewModel.cs index e764fb7d..12fbf178 100644 --- a/LRReader.Shared/ViewModels/ArchivesPageViewModel.cs +++ b/LRReader.Shared/ViewModels/ArchivesPageViewModel.cs @@ -55,7 +55,7 @@ public void LoadBookmarks() if (archive != null) Archives.OpenTab(archive, false); else - WeakReferenceMessenger.Default.Send(new ShowNotification("Bookmarked Archive with ID[" + b.archiveID + "] not found.", "")); + WeakReferenceMessenger.Default.Send(new ShowNotification("Bookmarked Archive with ID[" + b.archiveID + "] not found.", "", severity: NotificationSeverity.Warning)); } Settings.Profile.MarkedAsNonDuplicated.RemoveAll(hit => !(Archives.HasArchive(hit.Left) && Archives.HasArchive(hit.Right))); } diff --git a/LRReader.Shared/ViewModels/SettingsPageViewModel.cs b/LRReader.Shared/ViewModels/SettingsPageViewModel.cs index 918bb756..4038a038 100644 --- a/LRReader.Shared/ViewModels/SettingsPageViewModel.cs +++ b/LRReader.Shared/ViewModels/SettingsPageViewModel.cs @@ -272,7 +272,7 @@ public async Task CheckThumbnailJob() } if (status.state!.Equals("finished")) { - WeakReferenceMessenger.Default.Send(new ShowNotification("Thumbnail generation completed", "")); + WeakReferenceMessenger.Default.Send(new ShowNotification("Thumbnail generation completed", "", severity: NotificationSeverity.Informational)); thumbnailJob = null; } } diff --git a/LRReader.UWP.Installer/LRReader.UWP.Installer.csproj b/LRReader.UWP.Installer/LRReader.UWP.Installer.csproj index 4179d967..fbb6cd50 100644 --- a/LRReader.UWP.Installer/LRReader.UWP.Installer.csproj +++ b/LRReader.UWP.Installer/LRReader.UWP.Installer.csproj @@ -31,7 +31,7 @@ 5.7.0 all - + 3.0.0-preview.8 diff --git a/LRReader.UWP/App.xaml b/LRReader.UWP/App.xaml index 221978b4..8554039b 100644 --- a/LRReader.UWP/App.xaml +++ b/LRReader.UWP/App.xaml @@ -11,7 +11,6 @@ - diff --git a/LRReader.UWP/LRReader.UWP.csproj b/LRReader.UWP/LRReader.UWP.csproj index 16131f5d..671313a6 100644 --- a/LRReader.UWP/LRReader.UWP.csproj +++ b/LRReader.UWP/LRReader.UWP.csproj @@ -30,7 +30,7 @@ http://timestamp.digicert.com Resources\MiddleClickScrolling-CursorType.res enable - 9.0 + 10.0 true @@ -161,6 +161,9 @@ + + Empty.xaml + Feedback.xaml @@ -182,6 +185,9 @@ Main.xaml + + WebContent.xaml + ArchiveTags.xaml @@ -229,9 +235,6 @@ CategoryItem.xaml - - NotificationItem.xaml - ReaderImage.xaml @@ -416,6 +419,9 @@ 8.0.230907 + + 8.0.230907 + 8.0.230907 @@ -437,12 +443,6 @@ 6.2.14 - - 7.1.3 - - - 7.1.3 - 7.1.3 @@ -472,10 +472,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -488,6 +484,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -516,6 +516,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -568,10 +572,6 @@ MSBuild:Compile Designer - - MSBuild:Compile - Designer - MSBuild:Compile Designer diff --git a/LRReader.UWP/Resources/NotificationStyle.xaml b/LRReader.UWP/Resources/NotificationStyle.xaml deleted file mode 100644 index bf207a93..00000000 --- a/LRReader.UWP/Resources/NotificationStyle.xaml +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - 24,0,0,0 - 32 - 18 - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - Collapsed - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/LRReader.UWP/Resources/ThemeDictionary.xaml b/LRReader.UWP/Resources/ThemeDictionary.xaml index b225ef3d..0eb77a27 100644 --- a/LRReader.UWP/Resources/ThemeDictionary.xaml +++ b/LRReader.UWP/Resources/ThemeDictionary.xaml @@ -10,10 +10,11 @@ White White - + #D0D0D0 #B3FFFFFF @@ -30,10 +31,11 @@ Black #0a0a0a - + #151515 #0FFFFFFF diff --git a/LRReader.UWP/Resources/WinUITemplates.xaml b/LRReader.UWP/Resources/WinUITemplates.xaml index 04941845..9d7dcef9 100644 --- a/LRReader.UWP/Resources/WinUITemplates.xaml +++ b/LRReader.UWP/Resources/WinUITemplates.xaml @@ -9,6 +9,8 @@ + + 4 3 2 @@ -125,6 +127,8 @@ --> + + 4 3 2 @@ -241,6 +245,8 @@ --> + + 4 3 2 diff --git a/LRReader.UWP/Services/Updates.cs b/LRReader.UWP/Services/Updates.cs index 1f17fc13..447a0732 100644 --- a/LRReader.UWP/Services/Updates.cs +++ b/LRReader.UWP/Services/Updates.cs @@ -136,9 +136,9 @@ public override async Task DownloadAndInstall(IProgress pr Logger.LogInformation("Download and install"); try { - Logger.LogInformation("Source: {0}", check?.Link); + Logger.LogInformation("Source: {0}", check.Link); var pm = new PackageManager(); - var downloadTask = pm.AddPackageByAppInstallerFileAsync(new Uri(check?.Link), AddPackageByAppInstallerOptions.ForceTargetAppShutdown, pm.GetDefaultPackageVolume()); + var downloadTask = pm.AddPackageByAppInstallerFileAsync(new Uri(check.Link), AddPackageByAppInstallerOptions.ForceTargetAppShutdown, pm.GetDefaultPackageVolume()); downloadTask.Progress = (info, prog) => progress?.Report(prog.percentage / 100d); var result = await downloadTask.AsTask(); if (result.IsRegistered) diff --git a/LRReader.UWP/Views/Content/Empty.xaml b/LRReader.UWP/Views/Content/Empty.xaml new file mode 100644 index 00000000..3e428c50 --- /dev/null +++ b/LRReader.UWP/Views/Content/Empty.xaml @@ -0,0 +1,8 @@ + diff --git a/LRReader.UWP/Views/Content/Empty.xaml.cs b/LRReader.UWP/Views/Content/Empty.xaml.cs new file mode 100644 index 00000000..73f3bd82 --- /dev/null +++ b/LRReader.UWP/Views/Content/Empty.xaml.cs @@ -0,0 +1,12 @@ +using Windows.UI.Xaml.Controls; + +namespace LRReader.UWP.Views.Content +{ + public sealed partial class Empty : Page + { + public Empty() + { + this.InitializeComponent(); + } + } +} diff --git a/LRReader.UWP/Views/Content/Settings/Server.xaml b/LRReader.UWP/Views/Content/Settings/Server.xaml index 6aa23a12..adc10248 100644 --- a/LRReader.UWP/Views/Content/Settings/Server.xaml +++ b/LRReader.UWP/Views/Content/Settings/Server.xaml @@ -8,6 +8,7 @@ xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:services="using:LRReader.Shared.Services" xmlns:tools="using:LRReader.UWP.Views.Content.Tools" + xmlns:content="using:LRReader.UWP.Views.Content" DataContext="{Binding SettingsPageInstance, Source={StaticResource Locator}}" mc:Ignorable="d"> @@ -42,6 +43,7 @@ IsHitTestVisible="False" IsTabStop="False" /> + + + + + + + + + + + + + + + + + + + + + + + + + +