From 09965f9497dda33331e12d5c2543cf65c4254e27 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 25 Jul 2024 14:33:58 -0400 Subject: [PATCH 1/3] WinNUT UI tweaks w.r.t connections - Add IsUPSConnected property to main WinNUT form for easier connection state checking - Removed unused AutoReconnect boolean - Added SettingsPropertyChanged method to activate when a setting is changed, allowing the UI to update any relevant states. - Added UpdateMainMenuState which allows the main menu's state to be updated conveniently and consistently from anywhere in the WinNUT UI code (replaces the UpdateManageOldPrefsMenuItemStatus subroutine.) - Reorganized the Connection menu, renaming the (Re)connect command, and adding a Persist toggle that controls the auto reconnection feature. Adding some graphics, and better control over the menu item's enabled state. - Visual Studio designer deciding to move designer code around for no apparent reason --- .../WinNUT-Client.zh-TW.xlf | 92 +- .../WinNUT-client.de-DE.xlf | 92 +- .../WinNUT-client.fr-FR.xlf | 92 +- .../WinNUT-client.ru-RU.xlf | 92 +- .../WinNUT-client.uk-UA.xlf | 92 +- .../WinNUT-client.zh-CN.xlf | 92 +- .../My Project/Resources.Designer.vb | 30 + .../My Project/Resources.de-DE.resx | 9 + .../My Project/Resources.fr-FR.resx | 9 + .../WinNUT-Client/My Project/Resources.resx | 9 + .../My Project/Resources.ru-RU.resx | 9 + .../My Project/Resources.uk-UA.resx | 9 + .../My Project/Resources.zh-CN.resx | 9 + .../My Project/Resources.zh-TW.resx | 9 + .../WinNUT-Client/Resources/RepeatHS.png | Bin 0 -> 645 bytes .../WinNUT-Client/Resources/disconnect2.png | Bin 0 -> 740 bytes .../Resources/internetconnection.png | Bin 0 -> 4719 bytes WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj | 10 +- WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb | 193 +- WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx | 42 +- WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx | 42 +- WinNUT_V2/WinNUT-Client/WinNUT.resx | 1840 ++++++++++------- WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx | 42 +- WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx | 42 +- WinNUT_V2/WinNUT-Client/WinNUT.vb | 69 +- WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx | 42 +- WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx | 42 +- 27 files changed, 2023 insertions(+), 986 deletions(-) create mode 100644 WinNUT_V2/WinNUT-Client/Resources/RepeatHS.png create mode 100644 WinNUT_V2/WinNUT-Client/Resources/disconnect2.png create mode 100644 WinNUT_V2/WinNUT-Client/Resources/internetconnection.png diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf index 5532804..a9b22f3 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf @@ -859,6 +859,18 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + @@ -2562,8 +2574,8 @@ Accepted value: Numeric value from 0 to 100. UPS 變數 - 180, 22 - 180, 22 + 177, 22 + 177, 22 Exit @@ -2577,17 +2589,9 @@ Accepted value: Numeric value from 0 to 100. File 檔案 - - 133, 22 - 133, 22 - - - Reconnect - 重新連線 - - 133, 22 - 133, 22 + 180, 22 + 180, 22 Disconnect @@ -2646,8 +2650,8 @@ Accepted value: Numeric value from 0 to 100. 0, 24 - 351, 24 - 351, 24 + 231, 24 + 231, 24 0 @@ -3758,8 +3762,8 @@ Accepted value: Numeric value from 0 to 100. False - 180, 22 - 180, 22 + 177, 22 + 177, 22 Manage Old Prefs... @@ -3769,6 +3773,62 @@ Accepted value: Numeric value from 0 to 100. + + 180, 22 + 180, 22 + + + Connect + Connect + + + + + + + + + + + + + + + + + + + + + + + + + + + 177, 6 + 177, 6 + + + 180, 22 + 180, 22 + + + Persist + Persist + + + False + False + + + NoControl + NoControl + + + False + False + diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf index d952c46..de1246e 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf @@ -1953,6 +1953,18 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + @@ -1975,8 +1987,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa USV-Variablen - 180, 22 - 180, 22 + 177, 22 + 177, 22 Exit @@ -1990,17 +2002,9 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa File Datei - - 133, 22 - 133, 22 - - - Reconnect - Erneut verbinden - - 133, 22 - 133, 22 + 180, 22 + 180, 22 Disconnect @@ -2055,8 +2059,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa 0, 0 - 351, 24 - 351, 24 + 231, 24 + 231, 24 0 @@ -3231,8 +3235,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa False - 180, 22 - 180, 22 + 177, 22 + 177, 22 Manage Old Prefs... @@ -3242,6 +3246,62 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa + + 180, 22 + 180, 22 + + + Connect + Connect + + + + + + + + + + + + + + + + + + + + + + + + + + + 177, 6 + 177, 6 + + + 180, 22 + 180, 22 + + + Persist + Persist + + + False + False + + + NoControl + NoControl + + + False + False + diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf index 8425598..c8cf76f 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf @@ -1977,6 +1977,18 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + @@ -1999,8 +2011,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Variable de l'UPS - 180, 22 - 180, 22 + 177, 22 + 177, 22 Exit @@ -2014,17 +2026,9 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa File Fichier - - 133, 22 - 133, 22 - - - Reconnect - Re-Connecter - - 133, 22 - 133, 22 + 180, 22 + 180, 22 Disconnect @@ -2079,8 +2083,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa 0, 0 - 351, 24 - 351, 24 + 231, 24 + 231, 24 0 @@ -3255,8 +3259,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa False - 180, 22 - 180, 22 + 177, 22 + 177, 22 Manage Old Prefs... @@ -3266,6 +3270,62 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa + + 180, 22 + 180, 22 + + + Connect + Connect + + + + + + + + + + + + + + + + + + + + + + + + + + + 177, 6 + 177, 6 + + + 180, 22 + 180, 22 + + + Persist + Persist + + + False + False + + + NoControl + NoControl + + + False + False + diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf index 3b0b095..f164421 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf @@ -864,6 +864,18 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + @@ -2584,8 +2596,8 @@ Accepted value: Numeric value from 0 to 100. Переменные ИБП - 180, 22 - 180, 22 + 177, 22 + 177, 22 Exit @@ -2599,17 +2611,9 @@ Accepted value: Numeric value from 0 to 100. File Файл - - 133, 22 - 133, 22 - - - Reconnect - Переподключиться - - 133, 22 - 133, 22 + 180, 22 + 180, 22 Disconnect @@ -2668,8 +2672,8 @@ Accepted value: Numeric value from 0 to 100. 0, 24 - 351, 24 - 351, 24 + 231, 24 + 231, 24 0 @@ -3780,8 +3784,8 @@ Accepted value: Numeric value from 0 to 100. False - 180, 22 - 180, 22 + 177, 22 + 177, 22 Manage Old Prefs... @@ -3791,6 +3795,62 @@ Accepted value: Numeric value from 0 to 100. + + 180, 22 + 180, 22 + + + Connect + Connect + + + + + + + + + + + + + + + + + + + + + + + + + + + 177, 6 + 177, 6 + + + 180, 22 + 180, 22 + + + Persist + Persist + + + False + False + + + NoControl + NoControl + + + False + False + diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf index 4993e95..c96b0a7 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf @@ -864,6 +864,18 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Недоступно Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + @@ -2584,8 +2596,8 @@ Accepted value: Numeric value from 0 to 100. Змінні ДБЖ - 180, 22 - 180, 22 + 177, 22 + 177, 22 Exit @@ -2599,17 +2611,9 @@ Accepted value: Numeric value from 0 to 100. File Файл - - 133, 22 - 133, 22 - - - Reconnect - Перепідключитись - - 133, 22 - 133, 22 + 180, 22 + 180, 22 Disconnect @@ -2668,8 +2672,8 @@ Accepted value: Numeric value from 0 to 100. 0, 24 - 351, 24 - 351, 24 + 231, 24 + 231, 24 0 @@ -3780,8 +3784,8 @@ Accepted value: Numeric value from 0 to 100. False - 180, 22 - 180, 22 + 177, 22 + 177, 22 Manage Old Prefs... @@ -3791,6 +3795,62 @@ Accepted value: Numeric value from 0 to 100. + + 180, 22 + 180, 22 + + + Connect + Connect + + + + + + + + + + + + + + + + + + + + + + + + + + + 177, 6 + 177, 6 + + + 180, 22 + 180, 22 + + + Persist + Persist + + + False + False + + + NoControl + NoControl + + + False + False + diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf index d9410c0..58e119c 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf @@ -864,6 +864,18 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa 参数无效 Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + @@ -2583,8 +2595,8 @@ Accepted value: Numeric value from 0 to 100. UPS 变量 - 180, 22 - 180, 22 + 177, 22 + 177, 22 Exit @@ -2598,17 +2610,9 @@ Accepted value: Numeric value from 0 to 100. File 文件 - - 133, 22 - 133, 22 - - - Reconnect - 重新连接 - - 133, 22 - 133, 22 + 180, 22 + 180, 22 Disconnect @@ -2667,8 +2671,8 @@ Accepted value: Numeric value from 0 to 100. 0, 24 - 351, 24 - 351, 24 + 231, 24 + 231, 24 0 @@ -3779,8 +3783,8 @@ Accepted value: Numeric value from 0 to 100. False - 180, 22 - 180, 22 + 177, 22 + 177, 22 Manage Old Prefs... @@ -3790,6 +3794,62 @@ Accepted value: Numeric value from 0 to 100. + + 180, 22 + 180, 22 + + + Connect + Connect + + + + + + + + + + + + + + + + + + + + + + + + + + + 177, 6 + 177, 6 + + + 180, 22 + 180, 22 + + + Persist + Persist + + + False + False + + + NoControl + NoControl + + + False + False + diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb index 57b121c..3b341e4 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb @@ -378,6 +378,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized resource of type System.Drawing.Bitmap. + ''' + Public ReadOnly Property disconnect2() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("disconnect2", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Looks up a localized string similar to Old ups.ini imported '''Ini File Moved to {0}.old. @@ -580,6 +590,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized resource of type System.Drawing.Bitmap. + ''' + Public ReadOnly Property internetconnection() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("internetconnection", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Looks up a localized string similar to WinNut Preferences Changed. ''' @@ -716,6 +736,16 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized resource of type System.Drawing.Bitmap. + ''' + Public ReadOnly Property RepeatHS() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("RepeatHS", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + ''' ''' Looks up a localized string similar to Save WinNUT Registry Key. ''' diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx index a8be22f..c81c6df 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx @@ -117,4 +117,13 @@ ..\Resources\regedit.exe_14_100-0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx index 9cbc563..19da17a 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx @@ -121,4 +121,13 @@ Fichier Ini déplacé vers {0}.old ..\Resources\regedit.exe_14_100-0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx index 8786915..9a21365 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx @@ -215,6 +215,9 @@ Previous preferences data detected in the Registry. Notify the user that preferences data from the old system was detected in the Registry hive. + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Old ups.ini imported Ini File Moved to {0}.old @@ -285,6 +288,9 @@ Cancel to Save Msi and Install Later https://github.com/nutdotnet/WinNUT-Client + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + WinNut Preferences Changed @@ -332,6 +338,9 @@ Cancel to Save Msi and Install Later ..\Resources\regedit.exe_14_100-0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Save WinNUT Registry Key Title of the SaveFileDialog that prompts the user to select the file and location they would like to save their WinNUT Registry preferences to. diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx index eab5879..0600765 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx @@ -121,4 +121,13 @@ ..\Resources\regedit.exe_14_100-0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx index 1a45d19..cd5b490 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx @@ -180,4 +180,13 @@ Недоступно Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx index 9969265..e2182c0 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx @@ -177,4 +177,13 @@ Ini 文件重命名为 {0}.old 参数无效 Indicate that a variable is unavailable + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx index 6af9c08..69fe0d3 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx @@ -117,4 +117,13 @@ ..\Resources\regedit.exe_14_100-0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RepeatHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\disconnect2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\internetconnection.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Resources/RepeatHS.png b/WinNUT_V2/WinNUT-Client/Resources/RepeatHS.png new file mode 100644 index 0000000000000000000000000000000000000000..1b6573d213c8a1f708ca10d0a4963c67c5d7ddef GIT binary patch literal 645 zcmV;00($+4P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-`$Q51&%duJxQ!)7tAn!+}*2nYdD zl-LLXJ4G-ER*LJRl2{1F%EHDjL{x+jP>9Wn*jvO`o5DAO$tsAMO*WIw&fIz2JNID` zHmpv-B88{?`OkL_{O1s347O7g+bsKEhKDbd0f3YXuqZ(o#$Zu```7l7+y=L5>h#3p z;OWWRU-owE?Zkq&ZlmsTd{}5c=rsQUxH&8L_fT?Utrd>>Kfk}}=uw=av6f(IHNmfy z2vNd^k6eB`lmif&U1TXgRR7^2@K-CF(*uSjuK~|%gh3b~j*_EE+^*&T7Su7uI0D8% z3Ok;6^z}BwO4GkeAZ8s)BNHi17L4Wq4mAUr*3e3WI_?YrjE^rkQJmuC8q5F?0O;SdiwL1mr#9qPcfh4tG{(R!_M*2`KKFN= zJImz@l-kf*gF5bFZiA4ebArp^Qn`$RL&mP$UAEj}&!b|Y2)9(IQesXu{T6f<0K|Ts z12p|$CR6gTmTE*=#Y!qo)l#S$o*@zv-m;HxUq8WUF>i=Fy_sJ3FC4%A?gZz_L=;9N zLWvCn2mlQuLKu_HQ`mRj*UmoM5&!@P&d&`=-nwKmHmWl=006{t>(nW{QpTD7Ts!lz f+fV-cH~t;~v8ewyj#t}b00000NkvXXu0mjfHi8u# literal 0 HcmV?d00001 diff --git a/WinNUT_V2/WinNUT-Client/Resources/disconnect2.png b/WinNUT_V2/WinNUT-Client/Resources/disconnect2.png new file mode 100644 index 0000000000000000000000000000000000000000..4261cce9529e574b06cc1dfe4eaa0c0bc95e7f19 GIT binary patch literal 740 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 literal 0 HcmV?d00001 diff --git a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj index 65049f4..da9fc48 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj +++ b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj @@ -470,7 +470,15 @@ - + + + + + + + + + diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb b/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb index 4479ca2..2e8f118 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb @@ -39,8 +39,10 @@ Partial Class WinNUT Me.Menu_Quit = New System.Windows.Forms.ToolStripMenuItem() Me.ManageOldPrefsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.Menu_Connection = New System.Windows.Forms.ToolStripMenuItem() - Me.Menu_Reconnect = New System.Windows.Forms.ToolStripMenuItem() + Me.Menu_Connect = New System.Windows.Forms.ToolStripMenuItem() Me.Menu_Disconnect = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() + Me.Menu_Persist = New System.Windows.Forms.ToolStripMenuItem() Me.Menu_Settings = New System.Windows.Forms.ToolStripMenuItem() Me.Menu_Help = New System.Windows.Forms.ToolStripMenuItem() Me.Menu_About = New System.Windows.Forms.ToolStripMenuItem() @@ -151,14 +153,14 @@ Partial Class WinNUT ' 'Menu_File ' - Me.Menu_File.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Menu_UPS_Var, Me.Menu_Quit, Me.ManageOldPrefsToolStripMenuItem}) + Me.Menu_File.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Menu_UPS_Var, Me.ManageOldPrefsToolStripMenuItem, Me.Menu_Quit}) Me.Menu_File.Name = "Menu_File" resources.ApplyResources(Me.Menu_File, "Menu_File") ' 'Menu_UPS_Var ' - Me.Menu_UPS_Var.Name = "Menu_UPS_Var" resources.ApplyResources(Me.Menu_UPS_Var, "Menu_UPS_Var") + Me.Menu_UPS_Var.Name = "Menu_UPS_Var" ' 'Menu_Quit ' @@ -173,19 +175,34 @@ Partial Class WinNUT ' 'Menu_Connection ' - Me.Menu_Connection.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Menu_Reconnect, Me.Menu_Disconnect}) + Me.Menu_Connection.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Menu_Persist, Me.ToolStripSeparator1, Me.Menu_Connect, Me.Menu_Disconnect}) Me.Menu_Connection.Name = "Menu_Connection" resources.ApplyResources(Me.Menu_Connection, "Menu_Connection") ' - 'Menu_Reconnect + 'Menu_Connect ' - Me.Menu_Reconnect.Name = "Menu_Reconnect" - resources.ApplyResources(Me.Menu_Reconnect, "Menu_Reconnect") + Me.Menu_Connect.Image = Global.WinNUT_Client.My.Resources.Resources.internetconnection + Me.Menu_Connect.Name = "Menu_Connect" + resources.ApplyResources(Me.Menu_Connect, "Menu_Connect") ' 'Menu_Disconnect ' - Me.Menu_Disconnect.Name = "Menu_Disconnect" resources.ApplyResources(Me.Menu_Disconnect, "Menu_Disconnect") + Me.Menu_Disconnect.Image = Global.WinNUT_Client.My.Resources.Resources.disconnect2 + Me.Menu_Disconnect.Name = "Menu_Disconnect" + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + resources.ApplyResources(Me.ToolStripSeparator1, "ToolStripSeparator1") + ' + 'Menu_Persist + ' + Me.Menu_Persist.Checked = Global.WinNUT_Client.My.MySettings.Default.NUT_AutoReconnect + Me.Menu_Persist.CheckOnClick = True + Me.Menu_Persist.Image = Global.WinNUT_Client.My.Resources.Resources.RepeatHS + Me.Menu_Persist.Name = "Menu_Persist" + resources.ApplyResources(Me.Menu_Persist, "Menu_Persist") ' 'Menu_Settings ' @@ -448,259 +465,151 @@ Partial Class WinNUT ' 'AG_InF ' - Me.AG_InF.BaseArcColor = System.Drawing.Color.Gray Me.AG_InF.BaseArcRadius = 45 - Me.AG_InF.BaseArcStart = 135 - Me.AG_InF.BaseArcSweep = 270 Me.AG_InF.BaseArcWidth = 5 - Me.AG_InF.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen Me.AG_InF.GradientOrientation = WinNUT_Client.Controls.UPSVarGauge.GradientOrientationEnum.BottomToTop + Me.AG_InF.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen resources.ApplyResources(Me.AG_InF, "AG_InF") - Me.AG_InF.MaxValue = 100.0! - Me.AG_InF.MinValue = 0! + Me.AG_InF.MaxValue = 100 + Me.AG_InF.MinValue = 0 Me.AG_InF.Name = "AG_InF" - Me.AG_InF.NeedleColor1 = AGaugeClassic.AGaugeNeedleColor.Gray - Me.AG_InF.NeedleColor2 = System.Drawing.Color.DimGray Me.AG_InF.NeedleRadius = 32 - Me.AG_InF.NeedleType = AGaugeClassic.NeedleType.Advance - Me.AG_InF.NeedleWidth = 2 - Me.AG_InF.ScaleLinesInterColor = System.Drawing.Color.Black Me.AG_InF.ScaleLinesInterInnerRadius = 40 Me.AG_InF.ScaleLinesInterOuterRadius = 48 - Me.AG_InF.ScaleLinesInterWidth = 1 - Me.AG_InF.ScaleLinesMajorColor = System.Drawing.Color.Black Me.AG_InF.ScaleLinesMajorInnerRadius = 40 Me.AG_InF.ScaleLinesMajorOuterRadius = 48 - Me.AG_InF.ScaleLinesMajorStepValue = 50.0! - Me.AG_InF.ScaleLinesMajorWidth = 2 - Me.AG_InF.ScaleLinesMinorColor = System.Drawing.Color.Gray Me.AG_InF.ScaleLinesMinorInnerRadius = 42 Me.AG_InF.ScaleLinesMinorOuterRadius = 48 - Me.AG_InF.ScaleLinesMinorTicks = 9 - Me.AG_InF.ScaleLinesMinorWidth = 1 - Me.AG_InF.ScaleNumbersColor = System.Drawing.Color.Black Me.AG_InF.ScaleNumbersFormat = Nothing Me.AG_InF.ScaleNumbersRadius = 60 - Me.AG_InF.ScaleNumbersRotation = 0 - Me.AG_InF.ScaleNumbersStartScaleLine = 0 - Me.AG_InF.ScaleNumbersStepScaleLines = 1 Me.AG_InF.UnitValue1 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.Hertz Me.AG_InF.UnitValue2 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.None + Me.AG_InF.Value = 0! Me.AG_InF.Value1 = 0! Me.AG_InF.Value2 = 0! ' 'AG_InV ' - Me.AG_InV.BaseArcColor = System.Drawing.Color.Gray Me.AG_InV.BaseArcRadius = 45 - Me.AG_InV.BaseArcStart = 135 - Me.AG_InV.BaseArcSweep = 270 Me.AG_InV.BaseArcWidth = 5 - Me.AG_InV.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen Me.AG_InV.GradientOrientation = WinNUT_Client.Controls.UPSVarGauge.GradientOrientationEnum.BottomToTop + Me.AG_InV.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen resources.ApplyResources(Me.AG_InV, "AG_InV") - Me.AG_InV.MaxValue = 100.0! - Me.AG_InV.MinValue = 0! + Me.AG_InV.MaxValue = 100 + Me.AG_InV.MinValue = 0 Me.AG_InV.Name = "AG_InV" - Me.AG_InV.NeedleColor1 = AGaugeClassic.AGaugeNeedleColor.Gray - Me.AG_InV.NeedleColor2 = System.Drawing.Color.DimGray Me.AG_InV.NeedleRadius = 32 - Me.AG_InV.NeedleType = AGaugeClassic.NeedleType.Advance - Me.AG_InV.NeedleWidth = 2 - Me.AG_InV.ScaleLinesInterColor = System.Drawing.Color.Black Me.AG_InV.ScaleLinesInterInnerRadius = 40 Me.AG_InV.ScaleLinesInterOuterRadius = 48 - Me.AG_InV.ScaleLinesInterWidth = 1 - Me.AG_InV.ScaleLinesMajorColor = System.Drawing.Color.Black Me.AG_InV.ScaleLinesMajorInnerRadius = 40 Me.AG_InV.ScaleLinesMajorOuterRadius = 48 - Me.AG_InV.ScaleLinesMajorStepValue = 50.0! - Me.AG_InV.ScaleLinesMajorWidth = 2 - Me.AG_InV.ScaleLinesMinorColor = System.Drawing.Color.Gray Me.AG_InV.ScaleLinesMinorInnerRadius = 42 Me.AG_InV.ScaleLinesMinorOuterRadius = 48 - Me.AG_InV.ScaleLinesMinorTicks = 9 - Me.AG_InV.ScaleLinesMinorWidth = 1 - Me.AG_InV.ScaleNumbersColor = System.Drawing.Color.Black Me.AG_InV.ScaleNumbersFormat = Nothing Me.AG_InV.ScaleNumbersRadius = 60 - Me.AG_InV.ScaleNumbersRotation = 0 - Me.AG_InV.ScaleNumbersStartScaleLine = 0 - Me.AG_InV.ScaleNumbersStepScaleLines = 1 Me.AG_InV.UnitValue1 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.Volts Me.AG_InV.UnitValue2 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.None + Me.AG_InV.Value = 0! Me.AG_InV.Value1 = 0! Me.AG_InV.Value2 = 0! ' 'AG_BattV ' - Me.AG_BattV.BaseArcColor = System.Drawing.Color.Gray Me.AG_BattV.BaseArcRadius = 45 - Me.AG_BattV.BaseArcStart = 135 - Me.AG_BattV.BaseArcSweep = 270 Me.AG_BattV.BaseArcWidth = 5 - Me.AG_BattV.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen Me.AG_BattV.GradientOrientation = WinNUT_Client.Controls.UPSVarGauge.GradientOrientationEnum.BottomToTop + Me.AG_BattV.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen resources.ApplyResources(Me.AG_BattV, "AG_BattV") - Me.AG_BattV.MaxValue = 100.0! - Me.AG_BattV.MinValue = 0! + Me.AG_BattV.MaxValue = 100 + Me.AG_BattV.MinValue = 0 Me.AG_BattV.Name = "AG_BattV" - Me.AG_BattV.NeedleColor1 = AGaugeClassic.AGaugeNeedleColor.Gray - Me.AG_BattV.NeedleColor2 = System.Drawing.Color.DimGray Me.AG_BattV.NeedleRadius = 32 - Me.AG_BattV.NeedleType = AGaugeClassic.NeedleType.Advance - Me.AG_BattV.NeedleWidth = 2 - Me.AG_BattV.ScaleLinesInterColor = System.Drawing.Color.Black Me.AG_BattV.ScaleLinesInterInnerRadius = 40 Me.AG_BattV.ScaleLinesInterOuterRadius = 48 - Me.AG_BattV.ScaleLinesInterWidth = 1 - Me.AG_BattV.ScaleLinesMajorColor = System.Drawing.Color.Black Me.AG_BattV.ScaleLinesMajorInnerRadius = 40 Me.AG_BattV.ScaleLinesMajorOuterRadius = 48 - Me.AG_BattV.ScaleLinesMajorStepValue = 50.0! - Me.AG_BattV.ScaleLinesMajorWidth = 2 - Me.AG_BattV.ScaleLinesMinorColor = System.Drawing.Color.Gray Me.AG_BattV.ScaleLinesMinorInnerRadius = 42 Me.AG_BattV.ScaleLinesMinorOuterRadius = 48 - Me.AG_BattV.ScaleLinesMinorTicks = 9 - Me.AG_BattV.ScaleLinesMinorWidth = 1 - Me.AG_BattV.ScaleNumbersColor = System.Drawing.Color.Black Me.AG_BattV.ScaleNumbersFormat = Nothing Me.AG_BattV.ScaleNumbersRadius = 60 - Me.AG_BattV.ScaleNumbersRotation = 0 - Me.AG_BattV.ScaleNumbersStartScaleLine = 0 - Me.AG_BattV.ScaleNumbersStepScaleLines = 1 Me.AG_BattV.UnitValue1 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.Volts Me.AG_BattV.UnitValue2 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.None + Me.AG_BattV.Value = 0! Me.AG_BattV.Value1 = 0! Me.AG_BattV.Value2 = 0! ' 'AG_Load ' - Me.AG_Load.BaseArcColor = System.Drawing.Color.Gray Me.AG_Load.BaseArcRadius = 45 - Me.AG_Load.BaseArcStart = 135 - Me.AG_Load.BaseArcSweep = 270 Me.AG_Load.BaseArcWidth = 5 - Me.AG_Load.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen Me.AG_Load.GradientOrientation = WinNUT_Client.Controls.UPSVarGauge.GradientOrientationEnum.RightToLeft + Me.AG_Load.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen resources.ApplyResources(Me.AG_Load, "AG_Load") - Me.AG_Load.MaxValue = 100.0! - Me.AG_Load.MinValue = 0! + Me.AG_Load.MaxValue = 100 + Me.AG_Load.MinValue = 0 Me.AG_Load.Name = "AG_Load" - Me.AG_Load.NeedleColor1 = AGaugeClassic.AGaugeNeedleColor.Gray - Me.AG_Load.NeedleColor2 = System.Drawing.Color.DimGray Me.AG_Load.NeedleRadius = 32 - Me.AG_Load.NeedleType = AGaugeClassic.NeedleType.Advance - Me.AG_Load.NeedleWidth = 2 - Me.AG_Load.ScaleLinesInterColor = System.Drawing.Color.Black Me.AG_Load.ScaleLinesInterInnerRadius = 40 Me.AG_Load.ScaleLinesInterOuterRadius = 48 - Me.AG_Load.ScaleLinesInterWidth = 1 - Me.AG_Load.ScaleLinesMajorColor = System.Drawing.Color.Black Me.AG_Load.ScaleLinesMajorInnerRadius = 40 Me.AG_Load.ScaleLinesMajorOuterRadius = 48 - Me.AG_Load.ScaleLinesMajorStepValue = 50.0! - Me.AG_Load.ScaleLinesMajorWidth = 2 - Me.AG_Load.ScaleLinesMinorColor = System.Drawing.Color.Gray Me.AG_Load.ScaleLinesMinorInnerRadius = 42 Me.AG_Load.ScaleLinesMinorOuterRadius = 48 - Me.AG_Load.ScaleLinesMinorTicks = 9 - Me.AG_Load.ScaleLinesMinorWidth = 1 - Me.AG_Load.ScaleNumbersColor = System.Drawing.Color.Black Me.AG_Load.ScaleNumbersFormat = Nothing Me.AG_Load.ScaleNumbersRadius = 60 - Me.AG_Load.ScaleNumbersRotation = 0 - Me.AG_Load.ScaleNumbersStartScaleLine = 0 - Me.AG_Load.ScaleNumbersStepScaleLines = 1 Me.AG_Load.UnitValue1 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.Percent Me.AG_Load.UnitValue2 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.Watts + Me.AG_Load.Value = 0! Me.AG_Load.Value1 = 0! Me.AG_Load.Value2 = 0! ' 'AG_OutV ' - Me.AG_OutV.BaseArcColor = System.Drawing.Color.Gray Me.AG_OutV.BaseArcRadius = 45 - Me.AG_OutV.BaseArcStart = 135 - Me.AG_OutV.BaseArcSweep = 270 Me.AG_OutV.BaseArcWidth = 5 - Me.AG_OutV.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen Me.AG_OutV.GradientOrientation = WinNUT_Client.Controls.UPSVarGauge.GradientOrientationEnum.BottomToTop + Me.AG_OutV.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen resources.ApplyResources(Me.AG_OutV, "AG_OutV") - Me.AG_OutV.MaxValue = 100.0! - Me.AG_OutV.MinValue = 0! + Me.AG_OutV.MaxValue = 100 + Me.AG_OutV.MinValue = 0 Me.AG_OutV.Name = "AG_OutV" - Me.AG_OutV.NeedleColor1 = AGaugeClassic.AGaugeNeedleColor.Gray - Me.AG_OutV.NeedleColor2 = System.Drawing.Color.DimGray Me.AG_OutV.NeedleRadius = 32 - Me.AG_OutV.NeedleType = AGaugeClassic.NeedleType.Advance - Me.AG_OutV.NeedleWidth = 2 - Me.AG_OutV.ScaleLinesInterColor = System.Drawing.Color.Black Me.AG_OutV.ScaleLinesInterInnerRadius = 40 Me.AG_OutV.ScaleLinesInterOuterRadius = 48 - Me.AG_OutV.ScaleLinesInterWidth = 1 - Me.AG_OutV.ScaleLinesMajorColor = System.Drawing.Color.Black Me.AG_OutV.ScaleLinesMajorInnerRadius = 40 Me.AG_OutV.ScaleLinesMajorOuterRadius = 48 - Me.AG_OutV.ScaleLinesMajorStepValue = 50.0! - Me.AG_OutV.ScaleLinesMajorWidth = 2 - Me.AG_OutV.ScaleLinesMinorColor = System.Drawing.Color.Gray Me.AG_OutV.ScaleLinesMinorInnerRadius = 42 Me.AG_OutV.ScaleLinesMinorOuterRadius = 48 - Me.AG_OutV.ScaleLinesMinorTicks = 9 - Me.AG_OutV.ScaleLinesMinorWidth = 1 - Me.AG_OutV.ScaleNumbersColor = System.Drawing.Color.Black Me.AG_OutV.ScaleNumbersFormat = Nothing Me.AG_OutV.ScaleNumbersRadius = 60 - Me.AG_OutV.ScaleNumbersRotation = 0 - Me.AG_OutV.ScaleNumbersStartScaleLine = 0 - Me.AG_OutV.ScaleNumbersStepScaleLines = 1 Me.AG_OutV.UnitValue1 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.Volts Me.AG_OutV.UnitValue2 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.None + Me.AG_OutV.Value = 0! Me.AG_OutV.Value1 = 0! Me.AG_OutV.Value2 = 0! ' 'AG_BattCh ' - Me.AG_BattCh.BaseArcColor = System.Drawing.Color.Gray Me.AG_BattCh.BaseArcRadius = 45 - Me.AG_BattCh.BaseArcStart = 135 - Me.AG_BattCh.BaseArcSweep = 270 Me.AG_BattCh.BaseArcWidth = 5 - Me.AG_BattCh.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen Me.AG_BattCh.GradientOrientation = WinNUT_Client.Controls.UPSVarGauge.GradientOrientationEnum.LeftToRight + Me.AG_BattCh.GradientType = WinNUT_Client.Controls.UPSVarGauge.GradientTypeEnum.RedGreen resources.ApplyResources(Me.AG_BattCh, "AG_BattCh") - Me.AG_BattCh.MaxValue = 100.0! - Me.AG_BattCh.MinValue = 0! + Me.AG_BattCh.MaxValue = 100 + Me.AG_BattCh.MinValue = 0 Me.AG_BattCh.Name = "AG_BattCh" - Me.AG_BattCh.NeedleColor1 = AGaugeClassic.AGaugeNeedleColor.Gray - Me.AG_BattCh.NeedleColor2 = System.Drawing.Color.DimGray Me.AG_BattCh.NeedleRadius = 32 - Me.AG_BattCh.NeedleType = AGaugeClassic.NeedleType.Advance - Me.AG_BattCh.NeedleWidth = 2 - Me.AG_BattCh.ScaleLinesInterColor = System.Drawing.Color.Black Me.AG_BattCh.ScaleLinesInterInnerRadius = 40 Me.AG_BattCh.ScaleLinesInterOuterRadius = 48 - Me.AG_BattCh.ScaleLinesInterWidth = 1 - Me.AG_BattCh.ScaleLinesMajorColor = System.Drawing.Color.Black Me.AG_BattCh.ScaleLinesMajorInnerRadius = 40 Me.AG_BattCh.ScaleLinesMajorOuterRadius = 48 - Me.AG_BattCh.ScaleLinesMajorStepValue = 50.0! - Me.AG_BattCh.ScaleLinesMajorWidth = 2 - Me.AG_BattCh.ScaleLinesMinorColor = System.Drawing.Color.Gray Me.AG_BattCh.ScaleLinesMinorInnerRadius = 42 Me.AG_BattCh.ScaleLinesMinorOuterRadius = 48 - Me.AG_BattCh.ScaleLinesMinorTicks = 9 - Me.AG_BattCh.ScaleLinesMinorWidth = 1 - Me.AG_BattCh.ScaleNumbersColor = System.Drawing.Color.Black Me.AG_BattCh.ScaleNumbersFormat = Nothing Me.AG_BattCh.ScaleNumbersRadius = 60 - Me.AG_BattCh.ScaleNumbersRotation = 0 - Me.AG_BattCh.ScaleNumbersStartScaleLine = 0 - Me.AG_BattCh.ScaleNumbersStepScaleLines = 1 Me.AG_BattCh.UnitValue1 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.Percent Me.AG_BattCh.UnitValue2 = WinNUT_Client.Controls.UPSVarGauge.UnitValueEnum.None + Me.AG_BattCh.Value = 0! Me.AG_BattCh.Value1 = 0! Me.AG_BattCh.Value2 = 0! ' @@ -756,7 +665,7 @@ Partial Class WinNUT Friend WithEvents Menu_About As ToolStripMenuItem Friend WithEvents Menu_Help_Sep1 As ToolStripSeparator Friend WithEvents Menu_Update As ToolStripMenuItem - Friend WithEvents Menu_Reconnect As ToolStripMenuItem + Friend WithEvents Menu_Connect As ToolStripMenuItem Friend WithEvents Menu_Disconnect As ToolStripMenuItem Friend WithEvents ContextMenu_Systray As ContextMenuStrip Friend WithEvents Menu_Sys_Settings As ToolStripMenuItem @@ -806,4 +715,6 @@ Partial Class WinNUT Friend WithEvents CB_CurrentLog As ComboBox Friend WithEvents PBox_Battery_State As PictureBox Friend WithEvents ManageOldPrefsToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ToolStripSeparator1 As ToolStripSeparator + Friend WithEvents Menu_Persist As ToolStripMenuItem End Class diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx b/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx index add3238..990109b 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx @@ -21,9 +21,6 @@ Datei - - Erneut verbinden - Verbindung trennen @@ -102,4 +99,43 @@ False + + 177, 22 + + + 180, 22 + + + + + + + + + + + + + + + + + + + + + 177, 6 + + + 180, 22 + + + False + + + NoControl + + + False + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx b/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx index af5263e..e29ad5c 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx @@ -21,9 +21,6 @@ Fichier - - Re-Connecter - Déconnecter @@ -102,4 +99,43 @@ False + + 177, 22 + + + 180, 22 + + + + + + + + + + + + + + + + + + + + + 177, 6 + + + 180, 22 + + + False + + + NoControl + + + False + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.resx b/WinNUT_V2/WinNUT-Client/WinNUT.resx index 37ea6c8..4f951cd 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.resx @@ -124,6 +124,22 @@ 364, 17 + + 145, 110 + + + ContextMenu_Systray + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + NotifyIcon1 + + + + True + 144, 22 @@ -157,22 +173,6 @@ Exit - - 145, 110 - - - ContextMenu_Systray - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NotifyIcon1 - - - - True - 248, 17 @@ -186,18 +186,15 @@ None + + False + 180, 22 UPS Variable - - 180, 22 - - - Exit - False @@ -205,29 +202,23 @@ - 180, 22 + 177, 22 Manage Old Prefs... + + 177, 22 + + + Exit + 37, 20 File - - 133, 22 - - - Reconnect - - - 133, 22 - - - Disconnect - 81, 20 @@ -240,21 +231,6 @@ Settings - - 144, 22 - - - About - - - 141, 6 - - - 144, 22 - - - Verify Update - 44, 20 @@ -268,7 +244,7 @@ 0, 24 - 351, 24 + 231, 24 0 @@ -288,41 +264,53 @@ 9 - - True - - - Left + + 180, 22 - - None + + Connect - - Microsoft Sans Serif, 8.25pt, style=Bold + + False - - NoControl + + 180, 22 - - 6, 228 + + Disconnect - - 0, 0, 0, 0 + + 177, 6 - - 164, 13 + + 180, 22 - - 164, 13 + + Persist - - 164, 13 + + 144, 22 - - 17 + + About - - MiddleCenter + + 141, 6 + + + 144, 22 + + + Verify Update + + + True + + + Left + + + None Lbl_VSerial @@ -336,33 +324,6 @@ 0 - - Microsoft Sans Serif, 8.25pt, style=Bold - - - NoControl - - - 6, 260 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 16 - - - MiddleCenter - Lbl_VFirmware @@ -375,33 +336,6 @@ 1 - - Microsoft Sans Serif, 8.25pt, style=Bold - - - NoControl - - - 6, 196 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 15 - - - MiddleCenter - Lbl_VName @@ -414,33 +348,6 @@ 2 - - Microsoft Sans Serif, 8.25pt, style=Bold - - - NoControl - - - 6, 164 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 14 - - - MiddleCenter - Lbl_VMfr @@ -453,33 +360,6 @@ 3 - - Microsoft Sans Serif, 8.25pt, style=Bold - - - NoControl - - - 6, 132 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 13 - - - MiddleCenter - Lbl_VRTime @@ -492,21 +372,6 @@ 4 - - NoControl - - - 150, 44 - - - 16, 16 - - - 16, 16 - - - 12 - Lbl_VOB @@ -519,48 +384,18 @@ 5 - - NoControl + + Lbl_VOLoad - - 150, 68 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 16, 16 - - - 16, 16 - - - 11 - - - Lbl_VOLoad - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GB_Status + + GB_Status 6 - - NoControl - - - 150, 92 - - - 16, 16 - - - 16, 16 - - - 10 - Lbl_VBL @@ -573,21 +408,6 @@ 7 - - NoControl - - - 150, 20 - - - 16, 16 - - - 16, 16 - - - 9 - Lbl_VOL @@ -600,30 +420,6 @@ 8 - - NoControl - - - 6, 244 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 8 - - - Firmware : - Lbl_Firmware @@ -636,30 +432,6 @@ 9 - - NoControl - - - 6, 212 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 7 - - - Serial : - Lbl_Serial @@ -672,30 +444,6 @@ 10 - - NoControl - - - 6, 180 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 6 - - - Name : - Lbl_Name @@ -708,30 +456,6 @@ 11 - - NoControl - - - 6, 148 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 5 - - - Manufacturer : - Lbl_Mfr @@ -744,30 +468,6 @@ 12 - - NoControl - - - 6, 116 - - - 0, 0, 0, 0 - - - 164, 13 - - - 164, 13 - - - 164, 13 - - - 4 - - - Remaining Time : - Lbl_RTime @@ -780,27 +480,6 @@ 13 - - NoControl - - - 6, 92 - - - 140, 13 - - - 140, 13 - - - 140, 13 - - - 3 - - - UPS Battery Low - Lbl_BL @@ -813,27 +492,6 @@ 14 - - NoControl - - - 6, 68 - - - 140, 13 - - - 140, 13 - - - 140, 13 - - - 2 - - - UPS Overload - Lbl_OLoad @@ -846,27 +504,6 @@ 15 - - NoControl - - - 6, 44 - - - 140, 13 - - - 140, 13 - - - 140, 13 - - - 1 - - - UPS On Battery - Lbl_OB @@ -879,27 +516,6 @@ 16 - - NoControl - - - 6, 20 - - - 140, 13 - - - 140, 13 - - - 140, 13 - - - 0 - - - UPS On Line - Lbl_OL @@ -939,59 +555,638 @@ 7 - - True - - - Left + + Microsoft Sans Serif, 8.25pt, style=Bold - - 6, 26 + + NoControl + + + 6, 228 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 17 + + + MiddleCenter + + + Lbl_VSerial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 0 + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 6, 260 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 16 + + + MiddleCenter + + + Lbl_VFirmware + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 1 + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 6, 196 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 15 + + + MiddleCenter + + + Lbl_VName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 2 + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 6, 164 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 14 + + + MiddleCenter + + + Lbl_VMfr + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 3 + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 6, 132 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 13 + + + MiddleCenter + + + Lbl_VRTime + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 4 + + + NoControl + + + 150, 44 + + + 16, 16 + + + 16, 16 + + + 12 + + + Lbl_VOB + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 5 + + + NoControl + + + 150, 68 + + + 16, 16 + + + 16, 16 + + + 11 + + + Lbl_VOLoad + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 6 + + + NoControl + + + 150, 92 + + + 16, 16 + + + 16, 16 + + + 10 + + + Lbl_VBL + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 7 + + + NoControl + + + 150, 20 + + + 16, 16 + + + 16, 16 + + + 9 + + + Lbl_VOL + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 8 + + + NoControl + + + 6, 244 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 8 + + + Firmware : + + + Lbl_Firmware + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 9 + + + NoControl + + + 6, 212 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 7 + + + Serial : + + + Lbl_Serial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 10 + + + NoControl + + + 6, 180 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 6 + + + Name : + + + Lbl_Name + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 11 + + + NoControl + + + 6, 148 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 5 + + + Manufacturer : + + + Lbl_Mfr + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 12 + + + NoControl + + + 6, 116 + + + 0, 0, 0, 0 + + + 164, 13 + + + 164, 13 + + + 164, 13 + + + 4 + + + Remaining Time : + + + Lbl_RTime + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 13 + + + NoControl + + + 6, 92 + + + 140, 13 + + + 140, 13 + + + 140, 13 + + + 3 + + + UPS Battery Low + + + Lbl_BL - - 148, 130 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + GB_Status + + + 14 + + + NoControl + + + 6, 68 + + + 140, 13 + + + 140, 13 + + + 140, 13 + + + 2 + + + UPS Overload + + + Lbl_OLoad + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 15 + + + NoControl + + + 6, 44 + + + 140, 13 + + + 140, 13 + + + 140, 13 + + 1 - - AG_InV + + UPS On Battery - - System.Windows.Forms.AGauge, AGauge, Version=2.1.8814.30445, Culture=neutral, PublicKeyToken=null + + Lbl_OB - - GB_InV_Dial + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + GB_Status - - True + + 16 - + NoControl - - 4, 10 + + 6, 20 - - 152, 13 + + 140, 13 - - 152, 13 + + 140, 13 - - 152, 13 + + 140, 13 - + 0 - - Input Voltage + + UPS On Line - - MiddleCenter + + Lbl_OL + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_Status + + + 17 + + + True + + + Left + + + AG_InV + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + + + GB_InV_Dial + + + 0 Lbl_InV_Dial @@ -1026,32 +1221,56 @@ 3 - + True - - - Left - - 6, 26 + + NoControl - - 148, 130 + + 4, 10 - - 148, 130 + + 152, 13 - - 148, 130 + + 152, 13 - + + 152, 13 + + + 0 + + + Input Voltage + + + MiddleCenter + + + Lbl_InV_Dial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_InV_Dial + + 1 + + True + + + Left + AG_OutV - System.Windows.Forms.AGauge, AGauge, Version=2.1.8814.30445, Culture=neutral, PublicKeyToken=null + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null GB_OutV_Dial @@ -1059,6 +1278,39 @@ 0 + + Lbl_OutV_Dial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_OutV_Dial + + + 1 + + + 532, 27 + + + 160, 160 + + + 4 + + + GB_OutV_Dial + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + True @@ -1095,35 +1347,71 @@ GB_OutV_Dial - - 1 + + 1 + + + True + + + Left + + + PBox_Battery_State + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_BattCh_Dial + + + 0 + + + Lbl_BattCh_Dial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_BattCh_Dial + + + 1 + + + AG_BattCh + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + + + GB_BattCh_Dial + + + 2 - - 532, 27 + + 200, 188 - + 160, 160 - - 4 + + 3 - - GB_OutV_Dial + + GB_BattCh_Dial - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 6 - - - True - - - Left + + 8 NoControl @@ -1188,86 +1476,56 @@ 1 - - 6, 27 + + True + + + Left - - 148, 130 + + AG_Load - - 148, 130 + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null - - 148, 130 + + GB_Load_Dial - - 1 + + 0 - - AG_BattCh + + Lbl_Load_Dial - - System.Windows.Forms.AGauge, AGauge, Version=2.1.8814.30445, Culture=neutral, PublicKeyToken=null + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - GB_BattCh_Dial + + GB_Load_Dial - - 2 + + 1 - - 200, 188 + + 366, 188 - + 160, 160 - - 3 + + 4 - - GB_BattCh_Dial + + GB_Load_Dial - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 8 - - - True - - - Left - - - 6, 26 - - - 148, 130 - - - 148, 130 - - - 148, 130 - - - 1 - - - AG_Load - - - System.Windows.Forms.AGauge, AGauge, Version=2.1.8814.30445, Culture=neutral, PublicKeyToken=null - - - GB_Load_Dial - - - 0 + + 5 True @@ -1308,125 +1566,215 @@ 1 - - 366, 188 + + True + + + Left - + + AG_BattV + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + + + GB_BattV_Dial + + + 0 + + + Lbl_BattV_Dial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_BattV_Dial + + + 1 + + + 532, 188 + + 160, 160 - - 4 + + 5 - - GB_Load_Dial + + GB_BattV_Dial - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 5 + + 4 - + + True + + + NoControl + + + 4, 10 + + + 152, 13 + + + 152, 13 + + + 152, 13 + + + 0 + + + Battery Voltage + + + MiddleCenter + + + Lbl_BattV_Dial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_BattV_Dial + + + 1 + + True - + Left - - 6, 26 + + AG_InF - - 148, 130 + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null - - 148, 130 + + GB_InF_Dial - - 148, 130 + + 0 - + + Lbl_InF_Dial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GB_InF_Dial + + 1 - - AG_BattV + + 366, 27 + + + 160, 160 + + + 5 + + + GB_InF_Dial - - System.Windows.Forms.AGauge, AGauge, Version=2.1.8814.30445, Culture=neutral, PublicKeyToken=null + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - GB_BattV_Dial + + $this - - 0 + + 2 - + True - + NoControl - + 4, 10 - + 152, 13 - + 152, 13 - + 152, 13 - + 0 - - Battery Voltage + + Frequency - + MiddleCenter - - Lbl_BattV_Dial + + Lbl_InF_Dial - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - GB_BattV_Dial + + GB_InF_Dial - + 1 - - 532, 188 + + True + + + 12, 356 - - 160, 160 + + 680, 0 - - 5 + + 680, 0 - - GB_BattV_Dial + + 680, 21 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 6 - - $this + + CB_CurrentLog - - 4 + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - Left + + $this + + + 1 6, 26 @@ -1443,11 +1791,14 @@ 1 + + + AG_InF - System.Windows.Forms.AGauge, AGauge, Version=2.1.8814.30445, Culture=neutral, PublicKeyToken=null + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null GB_InF_Dial @@ -1455,96 +1806,150 @@ 0 - - True + + 6, 26 - - NoControl + + 148, 130 - - 4, 10 + + 1 - - 152, 13 + + - - 152, 13 + + AG_InV - - 152, 13 + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null - + + GB_InV_Dial + + 0 - - Frequency + + 6, 26 - - MiddleCenter + + 148, 130 - - Lbl_InF_Dial + + 148, 130 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 148, 130 - - GB_InF_Dial + + 1 - + + + + + AG_BattV + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null + + + GB_BattV_Dial + + + 0 + + + 6, 26 + + + 148, 130 + + + 148, 130 + + + 148, 130 + + 1 - - 366, 27 + + - - 160, 160 + + AG_Load - - 5 + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null - - GB_InF_Dial + + GB_Load_Dial - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - - $this + + 6, 26 - - 2 + + 148, 130 - - True - - - 12, 356 + + 148, 130 - - 680, 0 + + 148, 130 - - 680, 0 + + 1 - - 680, 21 + + - - 6 + + AG_OutV - - CB_CurrentLog + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + GB_OutV_Dial - - $this + + 0 - + + 6, 27 + + + 148, 130 + + + 148, 130 + + + 148, 130 + + 1 + + + + + AG_BattCh + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null + + + GB_BattCh_Dial + + + 2 + True @@ -1557,6 +1962,9 @@ 704, 381 + + NoControl + 720, 420 @@ -1644,10 +2052,10 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Menu_Reconnect + + Menu_Connect - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -1656,6 +2064,18 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ToolStripSeparator1 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Menu_Persist + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Menu_Settings diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx b/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx index 89180d3..06c87ae 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx @@ -33,9 +33,6 @@ Файл - - Переподключиться - Отключиться @@ -102,4 +99,43 @@ False + + 177, 22 + + + 180, 22 + + + + + + + + + + + + + + + + + + + + + 177, 6 + + + 180, 22 + + + False + + + NoControl + + + False + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx b/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx index 4beea94..ee90ec2 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx @@ -33,9 +33,6 @@ Файл - - Перепідключитись - Відключитись @@ -99,7 +96,46 @@ Частота + + 177, 22 + Керування старими налаштуваннями... + + 180, 22 + + + + + + + + + + + + + + + + + + + + + 177, 6 + + + 180, 22 + + + False + + + NoControl + + + False + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 1cab472..781b7fd 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -7,6 +7,8 @@ ' ' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY +Imports System.ComponentModel +Imports Microsoft.Win32 Imports WinNUT_Client_Common Public Class WinNUT @@ -24,13 +26,19 @@ Public Class WinNUT End Get End Property + Private ReadOnly Property IsUPSConnected As Boolean + Get + Return UPS_Device IsNot Nothing AndAlso UPS_Device.IsConnected + End Get + End Property + #End Region + Private WithEvents LogFile As Logger = WinNUT_Globals.LogFile 'Object for UPS management Public WithEvents UPS_Device As UPS_Device - Private AutoReconnect As Boolean Private UPS_Retry As Integer = 0 Private UPS_MaxRetry As Integer = 30 @@ -208,8 +216,9 @@ Public Class WinNUT HasFocus = False End If - AddHandler Microsoft.Win32.SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged + AddHandler SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged AddHandler RequestConnect, AddressOf UPS_Connect + AddHandler My.Settings.PropertyChanged, AddressOf SettingsPropertyChanged LogFile.LogTracing(String.Format("{0} v{1} completed initialization.", My.Application.Info.ProductName, My.Application.Info.Version), LogLvl.LOG_NOTICE, Me) @@ -327,6 +336,35 @@ Public Class WinNUT End Sub #End Region + + Private Sub SettingsPropertyChanged(sender As Object, e As PropertyChangedEventArgs) + LogFile.LogTracing("SettingsPropertyChanged: " & e.PropertyName, LogLvl.LOG_DEBUG, Me) + + UpdateMainMenuState() + End Sub + + Private Sub UpdateMainMenuState() + Menu_Persist.Checked = My.Settings.NUT_AutoReconnect + + If OldParams.WinNUT_Params.RegistryKeyRoot IsNot Nothing Then + ManageOldPrefsToolStripMenuItem.Enabled = True + ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Enabled_TooltipText + Else + ManageOldPrefsToolStripMenuItem.Enabled = False + ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Disabled_TooltipText + End If + + If IsUPSConnected Then + Menu_Connect.Enabled = False + Menu_Disconnect.Enabled = True + Menu_UPS_Var.Enabled = True + Else + Menu_Connect.Enabled = True + Menu_Disconnect.Enabled = False + Menu_UPS_Var.Enabled = False + End If + End Sub + Private Sub SystemEvents_PowerModeChanged(sender As Object, e As Microsoft.Win32.PowerModeChangedEventArgs) LogFile.LogTracing("PowerModeChangedEvent: " & [Enum].GetName(GetType(Microsoft.Win32.PowerModes), e.Mode), LogLvl.LOG_NOTICE, Me) Select Case e.Mode @@ -346,26 +384,12 @@ Public Class WinNUT End Select End Sub - ''' - ''' Updates the Manage old prefs File menu item status depending on the presence of old preferences. - ''' - Private Sub UpdateManageOldPrefsMenuItemStatus() - If OldParams.WinNUT_Params.RegistryKeyRoot IsNot Nothing Then - - ManageOldPrefsToolStripMenuItem.Enabled = True - ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Enabled_TooltipText - Else - ManageOldPrefsToolStripMenuItem.Enabled = False - ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Disabled_TooltipText - End If - End Sub - Private Sub RunRegPrefsUpgrade() LogFile.LogTracing("Starting Upgrade dialog.", LogLvl.LOG_NOTICE, Me) Dim upPrefsDg As New Forms.UpgradePrefsDialog() upPrefsDg.ShowDialog() - UpdateManageOldPrefsMenuItemStatus() + UpdateMainMenuState() ApplyApplicationPreferences() End Sub @@ -399,7 +423,7 @@ Public Class WinNUT Lbl_VFirmware.Text = .Firmware End With - Menu_UPS_Var.Enabled = True + UpdateMainMenuState() UpdateIcon_NotifyIcon() LogFile.LogTracing("Update Icon", LogLvl.LOG_DEBUG, Me) RaiseEvent UpdateNotifyIconStr("Connected", Nothing) @@ -436,7 +460,6 @@ Public Class WinNUT Private Sub UPS_Lostconnect() Handles UPS_Device.Lost_Connect LogFile.LogTracing("Notify user of lost connection", LogLvl.LOG_ERROR, Me, String.Format(StrLog.Item(AppResxStr.STR_MAIN_LOSTCONNECT), UPS_Device.Nut_Config.Host, UPS_Device.Nut_Config.Port)) - ' UPSDisconnect() ReInitDisplayValues() If UPS_Device.Nut_Config.AutoReconnect And UPS_Retry <= UPS_MaxRetry Then @@ -456,6 +479,7 @@ Public Class WinNUT ''' Private Sub UPSDisconnectedEvent() Handles UPS_Device.Disconnected ReInitDisplayValues() + UpdateMainMenuState() ActualAppIconIdx = AppIconIdx.IDX_ICO_OFFLINE LogFile.LogTracing("Update Icon", LogLvl.LOG_DEBUG, Me) UpdateIcon_NotifyIcon() @@ -815,7 +839,7 @@ Public Class WinNUT End With End Sub - Private Sub Menu_Reconnect_Click(sender As Object, e As EventArgs) Handles Menu_Reconnect.Click + Private Sub Menu_Reconnect_Click(sender As Object, e As EventArgs) Handles Menu_Connect.Click LogFile.LogTracing("Force Reconnect from menu", LogLvl.LOG_DEBUG, Me) UPSDisconnect() @@ -1047,5 +1071,10 @@ Public Class WinNUT Private Sub ManageOldPrefsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ManageOldPrefsToolStripMenuItem.Click RunRegPrefsUpgrade() End Sub + + Private Sub Menu_Persist_CheckedChanged(sender As Object, e As EventArgs) Handles Menu_Persist.CheckedChanged + LogFile.LogTracing("Menu_Persist checked state changing to " & Menu_Persist.Checked, LogLvl.LOG_DEBUG, Me) + My.Settings.NUT_AutoReconnect = Menu_Persist.Checked + End Sub End Class diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx b/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx index 93b9b17..47a17e3 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx @@ -33,9 +33,6 @@ 文件 - - 重新连接 - 断开连接 @@ -102,7 +99,46 @@ False + + 177, 22 + 管理旧设置... + + 180, 22 + + + + + + + + + + + + + + + + + + + + + 177, 6 + + + 180, 22 + + + False + + + NoControl + + + False + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx b/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx index 93d5391..1c2f0da 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx @@ -33,9 +33,6 @@ 檔案 - - 重新連線 - 中斷連線 @@ -102,4 +99,43 @@ False + + 177, 22 + + + 180, 22 + + + + + + + + + + + + + + + + + + + + + 177, 6 + + + 180, 22 + + + False + + + NoControl + + + False + \ No newline at end of file From 25a72844b1bc3c0ac5be4e9e137d56c5e52564d1 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 25 Jul 2024 14:51:43 -0400 Subject: [PATCH 2/3] Fix WinNUT string being applied to window title The main window title of WinNUT occasionally deviated from the defined program name (WinNUT Client) to just WinNUT. The string has been replaced. --- WinNUT_V2/WinNUT-Client/WinNUT.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 781b7fd..4f70cec 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -309,10 +309,10 @@ Public Class WinNUT If NotifyIcon.Visible = False Then Text = FormText Else - Text = "WinNUT" + Text = ProgramName End If ElseIf sender.WindowState = FormWindowState.Maximized Or sender.WindowState = FormWindowState.Normal Then - Text = "WinNUT" + Text = ProgramName End If End Sub From 886613f7d9dede986c2542847c6749577ba738e8 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 25 Jul 2024 16:17:50 -0400 Subject: [PATCH 3/3] Persistent connections/indefinite reconnections UPS_Device.vb - Provide a public readonly property indicating if the reconnect Timer is operating or not. - Remove retry connection attempt event, retry counter and max retries integer. - Connect_UPS subroutine only starts the reconnection timer on error if it isn't running already. - General exception in Retrieve_UPS_Datas no longer calls the disconnect subroutine, in favor of the Socket_Broken sub (prevents double notifications to listening code.) - Removed several strings related to reconnection attempts - Do not announce connection errors while attempting to reconnect --- .../WinNUT-Client.zh-TW.xlf | 12 ----- .../WinNUT-client.de-DE.xlf | 12 ----- .../WinNUT-client.fr-FR.xlf | 12 ----- .../WinNUT-client.ru-RU.xlf | 13 ------ .../WinNUT-client.uk-UA.xlf | 13 ------ .../WinNUT-client.zh-CN.xlf | 12 ----- .../My Project/Resources.Designer.vb | 27 ----------- .../My Project/Resources.de-DE.resx | 9 ---- .../My Project/Resources.fr-FR.resx | 9 ---- .../WinNUT-Client/My Project/Resources.resx | 9 ---- .../My Project/Resources.ru-RU.resx | 10 ----- .../My Project/Resources.uk-UA.resx | 10 ----- .../My Project/Resources.zh-CN.resx | 9 ---- .../My Project/Resources.zh-TW.resx | 9 ---- WinNUT_V2/WinNUT-Client/WinNUT.vb | 45 +++++++------------ .../WinNUT-Client_Common/Common_Enums.vb | 3 -- WinNUT_V2/WinNUT-Client_Common/UPS_Device.vb | 37 +++++++-------- 17 files changed, 33 insertions(+), 218 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf index a9b22f3..179f1ad 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf @@ -635,10 +635,6 @@ Ini File Moved to {0}.old Reconnection In Progress 正在重新連線 - - Try {0} of {1} - 重試第 {0} 次,共 {1} 次 - Not Connected 未連線 @@ -734,14 +730,6 @@ Cancel to Save Msi and Install Later Disconnected from Nut Host 已與 NUT 伺服器中斷連線。 - - Try Reconnect {0} / {1} - 重試連線 {0} / {1} - - - Max Retry reached. Wait for manual Reconnection - 已達最大重試次數,等待手動重新連線。 - Conditions met for launching the Extinguishing Process 啟動停機程序的條件 diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf index de1246e..89af9d6 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf @@ -1764,10 +1764,6 @@ Ini File Moved to {0}.old Reconnection In Progress Wiederverbindung läuft - - Try {0} of {1} - Versuch {0} von {1} - Not Connected Nicht verbunden @@ -1808,14 +1804,6 @@ Ini File Moved to {0}.old Disconnected from Nut Host Verbindung zum NUT-Host verloren - - Try Reconnect {0} / {1} - Versuche Wiederverbindung {0} / {1} - - - Max Retry reached. Wait for manual Reconnection - Maximale Anzahl Verbindungsversuche erreicht. Auf manuelle Wiederverbindung warten. - Conditions met for launching the Extinguishing Process Voraussetzungen für den Start des Löschprozesses liegen vor diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf index c8cf76f..40e69d9 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf @@ -1788,10 +1788,6 @@ Fichier Ini déplacé vers {0}.old Reconnection In Progress Reconnexion en cours - - Try {0} of {1} - Essai {0} sur {1} - Not Connected Non connecté @@ -1832,14 +1828,6 @@ Fichier Ini déplacé vers {0}.old Disconnected from Nut Host Déconnectée du serveur NUT - - Try Reconnect {0} / {1} - Tentative de reconnexion {0} / {1} - - - Max Retry reached. Wait for manual Reconnection - Nombre maximale d'essai atteint. En attente de reconnexion manuelle - Conditions met for launching the Extinguishing Process Conditions atteintes pour le lancement du Processus d'Extinction diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf index f164421..1101e46 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf @@ -636,10 +636,6 @@ Ini File Moved to {0}.old Reconnection In Progress Переподключение в процессе - - Try {0} of {1} - Попытка {0} из {1} - Not Connected Не подключено @@ -738,15 +734,6 @@ Cancel to Save Msi and Install Later Disconnected from Nut Host Отключиться от сервера NUT - - Try Reconnect {0} / {1} - Попытка переподключения {0} / {1} - - - Max Retry reached. Wait for manual Reconnection - Достигнуто макимальное количество попыток повторного подключения. -Ожидается ручное переподключение - Conditions met for launching the Extinguishing Process Достигнуты условия для запуска процесса отключения diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf index c96b0a7..8a013d7 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf @@ -636,10 +636,6 @@ Ini File Moved to {0}.old Reconnection In Progress Перепідключення в процесі - - Try {0} of {1} - Спроба {0} из {1} - Not Connected Не підключено @@ -738,15 +734,6 @@ Cancel to Save Msi and Install Later Disconnected from Nut Host Від'єднатися від сервера NUT - - Try Reconnect {0} / {1} - Спроба перепідключення {0} / {1} - - - Max Retry reached. Wait for manual Reconnection - Досягнуто макимальної кількості спроб повторного з'єднання. -Ожидается ручное переподключение - Conditions met for launching the Extinguishing Process Досягнуто умов для запуску процесу вимкнення diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf index 58e119c..589a413 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf @@ -625,10 +625,6 @@ Ini 文件重命名为 {0}.old Reconnection In Progress 重连中 - - Try {0} of {1} - 尝试 {1} 的 {0} - Not Connected 未连接 @@ -719,14 +715,6 @@ Cancel to Save Msi and Install Later Disconnected from Nut Host 从 Nut 主机断开了连接 - - Try Reconnect {0} / {1} - 尝试重连 {0} / {1} - - - Max Retry reached. Wait for manual Reconnection - 达到最大重试次数。等待手动重连。 - Conditions met for launching the Extinguishing Process 触发关机流程所需满足的条件 diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb index 3b341e4..dccd3b4 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb @@ -416,15 +416,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to Try {0} of {1}. - ''' - Public ReadOnly Property Frm_Main_Str_04() As String - Get - Return ResourceManager.GetString("Frm_Main_Str_04", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to Not Connected. ''' @@ -645,24 +636,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to Try Reconnect {0} / {1}. - ''' - Public ReadOnly Property Log_Str_06() As String - Get - Return ResourceManager.GetString("Log_Str_06", resourceCulture) - End Get - End Property - - ''' - ''' Looks up a localized string similar to Max Retry reached. Wait for manual Reconnection. - ''' - Public ReadOnly Property Log_Str_07() As String - Get - Return ResourceManager.GetString("Log_Str_07", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to Conditions met for launching the Extinguishing Process. ''' diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx index c81c6df..698d25b 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx @@ -42,9 +42,6 @@ Wiederverbindung läuft - - Versuch {0} von {1} - Nicht verbunden @@ -75,12 +72,6 @@ Verbindung zum NUT-Host verloren - - Versuche Wiederverbindung {0} / {1} - - - Maximale Anzahl Verbindungsversuche erreicht. Auf manuelle Wiederverbindung warten. - Voraussetzungen für den Start des Löschprozesses liegen vor diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx index 19da17a..ce9efe1 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx @@ -46,9 +46,6 @@ Fichier Ini déplacé vers {0}.old Reconnexion en cours - - Essai {0} sur {1} - Non connecté @@ -79,12 +76,6 @@ Fichier Ini déplacé vers {0}.old Déconnectée du serveur NUT - - Tentative de reconnexion {0} / {1} - - - Nombre maximale d'essai atteint. En attente de reconnexion manuelle - Conditions atteintes pour le lancement du Processus d'Extinction diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx index 9a21365..333f09d 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx @@ -228,9 +228,6 @@ Ini File Moved to {0}.old Reconnection In Progress - - Try {0} of {1} - Not Connected @@ -306,12 +303,6 @@ Cancel to Save Msi and Install Later Disconnected from Nut Host - - Try Reconnect {0} / {1} - - - Max Retry reached. Wait for manual Reconnection - Conditions met for launching the Extinguishing Process diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx index 0600765..3dc302f 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx @@ -24,9 +24,6 @@ Переподключение в процессе - - Попытка {0} из {1} - Не подключено @@ -96,13 +93,6 @@ Отключиться от сервера NUT - - Попытка переподключения {0} / {1} - - - Достигнуто макимальное количество попыток повторного подключения. -Ожидается ручное переподключение - Достигнуты условия для запуска процесса отключения diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx index cd5b490..43d67ec 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx @@ -24,9 +24,6 @@ Перепідключення в процесі - - Спроба {0} из {1} - Не підключено @@ -96,13 +93,6 @@ Від'єднатися від сервера NUT - - Спроба перепідключення {0} / {1} - - - Досягнуто макимальної кількості спроб повторного з'єднання. -Ожидается ручное переподключение - Досягнуто умов для запуску процесу вимкнення diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx index e2182c0..0a5808b 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx @@ -25,9 +25,6 @@ Ini 文件重命名为 {0}.old 重连中 - - 尝试 {1} 的 {0} - 未连接 @@ -91,12 +88,6 @@ Ini 文件重命名为 {0}.old 从 Nut 主机断开了连接 - - 尝试重连 {0} / {1} - - - 达到最大重试次数。等待手动重连。 - 触发关机流程所需满足的条件 diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx index 69fe0d3..22b28cd 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx @@ -24,9 +24,6 @@ 正在重新連線 - - 重試第 {0} 次,共 {1} 次 - 未連線 @@ -93,12 +90,6 @@ 已與 NUT 伺服器中斷連線。 - - 重試連線 {0} / {1} - - - 已達最大重試次數,等待手動重新連線。 - 啟動停機程序的條件 diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 4f70cec..38627ca 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -35,13 +35,8 @@ Public Class WinNUT #End Region Private WithEvents LogFile As Logger = WinNUT_Globals.LogFile - - 'Object for UPS management Public WithEvents UPS_Device As UPS_Device - Private UPS_Retry As Integer = 0 - Private UPS_MaxRetry As Integer = 30 - 'Variable used with Toast Functionnality Public WithEvents FrmBuild As Update_Gui Public ToastPopup As New ToastPopup @@ -91,7 +86,6 @@ Public Class WinNUT StrLog.Insert(AppResxStr.STR_MAIN_OLDINI_RENAMED, My.Resources.Frm_Main_Str_01) StrLog.Insert(AppResxStr.STR_MAIN_OLDINI, My.Resources.Frm_Main_Str_02) StrLog.Insert(AppResxStr.STR_MAIN_RECONNECT, My.Resources.Frm_Main_Str_03) - StrLog.Insert(AppResxStr.STR_MAIN_RETRY, My.Resources.Frm_Main_Str_04) StrLog.Insert(AppResxStr.STR_MAIN_NOTCONN, My.Resources.Frm_Main_Str_05) StrLog.Insert(AppResxStr.STR_MAIN_CONN, My.Resources.Frm_Main_Str_06) StrLog.Insert(AppResxStr.STR_MAIN_OL, My.Resources.Frm_Main_Str_07) @@ -123,8 +117,6 @@ Public Class WinNUT StrLog.Insert(AppResxStr.STR_LOG_CON_FAILED, My.Resources.Log_Str_03) StrLog.Insert(AppResxStr.STR_LOG_CON_RETRY, My.Resources.Log_Str_04) StrLog.Insert(AppResxStr.STR_LOG_LOGOFF, My.Resources.Log_Str_05) - StrLog.Insert(AppResxStr.STR_LOG_NEW_RETRY, My.Resources.Log_Str_06) - StrLog.Insert(AppResxStr.STR_LOG_STOP_RETRY, My.Resources.Log_Str_07) StrLog.Insert(AppResxStr.STR_LOG_SHUT_START, My.Resources.Log_Str_08) StrLog.Insert(AppResxStr.STR_LOG_SHUT_STOP, My.Resources.Log_Str_09) StrLog.Insert(AppResxStr.STR_LOG_NO_UPDATE, My.Resources.Log_Str_10) @@ -354,7 +346,7 @@ Public Class WinNUT ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Disabled_TooltipText End If - If IsUPSConnected Then + If IsUPSConnected OrElse (UPS_Device IsNot Nothing AndAlso UPS_Device.IsReconnecting) Then Menu_Connect.Enabled = False Menu_Disconnect.Enabled = True Menu_UPS_Var.Enabled = True @@ -437,10 +429,12 @@ Public Class WinNUT End Sub Private Sub ConnectionError(sender As UPS_Device, ex As Exception) Handles UPS_Device.ConnectionError - LogFile.LogTracing(String.Format("Something went wrong connecting to UPS {0}. IsConnected: {1}, IsLoggedIn: {2}", - sender.Name, sender.IsConnected, sender.IsLoggedIn), LogLvl.LOG_ERROR, Me, - String.Format(StrLog.Item(AppResxStr.STR_LOG_CON_FAILED), sender.Nut_Config.Host, sender.Nut_Config.Port, - ex.Message)) + If Not UPS_Device.IsReconnecting Then + LogFile.LogTracing(String.Format("Something went wrong connecting to UPS {0}. IsConnected: {1}, IsLoggedIn: {2}", + sender.Name, sender.IsConnected, sender.IsLoggedIn), LogLvl.LOG_ERROR, Me, + String.Format(StrLog.Item(AppResxStr.STR_LOG_CON_FAILED), sender.Nut_Config.Host, sender.Nut_Config.Port, + ex.Message)) + End If End Sub ''' @@ -458,20 +452,24 @@ Public Class WinNUT End Sub Private Sub UPS_Lostconnect() Handles UPS_Device.Lost_Connect - LogFile.LogTracing("Notify user of lost connection", LogLvl.LOG_ERROR, Me, - String.Format(StrLog.Item(AppResxStr.STR_MAIN_LOSTCONNECT), UPS_Device.Nut_Config.Host, UPS_Device.Nut_Config.Port)) + LogFile.LogTracing("UPS reports lost (broken) connection.", LogLvl.LOG_ERROR, Me, + String.Format(StrLog.Item(AppResxStr.STR_MAIN_LOSTCONNECT), UPS_Device.Nut_Config.Host, UPS_Device.Nut_Config.Port)) ReInitDisplayValues() - If UPS_Device.Nut_Config.AutoReconnect And UPS_Retry <= UPS_MaxRetry Then + If UPS_Device.Nut_Config.AutoReconnect Then ActualAppIconIdx = AppIconIdx.IDX_ICO_RETRY + Dim Message = String.Format(StrLog.Item(AppResxStr.STR_MAIN_RECONNECT)) + LogFile.LogTracing("UPS reports it lost connection and is retrying.", LogLvl.LOG_WARNING, Me, Message) + RaiseEvent UpdateNotifyIconStr("Retry", Message) Else + ActualAppIconIdx = AppIconIdx.IDX_ICO_OFFLINE + RaiseEvent UpdateNotifyIconStr("Lost Connect", Nothing) End If UpdateIcon_NotifyIcon() - RaiseEvent UpdateNotifyIconStr("Lost Connect", Nothing) - RaiseEvent UpdateBatteryState("Lost Connect") LogFile.LogTracing("Update Icon", LogLvl.LOG_DEBUG, Me) + RaiseEvent UpdateBatteryState("Lost Connect") End Sub ''' @@ -524,13 +522,6 @@ Public Class WinNUT End If End Sub - Private Sub NewRetry_NotifyIcon() Handles UPS_Device.New_Retry - Dim Message As String = String.Format(StrLog.Item(AppResxStr.STR_MAIN_RETRY), UPS_Device.Retry, UPS_Device.MaxRetry) - RaiseEvent UpdateNotifyIconStr("Retry", Message) - UpdateIcon_NotifyIcon() - LogFile.LogTracing("Update Icon", LogLvl.LOG_DEBUG, Me) - End Sub - Private Sub Event_UpdateNotifyIconStr(Optional Reason As String = Nothing, Optional Message As String = Nothing) Handles Me.UpdateNotifyIconStr Dim ShowVersion As String = ShortProgramVersion Dim NotifyStr As String = ProgramName & " - " & ShowVersion & vbNewLine @@ -648,9 +639,7 @@ Public Class WinNUT End Sub Public Shared Sub Event_ChangeStatus() Handles Me.On_Battery, Me.On_Line, - UPS_Device.Lost_Connect, UPS_Device.Connected, UPS_Device.Disconnected, UPS_Device.New_Retry - ', UPS_Device.Unknown_UPS - ', UPS_Device.InvalidLogin + UPS_Device.Lost_Connect, UPS_Device.Connected, UPS_Device.Disconnected WinNUT.NotifyIcon.BalloonTipText = WinNUT.NotifyIcon.Text If WinNUT.AllowToast And WinNUT.NotifyIcon.BalloonTipText <> "" Then diff --git a/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb b/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb index 648da9e..15196c3 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb @@ -34,7 +34,6 @@ Public Enum AppResxStr STR_MAIN_OLDINI_RENAMED STR_MAIN_OLDINI STR_MAIN_RECONNECT - STR_MAIN_RETRY STR_MAIN_NOTCONN STR_MAIN_CONN STR_MAIN_OL @@ -58,8 +57,6 @@ Public Enum AppResxStr STR_LOG_CON_FAILED STR_LOG_CON_RETRY STR_LOG_LOGOFF - STR_LOG_NEW_RETRY - STR_LOG_STOP_RETRY STR_LOG_SHUT_START STR_LOG_SHUT_STOP STR_LOG_NO_UPDATE diff --git a/WinNUT_V2/WinNUT-Client_Common/UPS_Device.vb b/WinNUT_V2/WinNUT-Client_Common/UPS_Device.vb index f428dee..88595e7 100644 --- a/WinNUT_V2/WinNUT-Client_Common/UPS_Device.vb +++ b/WinNUT_V2/WinNUT-Client_Common/UPS_Device.vb @@ -28,6 +28,13 @@ Public Class UPS_Device Return (Nut_Socket.ConnectionStatus) End Get End Property + + Public ReadOnly Property IsReconnecting As Boolean + Get + Return Reconnect_Nut.Enabled + End Get + End Property + Public ReadOnly Property IsLoggedIn As Boolean Get Return Nut_Socket.IsLoggedIn @@ -79,11 +86,10 @@ Public Class UPS_Device Public Event Connected(sender As UPS_Device) ' Notify that the connection was closed gracefully. Public Event Disconnected() - ' Notify of an unexpectedly lost connection (??) + ' Notify of an unexpectedly lost connection. Public Event Lost_Connect() ' Error encountered when trying to connect. Public Event ConnectionError(sender As UPS_Device, innerException As Exception) - Public Event New_Retry() ''' ''' Raised when the NUT server returns an error during normal communication and is deemed important for the client @@ -107,9 +113,7 @@ Public Class UPS_Device Private Freq_Fallback As Double Public Nut_Config As Nut_Parameter - Public Retry As Integer = 0 - Public MaxRetry As Integer = 30 - Private LogFile As Logger + Private ReadOnly LogFile As Logger Public Sub New(ByRef Nut_Config As Nut_Parameter, ByRef LogFile As Logger, pollInterval As Integer, defaultFrequency As Integer) Me.LogFile = LogFile @@ -147,7 +151,7 @@ Public Class UPS_Device Catch ex As Exception RaiseEvent ConnectionError(Me, ex) - If retryOnConnFailure Then + If retryOnConnFailure AndAlso IsReconnecting = False Then LogFile.LogTracing("Reconnection Process Started", LogLvl.LOG_NOTICE, Me) Reconnect_Nut.Start() End If @@ -178,7 +182,6 @@ Public Class UPS_Device Reconnect_Nut.Stop() End If - Retry = 0 Try Nut_Socket.Disconnect(forceful) Catch nutEx As NutException @@ -195,6 +198,7 @@ Public Class UPS_Device Private Sub Socket_Broken() Handles Nut_Socket.Socket_Broken LogFile.LogTracing("Socket has reported a Broken event.", LogLvl.LOG_WARNING, Me) + Update_Data.Stop() RaiseEvent Lost_Connect() If Nut_Config.AutoReconnect Then @@ -204,19 +208,11 @@ Public Class UPS_Device End Sub Private Sub AttemptReconnect(sender As Object, e As EventArgs) - Retry += 1 - If Retry <= MaxRetry Then - RaiseEvent New_Retry() - LogFile.LogTracing(String.Format("Try Reconnect {0} / {1}", Retry, MaxRetry), LogLvl.LOG_NOTICE, Me, String.Format(StrLog.Item(AppResxStr.STR_LOG_NEW_RETRY), Retry, MaxRetry)) - Connect_UPS() - If IsConnected Then - LogFile.LogTracing("Nut Host Reconnected", LogLvl.LOG_DEBUG, Me) - Reconnect_Nut.Stop() - Retry = 0 - End If - Else - LogFile.LogTracing("Max Retry reached. Stop Process Autoreconnect and wait for manual Reconnection", LogLvl.LOG_ERROR, Me, StrLog.Item(AppResxStr.STR_LOG_STOP_RETRY)) - Disconnect(True) + LogFile.LogTracing("Attempting reconnection...", LogLvl.LOG_NOTICE, Me) + Connect_UPS() + If IsConnected Then + LogFile.LogTracing("Nut Host Reconnected", LogLvl.LOG_NOTICE, Me) + Reconnect_Nut.Stop() End If End Sub @@ -429,7 +425,6 @@ Public Class UPS_Device Catch Excep As Exception LogFile.LogTracing("Something went wrong in Retrieve_UPS_Datas:", LogLvl.LOG_ERROR, Me) LogFile.LogException(Excep, Me) - Disconnect(False, True) Socket_Broken() End Try End Sub