diff --git a/BuildTime.txt b/BuildTime.txt index b192597..f64c45c 100644 --- a/BuildTime.txt +++ b/BuildTime.txt @@ -1 +1 @@ -2026-03-15 13:19:36 \ No newline at end of file +2026-03-15 15:41:15 \ No newline at end of file diff --git a/CMLeonOS.csproj b/CMLeonOS.csproj index dfbc0fb..b28be86 100644 --- a/CMLeonOS.csproj +++ b/CMLeonOS.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -30,7 +30,7 @@ 800x600x32 Always 0 - False + True diff --git a/GitCommit.txt b/GitCommit.txt index c52705e..b4bf064 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -d44fca8 \ No newline at end of file +d076d53 \ No newline at end of file diff --git a/Gui/Apps/Files.cs b/Gui/Apps/Files.cs index dcc8e0b..9abf648 100644 --- a/Gui/Apps/Files.cs +++ b/Gui/Apps/Files.cs @@ -89,6 +89,7 @@ namespace CMLeonOS.Gui.Apps private readonly (string Name, string Path)[] shortcuts = new (string, string)[] { ("CMLeonOS (0:)", @"0:\"), + ("ISO (1:)", @"1:\"), ("My Home", @$"0:\user\{UserSystem.CurrentLoggedInUser.Username}"), ("Users", @"0:\user"), }; @@ -117,6 +118,8 @@ namespace CMLeonOS.Gui.Apps { case @"0:\": return Icons.Icon_Drive; + case @"1:\": + return Icons.Icon_Drive; default: return Icons.Icon_Directory; } diff --git a/Gui/Apps/Settings.cs b/Gui/Apps/Settings.cs index ec01006..18c3939 100644 --- a/Gui/Apps/Settings.cs +++ b/Gui/Apps/Settings.cs @@ -87,6 +87,11 @@ namespace CMLeonOS.Gui.Apps SettingsManager.GUI_ShowFps = @checked; } + private void SkipToGuiChanged(bool @checked) + { + SettingsManager.SkipToGui = @checked; + } + private void MouseSensitivityChanged(float value) { SettingsManager.GUI_MouseSensitivity = value; @@ -115,6 +120,12 @@ namespace CMLeonOS.Gui.Apps showFps.CheckBoxChanged = ShowFpsChanged; wm.AddWindow(showFps); + Switch skipToGui = new Switch(appearance, 12, 96, 244, 16); + skipToGui.Text = "Skip to GUI on boot"; + skipToGui.Checked = SettingsManager.SkipToGui; + skipToGui.CheckBoxChanged = SkipToGuiChanged; + wm.AddWindow(skipToGui); + wm.Update(window); } diff --git a/Kernel.cs b/Kernel.cs index 6690f2b..3b18b37 100644 --- a/Kernel.cs +++ b/Kernel.cs @@ -96,7 +96,8 @@ namespace CMLeonOS private void InitializeSystem() { - // 修改光标样式等 + // 修改光标样式 + _logger.Info("Kernel", "Setting cursor size to 100"); Console.CursorSize = 100; // 注册VFS diff --git a/Settings/Settings.cs b/Settings/Settings.cs index c71646e..fb3c787 100644 --- a/Settings/Settings.cs +++ b/Settings/Settings.cs @@ -38,7 +38,8 @@ namespace CMLeonOS.Settings { "GUI_MouseSensitivity", "1.0" }, { "GUI_ScreenWidth", "1280" }, { "GUI_ScreenHeight", "800" }, - { "GUI_DarkNotepad", "false" } + { "GUI_DarkNotepad", "false" }, + { "SkipToGui", "false" } }; public static bool LoggerEnabled @@ -206,6 +207,23 @@ namespace CMLeonOS.Settings } } + public static bool SkipToGui + { + get + { + if (settings.TryGetValue("SkipToGui", out string value)) + { + return value.ToLower() == "true"; + } + return false; + } + set + { + settings["SkipToGui"] = value ? "true" : "false"; + SaveSettings(); + } + } + public static void LoadSettings() { settings.Clear(); diff --git a/System/BootMenu.cs b/System/BootMenu.cs index e475ada..5322618 100644 --- a/System/BootMenu.cs +++ b/System/BootMenu.cs @@ -113,6 +113,11 @@ namespace CMLeonOS public static BootMenuAction Show() { + if (Settings.SettingsManager.SkipToGui && UserDatExists()) + { + return BootMenuAction.GuiBoot; + } + Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.White; diff --git a/System/FileSystem.cs b/System/FileSystem.cs index ca0e873..ba65cb3 100644 --- a/System/FileSystem.cs +++ b/System/FileSystem.cs @@ -143,7 +143,7 @@ namespace CMLeonOS if (Directory.Exists(fullPath)) { string displayPath = path == "." ? CurrentDirectory : path; - Console.WriteLine($"Contents of {displayPath}:"); + Console.WriteLine($"Contents of {fullPath}:"); try { diff --git a/docs/cmleonos/docs/commands.md b/docs/cmleonos/docs/commands.md index 265409f..f0ad57e 100644 --- a/docs/cmleonos/docs/commands.md +++ b/docs/cmleonos/docs/commands.md @@ -144,6 +144,8 @@ ls /system - 文本文件:.txt, .md, .rtf - 图片文件:.bmp, .png, .jpg, .jpeg, .gif - 压缩文件:.zip, .rar, .7z, .tar, .gz +- Markit文件:.mi +- 数据文件:.dat ### cd 切换当前工作目录。 diff --git a/shell/Commands/Utility/AliasCommand.cs b/shell/Commands/Utility/AliasCommand.cs index 4b8e2a5..16dd411 100644 --- a/shell/Commands/Utility/AliasCommand.cs +++ b/shell/Commands/Utility/AliasCommand.cs @@ -24,10 +24,12 @@ namespace CMLeonOS.Commands { private static string aliasFilePath = @"0:\system\alias.dat"; private static Dictionary aliases = new Dictionary(); + private static bool hasUnsavedChanges = false; public static void LoadAliases() { aliases.Clear(); + hasUnsavedChanges = false; try { @@ -57,6 +59,11 @@ namespace CMLeonOS.Commands public static void SaveAliases() { + if (!hasUnsavedChanges) + { + return; + } + try { Directory.CreateDirectory(Path.GetDirectoryName(aliasFilePath)); @@ -87,6 +94,8 @@ namespace CMLeonOS.Commands writer.WriteLine($"{key}={aliases[key]}"); } } + + hasUnsavedChanges = false; } catch (Exception e) { @@ -103,7 +112,7 @@ namespace CMLeonOS.Commands } aliases[name] = command; - SaveAliases(); + hasUnsavedChanges = true; Console.WriteLine($"Alias '{name}' added successfully"); } @@ -111,7 +120,7 @@ namespace CMLeonOS.Commands { if (aliases.Remove(name)) { - SaveAliases(); + hasUnsavedChanges = true; Console.WriteLine($"Alias '{name}' removed successfully"); } else diff --git a/shell/Shell.cs b/shell/Shell.cs index 9897449..596508c 100644 --- a/shell/Shell.cs +++ b/shell/Shell.cs @@ -151,6 +151,7 @@ namespace CMLeonOS // 如果需要退出,返回到登录页面 if (shouldExit) { + Commands.AliasCommand.SaveAliases(); return; } }