From c4e2cae39c0545b9e36894b5b0c0db63d5e96055 Mon Sep 17 00:00:00 2001 From: lindexi Date: Thu, 21 Dec 2023 14:25:28 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E8=BD=AF=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=20=E4=BF=AE=E5=A4=8D=E8=99=9A=E6=8B=9F=E6=9C=BA?= =?UTF-8?q?=E9=97=AA=E7=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnoFileDownloader.Skia.Gtk/Program.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/Program.cs b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/Program.cs index ecd3cd4..38d880a 100644 --- a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/Program.cs +++ b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/Program.cs @@ -1,5 +1,5 @@ using System; - +using System.Runtime.InteropServices; using GLib; using Uno.UI.Runtime.Skia.Gtk; @@ -18,7 +18,10 @@ public static void Main(string[] args) var host = new GtkHost(() => new AppHead()); + // 防止虚拟机内闪烁 + host.RenderSurfaceType = RenderSurfaceType.Software; + host.Run(); } } -} \ No newline at end of file +} From 00d74ab31d0cff35bafe3684a0204280074c5f7f Mon Sep 17 00:00:00 2001 From: lindexi Date: Thu, 21 Dec 2023 14:30:24 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B1=E8=B4=A5=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnoFileDownloader/Presentation/MainPage.xaml.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/Presentation/MainPage.xaml.cs b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/Presentation/MainPage.xaml.cs index 220a717..7e5b93d 100644 --- a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/Presentation/MainPage.xaml.cs +++ b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/Presentation/MainPage.xaml.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using Uno.Logging; namespace UnoFileDownloader.Presentation { @@ -24,6 +25,7 @@ private void MainPage_DataContextChanged(FrameworkElement sender, DataContextCha { #if DEBUG // 谁,是谁,乱改 DataContext 的类型! + // 在 WinUI 项目里面可能进入多次,这是符合预期的,只需要最后一次的 DataContext 是正确的就行了 Debugger.Break(); #endif } @@ -40,6 +42,7 @@ private void DownloadFileInfoViewList_CollectionChanged(object? sender, System.C private void UpdateTaskListNoItemsTextBlock() { TaskListNoItemsTextBlock.Visibility = + // 如果下载列表为空,就显示“没有任务”文本块 ViewModel.DownloadFileInfoViewList.Count == 0 ? Visibility.Visible : Visibility.Collapsed; } @@ -65,6 +68,7 @@ private void DownloadItemOpenFileButton_OnClick(object sender, RoutedEventArgs e catch (Exception exception) { // 忽略吧,可能是需要管理员权限,但是用户取消了 + this.Log().LogWarning(exception, "打开文件失败"); } } From 0e361475e4e5aef0e0fd0135ba5282150f5dc770 Mon Sep 17 00:00:00 2001 From: lindexi Date: Sat, 27 Jan 2024 11:06:16 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=89=93=E5=8C=85?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnoFileDownloader/Directory.Packages.props | 3 ++- .../UnoFileDownloader.Skia.Gtk.csproj | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/UnoFileDownloader/UnoFileDownloader/Directory.Packages.props b/src/UnoFileDownloader/UnoFileDownloader/Directory.Packages.props index 8ceeac2..e33833e 100644 --- a/src/UnoFileDownloader/UnoFileDownloader/Directory.Packages.props +++ b/src/UnoFileDownloader/UnoFileDownloader/Directory.Packages.props @@ -1,4 +1,4 @@ - + @@ -46,5 +46,6 @@ + diff --git a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj index 58de840..98ba8fc 100644 --- a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj +++ b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj @@ -31,6 +31,9 @@ + + + From aa9535e4cc185d1c24afeb2738cabe46f0b04642 Mon Sep 17 00:00:00 2001 From: lindexi Date: Sat, 27 Jan 2024 11:14:14 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnoFileDownloader/UnoFileDownloader/App.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/App.cs b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/App.cs index 1e90dab..0b27028 100644 --- a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/App.cs +++ b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader/App.cs @@ -66,13 +66,15 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args) .AddContentSerializer(context) //.AddJsonTypeInfo(WeatherForecastContext.Default.IImmutableListWeatherForecast) ) - .UseHttp((context, services) => services - // Register HttpClient + .UseHttp((context, services) => + { + // Register HttpClient #if DEBUG - // DelegatingHandler will be automatically injected into Refit Client - .AddTransient() + // DelegatingHandler will be automatically injected into Refit Client + services.AddTransient(); #endif - ) + } + ) .ConfigureServices((context, services) => { // TODO: Register your services From 2d5769bd5d93a673bf1f7dfa70b0905057c35138 Mon Sep 17 00:00:00 2001 From: lindexi Date: Sat, 27 Jan 2024 11:36:29 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=85=8D=E7=BD=AE=20ID=20=E7=94=A8?= =?UTF-8?q?=E6=9D=A5=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UnoFileDownloader.Skia.Gtk.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj index 98ba8fc..fc7a7a3 100644 --- a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj +++ b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj @@ -4,6 +4,8 @@ Exe net8.0 app.manifest + + com.dotnetcampus.unofiledownloader From a83467712337b3fad303a30eb91126a4096f8dfd Mon Sep 17 00:00:00 2001 From: lindexi Date: Sat, 27 Jan 2024 11:47:39 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E6=89=93=E5=8C=85=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Download32x32Icon.png | Bin 0 -> 874 bytes .../UnoFileDownloader.Skia.Gtk.csproj | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/Download32x32Icon.png diff --git a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/Download32x32Icon.png b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/Download32x32Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7473e8b616acabe6826680825beb6b830a9c6d81 GIT binary patch literal 874 zcmV-w1C{)VP)Rwn zi+|(hm8V;3k7v5aiBQByBg>kps#mY7Ue|DT&lkVv`0W1z(4RkbgzyeI=WoDVUc1Mf zGk3KT7n~UCX@UaP95A7tmAp?H-5(yh;xw_f)xPlE&dj8yPhYS zuOEzhHXud-1L5Qsi#Y;|cW?w}iKZ<(A8Z0Z$cCR(GM5b#h)4hwe7T&pky#aY;~+ci z*s{@|Q@I#hb&0WbI$JAqcM@hF3P1~90F`x6xu$y8%V%&#AXp_cEXM}$ZBaT#)}Sy^ zGf_?fqB2v#B#0~O3xKEvL2NM~8?FlgbsOzIP@cEd+2nHzK!0B9qPr(A)5E%r^8Wlu zn@eMK%34lf^m&>{O+=l_6W}8l@PFNGGaWnzAUaeT` zRc`okyWvWtXn9>$g8(!I-5NK)XNnLv{=w7(15of;@6v#xtz}h#&;jVds_W^luRAErI?E>G$^Jg#kkDpP(CD|IFT)nVUGjbz>D8Y!ayDlWMISWx+k#QxH z+f2c>n1p37X>a4%#FT_}E2ddj3#R9-TDFoPa3PiA@BNL6xyZb3+M28YC_611u)%uh z`Y$voSk1?Y1kY=0IejnC>W+8VC)-9vzGDGU6w_e>HXQk3LV?sp8!vq?AaLR|olcK! zyP`7O2|!q_<1D686S6Y{CP%k@c4r1|8(7)>1t3i_KY5eOfdBvi07*qoM6N<$f^c1b A%m4rY literal 0 HcmV?d00001 diff --git a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj index fc7a7a3..6d7b01d 100644 --- a/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj +++ b/src/UnoFileDownloader/UnoFileDownloader/UnoFileDownloader.Skia.Gtk/UnoFileDownloader.Skia.Gtk.csproj @@ -5,7 +5,20 @@ net8.0 app.manifest + + com.dotnetcampus.unofiledownloader + 1.0.1 + + UnoFileDownloader + + 下载器 + Download32x32Icon.png + The file downloader. + 文件下载器,代码完全开源 + The UNO file downloader. + https://github.com/dotnet-campus/dotnetCampus.FileDownloader + dotnet-campus