From 4e404b16baafbd38ea57780152a9e81c3cac30c3 Mon Sep 17 00:00:00 2001 From: Dylech30th Date: Fri, 22 Oct 2021 17:59:22 +0800 Subject: [PATCH] update --- LICENSE | 143 ++++++++++-------- .../IllustrationAppActivationHandler.cs | 2 +- src/Pixeval/App.xaml | 2 +- src/Pixeval/App.xaml.cs | 1 - src/Pixeval/{ViewModel => }/AppViewModel.cs | 4 +- .../Setting.UI/SettingsPageViewModel.cs | 4 +- src/Pixeval/Download/DownloadFactories.cs | 2 +- .../IllustrationDownloadTaskFactory.cs | 2 +- .../IllustrationMetaPathMacroProvider.cs | 2 +- .../Download/IllustrationMetaPathParser.cs | 2 +- .../Download/Macros/FileExtensionMacro.cs | 2 +- .../Download/Macros/IllustrationIdMacro.cs | 2 +- .../Download/Macros/IllustrationTitleMacro.cs | 2 +- .../Download/Macros/IllustratorIdMacro.cs | 2 +- .../Download/Macros/IllustratorNameMacro.cs | 2 +- .../Download/Macros/IsFromSpotlightMacro.cs | 2 +- src/Pixeval/Download/Macros/IsMangaMacro.cs | 2 +- src/Pixeval/Download/Macros/IsUgoiraMacro.cs | 2 +- .../Download/Macros/MangaIndexMacro.cs | 2 +- .../Download/Macros/SpotlightIdMacro.cs | 2 +- .../Download/Macros/SpotlightTitleMacro.cs | 2 +- .../NavigatingBackToMainPageMessage.cs | 2 +- .../Misc/IllustrationViewModelComparers.cs | 2 +- .../Pages/Download/DownloadListEntry.xaml | 22 +++ .../Pages/Download/DownloadListEntry.xaml.cs | 28 ++++ .../Pages/Download/DownloadListOption.cs | 42 +++++ .../Pages/Download/DownloadListPage.xaml | 51 +++++++ .../DownloadListPage.xaml.cs | 4 +- .../Download/DownloadListPageViewModel.cs | 45 ++++++ .../CommentBlockViewModel.cs | 2 +- .../CommentRepliesBlockViewModel.cs | 2 +- .../CommentsIncrementalSource.cs | 1 - .../IllustrationViewer/CommentsPage.xaml.cs | 1 - .../IllustrationInfoPage.xaml.cs | 1 - .../IllustrationViewerPage.xaml.cs | 2 +- .../IllustrationViewerPageViewModel.cs | 2 +- .../ImageViewerPage.xaml.cs | 1 - .../ImageViewerPageViewModel.cs | 4 +- .../PixivReplyEmojiListPage.xaml | 3 +- .../PixivReplyEmojiListPage.xaml.cs | 1 - .../PixivReplyEmojiViewModel.cs | 2 +- .../PixivReplyStickerListPage.xaml | 3 +- .../PixivReplyStickerListPage.xaml.cs | 1 - .../PixivReplyStickerViewModel.cs | 2 +- src/Pixeval/Pages/MainPage.xaml | 4 +- src/Pixeval/Pages/MainPage.xaml.cs | 3 +- .../{ViewModel => Pages}/MainPageViewModel.cs | 2 +- src/Pixeval/Pages/Misc/DownloadListPage.xaml | 7 - src/Pixeval/Pages/Misc/LoginPage.xaml | 4 +- src/Pixeval/Pages/Misc/LoginPage.xaml.cs | 1 - .../Misc}/LoginPageViewModel.cs | 2 +- src/Pixeval/Pages/Misc/SettingsPage.xaml | 98 ++++++------ src/Pixeval/Pages/Misc/SettingsPage.xaml.cs | 2 +- src/Pixeval/Pixeval.csproj | 6 +- src/Pixeval/Popups/CommentRepliesBlock.xaml | 2 +- .../Popups/CommentRepliesBlock.xaml.cs | 2 +- .../IllustrationResultFilterPopupContent.xaml | 45 ++---- .../Strings/zh-CN/DownloadListPage.resw | 21 +++ src/Pixeval/Themes/Controls.xaml | 6 +- src/Pixeval/UserControls/CommentBlock.xaml.cs | 2 +- src/Pixeval/UserControls/CommentList.xaml | 6 +- src/Pixeval/UserControls/CommentList.xaml.cs | 2 +- .../IllustrationContainer.xaml.cs | 1 - .../UserControls/IllustrationGrid.xaml | 4 +- .../UserControls/IllustrationGrid.xaml.cs | 1 - .../IllustrationGridCommandBar.xaml.cs | 1 - .../IllustrationGridViewModel.cs | 2 +- .../IllustrationViewModel.cs | 3 +- .../UserControls/PixivReplyBar.xaml.cs | 1 - 69 files changed, 410 insertions(+), 228 deletions(-) rename src/Pixeval/{ViewModel => }/AppViewModel.cs (99%) create mode 100644 src/Pixeval/Pages/Download/DownloadListEntry.xaml create mode 100644 src/Pixeval/Pages/Download/DownloadListEntry.xaml.cs create mode 100644 src/Pixeval/Pages/Download/DownloadListOption.cs create mode 100644 src/Pixeval/Pages/Download/DownloadListPage.xaml rename src/Pixeval/Pages/{Misc => Download}/DownloadListPage.xaml.cs (90%) create mode 100644 src/Pixeval/Pages/Download/DownloadListPageViewModel.cs rename src/Pixeval/{ViewModel => Pages/IllustrationViewer}/CommentBlockViewModel.cs (98%) rename src/Pixeval/{ViewModel => Pages/IllustrationViewer}/CommentRepliesBlockViewModel.cs (96%) rename src/Pixeval/{ViewModel => Pages/IllustrationViewer}/IllustrationViewerPageViewModel.cs (99%) rename src/Pixeval/{ViewModel => Pages/IllustrationViewer}/ImageViewerPageViewModel.cs (99%) rename src/Pixeval/{ViewModel => Pages/IllustrationViewer}/PixivReplyEmojiViewModel.cs (96%) rename src/Pixeval/{ViewModel => Pages/IllustrationViewer}/PixivReplyStickerViewModel.cs (96%) rename src/Pixeval/{ViewModel => Pages}/MainPageViewModel.cs (98%) delete mode 100644 src/Pixeval/Pages/Misc/DownloadListPage.xaml rename src/Pixeval/{ViewModel => Pages/Misc}/LoginPageViewModel.cs (99%) rename src/Pixeval/{ViewModel => UserControls}/IllustrationGridViewModel.cs (99%) rename src/Pixeval/{ViewModel => UserControls}/IllustrationViewModel.cs (99%) diff --git a/LICENSE b/LICENSE index 0ad25db4..e72bfdda 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,15 +7,17 @@ Preamble - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. + The GNU General Public License is a free, copyleft license for +software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to +the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -24,34 +26,44 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. @@ -60,7 +72,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU Affero General Public License. + "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -537,45 +549,35 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. + 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single +under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General +Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published +GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's +versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -633,29 +635,40 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + GNU General Public License for more details. - You should have received a copy of the GNU Affero General Public License + You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see +For more information on this, and how to apply and follow the GNU GPL, see . + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/src/Pixeval/Activation/IllustrationAppActivationHandler.cs b/src/Pixeval/Activation/IllustrationAppActivationHandler.cs index 9fd38187..16c663a0 100644 --- a/src/Pixeval/Activation/IllustrationAppActivationHandler.cs +++ b/src/Pixeval/Activation/IllustrationAppActivationHandler.cs @@ -27,9 +27,9 @@ using Microsoft.Toolkit.Mvvm.Messaging; using Microsoft.UI.Xaml.Media.Animation; using Pixeval.Messages; using Pixeval.Pages.IllustrationViewer; +using Pixeval.UserControls; using Pixeval.Util.UI; using Pixeval.Utilities; -using Pixeval.ViewModel; namespace Pixeval.Activation { diff --git a/src/Pixeval/App.xaml b/src/Pixeval/App.xaml index 2b976ab5..4f55b409 100644 --- a/src/Pixeval/App.xaml +++ b/src/Pixeval/App.xaml @@ -10,7 +10,7 @@ - 25 + 28 18 14 11 diff --git a/src/Pixeval/App.xaml.cs b/src/Pixeval/App.xaml.cs index 9343554b..6133c351 100644 --- a/src/Pixeval/App.xaml.cs +++ b/src/Pixeval/App.xaml.cs @@ -27,7 +27,6 @@ using Microsoft.UI.Xaml.Media; using Microsoft.Windows.AppLifecycle; using Pixeval.Activation; using Pixeval.Util.UI; -using Pixeval.ViewModel; using ApplicationTheme = Pixeval.Options.ApplicationTheme; namespace Pixeval diff --git a/src/Pixeval/ViewModel/AppViewModel.cs b/src/Pixeval/AppViewModel.cs similarity index 99% rename from src/Pixeval/ViewModel/AppViewModel.cs rename to src/Pixeval/AppViewModel.cs index 3b355268..bec73d42 100644 --- a/src/Pixeval/ViewModel/AppViewModel.cs +++ b/src/Pixeval/AppViewModel.cs @@ -21,6 +21,7 @@ #endregion using System; +using System.Diagnostics; using System.Diagnostics.Tracing; using System.Threading.Tasks; using Windows.Foundation; @@ -43,10 +44,9 @@ using Pixeval.Options; using Pixeval.Util.UI; using ApplicationTheme = Pixeval.Options.ApplicationTheme; #if DEBUG -using System.Diagnostics; #endif -namespace Pixeval.ViewModel +namespace Pixeval { public class AppViewModel : AutoActivateObservableRecipient, IRecipient, diff --git a/src/Pixeval/Controls/Setting.UI/SettingsPageViewModel.cs b/src/Pixeval/Controls/Setting.UI/SettingsPageViewModel.cs index 0f263806..b89adeab 100644 --- a/src/Pixeval/Controls/Setting.UI/SettingsPageViewModel.cs +++ b/src/Pixeval/Controls/Setting.UI/SettingsPageViewModel.cs @@ -32,8 +32,8 @@ using Pixeval.Download; using Pixeval.Download.MacroParser; using Pixeval.Misc; using Pixeval.Options; +using Pixeval.UserControls; using Pixeval.UserControls.TokenInput; -using Pixeval.ViewModel; namespace Pixeval.Controls.Setting.UI { @@ -41,7 +41,7 @@ namespace Pixeval.Controls.Setting.UI { public static readonly IEnumerable AvailableFonts = new InstalledFontCollection().Families.Select(f => f.Name); - public static readonly ICollection AvailableIllustMacros = IllustrationDownloadTask.Factory.PathParser.MacroProvider.AvailableMacros + public static readonly ICollection AvailableIllustMacros = DownloadFactories.Illustration.PathParser.MacroProvider.AvailableMacros .Select(m => $"@{{{(m is IMacro.IPredicate ? $"{m.Name}:" : m.Name)}}}") .Select(s => new Token(s, false, false)) .ToList(); diff --git a/src/Pixeval/Download/DownloadFactories.cs b/src/Pixeval/Download/DownloadFactories.cs index a1a223ae..2e373cb7 100644 --- a/src/Pixeval/Download/DownloadFactories.cs +++ b/src/Pixeval/Download/DownloadFactories.cs @@ -18,7 +18,7 @@ // along with this program. If not, see . #endregion -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download { diff --git a/src/Pixeval/Download/IllustrationDownloadTaskFactory.cs b/src/Pixeval/Download/IllustrationDownloadTaskFactory.cs index 27d62ef4..3204cee4 100644 --- a/src/Pixeval/Download/IllustrationDownloadTaskFactory.cs +++ b/src/Pixeval/Download/IllustrationDownloadTaskFactory.cs @@ -22,9 +22,9 @@ using System.Threading.Tasks; using Pixeval.Download.MacroParser; +using Pixeval.UserControls; using Pixeval.Util; using Pixeval.Utilities; -using Pixeval.ViewModel; namespace Pixeval.Download { diff --git a/src/Pixeval/Download/IllustrationMetaPathMacroProvider.cs b/src/Pixeval/Download/IllustrationMetaPathMacroProvider.cs index 4e9e68b2..08c8e20a 100644 --- a/src/Pixeval/Download/IllustrationMetaPathMacroProvider.cs +++ b/src/Pixeval/Download/IllustrationMetaPathMacroProvider.cs @@ -23,7 +23,7 @@ using System.Collections.Generic; using Pixeval.Download.MacroParser; using Pixeval.Download.Macros; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download { diff --git a/src/Pixeval/Download/IllustrationMetaPathParser.cs b/src/Pixeval/Download/IllustrationMetaPathParser.cs index a4f2d865..0d11c256 100644 --- a/src/Pixeval/Download/IllustrationMetaPathParser.cs +++ b/src/Pixeval/Download/IllustrationMetaPathParser.cs @@ -21,8 +21,8 @@ #endregion using Pixeval.Download.MacroParser; +using Pixeval.UserControls; using Pixeval.Utilities; -using Pixeval.ViewModel; namespace Pixeval.Download { diff --git a/src/Pixeval/Download/Macros/FileExtensionMacro.cs b/src/Pixeval/Download/Macros/FileExtensionMacro.cs index d54ad9e2..a76fde9e 100644 --- a/src/Pixeval/Download/Macros/FileExtensionMacro.cs +++ b/src/Pixeval/Download/Macros/FileExtensionMacro.cs @@ -22,8 +22,8 @@ using System; using Pixeval.Download.MacroParser; +using Pixeval.UserControls; using Pixeval.Util; -using Pixeval.ViewModel; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/IllustrationIdMacro.cs b/src/Pixeval/Download/Macros/IllustrationIdMacro.cs index f9bfd921..8b51cbda 100644 --- a/src/Pixeval/Download/Macros/IllustrationIdMacro.cs +++ b/src/Pixeval/Download/Macros/IllustrationIdMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/IllustrationTitleMacro.cs b/src/Pixeval/Download/Macros/IllustrationTitleMacro.cs index 92e4cee6..fbd0322a 100644 --- a/src/Pixeval/Download/Macros/IllustrationTitleMacro.cs +++ b/src/Pixeval/Download/Macros/IllustrationTitleMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/IllustratorIdMacro.cs b/src/Pixeval/Download/Macros/IllustratorIdMacro.cs index df2a6159..37ab64b5 100644 --- a/src/Pixeval/Download/Macros/IllustratorIdMacro.cs +++ b/src/Pixeval/Download/Macros/IllustratorIdMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/IllustratorNameMacro.cs b/src/Pixeval/Download/Macros/IllustratorNameMacro.cs index 023b5e8a..682c14a4 100644 --- a/src/Pixeval/Download/Macros/IllustratorNameMacro.cs +++ b/src/Pixeval/Download/Macros/IllustratorNameMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/IsFromSpotlightMacro.cs b/src/Pixeval/Download/Macros/IsFromSpotlightMacro.cs index 0bb9dc50..79c3d4a5 100644 --- a/src/Pixeval/Download/Macros/IsFromSpotlightMacro.cs +++ b/src/Pixeval/Download/Macros/IsFromSpotlightMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/IsMangaMacro.cs b/src/Pixeval/Download/Macros/IsMangaMacro.cs index f3f9c359..a43d9fab 100644 --- a/src/Pixeval/Download/Macros/IsMangaMacro.cs +++ b/src/Pixeval/Download/Macros/IsMangaMacro.cs @@ -21,8 +21,8 @@ #endregion using Pixeval.Download.MacroParser; +using Pixeval.UserControls; using Pixeval.Util; -using Pixeval.ViewModel; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/IsUgoiraMacro.cs b/src/Pixeval/Download/Macros/IsUgoiraMacro.cs index 74f1ba02..4427b606 100644 --- a/src/Pixeval/Download/Macros/IsUgoiraMacro.cs +++ b/src/Pixeval/Download/Macros/IsUgoiraMacro.cs @@ -21,8 +21,8 @@ #endregion using Pixeval.Download.MacroParser; +using Pixeval.UserControls; using Pixeval.Util; -using Pixeval.ViewModel; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/MangaIndexMacro.cs b/src/Pixeval/Download/Macros/MangaIndexMacro.cs index f9737535..23fa80cc 100644 --- a/src/Pixeval/Download/Macros/MangaIndexMacro.cs +++ b/src/Pixeval/Download/Macros/MangaIndexMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/SpotlightIdMacro.cs b/src/Pixeval/Download/Macros/SpotlightIdMacro.cs index 9e7ef266..b8acfac9 100644 --- a/src/Pixeval/Download/Macros/SpotlightIdMacro.cs +++ b/src/Pixeval/Download/Macros/SpotlightIdMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Download/Macros/SpotlightTitleMacro.cs b/src/Pixeval/Download/Macros/SpotlightTitleMacro.cs index e8e2eb1b..9eb981b7 100644 --- a/src/Pixeval/Download/Macros/SpotlightTitleMacro.cs +++ b/src/Pixeval/Download/Macros/SpotlightTitleMacro.cs @@ -21,7 +21,7 @@ #endregion using Pixeval.Download.MacroParser; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Download.Macros { diff --git a/src/Pixeval/Messages/NavigatingBackToMainPageMessage.cs b/src/Pixeval/Messages/NavigatingBackToMainPageMessage.cs index a3cf26e3..70334a11 100644 --- a/src/Pixeval/Messages/NavigatingBackToMainPageMessage.cs +++ b/src/Pixeval/Messages/NavigatingBackToMainPageMessage.cs @@ -22,7 +22,7 @@ using Pixeval.Pages; using Pixeval.Pages.IllustrationViewer; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Messages { diff --git a/src/Pixeval/Misc/IllustrationViewModelComparers.cs b/src/Pixeval/Misc/IllustrationViewModelComparers.cs index 485d19a7..64da0839 100644 --- a/src/Pixeval/Misc/IllustrationViewModelComparers.cs +++ b/src/Pixeval/Misc/IllustrationViewModelComparers.cs @@ -22,7 +22,7 @@ using System.Collections; using System.Collections.Generic; -using Pixeval.ViewModel; +using Pixeval.UserControls; namespace Pixeval.Misc { diff --git a/src/Pixeval/Pages/Download/DownloadListEntry.xaml b/src/Pixeval/Pages/Download/DownloadListEntry.xaml new file mode 100644 index 00000000..8bd0b5d5 --- /dev/null +++ b/src/Pixeval/Pages/Download/DownloadListEntry.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + diff --git a/src/Pixeval/Pages/Download/DownloadListEntry.xaml.cs b/src/Pixeval/Pages/Download/DownloadListEntry.xaml.cs new file mode 100644 index 00000000..75ad9fd0 --- /dev/null +++ b/src/Pixeval/Pages/Download/DownloadListEntry.xaml.cs @@ -0,0 +1,28 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace Pixeval.Pages.Download +{ + public sealed partial class DownloadListEntry : UserControl + { + public DownloadListEntry() + { + this.InitializeComponent(); + } + } +} diff --git a/src/Pixeval/Pages/Download/DownloadListOption.cs b/src/Pixeval/Pages/Download/DownloadListOption.cs new file mode 100644 index 00000000..41ca0c6c --- /dev/null +++ b/src/Pixeval/Pages/Download/DownloadListOption.cs @@ -0,0 +1,42 @@ +#region Copyright (c) Pixeval/Pixeval +// GPL v3 License +// +// Pixeval/Pixeval +// Copyright (c) 2021 Pixeval/DownloadListOptions.cs +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +#endregion + +using Pixeval.Misc; + +namespace Pixeval.Pages.Download +{ + public enum DownloadListOption + { + [LocalizedResource(typeof(DownloadListPageResources), nameof(DownloadListPageResources.DownloadListOptionAllQueued))] + AllQueued, + + [LocalizedResource(typeof(DownloadListPageResources), nameof(DownloadListPageResources.DownloadListOptionRunning))] + Running, + + [LocalizedResource(typeof(DownloadListPageResources), nameof(DownloadListPageResources.DownloadListOptionCompleted))] + Completed, + + [LocalizedResource(typeof(DownloadListPageResources), nameof(DownloadListPageResources.DownloadListOptionCancelled))] + Cancelled, + + [LocalizedResource(typeof(DownloadListPageResources), nameof(DownloadListPageResources.DownloadListOptionError))] + Error + } +} \ No newline at end of file diff --git a/src/Pixeval/Pages/Download/DownloadListPage.xaml b/src/Pixeval/Pages/Download/DownloadListPage.xaml new file mode 100644 index 00000000..e7fe9eef --- /dev/null +++ b/src/Pixeval/Pages/Download/DownloadListPage.xaml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Pixeval/Pages/Misc/DownloadListPage.xaml.cs b/src/Pixeval/Pages/Download/DownloadListPage.xaml.cs similarity index 90% rename from src/Pixeval/Pages/Misc/DownloadListPage.xaml.cs rename to src/Pixeval/Pages/Download/DownloadListPage.xaml.cs index adddcdd5..712f20cf 100644 --- a/src/Pixeval/Pages/Misc/DownloadListPage.xaml.cs +++ b/src/Pixeval/Pages/Download/DownloadListPage.xaml.cs @@ -20,10 +20,12 @@ #endregion -namespace Pixeval.Pages.Misc +namespace Pixeval.Pages.Download { public sealed partial class DownloadListPage { + private readonly DownloadListPageViewModel _viewModel = new(); + public DownloadListPage() { InitializeComponent(); diff --git a/src/Pixeval/Pages/Download/DownloadListPageViewModel.cs b/src/Pixeval/Pages/Download/DownloadListPageViewModel.cs new file mode 100644 index 00000000..94e74c84 --- /dev/null +++ b/src/Pixeval/Pages/Download/DownloadListPageViewModel.cs @@ -0,0 +1,45 @@ +#region Copyright (c) Pixeval/Pixeval +// GPL v3 License +// +// Pixeval/Pixeval +// Copyright (c) 2021 Pixeval/DownloadListPageViewModel.cs +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +#endregion + +using System; +using System.Collections.Generic; +using Microsoft.Toolkit.Mvvm.ComponentModel; +using Pixeval.Misc; + +namespace Pixeval.Pages.Download +{ + public class DownloadListPageViewModel : ObservableObject + { + private DownloadListOption _currentOption; + + public DownloadListOption CurrentOption + { + get => _currentOption; + set => SetProperty(ref _currentOption, value); + } + + public static readonly IEnumerable AvailableDownloadListOptions = Enum.GetValues(); + + public string? SubtitleText(DownloadListOption option) + { + return option.GetLocalizedResourceContent(); + } + } +} \ No newline at end of file diff --git a/src/Pixeval/ViewModel/CommentBlockViewModel.cs b/src/Pixeval/Pages/IllustrationViewer/CommentBlockViewModel.cs similarity index 98% rename from src/Pixeval/ViewModel/CommentBlockViewModel.cs rename to src/Pixeval/Pages/IllustrationViewer/CommentBlockViewModel.cs index 2ae9ea05..b6524d9d 100644 --- a/src/Pixeval/ViewModel/CommentBlockViewModel.cs +++ b/src/Pixeval/Pages/IllustrationViewer/CommentBlockViewModel.cs @@ -36,7 +36,7 @@ using Pixeval.Util.IO; using Pixeval.Util.UI; using Pixeval.Utilities; -namespace Pixeval.ViewModel +namespace Pixeval.Pages.IllustrationViewer { public class CommentBlockViewModel { diff --git a/src/Pixeval/ViewModel/CommentRepliesBlockViewModel.cs b/src/Pixeval/Pages/IllustrationViewer/CommentRepliesBlockViewModel.cs similarity index 96% rename from src/Pixeval/ViewModel/CommentRepliesBlockViewModel.cs rename to src/Pixeval/Pages/IllustrationViewer/CommentRepliesBlockViewModel.cs index 262775ca..01b51904 100644 --- a/src/Pixeval/ViewModel/CommentRepliesBlockViewModel.cs +++ b/src/Pixeval/Pages/IllustrationViewer/CommentRepliesBlockViewModel.cs @@ -22,7 +22,7 @@ using Microsoft.Toolkit.Mvvm.ComponentModel; -namespace Pixeval.ViewModel +namespace Pixeval.Pages.IllustrationViewer { public class CommentRepliesBlockViewModel : ObservableObject { diff --git a/src/Pixeval/Pages/IllustrationViewer/CommentsIncrementalSource.cs b/src/Pixeval/Pages/IllustrationViewer/CommentsIncrementalSource.cs index 8a61b267..2388c084 100644 --- a/src/Pixeval/Pages/IllustrationViewer/CommentsIncrementalSource.cs +++ b/src/Pixeval/Pages/IllustrationViewer/CommentsIncrementalSource.cs @@ -25,7 +25,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Pixeval.CommunityToolkit.IncrementalLoadingCollection; -using Pixeval.ViewModel; namespace Pixeval.Pages.IllustrationViewer { diff --git a/src/Pixeval/Pages/IllustrationViewer/CommentsPage.xaml.cs b/src/Pixeval/Pages/IllustrationViewer/CommentsPage.xaml.cs index 2c4559de..500af3cf 100644 --- a/src/Pixeval/Pages/IllustrationViewer/CommentsPage.xaml.cs +++ b/src/Pixeval/Pages/IllustrationViewer/CommentsPage.xaml.cs @@ -36,7 +36,6 @@ using Pixeval.CoreApi.Net.Response; using Pixeval.Messages; using Pixeval.UserControls; using Pixeval.Util.IO; -using Pixeval.ViewModel; namespace Pixeval.Pages.IllustrationViewer { diff --git a/src/Pixeval/Pages/IllustrationViewer/IllustrationInfoPage.xaml.cs b/src/Pixeval/Pages/IllustrationViewer/IllustrationInfoPage.xaml.cs index 7555618e..a75e8cef 100644 --- a/src/Pixeval/Pages/IllustrationViewer/IllustrationInfoPage.xaml.cs +++ b/src/Pixeval/Pages/IllustrationViewer/IllustrationInfoPage.xaml.cs @@ -35,7 +35,6 @@ using Pixeval.CommunityToolkit.Markdown.MarkdownTextBlock; using Pixeval.CoreApi.Model; using Pixeval.Messages; using Pixeval.Utilities; -using Pixeval.ViewModel; using ReverseMarkdown; namespace Pixeval.Pages.IllustrationViewer diff --git a/src/Pixeval/Pages/IllustrationViewer/IllustrationViewerPage.xaml.cs b/src/Pixeval/Pages/IllustrationViewer/IllustrationViewerPage.xaml.cs index 0bf32296..bc323e72 100644 --- a/src/Pixeval/Pages/IllustrationViewer/IllustrationViewerPage.xaml.cs +++ b/src/Pixeval/Pages/IllustrationViewer/IllustrationViewerPage.xaml.cs @@ -34,11 +34,11 @@ using Pixeval.Messages; using Pixeval.Misc; using Pixeval.Options; using Pixeval.Popups; +using Pixeval.UserControls; using Pixeval.Util; using Pixeval.Util.IO; using Pixeval.Util.UI; using Pixeval.Utilities; -using Pixeval.ViewModel; namespace Pixeval.Pages.IllustrationViewer { diff --git a/src/Pixeval/ViewModel/IllustrationViewerPageViewModel.cs b/src/Pixeval/Pages/IllustrationViewer/IllustrationViewerPageViewModel.cs similarity index 99% rename from src/Pixeval/ViewModel/IllustrationViewerPageViewModel.cs rename to src/Pixeval/Pages/IllustrationViewer/IllustrationViewerPageViewModel.cs index 3664d0aa..4982d0e9 100644 --- a/src/Pixeval/ViewModel/IllustrationViewerPageViewModel.cs +++ b/src/Pixeval/Pages/IllustrationViewer/IllustrationViewerPageViewModel.cs @@ -41,7 +41,7 @@ using Pixeval.Util.UI; using Pixeval.Utilities; using QRCoder; -namespace Pixeval.ViewModel +namespace Pixeval.Pages.IllustrationViewer { public class IllustrationViewerPageViewModel : ObservableObject, IDisposable { diff --git a/src/Pixeval/Pages/IllustrationViewer/ImageViewerPage.xaml.cs b/src/Pixeval/Pages/IllustrationViewer/ImageViewerPage.xaml.cs index acc8fb30..3c3e70b4 100644 --- a/src/Pixeval/Pages/IllustrationViewer/ImageViewerPage.xaml.cs +++ b/src/Pixeval/Pages/IllustrationViewer/ImageViewerPage.xaml.cs @@ -30,7 +30,6 @@ using Microsoft.UI.Xaml.Media.Animation; using Microsoft.UI.Xaml.Navigation; using Pixeval.Util.UI; using Pixeval.Utilities; -using Pixeval.ViewModel; namespace Pixeval.Pages.IllustrationViewer { diff --git a/src/Pixeval/ViewModel/ImageViewerPageViewModel.cs b/src/Pixeval/Pages/IllustrationViewer/ImageViewerPageViewModel.cs similarity index 99% rename from src/Pixeval/ViewModel/ImageViewerPageViewModel.cs rename to src/Pixeval/Pages/IllustrationViewer/ImageViewerPageViewModel.cs index e4ba083b..87e9a20f 100644 --- a/src/Pixeval/ViewModel/ImageViewerPageViewModel.cs +++ b/src/Pixeval/Pages/IllustrationViewer/ImageViewerPageViewModel.cs @@ -30,12 +30,12 @@ using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Media.Imaging; using Pixeval.CoreApi.Net; using Pixeval.Misc; -using Pixeval.Pages.IllustrationViewer; +using Pixeval.UserControls; using Pixeval.Util; using Pixeval.Util.IO; using Pixeval.Utilities; -namespace Pixeval.ViewModel +namespace Pixeval.Pages.IllustrationViewer { public class ImageViewerPageViewModel : ObservableObject, IDisposable { diff --git a/src/Pixeval/Pages/IllustrationViewer/PixivReplyEmojiListPage.xaml b/src/Pixeval/Pages/IllustrationViewer/PixivReplyEmojiListPage.xaml index 6c721d8d..13af6fae 100644 --- a/src/Pixeval/Pages/IllustrationViewer/PixivReplyEmojiListPage.xaml +++ b/src/Pixeval/Pages/IllustrationViewer/PixivReplyEmojiListPage.xaml @@ -4,7 +4,6 @@ xmlns:controls="using:Pixeval.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:viewModel="using:Pixeval.ViewModel" xmlns:viewer="using:Pixeval.Pages.IllustrationViewer" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" mc:Ignorable="d"> @@ -12,7 +11,7 @@ ItemsSource="{x:Bind viewer:PixivReplyEmojiListPage.EmojiList}" SelectionMode="None"> - + @@ -13,7 +12,7 @@ ItemsSource="{x:Bind viewer:PixivReplyStickerListPage.Stickers}" SelectionMode="None"> - + { diff --git a/src/Pixeval/Pages/Misc/DownloadListPage.xaml b/src/Pixeval/Pages/Misc/DownloadListPage.xaml deleted file mode 100644 index be364ee1..00000000 --- a/src/Pixeval/Pages/Misc/DownloadListPage.xaml +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/src/Pixeval/Pages/Misc/LoginPage.xaml b/src/Pixeval/Pages/Misc/LoginPage.xaml index 883d18d0..716d05d6 100644 --- a/src/Pixeval/Pages/Misc/LoginPage.xaml +++ b/src/Pixeval/Pages/Misc/LoginPage.xaml @@ -5,8 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:misc="using:Pixeval.Misc" - xmlns:viewModel="using:Pixeval.ViewModel" - d:DataContext="{d:DesignInstance viewModel:LoginPageViewModel}" + xmlns:misc1="using:Pixeval.Pages.Misc" + d:DataContext="{d:DesignInstance misc1:LoginPageViewModel}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Loaded="LoginPage_OnLoaded" mc:Ignorable="d"> diff --git a/src/Pixeval/Pages/Misc/LoginPage.xaml.cs b/src/Pixeval/Pages/Misc/LoginPage.xaml.cs index 75643224..dc0ea123 100644 --- a/src/Pixeval/Pages/Misc/LoginPage.xaml.cs +++ b/src/Pixeval/Pages/Misc/LoginPage.xaml.cs @@ -31,7 +31,6 @@ using Microsoft.UI.Xaml.Navigation; using Pixeval.Messages; using Pixeval.Util.UI; using Pixeval.Utilities; -using Pixeval.ViewModel; namespace Pixeval.Pages.Misc { diff --git a/src/Pixeval/ViewModel/LoginPageViewModel.cs b/src/Pixeval/Pages/Misc/LoginPageViewModel.cs similarity index 99% rename from src/Pixeval/ViewModel/LoginPageViewModel.cs rename to src/Pixeval/Pages/Misc/LoginPageViewModel.cs index d96adf01..4c15d152 100644 --- a/src/Pixeval/ViewModel/LoginPageViewModel.cs +++ b/src/Pixeval/Pages/Misc/LoginPageViewModel.cs @@ -45,7 +45,7 @@ using Pixeval.Util.IO; using Pixeval.Util.UI; using Pixeval.Utilities; -namespace Pixeval.ViewModel +namespace Pixeval.Pages.Misc { public class LoginPageViewModel : AutoActivateObservableRecipient, IRecipient, diff --git a/src/Pixeval/Pages/Misc/SettingsPage.xaml b/src/Pixeval/Pages/Misc/SettingsPage.xaml index da02cd03..d3dd1895 100644 --- a/src/Pixeval/Pages/Misc/SettingsPage.xaml +++ b/src/Pixeval/Pages/Misc/SettingsPage.xaml @@ -35,7 +35,7 @@ - + @@ -145,10 +144,10 @@ + Icon="{ui:FontIcon Glyph=ColorE790}" + ItemsSource="{x:Bind model:ApplicationThemeSettingEntryItem.AvailableItems}" + SelectedItem="{x:Bind _viewModel.Theme, Mode=TwoWay}" + SelectionChanged="SingleSelectionSettingEntry_OnSelectionChanged"> @@ -162,10 +161,9 @@ - + - + - + - + - + - + @@ -248,24 +241,21 @@ - + - + - + @@ -309,9 +299,8 @@ - + - + TestParser = new(); diff --git a/src/Pixeval/Pixeval.csproj b/src/Pixeval/Pixeval.csproj index 78811997..3d5c42f3 100644 --- a/src/Pixeval/Pixeval.csproj +++ b/src/Pixeval/Pixeval.csproj @@ -79,6 +79,7 @@ + @@ -192,7 +193,7 @@ - + MSBuild:Compile @@ -290,6 +291,9 @@ MSBuild:Compile + + MSBuild:Compile + MSBuild:Compile diff --git a/src/Pixeval/Popups/CommentRepliesBlock.xaml b/src/Pixeval/Popups/CommentRepliesBlock.xaml index 8f93633b..576eda9a 100644 --- a/src/Pixeval/Popups/CommentRepliesBlock.xaml +++ b/src/Pixeval/Popups/CommentRepliesBlock.xaml @@ -27,7 +27,7 @@ + Style="{StaticResource TitleTextBlockStyle}" />