Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PixivFSUWP/BigImage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<InkToolbarStencilButton/>
</InkToolbar>
</CommandBar.Content>
<AppBarButton x:Name="btnSetWallpaper" Icon="SetLockScreen" x:Uid="SetWallpaper" Label="设置为壁纸" Click="btnSetWallpaper_Click"/>
<AppBarButton x:Name="btnSetWallpaper" Icon="SetLockScreen" x:Uid="SetWallpaper" Click="btnSetWallpaper_Click" />
<AppBarButton x:Name="btnSaveImage" Icon="Save" x:Uid="SaveImage" Click="BtnSaveImage_Click"/>
<AppBarToggleButton x:Name="btnDraw" Icon="Edit" x:Uid="Draw" Unchecked="BtnDraw_Unchecked" Checked="BtnDraw_Checked"/>
</CommandBar>
Expand Down
22 changes: 16 additions & 6 deletions PixivFSUWP/BigImage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,29 @@ private async void btnSetWallpaper_Click(object sender, RoutedEventArgs e)
if (UserProfilePersonalizationSettings.IsSupported())
{
UserProfilePersonalizationSettings settings = UserProfilePersonalizationSettings.Current;
StorageFile cacheFile = await CacheManager.GetCachedFileAsync(parameter.FileName);
StorageFile file = await cacheFile.CopyAsync(ApplicationData.Current.LocalFolder, "WallpaperImage", NameCollisionOption.ReplaceExisting);
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("WallpaperImage", CreationCollisionOption.ReplaceExisting);
using (var stream = await file.OpenAsync(FileAccessMode.ReadWrite))
{
var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, stream);
var image = mainImg.Source as WriteableBitmap;
var imageStream = image.PixelBuffer.AsStream();
byte[] raw = new byte[imageStream.Length];
await imageStream.ReadAsync(raw, 0, raw.Length);
encoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore,
(uint)image.PixelWidth, (uint)image.PixelHeight, 96, 96, raw);
await encoder.FlushAsync();
}
if (!await settings.TrySetWallpaperImageAsync(file))
{
var messageDialog = new MessageDialog("更换壁纸失败");
var messageDialog = new MessageDialog(GetResourceString("WallpaperFailed"));
await messageDialog.ShowAsync();
}
else
await ShowTip("已更换壁纸");
await ShowTip(GetResourceString("WallpaperSuccess"));
}
else
{
var messageDialog = new MessageDialog("您的设备不支持更换壁纸");
var messageDialog = new MessageDialog("WallpaperNotSupport");
await messageDialog.ShowAsync();
}
}
Expand Down Expand Up @@ -183,7 +193,7 @@ public async Task ShowTip(string Message, int Seconds = 3)
}

private async Task saveImage()
{
{
FileSavePicker picker = new FileSavePicker();
picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
picker.FileTypeChoices.Add(GetResourceString("ImageFilePlain"), new List<string>() { ".png" });
Expand Down
20 changes: 20 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,26 @@ Do you want to disable them?</target>
<target state="new">Download Manager</target>
<note from="MultilingualBuild" annotates="source" priority="2">NavigationViewItemHeader</note>
</trans-unit>
<trans-unit id="WallpaperFailedPlain" translate="yes" xml:space="preserve">
<source>Failed to change wallpaper</source>
<target state="translated">壁紙が変更できません</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="WallpaperNotSupportPlain" translate="yes" xml:space="preserve">
<source>Your device does not support changing the wallpaper</source>
<target state="translated">お使いのデバイスは壁紙の変更をサポートしていません</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="WallpaperSuccessPlain" translate="yes" xml:space="preserve">
<source>Wallpaper changed</source>
<target state="translated">壁紙を変更しました</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="SetWallpaper.Label" translate="yes" xml:space="preserve">
<source>Set as Wallpaper</source>
<target state="translated">壁紙に設定する</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
20 changes: 20 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,26 @@ Do you want to disable them?</source>
<target state="new">Download Manager</target>
<note from="MultilingualBuild" annotates="source" priority="2">NavigationViewItemHeader</note>
</trans-unit>
<trans-unit id="WallpaperFailedPlain" translate="yes" xml:space="preserve">
<source>Failed to change wallpaper</source>
<target state="translated">更换壁纸失败</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="WallpaperNotSupportPlain" translate="yes" xml:space="preserve">
<source>Your device does not support changing the wallpaper</source>
<target state="translated">您的设备不支持更换壁纸</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="WallpaperSuccessPlain" translate="yes" xml:space="preserve">
<source>Wallpaper changed</source>
<target state="translated">壁纸已更换</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="SetWallpaper.Label" translate="yes" xml:space="preserve">
<source>Set as Wallpaper</source>
<target state="translated">设为壁纸</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
20 changes: 20 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,26 @@ Do you want to disable them?</source>
<target state="new">Download Manager</target>
<note from="MultilingualBuild" annotates="source" priority="2">NavigationViewItemHeader</note>
</trans-unit>
<trans-unit id="WallpaperFailedPlain" translate="yes" xml:space="preserve">
<source>Failed to change wallpaper</source>
<target state="new">Failed to change wallpaper</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="WallpaperNotSupportPlain" translate="yes" xml:space="preserve">
<source>Your device does not support changing the wallpaper</source>
<target state="new">Your device does not support changing the wallpaper</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="WallpaperSuccessPlain" translate="yes" xml:space="preserve">
<source>Wallpaper changed</source>
<target state="new">Wallpaper changed</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
<trans-unit id="SetWallpaper.Label" translate="yes" xml:space="preserve">
<source>Set as Wallpaper</source>
<target state="new">Set as Wallpaper</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
16 changes: 16 additions & 0 deletions PixivFSUWP/Strings/en/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ Do you want to disable them?</value>
<value>Settings</value>
<comment>PlainText</comment>
</data>
<data name="SetWallpaper.Label" xml:space="preserve">
<value>Set as Wallpaper</value>
<comment>PlainText</comment>
</data>
<data name="Sex.Text" xml:space="preserve">
<value>Sex</value>
<comment>TextBlock</comment>
Expand Down Expand Up @@ -734,6 +738,18 @@ Do you want to disable them?</value>
<value>Version information</value>
<comment>TextBlock</comment>
</data>
<data name="WallpaperFailedPlain" xml:space="preserve">
<value>Failed to change wallpaper</value>
<comment>PlainText</comment>
</data>
<data name="WallpaperNotSupportPlain" xml:space="preserve">
<value>Your device does not support changing the wallpaper</value>
<comment>PlainText</comment>
</data>
<data name="WallpaperSuccessPlain" xml:space="preserve">
<value>Wallpaper changed</value>
<comment>PlainText</comment>
</data>
<data name="Work.Text" xml:space="preserve">
<value>Works</value>
<comment>TextBlock</comment>
Expand Down
54 changes: 19 additions & 35 deletions PixivFSUWP/Strings/ja/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<comment>TextBlock</comment>
</data>
<data name="BookmarkDeleteFailedPlain" xml:space="preserve">
<value>ブックマークから「{0}」を削除できません</value>
<value>「{0}」をブックマークから解除できません</value>
<comment>PlainText</comment>
</data>
<data name="Bookmarked.Content" xml:space="preserve">
Expand Down Expand Up @@ -53,7 +53,7 @@
<comment>PlainText</comment>
</data>
<data name="Chair.Text" xml:space="preserve">
<value>チェア</value>
<value>椅子</value>
<comment>TextBlock</comment>
</data>
<data name="CommentsPlain" xml:space="preserve">
Expand All @@ -77,11 +77,11 @@
<comment>ComboBoxItem</comment>
</data>
<data name="DeleteBookmarkPlain" xml:space="preserve">
<value>ブックマーク削除</value>
<value>ブックマーク解除</value>
<comment>PlainText</comment>
</data>
<data name="DeletedBookmarkPlain" xml:space="preserve">
<value>ブックマークから「{0}」を削除しました</value>
<value>「{0}」をブックマークから解除しました</value>
<comment>PlainText</comment>
</data>
<data name="Desk.Text" xml:space="preserve">
Expand Down Expand Up @@ -173,7 +173,7 @@
<comment>PlainText</comment>
</data>
<data name="LoadingStatusPlain" xml:space="preserve">
<value>{0}/{1} を読み込む中</value>
<value>{0}/{1}を読み込む中</value>
<comment>PlainText</comment>
</data>
<data name="LoggingIn.Text" xml:space="preserve">
Expand All @@ -189,15 +189,15 @@
<comment>TextBlock</comment>
</data>
<data name="LoginFailed.Content" xml:space="preserve">
<value>ログインできません。トラブルシューティングを行うか、もう一度やり直してください。</value>
<value>ログインできません。トラブルシューティングを行い、もう一度やり直してください。</value>
<comment>Button</comment>
</data>
<data name="Logout.Content" xml:space="preserve">
<value>ログアウト</value>
<comment>Button</comment>
</data>
<data name="LogoutWarning.Text" xml:space="preserve">
<value>*すべでのWindowsデバイスからログアウトします</value>
<value>*すべでのWindowsデバイスからログイン解除します</value>
<comment>TextBlock</comment>
</data>
<data name="MalePlain" xml:space="preserve">
Expand Down Expand Up @@ -225,7 +225,7 @@
<comment>PlainText</comment>
</data>
<data name="NoInkPlain" xml:space="preserve">
<value>保存するインクがありません</value>
<value>保存できるインクがありません</value>
<comment>PlainText</comment>
</data>
<data name="NotBookmarked.Text" xml:space="preserve">
Expand All @@ -249,7 +249,7 @@
<comment>PlainText</comment>
</data>
<data name="PageInfoPlain" xml:space="preserve">
<value>画像数: {0}</value>
<value>画像数: {0}。 クリックまたはタップして全画像モードに。</value>
<comment>PlainText</comment>
</data>
<data name="PartiallyMatchTag.Content" xml:space="preserve">
Expand Down Expand Up @@ -557,40 +557,24 @@
<comment>TextBlock</comment>
</data>
<data name="ExperimentalWarningPlain" xml:space="preserve">
<value>実験的な機能が有効になっています、安定性問題が発生する可能性があります。
無効にしますか?</value>
<value>You have experimental features enabled. They may cause stability issues.
Do you want to disable them?</value>
<comment>PlainText</comment>
</data>
<data name="ColorTheme.Text" xml:space="preserve">
<value>色</value>
<comment>TextBlock</comment>
</data>
<data name="DarkColorTheme.Content" xml:space="preserve">
<value>濃色</value>
<comment>ComboBoxItem</comment>
</data>
<data name="DefaultColorTheme.Content" xml:space="preserve">
<value>Windows モードを使用</value>
<comment>ComboBoxItem</comment>
</data>
<data name="LightColorTheme.Content" xml:space="preserve">
<value>淡色</value>
<comment>ComboBoxItem</comment>
</data>
<data name="RestartApplyColorTheme" xml:space="preserve">
<value>アプリを再起動して有効にする</value>
<data name="WallpaperFailedPlain" xml:space="preserve">
<value>壁紙が変更できません</value>
<comment>PlainText</comment>
</data>
<data name="ReleasedID" xml:space="preserve">
<value>パッケージ:</value>
<data name="WallpaperNotSupportPlain" xml:space="preserve">
<value>お使いのデバイスは壁紙の変更をサポートしていません</value>
<comment>PlainText</comment>
</data>
<data name="ReleasedTime" xml:space="preserve">
<value>時刻:</value>
<data name="WallpaperSuccessPlain" xml:space="preserve">
<value>壁紙を変更しました</value>
<comment>PlainText</comment>
</data>
<data name="ReleasedVersion" xml:space="preserve">
<value>バージョン:</value>
<data name="SetWallpaper.Label" xml:space="preserve">
<value>壁紙に設定する</value>
<comment>PlainText</comment>
</data>
</root>
16 changes: 16 additions & 0 deletions PixivFSUWP/Strings/zh-Hans/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -641,4 +641,20 @@
<value>当然</value>
<comment>PlainText (❌Unworkable)</comment>
</data>
<data name="WallpaperFailedPlain" xml:space="preserve">
<value>更换壁纸失败</value>
<comment>PlainText</comment>
</data>
<data name="WallpaperNotSupportPlain" xml:space="preserve">
<value>您的设备不支持更换壁纸</value>
<comment>PlainText</comment>
</data>
<data name="WallpaperSuccessPlain" xml:space="preserve">
<value>壁纸已更换</value>
<comment>PlainText</comment>
</data>
<data name="SetWallpaper.Label" xml:space="preserve">
<value>设为壁纸</value>
<comment>PlainText</comment>
</data>
</root>