设置系统+新的RSOD

This commit is contained in:
2026-02-06 16:15:24 +08:00
parent 2124fea5e2
commit 8d6a43cd81
8 changed files with 337 additions and 74 deletions

View File

@@ -85,6 +85,9 @@ namespace CMLeonOS.shell
case "version":
shell.ProcessVersion();
break;
case "settings":
shell.ProcessSettings(args);
break;
case "about":
shell.ProcessAbout();
break;

View File

@@ -72,6 +72,8 @@ namespace CMLeonOS.Commands
" lua <file> - Execute Lua script",
" version - Show OS version",
" about - Show about information",
" settings <key> [value] - View or modify system settings",
" settings - List all settings",
" help <page> - Show help page (1-3)",
" help all - Show all help pages",
"",

View File

@@ -0,0 +1,56 @@
using System;
using CMLeonOS.Settings;
namespace CMLeonOS.Commands
{
public static class SettingsCommand
{
public static void ProcessSettings(string args)
{
if (string.IsNullOrWhiteSpace(args))
{
SettingsManager.ListSettings();
return;
}
string[] parts = args.Split(new char[] { ' ' }, 2, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 1)
{
string key = parts[0];
string value = SettingsManager.GetSetting(key);
if (value != null)
{
Console.WriteLine($"{key} = {value}");
}
else
{
Console.WriteLine($"Error: Setting '{key}' not found");
}
}
else if (parts.Length == 2)
{
string key = parts[0];
string value = parts[1];
if (key.ToLower() == "loggerenabled")
{
if (value.ToLower() == "true" || value.ToLower() == "false")
{
SettingsManager.LoggerEnabled = value.ToLower() == "true";
Console.WriteLine($"LoggerEnabled set to {value.ToLower()}");
}
else
{
Console.WriteLine("Error: LoggerEnabled must be 'true' or 'false'");
}
}
else
{
SettingsManager.SetSetting(key, value);
Console.WriteLine($"{key} set to {value}");
}
}
}
}
}

View File

@@ -501,6 +501,11 @@ namespace CMLeonOS
Commands.VersionCommand.ProcessVersion();
}
public void ProcessSettings(string args)
{
Commands.SettingsCommand.ProcessSettings(args);
}
public void ProcessAbout()
{
Commands.AboutCommand.ProcessAbout();