# HG changeset patch
# User StephaneLenclud
# Date 1454517299 -3600
# Node ID b0c0aa5aea0533bca5c64eac2bfb49e765d97867
# Parent 317fdfa4fbb600b040c5606d54da62191a7b8be0
Idle client screen saver now working.
diff -r 317fdfa4fbb6 -r b0c0aa5aea05 Clients/Idle/FormClientIdle.cs
--- a/Clients/Idle/FormClientIdle.cs Wed Feb 03 16:04:37 2016 +0100
+++ b/Clients/Idle/FormClientIdle.cs Wed Feb 03 17:34:59 2016 +0100
@@ -66,7 +66,7 @@
iClient.CloseOrderEvent += OnCloseOrder;
iClient.Open();
iClient.SetName("Idle");
- iClient.SetPriority(SharpLib.Display.Priorities.Background);
+ iClient.SetPriority(Priorities.Background);
SetupDisplayClient();
//Timer
@@ -195,12 +195,24 @@
}
else
{
- //Do some screen saving
+ //Do some screen saving
iTextField.Text = "";
}
// Update our field
iClient.SetField(iTextField);
+
+ //Now make sure we save our screen from any running system monitor
+ if (String.IsNullOrEmpty(iTextField.Text))
+ {
+ //If text it empty it means we need to cool down our display even if system monitor is running
+ iClient.SetPriority(Priorities.SystemMonitor + 1);
+ }
+ else
+ {
+ //Switch back to background then, leaving system monitor if any doing its magic
+ iClient.SetPriority(Priorities.Background);
+ }
}
private void FormClientIdle_Shown(object sender, EventArgs e)
diff -r 317fdfa4fbb6 -r b0c0aa5aea05 Server/App.config
--- a/Server/App.config Wed Feb 03 16:04:37 2016 +0100
+++ b/Server/App.config Wed Feb 03 17:34:59 2016 +0100
@@ -43,6 +43,9 @@
True
+
+ True
+
diff -r 317fdfa4fbb6 -r b0c0aa5aea05 Server/MainForm.Designer.cs
--- a/Server/MainForm.Designer.cs Wed Feb 03 16:04:37 2016 +0100
+++ b/Server/MainForm.Designer.cs Wed Feb 03 17:34:59 2016 +0100
@@ -51,6 +51,8 @@
this.toolStripStatusLabelPower = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabelFps = new System.Windows.Forms.ToolStripStatusLabel();
this.tabPageClients = new System.Windows.Forms.TabPage();
+ this.iCheckBoxStartIdleClient = new System.Windows.Forms.CheckBox();
+ this.iButtonStartIdleClient = new System.Windows.Forms.Button();
this.buttonCloseClients = new System.Windows.Forms.Button();
this.buttonStartClient = new System.Windows.Forms.Button();
this.iTreeViewClients = new System.Windows.Forms.TreeView();
@@ -111,7 +113,6 @@
this.labelFontHeight = new System.Windows.Forms.Label();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
- this.iButtonStartIdleClient = new System.Windows.Forms.Button();
this.panelDisplay.SuspendLayout();
this.iTableLayoutPanel.SuspendLayout();
this.statusStrip.SuspendLayout();
@@ -245,6 +246,7 @@
//
// tabPageClients
//
+ this.tabPageClients.Controls.Add(this.iCheckBoxStartIdleClient);
this.tabPageClients.Controls.Add(this.iButtonStartIdleClient);
this.tabPageClients.Controls.Add(this.buttonCloseClients);
this.tabPageClients.Controls.Add(this.buttonStartClient);
@@ -257,6 +259,27 @@
this.tabPageClients.Text = "Clients";
this.tabPageClients.UseVisualStyleBackColor = true;
//
+ // iCheckBoxStartIdleClient
+ //
+ this.iCheckBoxStartIdleClient.AutoSize = true;
+ this.iCheckBoxStartIdleClient.Location = new System.Drawing.Point(108, 217);
+ this.iCheckBoxStartIdleClient.Name = "iCheckBoxStartIdleClient";
+ this.iCheckBoxStartIdleClient.Size = new System.Drawing.Size(145, 17);
+ this.iCheckBoxStartIdleClient.TabIndex = 22;
+ this.iCheckBoxStartIdleClient.Text = "Start idle client on startup";
+ this.iCheckBoxStartIdleClient.UseVisualStyleBackColor = true;
+ this.iCheckBoxStartIdleClient.CheckedChanged += new System.EventHandler(this.checkBoxStartIdleClient_CheckedChanged);
+ //
+ // iButtonStartIdleClient
+ //
+ this.iButtonStartIdleClient.Location = new System.Drawing.Point(6, 35);
+ this.iButtonStartIdleClient.Name = "iButtonStartIdleClient";
+ this.iButtonStartIdleClient.Size = new System.Drawing.Size(96, 23);
+ this.iButtonStartIdleClient.TabIndex = 21;
+ this.iButtonStartIdleClient.Text = "Start Idle Client";
+ this.iButtonStartIdleClient.UseVisualStyleBackColor = true;
+ this.iButtonStartIdleClient.Click += new System.EventHandler(this.ButtonStartIdleClient_Click);
+ //
// buttonCloseClients
//
this.buttonCloseClients.Location = new System.Drawing.Point(6, 213);
@@ -273,7 +296,7 @@
this.buttonStartClient.Name = "buttonStartClient";
this.buttonStartClient.Size = new System.Drawing.Size(96, 23);
this.buttonStartClient.TabIndex = 19;
- this.buttonStartClient.Text = "Start Client";
+ this.buttonStartClient.Text = "Start Test Client";
this.buttonStartClient.UseVisualStyleBackColor = true;
this.buttonStartClient.Click += new System.EventHandler(this.buttonStartClient_Click);
//
@@ -284,7 +307,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.iTreeViewClients.Location = new System.Drawing.Point(108, 6);
this.iTreeViewClients.Name = "iTreeViewClients";
- this.iTreeViewClients.Size = new System.Drawing.Size(478, 233);
+ this.iTreeViewClients.Size = new System.Drawing.Size(478, 205);
this.iTreeViewClients.TabIndex = 0;
this.iTreeViewClients.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewClients_AfterSelect);
//
@@ -935,16 +958,6 @@
//
this.openFileDialog.Filter = "EXE files (*.exe)|*.exe|All files (*.*)|*.*";
//
- // iButtonStartIdleClient
- //
- this.iButtonStartIdleClient.Location = new System.Drawing.Point(6, 35);
- this.iButtonStartIdleClient.Name = "iButtonStartIdleClient";
- this.iButtonStartIdleClient.Size = new System.Drawing.Size(96, 23);
- this.iButtonStartIdleClient.TabIndex = 21;
- this.iButtonStartIdleClient.Text = "Start Idle Client";
- this.iButtonStartIdleClient.UseVisualStyleBackColor = true;
- this.iButtonStartIdleClient.Click += new System.EventHandler(this.ButtonStartIdleClient_Click);
- //
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -970,6 +983,7 @@
this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout();
this.tabPageClients.ResumeLayout(false);
+ this.tabPageClients.PerformLayout();
this.tabPageDisplay.ResumeLayout(false);
this.tabPageDisplay.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).EndInit();
@@ -1066,6 +1080,7 @@
private System.Windows.Forms.CheckBox checkBoxCecMonitorOn;
private System.Windows.Forms.CheckBox checkBoxCecMonitorOff;
private System.Windows.Forms.Button iButtonStartIdleClient;
+ private System.Windows.Forms.CheckBox iCheckBoxStartIdleClient;
}
}
diff -r 317fdfa4fbb6 -r b0c0aa5aea05 Server/MainForm.cs
--- a/Server/MainForm.cs Wed Feb 03 16:04:37 2016 +0100
+++ b/Server/MainForm.cs Wed Feb 03 17:34:59 2016 +0100
@@ -111,7 +111,7 @@
private SharpLib.Notification.Control iNotifyIcon;
///
- /// System recording notifcation icon.
+ /// System recording notification icon.
///
private SharpLib.Notification.Control iRecordingNotification;
@@ -229,6 +229,12 @@
//Register for HID events
RegisterHidDevices();
+
+ //Start Idle client if needed
+ if (Properties.Settings.Default.StartIdleClient)
+ {
+ StartIdleClient();
+ }
}
///
@@ -1100,7 +1106,9 @@
checkBoxConnectOnStartup.Checked = Properties.Settings.Default.DisplayConnectOnStartup;
checkBoxMinimizeToTray.Checked = Properties.Settings.Default.MinimizeToTray;
checkBoxStartMinimized.Checked = Properties.Settings.Default.StartMinimized;
- labelStartFileName.Text = Properties.Settings.Default.StartFileName;
+ iCheckBoxStartIdleClient.Checked = Properties.Settings.Default.StartIdleClient;
+ labelStartFileName.Text = Properties.Settings.Default.StartFileName;
+
//Try find our drive in our drive list
int opticalDriveItemIndex=0;
@@ -1292,7 +1300,13 @@
Properties.Settings.Default.Save();
}
- private void checkBoxAutoStart_CheckedChanged(object sender, EventArgs e)
+ private void checkBoxStartIdleClient_CheckedChanged(object sender, EventArgs e)
+ {
+ Properties.Settings.Default.StartIdleClient = iCheckBoxStartIdleClient.Checked;
+ Properties.Settings.Default.Save();
+ }
+
+ private void checkBoxAutoStart_CheckedChanged(object sender, EventArgs e)
{
iStartupManager.Startup = checkBoxAutoStart.Checked;
}
diff -r 317fdfa4fbb6 -r b0c0aa5aea05 Server/Properties/Settings.Designer.cs
--- a/Server/Properties/Settings.Designer.cs Wed Feb 03 16:04:37 2016 +0100
+++ b/Server/Properties/Settings.Designer.cs Wed Feb 03 17:34:59 2016 +0100
@@ -165,5 +165,17 @@
this["CecMonitorOff"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool StartIdleClient {
+ get {
+ return ((bool)(this["StartIdleClient"]));
+ }
+ set {
+ this["StartIdleClient"] = value;
+ }
+ }
}
}
diff -r 317fdfa4fbb6 -r b0c0aa5aea05 Server/Properties/Settings.settings
--- a/Server/Properties/Settings.settings Wed Feb 03 16:04:37 2016 +0100
+++ b/Server/Properties/Settings.settings Wed Feb 03 17:34:59 2016 +0100
@@ -38,5 +38,8 @@
True
+
+ True
+
\ No newline at end of file