diff --git a/Localization/Strings.Designer.cs b/Localization/Strings.Designer.cs index bbb8ea8..c2a1fae 100644 --- a/Localization/Strings.Designer.cs +++ b/Localization/Strings.Designer.cs @@ -770,6 +770,78 @@ public static string SizeString { } } + /// + /// Checking configuration information... に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormConfigCaption { + get { + return ResourceManager.GetString("SplashFormConfigCaption", resourceCulture); + } + } + + /// + /// Check for FFmpeg updates... に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormFFCaption { + get { + return ResourceManager.GetString("SplashFormFFCaption", resourceCulture); + } + } + + /// + /// Loaded: '{0}' に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormFileCaption { + get { + return ResourceManager.GetString("SplashFormFileCaption", resourceCulture); + } + } + + /// + /// Running... に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormFinalCaption { + get { + return ResourceManager.GetString("SplashFormFinalCaption", resourceCulture); + } + } + + /// + /// Getting system information... に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormSystemCaption { + get { + return ResourceManager.GetString("SplashFormSystemCaption", resourceCulture); + } + } + + /// + /// Check for updates... に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormUpdateCaption { + get { + return ResourceManager.GetString("SplashFormUpdateCaption", resourceCulture); + } + } + + /// + /// Update Successfuly. に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormUpdatedCaption { + get { + return ResourceManager.GetString("SplashFormUpdatedCaption", resourceCulture); + } + } + + /// + /// Updating application... に類似しているローカライズされた文字列を検索します。 + /// + public static string SplashFormUpdatingCaption { + get { + return ResourceManager.GetString("SplashFormUpdatingCaption", resourceCulture); + } + } + /// /// An unexpected error has occurred. ///{0} に類似しているローカライズされた文字列を検索します。 diff --git a/Localization/Strings.en.resx b/Localization/Strings.en.resx index c811c0a..1b8c2cd 100644 --- a/Localization/Strings.en.resx +++ b/Localization/Strings.en.resx @@ -362,6 +362,30 @@ Please configure the settings from the 'Settings' item. Bytes. + + Checking configuration information... + + + Check for FFmpeg updates... + + + Loaded: '{0}' + + + Running... + + + Getting system information... + + + Check for updates... + + + Update Successfuly. + + + Updating application... + An unexpected error has occurred. {0} diff --git a/Localization/Strings.ja.resx b/Localization/Strings.ja.resx index 2bae6ee..22090dd 100644 --- a/Localization/Strings.ja.resx +++ b/Localization/Strings.ja.resx @@ -376,6 +376,30 @@ Real-ESRGAN Photo: 写真等をアップスケールする際に適したモデ バイト + + アプリケーション設定の確認中... + + + FFmpegのアップデートを確認中... + + + 読み込み:'{0}' + + + 起動中… + + + システム情報の取得中… + + + 更新の確認中... + + + アップデート完了 + + + アプリケーションのアップデート中… + 予期せぬエラーが発生しました。 {0} diff --git a/Localization/Strings.resx b/Localization/Strings.resx index 111bbd1..40c20c2 100644 --- a/Localization/Strings.resx +++ b/Localization/Strings.resx @@ -377,6 +377,30 @@ Please configure the settings from the 'Settings' item. Bytes. + + Checking configuration information... + + + Check for FFmpeg updates... + + + Loaded: '{0}' + + + Running... + + + Getting system information... + + + Check for updates... + + + Update Successfuly. + + + Updating application... + An unexpected error has occurred. {0} diff --git a/Localization/Strings.zh.resx b/Localization/Strings.zh.resx index f142edf..aa93666 100644 --- a/Localization/Strings.zh.resx +++ b/Localization/Strings.zh.resx @@ -376,6 +376,30 @@ Real-ESRGAN Photo:该模型适用于放大照片等。 字节 + + 检查应用程序设置... + + + 检查FFmpeg的更新... + + + 阅读:'{0}' + + + 激活... + + + 获取系统信息的过程中... + + + 检查更新... + + + 更新完成。 + + + 更新正在进行的申请... + 发生了一个意外的错误。 {0} diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 11021ab..e484279 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -119,5 +119,15 @@ internal static System.Drawing.Bitmap waifu2x_api { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。 + /// + internal static System.Drawing.Bitmap waifu2x_splash { + get { + object obj = ResourceManager.GetObject("waifu2x_splash", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Properties/Resources.resx b/Properties/Resources.resx index f6bc6e2..b930c72 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + opencv-logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -136,4 +136,7 @@ 2021-9-13-18-29-59_Upscaled.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + waifu2x-splash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Properties/waifu2x-splash.png b/Properties/waifu2x-splash.png new file mode 100644 index 0000000..7936f93 Binary files /dev/null and b/Properties/waifu2x-splash.png differ diff --git a/VERSIONINFO b/VERSIONINFO index 5524611..be3b6ec 100644 --- a/VERSIONINFO +++ b/VERSIONINFO @@ -1 +1 @@ -version:1.29.2220.412 +version:1.29.2220.429 diff --git a/src/Common.cs b/src/Common.cs index 380cad8..2be61bb 100644 --- a/src/Common.cs +++ b/src/Common.cs @@ -1224,6 +1224,12 @@ public static async Task GetWebStreamAsync(HttpClient httpClient, Uri ur { return await httpClient.GetStreamAsync(uri); } + + public static async Task GetWebImageAsync(HttpClient httpClient, Uri uri) + { + using Stream stream = await GetWebStreamAsync(httpClient, uri); + return Image.FromStream(stream); + } } } diff --git a/src/Forms/FormMain.cs b/src/Forms/FormMain.cs index d333629..6a3c44d 100644 --- a/src/Forms/FormMain.cs +++ b/src/Forms/FormMain.cs @@ -36,6 +36,18 @@ private void FormMain_Load(object sender, EventArgs e) FileVersionInfo ver = FileVersionInfo.GetVersionInfo(Application.ExecutablePath); Text = "waifu2x-nvger ( build: " + ver.FileVersion.ToString() + "-Beta )"; + using FormSplash splash = new(); + splash.Show(); + splash.Refresh(); + + foreach (var files in Directory.GetFiles(Directory.GetCurrentDirectory() + @"\res", "*", SearchOption.AllDirectories)) + { + FileInfo fi = new(files); + RefleshSplashForm(splash, string.Format(Strings.SplashFormFileCaption, fi.Name)); + } + + RefleshSplashForm(splash, Strings.SplashFormSystemCaption); + label1.Text = Strings.DragDropCaption; string[] OSInfo = new string[17]; @@ -51,6 +63,8 @@ private void FormMain_Load(object sender, EventArgs e) label_Graphic.Text = GPUInfo[0] + " - " + GPUInfo[1] + " [ " + GPUInfo[2] + " RAM ]"; toolStripStatusLabel_Status.ForeColor = Color.FromArgb(0, 255, 0, 0); + RefleshSplashForm(splash, Strings.SplashFormConfigCaption); + if (!File.Exists(Common.xmlpath)) { Common.InitConfig(); @@ -97,20 +111,32 @@ private void FormMain_Load(object sender, EventArgs e) if (File.Exists(Directory.GetCurrentDirectory() + @"\updated.dat")) { + RefleshSplashForm(splash, Strings.SplashFormUpdatingCaption); File.Delete(Directory.GetCurrentDirectory() + @"\updated.dat"); string updpath = Directory.GetCurrentDirectory()[..Directory.GetCurrentDirectory().LastIndexOf('\\')]; File.Delete(updpath + @"\updater.exe"); File.Delete(updpath + @"\waifu2x-nvger.zip"); Common.DeleteDirectory(updpath + @"\updater-temp"); + RefleshSplashForm(splash, Strings.SplashFormUpdatedCaption); MessageBox.Show(Strings.UpdateCompletedCaption, Strings.MSGInfo, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { - CheckForUpdatesForInit(); + RefleshSplashForm(splash, Strings.SplashFormUpdateCaption); + var update = Task.Run(() => CheckForUpdatesForInit()); + update.Wait(); } - Task.Run(() => CheckForFFmpeg()); + RefleshSplashForm(splash, Strings.SplashFormFFCaption); + + var ffupdate = Task.Run(() => CheckForFFmpeg()); + ffupdate.Wait(); + + RefleshSplashForm(splash, Strings.SplashFormFinalCaption); + + splash.Close(); + Activate(); } private void OpenImegeIToolStripMenuItem_Click(object sender, EventArgs e) @@ -4190,7 +4216,7 @@ private async void CheckForUpdatesUToolStripMenuItem_Click(object sender, EventA /// /// 起動時のアップデート確認 /// - private async void CheckForUpdatesForInit() + private async Task CheckForUpdatesForInit() { if (NetworkInterface.GetIsNetworkAvailable()) { @@ -4289,7 +4315,7 @@ private async void CheckForUpdatesForInit() } } - private async void CheckForFFmpeg() + private async Task CheckForFFmpeg() { if (NetworkInterface.GetIsNetworkAvailable()) { @@ -4537,5 +4563,12 @@ private async void CheckForFFmpeg() return; } } + + private static void RefleshSplashForm(FormSplash form, string text) + { + form.ProgressMsg = text; + Application.DoEvents(); + System.Threading.Thread.Sleep(10); + } } } diff --git a/src/Forms/FormSplash.Designer.cs b/src/Forms/FormSplash.Designer.cs new file mode 100644 index 0000000..3ab09a0 --- /dev/null +++ b/src/Forms/FormSplash.Designer.cs @@ -0,0 +1,64 @@ +namespace NVGE +{ + partial class FormSplash + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label_log = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label_log + // + this.label_log.AutoEllipsis = true; + this.label_log.Location = new System.Drawing.Point(12, 302); + this.label_log.Name = "label_log"; + this.label_log.Size = new System.Drawing.Size(466, 19); + this.label_log.TabIndex = 0; + this.label_log.Text = "Loading..."; + this.label_log.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // FormSplash + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(490, 330); + this.ControlBox = false; + this.Controls.Add(this.label_log); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "FormSplash"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Loading"; + this.Load += new System.EventHandler(this.FormSplash_Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label_log; + } +} \ No newline at end of file diff --git a/src/Forms/FormSplash.cs b/src/Forms/FormSplash.cs new file mode 100644 index 0000000..fc06a37 --- /dev/null +++ b/src/Forms/FormSplash.cs @@ -0,0 +1,40 @@ +using System; +using System.Drawing; +using System.IO; +using System.Net.Http; +using System.Net.NetworkInformation; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace NVGE +{ + public partial class FormSplash : Form + { + #region NetworkCommon + private static readonly HttpClientHandler handler = new() + { + UseProxy = false, + UseCookies = false + }; + private static readonly HttpClient stream = new(handler); + #endregion + + public FormSplash() + { + InitializeComponent(); + } + + private void FormSplash_Load(object sender, EventArgs e) + { + BackgroundImage = Properties.Resources.waifu2x_splash; + } + + public string ProgressMsg + { + set + { + label_log.Text = value; + } + } + } +} diff --git a/src/Forms/FormSplash.resx b/src/Forms/FormSplash.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/src/Forms/FormSplash.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj b/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj index 4143866..43490cd 100644 --- a/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj +++ b/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj @@ -10,8 +10,8 @@ XyLe waifu2x-ncnn-vulkan GUI Edition Reloaded Copyright (C) 2022 - XyLe. All Rights Reserved. - 1.29.2220.412 - 1.29.2220.412 + 1.29.2220.429 + 1.29.2220.429 1.29 Super-Resolution Convolutional Neural Network(SRCNN)Utility. csharp-logo.png diff --git a/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.sln b/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.sln index 39a9eca..2d03235 100644 --- a/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.sln +++ b/waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 17.1.32210.238 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp", "waifu2x-ncnn-vulkan-GUI-Edition-C-Sharp.csproj", "{BB284BCD-9102-48AD-914A-042E3DBD45BC}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApplicationUpdater", ".\ApplicationUpdater\ApplicationUpdater.vcxproj", "{DF78F33D-58BA-4FE1-82F3-66209CC0223E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApplicationUpdater", "..\ApplicationUpdater\ApplicationUpdater.vcxproj", "{DF78F33D-58BA-4FE1-82F3-66209CC0223E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution