mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
update
This commit is contained in:
@@ -17,9 +17,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
Monitors = new List<MonitorInfo>();
|
||||
RestoreSettingsOnStartup = true;
|
||||
SavedMonitorSettings = new Dictionary<string, MonitorSavedSettings>();
|
||||
EnableMcpServer = false;
|
||||
McpServerPort = 5000;
|
||||
McpAutoStart = false;
|
||||
}
|
||||
|
||||
[JsonPropertyName("launch_at_startup")]
|
||||
@@ -39,14 +36,5 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
|
||||
[JsonPropertyName("saved_monitor_settings")]
|
||||
public Dictionary<string, MonitorSavedSettings> SavedMonitorSettings { get; set; }
|
||||
|
||||
[JsonPropertyName("enable_mcp_server")]
|
||||
public bool EnableMcpServer { get; set; }
|
||||
|
||||
[JsonPropertyName("mcp_server_port")]
|
||||
public int McpServerPort { get; set; }
|
||||
|
||||
[JsonPropertyName("mcp_auto_start")]
|
||||
public bool McpAutoStart { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,33 +62,6 @@
|
||||
|
||||
</controls:SettingsGroup>
|
||||
|
||||
<controls:SettingsGroup x:Uid="PowerDisplay_MCP_GroupSettings" IsEnabled="{x:Bind ViewModel.IsPowerDisplayEnabled, Mode=OneWay}">
|
||||
<tkcontrols:SettingsCard
|
||||
x:Uid="PowerDisplay_EnableMcpServer"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}">
|
||||
<ToggleSwitch IsOn="{x:Bind ViewModel.EnableMcpServer, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
|
||||
<tkcontrols:SettingsCard
|
||||
x:Uid="PowerDisplay_McpServerPort"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}"
|
||||
IsEnabled="{x:Bind ViewModel.EnableMcpServer, Mode=OneWay}">
|
||||
<NumberBox
|
||||
Value="{x:Bind ViewModel.McpServerPort, Mode=TwoWay}"
|
||||
Minimum="1000"
|
||||
Maximum="65535"
|
||||
MinWidth="120" />
|
||||
</tkcontrols:SettingsCard>
|
||||
|
||||
<tkcontrols:SettingsCard
|
||||
x:Uid="PowerDisplay_McpAutoStart"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}"
|
||||
IsEnabled="{x:Bind ViewModel.EnableMcpServer, Mode=OneWay}">
|
||||
<ToggleSwitch IsOn="{x:Bind ViewModel.McpAutoStart, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
|
||||
</controls:SettingsGroup>
|
||||
|
||||
<controls:SettingsGroup x:Uid="PowerDisplay_Monitors" IsEnabled="{x:Bind ViewModel.IsPowerDisplayEnabled, Mode=OneWay}">
|
||||
<!-- 空状态提示 -->
|
||||
<InfoBar
|
||||
|
||||
@@ -5629,25 +5629,4 @@ To record a specific window, enter the hotkey with the Alt key in the opposite m
|
||||
<data name="PowerDisplay_Monitor_EnableVolume_ToggleSwitch.OffContent" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_MCP_GroupSettings.Header" xml:space="preserve">
|
||||
<value>Model Context Protocol (MCP)</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_EnableMcpServer.Header" xml:space="preserve">
|
||||
<value>Enable MCP Server</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_EnableMcpServer.Description" xml:space="preserve">
|
||||
<value>Allow MCP clients like Claude Desktop to control monitor settings through standardized protocol</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_McpServerPort.Header" xml:space="preserve">
|
||||
<value>MCP Server Port</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_McpServerPort.Description" xml:space="preserve">
|
||||
<value>Port number for the MCP server to listen on (default: 5000)</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_McpAutoStart.Header" xml:space="preserve">
|
||||
<value>MCP Auto Start</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_McpAutoStart.Description" xml:space="preserve">
|
||||
<value>Automatically start MCP server when PowerDisplay launches</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -144,51 +144,6 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableMcpServer
|
||||
{
|
||||
get => _settings.Properties.EnableMcpServer;
|
||||
set
|
||||
{
|
||||
if (_settings.Properties.EnableMcpServer != value)
|
||||
{
|
||||
_settings.Properties.EnableMcpServer = value;
|
||||
OnPropertyChanged(nameof(EnableMcpServer));
|
||||
|
||||
NotifySettingsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int McpServerPort
|
||||
{
|
||||
get => _settings.Properties.McpServerPort;
|
||||
set
|
||||
{
|
||||
if (_settings.Properties.McpServerPort != value)
|
||||
{
|
||||
_settings.Properties.McpServerPort = value;
|
||||
OnPropertyChanged(nameof(McpServerPort));
|
||||
|
||||
NotifySettingsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool McpAutoStart
|
||||
{
|
||||
get => _settings.Properties.McpAutoStart;
|
||||
set
|
||||
{
|
||||
if (_settings.Properties.McpAutoStart != value)
|
||||
{
|
||||
_settings.Properties.McpAutoStart = value;
|
||||
OnPropertyChanged(nameof(McpAutoStart));
|
||||
|
||||
NotifySettingsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<string> _brightnessUpdateRateOptions = new List<string>
|
||||
{
|
||||
"never",
|
||||
|
||||
Reference in New Issue
Block a user