# HG changeset patch # User St?phane Lenclud # Date 1480272969 -3600 # Node ID 24aec939b2868659cc35cb4283eb73804c4a65d5 # Parent 5dcd226539d4b597c34b58a683c895a108573c13 Published v1.3.5. Updated Harmony library. Removed Harmony Logitech password and username. diff -r 5dcd226539d4 -r 24aec939b286 Server/App.config --- a/Server/App.config Wed Oct 05 15:02:09 2016 +0200 +++ b/Server/App.config Sun Nov 27 19:56:09 2016 +0100 @@ -40,15 +40,9 @@ HarmonyHub - - - - - - diff -r 5dcd226539d4 -r 24aec939b286 Server/FormMain.Designer.cs --- a/Server/FormMain.Designer.cs Wed Oct 05 15:02:09 2016 +0200 +++ b/Server/FormMain.Designer.cs Sun Nov 27 19:56:09 2016 +0100 @@ -107,10 +107,6 @@ this.iButtonHarmonyConnect = new System.Windows.Forms.Button(); this.iCheckBoxHarmonyEnabled = new System.Windows.Forms.CheckBox(); this.iTreeViewHarmony = new System.Windows.Forms.TreeView(); - this.label2 = new System.Windows.Forms.Label(); - this.iTextBoxLogitechPassword = new System.Windows.Forms.TextBox(); - this.labelLogitechUserName = new System.Windows.Forms.Label(); - this.iTextBoxLogitechUserName = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.iTextBoxHarmonyHubAddress = new System.Windows.Forms.TextBox(); this.tabPageEvent = new System.Windows.Forms.TabPage(); @@ -925,10 +921,6 @@ this.tabPageHarmony.Controls.Add(this.iButtonHarmonyConnect); this.tabPageHarmony.Controls.Add(this.iCheckBoxHarmonyEnabled); this.tabPageHarmony.Controls.Add(this.iTreeViewHarmony); - this.tabPageHarmony.Controls.Add(this.label2); - this.tabPageHarmony.Controls.Add(this.iTextBoxLogitechPassword); - this.tabPageHarmony.Controls.Add(this.labelLogitechUserName); - this.tabPageHarmony.Controls.Add(this.iTextBoxLogitechUserName); this.tabPageHarmony.Controls.Add(this.label1); this.tabPageHarmony.Controls.Add(this.iTextBoxHarmonyHubAddress); this.tabPageHarmony.Location = new System.Drawing.Point(4, 22); @@ -973,46 +965,6 @@ this.iTreeViewHarmony.TabIndex = 15; this.iTreeViewHarmony.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.iTreeViewHarmony_NodeMouseDoubleClick); // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(597, 7); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(99, 13); - this.label2.TabIndex = 13; - this.label2.Text = "Logitech password:"; - // - // iTextBoxLogitechPassword - // - this.iTextBoxLogitechPassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.iTextBoxLogitechPassword.Location = new System.Drawing.Point(600, 23); - this.iTextBoxLogitechPassword.Name = "iTextBoxLogitechPassword"; - this.iTextBoxLogitechPassword.PasswordChar = '*'; - this.iTextBoxLogitechPassword.Size = new System.Drawing.Size(134, 20); - this.iTextBoxLogitechPassword.TabIndex = 12; - this.iTextBoxLogitechPassword.TextChanged += new System.EventHandler(this.iTextBoxLogitechPassword_TextChanged); - // - // labelLogitechUserName - // - this.labelLogitechUserName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.labelLogitechUserName.AutoSize = true; - this.labelLogitechUserName.Location = new System.Drawing.Point(433, 7); - this.labelLogitechUserName.Name = "labelLogitechUserName"; - this.labelLogitechUserName.Size = new System.Drawing.Size(141, 13); - this.labelLogitechUserName.TabIndex = 11; - this.labelLogitechUserName.Text = "Logitech user name / e-mail:"; - // - // iTextBoxLogitechUserName - // - this.iTextBoxLogitechUserName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.iTextBoxLogitechUserName.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::SharpDisplayManager.Properties.Settings.Default, "LogitechUserName", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.iTextBoxLogitechUserName.Location = new System.Drawing.Point(436, 23); - this.iTextBoxLogitechUserName.Name = "iTextBoxLogitechUserName"; - this.iTextBoxLogitechUserName.Size = new System.Drawing.Size(134, 20); - this.iTextBoxLogitechUserName.TabIndex = 10; - this.iTextBoxLogitechUserName.Text = global::SharpDisplayManager.Properties.Settings.Default.LogitechUserName; - // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -1441,10 +1393,6 @@ private System.Windows.Forms.Button buttonEventEdit; private System.Windows.Forms.TabPage tabPageHarmony; private System.Windows.Forms.TreeView iTreeViewHarmony; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox iTextBoxLogitechPassword; - private System.Windows.Forms.Label labelLogitechUserName; - private System.Windows.Forms.TextBox iTextBoxLogitechUserName; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox iTextBoxHarmonyHubAddress; private System.Windows.Forms.CheckBox iCheckBoxHarmonyEnabled; diff -r 5dcd226539d4 -r 24aec939b286 Server/FormMain.cs --- a/Server/FormMain.cs Wed Oct 05 15:02:09 2016 +0200 +++ b/Server/FormMain.cs Sun Nov 27 19:56:09 2016 +0100 @@ -1244,10 +1244,6 @@ CheckFontHeight(); //Check if "run on Windows startup" is enabled checkBoxAutoStart.Checked = iStartupManager.Startup; - - //Harmony settings - //Decrypt our password first - iTextBoxLogitechPassword.Text = Secure.ToInsecureString(Secure.DecryptString(Properties.Settings.Default.LogitechPassword)); //CEC settings comboBoxHdmiPort.SelectedIndex = Properties.Settings.Default.CecHdmiPort - 1; @@ -3059,12 +3055,15 @@ /// Called whenever we loose connection with our HarmonyHub. /// /// - private void HarmonyConnectionClosedByServer(object aSender, bool aRequestWasCancelled) + private void HarmonyConnectionClosed(object aSender, bool aClosedByServer) { - //Try reconnect then + if (aClosedByServer) + { + //Try reconnect then #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed - BeginInvoke(new MethodInvoker(delegate () { ResetHarmonyAsync(); })); + BeginInvoke(new MethodInvoker(delegate () { ResetHarmonyAsync(); })); #pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed + } } @@ -3094,7 +3093,7 @@ //First create our client and login //Tip: Set keep-alive to false when testing reconnection process Program.HarmonyClient = new HarmonyHub.Client(iTextBoxHarmonyHubAddress.Text, true); - Program.HarmonyClient.OnConnectionClosedByServer += HarmonyConnectionClosedByServer; + Program.HarmonyClient.OnConnectionClosed += HarmonyConnectionClosed; string authToken = Properties.Settings.Default.LogitechAuthToken; if (!string.IsNullOrEmpty(authToken) && !aForceAuth) @@ -3114,15 +3113,8 @@ Properties.Settings.Default.LogitechAuthToken = ""; Properties.Settings.Default.Save(); - //Then try connect using our password - if (string.IsNullOrEmpty(iTextBoxLogitechPassword.Text)) - { - Trace.WriteLine("Harmony: Credentials missing!"); - return; - } - Trace.WriteLine("Harmony: Authenticating with Logitech servers..."); - success = await Program.HarmonyClient.TryOpenAsync(iTextBoxLogitechUserName.Text, iTextBoxLogitechPassword.Text); + success = await Program.HarmonyClient.TryOpenAsync(); //Persist our authentication token in our setting if (success) { @@ -3227,11 +3219,5 @@ } } - private void iTextBoxLogitechPassword_TextChanged(object sender, EventArgs e) - { - //Save our password after encryption - Properties.Settings.Default.LogitechPassword = Secure.EncryptString(Secure.ToSecureString(iTextBoxLogitechPassword.Text)); - Properties.Settings.Default.Save(); - } } } diff -r 5dcd226539d4 -r 24aec939b286 Server/Properties/Settings.Designer.cs --- a/Server/Properties/Settings.Designer.cs Wed Oct 05 15:02:09 2016 +0200 +++ b/Server/Properties/Settings.Designer.cs Sun Nov 27 19:56:09 2016 +0100 @@ -168,18 +168,6 @@ [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] - public string LogitechUserName { - get { - return ((string)(this["LogitechUserName"])); - } - set { - this["LogitechUserName"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] public string LogitechAuthToken { get { return ((string)(this["LogitechAuthToken"])); @@ -188,17 +176,5 @@ this["LogitechAuthToken"] = value; } } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string LogitechPassword { - get { - return ((string)(this["LogitechPassword"])); - } - set { - this["LogitechPassword"] = value; - } - } } } diff -r 5dcd226539d4 -r 24aec939b286 Server/Properties/Settings.settings --- a/Server/Properties/Settings.settings Wed Oct 05 15:02:09 2016 +0200 +++ b/Server/Properties/Settings.settings Sun Nov 27 19:56:09 2016 +0100 @@ -38,14 +38,8 @@ HarmonyHub - - - - - - \ No newline at end of file diff -r 5dcd226539d4 -r 24aec939b286 Server/SharpDisplayManager.csproj --- a/Server/SharpDisplayManager.csproj Wed Oct 05 15:02:09 2016 +0200 +++ b/Server/SharpDisplayManager.csproj Sun Nov 27 19:56:09 2016 +0100 @@ -34,7 +34,7 @@ index.htm false 0 - 1.3.4.0 + 1.3.5.0 false true true @@ -112,7 +112,7 @@ True - ..\packages\SharpLibHarmony.0.6.5\lib\net451\HarmonyHub.dll + ..\packages\SharpLibHarmony.0.7.0\lib\net451\HarmonyHub.dll True diff -r 5dcd226539d4 -r 24aec939b286 Server/packages.config --- a/Server/packages.config Wed Oct 05 15:02:09 2016 +0200 +++ b/Server/packages.config Sun Nov 27 19:56:09 2016 +0100 @@ -4,7 +4,7 @@ - +