From a236e7a8a532961c362e715b8fd36276075ca525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva=20de=20Jesus?= Date: Sun, 22 Sep 2024 10:27:07 -0300 Subject: [PATCH] Support for display change trigger, connected display name preset condition and minor changes (#412) * add displaychange trigger, connected display filter and other minor changes * Undo unintended designer changes on LgPanel * Try to fix unintended changes in the samsung panel * Fix async handling of window message dispatcher event; Change to use native method for display enum as Screen.AllScreen caches and returns wrong results * Uncomment SignManifests * Fix mixed tabs/spaces --- .../Pages/Generic/TriggerInput.razor | 5 + ColorControl/Program.cs | 1 + ColorControl/Services/LG/LgPanel.Designer.cs | 98 ++++++++++------ ColorControl/Services/LG/LgPanel.cs | 6 +- ColorControl/Services/LG/LgPanel.resx | 7 +- ColorControl/Services/LG/LgService.cs | 35 ++++-- .../Services/Samsung/SamsungPanel.Designer.cs | 108 +++++++++++------- ColorControl/Services/Samsung/SamsungPanel.cs | 6 +- .../Services/Samsung/SamsungPanel.resx | 9 +- .../Services/Samsung/SamsungService.cs | 28 ++++- Shared/Contracts/LG/LgPreset.cs | 2 +- Shared/Contracts/Presets/PresetBase.cs | 46 ++++++-- Shared/Contracts/Samsung/SamsungPreset.cs | 2 +- .../DisplayChangeEventDispatcher.cs | 33 ++++++ .../EventDispatcher/ProcessEventDispatcher.cs | 2 +- .../WindowMessageDispatcher.cs | 4 + Shared/Native/CCD.cs | 37 +++++- 17 files changed, 323 insertions(+), 106 deletions(-) create mode 100644 Shared/EventDispatcher/DisplayChangeEventDispatcher.cs diff --git a/ColorControl.UI/Components/Pages/Generic/TriggerInput.razor b/ColorControl.UI/Components/Pages/Generic/TriggerInput.razor index 16e5fb5..1f27951 100644 --- a/ColorControl.UI/Components/Pages/Generic/TriggerInput.razor +++ b/ColorControl.UI/Components/Pages/Generic/TriggerInput.razor @@ -27,6 +27,11 @@ +
+ + +
} } diff --git a/ColorControl/Program.cs b/ColorControl/Program.cs index ec10bb5..0e45914 100644 --- a/ColorControl/Program.cs +++ b/ColorControl/Program.cs @@ -342,6 +342,7 @@ namespace ColorControl services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/ColorControl/Services/LG/LgPanel.Designer.cs b/ColorControl/Services/LG/LgPanel.Designer.cs index 6a8f2e5..6e193be 100644 --- a/ColorControl/Services/LG/LgPanel.Designer.cs +++ b/ColorControl/Services/LG/LgPanel.Designer.cs @@ -30,6 +30,8 @@ { components = new System.ComponentModel.Container(); scLgController = new System.Windows.Forms.SplitContainer(); + lblLgPresetConnectedDisplaysRegex = new System.Windows.Forms.Label(); + edtLgPresetConnectedDisplaysRegex = new System.Windows.Forms.TextBox(); btnLgDeviceOptionsSettings = new System.Windows.Forms.Button(); btnLgSettings = new System.Windows.Forms.Button(); chkLgQuickAccess = new System.Windows.Forms.CheckBox(); @@ -95,6 +97,7 @@ mnuLgSettings = new System.Windows.Forms.ContextMenuStrip(components); miTestPowerOffOn = new System.Windows.Forms.ToolStripMenuItem(); miNvSettings = new System.Windows.Forms.ToolStripMenuItem(); + toolTipLgPreset = new System.Windows.Forms.ToolTip(components); ((System.ComponentModel.ISupportInitialize)scLgController).BeginInit(); scLgController.Panel1.SuspendLayout(); scLgController.SuspendLayout(); @@ -112,6 +115,8 @@ // // scLgController.Panel1 // + scLgController.Panel1.Controls.Add(lblLgPresetConnectedDisplaysRegex); + scLgController.Panel1.Controls.Add(edtLgPresetConnectedDisplaysRegex); scLgController.Panel1.Controls.Add(btnLgDeviceOptionsSettings); scLgController.Panel1.Controls.Add(btnLgSettings); scLgController.Panel1.Controls.Add(chkLgQuickAccess); @@ -167,6 +172,28 @@ scLgController.SplitterWidth = 5; scLgController.TabIndex = 43; // + // lblLgPresetConnectedDisplaysRegex + // + lblLgPresetConnectedDisplaysRegex.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + lblLgPresetConnectedDisplaysRegex.AutoSize = true; + lblLgPresetConnectedDisplaysRegex.Location = new System.Drawing.Point(475, 404); + lblLgPresetConnectedDisplaysRegex.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + lblLgPresetConnectedDisplaysRegex.Name = "lblLgPresetConnectedDisplaysRegex"; + lblLgPresetConnectedDisplaysRegex.Size = new System.Drawing.Size(149, 15); + lblLgPresetConnectedDisplaysRegex.TabIndex = 67; + lblLgPresetConnectedDisplaysRegex.Text = "Connected Displays Regex:"; + // + // edtLgPresetConnectedDisplaysRegex + // + edtLgPresetConnectedDisplaysRegex.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; + edtLgPresetConnectedDisplaysRegex.Enabled = false; + edtLgPresetConnectedDisplaysRegex.Location = new System.Drawing.Point(636, 398); + edtLgPresetConnectedDisplaysRegex.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); + edtLgPresetConnectedDisplaysRegex.Name = "edtLgPresetConnectedDisplaysRegex"; + edtLgPresetConnectedDisplaysRegex.Size = new System.Drawing.Size(254, 23); + edtLgPresetConnectedDisplaysRegex.TabIndex = 66; + toolTipLgPreset.SetToolTip(edtLgPresetConnectedDisplaysRegex, "The preset will be executed only if the supplied Regular Expression matches the device name of at least one of the displays that are connected at the moment the trigger is fired."); + // // btnLgDeviceOptionsSettings // btnLgDeviceOptionsSettings.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; @@ -183,7 +210,7 @@ // btnLgSettings // btnLgSettings.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; - btnLgSettings.Location = new System.Drawing.Point(807, 284); + btnLgSettings.Location = new System.Drawing.Point(807, 240); btnLgSettings.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnLgSettings.Name = "btnLgSettings"; btnLgSettings.Size = new System.Drawing.Size(88, 27); @@ -197,7 +224,7 @@ chkLgQuickAccess.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; chkLgQuickAccess.AutoSize = true; chkLgQuickAccess.Enabled = false; - chkLgQuickAccess.Location = new System.Drawing.Point(341, 320); + chkLgQuickAccess.Location = new System.Drawing.Point(341, 276); chkLgQuickAccess.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); chkLgQuickAccess.Name = "chkLgQuickAccess"; chkLgQuickAccess.Size = new System.Drawing.Size(96, 19); @@ -231,7 +258,7 @@ // edtLgPresetDescription.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; edtLgPresetDescription.Enabled = false; - edtLgPresetDescription.Location = new System.Drawing.Point(100, 489); + edtLgPresetDescription.Location = new System.Drawing.Point(100, 481); edtLgPresetDescription.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); edtLgPresetDescription.Multiline = true; edtLgPresetDescription.Name = "edtLgPresetDescription"; @@ -242,7 +269,7 @@ // lblLgPresetDescription.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; lblLgPresetDescription.AutoSize = true; - lblLgPresetDescription.Location = new System.Drawing.Point(6, 494); + lblLgPresetDescription.Location = new System.Drawing.Point(6, 486); lblLgPresetDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); lblLgPresetDescription.Name = "lblLgPresetDescription"; lblLgPresetDescription.Size = new System.Drawing.Size(70, 15); @@ -276,7 +303,7 @@ // btnLgPresetEditTriggerConditions.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnLgPresetEditTriggerConditions.Enabled = false; - btnLgPresetEditTriggerConditions.Location = new System.Drawing.Point(804, 347); + btnLgPresetEditTriggerConditions.Location = new System.Drawing.Point(804, 303); btnLgPresetEditTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnLgPresetEditTriggerConditions.Name = "btnLgPresetEditTriggerConditions"; btnLgPresetEditTriggerConditions.Size = new System.Drawing.Size(88, 27); @@ -289,7 +316,7 @@ // edtLgPresetTriggerConditions.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; edtLgPresetTriggerConditions.Enabled = false; - edtLgPresetTriggerConditions.Location = new System.Drawing.Point(601, 349); + edtLgPresetTriggerConditions.Location = new System.Drawing.Point(601, 305); edtLgPresetTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); edtLgPresetTriggerConditions.Name = "edtLgPresetTriggerConditions"; edtLgPresetTriggerConditions.ReadOnly = true; @@ -300,7 +327,7 @@ // lblLgPresetExcludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; lblLgPresetExcludedProcesses.AutoSize = true; - lblLgPresetExcludedProcesses.Location = new System.Drawing.Point(475, 414); + lblLgPresetExcludedProcesses.Location = new System.Drawing.Point(475, 370); lblLgPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); lblLgPresetExcludedProcesses.Name = "lblLgPresetExcludedProcesses"; lblLgPresetExcludedProcesses.Size = new System.Drawing.Size(112, 15); @@ -311,7 +338,7 @@ // edtLgPresetExcludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; edtLgPresetExcludedProcesses.Enabled = false; - edtLgPresetExcludedProcesses.Location = new System.Drawing.Point(601, 411); + edtLgPresetExcludedProcesses.Location = new System.Drawing.Point(601, 367); edtLgPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); edtLgPresetExcludedProcesses.Name = "edtLgPresetExcludedProcesses"; edtLgPresetExcludedProcesses.Size = new System.Drawing.Size(289, 23); @@ -321,7 +348,7 @@ // lblLgPresetIncludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; lblLgPresetIncludedProcesses.AutoSize = true; - lblLgPresetIncludedProcesses.Location = new System.Drawing.Point(475, 384); + lblLgPresetIncludedProcesses.Location = new System.Drawing.Point(475, 340); lblLgPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); lblLgPresetIncludedProcesses.Name = "lblLgPresetIncludedProcesses"; lblLgPresetIncludedProcesses.Size = new System.Drawing.Size(110, 15); @@ -332,7 +359,7 @@ // edtLgPresetIncludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; edtLgPresetIncludedProcesses.Enabled = false; - edtLgPresetIncludedProcesses.Location = new System.Drawing.Point(601, 381); + edtLgPresetIncludedProcesses.Location = new System.Drawing.Point(601, 337); edtLgPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); edtLgPresetIncludedProcesses.Name = "edtLgPresetIncludedProcesses"; edtLgPresetIncludedProcesses.Size = new System.Drawing.Size(289, 23); @@ -342,7 +369,7 @@ // lblLgPresetTriggerCondition.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; lblLgPresetTriggerCondition.AutoSize = true; - lblLgPresetTriggerCondition.Location = new System.Drawing.Point(475, 353); + lblLgPresetTriggerCondition.Location = new System.Drawing.Point(475, 309); lblLgPresetTriggerCondition.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); lblLgPresetTriggerCondition.Name = "lblLgPresetTriggerCondition"; lblLgPresetTriggerCondition.Size = new System.Drawing.Size(63, 15); @@ -355,7 +382,7 @@ cbxLgPresetTrigger.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; cbxLgPresetTrigger.Enabled = false; cbxLgPresetTrigger.FormattingEnabled = true; - cbxLgPresetTrigger.Location = new System.Drawing.Point(601, 318); + cbxLgPresetTrigger.Location = new System.Drawing.Point(601, 274); cbxLgPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); cbxLgPresetTrigger.Name = "cbxLgPresetTrigger"; cbxLgPresetTrigger.Size = new System.Drawing.Size(289, 23); @@ -365,7 +392,7 @@ // lblLgPresetTrigger.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; lblLgPresetTrigger.AutoSize = true; - lblLgPresetTrigger.Location = new System.Drawing.Point(475, 321); + lblLgPresetTrigger.Location = new System.Drawing.Point(475, 277); lblLgPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); lblLgPresetTrigger.Name = "lblLgPresetTrigger"; lblLgPresetTrigger.Size = new System.Drawing.Size(46, 15); @@ -389,7 +416,7 @@ mnuLgExpert.ImageScalingSize = new System.Drawing.Size(20, 20); mnuLgExpert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { mnuLgOLEDMotionPro, mnuLgSetSvcMenuFlag, miLgExpertSeparator1 }); mnuLgExpert.Name = "mnuLgButtons"; - mnuLgExpert.Size = new System.Drawing.Size(328, 76); + mnuLgExpert.Size = new System.Drawing.Size(328, 54); mnuLgExpert.Opening += mnuLgExpert_Opening; // // mnuLgOLEDMotionPro @@ -423,14 +450,14 @@ // miLgFullServiceMenuEnable // miLgFullServiceMenuEnable.Name = "miLgFullServiceMenuEnable"; - miLgFullServiceMenuEnable.Size = new System.Drawing.Size(180, 22); + miLgFullServiceMenuEnable.Size = new System.Drawing.Size(112, 22); miLgFullServiceMenuEnable.Text = "Enable"; miLgFullServiceMenuEnable.Click += miLgFullServiceMenuEnable_Click; // // miLgFullServiceMenuDisable // miLgFullServiceMenuDisable.Name = "miLgFullServiceMenuDisable"; - miLgFullServiceMenuDisable.Size = new System.Drawing.Size(180, 22); + miLgFullServiceMenuDisable.Size = new System.Drawing.Size(112, 22); miLgFullServiceMenuDisable.Text = "Disable"; miLgFullServiceMenuDisable.Click += miLgFullServiceMenuDisable_Click; // @@ -492,7 +519,7 @@ cbxLgApps.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; cbxLgApps.Enabled = false; cbxLgApps.FormattingEnabled = true; - cbxLgApps.Location = new System.Drawing.Point(100, 380); + cbxLgApps.Location = new System.Drawing.Point(100, 336); cbxLgApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); cbxLgApps.Name = "cbxLgApps"; cbxLgApps.Size = new System.Drawing.Size(233, 23); @@ -509,7 +536,7 @@ lvLgPresets.MultiSelect = false; lvLgPresets.Name = "lvLgPresets"; lvLgPresets.ShowItemToolTips = true; - lvLgPresets.Size = new System.Drawing.Size(888, 126); + lvLgPresets.Size = new System.Drawing.Size(888, 82); lvLgPresets.TabIndex = 8; lvLgPresets.UseCompatibleStateImageBehavior = false; lvLgPresets.View = System.Windows.Forms.View.Details; @@ -522,7 +549,7 @@ // label5.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; label5.AutoSize = true; - label5.Location = new System.Drawing.Point(6, 384); + label5.Location = new System.Drawing.Point(6, 340); label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label5.Name = "label5"; label5.Size = new System.Drawing.Size(32, 15); @@ -535,7 +562,7 @@ cbxLgPresetDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; cbxLgPresetDevice.Enabled = false; cbxLgPresetDevice.FormattingEnabled = true; - cbxLgPresetDevice.Location = new System.Drawing.Point(100, 348); + cbxLgPresetDevice.Location = new System.Drawing.Point(100, 304); cbxLgPresetDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); cbxLgPresetDevice.Name = "cbxLgPresetDevice"; cbxLgPresetDevice.Size = new System.Drawing.Size(370, 23); @@ -545,7 +572,7 @@ // btnDeleteLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnDeleteLg.Enabled = false; - btnDeleteLg.Location = new System.Drawing.Point(289, 284); + btnDeleteLg.Location = new System.Drawing.Point(289, 240); btnDeleteLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnDeleteLg.Name = "btnDeleteLg"; btnDeleteLg.Size = new System.Drawing.Size(88, 27); @@ -558,7 +585,7 @@ // btnApplyLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnApplyLg.Enabled = false; - btnApplyLg.Location = new System.Drawing.Point(6, 284); + btnApplyLg.Location = new System.Drawing.Point(6, 240); btnApplyLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnApplyLg.Name = "btnApplyLg"; btnApplyLg.Size = new System.Drawing.Size(88, 27); @@ -581,7 +608,7 @@ // lblLgPresetDevice.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; lblLgPresetDevice.AutoSize = true; - lblLgPresetDevice.Location = new System.Drawing.Point(6, 351); + lblLgPresetDevice.Location = new System.Drawing.Point(6, 307); lblLgPresetDevice.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); lblLgPresetDevice.Name = "lblLgPresetDevice"; lblLgPresetDevice.Size = new System.Drawing.Size(45, 15); @@ -591,7 +618,7 @@ // btnAddLg // btnAddLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; - btnAddLg.Location = new System.Drawing.Point(195, 284); + btnAddLg.Location = new System.Drawing.Point(195, 240); btnAddLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnAddLg.Name = "btnAddLg"; btnAddLg.Size = new System.Drawing.Size(88, 27); @@ -604,7 +631,7 @@ // edtShortcutLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; edtShortcutLg.Enabled = false; - edtShortcutLg.Location = new System.Drawing.Point(100, 411); + edtShortcutLg.Location = new System.Drawing.Point(100, 367); edtShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); edtShortcutLg.Name = "edtShortcutLg"; edtShortcutLg.ReadOnly = true; @@ -638,7 +665,7 @@ // btnLgRefreshApps.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnLgRefreshApps.Enabled = false; - btnLgRefreshApps.Location = new System.Drawing.Point(341, 378); + btnLgRefreshApps.Location = new System.Drawing.Point(341, 334); btnLgRefreshApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnLgRefreshApps.Name = "btnLgRefreshApps"; btnLgRefreshApps.Size = new System.Drawing.Size(88, 27); @@ -651,7 +678,7 @@ // label2.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; label2.AutoSize = true; - label2.Location = new System.Drawing.Point(6, 415); + label2.Location = new System.Drawing.Point(6, 371); label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label2.Name = "label2"; label2.Size = new System.Drawing.Size(55, 15); @@ -662,7 +689,7 @@ // label1.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; label1.AutoSize = true; - label1.Location = new System.Drawing.Point(6, 321); + label1.Location = new System.Drawing.Point(6, 277); label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label1.Name = "label1"; label1.Size = new System.Drawing.Size(42, 15); @@ -684,7 +711,7 @@ // edtNameLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; edtNameLg.Enabled = false; - edtNameLg.Location = new System.Drawing.Point(100, 318); + edtNameLg.Location = new System.Drawing.Point(100, 274); edtNameLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); edtNameLg.Name = "edtNameLg"; edtNameLg.Size = new System.Drawing.Size(233, 23); @@ -694,7 +721,7 @@ // btnSetShortcutLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnSetShortcutLg.Enabled = false; - btnSetShortcutLg.Location = new System.Drawing.Point(384, 284); + btnSetShortcutLg.Location = new System.Drawing.Point(384, 240); btnSetShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnSetShortcutLg.Name = "btnSetShortcutLg"; btnSetShortcutLg.Size = new System.Drawing.Size(88, 27); @@ -707,7 +734,7 @@ // edtStepsLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; edtStepsLg.Enabled = false; - edtStepsLg.Location = new System.Drawing.Point(100, 440); + edtStepsLg.Location = new System.Drawing.Point(100, 432); edtStepsLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); edtStepsLg.Multiline = true; edtStepsLg.Name = "edtStepsLg"; @@ -719,7 +746,7 @@ btnLgAddButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; btnLgAddButton.ContextMenuStrip = mnuLgButtons; btnLgAddButton.Enabled = false; - btnLgAddButton.Location = new System.Drawing.Point(807, 439); + btnLgAddButton.Location = new System.Drawing.Point(807, 431); btnLgAddButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnLgAddButton.Name = "btnLgAddButton"; btnLgAddButton.Size = new System.Drawing.Size(88, 27); @@ -771,7 +798,7 @@ // btnCloneLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; btnCloneLg.Enabled = false; - btnCloneLg.Location = new System.Drawing.Point(100, 284); + btnCloneLg.Location = new System.Drawing.Point(100, 240); btnCloneLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); btnCloneLg.Name = "btnCloneLg"; btnCloneLg.Size = new System.Drawing.Size(88, 27); @@ -784,7 +811,7 @@ // lblStepsLg.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left; lblStepsLg.AutoSize = true; - lblStepsLg.Location = new System.Drawing.Point(6, 445); + lblStepsLg.Location = new System.Drawing.Point(6, 437); lblStepsLg.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); lblStepsLg.Name = "lblStepsLg"; lblStepsLg.Size = new System.Drawing.Size(38, 15); @@ -935,5 +962,8 @@ private System.Windows.Forms.ToolStripMenuItem mnuLgSetSvcMenuFlag; private System.Windows.Forms.ToolStripMenuItem miLgFullServiceMenuEnable; private System.Windows.Forms.ToolStripMenuItem miLgFullServiceMenuDisable; + private System.Windows.Forms.Label lblLgPresetConnectedDisplaysRegex; + private System.Windows.Forms.TextBox edtLgPresetConnectedDisplaysRegex; + private System.Windows.Forms.ToolTip toolTipLgPreset; } } diff --git a/ColorControl/Services/LG/LgPanel.cs b/ColorControl/Services/LG/LgPanel.cs index 8276caa..64cc640 100644 --- a/ColorControl/Services/LG/LgPanel.cs +++ b/ColorControl/Services/LG/LgPanel.cs @@ -172,6 +172,7 @@ namespace ColorControl.Services.LG btnLgPresetEditTriggerConditions.Enabled = enabled; edtLgPresetIncludedProcesses.Enabled = enabled; edtLgPresetExcludedProcesses.Enabled = enabled; + edtLgPresetConnectedDisplaysRegex.Enabled = enabled; var preset = GetSelectedLgPreset(); @@ -208,6 +209,7 @@ namespace ColorControl.Services.LG edtLgPresetIncludedProcesses.Text = trigger?.IncludedProcesses?.Join(", ") ?? string.Empty; edtLgPresetExcludedProcesses.Text = trigger?.ExcludedProcesses?.Join(", ") ?? string.Empty; + edtLgPresetConnectedDisplaysRegex.Text = trigger?.ConnectedDisplaysRegex ?? string.Empty; } else { @@ -223,6 +225,7 @@ namespace ColorControl.Services.LG edtLgPresetTriggerConditions.Tag = 0; edtLgPresetIncludedProcesses.Text = string.Empty; edtLgPresetExcludedProcesses.Text = string.Empty; + edtLgPresetConnectedDisplaysRegex.Text = string.Empty; } } @@ -281,7 +284,8 @@ namespace ColorControl.Services.LG preset.UpdateTrigger(triggerType, (PresetConditionType)edtLgPresetTriggerConditions.Tag, edtLgPresetIncludedProcesses.Text, - edtLgPresetExcludedProcesses.Text); + edtLgPresetExcludedProcesses.Text, + edtLgPresetConnectedDisplaysRegex.Text); preset.shortcut = shortcut; diff --git a/ColorControl/Services/LG/LgPanel.resx b/ColorControl/Services/LG/LgPanel.resx index 203d97e..426958f 100644 --- a/ColorControl/Services/LG/LgPanel.resx +++ b/ColorControl/Services/LG/LgPanel.resx @@ -1,7 +1,7 @@