mirror of
https://github.com/Maassoft/ColorControl.git
synced 2026-10-18 23:07:15 -05:00
Merge branch 'master' of https://github.com/Maassoft/ColorControl
This commit is contained in:
commit
c2b220c70b
17 files changed
+323
-106
No files matched your search
@@ -27,6 +27,11 @@
|
||||
<label class="form-label" for="excludedProcesses">Excluded processes</label>
|
||||
<input class="form-control" type="text" @bind="trigger.ExcludedProcessesAsString" />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label" for="connectedDisplays">Connected displays Regex</label>
|
||||
<input class="form-control" type="text" @bind="trigger.ConnectedDisplaysRegex"
|
||||
title="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." />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -342,6 +342,7 @@ namespace ColorControl
|
||||
services.AddSingleton<ProcessEventDispatcher>();
|
||||
services.AddSingleton<WindowMessageDispatcher>();
|
||||
services.AddSingleton<KeyboardShortcutDispatcher>();
|
||||
services.AddSingleton<DisplayChangeEventDispatcher>();
|
||||
services.AddSingleton<MainForm>();
|
||||
services.AddSingleton<LogWindow>();
|
||||
services.AddSingleton<BrowserWindow>();
|
||||
|
||||
+64
-34
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
@@ -117,6 +117,9 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="toolTipLgPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>471, 16</value>
|
||||
</metadata>
|
||||
<metadata name="mnuLgExpert.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace ColorControl.Services.LG
|
||||
private readonly PowerEventDispatcher _powerEventDispatcher;
|
||||
private readonly SessionSwitchDispatcher _sessionSwitchDispatcher;
|
||||
private readonly ProcessEventDispatcher _processEventDispatcher;
|
||||
private readonly DisplayChangeEventDispatcher _displayChangeEventDispatcher;
|
||||
private readonly ServiceManager _serviceManager;
|
||||
private LgDevice _selectedDevice;
|
||||
private string _rcButtonsFilename;
|
||||
@@ -72,12 +73,22 @@ namespace ColorControl.Services.LG
|
||||
public static readonly int SHORTCUTID_LGQA = -202;
|
||||
public static readonly int SHORTCUTID_GAMEBAR = -101;
|
||||
|
||||
public LgService(GlobalContext globalContext, PowerEventDispatcher powerEventDispatcher, SessionSwitchDispatcher sessionSwitchDispatcher, ProcessEventDispatcher processEventDispatcher, ServiceManager serviceManager, RestartDetector restartDetector, WinApiService winApiService, WinApiAdminService winApiAdminService) : base(globalContext)
|
||||
public LgService(
|
||||
GlobalContext globalContext,
|
||||
PowerEventDispatcher powerEventDispatcher,
|
||||
SessionSwitchDispatcher sessionSwitchDispatcher,
|
||||
ProcessEventDispatcher processEventDispatcher,
|
||||
DisplayChangeEventDispatcher displayChangeEventDispatcher,
|
||||
ServiceManager serviceManager,
|
||||
RestartDetector restartDetector,
|
||||
WinApiService winApiService,
|
||||
WinApiAdminService winApiAdminService) : base(globalContext)
|
||||
{
|
||||
_allowPowerOn = globalContext.StartUpParams.RunningFromScheduledTask;
|
||||
_powerEventDispatcher = powerEventDispatcher;
|
||||
_sessionSwitchDispatcher = sessionSwitchDispatcher;
|
||||
_processEventDispatcher = processEventDispatcher;
|
||||
_displayChangeEventDispatcher = displayChangeEventDispatcher;
|
||||
_serviceManager = serviceManager;
|
||||
LgPreset.GetDeviceName += LgPreset_GetDeviceName;
|
||||
LgPreset.GetAppName += LgPreset_GetAppName;
|
||||
@@ -466,10 +477,7 @@ namespace ColorControl.Services.LG
|
||||
SetShortcuts(SHORTCUTID_LGQA, Config.QuickAccessShortcut);
|
||||
|
||||
var keyboardShortcutDispatcher = _globalContext.ServiceProvider.GetService<KeyboardShortcutDispatcher>();
|
||||
if (keyboardShortcutDispatcher != null)
|
||||
{
|
||||
keyboardShortcutDispatcher.RegisterShortcut(SHORTCUTID_GAMEBAR, Config.GameBarShortcut);
|
||||
}
|
||||
keyboardShortcutDispatcher?.RegisterShortcut(SHORTCUTID_GAMEBAR, Config.GameBarShortcut);
|
||||
|
||||
_powerEventDispatcher.RegisterAsyncEventHandler(PowerEventDispatcher.Event_Startup, PowerStateChanged);
|
||||
_powerEventDispatcher.RegisterEventHandler(PowerEventDispatcher.Event_Suspend, PowerModeChanged);
|
||||
@@ -481,6 +489,13 @@ namespace ColorControl.Services.LG
|
||||
_sessionSwitchDispatcher.RegisterEventHandler(SessionSwitchDispatcher.Event_SessionSwitch, SessionSwitched);
|
||||
|
||||
_processEventDispatcher.RegisterAsyncEventHandler(ProcessEventDispatcher.Event_ProcessChanged, ProcessChanged);
|
||||
|
||||
_displayChangeEventDispatcher.RegisterAsyncEventHandler(DisplayChangeEventDispatcher.Event_DisplayChanged, DisplayChanged);
|
||||
}
|
||||
|
||||
private async Task DisplayChanged(object sender, DisplayChangedEventArgs e, CancellationToken ct)
|
||||
{
|
||||
await ExecutePresetsForEvent(PresetTriggerType.DisplayChange);
|
||||
}
|
||||
|
||||
private async Task PowerStateChanged(object sender, PowerStateChangedEventArgs e, CancellationToken token)
|
||||
@@ -633,8 +648,14 @@ namespace ColorControl.Services.LG
|
||||
return;
|
||||
}
|
||||
|
||||
var applicableDevices = Devices.Where(d => d.PowerOffOnScreenSaver || d.PowerOnAfterScreenSaver || d.TriggersEnabled && _presets.Any(p => p.Triggers.Any(t => t.Trigger != PresetTriggerType.None) &&
|
||||
((string.IsNullOrEmpty(p.DeviceMacAddress) && d == SelectedDevice) || p.DeviceMacAddress.Equals(d.MacAddress, StringComparison.OrdinalIgnoreCase)))).ToList();
|
||||
var applicableDevices = Devices.Where(d =>
|
||||
d.PowerOffOnScreenSaver
|
||||
|| d.PowerOnAfterScreenSaver
|
||||
|| (d.TriggersEnabled
|
||||
// only these trigger types are ever triggered by a process changed event
|
||||
&& _presets.Any(p => p.Triggers.Any(t => t.Trigger == PresetTriggerType.ProcessSwitch || t.Trigger == PresetTriggerType.ScreensaverStart || t.Trigger == PresetTriggerType.ScreensaverStop)
|
||||
&& ((string.IsNullOrEmpty(p.DeviceMacAddress) && d == SelectedDevice) || p.DeviceMacAddress.Equals(d.MacAddress, StringComparison.OrdinalIgnoreCase)))))
|
||||
.ToList();
|
||||
|
||||
if (!applicableDevices.Any())
|
||||
{
|
||||
|
||||
+69
-39
@@ -30,8 +30,11 @@
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
scSamsungController = new System.Windows.Forms.SplitContainer();
|
||||
lblSamsungPresetConnectedDisplaysRegex = new System.Windows.Forms.Label();
|
||||
edtSamsungPresetConnectedDisplaysRegex = new System.Windows.Forms.TextBox();
|
||||
btnExpert = new System.Windows.Forms.Button();
|
||||
mnuExpert = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
miExpertDummy = new System.Windows.Forms.ToolStripMenuItem();
|
||||
btnSamsungDeviceOptionsSettings = new System.Windows.Forms.Button();
|
||||
btnSamsungSettings = new System.Windows.Forms.Button();
|
||||
chkSamsungQuickAccess = new System.Windows.Forms.CheckBox();
|
||||
@@ -87,7 +90,7 @@
|
||||
mnuLgSettings = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
miTestPowerOffOn = new System.Windows.Forms.ToolStripMenuItem();
|
||||
miNvSettings = new System.Windows.Forms.ToolStripMenuItem();
|
||||
miExpertDummy = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolTipSamsungPreset = new System.Windows.Forms.ToolTip(components);
|
||||
((System.ComponentModel.ISupportInitialize)scSamsungController).BeginInit();
|
||||
scSamsungController.Panel1.SuspendLayout();
|
||||
scSamsungController.SuspendLayout();
|
||||
@@ -105,6 +108,8 @@
|
||||
//
|
||||
// scSamsungController.Panel1
|
||||
//
|
||||
scSamsungController.Panel1.Controls.Add(lblSamsungPresetConnectedDisplaysRegex);
|
||||
scSamsungController.Panel1.Controls.Add(edtSamsungPresetConnectedDisplaysRegex);
|
||||
scSamsungController.Panel1.Controls.Add(btnExpert);
|
||||
scSamsungController.Panel1.Controls.Add(btnSamsungDeviceOptionsSettings);
|
||||
scSamsungController.Panel1.Controls.Add(btnSamsungSettings);
|
||||
@@ -159,6 +164,28 @@
|
||||
scSamsungController.SplitterWidth = 5;
|
||||
scSamsungController.TabIndex = 43;
|
||||
//
|
||||
// lblSamsungPresetConnectedDisplaysRegex
|
||||
//
|
||||
lblSamsungPresetConnectedDisplaysRegex.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblSamsungPresetConnectedDisplaysRegex.AutoSize = true;
|
||||
lblSamsungPresetConnectedDisplaysRegex.Location = new System.Drawing.Point(475, 406);
|
||||
lblSamsungPresetConnectedDisplaysRegex.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
|
||||
lblSamsungPresetConnectedDisplaysRegex.Name = "lblSamsungPresetConnectedDisplaysRegex";
|
||||
lblSamsungPresetConnectedDisplaysRegex.Size = new System.Drawing.Size(149, 15);
|
||||
lblSamsungPresetConnectedDisplaysRegex.TabIndex = 68;
|
||||
lblSamsungPresetConnectedDisplaysRegex.Text = "Connected Displays Regex:";
|
||||
//
|
||||
// edtSamsungPresetConnectedDisplaysRegex
|
||||
//
|
||||
edtSamsungPresetConnectedDisplaysRegex.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
edtSamsungPresetConnectedDisplaysRegex.Enabled = false;
|
||||
edtSamsungPresetConnectedDisplaysRegex.Location = new System.Drawing.Point(636, 401);
|
||||
edtSamsungPresetConnectedDisplaysRegex.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
|
||||
edtSamsungPresetConnectedDisplaysRegex.Name = "edtSamsungPresetConnectedDisplaysRegex";
|
||||
edtSamsungPresetConnectedDisplaysRegex.Size = new System.Drawing.Size(254, 23);
|
||||
edtSamsungPresetConnectedDisplaysRegex.TabIndex = 67;
|
||||
toolTipSamsungPreset.SetToolTip(edtSamsungPresetConnectedDisplaysRegex, "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.");
|
||||
//
|
||||
// btnExpert
|
||||
//
|
||||
btnExpert.ContextMenuStrip = mnuExpert;
|
||||
@@ -176,9 +203,15 @@
|
||||
mnuExpert.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
mnuExpert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { miExpertDummy });
|
||||
mnuExpert.Name = "mnuLgButtons";
|
||||
mnuExpert.Size = new System.Drawing.Size(181, 48);
|
||||
mnuExpert.Size = new System.Drawing.Size(118, 26);
|
||||
mnuExpert.Opening += mnuExpert_Opening;
|
||||
//
|
||||
// miExpertDummy
|
||||
//
|
||||
miExpertDummy.Name = "miExpertDummy";
|
||||
miExpertDummy.Size = new System.Drawing.Size(117, 22);
|
||||
miExpertDummy.Text = "Dummy";
|
||||
//
|
||||
// btnSamsungDeviceOptionsSettings
|
||||
//
|
||||
btnSamsungDeviceOptionsSettings.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
@@ -195,7 +228,7 @@
|
||||
// btnSamsungSettings
|
||||
//
|
||||
btnSamsungSettings.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnSamsungSettings.Location = new System.Drawing.Point(807, 284);
|
||||
btnSamsungSettings.Location = new System.Drawing.Point(807, 243);
|
||||
btnSamsungSettings.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnSamsungSettings.Name = "btnSamsungSettings";
|
||||
btnSamsungSettings.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -209,7 +242,7 @@
|
||||
chkSamsungQuickAccess.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
chkSamsungQuickAccess.AutoSize = true;
|
||||
chkSamsungQuickAccess.Enabled = false;
|
||||
chkSamsungQuickAccess.Location = new System.Drawing.Point(341, 320);
|
||||
chkSamsungQuickAccess.Location = new System.Drawing.Point(341, 279);
|
||||
chkSamsungQuickAccess.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkSamsungQuickAccess.Name = "chkSamsungQuickAccess";
|
||||
chkSamsungQuickAccess.Size = new System.Drawing.Size(96, 19);
|
||||
@@ -245,7 +278,7 @@
|
||||
//
|
||||
edtSamsungPresetDescription.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
edtSamsungPresetDescription.Enabled = false;
|
||||
edtSamsungPresetDescription.Location = new System.Drawing.Point(100, 489);
|
||||
edtSamsungPresetDescription.Location = new System.Drawing.Point(100, 484);
|
||||
edtSamsungPresetDescription.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtSamsungPresetDescription.Multiline = true;
|
||||
edtSamsungPresetDescription.Name = "edtSamsungPresetDescription";
|
||||
@@ -256,7 +289,7 @@
|
||||
//
|
||||
lblSamsungPresetDescription.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblSamsungPresetDescription.AutoSize = true;
|
||||
lblSamsungPresetDescription.Location = new System.Drawing.Point(6, 494);
|
||||
lblSamsungPresetDescription.Location = new System.Drawing.Point(6, 489);
|
||||
lblSamsungPresetDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblSamsungPresetDescription.Name = "lblSamsungPresetDescription";
|
||||
lblSamsungPresetDescription.Size = new System.Drawing.Size(70, 15);
|
||||
@@ -279,7 +312,7 @@
|
||||
//
|
||||
btnSamsungPresetEditTriggerConditions.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
btnSamsungPresetEditTriggerConditions.Enabled = false;
|
||||
btnSamsungPresetEditTriggerConditions.Location = new System.Drawing.Point(804, 347);
|
||||
btnSamsungPresetEditTriggerConditions.Location = new System.Drawing.Point(804, 306);
|
||||
btnSamsungPresetEditTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnSamsungPresetEditTriggerConditions.Name = "btnSamsungPresetEditTriggerConditions";
|
||||
btnSamsungPresetEditTriggerConditions.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -292,7 +325,7 @@
|
||||
//
|
||||
edtSamsungPresetTriggerConditions.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
edtSamsungPresetTriggerConditions.Enabled = false;
|
||||
edtSamsungPresetTriggerConditions.Location = new System.Drawing.Point(601, 349);
|
||||
edtSamsungPresetTriggerConditions.Location = new System.Drawing.Point(601, 308);
|
||||
edtSamsungPresetTriggerConditions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtSamsungPresetTriggerConditions.Name = "edtSamsungPresetTriggerConditions";
|
||||
edtSamsungPresetTriggerConditions.ReadOnly = true;
|
||||
@@ -303,7 +336,7 @@
|
||||
//
|
||||
lblSamsungPresetExcludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblSamsungPresetExcludedProcesses.AutoSize = true;
|
||||
lblSamsungPresetExcludedProcesses.Location = new System.Drawing.Point(475, 414);
|
||||
lblSamsungPresetExcludedProcesses.Location = new System.Drawing.Point(475, 373);
|
||||
lblSamsungPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblSamsungPresetExcludedProcesses.Name = "lblSamsungPresetExcludedProcesses";
|
||||
lblSamsungPresetExcludedProcesses.Size = new System.Drawing.Size(112, 15);
|
||||
@@ -314,7 +347,7 @@
|
||||
//
|
||||
edtSamsungPresetExcludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
edtSamsungPresetExcludedProcesses.Enabled = false;
|
||||
edtSamsungPresetExcludedProcesses.Location = new System.Drawing.Point(601, 411);
|
||||
edtSamsungPresetExcludedProcesses.Location = new System.Drawing.Point(601, 370);
|
||||
edtSamsungPresetExcludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtSamsungPresetExcludedProcesses.Name = "edtSamsungPresetExcludedProcesses";
|
||||
edtSamsungPresetExcludedProcesses.Size = new System.Drawing.Size(289, 23);
|
||||
@@ -324,7 +357,7 @@
|
||||
//
|
||||
lblSamsungPresetIncludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblSamsungPresetIncludedProcesses.AutoSize = true;
|
||||
lblSamsungPresetIncludedProcesses.Location = new System.Drawing.Point(475, 384);
|
||||
lblSamsungPresetIncludedProcesses.Location = new System.Drawing.Point(475, 343);
|
||||
lblSamsungPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblSamsungPresetIncludedProcesses.Name = "lblSamsungPresetIncludedProcesses";
|
||||
lblSamsungPresetIncludedProcesses.Size = new System.Drawing.Size(110, 15);
|
||||
@@ -335,7 +368,7 @@
|
||||
//
|
||||
edtSamsungPresetIncludedProcesses.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
edtSamsungPresetIncludedProcesses.Enabled = false;
|
||||
edtSamsungPresetIncludedProcesses.Location = new System.Drawing.Point(601, 381);
|
||||
edtSamsungPresetIncludedProcesses.Location = new System.Drawing.Point(601, 340);
|
||||
edtSamsungPresetIncludedProcesses.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtSamsungPresetIncludedProcesses.Name = "edtSamsungPresetIncludedProcesses";
|
||||
edtSamsungPresetIncludedProcesses.Size = new System.Drawing.Size(289, 23);
|
||||
@@ -345,7 +378,7 @@
|
||||
//
|
||||
lblSamsungPresetTriggerCondition.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblSamsungPresetTriggerCondition.AutoSize = true;
|
||||
lblSamsungPresetTriggerCondition.Location = new System.Drawing.Point(475, 353);
|
||||
lblSamsungPresetTriggerCondition.Location = new System.Drawing.Point(475, 312);
|
||||
lblSamsungPresetTriggerCondition.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblSamsungPresetTriggerCondition.Name = "lblSamsungPresetTriggerCondition";
|
||||
lblSamsungPresetTriggerCondition.Size = new System.Drawing.Size(63, 15);
|
||||
@@ -358,7 +391,7 @@
|
||||
cbxSamsungPresetTrigger.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbxSamsungPresetTrigger.Enabled = false;
|
||||
cbxSamsungPresetTrigger.FormattingEnabled = true;
|
||||
cbxSamsungPresetTrigger.Location = new System.Drawing.Point(601, 318);
|
||||
cbxSamsungPresetTrigger.Location = new System.Drawing.Point(601, 277);
|
||||
cbxSamsungPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbxSamsungPresetTrigger.Name = "cbxSamsungPresetTrigger";
|
||||
cbxSamsungPresetTrigger.Size = new System.Drawing.Size(289, 23);
|
||||
@@ -368,7 +401,7 @@
|
||||
//
|
||||
lblSamsungPresetTrigger.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblSamsungPresetTrigger.AutoSize = true;
|
||||
lblSamsungPresetTrigger.Location = new System.Drawing.Point(475, 321);
|
||||
lblSamsungPresetTrigger.Location = new System.Drawing.Point(475, 280);
|
||||
lblSamsungPresetTrigger.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblSamsungPresetTrigger.Name = "lblSamsungPresetTrigger";
|
||||
lblSamsungPresetTrigger.Size = new System.Drawing.Size(46, 15);
|
||||
@@ -429,7 +462,7 @@
|
||||
cbxSamsungApps.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbxSamsungApps.Enabled = false;
|
||||
cbxSamsungApps.FormattingEnabled = true;
|
||||
cbxSamsungApps.Location = new System.Drawing.Point(100, 380);
|
||||
cbxSamsungApps.Location = new System.Drawing.Point(100, 339);
|
||||
cbxSamsungApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbxSamsungApps.Name = "cbxSamsungApps";
|
||||
cbxSamsungApps.Size = new System.Drawing.Size(233, 23);
|
||||
@@ -446,7 +479,7 @@
|
||||
lvSamsungPresets.MultiSelect = false;
|
||||
lvSamsungPresets.Name = "lvSamsungPresets";
|
||||
lvSamsungPresets.ShowItemToolTips = true;
|
||||
lvSamsungPresets.Size = new System.Drawing.Size(888, 126);
|
||||
lvSamsungPresets.Size = new System.Drawing.Size(888, 85);
|
||||
lvSamsungPresets.TabIndex = 8;
|
||||
lvSamsungPresets.UseCompatibleStateImageBehavior = false;
|
||||
lvSamsungPresets.View = System.Windows.Forms.View.Details;
|
||||
@@ -459,7 +492,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, 343);
|
||||
label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new System.Drawing.Size(32, 15);
|
||||
@@ -472,7 +505,7 @@
|
||||
cbxSamsungPresetDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbxSamsungPresetDevice.Enabled = false;
|
||||
cbxSamsungPresetDevice.FormattingEnabled = true;
|
||||
cbxSamsungPresetDevice.Location = new System.Drawing.Point(100, 348);
|
||||
cbxSamsungPresetDevice.Location = new System.Drawing.Point(100, 307);
|
||||
cbxSamsungPresetDevice.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbxSamsungPresetDevice.Name = "cbxSamsungPresetDevice";
|
||||
cbxSamsungPresetDevice.Size = new System.Drawing.Size(370, 23);
|
||||
@@ -482,7 +515,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, 243);
|
||||
btnDeleteLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnDeleteLg.Name = "btnDeleteLg";
|
||||
btnDeleteLg.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -495,7 +528,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, 243);
|
||||
btnApplyLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnApplyLg.Name = "btnApplyLg";
|
||||
btnApplyLg.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -518,7 +551,7 @@
|
||||
//
|
||||
lblSamsungPresetDevice.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblSamsungPresetDevice.AutoSize = true;
|
||||
lblSamsungPresetDevice.Location = new System.Drawing.Point(6, 351);
|
||||
lblSamsungPresetDevice.Location = new System.Drawing.Point(6, 310);
|
||||
lblSamsungPresetDevice.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblSamsungPresetDevice.Name = "lblSamsungPresetDevice";
|
||||
lblSamsungPresetDevice.Size = new System.Drawing.Size(45, 15);
|
||||
@@ -528,7 +561,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, 243);
|
||||
btnAddLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnAddLg.Name = "btnAddLg";
|
||||
btnAddLg.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -541,7 +574,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, 370);
|
||||
edtShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtShortcutLg.Name = "edtShortcutLg";
|
||||
edtShortcutLg.ReadOnly = true;
|
||||
@@ -575,7 +608,7 @@
|
||||
//
|
||||
btnSamsungRefreshApps.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
btnSamsungRefreshApps.Enabled = false;
|
||||
btnSamsungRefreshApps.Location = new System.Drawing.Point(341, 378);
|
||||
btnSamsungRefreshApps.Location = new System.Drawing.Point(341, 337);
|
||||
btnSamsungRefreshApps.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnSamsungRefreshApps.Name = "btnSamsungRefreshApps";
|
||||
btnSamsungRefreshApps.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -589,7 +622,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, 374);
|
||||
label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(55, 15);
|
||||
@@ -600,7 +633,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, 280);
|
||||
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(42, 15);
|
||||
@@ -622,7 +655,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, 277);
|
||||
edtNameLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtNameLg.Name = "edtNameLg";
|
||||
edtNameLg.Size = new System.Drawing.Size(233, 23);
|
||||
@@ -632,7 +665,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, 243);
|
||||
btnSetShortcutLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnSetShortcutLg.Name = "btnSetShortcutLg";
|
||||
btnSetShortcutLg.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -645,7 +678,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, 435);
|
||||
edtStepsLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtStepsLg.Multiline = true;
|
||||
edtStepsLg.Name = "edtStepsLg";
|
||||
@@ -657,7 +690,7 @@
|
||||
btnSamsungAddButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnSamsungAddButton.ContextMenuStrip = mnuLgButtons;
|
||||
btnSamsungAddButton.Enabled = false;
|
||||
btnSamsungAddButton.Location = new System.Drawing.Point(807, 439);
|
||||
btnSamsungAddButton.Location = new System.Drawing.Point(807, 434);
|
||||
btnSamsungAddButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnSamsungAddButton.Name = "btnSamsungAddButton";
|
||||
btnSamsungAddButton.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -709,7 +742,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, 243);
|
||||
btnCloneLg.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnCloneLg.Name = "btnCloneLg";
|
||||
btnCloneLg.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -722,7 +755,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, 440);
|
||||
lblStepsLg.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblStepsLg.Name = "lblStepsLg";
|
||||
lblStepsLg.Size = new System.Drawing.Size(38, 15);
|
||||
@@ -787,12 +820,6 @@
|
||||
miNvSettings.Text = "Settings";
|
||||
miNvSettings.Click += miNvSettings_Click;
|
||||
//
|
||||
// miExpertDummy
|
||||
//
|
||||
miExpertDummy.Name = "miExpertDummy";
|
||||
miExpertDummy.Size = new System.Drawing.Size(180, 22);
|
||||
miExpertDummy.Text = "Dummy";
|
||||
//
|
||||
// SamsungPanel
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
@@ -872,5 +899,8 @@
|
||||
private System.Windows.Forms.Button btnExpert;
|
||||
private System.Windows.Forms.ContextMenuStrip mnuExpert;
|
||||
private System.Windows.Forms.ToolStripMenuItem miExpertDummy;
|
||||
private System.Windows.Forms.Label lblSamsungPresetConnectedDisplaysRegex;
|
||||
private System.Windows.Forms.TextBox edtSamsungPresetConnectedDisplaysRegex;
|
||||
private System.Windows.Forms.ToolTip toolTipSamsungPreset;
|
||||
}
|
||||
}
|
||||
@@ -179,6 +179,7 @@ namespace ColorControl.Services.Samsung
|
||||
btnSamsungPresetEditTriggerConditions.Enabled = enabled;
|
||||
edtSamsungPresetIncludedProcesses.Enabled = enabled;
|
||||
edtSamsungPresetExcludedProcesses.Enabled = enabled;
|
||||
edtSamsungPresetConnectedDisplaysRegex.Enabled = enabled;
|
||||
|
||||
var preset = GetSelectedPreset();
|
||||
|
||||
@@ -215,6 +216,7 @@ namespace ColorControl.Services.Samsung
|
||||
|
||||
edtSamsungPresetIncludedProcesses.Text = trigger?.IncludedProcesses?.Join(", ") ?? string.Empty;
|
||||
edtSamsungPresetExcludedProcesses.Text = trigger?.ExcludedProcesses?.Join(", ") ?? string.Empty;
|
||||
edtSamsungPresetConnectedDisplaysRegex.Text = trigger?.ConnectedDisplaysRegex ?? string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -230,6 +232,7 @@ namespace ColorControl.Services.Samsung
|
||||
edtSamsungPresetTriggerConditions.Tag = 0;
|
||||
edtSamsungPresetIncludedProcesses.Text = string.Empty;
|
||||
edtSamsungPresetExcludedProcesses.Text = string.Empty;
|
||||
edtSamsungPresetConnectedDisplaysRegex.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +291,8 @@ namespace ColorControl.Services.Samsung
|
||||
preset.UpdateTrigger(triggerType,
|
||||
(PresetConditionType)edtSamsungPresetTriggerConditions.Tag,
|
||||
edtSamsungPresetIncludedProcesses.Text,
|
||||
edtSamsungPresetExcludedProcesses.Text);
|
||||
edtSamsungPresetExcludedProcesses.Text,
|
||||
edtSamsungPresetConnectedDisplaysRegex.Text);
|
||||
|
||||
preset.shortcut = shortcut;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
@@ -48,7 +48,7 @@
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
@@ -117,6 +117,9 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="toolTipSamsungPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>471, 16</value>
|
||||
</metadata>
|
||||
<metadata name="mnuExpert.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>147, 17</value>
|
||||
</metadata>
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace ColorControl.Services.Samsung
|
||||
private bool _allowPowerOn;
|
||||
private ServiceManager _serviceManager;
|
||||
private readonly PowerEventDispatcher _powerEventDispatcher;
|
||||
private readonly DisplayChangeEventDispatcher _displayChangeEventDispatcher;
|
||||
private readonly SessionSwitchDispatcher _sessionSwitchDispatcher;
|
||||
private readonly RestartDetector _restartDetector;
|
||||
private readonly ProcessEventDispatcher _processEventDispatcher;
|
||||
@@ -46,12 +47,21 @@ namespace ColorControl.Services.Samsung
|
||||
|
||||
public static readonly int SHORTCUTID_SAMSUNGQA = -204;
|
||||
|
||||
public SamsungService(GlobalContext globalContext, ServiceManager serviceManager, PowerEventDispatcher powerEventDispatcher, SessionSwitchDispatcher sessionSwitchDispatcher, RestartDetector restartDetector, ProcessEventDispatcher processEventDispatcher, WinApiAdminService winApiAdminService) : base(globalContext)
|
||||
public SamsungService(
|
||||
GlobalContext globalContext,
|
||||
ServiceManager serviceManager,
|
||||
PowerEventDispatcher powerEventDispatcher,
|
||||
DisplayChangeEventDispatcher displayChangeEventDispatcher,
|
||||
SessionSwitchDispatcher sessionSwitchDispatcher,
|
||||
RestartDetector restartDetector,
|
||||
ProcessEventDispatcher processEventDispatcher,
|
||||
WinApiAdminService winApiAdminService) : base(globalContext)
|
||||
{
|
||||
_appContext = globalContext;
|
||||
_allowPowerOn = _appContext.StartUpParams.RunningFromScheduledTask;
|
||||
_serviceManager = serviceManager;
|
||||
_powerEventDispatcher = powerEventDispatcher;
|
||||
_displayChangeEventDispatcher = displayChangeEventDispatcher;
|
||||
_sessionSwitchDispatcher = sessionSwitchDispatcher;
|
||||
_restartDetector = restartDetector;
|
||||
_processEventDispatcher = processEventDispatcher;
|
||||
@@ -111,6 +121,7 @@ namespace ColorControl.Services.Samsung
|
||||
_powerEventDispatcher.RegisterAsyncEventHandler(PowerEventDispatcher.Event_Resume, PowerModeResume);
|
||||
_powerEventDispatcher.RegisterEventHandler(PowerEventDispatcher.Event_Shutdown, PowerModeChanged);
|
||||
_processEventDispatcher.RegisterAsyncEventHandler(ProcessEventDispatcher.Event_ProcessChanged, ProcessChanged);
|
||||
_displayChangeEventDispatcher.RegisterAsyncEventHandler(DisplayChangeEventDispatcher.Event_DisplayChanged, DisplayChanged);
|
||||
}
|
||||
|
||||
public override List<string> GetInfo()
|
||||
@@ -118,6 +129,11 @@ namespace ColorControl.Services.Samsung
|
||||
return [$"{_presets.Count} presets", $"{Devices?.Count ?? 0} devices"];
|
||||
}
|
||||
|
||||
private async Task DisplayChanged(object sender, DisplayChangedEventArgs e, CancellationToken ct)
|
||||
{
|
||||
await ExecutePresetsForEvent(PresetTriggerType.DisplayChange);
|
||||
}
|
||||
|
||||
private async Task PowerStateChanged(object sender, PowerStateChangedEventArgs e, CancellationToken token)
|
||||
{
|
||||
await RefreshDevices(afterStartUp: true);
|
||||
@@ -532,8 +548,14 @@ namespace ColorControl.Services.Samsung
|
||||
return;
|
||||
}
|
||||
|
||||
var applicableDevices = Devices.Where(d => d.Options.PowerOffOnScreenSaver || d.Options.PowerOnAfterScreenSaver || d.Options.TriggersEnabled && _presets.Any(p => p.Triggers.Any(t => t.Trigger != PresetTriggerType.None) &&
|
||||
((string.IsNullOrEmpty(p.DeviceMacAddress) && d == SelectedDevice) || p.DeviceMacAddress.Equals(d.MacAddress, StringComparison.OrdinalIgnoreCase)))).ToList();
|
||||
var applicableDevices = Devices.Where(d =>
|
||||
d.Options.PowerOffOnScreenSaver
|
||||
|| d.Options.PowerOnAfterScreenSaver
|
||||
|| (d.Options.TriggersEnabled
|
||||
// only these trigger types are ever triggered by a process changed event
|
||||
&& _presets.Any(p => p.Triggers.Any(t => t.Trigger == PresetTriggerType.ProcessSwitch || t.Trigger == PresetTriggerType.ScreensaverStart || t.Trigger == PresetTriggerType.ScreensaverStop)
|
||||
&& ((string.IsNullOrEmpty(p.DeviceMacAddress) && d == SelectedDevice) || p.DeviceMacAddress.Equals(d.MacAddress, StringComparison.OrdinalIgnoreCase)))))
|
||||
.ToList();
|
||||
|
||||
if (!applicableDevices.Any())
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ public class LgPreset : PresetBase
|
||||
var trigger = preset.Triggers.FirstOrDefault();
|
||||
if (trigger != null)
|
||||
{
|
||||
UpdateTrigger(trigger.Trigger, trigger.Conditions, trigger.IncludedProcessesAsString, trigger.ExcludedProcessesAsString);
|
||||
UpdateTrigger(trigger.Trigger, trigger.Conditions, trigger.IncludedProcessesAsString, trigger.ExcludedProcessesAsString, trigger.ConnectedDisplaysRegex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using ColorControl.Shared.Common;
|
||||
using ColorControl.Shared.EventDispatcher;
|
||||
using ColorControl.Shared.Native;
|
||||
using NStandard;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace ColorControl.Shared.Contracts;
|
||||
|
||||
@@ -26,6 +29,8 @@ public enum PresetTriggerType
|
||||
ScreensaverStart = 7,
|
||||
[Description("Screensaver stop")]
|
||||
ScreensaverStop = 8,
|
||||
[Description("Display Change")]
|
||||
DisplayChange = 9,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
@@ -61,6 +66,7 @@ public class PresetTrigger
|
||||
public PresetTriggerType Trigger { get; set; }
|
||||
public List<string> IncludedProcesses { get; set; }
|
||||
public List<string> ExcludedProcesses { get; set; }
|
||||
public string ConnectedDisplaysRegex { get; set; }
|
||||
public PresetConditionType Conditions { get; set; }
|
||||
|
||||
public string IncludedProcessesAsString
|
||||
@@ -92,10 +98,23 @@ public class PresetTrigger
|
||||
public bool TriggerActive(PresetTriggerContext context)
|
||||
{
|
||||
var active = Conditions == PresetConditionType.None ||
|
||||
(Conditions.HasFlag(PresetConditionType.SDR) ? !context.IsHDRActive : true) && (Conditions.HasFlag(PresetConditionType.HDR) ? context.IsHDRActive : true) &&
|
||||
(Conditions.HasFlag(PresetConditionType.GsyncDisabled) ? !context.IsGsyncActive : true) && (Conditions.HasFlag(PresetConditionType.GsyncEnabled) ? context.IsGsyncActive : true);
|
||||
(!Conditions.HasFlag(PresetConditionType.SDR) || !context.IsHDRActive)
|
||||
&& (!Conditions.HasFlag(PresetConditionType.HDR) || context.IsHDRActive)
|
||||
&& (!Conditions.HasFlag(PresetConditionType.GsyncDisabled) || !context.IsGsyncActive)
|
||||
&& (!Conditions.HasFlag(PresetConditionType.GsyncEnabled) || context.IsGsyncActive);
|
||||
|
||||
if (Trigger == PresetTriggerType.ProcessSwitch && context.Triggers.Contains(Trigger))
|
||||
active = active && context.Triggers.Contains(Trigger);
|
||||
|
||||
if (!ConnectedDisplaysRegex.IsNullOrWhiteSpace())
|
||||
{
|
||||
active = active && CCD.EnumerateDisplayDeviceNames().Any(s =>
|
||||
{
|
||||
var extendedDisplayName = CCD.GetDisplayInfo(s)?.ExtendedName;
|
||||
return extendedDisplayName is not null && Regex.IsMatch(extendedDisplayName, ConnectedDisplaysRegex);
|
||||
});
|
||||
}
|
||||
|
||||
if (Trigger == PresetTriggerType.ProcessSwitch)
|
||||
{
|
||||
var allProcesses = IncludedProcesses.Contains("*");
|
||||
active = active && (allProcesses || (context.ChangedProcesses?.Any() ?? false));
|
||||
@@ -114,14 +133,10 @@ public class PresetTrigger
|
||||
active = included && !excluded && screenSizeCheck && notificationsDisabledCheck;
|
||||
}
|
||||
}
|
||||
else if ((Trigger == PresetTriggerType.ScreensaverStart || Trigger == PresetTriggerType.ScreensaverStop) && context.Triggers.Contains(Trigger))
|
||||
else if (Trigger == PresetTriggerType.ScreensaverStart || Trigger == PresetTriggerType.ScreensaverStop)
|
||||
{
|
||||
active = active && (Trigger == PresetTriggerType.ScreensaverStart && context.ScreenSaverTransitionState == ScreenSaverTransitionState.Started ||
|
||||
Trigger == PresetTriggerType.ScreensaverStop && context.ScreenSaverTransitionState == ScreenSaverTransitionState.Stopped);
|
||||
}
|
||||
else
|
||||
{
|
||||
active = active && context.Triggers.Contains(Trigger);
|
||||
active &= (Trigger == PresetTriggerType.ScreensaverStart && context.ScreenSaverTransitionState == ScreenSaverTransitionState.Started) ||
|
||||
(Trigger == PresetTriggerType.ScreensaverStop && context.ScreenSaverTransitionState == ScreenSaverTransitionState.Stopped);
|
||||
}
|
||||
|
||||
return active;
|
||||
@@ -140,7 +155,12 @@ public class PresetTrigger
|
||||
{
|
||||
text += $"of {DisplayProcesses(IncludedProcesses)}{(ExcludedProcesses.Any() ? ", excluding " + DisplayProcesses(ExcludedProcesses) : string.Empty)}";
|
||||
}
|
||||
return text += $"{(Conditions > 0 ? ", only in " + string.Join(", ", Utils.GetDescriptions<PresetConditionType>((int)Conditions)) : string.Empty)}";
|
||||
|
||||
text += $"{(Conditions > 0 ? ", only in " + string.Join(", ", Utils.GetDescriptions<PresetConditionType>((int)Conditions)) : string.Empty)}";
|
||||
|
||||
text += ConnectedDisplaysRegex.IsNullOrWhiteSpace() ? "" : $", connected display name matching {ConnectedDisplaysRegex}";
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
public static string DisplayProcesses(IEnumerable<string> processes)
|
||||
@@ -235,7 +255,7 @@ public abstract class PresetBase
|
||||
return name;
|
||||
}
|
||||
|
||||
public void UpdateTrigger(PresetTriggerType triggerType, PresetConditionType conditions, string includedProcesses = null, string excludedProcesses = null)
|
||||
public void UpdateTrigger(PresetTriggerType triggerType, PresetConditionType conditions, string includedProcesses = null, string excludedProcesses = null, string connectedDisplaysRegex = null)
|
||||
{
|
||||
if (!Triggers.Any())
|
||||
{
|
||||
@@ -257,6 +277,8 @@ public abstract class PresetBase
|
||||
}
|
||||
Utils.ParseWords(trigger.IncludedProcesses, includedProcesses);
|
||||
Utils.ParseWords(trigger.ExcludedProcesses, excludedProcesses);
|
||||
|
||||
trigger.ConnectedDisplaysRegex = connectedDisplaysRegex;
|
||||
}
|
||||
|
||||
public PresetTrigger AddTrigger()
|
||||
|
||||
@@ -40,7 +40,7 @@ public class SamsungPreset : PresetBase
|
||||
var trigger = preset.Triggers.FirstOrDefault();
|
||||
if (trigger != null)
|
||||
{
|
||||
UpdateTrigger(trigger.Trigger, trigger.Conditions, trigger.IncludedProcessesAsString, trigger.ExcludedProcessesAsString);
|
||||
UpdateTrigger(trigger.Trigger, trigger.Conditions, trigger.IncludedProcessesAsString, trigger.ExcludedProcessesAsString, trigger.ConnectedDisplaysRegex);
|
||||
}
|
||||
Steps.Clear();
|
||||
Steps.AddRange(preset.Steps);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static NStandard.Measures.Length;
|
||||
|
||||
namespace ColorControl.Shared.EventDispatcher;
|
||||
|
||||
public class DisplayChangedEventArgs : EventArgs
|
||||
{
|
||||
public uint Width { get; set; }
|
||||
public uint Height { get; set; }
|
||||
public uint BitsPerPixel{ get; set; }
|
||||
}
|
||||
|
||||
public class DisplayChangeEventDispatcher : EventDispatcher<DisplayChangedEventArgs>
|
||||
{
|
||||
public const string Event_DisplayChanged = "DisplayChanged";
|
||||
public DisplayChangeEventDispatcher(WindowMessageDispatcher windowMessageDispatcher)
|
||||
{
|
||||
windowMessageDispatcher.RegisterEventHandler(WindowMessageDispatcher.Event_WindowMessageDisplayChange, OnWindowMessageDisplayChange);
|
||||
}
|
||||
|
||||
private async void OnWindowMessageDisplayChange(object sender, WindowMessageEventArgs e)
|
||||
{
|
||||
uint width = (uint)(e.Message.LParam & 0xffff);
|
||||
uint height = (uint)(e.Message.LParam >> 16);
|
||||
uint bpp = (uint)e.Message.WParam;
|
||||
await DispatchEventAsync(Event_DisplayChanged, new DisplayChangedEventArgs { Width = width, Height = height, BitsPerPixel = bpp });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ProcessEventDispatcher : EventDispatcher<ProcessChangedEventArgs>
|
||||
|
||||
MonitorContext ??= new ProcessChangedEventArgs();
|
||||
|
||||
while (IsRunning)
|
||||
while (true)
|
||||
{
|
||||
await Task.Delay(_globalContext.Config.ProcessMonitorPollingInterval);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ public class WindowMessageDispatcher : EventDispatcher<WindowMessageEventArgs>
|
||||
public const string Event_WindowMessagePowerBroadcast = "WindowMessagePowerBroadcast";
|
||||
public const string Event_WindowMessageShowWindow = "WindowMessageShowWindow";
|
||||
public const string Event_WindowMessageUserBringToFront = "WindowMessageUserBringToFront";
|
||||
public const string Event_WindowMessageDisplayChange = "WindowMessageDisplayChange";
|
||||
|
||||
private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
private readonly GlobalContext _globalContext;
|
||||
@@ -39,6 +40,7 @@ public class WindowMessageDispatcher : EventDispatcher<WindowMessageEventArgs>
|
||||
{ NativeConstants.WM_CLOSE, Event_WindowMessageClose },
|
||||
{ NativeConstants.WM_POWERBROADCAST, Event_WindowMessagePowerBroadcast },
|
||||
{ NativeConstants.WM_SHOWWINDOW, Event_WindowMessageShowWindow },
|
||||
{ NativeConstants.WM_DISPLAYCHANGE, Event_WindowMessageDisplayChange },
|
||||
{ Utils.WM_BRINGTOFRONT, Event_WindowMessageUserBringToFront }
|
||||
};
|
||||
|
||||
@@ -88,6 +90,8 @@ public class WindowMessageDispatcher : EventDispatcher<WindowMessageEventArgs>
|
||||
Logger.Debug("WM_QUERYENDSESSION");
|
||||
}
|
||||
|
||||
Logger.Debug(m);
|
||||
|
||||
OnMessage?.Invoke(this, m);
|
||||
|
||||
base.WndProc(ref m);
|
||||
|
||||
+36
-1
@@ -547,6 +547,21 @@ namespace ColorControl.Shared.Native
|
||||
return dd.DeviceKey;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> EnumerateDisplayDeviceNames()
|
||||
{
|
||||
var dd = new DISPLAYDEVICE();
|
||||
dd.cb = (uint)Marshal.SizeOf(dd);
|
||||
|
||||
for (uint id = 0; NativeMethods.EnumDisplayDevices(null, id, ref dd, 0); id++)
|
||||
{
|
||||
if (dd.StateFlags.HasFlag(DisplayDeviceStateFlags.AttachedToDesktop))
|
||||
{
|
||||
yield return dd.DeviceName;
|
||||
}
|
||||
dd.cb = (uint)Marshal.SizeOf(dd);
|
||||
}
|
||||
}
|
||||
|
||||
public static DisplayInfo GetDisplayInfo(string displayName)
|
||||
{
|
||||
return ExecuteForModeConfig((modeInfo) =>
|
||||
@@ -1551,6 +1566,26 @@ namespace ColorControl.Shared.Native
|
||||
public string szDevice;
|
||||
}
|
||||
|
||||
[Flags()]
|
||||
public enum DisplayDeviceStateFlags : int
|
||||
{
|
||||
/// <summary>The device is part of the desktop.</summary>
|
||||
AttachedToDesktop = 0x1,
|
||||
MultiDriver = 0x2,
|
||||
/// <summary>The device is part of the desktop.</summary>
|
||||
PrimaryDevice = 0x4,
|
||||
/// <summary>Represents a pseudo device used to mirror application drawing for remoting or other purposes.</summary>
|
||||
MirroringDriver = 0x8,
|
||||
/// <summary>The device is VGA compatible.</summary>
|
||||
VGACompatible = 0x10,
|
||||
/// <summary>The device is removable; it cannot be the primary display.</summary>
|
||||
Removable = 0x20,
|
||||
/// <summary>The device has more display modes than its output devices support.</summary>
|
||||
ModesPruned = 0x8000000,
|
||||
Remote = 0x4000000,
|
||||
Disconnect = 0x2000000
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public struct DISPLAYDEVICE
|
||||
{
|
||||
@@ -1559,7 +1594,7 @@ namespace ColorControl.Shared.Native
|
||||
public string DeviceName;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
|
||||
public string DeviceString;
|
||||
public uint StateFlags;
|
||||
public DisplayDeviceStateFlags StateFlags;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
|
||||
public string DeviceID;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
|
||||
|
||||
Reference in new issue
Block a user