Skip to content

Commit

Permalink
fix: 错误的更新提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaitonn committed Mar 11, 2023
1 parent 41d3e86 commit 3459e4b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
12 changes: 10 additions & 2 deletions Serein/Universal/Core/Server/ServerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ internal static class ServerManager
/// </summary>
public static double CPUUsage { get; private set; }

/// <summary>
/// Motd对象
/// </summary>
public static Motd Motd { get; private set; } = new();

/// <summary>
/// 更新计时器
/// </summary>
private static Timer UpdateTimer;

/// <summary>
Expand Down Expand Up @@ -101,15 +107,17 @@ internal static class ServerManager
};

#if CONSOLE
/// <summary>
/// 上一次执行强制结束时间
/// </summary>
private static DateTime LastKillTime = DateTime.Now;
#endif

/// <summary>
/// 启动服务器
/// </summary>
/// <returns>启动结果</returns>
public static bool Start()
=> Start(false);
public static bool Start() => Start(false);

/// <summary>
/// 启动服务器
Expand Down
7 changes: 3 additions & 4 deletions Serein/Universal/Utils/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Drawing;
using Serein.Base;
using Serein.Base;
using Serein.Extensions;
using System;
using System.Diagnostics;
Expand Down Expand Up @@ -154,7 +153,7 @@ public static void Output(LogType type, params object[] objects)
break;
case LogType.Version_New:
Program.Ui.ShowBalloonTip("发现新版本:\n" + line);
Program.Ui.SettingSereinVersion_Update($"当前版本:{Global.VERSION} (发现新版本:{line}你可以等待后台自动下载或手动点击下方链接获取最新版)");
Program.Ui.SettingSereinVersion_Update($"当前版本:{Global.VERSION} (发现新版本:{line}你可以{(Global.Settings.Serein.AutoUpdate ? "等待后台自动下载或手动" : string.Empty)}点击下方链接获取最新版)");
break;
case LogType.Version_Latest:
Program.Ui.ShowBalloonTip(
Expand Down Expand Up @@ -223,7 +222,7 @@ public static void Output(LogType type, params object[] objects)
),
expirationTime: TimeSpan.FromSeconds(10)
);
Catalog.Settings.Serein?.UpdateVersion($"\n(发现新版本:{line}你可以等待后台自动下载或手动点击下方链接获取最新版)");
Catalog.Settings.Serein?.UpdateVersion($"\n(发现新版本:{line}你可以{(Global.Settings.Serein.AutoUpdate ? "等待后台自动下载或手动" : string.Empty)}点击下方链接获取最新版)");
break;
case LogType.Version_Latest:
Catalog.Notification?.Show(
Expand Down
2 changes: 1 addition & 1 deletion Serein/WPF/Windows/Pages/Settings/Serein.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
HorizontalAlignment="Left"
Icon="TextFirstLine24"
IntegersOnly="True"
Max="250"
Max="300"
Min="0"
Step="1"
TextChanged="MaxCacheLines_TextChanged"
Expand Down
2 changes: 1 addition & 1 deletion Serein/Winform/Ui/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private void SettingSereinVersion_Click(object sender, EventArgs _)
Buttons = {
new Ookii.Dialogs.Wpf.TaskDialogButton(ButtonType.Ok)
},
MainInstruction = "详细信息",
MainInstruction = "当前版本详细信息",
WindowTitle = "Serein",
Content = "" +
$"当前版本:{Global.VERSION}\n" +
Expand Down

0 comments on commit 3459e4b

Please sign in to comment.