diff --git a/Pixeval.sln.DotSettings b/Pixeval.sln.DotSettings
new file mode 100644
index 00000000..77e3c871
--- /dev/null
+++ b/Pixeval.sln.DotSettings
@@ -0,0 +1,2 @@
+
+ True
\ No newline at end of file
diff --git a/src/Pixeval.Interchange/Program.cs b/src/Pixeval.Interchange/Program.cs
index 5df64475..f4afeb7b 100644
--- a/src/Pixeval.Interchange/Program.cs
+++ b/src/Pixeval.Interchange/Program.cs
@@ -60,7 +60,6 @@ namespace Pixeval.Interchange
}
}
}
-
private static bool PixevalInstanceRunning()
{
return Process.GetProcessesByName("Pixeval").Length > 0;
diff --git a/src/Pixeval/App.xaml b/src/Pixeval/App.xaml
index 45c9c496..fb4a756c 100644
--- a/src/Pixeval/App.xaml
+++ b/src/Pixeval/App.xaml
@@ -15,7 +15,8 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .-->
- .-->
-
-
-
-
+
+
+
+
2
+
@@ -49,6 +49,7 @@ along with this program. If not, see .-->
+
-
-
+
-
+
+ ToolTip="{Binding Path=(i18N:AkaI18N.IllustBrowserViewInBrowser)}" />
-
+ ToolTip="{Binding Path=(i18N:AkaI18N.IllustBrowserDownload)}" />
-
+ ToolTip="{Binding Path=(i18N:AkaI18N.IllustBrowserPrivateBookmark)}" />
-
-
@@ -1681,14 +2276,20 @@ along with this program. If not, see .-->
-
-
+
diff --git a/src/Pixeval/UI/MainWindow.xaml.cs b/src/Pixeval/UI/MainWindow.xaml.cs
index 7194a58d..c9d3f9b9 100644
--- a/src/Pixeval/UI/MainWindow.xaml.cs
+++ b/src/Pixeval/UI/MainWindow.xaml.cs
@@ -19,10 +19,8 @@
#endregion
using System;
-using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -73,9 +71,6 @@ namespace Pixeval.UI
IgnoreDuplicate = true
};
- private readonly ConcurrentDictionary dataContextHolder =
- new ConcurrentDictionary();
-
public MainWindow()
{
Instance = this;
@@ -85,9 +80,6 @@ namespace Pixeval.UI
if (Dispatcher != null) Dispatcher.UnhandledException += Dispatcher_UnhandledException;
- var property = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(ListBox));
- property?.AddValueChanged(ImageListView, (sender, args) => dataContextHolder.Clear());
-
#pragma warning disable 4014
AcquireRecommendUser();
#pragma warning restore 4014
@@ -266,7 +258,6 @@ namespace Pixeval.UI
private void RecommendIllustratorContainer_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
SetUserBrowserContext(sender.GetDataContext());
- OpenUserBrowser();
}
private async void MainWindow_OnKeyDown(object sender, KeyEventArgs e)
@@ -557,8 +548,8 @@ namespace Pixeval.UI
if (dataContext != null && Uri.IsWellFormedUriString(dataContext.Thumbnail, UriKind.Absolute))
{
- dataContextHolder.TryAdd(sender, dataContext);
- await dataContext.LoadAndCacheThumbnailImageToControl(sender);
+ if(dataContext.Thumbnail != null && Uri.IsWellFormedUriString(dataContext.Thumbnail, UriKind.Absolute))
+ SetImageSource(sender, await PixivIO.FromUrl(dataContext.Thumbnail));
}
StartDoubleAnimationUseCubicEase(sender, "(Image.Opacity)", 0, 1, 800);
@@ -568,13 +559,6 @@ namespace Pixeval.UI
private void Thumbnail_OnUnloaded(object sender, RoutedEventArgs e)
{
- if (Settings.Global.UseCache)
- if (dataContextHolder.TryGetValue(sender, out var illust))
- {
- var bitmapImage = (BitmapImage) ((Image) sender).Source;
- AppContext.DefaultCacheProvider.Attach(ref bitmapImage, illust);
- }
-
ReleaseImage(sender);
}
@@ -641,7 +625,15 @@ namespace Pixeval.UI
private void DownloadNowMenuItem_OnClick(object sender, RoutedEventArgs e)
{
- DownloadManager.EnqueueDownloadItem(sender.GetDataContext());
+ DownloadOption option = null;
+ if (BrowsingUser() && IsAtUploadCheckerPosition())
+ {
+ option = new DownloadOption
+ {
+ CreateNewWhenFromUser = Settings.Global.CreateNewFolderWhenDownloadFromUser
+ };
+ }
+ DownloadManager.EnqueueDownloadItem(sender.GetDataContext(), option);
MessageQueue.Enqueue(AkaI18N.QueuedDownload);
}
@@ -656,16 +648,28 @@ namespace Pixeval.UI
if (fileDialog.ShowDialog() == CommonFileDialogResult.Ok)
{
- DownloadManager.EnqueueDownloadItem(sender.GetDataContext(), fileDialog.FileName);
+ DownloadManager.EnqueueDownloadItem(sender.GetDataContext(), new DownloadOption {RootDirectory = fileDialog.FileName});
MessageQueue.Enqueue(AkaI18N.QueuedDownload);
}
}
- private void DownloadAllNowMenuItem_OnClick(object sender, RoutedEventArgs e)
+ private async void DownloadAllNowMenuItem_OnClick(object sender, RoutedEventArgs e)
{
- foreach (var illustration in GetImageSourceCopy())
- if (illustration != null)
- DownloadManager.EnqueueDownloadItem(illustration);
+ DownloadOption option = null;
+ if (BrowsingUser() && IsAtUploadCheckerPosition())
+ {
+ option = new DownloadOption
+ {
+ CreateNewWhenFromUser = Settings.Global.CreateNewFolderWhenDownloadFromUser
+ };
+ }
+
+ await Task.Run(() =>
+ {
+ foreach (var illustration in GetImageSourceCopy())
+ if (illustration != null)
+ DownloadManager.EnqueueDownloadItem(illustration, option);
+ });
MessageQueue.Enqueue(AkaI18N.QueuedAllToDownload);
}
@@ -673,6 +677,14 @@ namespace Pixeval.UI
#region 用户预览
+ private void Timeline_OnCompleted(object sender, EventArgs e)
+ {
+ UserBrowserPageScrollViewer.DataContext = null;
+ ReleaseImage(UserBanner);
+ ReleaseImage(UserBrowserUserAvatar);
+ ReleaseItemsSource(UserIllustsImageListView);
+ }
+
private async void PrivateFollow_OnClick(object sender, RoutedEventArgs e)
{
var usr = sender.GetDataContext();
@@ -829,14 +841,6 @@ namespace Pixeval.UI
return CheckerSnackBar.HorizontalAlignment == HorizontalAlignment.Left && CheckerSnackBar.Width.Equals(120);
}
- private void BackToMainPageButton_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- UserBrowserPageScrollViewer.DataContext = null;
- ReleaseImage(UserBanner);
- ReleaseImage(UserBrowserUserAvatar);
- ReleaseItemsSource(UserIllustsImageListView);
- }
-
private async void FollowButton_OnClick(object sender, RoutedEventArgs e)
{
var usr = sender.GetDataContext();
@@ -1170,12 +1174,7 @@ namespace Pixeval.UI
public void OpenUserBrowser()
{
- this.GetResources("UserBrowserOpacityIncreaseAnimation").Begin();
- this.GetResources("UserBrowserScaleXIncreaseAnimation").Begin();
- this.GetResources("UserBrowserScaleYIncreaseAnimation").Begin();
- this.GetResources("ContentContainerOpacityIncreaseAnimation").Begin();
- this.GetResources("ContentContainerScaleXIncreaseAnimation").Begin();
- this.GetResources("ContentContainerScaleYIncreaseAnimation").Begin();
+ this.GetResources("OpenUserBrowserAnimation").Begin();
}
public async void OpenIllustBrowser(Illustration illustration, bool record = true)
diff --git a/src/Pixeval/UI/SignIn.xaml b/src/Pixeval/UI/SignIn.xaml
index cb29e637..f022c6cd 100644
--- a/src/Pixeval/UI/SignIn.xaml
+++ b/src/Pixeval/UI/SignIn.xaml
@@ -15,15 +15,11 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .-->
-
@@ -35,8 +31,7 @@ along with this program. If not, see .-->
-
@@ -50,16 +45,15 @@ along with this program. If not, see .-->
+ Watermark="{Binding Path=(i18N:AkaI18N.SignInAccount)}" />
+ Watermark="{Binding Path=(i18N:AkaI18N.SignInPassword)}" />
.-->
-
+
@@ -83,10 +77,8 @@ along with this program. If not, see .-->
IsOpen="False"
Style="{DynamicResource MaterialDesignEmbeddedDialogHost}">
-
+
diff --git a/src/Pixeval/UI/UserControls/DownloadQueue.xaml b/src/Pixeval/UI/UserControls/DownloadQueue.xaml
index 7b6e401a..e15f1d04 100644
--- a/src/Pixeval/UI/UserControls/DownloadQueue.xaml
+++ b/src/Pixeval/UI/UserControls/DownloadQueue.xaml
@@ -15,17 +15,10 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .-->
-
@@ -45,17 +38,14 @@ along with this program. If not, see .-->
-
+
-
-
+
+
@@ -74,13 +64,10 @@ along with this program. If not, see .-->
Foreground="#007CEE" Maximum="1"
Style="{StaticResource RoundedCornerProgressBar}"
Value="{Binding Progress}" />
-
-
-
+
+
.-->
@@ -110,10 +95,8 @@ along with this program. If not, see .-->
-
-
+
+
@@ -132,13 +115,10 @@ along with this program. If not, see .-->
Foreground="#007CEE" Maximum="1"
Style="{StaticResource RoundedCornerProgressBar}"
Value="{Binding Progress}" />
-
-
-
+
+
.-->
Cursor="Hand" MouseLeftButtonDown="ViewDownloadLocationButton_OnMouseLeftButtonDown">
-
+
@@ -168,13 +146,10 @@ along with this program. If not, see .-->
-
@@ -219,12 +194,9 @@ along with this program. If not, see .-->
-
-
-
+
+
+
@@ -234,7 +206,7 @@ along with this program. If not, see .-->
+ Text="{Binding Path=(i18N:AkaI18N.DownloadQueueDownloading)}" />
.-->
+ Text="{Binding Path=(i18N:AkaI18N.DownloadQueueEmptyNotifier)}" />
@@ -259,7 +231,7 @@ along with this program. If not, see .-->
+ Text="{Binding Path=(i18N:AkaI18N.DownloadQueueDownloaded)}" />
.-->
+ Text="{Binding Path=(i18N:AkaI18N.DownloadQueueEmptyNotifier)}" />
@@ -284,15 +256,13 @@ along with this program. If not, see .-->
+ Text="{Binding Path=(i18N:AkaI18N.DownloadQueueBrowsingHistory)}" />
+ ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled" VirtualizingPanel.CacheLength="0 0"
+ VirtualizingPanel.CacheLengthUnit="Pixel" VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.VirtualizationMode="Standard">
@@ -304,7 +274,7 @@ along with this program. If not, see .-->
+ Text="{Binding Path=(i18N:AkaI18N.DownloadQueueHistoryListIsEmpty)}" />
diff --git a/src/Pixeval/UI/UserControls/DownloadQueue.xaml.cs b/src/Pixeval/UI/UserControls/DownloadQueue.xaml.cs
index da3b5bda..b42071e0 100644
--- a/src/Pixeval/UI/UserControls/DownloadQueue.xaml.cs
+++ b/src/Pixeval/UI/UserControls/DownloadQueue.xaml.cs
@@ -77,7 +77,7 @@ namespace Pixeval.UI.UserControls
private void ViewDownloadLocationButton_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var model = sender.GetDataContext();
- if (!model.GetPath().IsNullOrEmpty() && Path.GetDirectoryName(model.GetPath()) is var p)
+ if (!model.GetPath().IsNullOrEmpty() && Path.GetDirectoryName(model.GetPath()) is var _)
{
var processInfo = new ProcessStartInfo
{
diff --git a/src/Pixeval/UI/UserControls/IllustPresenter.xaml b/src/Pixeval/UI/UserControls/IllustPresenter.xaml
index 73fd74a9..fd5c95bc 100644
--- a/src/Pixeval/UI/UserControls/IllustPresenter.xaml
+++ b/src/Pixeval/UI/UserControls/IllustPresenter.xaml
@@ -15,11 +15,8 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .-->
-
@@ -30,15 +27,14 @@ along with this program. If not, see .-->
Stretch="Uniform">
-
+
-
+
.-->
.-->
-
@@ -32,7 +27,7 @@ along with this program. If not, see .-->
materialDesign:ShadowAssist.Darken="True" materialDesign:ShadowAssist.ShadowDepth="Depth3">
diff --git a/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml b/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml
index f729a485..8a92acc8 100644
--- a/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml
+++ b/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml
@@ -22,10 +22,12 @@ along with this program. If not, see .-->
xmlns:i18N="clr-namespace:Pixeval.Objects.I18n"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:pixeval="clr-namespace:Pixeval"
xmlns:valueConverters="clr-namespace:Pixeval.Objects.ValueConverters"
xmlns:viewModel="clr-namespace:Pixeval.Data.ViewModel"
d:DataContext="{d:DesignData Settings}"
- TextElement.FontFamily="Microsoft YaHei Light" mc:Ignorable="d">
+ TextElement.FontFamily="Microsoft YaHei Light"
+ mc:Ignorable="d">
@@ -44,11 +46,14 @@ along with this program. If not, see .-->
-
+
-
+
@@ -72,122 +77,194 @@ along with this program. If not, see .-->
-
-
+
-
-
+
-
-
+
-
-
+
+
+
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
+
+
+
+
-
-
+
-
+
-
-
-
-
+
+ ToolTip="{Binding Path=(i18N:AkaI18N.TurnOnWebR18)}" />
diff --git a/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml.cs b/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml.cs
index 256ab899..969213e2 100644
--- a/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml.cs
+++ b/src/Pixeval/UI/UserControls/PixevalSettingPage.xaml.cs
@@ -21,15 +21,13 @@
using System;
using System.Collections.Generic;
using System.Windows;
+using System.Windows.Controls;
using System.Windows.Input;
-using System.Windows.Media.Imaging;
using Microsoft.WindowsAPICodePack.Dialogs;
using Pixeval.Core;
using Pixeval.Data.ViewModel;
-using Pixeval.Objects.Caching;
using Pixeval.Objects.Generic;
using Pixeval.Objects.I18n;
-using Pixeval.Objects.Primitive;
using Pixeval.Persisting;
namespace Pixeval.UI.UserControls
@@ -84,20 +82,6 @@ namespace Pixeval.UI.UserControls
Settings.Global.IncludeTag = new HashSet(text);
}
- private void ChangeCachingPolicyToggleButton_OnChecked(object sender, RoutedEventArgs e)
- {
- AppContext.DefaultCacheProvider.Clear();
- AppContext.DefaultCacheProvider = new FileCache(AppContext.CacheFolder,
- image => image.ToStream(),
- InternalIO.CreateBitmapImageFromStream);
- }
-
- private void ChangeCachingPolicyToggleButton_OnUnchecked(object sender, RoutedEventArgs e)
- {
- AppContext.DefaultCacheProvider.Clear();
- AppContext.DefaultCacheProvider = MemoryCache.Shared;
- }
-
private async void OpenWebApiR18Button_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
MainWindow.MessageQueue.Enqueue(AkaI18N.TryingToToggleR18Switch);
@@ -105,5 +89,10 @@ namespace Pixeval.UI.UserControls
? AkaI18N.ToggleR18OnSuccess
: AkaI18N.ToggleR18OnFailed);
}
+
+ private void CultureSelector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ AkaI18N.Reload((I18nOption) CultureSelector.SelectedItem);
+ }
}
}
\ No newline at end of file
diff --git a/src/Pixeval/UI/UserControls/SauceNAOHomePage.xaml b/src/Pixeval/UI/UserControls/SauceNAOHomePage.xaml
index f439250b..48c2cb6c 100644
--- a/src/Pixeval/UI/UserControls/SauceNAOHomePage.xaml
+++ b/src/Pixeval/UI/UserControls/SauceNAOHomePage.xaml
@@ -37,13 +37,13 @@ along with this program. If not, see .-->
+ ToolTip="{Binding Path=(i18N:AkaI18N.SauceNaoUploadAndSearch)}">
-
+
-
+
diff --git a/src/pixeval-backend/.idea/workspace.xml b/src/pixeval-backend/.idea/workspace.xml
index 15b4ba88..7f164012 100644
--- a/src/pixeval-backend/.idea/workspace.xml
+++ b/src/pixeval-backend/.idea/workspace.xml
@@ -20,33 +20,40 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
+
+
@@ -101,7 +108,7 @@
-
+
@@ -220,6 +227,8 @@
+
+
@@ -291,11 +300,11 @@
-
+
-
+