From 4b1457507913f46f68f2173daa8a628b5b79433a Mon Sep 17 00:00:00 2001 From: gbakeman Date: Tue, 25 Nov 2025 15:17:01 -0500 Subject: [PATCH 01/10] Remove strings relating to deleted .INI import system --- .../WinNUT-Client.zh-TW.xlf | 31 ++++---- .../WinNUT-client.de-DE.xlf | 77 +++++++++---------- .../WinNUT-client.fr-FR.xlf | 34 ++++---- .../WinNUT-client.ru-RU.xlf | 31 ++++---- .../WinNUT-client.uk-UA.xlf | 31 ++++---- .../WinNUT-client.zh-CN.xlf | 32 ++++---- .../My Project/Resources.Designer.vb | 28 +++---- .../My Project/Resources.de-DE.resx | 6 -- .../My Project/Resources.fr-FR.resx | 7 -- .../WinNUT-Client/My Project/Resources.resx | 11 +-- .../My Project/Resources.ru-RU.resx | 6 -- .../My Project/Resources.uk-UA.resx | 6 -- .../My Project/Resources.zh-CN.resx | 7 -- .../My Project/Resources.zh-TW.resx | 6 -- WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj | 1 + WinNUT_V2/WinNUT-Client/WinNUT.vb | 2 - .../WinNUT-Client_Common/Common_Enums.vb | 2 - 17 files changed, 128 insertions(+), 190 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 db819aa..7935d31 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf @@ -477,15 +477,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} ..\Resources\Delete_LogFile_24x24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Delete_LogFile_24x24.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 - 已匯入舊的 ups.ini, ini 檔案已重新命名為 {0}.old - - - Old ups.ini imported - 匯入舊的 ups.ini - Reconnection In Progress 正在重新連線 @@ -697,6 +688,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Checking for update... Inform the user that WinNUT is checking for an update. + + Error loading encrypted Settings (username/password) + Error loading encrypted Settings (username/password) + Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + @@ -2360,8 +2356,8 @@ Accepted value: Numeric value from 0 to 100. None - 180, 22 - 180, 22 + 177, 22 + 177, 22 UPS Variable @@ -2384,8 +2380,8 @@ Accepted value: Numeric value from 0 to 100. 檔案 - 180, 22 - 180, 22 + 133, 22 + 133, 22 Disconnect @@ -3568,8 +3564,9 @@ Accepted value: Numeric value from 0 to 100. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Connect @@ -3600,12 +3597,14 @@ Accepted value: Numeric value from 0 to 100. - 177, 6 + 130, 6 177, 6 + Please verify the translation’s accuracy as the source string was updated after it was translated. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Persist 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 f2d904b..522132d 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf @@ -1197,19 +1197,19 @@ UPS name to monitor. Accepted Value: Name of the UPS configured in the Nut server. - Name der zu überwachenden USV. + Name der zu überwachenden USV. Wertebereich: Name der auf dem NUT-Server konfigurierten USV. Nut Server Port Number (default = 3493). Accepted value: Numeric value from 1 to 65535. - NUT-Server Portnummer (Standard = 3493). + NUT-Server Portnummer (Standard = 3493). Wertebereich: Numerischer Wert von 1 bis 65535. Nut server address. Accepted value: IPV4 / IPV6 / FQDN address. - Adresse des NUT-Servers. + Adresse des NUT-Servers. Wertebereich: IPV4 / IPV6 / FQDN-Adresse. @@ -1223,49 +1223,49 @@ Wertebereich: IPV4 / IPV6 / FQDN-Adresse. Maximum Battery Voltage. Accepted value: Numeric value from 0 to 100. - Maximale Akkuspannung. + Maximale Akkuspannung. Wertebereich: Numerischer Wert von 0 bis 100. Maximum Output Voltage. Accepted value: Numeric value from 0 to 999. - Maximale Ausgangsspannung. + Maximale Ausgangsspannung. Wertebereich: Numerischer Wert von 0 bis 999. Maximum input frequency. Accepted value: Numeric value from 0 to 100. - Maximale Eingangsfrequenz. + Maximale Eingangsfrequenz. Wertebereich: Numerischer Wert von 0 bis 100. Minimum Battery Voltage. Accepted value: Numeric value from 0 to 100. - Minimale Akkuspannung. + Minimale Akkuspannung. Wertebereich: Numerischer Wert von 0 bis 100. Minimum Output Voltage. Accepted value: Numeric value from 0 to 999. - Minimale Ausgangsspannung. + Minimale Ausgangsspannung. Wertebereich: Numerischer Wert von 0 bis 999. Minimum input frequency. Accepted value: Numeric value from 0 to 100. - Minimale Eingangsfrequenz. + Minimale Eingangsfrequenz. Wertebereich: Numerischer Wert von 0 bis 100. Maximum input voltage. Accepted value: Numeric value from 0 to 999. - Maximale Eingangsspannung. + Maximale Eingangsspannung. Wertebereich: Numerischer Wert von 0 bis 999. Minimum input voltage. Accepted value: Numeric value from 0 to 999. - Minimale Eingangsspannung. + Minimale Eingangsspannung. Wertebereich: Numerischer Wert von 0 bis 999. @@ -1307,21 +1307,21 @@ Wertebereich: Numerischer Wert von 0 bis 999. Additional grace period limit. Accepted value: Numeric value from 0 to 3600. - Limit für zusätzliche Verzögerung. + Limit für zusätzliche Verzögerung. Wertebereich: Numerischer Wert von 0 bis 3600. Allow additional time during the shutdown procedure. Note: This additional time could go beyond the UPS backup time - USE WITH CAUTION!!! - Zusätzliche Zeit für das Herunterfahren erlauben. -Hinweis: + Zusätzliche Zeit für das Herunterfahren erlauben. +Hinweis: Diese zusätzliche Zeit kann über die Verfügbarkeit der USV hinausgehen - MIT VORSICHT VERWENDEN !!! Stop procedure delay if delayed. Accepted value: Numeric value from 0 to 3600. - Stoppvorgang bei Verzögerung unterbrechen. + Stoppvorgang bei Verzögerung unterbrechen. Wertebereich: Numerischer Wert von 0 bis 3600. @@ -1335,13 +1335,13 @@ Wertebereich: Numerischer Wert von 0 bis 3600. Lower backup time limit triggering the shutdown procedure. Accepted value: Numeric value from 0 to 3600. - Unteres Backup-Zeitlimit, welches das Herunterfahren auslöst. + Unteres Backup-Zeitlimit, welches das Herunterfahren auslöst. Wertebereich: Numerischer Wert von 0 bis 3600. Lower limit of the battery level triggering the shutdown procedure. Accepted value: Numeric value from 0 to 100. - Untergrenze des Akkuladestands, welcher den Abschaltvorgang auslöst. + Untergrenze des Akkuladestands, welcher den Abschaltvorgang auslöst. Wertebereich: Numerischer Wert von 0 bis 100. @@ -1712,18 +1712,9 @@ Wertebereich: Numerischer Wert von 0 bis 100. Battery_Charge : {0} Remaining Time : {1} - Akkuladung: {0} + Akkuladung: {0} Verbleibende Zeit: {1} - - Old ups.ini imported -Ini File Moved to {0}.old - Alte ups.ini importiert INI-Datei nach {0}.old verschoben - - - Old ups.ini imported - Alte ups.ini importiert - Reconnection In Progress Wiederverbindung läuft @@ -1869,10 +1860,10 @@ Ini File Moved to {0}.old {0} Please correct the error, or cancel the upgrade dialog to continue with the default settings. - Während des Upgrade-Vorgangs ist ein Fehler aufgetreten: - -{0} - + Während des Upgrade-Vorgangs ist ein Fehler aufgetreten: + +{0} + Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um mit den Standardeinstellungen fortzufahren. Alert the user that an error occurred during the upgrade procedure, attempt to give a brief summary of the error, and prompt them to take the next step. @@ -1922,6 +1913,11 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m Updateprüfung läuft... Inform the user that WinNUT is checking for an update. + + Error loading encrypted Settings (username/password) + Error loading encrypted Settings (username/password) + Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + @@ -1936,8 +1932,8 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m 248, 17 - 180, 22 - 180, 22 + 177, 22 + 177, 22 UPS Variable @@ -1960,8 +1956,8 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m Datei - 180, 22 - 180, 22 + 133, 22 + 133, 22 Disconnect @@ -3204,8 +3200,9 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Connect @@ -3236,12 +3233,14 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m - 177, 6 + 130, 6 177, 6 + Please verify the translation’s accuracy as the source string was updated after it was translated. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Persist @@ -3619,7 +3618,7 @@ along with this program. If not, see https://www.gnu.org/licenses/. Battery_Charge : {WinNUT.UPS_BattCh} Remaining Time : {WinNUT.Lbl_VRTime.Text} - Akkuladung: {WinNUT.UPS_BattCh} + Akkuladung: {WinNUT.UPS_BattCh} Verbleibende Zeit: {WinNUT.Lbl_VRTime.Text} 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 a957a2d..96563cc 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf @@ -1718,16 +1718,6 @@ Remaining Time : {1} Charge Batterie : {0} Temps restant : {1} - - Old ups.ini imported -Ini File Moved to {0}.old - Ancien Fichier "ups.ini" importé -Fichier Ini déplacé vers {0}.old - - - Old ups.ini imported - Ancien Fichier "ups.ini" importé - Reconnection In Progress Reconnexion en cours @@ -1926,6 +1916,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Checking for update... Inform the user that WinNUT is checking for an update. + + Error loading encrypted Settings (username/password) + Error loading encrypted Settings (username/password) + Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + @@ -1940,8 +1935,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa 248, 17 - 180, 22 - 180, 22 + 177, 22 + 177, 22 UPS Variable @@ -1964,8 +1959,8 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Fichier - 180, 22 - 180, 22 + 133, 22 + 133, 22 Disconnect @@ -3208,8 +3203,9 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Connect @@ -3240,12 +3236,14 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa - 177, 6 + 130, 6 177, 6 + Please verify the translation’s accuracy as the source string was updated after it was translated. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Persist @@ -4199,4 +4197,4 @@ Temps restant: {WinNUT.Lbl_VRTime.Text} - + \ No newline at end of file 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 f29f5a8..bf913d0 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf @@ -478,15 +478,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} ..\Resources\Delete_LogFile_24x24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Delete_LogFile_24x24.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 - Старая версия ups.ini перемещена в {0}.old - - - Old ups.ini imported - Старая версия ups.ini импортирована - Reconnection In Progress Переподключение в процессе @@ -699,6 +690,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Checking for update... Inform the user that WinNUT is checking for an update. + + Error loading encrypted Settings (username/password) + Error loading encrypted Settings (username/password) + Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + @@ -2379,8 +2375,8 @@ Accepted value: Numeric value from 0 to 100. None - 180, 22 - 180, 22 + 177, 22 + 177, 22 UPS Variable @@ -2403,8 +2399,8 @@ Accepted value: Numeric value from 0 to 100. Файл - 180, 22 - 180, 22 + 133, 22 + 133, 22 Disconnect @@ -3587,8 +3583,9 @@ Accepted value: Numeric value from 0 to 100. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Connect @@ -3619,12 +3616,14 @@ Accepted value: Numeric value from 0 to 100. - 177, 6 + 130, 6 177, 6 + Please verify the translation’s accuracy as the source string was updated after it was translated. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Persist 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 aa440a5..f60265e 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf @@ -478,15 +478,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} ..\Resources\Delete_LogFile_24x24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Delete_LogFile_24x24.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 - Стара версія ups.ini переміщена в {0}.old - - - Old ups.ini imported - Старая версія ups.ini імпортована - Reconnection In Progress Перепідключення в процесі @@ -699,6 +690,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Checking for update... Inform the user that WinNUT is checking for an update. + + Error loading encrypted Settings (username/password) + Error loading encrypted Settings (username/password) + Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + @@ -2379,8 +2375,8 @@ Accepted value: Numeric value from 0 to 100. None - 180, 22 - 180, 22 + 177, 22 + 177, 22 UPS Variable @@ -2403,8 +2399,8 @@ Accepted value: Numeric value from 0 to 100. Файл - 180, 22 - 180, 22 + 133, 22 + 133, 22 Disconnect @@ -3587,8 +3583,9 @@ Accepted value: Numeric value from 0 to 100. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Connect @@ -3619,12 +3616,14 @@ Accepted value: Numeric value from 0 to 100. - 177, 6 + 130, 6 177, 6 + Please verify the translation’s accuracy as the source string was updated after it was translated. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Persist 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 0e502f7..628c4ca 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf @@ -466,16 +466,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} ..\Resources\Delete_LogFile_24x24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Delete_LogFile_24x24.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 - 导入了旧的 ups.ini -Ini 文件重命名为 {0}.old - - - Old ups.ini imported - 导入了旧的 ups.ini - Reconnection In Progress 重连中 @@ -700,6 +690,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Checking for update... Inform the user that WinNUT is checking for an update. + + Error loading encrypted Settings (username/password) + Error loading encrypted Settings (username/password) + Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + @@ -2379,8 +2374,8 @@ Accepted value: Numeric value from 0 to 100. None - 180, 22 - 180, 22 + 177, 22 + 177, 22 UPS Variable @@ -2403,8 +2398,8 @@ Accepted value: Numeric value from 0 to 100. 文件 - 180, 22 - 180, 22 + 133, 22 + 133, 22 Disconnect @@ -3587,8 +3582,9 @@ Accepted value: Numeric value from 0 to 100. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Connect @@ -3619,12 +3615,14 @@ Accepted value: Numeric value from 0 to 100. - 177, 6 + 130, 6 177, 6 + Please verify the translation’s accuracy as the source string was updated after it was translated. - 180, 22 + 133, 22 180, 22 + Please verify the translation’s accuracy as the source string was updated after it was translated. Persist diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb index 6e023e5..a99377c 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb @@ -388,25 +388,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to Old ups.ini imported - '''Ini File Moved to {0}.old. - ''' - Public ReadOnly Property Frm_Main_Str_01() As String - Get - Return ResourceManager.GetString("Frm_Main_Str_01", resourceCulture) - End Get - End Property - - ''' - ''' Looks up a localized string similar to Old ups.ini imported. - ''' - Public ReadOnly Property Frm_Main_Str_02() As String - Get - Return ResourceManager.GetString("Frm_Main_Str_02", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to Reconnection In Progress. ''' @@ -634,6 +615,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Error loading encrypted Settings (username/password). + ''' + Public ReadOnly Property Log_Str_ErrorDecrypting() As String + Get + Return ResourceManager.GetString("Log_Str_ErrorDecrypting", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Checking for update.... ''' 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 f98a512..319a446 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx @@ -19,12 +19,6 @@ Akkuladung: {0} Verbleibende Zeit: {1} - - Alte ups.ini importiert INI-Datei nach {0}.old verschoben - - - Alte ups.ini importiert - Wiederverbindung läuft 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 3b526dc..b5432e5 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx @@ -19,13 +19,6 @@ Charge Batterie : {0} Temps restant : {1} - - Ancien Fichier "ups.ini" importé -Fichier Ini déplacé vers {0}.old - - - Ancien Fichier "ups.ini" importé - Reconnexion en cours diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx index 04208ab..6a9fadd 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx @@ -218,13 +218,6 @@ ..\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 - - - Old ups.ini imported - Reconnection In Progress @@ -305,6 +298,10 @@ Remaining Time : {1} Stop condition imposed by the NUT server + + Error loading encrypted Settings (username/password) + Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + Old preferences were not detected in your system. Similar to _Enabled tooltip, except that the preferences were not detected. 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 89aa9e1..0103d44 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx @@ -15,12 +15,6 @@ Программное отключение в - - Старая версия ups.ini перемещена в {0}.old - - - Старая версия ups.ini импортирована - Переподключение в процессе 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 5efe837..08d0bb3 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx @@ -15,12 +15,6 @@ Програмне вимкнення о - - Стара версія ups.ini переміщена в {0}.old - - - Старая версія ups.ini імпортована - Перепідключення в процесі 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 b6e69f8..e4e9967 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx @@ -15,13 +15,6 @@ 应用程序被关闭于 - - 导入了旧的 ups.ini -Ini 文件重命名为 {0}.old - - - 导入了旧的 ups.ini - 重连中 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 73d5f99..dbd344c 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx @@ -15,12 +15,6 @@ 應用程式關閉於 - - 已匯入舊的 ups.ini, ini 檔案已重新命名為 {0}.old - - - 匯入舊的 ups.ini - 正在重新連線 diff --git a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj index 2851a25..cec7377 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj +++ b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj @@ -124,6 +124,7 @@ LocalIntranet + diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index deec7d5..0f4348a 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -71,8 +71,6 @@ Public Class WinNUT Private Sub WinNUT_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'Add Main Gui's Strings - 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_NOTCONN, My.Resources.Frm_Main_Str_05) StrLog.Insert(AppResxStr.STR_MAIN_CONN, My.Resources.Frm_Main_Str_06) diff --git a/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb b/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb index abec61b..5c8eba2 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb @@ -31,8 +31,6 @@ End Enum 'Define Resource Str Public Enum AppResxStr - STR_MAIN_OLDINI_RENAMED - STR_MAIN_OLDINI STR_MAIN_RECONNECT STR_MAIN_NOTCONN STR_MAIN_CONN From 1b1c02a618e11215e1c3afd246d81323b37f3051 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 4 Dec 2025 15:03:54 -0500 Subject: [PATCH 02/10] Remove UpgradePrefsCompleted setting Was redundant due to the `IsFirstRun` setting. --- WinNUT_V2/WinNUT-Client/App.config | 3 --- .../Models/UpgradePrefsDialogModel.vb | 3 --- .../WinNUT-Client/My Project/Settings.Designer.vb | 14 +------------- .../WinNUT-Client/My Project/Settings.settings | 3 --- WinNUT_V2/WinNUT-Client/WinNUT.vb | 2 +- 5 files changed, 2 insertions(+), 23 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/App.config b/WinNUT_V2/WinNUT-Client/App.config index e336ab6..005762c 100644 --- a/WinNUT_V2/WinNUT-Client/App.config +++ b/WinNUT_V2/WinNUT-Client/App.config @@ -49,9 +49,6 @@ - - False - False diff --git a/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb b/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb index d594394..e64f501 100644 --- a/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb +++ b/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb @@ -203,7 +203,6 @@ Namespace Models Else LogFile.LogTracing("Exiting out of upgrade dialog.", LogLvl.LOG_NOTICE, Me) _parentForm.DialogResult = DialogResult.Cancel - My.Settings.UpgradePrefsCompleted = True _parentForm.Close() End If End Sub @@ -268,8 +267,6 @@ Namespace Models End If ProgressPercent = 100 - - My.Settings.UpgradePrefsCompleted = True _parentForm.Close() End Sub diff --git a/WinNUT_V2/WinNUT-Client/My Project/Settings.Designer.vb b/WinNUT_V2/WinNUT-Client/My Project/Settings.Designer.vb index 4e2f6c4..b4eb4fd 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Settings.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/My Project/Settings.Designer.vb @@ -15,7 +15,7 @@ Option Explicit On Namespace My _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase @@ -54,18 +54,6 @@ Namespace My End Get End Property - _ - Public Property UpgradePrefsCompleted() As Boolean - Get - Return CType(Me("UpgradePrefsCompleted"),Boolean) - End Get - Set - Me("UpgradePrefsCompleted") = value - End Set - End Property - _ diff --git a/WinNUT_V2/WinNUT-Client/My Project/Settings.settings b/WinNUT_V2/WinNUT-Client/My Project/Settings.settings index 13fdede..579c341 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Settings.settings +++ b/WinNUT_V2/WinNUT-Client/My Project/Settings.settings @@ -2,9 +2,6 @@ - - False - False diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 0f4348a..1d891c9 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -173,7 +173,7 @@ Public Class WinNUT ' If this is the first time WinNUT has been launched with the Settings system, check if old preferences exist ' and prompt the user to upgrade. - If Not My.Settings.UpgradePrefsCompleted AndAlso OldPrefsExist Then + If My.Settings.IsFirstRun AndAlso OldPrefsExist Then LogFile.LogTracing("Previous preferences data detected in the Registry.", LogLvl.LOG_NOTICE, Me, My.Resources.DetectedPreviousPrefsData) From 1ef4939dd7768c06d4f98a828d5784ccfb191fc8 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 4 Dec 2025 16:22:37 -0500 Subject: [PATCH 03/10] Improve first run, old prefs handling - Cleanup ApplicationEvents.vb comments - Move old params check from WinNUT startup to application startup - Added prefs existence check in Params class, removed from WinNUT form. --- WinNUT_V2/WinNUT-Client/ApplicationEvents.vb | 33 ++++++++----------- WinNUT_V2/WinNUT-Client/WinNUT.vb | 21 ++---------- .../OldParams/WinNUT_Params.vb | 6 ++++ 3 files changed, 22 insertions(+), 38 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb index 8f774a5..cb10cf8 100644 --- a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb +++ b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb @@ -1,28 +1,13 @@ -' WinNUT-Client is a NUT windows client for monitoring your ups hooked up to your favorite linux server. -' Copyright (C) 2019-2021 Gawindx (Decaux Nicolas) -' -' This program is free software: you can redistribute it and/or modify it under the terms of the -' GNU General Public License as published by the Free Software Foundation, either version 3 of the -' License, or any later version. -' -' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY - -Imports System.Configuration -Imports System.Deployment.Application +Imports System.Configuration Imports System.Globalization Imports System.IO Imports System.Text.RegularExpressions Imports Microsoft.VisualBasic.ApplicationServices Imports Newtonsoft.Json Imports WinNUT_Client_Common +Imports WinNUT_Client_Common.OldParams Namespace My - ' Les événements suivants sont disponibles pour MyApplication : - ' Startup : Déclenché au démarrage de l'application avant la création du formulaire de démarrage. - ' Shutdown : Déclenché après la fermeture de tous les formulaires de l'application. Cet événement n'est pas déclenché si l'application se termine de façon anormale. - ' UnhandledException : Déclenché si l'application rencontre une exception non gérée. - ' StartupNextInstance : Déclenché lors du lancement d'une application à instance unique et si cette application est déjà active. - ' NetworkAvailabilityChanged : Déclenché quand la connexion réseau est connectée ou déconnectée. Partial Friend Class MyApplication ' Default culture for output so logs can be shared with the project. Private Shared ReadOnly DEF_CULTURE_INFO As CultureInfo = CultureInfo.InvariantCulture @@ -43,14 +28,14 @@ Namespace My ' AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf AppDomainUnhandledException Init_Globals() - LogFile.LogTracing(String.Format("{0} v{1} starting up.", My.Application.Info.ProductName, My.Application.Info.Version), + LogFile.LogTracing(String.Format("{0} v{1} starting up.", Application.Info.ProductName, Application.Info.Version), LogLvl.LOG_NOTICE, Me) ' LogFile.LogTracing($"DataDirectory: { ApplicationDeployment.CurrentDeployment.DataDirectory }", LogLvl.LOG_NOTICE, Me) - ' If first run indicated by Settings, attempt upgrade in case older version is present. - ' Only necessary when deploying MSI. Remove once using pure ClickOnce. + ' Starting without previous settings. May be new installation or MSI upgrade. If Settings.IsFirstRun Then Try + ' Handle MSI upgrade scenario. Settings.Upgrade() LogFile.LogTracing("Settings upgrade completed without exception.", LogLvl.LOG_NOTICE, Me) Catch ex As ConfigurationErrorsException @@ -58,6 +43,14 @@ Namespace My LogFile.LogException(ex, Me) End Try + ' If Settings still appear new, check if old Registry preferences are leftover. + If Settings.IsFirstRun AndAlso WinNUT_Params.ParamsExist Then + LogFile.LogTracing("Previous preferences data detected in the Registry.", LogLvl.LOG_NOTICE, Me, + Resources.DetectedPreviousPrefsData) + + Forms.UpgradePrefsDialog.ShowDialog() + End If + Settings.IsFirstRun = False Settings.Save() End If diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 1d891c9..c4e36ff 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -1,4 +1,5 @@ -Imports WinNUT_Client_Common +Imports System.Configuration +Imports WinNUT_Client_Common Public Class WinNUT #Region "Properties" @@ -9,12 +10,6 @@ Public Class WinNUT End Set End Property - Private ReadOnly Property OldPrefsExist As Boolean - Get - Return OldParams.WinNUT_Params.RegistryKeyRoot IsNot Nothing - End Get - End Property - Private ReadOnly Property IsUPSConnected As Boolean Get Return UPS_Device IsNot Nothing AndAlso UPS_Device.IsConnected @@ -167,18 +162,8 @@ Public Class WinNUT LogFile.LogTracing("Update Icon at Startup", LogLvl.LOG_DEBUG, Me) ' Start_Tray_Icon = Nothing - ' TODO: Move below code to a dedicated onsettingsloaded method. - ApplyApplicationPreferences() UpdateMainMenuState() - ' If this is the first time WinNUT has been launched with the Settings system, check if old preferences exist - ' and prompt the user to upgrade. - If My.Settings.IsFirstRun AndAlso OldPrefsExist Then - LogFile.LogTracing("Previous preferences data detected in the Registry.", LogLvl.LOG_NOTICE, Me, - My.Resources.DetectedPreviousPrefsData) - - RunRegPrefsUpgrade() - End If AddHandler UpdateController.UpdateCheckCompleted, AddressOf OnCheckForUpdateCompleted 'Run Update @@ -316,7 +301,7 @@ Public Class WinNUT Private Sub UpdateMainMenuState() Menu_Persist.Checked = My.Settings.NUT_AutoReconnect - If OldParams.WinNUT_Params.RegistryKeyRoot IsNot Nothing Then + If OldParams.WinNUT_Params.ParamsExist Then ManageOldPrefsToolStripMenuItem.Enabled = True ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Enabled_TooltipText Else diff --git a/WinNUT_V2/WinNUT-Client_Common/OldParams/WinNUT_Params.vb b/WinNUT_V2/WinNUT-Client_Common/OldParams/WinNUT_Params.vb index 9da8688..dfaaead 100644 --- a/WinNUT_V2/WinNUT-Client_Common/OldParams/WinNUT_Params.vb +++ b/WinNUT_V2/WinNUT-Client_Common/OldParams/WinNUT_Params.vb @@ -86,6 +86,12 @@ Namespace OldParams End Get End Property + Public Shared ReadOnly Property ParamsExist As Boolean + Get + Return RegistryKeyRoot IsNot Nothing + End Get + End Property + ''' ''' Load parameters from the Windows User Registry Hive. ''' From ad1ce7ec3967ee87f40ba267222948c541e4c706 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 4 Dec 2025 16:33:46 -0500 Subject: [PATCH 04/10] Validate encrypted data, poll interval in one place - Created sub in ApplicationEvents to handle settings first loaded. Verify encrypted data can be loaded. Moved poll interval validation from WinNUT form to this sub. --- WinNUT_V2/WinNUT-Client/ApplicationEvents.vb | 29 +++++++++++++++++++- WinNUT_V2/WinNUT-Client/WinNUT.vb | 14 +++------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb index cb10cf8..910964b 100644 --- a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb +++ b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb @@ -26,7 +26,7 @@ Namespace My Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup ' Uncomment below and comment out Handles line for _UnhandledException sub when debugging unhandled exceptions. ' AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf AppDomainUnhandledException - + AddHandler Settings.SettingsLoaded, AddressOf OnSettingsFirstLoaded Init_Globals() LogFile.LogTracing(String.Format("{0} v{1} starting up.", Application.Info.ProductName, Application.Info.Version), LogLvl.LOG_NOTICE, Me) @@ -189,5 +189,32 @@ Namespace My Private Sub Close_Button_Click(sender As Object, e As EventArgs) CrashBug_Form.Close() End Sub + + ''' + ''' Handles validation of Settings when loaded. + ''' + ''' + ''' + Private Sub OnSettingsFirstLoaded(sender As Object, e As SettingsLoadedEventArgs) + LogFile.LogTracing("OnSettingsFirstLoaded event raised.", LogLvl.LOG_DEBUG, Me) + + ' Verify that encrypted data can be decrypted + Try + Settings.NUT_Username?.ToString() + Catch ex As Exception + LogFile.LogTracing("Error attempting to decrypt encrypted data. Resetting to defaults.", + LogLvl.LOG_ERROR, Me, Resources.Log_Str_ErrorDecrypting) + LogFile.LogException(ex, Me) + + Settings.NUT_Username = New SerializedProtectedString() + Settings.NUT_Password = New SerializedProtectedString() + End Try + + If Not Settings.NUT_PollIntervalMsec > 0 Then + LogFile.LogTracing("Incorrect value of " & Settings.NUT_PollIntervalMsec & + " for Poll Delay/Interval, resetting to default.", LogLvl.LOG_ERROR, Me) + Settings.NUT_PollIntervalMsec = MySettings.Default.NUT_PollIntervalMsec + End If + End Sub End Class End Namespace diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index c4e36ff..6b989d8 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -174,7 +174,7 @@ Public Class WinNUT AddHandler Microsoft.Win32.SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged AddHandler RequestConnect, AddressOf UPS_Connect - AddHandler My.Settings.PropertyChanged, AddressOf SettingsPropertyChanged + AddHandler My.Settings.SettingChanging, AddressOf SettingChanging LogFile.LogTracing("WinNUT Form completed Load.", LogLvl.LOG_NOTICE, Me) End Sub @@ -210,6 +210,7 @@ Public Class WinNUT ''' ''' Final step in loading the main form for the first time. + ''' "The Shown event is _only_ raised the first time a form is displayed" ''' ''' ''' @@ -292,8 +293,8 @@ Public Class WinNUT #End Region - Private Sub SettingsPropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs) - LogFile.LogTracing("SettingsPropertyChanged: " & e.PropertyName, LogLvl.LOG_DEBUG, Me) + Private Sub SettingChanging(sender As Object, e As SettingChangingEventArgs) + LogFile.LogTracing("SettingChanging: " & e.SettingName, LogLvl.LOG_DEBUG, Me) UpdateMainMenuState() End Sub @@ -801,13 +802,6 @@ Public Class WinNUT LogFile.IsWritingToFile = My.Settings.LG_LogToFile LogFile.LogLevelValue = My.Settings.LG_LogLevel - ' Validate interval value because it's been incorrectly stored in older versions. - If My.Settings.NUT_PollIntervalMsec <= 0 Then - LogFile.LogTracing("Incorrect value of " & My.Settings.NUT_PollIntervalMsec & - " for Poll Delay/Interval, resetting to default.", LogLvl.LOG_ERROR, Me) - My.Settings.NUT_PollIntervalMsec = My.MySettings.Default.NUT_PollIntervalMsec - End If - If autoReconnect Then UPS_Connect() End If From 46425bc16dc032f89ccb31247879205f55c12636 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 4 Dec 2025 16:36:43 -0500 Subject: [PATCH 05/10] Small adjustments to main form --- .../WinNUT-Client.zh-TW.xlf | 39 +- .../WinNUT-client.de-DE.xlf | 15 +- .../WinNUT-client.fr-FR.xlf | 39 +- .../WinNUT-client.ru-RU.xlf | 39 +- .../WinNUT-client.uk-UA.xlf | 39 +- .../WinNUT-client.zh-CN.xlf | 39 +- WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb | 321 +++++------ WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx | 9 - WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx | 9 - WinNUT_V2/WinNUT-Client/WinNUT.resx | 499 +++++++++--------- WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx | 9 - WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx | 9 - WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx | 9 - WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx | 9 - 14 files changed, 505 insertions(+), 579 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 7935d31..640abb0 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf @@ -671,15 +671,15 @@ 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 @@ -3563,62 +3563,59 @@ Accepted value: Numeric value from 0 to 100. - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Connect Connect - + - + - + - + - + - + - + 130, 6 - 177, 6 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 130, 6 - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 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 522132d..c6bcbf6 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf @@ -3199,10 +3199,9 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Connect @@ -3232,15 +3231,13 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m - + 130, 6 - 177, 6 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 130, 6 - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Persist 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 96563cc..2ccd39d 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf @@ -1899,15 +1899,15 @@ 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 @@ -3202,62 +3202,59 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Connect Connect - + - + - + - + - + - + - + 130, 6 - 177, 6 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 130, 6 - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 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 bf913d0..1c246f6 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf @@ -673,15 +673,15 @@ 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 @@ -3582,62 +3582,59 @@ Accepted value: Numeric value from 0 to 100. - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Connect Connect - + - + - + - + - + - + - + 130, 6 - 177, 6 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 130, 6 - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 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 f60265e..f624a47 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf @@ -673,15 +673,15 @@ 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 @@ -3582,62 +3582,59 @@ Accepted value: Numeric value from 0 to 100. - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Connect Connect - + - + - + - + - + - + - + 130, 6 - 177, 6 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 130, 6 - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 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 628c4ca..2f136bf 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf @@ -673,15 +673,15 @@ 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 @@ -3581,62 +3581,59 @@ Accepted value: Numeric value from 0 to 100. - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Connect Connect - + - + - + - + - + - + - + 130, 6 - 177, 6 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 130, 6 - + 133, 22 - 180, 22 - Please verify the translation’s accuracy as the source string was updated after it was translated. + 133, 22 Persist Persist - + False False - + NoControl NoControl - + False False diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb b/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb index 2e8f118..015397a 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.Designer.vb @@ -36,13 +36,13 @@ Partial Class WinNUT Me.Main_Menu = New System.Windows.Forms.MenuStrip() Me.Menu_File = New System.Windows.Forms.ToolStripMenuItem() Me.Menu_UPS_Var = New System.Windows.Forms.ToolStripMenuItem() - Me.Menu_Quit = New System.Windows.Forms.ToolStripMenuItem() Me.ManageOldPrefsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.Menu_Quit = New System.Windows.Forms.ToolStripMenuItem() Me.Menu_Connection = New System.Windows.Forms.ToolStripMenuItem() + Me.Menu_Persist = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() 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() @@ -68,25 +68,25 @@ Partial Class WinNUT Me.Lbl_OB = New System.Windows.Forms.Label() Me.Lbl_OL = New System.Windows.Forms.Label() Me.GB_InV_Dial = New System.Windows.Forms.GroupBox() + Me.AG_InV = New WinNUT_Client.Controls.UPSVarGauge() Me.Lbl_InV_Dial = New System.Windows.Forms.Label() Me.GB_OutV_Dial = New System.Windows.Forms.GroupBox() + Me.AG_OutV = New WinNUT_Client.Controls.UPSVarGauge() Me.Lbl_OutV_Dial = New System.Windows.Forms.Label() Me.GB_BattCh_Dial = New System.Windows.Forms.GroupBox() Me.PBox_Battery_State = New System.Windows.Forms.PictureBox() Me.Lbl_BattCh_Dial = New System.Windows.Forms.Label() + Me.AG_BattCh = New WinNUT_Client.Controls.UPSVarGauge() Me.GB_Load_Dial = New System.Windows.Forms.GroupBox() + Me.AG_Load = New WinNUT_Client.Controls.UPSVarGauge() Me.Lbl_Load_Dial = New System.Windows.Forms.Label() Me.GB_BattV_Dial = New System.Windows.Forms.GroupBox() + Me.AG_BattV = New WinNUT_Client.Controls.UPSVarGauge() Me.Lbl_BattV_Dial = New System.Windows.Forms.Label() Me.GB_InF_Dial = New System.Windows.Forms.GroupBox() + Me.AG_InF = New WinNUT_Client.Controls.UPSVarGauge() Me.Lbl_InF_Dial = New System.Windows.Forms.Label() Me.CB_CurrentLog = New System.Windows.Forms.ComboBox() - Me.AG_InF = New WinNUT_Client.Controls.UPSVarGauge() - Me.AG_InV = New WinNUT_Client.Controls.UPSVarGauge() - Me.AG_BattV = New WinNUT_Client.Controls.UPSVarGauge() - Me.AG_Load = New WinNUT_Client.Controls.UPSVarGauge() - Me.AG_OutV = New WinNUT_Client.Controls.UPSVarGauge() - Me.AG_BattCh = New WinNUT_Client.Controls.UPSVarGauge() Me.ContextMenu_Systray.SuspendLayout() Me.Main_Menu.SuspendLayout() Me.GB_Status.SuspendLayout() @@ -162,23 +162,36 @@ Partial Class WinNUT resources.ApplyResources(Me.Menu_UPS_Var, "Menu_UPS_Var") Me.Menu_UPS_Var.Name = "Menu_UPS_Var" ' - 'Menu_Quit - ' - Me.Menu_Quit.Name = "Menu_Quit" - resources.ApplyResources(Me.Menu_Quit, "Menu_Quit") - ' 'ManageOldPrefsToolStripMenuItem ' resources.ApplyResources(Me.ManageOldPrefsToolStripMenuItem, "ManageOldPrefsToolStripMenuItem") Me.ManageOldPrefsToolStripMenuItem.Image = Global.WinNUT_Client.My.Resources.Resources.regedit_exe_14_100_0 Me.ManageOldPrefsToolStripMenuItem.Name = "ManageOldPrefsToolStripMenuItem" ' + 'Menu_Quit + ' + Me.Menu_Quit.Name = "Menu_Quit" + resources.ApplyResources(Me.Menu_Quit, "Menu_Quit") + ' 'Menu_Connection ' 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_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") + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + resources.ApplyResources(Me.ToolStripSeparator1, "ToolStripSeparator1") + ' 'Menu_Connect ' Me.Menu_Connect.Image = Global.WinNUT_Client.My.Resources.Resources.internetconnection @@ -191,19 +204,6 @@ Partial Class WinNUT 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 ' Me.Menu_Settings.Name = "Menu_Settings" @@ -380,6 +380,31 @@ Partial Class WinNUT Me.GB_InV_Dial.Name = "GB_InV_Dial" Me.GB_InV_Dial.TabStop = False ' + 'AG_InV + ' + Me.AG_InV.BaseArcRadius = 45 + Me.AG_InV.BaseArcWidth = 5 + 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 + Me.AG_InV.MinValue = 0 + Me.AG_InV.Name = "AG_InV" + Me.AG_InV.NeedleRadius = 32 + Me.AG_InV.ScaleLinesInterInnerRadius = 40 + Me.AG_InV.ScaleLinesInterOuterRadius = 48 + Me.AG_InV.ScaleLinesMajorInnerRadius = 40 + Me.AG_InV.ScaleLinesMajorOuterRadius = 48 + Me.AG_InV.ScaleLinesMinorInnerRadius = 42 + Me.AG_InV.ScaleLinesMinorOuterRadius = 48 + Me.AG_InV.ScaleNumbersFormat = Nothing + Me.AG_InV.ScaleNumbersRadius = 60 + 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! + ' 'Lbl_InV_Dial ' resources.ApplyResources(Me.Lbl_InV_Dial, "Lbl_InV_Dial") @@ -393,6 +418,31 @@ Partial Class WinNUT Me.GB_OutV_Dial.Name = "GB_OutV_Dial" Me.GB_OutV_Dial.TabStop = False ' + 'AG_OutV + ' + Me.AG_OutV.BaseArcRadius = 45 + Me.AG_OutV.BaseArcWidth = 5 + 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 + Me.AG_OutV.MinValue = 0 + Me.AG_OutV.Name = "AG_OutV" + Me.AG_OutV.NeedleRadius = 32 + Me.AG_OutV.ScaleLinesInterInnerRadius = 40 + Me.AG_OutV.ScaleLinesInterOuterRadius = 48 + Me.AG_OutV.ScaleLinesMajorInnerRadius = 40 + Me.AG_OutV.ScaleLinesMajorOuterRadius = 48 + Me.AG_OutV.ScaleLinesMinorInnerRadius = 42 + Me.AG_OutV.ScaleLinesMinorOuterRadius = 48 + Me.AG_OutV.ScaleNumbersFormat = Nothing + Me.AG_OutV.ScaleNumbersRadius = 60 + 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! + ' 'Lbl_OutV_Dial ' resources.ApplyResources(Me.Lbl_OutV_Dial, "Lbl_OutV_Dial") @@ -418,6 +468,31 @@ Partial Class WinNUT resources.ApplyResources(Me.Lbl_BattCh_Dial, "Lbl_BattCh_Dial") Me.Lbl_BattCh_Dial.Name = "Lbl_BattCh_Dial" ' + 'AG_BattCh + ' + Me.AG_BattCh.BaseArcRadius = 45 + Me.AG_BattCh.BaseArcWidth = 5 + 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 + Me.AG_BattCh.MinValue = 0 + Me.AG_BattCh.Name = "AG_BattCh" + Me.AG_BattCh.NeedleRadius = 32 + Me.AG_BattCh.ScaleLinesInterInnerRadius = 40 + Me.AG_BattCh.ScaleLinesInterOuterRadius = 48 + Me.AG_BattCh.ScaleLinesMajorInnerRadius = 40 + Me.AG_BattCh.ScaleLinesMajorOuterRadius = 48 + Me.AG_BattCh.ScaleLinesMinorInnerRadius = 42 + Me.AG_BattCh.ScaleLinesMinorOuterRadius = 48 + Me.AG_BattCh.ScaleNumbersFormat = Nothing + Me.AG_BattCh.ScaleNumbersRadius = 60 + 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! + ' 'GB_Load_Dial ' resources.ApplyResources(Me.GB_Load_Dial, "GB_Load_Dial") @@ -426,6 +501,31 @@ Partial Class WinNUT Me.GB_Load_Dial.Name = "GB_Load_Dial" Me.GB_Load_Dial.TabStop = False ' + 'AG_Load + ' + Me.AG_Load.BaseArcRadius = 45 + Me.AG_Load.BaseArcWidth = 5 + 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 + Me.AG_Load.MinValue = 0 + Me.AG_Load.Name = "AG_Load" + Me.AG_Load.NeedleRadius = 32 + Me.AG_Load.ScaleLinesInterInnerRadius = 40 + Me.AG_Load.ScaleLinesInterOuterRadius = 48 + Me.AG_Load.ScaleLinesMajorInnerRadius = 40 + Me.AG_Load.ScaleLinesMajorOuterRadius = 48 + Me.AG_Load.ScaleLinesMinorInnerRadius = 42 + Me.AG_Load.ScaleLinesMinorOuterRadius = 48 + Me.AG_Load.ScaleNumbersFormat = Nothing + Me.AG_Load.ScaleNumbersRadius = 60 + 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! + ' 'Lbl_Load_Dial ' resources.ApplyResources(Me.Lbl_Load_Dial, "Lbl_Load_Dial") @@ -439,6 +539,31 @@ Partial Class WinNUT Me.GB_BattV_Dial.Name = "GB_BattV_Dial" Me.GB_BattV_Dial.TabStop = False ' + 'AG_BattV + ' + Me.AG_BattV.BaseArcRadius = 45 + Me.AG_BattV.BaseArcWidth = 5 + 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 + Me.AG_BattV.MinValue = 0 + Me.AG_BattV.Name = "AG_BattV" + Me.AG_BattV.NeedleRadius = 32 + Me.AG_BattV.ScaleLinesInterInnerRadius = 40 + Me.AG_BattV.ScaleLinesInterOuterRadius = 48 + Me.AG_BattV.ScaleLinesMajorInnerRadius = 40 + Me.AG_BattV.ScaleLinesMajorOuterRadius = 48 + Me.AG_BattV.ScaleLinesMinorInnerRadius = 42 + Me.AG_BattV.ScaleLinesMinorOuterRadius = 48 + Me.AG_BattV.ScaleNumbersFormat = Nothing + Me.AG_BattV.ScaleNumbersRadius = 60 + 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! + ' 'Lbl_BattV_Dial ' resources.ApplyResources(Me.Lbl_BattV_Dial, "Lbl_BattV_Dial") @@ -452,17 +577,6 @@ Partial Class WinNUT Me.GB_InF_Dial.Name = "GB_InF_Dial" Me.GB_InF_Dial.TabStop = False ' - 'Lbl_InF_Dial - ' - resources.ApplyResources(Me.Lbl_InF_Dial, "Lbl_InF_Dial") - Me.Lbl_InF_Dial.Name = "Lbl_InF_Dial" - ' - 'CB_CurrentLog - ' - Me.CB_CurrentLog.FormattingEnabled = True - resources.ApplyResources(Me.CB_CurrentLog, "CB_CurrentLog") - Me.CB_CurrentLog.Name = "CB_CurrentLog" - ' 'AG_InF ' Me.AG_InF.BaseArcRadius = 45 @@ -488,130 +602,17 @@ Partial Class WinNUT Me.AG_InF.Value1 = 0! Me.AG_InF.Value2 = 0! ' - 'AG_InV - ' - Me.AG_InV.BaseArcRadius = 45 - Me.AG_InV.BaseArcWidth = 5 - 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 - Me.AG_InV.MinValue = 0 - Me.AG_InV.Name = "AG_InV" - Me.AG_InV.NeedleRadius = 32 - Me.AG_InV.ScaleLinesInterInnerRadius = 40 - Me.AG_InV.ScaleLinesInterOuterRadius = 48 - Me.AG_InV.ScaleLinesMajorInnerRadius = 40 - Me.AG_InV.ScaleLinesMajorOuterRadius = 48 - Me.AG_InV.ScaleLinesMinorInnerRadius = 42 - Me.AG_InV.ScaleLinesMinorOuterRadius = 48 - Me.AG_InV.ScaleNumbersFormat = Nothing - Me.AG_InV.ScaleNumbersRadius = 60 - 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.BaseArcRadius = 45 - Me.AG_BattV.BaseArcWidth = 5 - 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 - Me.AG_BattV.MinValue = 0 - Me.AG_BattV.Name = "AG_BattV" - Me.AG_BattV.NeedleRadius = 32 - Me.AG_BattV.ScaleLinesInterInnerRadius = 40 - Me.AG_BattV.ScaleLinesInterOuterRadius = 48 - Me.AG_BattV.ScaleLinesMajorInnerRadius = 40 - Me.AG_BattV.ScaleLinesMajorOuterRadius = 48 - Me.AG_BattV.ScaleLinesMinorInnerRadius = 42 - Me.AG_BattV.ScaleLinesMinorOuterRadius = 48 - Me.AG_BattV.ScaleNumbersFormat = Nothing - Me.AG_BattV.ScaleNumbersRadius = 60 - 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.BaseArcRadius = 45 - Me.AG_Load.BaseArcWidth = 5 - 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 - Me.AG_Load.MinValue = 0 - Me.AG_Load.Name = "AG_Load" - Me.AG_Load.NeedleRadius = 32 - Me.AG_Load.ScaleLinesInterInnerRadius = 40 - Me.AG_Load.ScaleLinesInterOuterRadius = 48 - Me.AG_Load.ScaleLinesMajorInnerRadius = 40 - Me.AG_Load.ScaleLinesMajorOuterRadius = 48 - Me.AG_Load.ScaleLinesMinorInnerRadius = 42 - Me.AG_Load.ScaleLinesMinorOuterRadius = 48 - Me.AG_Load.ScaleNumbersFormat = Nothing - Me.AG_Load.ScaleNumbersRadius = 60 - 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 + 'Lbl_InF_Dial ' - Me.AG_OutV.BaseArcRadius = 45 - Me.AG_OutV.BaseArcWidth = 5 - 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 - Me.AG_OutV.MinValue = 0 - Me.AG_OutV.Name = "AG_OutV" - Me.AG_OutV.NeedleRadius = 32 - Me.AG_OutV.ScaleLinesInterInnerRadius = 40 - Me.AG_OutV.ScaleLinesInterOuterRadius = 48 - Me.AG_OutV.ScaleLinesMajorInnerRadius = 40 - Me.AG_OutV.ScaleLinesMajorOuterRadius = 48 - Me.AG_OutV.ScaleLinesMinorInnerRadius = 42 - Me.AG_OutV.ScaleLinesMinorOuterRadius = 48 - Me.AG_OutV.ScaleNumbersFormat = Nothing - Me.AG_OutV.ScaleNumbersRadius = 60 - 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! + resources.ApplyResources(Me.Lbl_InF_Dial, "Lbl_InF_Dial") + Me.Lbl_InF_Dial.Name = "Lbl_InF_Dial" ' - 'AG_BattCh + 'CB_CurrentLog ' - Me.AG_BattCh.BaseArcRadius = 45 - Me.AG_BattCh.BaseArcWidth = 5 - 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 - Me.AG_BattCh.MinValue = 0 - Me.AG_BattCh.Name = "AG_BattCh" - Me.AG_BattCh.NeedleRadius = 32 - Me.AG_BattCh.ScaleLinesInterInnerRadius = 40 - Me.AG_BattCh.ScaleLinesInterOuterRadius = 48 - Me.AG_BattCh.ScaleLinesMajorInnerRadius = 40 - Me.AG_BattCh.ScaleLinesMajorOuterRadius = 48 - Me.AG_BattCh.ScaleLinesMinorInnerRadius = 42 - Me.AG_BattCh.ScaleLinesMinorOuterRadius = 48 - Me.AG_BattCh.ScaleNumbersFormat = Nothing - Me.AG_BattCh.ScaleNumbersRadius = 60 - 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! + Me.CB_CurrentLog.CausesValidation = False + Me.CB_CurrentLog.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + resources.ApplyResources(Me.CB_CurrentLog, "CB_CurrentLog") + Me.CB_CurrentLog.Name = "CB_CurrentLog" ' 'WinNUT ' @@ -712,9 +713,9 @@ Partial Class WinNUT Friend WithEvents GB_InF_Dial As GroupBox Friend WithEvents AG_InF As WinNUT_Client.Controls.UPSVarGauge Friend WithEvents Lbl_InF_Dial As Label - 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 + Private WithEvents CB_CurrentLog As ComboBox End Class diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx b/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx index bd54f27..14cb97a 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.de-DE.resx @@ -105,9 +105,6 @@ Alte Einstellungen verwalten... - - 180, 22 - Verbinden @@ -129,12 +126,6 @@ - - 177, 6 - - - 180, 22 - Automatische Wiederverbindung diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx b/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx index e29ad5c..52275cb 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.fr-FR.resx @@ -102,9 +102,6 @@ 177, 22 - - 180, 22 - @@ -123,12 +120,6 @@ - - 177, 6 - - - 180, 22 - False diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.resx b/WinNUT_V2/WinNUT-Client/WinNUT.resx index 4f951cd..eb1539d 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.resx @@ -186,11 +186,44 @@ None + + 0, 0 + + + 0, 24 + + + 231, 24 + + + 0 + + + MenuStrip1 + + + Main_Menu + + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 37, 20 + + + File + False - 180, 22 + 177, 22 UPS Variable @@ -213,59 +246,23 @@ Exit - - 37, 20 - - - File - 81, 20 Connection - - 61, 20 - - - Settings - - - 44, 20 - - - Help - - - 0, 0 - - - 0, 24 - - - 231, 24 - - - 0 - - - MenuStrip1 - - - Main_Menu - - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 133, 22 - - $this + + Persist - - 9 + + 130, 6 - 180, 22 + 133, 22 Connect @@ -274,19 +271,22 @@ False - 180, 22 + 133, 22 Disconnect - - 177, 6 + + 61, 20 - - 180, 22 + + Settings - - Persist + + 44, 20 + + + Help 144, 22 @@ -1221,6 +1221,30 @@ 3 + + 6, 26 + + + 148, 130 + + + 1 + + + + + + AG_InV + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + GB_InV_Dial + + + 0 + True @@ -1270,7 +1294,7 @@ AG_OutV - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null GB_OutV_Dial @@ -1311,6 +1335,36 @@ 6 + + 6, 26 + + + 148, 130 + + + 148, 130 + + + 148, 130 + + + 1 + + + + + + AG_OutV + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + GB_OutV_Dial + + + 0 + True @@ -1384,7 +1438,7 @@ AG_BattCh - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null GB_BattCh_Dial @@ -1476,6 +1530,36 @@ 1 + + 6, 27 + + + 148, 130 + + + 148, 130 + + + 148, 130 + + + 1 + + + + + + AG_BattCh + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + GB_BattCh_Dial + + + 2 + True @@ -1486,7 +1570,7 @@ AG_Load - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null GB_Load_Dial @@ -1527,6 +1611,36 @@ 5 + + 6, 26 + + + 148, 130 + + + 148, 130 + + + 148, 130 + + + 1 + + + + + + AG_Load + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + GB_Load_Dial + + + 0 + True @@ -1576,7 +1690,7 @@ AG_BattV - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null GB_BattV_Dial @@ -1617,6 +1731,36 @@ 4 + + 6, 26 + + + 148, 130 + + + 148, 130 + + + 148, 130 + + + 1 + + + + + + AG_BattV + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + GB_BattV_Dial + + + 0 + True @@ -1666,7 +1810,7 @@ AG_InF - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25554, Culture=neutral, PublicKeyToken=null + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null GB_InF_Dial @@ -1707,6 +1851,36 @@ 2 + + 6, 26 + + + 148, 130 + + + 148, 130 + + + 148, 130 + + + 1 + + + + + + AG_InF + + + WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + GB_InF_Dial + + + 0 + True @@ -1776,180 +1950,6 @@ 1 - - 6, 26 - - - 148, 130 - - - 148, 130 - - - 148, 130 - - - 1 - - - - - - AG_InF - - - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null - - - GB_InF_Dial - - - 0 - - - 6, 26 - - - 148, 130 - - - 1 - - - - - - AG_InV - - - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null - - - GB_InV_Dial - - - 0 - - - 6, 26 - - - 148, 130 - - - 148, 130 - - - 148, 130 - - - 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 - - - - - - AG_Load - - - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null - - - GB_Load_Dial - - - 0 - - - 6, 26 - - - 148, 130 - - - 148, 130 - - - 148, 130 - - - 1 - - - - - - AG_OutV - - - WinNUT_Client.Controls.UPSVarGauge, WinNUT-Client, Version=2.3.8972.25578, Culture=neutral, PublicKeyToken=null - - - GB_OutV_Dial - - - 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 @@ -1962,9 +1962,6 @@ 704, 381 - - NoControl - 720, 420 @@ -2034,34 +2031,28 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Menu_Quit - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ManageOldPrefsToolStripMenuItem System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Menu_Connection + + Menu_Quit - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Menu_Connect + + Menu_Connection - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Menu_Disconnect + + Menu_Persist - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -2070,10 +2061,16 @@ System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Menu_Persist + + Menu_Connect - + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Menu_Disconnect + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx b/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx index 06c87ae..bec73e0 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.ru-RU.resx @@ -102,9 +102,6 @@ 177, 22 - - 180, 22 - @@ -123,12 +120,6 @@ - - 177, 6 - - - 180, 22 - False diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx b/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx index ee90ec2..ee1abea 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.uk-UA.resx @@ -102,9 +102,6 @@ Керування старими налаштуваннями... - - 180, 22 - @@ -123,12 +120,6 @@ - - 177, 6 - - - 180, 22 - False diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx b/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx index 47a17e3..be44ec1 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.zh-CN.resx @@ -105,9 +105,6 @@ 管理旧设置... - - 180, 22 - @@ -126,12 +123,6 @@ - - 177, 6 - - - 180, 22 - False diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx b/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx index 1c2f0da..797fa5b 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx +++ b/WinNUT_V2/WinNUT-Client/WinNUT.zh-TW.resx @@ -102,9 +102,6 @@ 177, 22 - - 180, 22 - @@ -123,12 +120,6 @@ - - 177, 6 - - - 180, 22 - False From fa1430dcf4c95c06ca22922bcdcc487aed199d17 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Thu, 4 Dec 2025 16:53:00 -0500 Subject: [PATCH 06/10] Fix display values init, prefs upgrade message - Fixed display values init not being called on startup - Make upgrade prefs cancelled display log message be printed whenever the cancel button is clicked. --- WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb | 4 ++-- WinNUT_V2/WinNUT-Client/WinNUT.vb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb b/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb index e64f501..a265b5e 100644 --- a/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb +++ b/WinNUT_V2/WinNUT-Client/Models/UpgradePrefsDialogModel.vb @@ -201,7 +201,7 @@ Namespace Models LogFile.LogTracing("Requesting cancellation of upgradeWorker.", LogLvl.LOG_NOTICE, Me) upgradeWorker.CancelAsync() Else - LogFile.LogTracing("Exiting out of upgrade dialog.", LogLvl.LOG_NOTICE, Me) + LogFile.LogTracing("Exiting out of upgrade dialog.", LogLvl.LOG_NOTICE, Me, My.Resources.UpgradePrefsDialog_Cancelled) _parentForm.DialogResult = DialogResult.Cancel _parentForm.Close() End If @@ -262,7 +262,7 @@ Namespace Models If e.Cancelled Then ProgressPercent = 0 - LogFile.LogTracing("Upgrade work was cancelled.", LogLvl.LOG_WARNING, Me, My.Resources.UpgradePrefsDialog_Cancelled) + LogFile.LogTracing("Upgrade work was cancelled.", LogLvl.LOG_WARNING, Me) Return End If diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 6b989d8..7a8b033 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -163,6 +163,7 @@ Public Class WinNUT ' Start_Tray_Icon = Nothing UpdateMainMenuState() + ReInitDisplayValues() AddHandler UpdateController.UpdateCheckCompleted, AddressOf OnCheckForUpdateCompleted From 14c923ab982083c2031eb16dba3db58a5aae3071 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Fri, 5 Dec 2025 16:50:21 -0500 Subject: [PATCH 07/10] Upgrade displayed logs system Various upgrades to the system that displays user-friendly log information in WinNUT. - Set constant maximum number of logs that can be displayed - Created new collection with accessor, counter and events for displayed items - Migrated handling code into Logger class, while adding a prune algorithm - Fill displayed logs Combobox when loading for the first time - Adding a debug menu (added in debug builds) with a test function for the displayed logs system and how it handles pruning - Adding event handlers for adding log lines and pruning them --- WinNUT_V2/WinNUT-Client/WinNUT.vb | 52 ++++++++++++++++++------ WinNUT_V2/WinNUT-Client_Common/Logger.vb | 36 ++++++++++------ 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 7a8b033..f7a315e 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -165,6 +165,10 @@ Public Class WinNUT UpdateMainMenuState() ReInitDisplayValues() + ' Prepare visual log combo box + For Each line In LogFile.DisplayedLogs + AddLogLine(line) + Next AddHandler UpdateController.UpdateCheckCompleted, AddressOf OnCheckForUpdateCompleted 'Run Update @@ -180,6 +184,30 @@ Public Class WinNUT LogFile.LogTracing("WinNUT Form completed Load.", LogLvl.LOG_NOTICE, Me) End Sub +#Region "Debug menu" +#If DEBUG Then + Private Sub TestFillAndTrim() + For i = LogFile.DisplayedLogs.Count To Logger.MAX_DISPLAYED_LOGS + 3 + LogFile.LogTracing("Test logging line " & i, LogLvl.LOG_DEBUG, Me, "Test logging line " & i) + Next + End Sub + + Private Sub InsertDebugMenuOnLoad(sender As Object, e As EventArgs) Handles MyBase.Load + Dim testFillAndTrimCommand As New ToolStripMenuItem("Test Fill and Trim") + AddHandler testFillAndTrimCommand.Click, AddressOf TestFillAndTrim + + Dim logDisplaySubmenu As New ToolStripMenuItem("LogDisplay") + logDisplaySubmenu.DropDownItems.Add(testFillAndTrimCommand) + + Dim debugMenu As New ToolStripMenuItem("Debug") + debugMenu.DropDownItems.Add(logDisplaySubmenu) + Main_Menu.Items.Add(debugMenu) + + LogFile.LogTracing("Inserted debug menu to Main_Menu.", LogLvl.LOG_DEBUG, Me, "Debug Menu enabled.") + End Sub +#End If +#End Region + ''' ''' Second-to-last step in loading the Form. "Occurs when the form is activated in code or by the user." ''' @@ -917,21 +945,21 @@ Public Class WinNUT lvgForm.Show() End Sub - Public Sub Update_InstantLog(sender As Object) Handles LogFile.NewData - Dim Message As String = LogFile.CurrentLogData - Static Dim Event_Id = 1 - LogFile.LogTracing("New Log to CB_Current Log : " & Message, LogLvl.LOG_DEBUG, sender.ToString) - Message = "[Id " & Event_Id & ": " & Format(Now, "General Date") & "] " & Message - Event_Id += 1 - CB_CurrentLog.Items.Insert(0, Message) - CB_CurrentLog.SelectedIndex = 0 - If CB_CurrentLog.Items.Count > 10 Then - For i = 10 To (CB_CurrentLog.Items.Count - 1) Step 1 - CB_CurrentLog.Items.Remove(i) - Next + Private Sub AddLogLine(logLine As String) Handles LogFile.DisplayedLogsLineAdded + If Not CB_CurrentLog.Items.Contains(logLine) Then + ' Invert insertions so latest items appear at the top. + CB_CurrentLog.Items.Insert(0, logLine) + CB_CurrentLog.SelectedIndex = 0 + Else + LogFile.LogTracing("Attempted to add duplicate item to CB_CurrentLog: " & logLine, LogLvl.LOG_ERROR, Me) End If End Sub + Private Sub TrimLogLine(removedLine As String) Handles LogFile.DisplayedLogsTrimmed + LogFile.LogTracing("Receiving event to trim end of displayed logs list.", LogLvl.LOG_DEBUG, Me) + CB_CurrentLog.Items.Remove(removedLine) + End Sub + Private Sub HandleUPSStatusChange(sender As UPS_Device, newStatuses As UPS_States) Handles UPS_Device.StatusesChanged LogFile.LogTracing("Handling new UPS status(es)...", LogLvl.LOG_DEBUG, Me) diff --git a/WinNUT_V2/WinNUT-Client_Common/Logger.vb b/WinNUT_V2/WinNUT-Client_Common/Logger.vb index 2cf31bd..83714fa 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Logger.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Logger.vb @@ -16,6 +16,7 @@ Imports Microsoft.VisualBasic.Logging Public Class Logger #Region "Constants/Shared" Private Const LOG_FILE_CREATION_SCHEDULE = LogFileCreationScheduleOption.Daily + Public Const MAX_DISPLAYED_LOGS = 50 ' Set TEST_RELEASE_DIRS in the custom compiler constants dialog for file storage to behave like release. #If DEBUG AndAlso Not TEST_RELEASE_DIRS Then @@ -32,15 +33,17 @@ Public Class Logger #Region "Private/backing values" Private LogFile As FileLogTraceListener - Private L_CurrentLogData As String Private LastEventsList As New List(Of Object) + Private _displayedLogs As New Queue(Of String)(MAX_DISPLAYED_LOGS) + Private _displayedLogsCounter As Integer = 0 ' As incrementing when a new displayed log is added. Private _DateTimeFormatInfo As DateTimeFormatInfo = DEFAULT_DATETIMEFORMAT #End Region Public LogLevelValue As LogLvl - Public Event NewData(sender As Object) + Public Event DisplayedLogsLineAdded(newLine As String) + Public Event DisplayedLogsTrimmed(removedLine As String) #Region "Properties" @@ -56,15 +59,14 @@ Public Class Logger End Set End Property - Public Property CurrentLogData() As String + ''' + ''' Friendly log messages that are intended to be displayed to the user. + ''' + ''' + Public ReadOnly Property DisplayedLogs As Queue(Of String) Get - Dim Tmp_Data = L_CurrentLogData - L_CurrentLogData = Nothing - Return Tmp_Data + Return _displayedLogs End Get - Set(Value As String) - L_CurrentLogData = Value - End Set End Property Public ReadOnly Property LastEvents() As List(Of Object) @@ -220,10 +222,20 @@ Public Class Logger LogFile.WriteLine(FinalMsg) End If - 'If LvlError = LogLvl.LOG_NOTICE Then + ' Insert new log message for display to the user, and prune old ones. If LogToDisplay IsNot Nothing Then - L_CurrentLogData = LogToDisplay - RaiseEvent NewData(sender) + If _displayedLogs.Count >= MAX_DISPLAYED_LOGS Then + Dim removedLog = _displayedLogs.Dequeue() + LogTracing($"Removed log from displayed logs collection: { removedLog }", LogLvl.LOG_DEBUG, Me) + RaiseEvent DisplayedLogsTrimmed(removedLog) + End If + + _displayedLogsCounter += 1 + Dim newLogLine = String.Format("[{0}][{1}] {2}", _displayedLogsCounter, + String.Format(Now, "General Date"), LogToDisplay) + _displayedLogs.Enqueue(newLogLine) + LogTracing("Added new line to displayed logs collection: " & newLogLine, LogLvl.LOG_DEBUG, Me) + RaiseEvent DisplayedLogsLineAdded(newLogLine) End If End Sub From e5ee2e864835d89da04bd3d7e375e241558c97b7 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Tue, 9 Dec 2025 12:15:12 -0500 Subject: [PATCH 08/10] Fix missing close tag in XLIFF files --- .../WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf | 1 + .../WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf | 1 + .../WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf | 1 + .../WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf | 1 + .../WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf | 1 + .../WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf | 1 + 6 files changed, 6 insertions(+) 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 63cc2e7..eec8fb3 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf @@ -724,6 +724,7 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Error loading encrypted Settings (username/password) Error loading encrypted Settings (username/password) Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 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 e119930..7a11e35 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf @@ -1917,6 +1917,7 @@ Bitte beheben Sie den Fehler oder brechen Sie den Aktualisierungsdialog ab, um m Error loading encrypted Settings (username/password) Error loading encrypted Settings (username/password) Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 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 0510f80..acba829 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf @@ -1920,6 +1920,7 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Error loading encrypted Settings (username/password) Error loading encrypted Settings (username/password) Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 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 1f2ca43..903f94b 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf @@ -726,6 +726,7 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Error loading encrypted Settings (username/password) Error loading encrypted Settings (username/password) Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 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 5576c0c..ee75a3c 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf @@ -726,6 +726,7 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Error loading encrypted Settings (username/password) Error loading encrypted Settings (username/password) Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 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 1212296..737c5ef 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf @@ -726,6 +726,7 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Error loading encrypted Settings (username/password) Error loading encrypted Settings (username/password) Short log string to alert the user that there was an error loading encrypted Settings, and give examples of what those Settings were. + ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\CopyHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a From 6a2549674bad13d623855bd9855a62e9ea174e0e Mon Sep 17 00:00:00 2001 From: gbakeman Date: Tue, 9 Dec 2025 13:39:19 -0500 Subject: [PATCH 09/10] Enable extra crash handling, adjust report gen. - Uncommented and enabled the extra crash handler as it seems to aid with debugging unhandled exceptions - Delayed call to GenerateCrashReport until user has confirmed by clicking the button, so at least the report window can be displayed first --- WinNUT_V2/WinNUT-Client/ApplicationEvents.vb | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb index 910964b..c3a3b65 100644 --- a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb +++ b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb @@ -21,12 +21,11 @@ Namespace My Private SensitiveProperties As List(Of String) = New List(Of String)({"NUT_ServerAddress", "NUT_ServerPort", "NUT_UPSName", "NUT_Username", "NUT_Password"}) - Private crashReportData As String Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup - ' Uncomment below and comment out Handles line for _UnhandledException sub when debugging unhandled exceptions. - ' AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf AppDomainUnhandledException + AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf AppDomainUnhandledException AddHandler Settings.SettingsLoaded, AddressOf OnSettingsFirstLoaded + Init_Globals() LogFile.LogTracing(String.Format("{0} v{1} starting up.", Application.Info.ProductName, Application.Info.Version), LogLvl.LOG_NOTICE, Me) @@ -59,11 +58,16 @@ Namespace My End Sub Private Sub AppDomainUnhandledException(sender As Object, e As System.UnhandledExceptionEventArgs) + LogFile.LogTracing("AppDomainUnhandledException", LogLvl.LOG_ERROR, Me) MyApplication_UnhandledException(sender, New UnhandledExceptionEventArgs(False, e.ExceptionObject)) End Sub + Private caughtException As Exception Private Sub MyApplication_UnhandledException(sender As Object, e As UnhandledExceptionEventArgs) Handles Me.UnhandledException + LogFile.LogTracing("UnhandledException", LogLvl.LOG_ERROR, Me) + WinNUT.HasCrashed = True e.ExitApplication = False + caughtException = e.Exception With Msg_Crash .Location = New Point(6, 6) @@ -114,17 +118,14 @@ Namespace My .Controls.Add(BtnGenerate) End With - crashReportData = GenerateCrashReport(e.Exception) - AddHandler BtnClose.Click, AddressOf Application.Close_Button_Click AddHandler BtnGenerate.Click, AddressOf Application.Generate_Button_Click CrashBug_Form.Show() CrashBug_Form.BringToFront() - WinNUT.HasCrashed = True End Sub - Private Function GenerateCrashReport(ex As Exception) As String + Private Function GenerateCrashReport() As String Dim jsonSerializerSettings As New JsonSerializerSettings() jsonSerializerSettings.Culture = DEF_CULTURE_INFO jsonSerializerSettings.Formatting = Formatting.Indented @@ -158,7 +159,7 @@ Namespace My #Region "Exceptions" reportStream.WriteLine("==== Exception ====") reportStream.WriteLine() - reportStream.WriteLine(Regex.Unescape(JsonConvert.SerializeObject(ex, jsonSerializerSettings))) + reportStream.WriteLine(Regex.Unescape(JsonConvert.SerializeObject(caughtException, jsonSerializerSettings))) reportStream.WriteLine() #End Region @@ -173,12 +174,13 @@ Namespace My Private Sub Generate_Button_Click(sender As Object, e As EventArgs) Dim logFileName = "CrashReport_" + Date.Now.ToString("s").Replace(":", ".") + ".txt" + Dim generatedReport = GenerateCrashReport() - Computer.Clipboard.SetText(crashReportData) + Computer.Clipboard.SetText(generatedReport) Directory.CreateDirectory(CRASHBUG_OUTPUT_PATH) Dim CrashLog_Report = New StreamWriter(Path.Combine(CRASHBUG_OUTPUT_PATH, logFileName)) - CrashLog_Report.WriteLine(crashReportData) + CrashLog_Report.WriteLine(generatedReport) CrashLog_Report.Close() ' Open an Explorer window to the crash log. From c9b2f7b8a14a6f13f7d05e0f285c226305768c2b Mon Sep 17 00:00:00 2001 From: gbakeman Date: Sat, 27 Dec 2025 12:17:14 -0500 Subject: [PATCH 10/10] Directory, logging handling, misc. fixes - Added support for "-PersistDataInStartupPath" command line argument, which causes WinNUT to try to store persistent data (logs) in the folder in which is started up in. It will always fall back to the LocalUserAppDataPath, which is a special property in the Forms namespace. - Removed empty Init_Globals sub from the Globals module, and replaced it with a constructor that allows us to set the DataDirectory ReadOnly property on startup. - Moved important log lines to beginning of startup event handler - Added sub to specifically handle logging settings changes (or apply them on startup) - Main WinNUT form is hidden during a crash - Crashlogs are now written to the preferred data directory - Removed compiler constant support for forcing the log file location (use CLA instead) - Attempting to get the LogFilePath property when log file is not initialized will throw an exception instead of returning a default value. - Pref gui will write a displayed log line when saving preferences. - Modified WinNUT settings/properties changing event for handling the AutoReconnect property. - Connection menu item state logic is more consistent - Simplified code for opening the preferences GUI into a subroutine - Adjusted purpose of applyapplicationpreferences sub into a sub that resets the UI state. --- WinNUT_V2/WinNUT-Client/ApplicationEvents.vb | 40 ++++++--- WinNUT_V2/WinNUT-Client/Pref_Gui.vb | 2 +- WinNUT_V2/WinNUT-Client/WinNUT.vb | 84 ++++++------------- WinNUT_V2/WinNUT-Client_Common/Logger.vb | 67 +++++++-------- .../WinNUT-Client_Common/WinNUT_Globals.vb | 37 +++++++- 5 files changed, 122 insertions(+), 108 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb index c3a3b65..097e6fa 100644 --- a/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb +++ b/WinNUT_V2/WinNUT-Client/ApplicationEvents.vb @@ -5,13 +5,11 @@ Imports System.Text.RegularExpressions Imports Microsoft.VisualBasic.ApplicationServices Imports Newtonsoft.Json Imports WinNUT_Client_Common -Imports WinNUT_Client_Common.OldParams Namespace My Partial Friend Class MyApplication ' Default culture for output so logs can be shared with the project. Private Shared ReadOnly DEF_CULTURE_INFO As CultureInfo = CultureInfo.InvariantCulture - Private Shared ReadOnly CRASHBUG_OUTPUT_PATH = System.Windows.Forms.Application.LocalUserAppDataPath Private CrashBug_Form As New Form Private BtnClose As New Button @@ -23,13 +21,17 @@ Namespace My "NUT_Username", "NUT_Password"}) Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup + LogFile.LogTracing(String.Format("{0} v{1} starting up.", ProgramName, ProgramVersion), + LogLvl.LOG_NOTICE, Me) + LogFile.LogTracing("Data storage path: " & DataDirectory, LogLvl.LOG_NOTICE, Me) + AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf AppDomainUnhandledException AddHandler Settings.SettingsLoaded, AddressOf OnSettingsFirstLoaded + AddHandler Settings.PropertyChanged, AddressOf OnPropertyChanged - Init_Globals() - LogFile.LogTracing(String.Format("{0} v{1} starting up.", Application.Info.ProductName, Application.Info.Version), - LogLvl.LOG_NOTICE, Me) - ' LogFile.LogTracing($"DataDirectory: { ApplicationDeployment.CurrentDeployment.DataDirectory }", LogLvl.LOG_NOTICE, Me) + LogFile.LogTracing("Event handlers configured.", LogLvl.LOG_DEBUG, Me) + + ApplyLoggingSettings() ' Starting without previous settings. May be new installation or MSI upgrade. If Settings.IsFirstRun Then @@ -43,7 +45,7 @@ Namespace My End Try ' If Settings still appear new, check if old Registry preferences are leftover. - If Settings.IsFirstRun AndAlso WinNUT_Params.ParamsExist Then + If Settings.IsFirstRun AndAlso OldParams.WinNUT_Params.ParamsExist Then LogFile.LogTracing("Previous preferences data detected in the Registry.", LogLvl.LOG_NOTICE, Me, Resources.DetectedPreviousPrefsData) @@ -66,6 +68,7 @@ Namespace My Private Sub MyApplication_UnhandledException(sender As Object, e As UnhandledExceptionEventArgs) Handles Me.UnhandledException LogFile.LogTracing("UnhandledException", LogLvl.LOG_ERROR, Me) WinNUT.HasCrashed = True + WinNUT.Hide() e.ExitApplication = False caughtException = e.Exception @@ -178,13 +181,12 @@ Namespace My Computer.Clipboard.SetText(generatedReport) - Directory.CreateDirectory(CRASHBUG_OUTPUT_PATH) - Dim CrashLog_Report = New StreamWriter(Path.Combine(CRASHBUG_OUTPUT_PATH, logFileName)) + Dim CrashLog_Report = New StreamWriter(Path.Combine(DataDirectory, logFileName)) CrashLog_Report.WriteLine(generatedReport) CrashLog_Report.Close() ' Open an Explorer window to the crash log. - Process.Start(CRASHBUG_OUTPUT_PATH) + Process.Start(DataDirectory) End End Sub @@ -218,5 +220,23 @@ Namespace My Settings.NUT_PollIntervalMsec = MySettings.Default.NUT_PollIntervalMsec End If End Sub + + ''' + ''' Raised when any Settings property is changed through a set accessor, or when reloaded/reset. + ''' + ''' + ''' + Private Sub OnPropertyChanged(sender As Object, e As ComponentModel.PropertyChangedEventArgs) + LogFile.LogTracing("Handling OnPropertyChanged for " & e.PropertyName, LogLvl.LOG_DEBUG, Me) + If e.PropertyName = "LG_LogToFile" OrElse e.PropertyName = "LG_LogLevel" Then + LogFile.LogTracing("Settings property changed for logging subsystem, updating...", LogLvl.LOG_DEBUG, Me) + ApplyLoggingSettings() + End If + End Sub + + Private Sub ApplyLoggingSettings() + LogFile.IsWritingToFile = Settings.LG_LogToFile + LogFile.LogLevelValue = Settings.LG_LogLevel + End Sub End Class End Namespace diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.vb b/WinNUT_V2/WinNUT-Client/Pref_Gui.vb index 41708e9..965abe2 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.vb +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.vb @@ -74,7 +74,7 @@ Public Class Pref_Gui RaiseEvent SavedPreferences() SetLogControlsStatus() - LogFile.LogTracing("Preferences Saved", LogLvl.LOG_NOTICE, Me) + LogFile.LogTracing("WinNut Preferences Saved.", LogLvl.LOG_NOTICE, Me, StrLog.Item(AppResxStr.STR_LOG_PREFS)) PrefsModified = False Catch e As Exception diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index f7a315e..d35e48f 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -1,4 +1,4 @@ -Imports System.Configuration +Imports System.ComponentModel Imports WinNUT_Client_Common Public Class WinNUT @@ -10,12 +10,6 @@ Public Class WinNUT End Set 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 @@ -179,7 +173,8 @@ Public Class WinNUT AddHandler Microsoft.Win32.SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged AddHandler RequestConnect, AddressOf UPS_Connect - AddHandler My.Settings.SettingChanging, AddressOf SettingChanging + AddHandler My.Settings.PropertyChanged, AddressOf OnPropertyChanged + AddHandler Pref_Gui.SavedPreferences, AddressOf ResetUIState LogFile.LogTracing("WinNUT Form completed Load.", LogLvl.LOG_NOTICE, Me) End Sub @@ -322,15 +317,14 @@ Public Class WinNUT #End Region - Private Sub SettingChanging(sender As Object, e As SettingChangingEventArgs) - LogFile.LogTracing("SettingChanging: " & e.SettingName, LogLvl.LOG_DEBUG, Me) - - UpdateMainMenuState() + Private Sub OnPropertyChanged(sender As Object, e As PropertyChangedEventArgs) + If e.PropertyName = "NUT_AutoReconnect" Then + LogFile.LogTracing("Handling OnPropertyChanged for " & e.PropertyName, LogLvl.LOG_DEBUG, Me) + UpdateMainMenuState() + End If End Sub Private Sub UpdateMainMenuState() - Menu_Persist.Checked = My.Settings.NUT_AutoReconnect - If OldParams.WinNUT_Params.ParamsExist Then ManageOldPrefsToolStripMenuItem.Enabled = True ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Enabled_TooltipText @@ -339,15 +333,10 @@ Public Class WinNUT ManageOldPrefsToolStripMenuItem.ToolTipText = My.Resources.ManageOldPrefsToolstripMenuItem_Disabled_TooltipText End If - 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 - Else - Menu_Connect.Enabled = True - Menu_Disconnect.Enabled = False - Menu_UPS_Var.Enabled = False - End If + Menu_Persist.Checked = My.Settings.NUT_AutoReconnect + Menu_UPS_Var.Enabled = If(UPS_Device?.IsConnected, False) + Menu_Disconnect.Enabled = If(UPS_Device?.IsConnected, False) OrElse If(UPS_Device?.IsReconnecting, False) + Menu_Connect.Enabled = Not Menu_Disconnect.Enabled End Sub Private Sub SystemEvents_PowerModeChanged(sender As Object, e As Microsoft.Win32.PowerModeChangedEventArgs) @@ -369,15 +358,6 @@ Public Class WinNUT End Select End Sub - Private Sub RunRegPrefsUpgrade() - LogFile.LogTracing("Starting Upgrade dialog.", LogLvl.LOG_NOTICE, Me) - Dim upPrefsDg As New Forms.UpgradePrefsDialog() - upPrefsDg.ShowDialog() - - UpdateMainMenuState() - ApplyApplicationPreferences() - End Sub - Private Sub UPS_Connect(Optional retryOnConnFailure = False) Dim Nut_Config As Nut_Parameter LogFile.LogTracing("Client UPS_Connect subroutine beginning.", LogLvl.LOG_NOTICE, Me) @@ -392,6 +372,7 @@ Public Class WinNUT UPS_Device = New UPS_Device(Nut_Config, LogFile, My.Settings.NUT_PollIntervalMsec, My.Settings.CAL_FreqInNom) AddHandler UPS_Device.EncounteredNUTException, AddressOf HandleNUTException UPS_Device.Connect_UPS(retryOnConnFailure) + UpdateMainMenuState() End Sub ''' @@ -482,27 +463,11 @@ Public Class WinNUT Application.Exit() End Sub - Private Sub Menu_Settings_Click(sender As Object, e As EventArgs) Handles Menu_Settings.Click - LogFile.LogTracing("Open Pref Gui From Menu", LogLvl.LOG_DEBUG, Me) - AddHandler Pref_Gui.SavedPreferences, AddressOf ApplyApplicationPreferences - Pref_Gui.Activate() - Pref_Gui.Visible = True - HasFocus = False - End Sub - Private Sub Menu_Sys_Exit_Click(sender As Object, e As EventArgs) Handles Menu_Sys_Exit.Click LogFile.LogTracing("Close WinNut From Systray", LogLvl.LOG_DEBUG, Me) Application.Exit() End Sub - Private Sub Menu_Sys_Settings_Click(sender As Object, e As EventArgs) Handles Menu_Sys_Settings.Click - LogFile.LogTracing("Open Pref Gui From Systray", LogLvl.LOG_DEBUG, Me) - AddHandler Pref_Gui.SavedPreferences, AddressOf ApplyApplicationPreferences - Pref_Gui.Activate() - Pref_Gui.Visible = True - HasFocus = False - End Sub - Private Sub NotifyIcon_MouseClick(sender As Object, e As MouseEventArgs) Handles NotifyIcon.MouseClick, NotifyIcon.MouseDoubleClick If e.Button <> MouseButtons.Right Then LogFile.LogTracing("Restore Main Gui On Mouse Click Notify Icon", LogLvl.LOG_DEBUG, Me) @@ -813,29 +778,28 @@ Public Class WinNUT UPS_Connect() End Sub + Private Sub OpenPrefsForm() Handles Menu_Sys_Settings.Click, Menu_Settings.Click + LogFile.LogTracing("Opening Prefs form...", LogLvl.LOG_NOTICE, Me) + Pref_Gui.ShowDialog() + End Sub + ''' - ''' Apply settings and preferences to WinNUT, whether or not they have changed. + ''' Reset the UI by cycling the connection if already connected and reinitialize display values. ''' - Public Sub ApplyApplicationPreferences() - LogFile.LogTracing("Beginning ApplyApplicationPreferences subroutine.", LogLvl.LOG_DEBUG, Me) + Public Sub ResetUIState() + LogFile.LogTracing("Beginning ResetUIState subroutine.", LogLvl.LOG_DEBUG, Me) Dim autoReconnect = False If (UPS_Device IsNot Nothing) AndAlso UPS_Device.IsConnected Then autoReconnect = True UPSDisconnect() - Else - ReInitDisplayValues() End If - ' Apply logging subsystem configuration - LogFile.IsWritingToFile = My.Settings.LG_LogToFile - LogFile.LogLevelValue = My.Settings.LG_LogLevel + ReInitDisplayValues() If autoReconnect Then UPS_Connect() End If - - LogFile.LogTracing("WinNut Preferences Applied.", LogLvl.LOG_NOTICE, Me, StrLog.Item(AppResxStr.STR_LOG_PREFS)) End Sub Private Sub UpdateIcon_NotifyIcon() @@ -1036,7 +1000,9 @@ Public Class WinNUT End Sub Private Sub ManageOldPrefsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ManageOldPrefsToolStripMenuItem.Click - RunRegPrefsUpgrade() + LogFile.LogTracing("Launching UpgradePrefsDialog from ToolStripMenu.", LogLvl.LOG_NOTICE, Me) + UPSDisconnect() + Forms.UpgradePrefsDialog.ShowDialog() End Sub Private Sub Menu_Update_Click(sender As Object, e As EventArgs) Handles Menu_Update.Click diff --git a/WinNUT_V2/WinNUT-Client_Common/Logger.vb b/WinNUT_V2/WinNUT-Client_Common/Logger.vb index 83714fa..eede501 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Logger.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Logger.vb @@ -1,30 +1,18 @@ -' WinNUT-Client is a NUT windows client for monitoring your ups hooked up to your favorite linux server. -' Copyright (C) 2019-2021 Gawindx (Decaux Nicolas) -' -' This program is free software: you can redistribute it and/or modify it under the terms of the -' GNU General Public License as published by the Free Software Foundation, either version 3 of the -' License, or any later version. -' -' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY - -Imports System.Globalization +Imports System.Globalization Imports System.IO Imports System.Text -Imports System.Windows.Forms Imports Microsoft.VisualBasic.Logging Public Class Logger #Region "Constants/Shared" Private Const LOG_FILE_CREATION_SCHEDULE = LogFileCreationScheduleOption.Daily + Private Const SUBDIRECTORY = "Logs" Public Const MAX_DISPLAYED_LOGS = 50 - ' Set TEST_RELEASE_DIRS in the custom compiler constants dialog for file storage to behave like release. -#If DEBUG AndAlso Not TEST_RELEASE_DIRS Then +#If DEBUG Then Private Shared ReadOnly DEFAULT_DATETIMEFORMAT = DateTimeFormatInfo.InvariantInfo - Private Shared ReadOnly DEFAULT_LOCATION = Application.StartupPath #Else Private Shared ReadOnly DEFAULT_DATETIMEFORMAT = DateTimeFormatInfo.CurrentInfo - Private Shared ReadOnly DEFAULT_LOCATION = Application.LocalUserAppDataPath #End If Private ReadOnly TEventCache As New TraceEventCache() @@ -85,8 +73,8 @@ Public Class Logger Return LogFile IsNot Nothing End Get Set(value As Boolean) - If value <> (LogFile IsNot Nothing) Then - If value = True Then + If value <> IsWritingToFile Then + If value Then InitializeLogFile() Else TerminateLogFile() @@ -96,14 +84,15 @@ Public Class Logger End Property ''' - ''' Get the filesystem location of the object, or the folder where it would be stored. + ''' Get the full path of the object's log file. ''' - Public ReadOnly Property LogFilePath() As String + ''' + Public ReadOnly Property LogFilePath As String Get If IsWritingToFile Then Return LogFile.FullLogFileName Else - Return DEFAULT_LOCATION + Throw New InvalidOperationException("Log file has not been created.") End If End Get End Property @@ -127,22 +116,28 @@ Public Class Logger #Region "Log file management" ''' - ''' Instantiates a new at a the desired location, and outputs the - ''' buffer into the file before synchronizing with write calls. + ''' Instantiates a new with a location that's determined by a pre-defined + ''' algorithm. The buffer is written into the file before synchronizing with write calls. ''' - ''' Desired location to initiate the log file. If unspecified, - ''' then a default location is used. - Public Sub InitializeLogFile(Optional baseDataFolder As String = Nothing) - LogFile = New FileLogTraceListener() With { - .TraceOutputOptions = TraceOptions.DateTime Or TraceOptions.ProcessId, - .Append = True, - .AutoFlush = True, - .LogFileCreationSchedule = LOG_FILE_CREATION_SCHEDULE, - .CustomLocation = If(baseDataFolder Is Nothing, DEFAULT_LOCATION, baseDataFolder), - .Location = LogFileLocation.Custom - } - - LogTracing($"Init log file: { LogFilePath }", LogLvl.LOG_NOTICE, Me) + Private Sub InitializeLogFile() + LogTracing("InitializeLogFile called...", LogLvl.LOG_DEBUG, Me) + + Try + LogFile = New FileLogTraceListener() With { + .TraceOutputOptions = TraceOptions.DateTime Or TraceOptions.ProcessId, + .Append = True, + .AutoFlush = True, + .LogFileCreationSchedule = LOG_FILE_CREATION_SCHEDULE, + .CustomLocation = Path.Combine({DataDirectory, SUBDIRECTORY}), + .Location = LogFileLocation.Custom + } + + ' Calling the trace sub will also cause it to try to write to the log file, validating it. + LogTracing($"Attempt init log file: { LogFilePath }", LogLvl.LOG_NOTICE, Me) + Catch ex As Exception + TerminateLogFile() + LogException(ex, Me) + End Try If LastEventsList.Count > 0 Then ' Fill new file with the LastEventsList buffer @@ -153,7 +148,7 @@ Public Class Logger Next End If - LogFile.WriteLine("==== Begin Live Log ====") + LogFile.WriteLine("==== Begin Live Log ====" & Environment.NewLine) End Sub ''' diff --git a/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb b/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb index f3422b4..13d8d98 100644 --- a/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb +++ b/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb @@ -2,13 +2,16 @@ #Region "Constants/Shareds" + Private Const PARAM_PERSIST_DATA_IN_STARTUP_PATH = "-PersistDataInStartupPath" + Private ReadOnly PREFERRED_DATA_DIRECTORY = Windows.Forms.Application.LocalUserAppDataPath + Public ReadOnly ProgramName As String = My.Application.Info.ProductName Public ReadOnly ProgramVersion As String = My.Application.Info.Version.ToString() Public ReadOnly ShortProgramVersion As String = ProgramVersion.Substring(0, ProgramVersion.IndexOf(".", ProgramVersion.IndexOf(".") + 1)) Public ReadOnly GitHubURL As String = My.Application.Info.Trademark Public ReadOnly Copyright As String = My.Application.Info.Copyright - Public ReadOnly DataDirectory = $"{ My.Application.Info.CompanyName }\{ ProgramName }\{ ProgramVersion }" + Public ReadOnly DataDirectory As String Public WithEvents LogFile As Logger = New Logger(LogLvl.LOG_DEBUG) Public WithEvents UpdateController As New Updater.UpdateUtil @@ -16,7 +19,37 @@ #End Region - Public Sub Init_Globals() + Sub New() + If Environment.GetCommandLineArgs().Contains(PARAM_PERSIST_DATA_IN_STARTUP_PATH) Then + LogFile.LogTracing("Detected CommandLineArg to store persistent data to StartupPath.", LogLvl.LOG_DEBUG, Nothing) + + If IsPathWritable(Windows.Forms.Application.StartupPath) Then + LogFile.LogTracing("Confirmed StartupPath as chosen path.", LogLvl.LOG_DEBUG, Nothing) + DataDirectory = Windows.Forms.Application.StartupPath + Return + Else + LogFile.LogTracing("Log to StartupPath requested, but path is not writable.", LogLvl.LOG_ERROR, Nothing) + End If + End If + LogFile.LogTracing("Setting DataDirectory to preferred location.", LogLvl.LOG_DEBUG, Nothing) + DataDirectory = PREFERRED_DATA_DIRECTORY End Sub + + Private Function IsPathWritable(_path As String, Optional throwExceptions As Boolean = False) As Boolean + LogFile.LogTracing($"Checking path { _path } for writability...", LogLvl.LOG_DEBUG, Nothing) + Try + Using fs = IO.File.Create(IO.Path.Combine(_path, IO.Path.GetRandomFileName()), 1, IO.FileOptions.DeleteOnClose) + End Using + LogFile.LogTracing("Path is writable.", LogLvl.LOG_DEBUG, Nothing) + Return True + Catch + LogFile.LogTracing("Path is not writable.", LogLvl.LOG_DEBUG, Nothing) + If throwExceptions Then + Throw + Else + Return False + End If + End Try + End Function End Module