From 668567cee454a0dd1e96f698e6129558778b9136 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Fri, 4 Aug 2023 15:14:01 -0400 Subject: [PATCH 1/6] Creating updater classes in Common library - Created a new interface and class to handle checking for updates on GitHub (does not install yet) - Added Octokit library --- .../CheckForUpdateCompletedEventArgs.vb | 33 +++++ .../Updater/GitHubUpdateProvider.vb | 130 ++++++++++++++++++ .../Updater/IUpdateProvider.vb | 35 +++++ .../Updater/UpdateProgressChangedEventArgs.vb | 22 +++ .../WinNUT-Client_Common.vbproj | 8 ++ .../WinNUT-Client_Common/packages.config | 4 + 6 files changed, 232 insertions(+) create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/GitHubUpdateProvider.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/IUpdateProvider.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/packages.config diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb new file mode 100644 index 0000000..c4db18e --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb @@ -0,0 +1,33 @@ +' 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.ComponentModel + +''' +''' Represent important details resulting from a completed async request to check for updates. +''' +Public Class CheckForUpdateCompletedEventArgs + Inherits AsyncCompletedEventArgs + + Private ReadOnly _LatestRelease As Octokit.Release + + ReadOnly Property LatestRelease As Octokit.Release + Get + Return _LatestRelease + End Get + End Property + + Public Sub New(latestRelease As Octokit.Release, Optional [error] As Exception = Nothing, + Optional cancelled As Boolean = False) + + MyBase.New([error], cancelled, Nothing) + _LatestRelease = latestRelease + End Sub + +End Class diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/GitHubUpdateProvider.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/GitHubUpdateProvider.vb new file mode 100644 index 0000000..fb2c20b --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/GitHubUpdateProvider.vb @@ -0,0 +1,130 @@ +' 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.ComponentModel +Imports System.Threading +Imports Octokit + +Namespace Updater + + Public Class GitHubUpdateProvider + Implements IUpdateProvider + + Private Const REPOSITORY_OWNER = "nutdotnet" + Private Const REPOSITORY_NAME = "WinNUT-Client" + + Private onCompletedDelegate As SendOrPostCallback + Private Delegate Sub CheckForUpdateDelegate() + ' Only one instance of a check or install procedure at a time. + Private asyncOpInstance As AsyncOperation + Private disposedValue As Boolean + Private Shared _gitHubClient As GitHubClient + + Public Event OnCheckForUpdateCompleted(sender As IUpdateProvider, eventArgs As CheckForUpdateCompletedEventArgs) _ + Implements IUpdateProvider.OnCheckForUpdateCompleted + + Public Event Disposed As EventHandler Implements IComponent.Disposed + + Protected Overridable Sub InitializeDelegates() + onCompletedDelegate = New SendOrPostCallback(AddressOf CheckForUpdateAsyncCompleted) + End Sub + + Public Function CheckForUpdate() As Release Implements IUpdateProvider.CheckForUpdate + Dim checkTask = _gitHubClient.Repository.Release.GetLatest(REPOSITORY_OWNER, REPOSITORY_NAME) + + checkTask.RunSynchronously() + Return checkTask.Result + End Function + + Public Sub CheckForUpdateAsync() Implements IUpdateProvider.CheckForUpdateAsync + If asyncOpInstance IsNot Nothing Then + Throw New InvalidOperationException("Instance of AsyncOperation already exists.") + End If + + asyncOpInstance = AsyncOperationManager.CreateOperation(Nothing) + Dim checkDelegate As New CheckForUpdateDelegate(AddressOf CheckForUpdateWorker) + checkDelegate.BeginInvoke(Nothing, Nothing) + End Sub + + Private Sub CheckForUpdateWorker() Implements IUpdateProvider.CheckForUpdateWorker + Dim checkCompleteEvent = New CheckForUpdateCompletedEventArgs(CheckForUpdate()) + CheckForUpdateAsyncCompleted(checkCompleteEvent) + End Sub + + ' Doesn't really do anything. May need to implement real cancellation logic. + Public Sub CheckForUpdateAsyncCancel() Implements IUpdateProvider.CheckForUpdateAsyncCancel + If asyncOpInstance IsNot Nothing Then + asyncOpInstance = Nothing + End If + End Sub + + Protected Sub CheckForUpdateAsyncCompleted(eventArguments As CheckForUpdateCompletedEventArgs) _ + Implements IUpdateProvider.CheckForUpdateAsyncCompleted + + RaiseEvent OnCheckForUpdateCompleted(Me, eventArguments) + End Sub + + Public Function UpdateWorker() As Boolean Implements IUpdateProvider.UpdateWorker + Throw New NotImplementedException() + End Function + + Public Function Update() As Boolean Implements IUpdateProvider.Update + Throw New NotImplementedException() + End Function + + Public Sub UpdateAsync() Implements IUpdateProvider.UpdateAsync + Throw New NotImplementedException() + End Sub + + Public Sub UpdateAsyncCancel() Implements IUpdateProvider.UpdateAsyncCancel + Throw New NotImplementedException() + End Sub + + Sub New() + InitializeDelegates() + + _gitHubClient = New GitHubClient(New ProductHeaderValue(REPOSITORY_NAME)) + End Sub + + Public Property Site As ISite Implements IComponent.Site + Get + Throw New NotImplementedException() + End Get + Set(value As ISite) + Throw New NotImplementedException() + End Set + End Property + + Protected Overridable Sub Dispose(disposing As Boolean) + If Not disposedValue Then + If disposing Then + ' TODO: dispose managed state (managed objects) + End If + + ' TODO: free unmanaged resources (unmanaged objects) and override finalizer + ' TODO: set large fields to null + disposedValue = True + End If + End Sub + + ' ' TODO: override finalizer only if 'Dispose(disposing As Boolean)' has code to free unmanaged resources + ' Protected Overrides Sub Finalize() + ' ' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method + ' Dispose(disposing:=False) + ' MyBase.Finalize() + ' End Sub + + Public Sub Dispose() Implements IDisposable.Dispose + ' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method + Dispose(disposing:=True) + GC.SuppressFinalize(Me) + End Sub + End Class + +End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/IUpdateProvider.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/IUpdateProvider.vb new file mode 100644 index 0000000..19a0596 --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/IUpdateProvider.vb @@ -0,0 +1,35 @@ +' 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.ComponentModel +Imports Octokit + +Namespace Updater + + ''' + ''' Defines an object that handles checking and retrieving updates for WinNUT. + ''' + Public Interface IUpdateProvider + Inherits IComponent + + Function CheckForUpdate() As Release + Sub CheckForUpdateWorker() + Sub CheckForUpdateAsync() + Sub CheckForUpdateAsyncCancel() + Sub CheckForUpdateAsyncCompleted(eventArguments As CheckForUpdateCompletedEventArgs) + Event OnCheckForUpdateCompleted(sender As IUpdateProvider, eventArguments As CheckForUpdateCompletedEventArgs) + + Function UpdateWorker() As Boolean + Function Update() As Boolean + Sub UpdateAsync() + Sub UpdateAsyncCancel() + + End Interface + +End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb new file mode 100644 index 0000000..0b66929 --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb @@ -0,0 +1,22 @@ +' 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.ComponentModel + +''' +''' Notify a listener that an async method for either checking or installing an update has progress to report. +''' NOTE: Currently just a wrapper for +''' +Public Class UpdateProgressChangedEventArgs + Inherits ProgressChangedEventArgs + + Public Sub New(progressPercentage As Integer, userState As Object) + MyBase.New(progressPercentage, userState) + End Sub +End Class diff --git a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj index 8872739..673ad6e 100644 --- a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj +++ b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj @@ -45,6 +45,9 @@ On + + ..\packages\Octokit.5.0.4\lib\netstandard2.0\Octokit.dll + @@ -94,6 +97,10 @@ True + + + + @@ -117,6 +124,7 @@ My Settings.Designer.vb + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client_Common/packages.config b/WinNUT_V2/WinNUT-Client_Common/packages.config new file mode 100644 index 0000000..9a766ae --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 0f09ed9d59d86717195026396aaaba903c9b746b Mon Sep 17 00:00:00 2001 From: gbakeman Date: Fri, 26 Jul 2024 13:12:59 -0400 Subject: [PATCH 2/6] Relocating providers --- .../Updater/{ => Providers}/GitHubUpdateProvider.vb | 2 +- .../Updater/{ => Providers}/IUpdateProvider.vb | 5 +++-- WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) rename WinNUT_V2/WinNUT-Client_Common/Updater/{ => Providers}/GitHubUpdateProvider.vb (99%) rename WinNUT_V2/WinNUT-Client_Common/Updater/{ => Providers}/IUpdateProvider.vb (86%) diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/GitHubUpdateProvider.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb similarity index 99% rename from WinNUT_V2/WinNUT-Client_Common/Updater/GitHubUpdateProvider.vb rename to WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb index fb2c20b..8fe69d3 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Updater/GitHubUpdateProvider.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb @@ -11,7 +11,7 @@ Imports System.ComponentModel Imports System.Threading Imports Octokit -Namespace Updater +Namespace Updater.Providers Public Class GitHubUpdateProvider Implements IUpdateProvider diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/IUpdateProvider.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb similarity index 86% rename from WinNUT_V2/WinNUT-Client_Common/Updater/IUpdateProvider.vb rename to WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb index 19a0596..5d34300 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Updater/IUpdateProvider.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb @@ -10,10 +10,11 @@ Imports System.ComponentModel Imports Octokit -Namespace Updater +Namespace Updater.Providers ''' - ''' Defines an object that handles checking and retrieving updates for WinNUT. + ''' Defines an object that handles checking and retrieving updates for WinNUT. While methods of checking for and + ''' installing updates can differ, there will always be a GitHub Release object associated with an update. ''' Public Interface IUpdateProvider Inherits IComponent diff --git a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj index 673ad6e..24727a8 100644 --- a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj +++ b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj @@ -97,8 +97,9 @@ True - - + + + From 31fc636d81a52821349ba078f16e1eefc1348e1a Mon Sep 17 00:00:00 2001 From: gbakeman Date: Sat, 10 Aug 2024 13:08:46 -0400 Subject: [PATCH 3/6] Common library Updater changes - Modified global variables to avoid implicit definitions - Added update controller to global variables - Updated OctoKit NuGet library to latest version - Removing update provider classes and interface in favor of single defined class with multiple event argument classes --- .../CheckForUpdateCompletedEventArgs.vb | 33 ----- .../Updater/Providers/GitHubUpdateProvider.vb | 130 ----------------- .../Updater/Providers/IUpdateProvider.vb | 36 ----- .../Updater/UpdateCheckCompletedEventArgs.vb | 34 +++++ .../UpdateDownloadCompletedEventArgs.vb | 35 +++++ .../UpdateDownloadProgressChangedEventArgs.vb | 16 +++ .../Updater/UpdateProgressChangedEventArgs.vb | 22 --- .../Updater/UpdateUtil.vb | 135 ++++++++++++++++++ .../WinNUT-Client_Common.vbproj | 14 +- .../WinNUT-Client_Common/WinNUT_Globals.vb | 23 ++- .../WinNUT-Client_Common/packages.config | 2 +- 11 files changed, 236 insertions(+), 244 deletions(-) delete mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb delete mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb delete mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/UpdateCheckCompletedEventArgs.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadCompletedEventArgs.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadProgressChangedEventArgs.vb delete mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb create mode 100644 WinNUT_V2/WinNUT-Client_Common/Updater/UpdateUtil.vb diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb deleted file mode 100644 index c4db18e..0000000 --- a/WinNUT_V2/WinNUT-Client_Common/Updater/CheckForUpdateCompletedEventArgs.vb +++ /dev/null @@ -1,33 +0,0 @@ -' 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.ComponentModel - -''' -''' Represent important details resulting from a completed async request to check for updates. -''' -Public Class CheckForUpdateCompletedEventArgs - Inherits AsyncCompletedEventArgs - - Private ReadOnly _LatestRelease As Octokit.Release - - ReadOnly Property LatestRelease As Octokit.Release - Get - Return _LatestRelease - End Get - End Property - - Public Sub New(latestRelease As Octokit.Release, Optional [error] As Exception = Nothing, - Optional cancelled As Boolean = False) - - MyBase.New([error], cancelled, Nothing) - _LatestRelease = latestRelease - End Sub - -End Class diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb deleted file mode 100644 index 8fe69d3..0000000 --- a/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/GitHubUpdateProvider.vb +++ /dev/null @@ -1,130 +0,0 @@ -' 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.ComponentModel -Imports System.Threading -Imports Octokit - -Namespace Updater.Providers - - Public Class GitHubUpdateProvider - Implements IUpdateProvider - - Private Const REPOSITORY_OWNER = "nutdotnet" - Private Const REPOSITORY_NAME = "WinNUT-Client" - - Private onCompletedDelegate As SendOrPostCallback - Private Delegate Sub CheckForUpdateDelegate() - ' Only one instance of a check or install procedure at a time. - Private asyncOpInstance As AsyncOperation - Private disposedValue As Boolean - Private Shared _gitHubClient As GitHubClient - - Public Event OnCheckForUpdateCompleted(sender As IUpdateProvider, eventArgs As CheckForUpdateCompletedEventArgs) _ - Implements IUpdateProvider.OnCheckForUpdateCompleted - - Public Event Disposed As EventHandler Implements IComponent.Disposed - - Protected Overridable Sub InitializeDelegates() - onCompletedDelegate = New SendOrPostCallback(AddressOf CheckForUpdateAsyncCompleted) - End Sub - - Public Function CheckForUpdate() As Release Implements IUpdateProvider.CheckForUpdate - Dim checkTask = _gitHubClient.Repository.Release.GetLatest(REPOSITORY_OWNER, REPOSITORY_NAME) - - checkTask.RunSynchronously() - Return checkTask.Result - End Function - - Public Sub CheckForUpdateAsync() Implements IUpdateProvider.CheckForUpdateAsync - If asyncOpInstance IsNot Nothing Then - Throw New InvalidOperationException("Instance of AsyncOperation already exists.") - End If - - asyncOpInstance = AsyncOperationManager.CreateOperation(Nothing) - Dim checkDelegate As New CheckForUpdateDelegate(AddressOf CheckForUpdateWorker) - checkDelegate.BeginInvoke(Nothing, Nothing) - End Sub - - Private Sub CheckForUpdateWorker() Implements IUpdateProvider.CheckForUpdateWorker - Dim checkCompleteEvent = New CheckForUpdateCompletedEventArgs(CheckForUpdate()) - CheckForUpdateAsyncCompleted(checkCompleteEvent) - End Sub - - ' Doesn't really do anything. May need to implement real cancellation logic. - Public Sub CheckForUpdateAsyncCancel() Implements IUpdateProvider.CheckForUpdateAsyncCancel - If asyncOpInstance IsNot Nothing Then - asyncOpInstance = Nothing - End If - End Sub - - Protected Sub CheckForUpdateAsyncCompleted(eventArguments As CheckForUpdateCompletedEventArgs) _ - Implements IUpdateProvider.CheckForUpdateAsyncCompleted - - RaiseEvent OnCheckForUpdateCompleted(Me, eventArguments) - End Sub - - Public Function UpdateWorker() As Boolean Implements IUpdateProvider.UpdateWorker - Throw New NotImplementedException() - End Function - - Public Function Update() As Boolean Implements IUpdateProvider.Update - Throw New NotImplementedException() - End Function - - Public Sub UpdateAsync() Implements IUpdateProvider.UpdateAsync - Throw New NotImplementedException() - End Sub - - Public Sub UpdateAsyncCancel() Implements IUpdateProvider.UpdateAsyncCancel - Throw New NotImplementedException() - End Sub - - Sub New() - InitializeDelegates() - - _gitHubClient = New GitHubClient(New ProductHeaderValue(REPOSITORY_NAME)) - End Sub - - Public Property Site As ISite Implements IComponent.Site - Get - Throw New NotImplementedException() - End Get - Set(value As ISite) - Throw New NotImplementedException() - End Set - End Property - - Protected Overridable Sub Dispose(disposing As Boolean) - If Not disposedValue Then - If disposing Then - ' TODO: dispose managed state (managed objects) - End If - - ' TODO: free unmanaged resources (unmanaged objects) and override finalizer - ' TODO: set large fields to null - disposedValue = True - End If - End Sub - - ' ' TODO: override finalizer only if 'Dispose(disposing As Boolean)' has code to free unmanaged resources - ' Protected Overrides Sub Finalize() - ' ' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method - ' Dispose(disposing:=False) - ' MyBase.Finalize() - ' End Sub - - Public Sub Dispose() Implements IDisposable.Dispose - ' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method - Dispose(disposing:=True) - GC.SuppressFinalize(Me) - End Sub - End Class - -End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb deleted file mode 100644 index 5d34300..0000000 --- a/WinNUT_V2/WinNUT-Client_Common/Updater/Providers/IUpdateProvider.vb +++ /dev/null @@ -1,36 +0,0 @@ -' 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.ComponentModel -Imports Octokit - -Namespace Updater.Providers - - ''' - ''' Defines an object that handles checking and retrieving updates for WinNUT. While methods of checking for and - ''' installing updates can differ, there will always be a GitHub Release object associated with an update. - ''' - Public Interface IUpdateProvider - Inherits IComponent - - Function CheckForUpdate() As Release - Sub CheckForUpdateWorker() - Sub CheckForUpdateAsync() - Sub CheckForUpdateAsyncCancel() - Sub CheckForUpdateAsyncCompleted(eventArguments As CheckForUpdateCompletedEventArgs) - Event OnCheckForUpdateCompleted(sender As IUpdateProvider, eventArguments As CheckForUpdateCompletedEventArgs) - - Function UpdateWorker() As Boolean - Function Update() As Boolean - Sub UpdateAsync() - Sub UpdateAsyncCancel() - - End Interface - -End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateCheckCompletedEventArgs.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateCheckCompletedEventArgs.vb new file mode 100644 index 0000000..2b333fd --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateCheckCompletedEventArgs.vb @@ -0,0 +1,34 @@ +' 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.ComponentModel + +Namespace Updater + ''' + ''' Represent important details resulting from a completed async request to check for updates. + ''' + Public Class UpdateCheckCompletedEventArgs + Inherits AsyncCompletedEventArgs + + Private ReadOnly _LatestRelease As Octokit.Release + + ReadOnly Property LatestRelease As Octokit.Release + Get + Return _LatestRelease + End Get + End Property + + Public Sub New(latestRelease As Octokit.Release, Optional [error] As Exception = Nothing, + Optional cancelled As Boolean = False) + + MyBase.New([error], cancelled, Nothing) + _LatestRelease = latestRelease + End Sub + End Class +End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadCompletedEventArgs.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadCompletedEventArgs.vb new file mode 100644 index 0000000..429961e --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadCompletedEventArgs.vb @@ -0,0 +1,35 @@ +' 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.ComponentModel +Imports System.IO + +Namespace Updater + ''' + ''' Represent important details resulting from a completed async request to download an update. + ''' + Public Class UpdateDownloadCompletedEventArgs + Inherits AsyncCompletedEventArgs + + Private ReadOnly _downloadedFile As FileInfo + + ReadOnly Property DownloadedFile As FileInfo + Get + Return _downloadedFile + End Get + End Property + + Public Sub New(downloadedFile As FileInfo, Optional [error] As Exception = Nothing, + Optional cancelled As Boolean = False) + + MyBase.New([error], cancelled, Nothing) + _downloadedFile = downloadedFile + End Sub + End Class +End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadProgressChangedEventArgs.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadProgressChangedEventArgs.vb new file mode 100644 index 0000000..709348a --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateDownloadProgressChangedEventArgs.vb @@ -0,0 +1,16 @@ +Namespace Updater + Public Class UpdateDownloadProgressChangedEventArgs + Inherits EventArgs + + Private _bytesDownloaded As Integer + ReadOnly Property BytesDownloaded As Integer + Get + Return _bytesDownloaded + End Get + End Property + + Public Sub New(bytesDown As Integer) + _bytesDownloaded = bytesDown + End Sub + End Class +End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb deleted file mode 100644 index 0b66929..0000000 --- a/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateProgressChangedEventArgs.vb +++ /dev/null @@ -1,22 +0,0 @@ -' 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.ComponentModel - -''' -''' Notify a listener that an async method for either checking or installing an update has progress to report. -''' NOTE: Currently just a wrapper for -''' -Public Class UpdateProgressChangedEventArgs - Inherits ProgressChangedEventArgs - - Public Sub New(progressPercentage As Integer, userState As Object) - MyBase.New(progressPercentage, userState) - End Sub -End Class diff --git a/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateUtil.vb b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateUtil.vb new file mode 100644 index 0000000..622a137 --- /dev/null +++ b/WinNUT_V2/WinNUT-Client_Common/Updater/UpdateUtil.vb @@ -0,0 +1,135 @@ +Imports System.IO +Imports System.Net.Http +Imports Octokit + +Namespace Updater + Public Class UpdateUtil + Private Const REPOSITORY_OWNER = "nutdotnet" + Private Const REPOSITORY_NAME = "WinNUT-Client" + Private Shared ReadOnly USER_AGENT_HEADER As String = $"{REPOSITORY_OWNER}" + Private Shared ReadOnly PROGRESS_CHANGED_DELAY = 500 ' Milliseconds to delay between raising progress update events. + + Private _latestRelease As Release + Private releaseAsset As ReleaseAsset + + Public Event UpdateCheckCompleted(sender As UpdateUtil, e As UpdateCheckCompletedEventArgs) + Public Event UpdateDownloadProgressChanged(sender As UpdateUtil, e As UpdateDownloadProgressChangedEventArgs) + Public Event UpdateDownloadCompleted(sender As UpdateUtil, e As UpdateDownloadCompletedEventArgs) + + Public Property LatestRelease As Release + Get + Return _latestRelease + End Get + Private Set(value As Release) + _latestRelease = value + releaseAsset = value.Assets.First(Function(asset As ReleaseAsset) asset.Name.ToLowerInvariant().EndsWith(".msi")) + End Set + End Property + + Public Property LatestReleaseAsset As ReleaseAsset + Get + Return releaseAsset + End Get + Private Set(value As ReleaseAsset) + releaseAsset = value + End Set + End Property + + Public Async Function BeginUpdateCheck(acceptPreRelease As Boolean) As Task + Try + Dim releases = Await New GitHubClient(New ProductHeaderValue(USER_AGENT_HEADER)).Repository.Release.GetAll( + REPOSITORY_OWNER, REPOSITORY_NAME) + + For Each rel As Release In releases + If (acceptPreRelease AndAlso rel.Prerelease) OrElse Not rel.Prerelease Then + LatestRelease = rel + RaiseEvent UpdateCheckCompleted(Me, New UpdateCheckCompletedEventArgs(rel)) + Return + End If + Next + Catch ex As Exception + RaiseEvent UpdateCheckCompleted(Me, New UpdateCheckCompletedEventArgs(Nothing, ex)) + Return + End Try + End Function + + Public Async Function BeginUpdateDownload() As Task + If releaseAsset Is Nothing Then + Throw New InvalidOperationException("No release asset available to download.") + End If + + Dim downloadFilePath = Path.GetTempPath() & releaseAsset.Name + + If File.Exists(downloadFilePath) Then + Dim fileInfo = New FileInfo(downloadFilePath) + If fileInfo.Length <> releaseAsset.Size Then + File.Delete(downloadFilePath) + Else + RaiseEvent UpdateDownloadCompleted(Me, New UpdateDownloadCompletedEventArgs(fileInfo)) + Return + End If + End If + + Try + Using client As New HttpClient() + Dim response = Await client.GetAsync(New Uri(releaseAsset.BrowserDownloadUrl), + HttpCompletionOption.ResponseHeadersRead) + response.EnsureSuccessStatusCode() + + Using fs As New FileStream(downloadFilePath, IO.FileMode.Create), + contentStream = Await response.Content.ReadAsStreamAsync() + + Dim buffer As Byte() = New Byte(4096) {} + Dim totalBytesRead As Integer + Dim nextProgressUpdate As Date + Dim bytesRead As Integer + + Do + bytesRead = Await contentStream.ReadAsync(buffer, 0, buffer.Length) + Await fs.WriteAsync(buffer, 0, bytesRead) + totalBytesRead += bytesRead + + If Date.Now >= nextProgressUpdate Then + RaiseEvent UpdateDownloadProgressChanged(Me, + New UpdateDownloadProgressChangedEventArgs(totalBytesRead)) + nextProgressUpdate.AddTicks(PROGRESS_CHANGED_DELAY * 10) + End If + Loop While bytesRead > 0 + + RaiseEvent UpdateDownloadCompleted(Me, + New UpdateDownloadCompletedEventArgs(New FileInfo(downloadFilePath))) + End Using + End Using + Catch ex As Exception + RaiseEvent UpdateDownloadCompleted(Me, New UpdateDownloadCompletedEventArgs(Nothing, ex)) + End Try + + End Function + + ''' + ''' Determine if the interval between update checks has exceeded the user's settings. + ''' + ''' The int used to represent the between updates. + ''' The date when updates were last checked. + ''' True if an update check is warranted based on the user's settings. + Public Shared Function UpdateCheckDelayPassed(autoCheckDelay As Integer, lastChecked As Date) As Boolean + Dim DelayVerif As DateInterval + Select Case autoCheckDelay + Case 0 + DelayVerif = DateInterval.Day + Case 1 + DelayVerif = DateInterval.Weekday + Case 2 + DelayVerif = DateInterval.Month + End Select + + Dim Diff = 1 + + If lastChecked <> Date.MinValue Then + Diff = DateDiff(DelayVerif, lastChecked, Now) + End If + + Return Diff >= 1 + End Function + End Class +End Namespace diff --git a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj index 3433dac..8278345 100644 --- a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj +++ b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj @@ -61,13 +61,14 @@ true - - ..\packages\Octokit.5.0.4\lib\netstandard2.0\Octokit.dll + + ..\packages\Octokit.13.0.1\lib\netstandard2.0\Octokit.dll + @@ -109,11 +110,10 @@ Resources.resx - - - - - + + + + diff --git a/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb b/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb index aec9386..0f4f57d 100644 --- a/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb +++ b/WinNUT_V2/WinNUT-Client_Common/WinNUT_Globals.vb @@ -1,23 +1,16 @@ -' 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 - -Public Module WinNUT_Globals +Public Module WinNUT_Globals #Region "Constants/Shareds" - Public ReadOnly ProgramName = My.Application.Info.ProductName - Public ReadOnly ProgramVersion = My.Application.Info.Version.ToString() - Public ReadOnly ShortProgramVersion = ProgramVersion.Substring(0, ProgramVersion.IndexOf(".", ProgramVersion.IndexOf(".") + 1)) - Public ReadOnly GitHubURL = My.Application.Info.Trademark - Public ReadOnly Copyright = My.Application.Info.Copyright + 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 WithEvents LogFile As Logger = New Logger(LogLvl.LOG_DEBUG) + Public WithEvents UpdateController As New Updater.UpdateUtil Public StrLog As New List(Of String) #End Region diff --git a/WinNUT_V2/WinNUT-Client_Common/packages.config b/WinNUT_V2/WinNUT-Client_Common/packages.config index 9a766ae..e6bb536 100644 --- a/WinNUT_V2/WinNUT-Client_Common/packages.config +++ b/WinNUT_V2/WinNUT-Client_Common/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file From 9467238e3639f04286bef61c422f248e3a73655f Mon Sep 17 00:00:00 2001 From: gbakeman Date: Sat, 10 Aug 2024 13:21:40 -0400 Subject: [PATCH 4/6] Update form overhaul, Part 1 - Renamed the Update_Gui form to UpdateAvailableForm, and relocated it in the Forms namespace/folder. - Overhauled form and logic for updating. Most update check/download logic is handled outside of the form (in UpdateUtil or WinNUT.vb). Form generally handles events and small visual changes. - Removed most update-related strings from WinNUT. Besides a few notification strings, most will be found in the UpdateAvailableForm. Requires translators. - Removed AutoUpdate setting. WinNUT doesn't have the functionality to automatically check for updates during operation - it only does this when first starting. - Applied this change to Pref_Gui and simplified some logic. --- WinNUT_V2/WinNUT-Client/App.config | 3 - .../Forms/UpdateAvailableForm.Designer.vb | 136 +++ .../Forms/UpdateAvailableForm.de-DE.resx | 159 ++++ .../Forms/UpdateAvailableForm.fr-FR.resx | 159 ++++ .../UpdateAvailableForm.resx} | 336 ++++--- .../Forms/UpdateAvailableForm.ru-RU.resx | 159 ++++ .../Forms/UpdateAvailableForm.uk-UA.resx | 159 ++++ .../Forms/UpdateAvailableForm.vb | 42 + .../Forms/UpdateAvailableForm.zh-CN.resx | 159 ++++ .../Forms/UpdateAvailableForm.zh-TW.resx | 159 ++++ .../WinNUT-Client.zh-TW.xlf | 473 +++++----- .../WinNUT-client.de-DE.xlf | 473 +++++----- .../WinNUT-client.fr-FR.xlf | 475 +++++----- .../WinNUT-client.ru-RU.xlf | 475 +++++----- .../WinNUT-client.uk-UA.xlf | 475 +++++----- .../WinNUT-client.zh-CN.xlf | 475 +++++----- .../My Project/Resources.Designer.vb | 56 +- .../My Project/Resources.de-DE.resx | 15 - .../My Project/Resources.fr-FR.resx | 17 - .../WinNUT-Client/My Project/Resources.resx | 21 +- .../My Project/Resources.ru-RU.resx | 17 - .../My Project/Resources.uk-UA.resx | 17 - .../My Project/Resources.zh-CN.resx | 17 - .../My Project/Resources.zh-TW.resx | 15 - .../My Project/Settings.Designer.vb | 14 +- .../My Project/Settings.settings | 3 - WinNUT_V2/WinNUT-Client/Pref_Gui.Designer.vb | 15 +- WinNUT_V2/WinNUT-Client/Pref_Gui.de-DE.resx | 6 - WinNUT_V2/WinNUT-Client/Pref_Gui.fr-FR.resx | 6 - WinNUT_V2/WinNUT-Client/Pref_Gui.resx | 820 +++--------------- WinNUT_V2/WinNUT-Client/Pref_Gui.ru-RU.resx | 6 - WinNUT_V2/WinNUT-Client/Pref_Gui.uk-UA.resx | 6 - WinNUT_V2/WinNUT-Client/Pref_Gui.vb | 25 +- WinNUT_V2/WinNUT-Client/Pref_Gui.zh-CN.resx | 6 - WinNUT_V2/WinNUT-Client/Pref_Gui.zh-TW.resx | 6 - .../WinNUT-Client/Update_Gui.Designer.vb | 94 -- WinNUT_V2/WinNUT-Client/Update_Gui.de-DE.resx | 30 - WinNUT_V2/WinNUT-Client/Update_Gui.fr-FR.resx | 30 - WinNUT_V2/WinNUT-Client/Update_Gui.ru-RU.resx | 30 - WinNUT_V2/WinNUT-Client/Update_Gui.uk-UA.resx | 30 - WinNUT_V2/WinNUT-Client/Update_Gui.vb | 252 ------ WinNUT_V2/WinNUT-Client/Update_Gui.zh-CN.resx | 30 - WinNUT_V2/WinNUT-Client/Update_Gui.zh-TW.resx | 30 - WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj | 38 +- WinNUT_V2/WinNUT-Client/WinNUT.vb | 84 +- .../WinNUT-Client_Common/Common_Enums.vb | 5 - 46 files changed, 3152 insertions(+), 2906 deletions(-) create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.Designer.vb create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.de-DE.resx create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.fr-FR.resx rename WinNUT_V2/WinNUT-Client/{Update_Gui.resx => Forms/UpdateAvailableForm.resx} (59%) create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.ru-RU.resx create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.uk-UA.resx create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.vb create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-CN.resx create mode 100644 WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-TW.resx delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.Designer.vb delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.de-DE.resx delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.fr-FR.resx delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.ru-RU.resx delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.uk-UA.resx delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.vb delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.zh-CN.resx delete mode 100644 WinNUT_V2/WinNUT-Client/Update_Gui.zh-TW.resx diff --git a/WinNUT_V2/WinNUT-Client/App.config b/WinNUT_V2/WinNUT-Client/App.config index ae1c5c8..e336ab6 100644 --- a/WinNUT_V2/WinNUT-Client/App.config +++ b/WinNUT_V2/WinNUT-Client/App.config @@ -70,9 +70,6 @@ 0 - - False - False diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.Designer.vb b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.Designer.vb new file mode 100644 index 0000000..50066c6 --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.Designer.vb @@ -0,0 +1,136 @@ +Namespace Forms + + + Partial Class UpdateAvailableForm + Inherits System.Windows.Forms.Form + + 'Form remplace la méthode Dispose pour nettoyer la liste des composants. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Requise par le Concepteur Windows Form + Private components As System.ComponentModel.IContainer + + 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form + 'Elle peut être modifiée à l'aide du Concepteur Windows Form. + 'Ne la modifiez pas à l'aide de l'éditeur de code. + + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(UpdateAvailableForm)) + Me.GB1 = New System.Windows.Forms.GroupBox() + Me.Title = New System.Windows.Forms.Label() + Me.TB_ChgLog = New System.Windows.Forms.TextBox() + Me.Update_Btn = New System.Windows.Forms.Button() + Me.Close_Btn = New System.Windows.Forms.Button() + Me.ButtonsPanel = New System.Windows.Forms.Panel() + Me.VisitPageButton = New System.Windows.Forms.Button() + Me.DownloadProgressPanel = New System.Windows.Forms.Panel() + Me.DownloadProgressPanelLabel = New System.Windows.Forms.Label() + Me.DownloadProgressBar = New WinNUT_Client.WinFormControls.CProgressBar() + Me.GB1.SuspendLayout() + Me.ButtonsPanel.SuspendLayout() + Me.DownloadProgressPanel.SuspendLayout() + Me.SuspendLayout() + ' + 'GB1 + ' + resources.ApplyResources(Me.GB1, "GB1") + Me.GB1.Controls.Add(Me.Title) + Me.GB1.Controls.Add(Me.TB_ChgLog) + Me.GB1.Name = "GB1" + Me.GB1.TabStop = False + ' + 'Title + ' + resources.ApplyResources(Me.Title, "Title") + Me.Title.Name = "Title" + ' + 'TB_ChgLog + ' + resources.ApplyResources(Me.TB_ChgLog, "TB_ChgLog") + Me.TB_ChgLog.Name = "TB_ChgLog" + ' + 'Update_Btn + ' + resources.ApplyResources(Me.Update_Btn, "Update_Btn") + Me.Update_Btn.Name = "Update_Btn" + Me.Update_Btn.UseVisualStyleBackColor = True + ' + 'Close_Btn + ' + resources.ApplyResources(Me.Close_Btn, "Close_Btn") + Me.Close_Btn.Name = "Close_Btn" + Me.Close_Btn.UseVisualStyleBackColor = True + ' + 'ButtonsPanel + ' + resources.ApplyResources(Me.ButtonsPanel, "ButtonsPanel") + Me.ButtonsPanel.Controls.Add(Me.VisitPageButton) + Me.ButtonsPanel.Controls.Add(Me.Update_Btn) + Me.ButtonsPanel.Controls.Add(Me.Close_Btn) + Me.ButtonsPanel.Name = "ButtonsPanel" + ' + 'VisitPageButton + ' + resources.ApplyResources(Me.VisitPageButton, "VisitPageButton") + Me.VisitPageButton.Name = "VisitPageButton" + Me.VisitPageButton.UseVisualStyleBackColor = True + ' + 'DownloadProgressPanel + ' + resources.ApplyResources(Me.DownloadProgressPanel, "DownloadProgressPanel") + Me.DownloadProgressPanel.Controls.Add(Me.DownloadProgressPanelLabel) + Me.DownloadProgressPanel.Controls.Add(Me.DownloadProgressBar) + Me.DownloadProgressPanel.Name = "DownloadProgressPanel" + ' + 'DownloadProgressPanelLabel + ' + resources.ApplyResources(Me.DownloadProgressPanelLabel, "DownloadProgressPanelLabel") + Me.DownloadProgressPanelLabel.Name = "DownloadProgressPanelLabel" + ' + 'DownloadProgressBar + ' + Me.DownloadProgressBar.ForeColor = System.Drawing.SystemColors.HighlightText + resources.ApplyResources(Me.DownloadProgressBar, "DownloadProgressBar") + Me.DownloadProgressBar.Name = "DownloadProgressBar" + ' + 'UpdateAvailableForm + ' + resources.ApplyResources(Me, "$this") + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.GB1) + Me.Controls.Add(Me.DownloadProgressPanel) + Me.Controls.Add(Me.ButtonsPanel) + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "UpdateAvailableForm" + Me.GB1.ResumeLayout(False) + Me.GB1.PerformLayout() + Me.ButtonsPanel.ResumeLayout(False) + Me.DownloadProgressPanel.ResumeLayout(False) + Me.DownloadProgressPanel.PerformLayout() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents GB1 As GroupBox + Friend WithEvents Close_Btn As Button + Friend WithEvents Update_Btn As Button + Friend WithEvents TB_ChgLog As TextBox + Private WithEvents Title As Label + Private WithEvents ButtonsPanel As Panel + Friend WithEvents DownloadProgressPanel As Panel + Friend WithEvents DownloadProgressPanelLabel As Label + Friend WithEvents VisitPageButton As Button + Friend WithEvents DownloadProgressBar As WinFormControls.CProgressBar + End Class + +End Namespace diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.de-DE.resx b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.de-DE.resx new file mode 100644 index 0000000..5f7b13b --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.de-DE.resx @@ -0,0 +1,159 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + + + 500, 20 + + + 500, 20 + + + 500, 20 + + + 0 + + + MiddleCenter + + + 6, 42 + + + True + + + Vertical + + + 1 + + + 12, 12 + + + 0 + + + 2 + + + 4 + + + 6, 13 + + + CenterScreen + + + True + + + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + + + Bottom, Right + + + NoControl + + + 3, 3 + + + 75, 23 + + + 5 + + + 349, 423 + + + 244, 29 + + + 5 + + + Bottom, Left, Right + + + True + + + Microsoft Sans Serif, 11.25pt + + + 3, 0 + + + 154, 18 + + + 0 + + + 12, 366 + + + 584, 51 + + + 6 + + + False + + + 624, 503 + + + 3, 25 + + + 578, 23 + + + 1 + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.fr-FR.resx b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.fr-FR.resx new file mode 100644 index 0000000..5f7b13b --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.fr-FR.resx @@ -0,0 +1,159 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + + + 500, 20 + + + 500, 20 + + + 500, 20 + + + 0 + + + MiddleCenter + + + 6, 42 + + + True + + + Vertical + + + 1 + + + 12, 12 + + + 0 + + + 2 + + + 4 + + + 6, 13 + + + CenterScreen + + + True + + + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + + + Bottom, Right + + + NoControl + + + 3, 3 + + + 75, 23 + + + 5 + + + 349, 423 + + + 244, 29 + + + 5 + + + Bottom, Left, Right + + + True + + + Microsoft Sans Serif, 11.25pt + + + 3, 0 + + + 154, 18 + + + 0 + + + 12, 366 + + + 584, 51 + + + 6 + + + False + + + 624, 503 + + + 3, 25 + + + 578, 23 + + + 1 + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.resx b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.resx similarity index 59% rename from WinNUT_V2/WinNUT-Client/Update_Gui.resx rename to WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.resx index f02989b..575ec05 100644 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.resx +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.resx @@ -117,187 +117,313 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Top, Bottom, Left, Right + - - 145, 23 + + Microsoft Sans Serif, 12pt, style=Bold + + + NoControl - + 6, 16 + + 500, 20 + + + 500, 20 + + + 500, 20 + - - 4 + + 0 - + + MiddleCenter + + + Title + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + GB1 - - Show ChangeLog + + 0 - - $this + + Top, Bottom, Left, Right - - Update + + 6, 42 - - 500, 20 + + True - - GB1 + + Vertical - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 572, 300 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1 + + + TB_ChgLog System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 536, 264 - - - Update_Gui + + GB1 - - ShowLog_Button + + 1 12, 12 - - 500, 20 + + 584, 348 - - 6, 42 + + 0 - - 1 + + GB1 - - 145, 23 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Update_Btn + + $this - - 374, 230 + + 0 + + + NoControl + + + 84, 3 + + + 75, 23 2 - - Close_Btn - Update - - MiddleCenter + + Update_Btn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ButtonsPanel + + + 1 - - 196, 230 + + NoControl - - Update Available : Version {0} + + 165, 3 + + + 75, 23 + + + 4 Close - - 0 + + Close_Btn - - 1 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Microsoft Sans Serif, 12pt + + ButtonsPanel - - 500, 20 + + 2 - - 1 + + Bottom, Right - - GB1 + + NoControl - - - Vertical + + 3, 3 - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 75, 23 - - 3 + + 5 - - Lbl + + Visit Page - - CenterScreen + + VisitPageButton - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ButtonsPanel - - True + + 0 - - 6, 13 + + 349, 423 - - $this + + 244, 29 - + + 5 + + + ButtonsPanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - 145, 23 + + 2 - - 500, 160 + + Bottom, Left, Right - + True - - 0 + + Microsoft Sans Serif, 11.25pt - - $this + + NoControl + + + 3, 0 - - 3 + + 154, 18 - + 0 - - 18, 230 + + Downloading update... - - 2 + + DownloadProgressPanelLabel - - TB_ChgLog + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 513, 212 + + DownloadProgressPanel - + 0 + + NoControl + + + 3, 25 + + + 578, 23 + + + 1 + + + DownloadProgressBar + + + WinNUT_Client.WinFormControls.CProgressBar, WinNUT-Client, Version=2.2.8987.31429, Culture=neutral, PublicKeyToken=null + + + DownloadProgressPanel + + + 1 + + + 12, 366 + + + 584, 51 + + + 6 + + + False + + + DownloadProgressPanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + True + + 6, 13 + + + 608, 464 + + + NoControl + + + 624, 503 + + + CenterScreen + + + Update Available + + + UpdateAvailableForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.ru-RU.resx b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.ru-RU.resx new file mode 100644 index 0000000..5f7b13b --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.ru-RU.resx @@ -0,0 +1,159 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + + + 500, 20 + + + 500, 20 + + + 500, 20 + + + 0 + + + MiddleCenter + + + 6, 42 + + + True + + + Vertical + + + 1 + + + 12, 12 + + + 0 + + + 2 + + + 4 + + + 6, 13 + + + CenterScreen + + + True + + + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + + + Bottom, Right + + + NoControl + + + 3, 3 + + + 75, 23 + + + 5 + + + 349, 423 + + + 244, 29 + + + 5 + + + Bottom, Left, Right + + + True + + + Microsoft Sans Serif, 11.25pt + + + 3, 0 + + + 154, 18 + + + 0 + + + 12, 366 + + + 584, 51 + + + 6 + + + False + + + 624, 503 + + + 3, 25 + + + 578, 23 + + + 1 + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.uk-UA.resx b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.uk-UA.resx new file mode 100644 index 0000000..5f7b13b --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.uk-UA.resx @@ -0,0 +1,159 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + + + 500, 20 + + + 500, 20 + + + 500, 20 + + + 0 + + + MiddleCenter + + + 6, 42 + + + True + + + Vertical + + + 1 + + + 12, 12 + + + 0 + + + 2 + + + 4 + + + 6, 13 + + + CenterScreen + + + True + + + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + + + Bottom, Right + + + NoControl + + + 3, 3 + + + 75, 23 + + + 5 + + + 349, 423 + + + 244, 29 + + + 5 + + + Bottom, Left, Right + + + True + + + Microsoft Sans Serif, 11.25pt + + + 3, 0 + + + 154, 18 + + + 0 + + + 12, 366 + + + 584, 51 + + + 6 + + + False + + + 624, 503 + + + 3, 25 + + + 578, 23 + + + 1 + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.vb b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.vb new file mode 100644 index 0000000..71e82a8 --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.vb @@ -0,0 +1,42 @@ +Imports WinNUT_Client_Common + +Namespace Forms + Public Class UpdateAvailableForm + + Public Sub New() + InitializeComponent() + + Title.Text = UpdateController.LatestRelease.Name + Icon = WinNUT.Icon + TB_ChgLog.Text = UpdateController.LatestRelease.Body + End Sub + + Private Sub VisitPageButton_Click(sender As Object, e As EventArgs) Handles VisitPageButton.Click + Process.Start(UpdateController.LatestRelease.HtmlUrl) + End Sub + + Private Sub Update_Btn_Click(sender As Object, e As EventArgs) Handles Update_Btn.Click + DownloadProgressPanel.Visible = True + AddHandler UpdateController.UpdateDownloadProgressChanged, AddressOf UpdateDownloadProgressChanged + AddHandler UpdateController.UpdateDownloadCompleted, AddressOf UpdateDownloadCompleted + UpdateController.BeginUpdateDownload() + End Sub + + Private Sub UpdateDownloadProgressChanged(sender As Object, e As Updater.UpdateDownloadProgressChangedEventArgs) + If UpdateController.LatestReleaseAsset.Size > 0 Then + DownloadProgressBar.Value = (e.BytesDownloaded / UpdateController.LatestReleaseAsset.Size) * 100 + DownloadProgressBar.Text = String.Format("{0:F2} MB / {1:F2} MB", e.BytesDownloaded / 1048576, + UpdateController.LatestReleaseAsset.Size / 1048576) + End If + End Sub + + Private Sub UpdateDownloadCompleted(sender As Object, e As Updater.UpdateDownloadCompletedEventArgs) + Process.Start(e.DownloadedFile.FullName) + Application.Exit() + End Sub + + Private Sub Close_Btn_Click(sender As Object, e As EventArgs) Handles Close_Btn.Click + Close() + End Sub + End Class +End Namespace diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-CN.resx b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-CN.resx new file mode 100644 index 0000000..5f7b13b --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-CN.resx @@ -0,0 +1,159 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + + + 500, 20 + + + 500, 20 + + + 500, 20 + + + 0 + + + MiddleCenter + + + 6, 42 + + + True + + + Vertical + + + 1 + + + 12, 12 + + + 0 + + + 2 + + + 4 + + + 6, 13 + + + CenterScreen + + + True + + + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + + + Bottom, Right + + + NoControl + + + 3, 3 + + + 75, 23 + + + 5 + + + 349, 423 + + + 244, 29 + + + 5 + + + Bottom, Left, Right + + + True + + + Microsoft Sans Serif, 11.25pt + + + 3, 0 + + + 154, 18 + + + 0 + + + 12, 366 + + + 584, 51 + + + 6 + + + False + + + 624, 503 + + + 3, 25 + + + 578, 23 + + + 1 + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-TW.resx b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-TW.resx new file mode 100644 index 0000000..5f7b13b --- /dev/null +++ b/WinNUT_V2/WinNUT-Client/Forms/UpdateAvailableForm.zh-TW.resx @@ -0,0 +1,159 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + + + 500, 20 + + + 500, 20 + + + 500, 20 + + + 0 + + + MiddleCenter + + + 6, 42 + + + True + + + Vertical + + + 1 + + + 12, 12 + + + 0 + + + 2 + + + 4 + + + 6, 13 + + + CenterScreen + + + True + + + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + + + Bottom, Right + + + NoControl + + + 3, 3 + + + 75, 23 + + + 5 + + + 349, 423 + + + 244, 29 + + + 5 + + + Bottom, Left, Right + + + True + + + Microsoft Sans Serif, 11.25pt + + + 3, 0 + + + 154, 18 + + + 0 + + + 12, 366 + + + 584, 51 + + + 6 + + + False + + + 624, 503 + + + 3, 25 + + + 578, 23 + + + 1 + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + + NoControl + + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf index 5532804..b6e2031 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-Client.zh-TW.xlf @@ -106,151 +106,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} - -
- -
- - - - 145, 23 - 145, 23 - - - 6, 16 - 6, 16 - - - 4 - 4 - - - Show ChangeLog - 顯示更新日誌 - - - Update - 更新 - - - 500, 20 - 500, 20 - - - 536, 264 - 536, 264 - - - 12, 12 - 12, 12 - - - 500, 20 - 500, 20 - - - 6, 42 - 6, 42 - - - 145, 23 - 145, 23 - - - 374, 230 - 374, 230 - - - 2 - 2 - - - Update - 更新 - - - MiddleCenter - MiddleCenter - - - 196, 230 - 196, 230 - - - Update Available : Version {0} - 可用的新版本:{0} - - - Close - 關閉 - - - 0 - 0 - - - 1 - 1 - - - Microsoft Sans Serif, 12pt - Microsoft Sans Serif, 12pt - - - 500, 20 - 500, 20 - - - Vertical - Vertical - - - CenterScreen - CenterScreen - - - True - True - - - 6, 13 - 6, 13 - - - 145, 23 - 145, 23 - - - 500, 160 - 500, 160 - - - True - True - - - 3 - 3 - - - 0 - 0 - - - 18, 230 - 18, 230 - - - 513, 212 - 513, 212 - - - True - True - - - -
@@ -688,28 +543,6 @@ Ini File Moved to {0}.old Remaining Time : {1} 電池電量:{0} 剩餘時間:{1} - - Update Available : Version {0} - 可用的新版本:{0} - - - Show ChangeLog - 顯示更新日誌 - - - Hide ChangeLog - 隱藏更新日誌 - - - Update WinNUT-Client Now? -Ok to Close WinNut and Install New Version -Cancel to Save Msi and Install Later - 您是否要立即更新 WinNUT Client?點選確定以關閉 WinNUT 並安裝新版本,點選取消以儲存 msi 檔案並於稍後手動安裝。 - - - Download New Version from : - 下載新版本來源: - https://github.com/nutdotnet/WinNUT-Client https://github.com/nutdotnet/WinNUT-Client @@ -859,6 +692,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + Checking for update... + Checking for update... + Inform the user that WinNUT is checking for an update. + @@ -1003,10 +841,6 @@ along with this program. If not, see https://www.gnu.org/licenses/. True True - - Verify Update - 檢查更新 - MiddleRight MiddleRight @@ -1031,10 +865,6 @@ along with this program. If not, see https://www.gnu.org/licenses/. Shutdown Options 停機選項 - - 310, 17 - 310, 17 - MiddleRight MiddleRight @@ -1134,17 +964,13 @@ Accepted value: Numeric value from 0 to 100. 240, 11 - 6, 42 - 6, 42 + 3, 13 + 3, 13 Stable 穩定版本 - - 6, 12 - 6, 12 - MiddleRight MiddleRight @@ -1237,10 +1063,6 @@ Accepted value: Numeric value from 0 to 100. Type of stop at the end of the stop procedure. 停機流程最後的停機方式 - - MiddleRight - MiddleRight - 284, 0 284, 0 @@ -1340,8 +1162,8 @@ Accepted value: Numeric value from 0 to 999. 155, 13 - 196, 101 - 196, 101 + 196, 63 + 196, 63 6, 72 @@ -1481,8 +1303,8 @@ Accepted value: Numeric value from 0 to 100. 睡眠 - 6, 72 - 6, 72 + 3, 39 + 3, 39 Calibration @@ -1721,8 +1543,8 @@ Accepted value: Numeric value from 0 to 100. 錯誤 - 196, 71 - 196, 71 + 196, 36 + 196, 36 Open the log file. @@ -1874,10 +1696,6 @@ Accepted value: Numeric value from 0 to 3600. 4, 22 4, 22 - - 0 - 0 - 4 4 @@ -2073,10 +1891,6 @@ Accepted value: Numeric value from 0 to 999. 265, 70 265, 70 - - True - True - 6, 42 6, 42 @@ -2167,8 +1981,8 @@ Accepted value: Numeric value from 0 to 3600. 240, 121 - 6, 102 - 6, 102 + 3, 66 + 3, 66 322, 234 @@ -2247,10 +2061,6 @@ Accepted value: Numeric value from 0 to 999. 21 21 - - 310, 0 - 310, 0 - NUT server login password NUT 伺服器登入密碼 @@ -2335,10 +2145,6 @@ Accepted value: Numeric value from 0 to 999. 68, 13 68, 13 - - Check for updates. - 檢查應用程式更新。 - Write logging events to a file. Write logging events to a file. @@ -4073,4 +3879,253 @@ Accepted value: Numeric value from 0 to 100. + +
+ +
+ + + + Microsoft Sans Serif, 12pt, style=Bold + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + 6, 16 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 0 + 0 + + + MiddleCenter + MiddleCenter + + + 6, 42 + 6, 42 + + + True + True + + + Vertical + Vertical + + + 572, 300 + 572, 300 + + + 1 + 1 + + + 12, 12 + 12, 12 + + + 584, 348 + 584, 348 + + + 0 + 0 + + + 84, 3 + 84, 3 + + + 75, 23 + 75, 23 + + + 2 + 2 + + + Update + Update + + + 165, 3 + 165, 3 + + + 75, 23 + 75, 23 + + + 4 + 4 + + + Close + Close + + + 6, 13 + 6, 13 + + + 608, 464 + 608, 464 + + + CenterScreen + CenterScreen + + + Update Available + Update Available + + + True + True + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Bottom, Right + Bottom, Right + + + NoControl + NoControl + + + 3, 3 + 3, 3 + + + 75, 23 + 75, 23 + + + 5 + 5 + + + Visit Page + Visit Page + + + 349, 423 + 349, 423 + + + 244, 29 + 244, 29 + + + 5 + 5 + + + Bottom, Left, Right + Bottom, Left, Right + + + True + True + + + Microsoft Sans Serif, 11.25pt + Microsoft Sans Serif, 11.25pt + + + 3, 0 + 3, 0 + + + 154, 18 + 154, 18 + + + 0 + 0 + + + Downloading update... + Downloading update... + + + 12, 366 + 12, 366 + + + 584, 51 + 584, 51 + + + 6 + 6 + + + False + False + + + 624, 503 + 624, 503 + + + 3, 25 + 3, 25 + + + 578, 23 + 578, 23 + + + 1 + 1 + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + +
\ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf index d952c46..08964f3 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.de-DE.xlf @@ -991,8 +991,8 @@ Entwicklung
- 196, 101 - 196, 101 + 196, 63 + 196, 63 120, 21 @@ -1015,8 +1015,8 @@ Monatlich - 196, 71 - 196, 71 + 196, 36 + 196, 36 120, 21 @@ -1031,8 +1031,8 @@ True - 6, 102 - 6, 102 + 3, 66 + 3, 66 111, 13 @@ -1051,8 +1051,8 @@ True - 6, 72 - 6, 72 + 3, 39 + 3, 39 134, 13 @@ -1075,8 +1075,8 @@ MiddleRight - 6, 42 - 6, 42 + 3, 13 + 3, 13 310, 0 @@ -1094,34 +1094,6 @@ Verify Update At Start Beim Start auf Updates prüfen - - True - True - - - MiddleRight - MiddleRight - - - 6, 12 - 6, 12 - - - 310, 0 - 310, 0 - - - 310, 17 - 310, 17 - - - 0 - 0 - - - Verify Update - Auf Update prüfen - 4, 22 4, 22 @@ -1367,10 +1339,6 @@ Accepted value: Numeric value from 0 to 100. Checks for updates at startup. Sucht beim Start nach Updates. - - Check for updates. - Auf Updates prüfen. - 154, 191 154, 191 @@ -1729,28 +1697,6 @@ Accepted value: Numeric value from 0 to 100. Remaining Time : {1} Akkuladung: {0} Verbleibende Zeit: {1} - - Update Available : Version {0} - Update verfügbar : Version {0} - - - Show ChangeLog - Change-Log anzeigen - - - Hide ChangeLog - Change-Log ausblenden - - - Update WinNUT-Client Now? -Ok to Close WinNut and Install New Version -Cancel to Save Msi and Install Later - WinNUT-Client jetzt aktualisieren? OK um WinNUT zu schließen und neue Version zu installieren Abbrechen um MSI-Datei zu speichern und später zu installieren - - - Download New Version from : - Neue Version herunterladen von : - Old ups.ini imported Ini File Moved to {0}.old @@ -1953,6 +1899,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + Checking for update... + Checking for update... + Inform the user that WinNUT is checking for an update. + @@ -3521,151 +3472,6 @@ along with this program. If not, see https://www.gnu.org/licenses/. - -
- -
- - - - 6, 42 - 6, 42 - - - True - True - - - Vertical - Vertical - - - 500, 160 - 500, 160 - - - 1 - 1 - - - True - True - - - Microsoft Sans Serif, 12pt - Microsoft Sans Serif, 12pt - - - 6, 16 - 6, 16 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 0 - 0 - - - Update Available : Version {0} - Update verfügbar: Version {0} - - - MiddleCenter - MiddleCenter - - - 12, 12 - 12, 12 - - - 513, 212 - 513, 212 - - - 0 - 0 - - - 18, 230 - 18, 230 - - - 145, 23 - 145, 23 - - - 2 - 2 - - - Update - Aktualisieren - - - 196, 230 - 196, 230 - - - 145, 23 - 145, 23 - - - 3 - 3 - - - Show ChangeLog - Change-Log anzeigen - - - 374, 230 - 374, 230 - - - 145, 23 - 145, 23 - - - 4 - 4 - - - Close - Schließen - - - 6, 13 - 6, 13 - - - 536, 264 - 536, 264 - - - CenterScreen - CenterScreen - - - Update - Aktualisieren - - - True - True - - - -
@@ -4073,4 +3879,253 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} + +
+ +
+ + + + Microsoft Sans Serif, 12pt, style=Bold + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + 6, 16 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 0 + 0 + + + MiddleCenter + MiddleCenter + + + 6, 42 + 6, 42 + + + True + True + + + Vertical + Vertical + + + 572, 300 + 572, 300 + + + 1 + 1 + + + 12, 12 + 12, 12 + + + 584, 348 + 584, 348 + + + 0 + 0 + + + 84, 3 + 84, 3 + + + 75, 23 + 75, 23 + + + 2 + 2 + + + Update + Update + + + 165, 3 + 165, 3 + + + 75, 23 + 75, 23 + + + 4 + 4 + + + Close + Close + + + 6, 13 + 6, 13 + + + 608, 464 + 608, 464 + + + CenterScreen + CenterScreen + + + Update Available + Update Available + + + True + True + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Bottom, Right + Bottom, Right + + + NoControl + NoControl + + + 3, 3 + 3, 3 + + + 75, 23 + 75, 23 + + + 5 + 5 + + + Visit Page + Visit Page + + + 349, 423 + 349, 423 + + + 244, 29 + 244, 29 + + + 5 + 5 + + + Bottom, Left, Right + Bottom, Left, Right + + + True + True + + + Microsoft Sans Serif, 11.25pt + Microsoft Sans Serif, 11.25pt + + + 3, 0 + 3, 0 + + + 154, 18 + 154, 18 + + + 0 + 0 + + + Downloading update... + Downloading update... + + + 12, 366 + 12, 366 + + + 584, 51 + 584, 51 + + + 6 + 6 + + + False + False + + + 624, 503 + 624, 503 + + + 3, 25 + 3, 25 + + + 578, 23 + 578, 23 + + + 1 + 1 + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + +
\ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf index 8425598..0c14c37 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.fr-FR.xlf @@ -994,8 +994,8 @@ inférieur à Développement - 196, 101 - 196, 101 + 196, 63 + 196, 63 120, 21 @@ -1018,8 +1018,8 @@ inférieur à Mensuelle - 196, 71 - 196, 71 + 196, 36 + 196, 36 120, 21 @@ -1034,8 +1034,8 @@ inférieur à True - 6, 102 - 6, 102 + 3, 66 + 3, 66 111, 13 @@ -1054,8 +1054,8 @@ inférieur à True - 6, 72 - 6, 72 + 3, 39 + 3, 39 134, 13 @@ -1078,8 +1078,8 @@ inférieur à MiddleRight - 6, 42 - 6, 42 + 3, 13 + 3, 13 310, 0 @@ -1097,34 +1097,6 @@ inférieur à Verify Update At Start Vérifier la mise à jour au Démarrage - - True - True - - - MiddleRight - MiddleRight - - - 6, 12 - 6, 12 - - - 310, 0 - 310, 0 - - - 310, 17 - 310, 17 - - - 0 - 0 - - - Verify Update - Vérifier la mise à jour - 4, 22 4, 22 @@ -1387,10 +1359,6 @@ Valeur acceptée: valeur numérique de 0 à 100. Checks for updates at startup. Vérifie les mises à jour au démarrage. - - Check for updates. - Vérifiez les mises à jour. - 154, 191 154, 191 @@ -1750,30 +1718,6 @@ Remaining Time : {1} Charge Batterie : {0} Temps restant : {1} - - Update Available : Version {0} - Mise à jour disponible : version {0} - - - Show ChangeLog - Afficher ChangeLog - - - Hide ChangeLog - Cacher ChangeLog - - - Update WinNUT-Client Now? -Ok to Close WinNut and Install New Version -Cancel to Save Msi and Install Later - Mettre à jour WinNUT-Client maintenant? -Ok pour fermer WinNut et installer une nouvelle version -Annuler pour enregistrer Msi et installer plus tard - - - Download New Version from : - Téléchargez la nouvelle version depuis : - Old ups.ini imported Ini File Moved to {0}.old @@ -1977,6 +1921,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + Checking for update... + Checking for update... + Inform the user that WinNUT is checking for an update. + @@ -3545,151 +3494,6 @@ along with this program. If not, see https://www.gnu.org/licenses/. - -
- -
- - - - 6, 42 - 6, 42 - - - True - True - - - Vertical - Vertical - - - 500, 160 - 500, 160 - - - 1 - 1 - - - True - True - - - Microsoft Sans Serif, 12pt - Microsoft Sans Serif, 12pt - - - 6, 16 - 6, 16 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 0 - 0 - - - Update Available : Version {0} - Mise à jour disponible : version {0} - - - MiddleCenter - MiddleCenter - - - 12, 12 - 12, 12 - - - 513, 212 - 513, 212 - - - 0 - 0 - - - 18, 230 - 18, 230 - - - 145, 23 - 145, 23 - - - 2 - 2 - - - Update - Mise à jour - - - 196, 230 - 196, 230 - - - 145, 23 - 145, 23 - - - 3 - 3 - - - Show ChangeLog - Afficher ChangeLog - - - 374, 230 - 374, 230 - - - 145, 23 - 145, 23 - - - 4 - 4 - - - Close - Fermer - - - 6, 13 - 6, 13 - - - 536, 264 - 536, 264 - - - CenterScreen - CenterScreen - - - Update - Mise à jour - - - True - True - - - -
@@ -4098,4 +3902,253 @@ Temps restant: {WinNUT.Lbl_VRTime.Text} + +
+ +
+ + + + Microsoft Sans Serif, 12pt, style=Bold + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + 6, 16 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 0 + 0 + + + MiddleCenter + MiddleCenter + + + 6, 42 + 6, 42 + + + True + True + + + Vertical + Vertical + + + 572, 300 + 572, 300 + + + 1 + 1 + + + 12, 12 + 12, 12 + + + 584, 348 + 584, 348 + + + 0 + 0 + + + 84, 3 + 84, 3 + + + 75, 23 + 75, 23 + + + 2 + 2 + + + Update + Update + + + 165, 3 + 165, 3 + + + 75, 23 + 75, 23 + + + 4 + 4 + + + Close + Close + + + 6, 13 + 6, 13 + + + 608, 464 + 608, 464 + + + CenterScreen + CenterScreen + + + Update Available + Update Available + + + True + True + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Bottom, Right + Bottom, Right + + + NoControl + NoControl + + + 3, 3 + 3, 3 + + + 75, 23 + 75, 23 + + + 5 + 5 + + + Visit Page + Visit Page + + + 349, 423 + 349, 423 + + + 244, 29 + 244, 29 + + + 5 + 5 + + + Bottom, Left, Right + Bottom, Left, Right + + + True + True + + + Microsoft Sans Serif, 11.25pt + Microsoft Sans Serif, 11.25pt + + + 3, 0 + 3, 0 + + + 154, 18 + 154, 18 + + + 0 + 0 + + + Downloading update... + Downloading update... + + + 12, 366 + 12, 366 + + + 584, 51 + 584, 51 + + + 6 + 6 + + + False + False + + + 624, 503 + 624, 503 + + + 3, 25 + 3, 25 + + + 578, 23 + 578, 23 + + + 1 + 1 + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + +
\ 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 3b0b095..3872a31 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.ru-RU.xlf @@ -107,151 +107,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} - -
- -
- - - - 6, 42 - 6, 42 - - - True - True - - - Vertical - Vertical - - - 500, 160 - 500, 160 - - - 1 - 1 - - - True - True - - - Microsoft Sans Serif, 12pt - Microsoft Sans Serif, 12pt - - - 6, 16 - 6, 16 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 0 - 0 - - - Update Available : Version {0} - Доступно обновление: Версия {0} - - - MiddleCenter - MiddleCenter - - - 12, 12 - 12, 12 - - - 513, 212 - 513, 212 - - - 0 - 0 - - - 18, 230 - 18, 230 - - - 145, 23 - 145, 23 - - - 2 - 2 - - - Update - Обновить - - - 196, 230 - 196, 230 - - - 145, 23 - 145, 23 - - - 3 - 3 - - - Show ChangeLog - Показать список изменений - - - 374, 230 - 374, 230 - - - 145, 23 - 145, 23 - - - 4 - 4 - - - Close - Закрыть - - - 6, 13 - 6, 13 - - - 536, 264 - 536, 264 - - - CenterScreen - CenterScreen - - - Update - Обновить - - - True - True - - - -
@@ -690,30 +545,6 @@ Remaining Time : {1} Заряд : {0} Осталось времени : {1} - - Update Available : Version {0} - Доступно обновление: Версия {0} - - - Show ChangeLog - Показать список изменений - - - Hide ChangeLog - Скрыть список изменений - - - Update WinNUT-Client Now? -Ok to Close WinNut and Install New Version -Cancel to Save Msi and Install Later - Обновить WinNUT сейчас? -"ОК" - закрыть WinNUT и установить новую версию. -"Отмена" - сохранить MSI и установить позже. - - - Download New Version from : - Скачать новую версию с: - https://github.com/nutdotnet/WinNUT-Client https://github.com/nutdotnet/WinNUT-Client @@ -864,6 +695,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Unavailable Indicate that a variable is unavailable + + Checking for update... + Checking for update... + Inform the user that WinNUT is checking for an update. + @@ -993,8 +829,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. Отладочная версия - 196, 101 - 196, 101 + 196, 63 + 196, 63 120, 21 @@ -1021,8 +857,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. Ежемесячно - 196, 71 - 196, 71 + 196, 36 + 196, 36 120, 21 @@ -1041,8 +877,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. True - 6, 102 - 6, 102 + 3, 66 + 3, 66 111, 13 @@ -1061,8 +897,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. True - 6, 72 - 6, 72 + 3, 39 + 3, 39 134, 13 @@ -1085,8 +921,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. MiddleRight - 6, 42 - 6, 42 + 3, 13 + 3, 13 310, 0 @@ -1108,38 +944,6 @@ along with this program. If not, see https://www.gnu.org/licenses/. Checks for updates at startup. Проверяет обновления при запуске. - - True - True - - - MiddleRight - MiddleRight - - - 6, 12 - 6, 12 - - - 310, 0 - 310, 0 - - - 310, 17 - 310, 17 - - - 0 - 0 - - - Verify Update - Проверять обновления - - - Check for updates. - Проверка обновлений. - 4, 22 4, 22 @@ -4095,4 +3899,253 @@ Accepted value: Numeric value from 0 to 100. + +
+ +
+ + + + Microsoft Sans Serif, 12pt, style=Bold + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + 6, 16 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 0 + 0 + + + MiddleCenter + MiddleCenter + + + 6, 42 + 6, 42 + + + True + True + + + Vertical + Vertical + + + 572, 300 + 572, 300 + + + 1 + 1 + + + 12, 12 + 12, 12 + + + 584, 348 + 584, 348 + + + 0 + 0 + + + 84, 3 + 84, 3 + + + 75, 23 + 75, 23 + + + 2 + 2 + + + Update + Update + + + 165, 3 + 165, 3 + + + 75, 23 + 75, 23 + + + 4 + 4 + + + Close + Close + + + 6, 13 + 6, 13 + + + 608, 464 + 608, 464 + + + CenterScreen + CenterScreen + + + Update Available + Update Available + + + True + True + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Bottom, Right + Bottom, Right + + + NoControl + NoControl + + + 3, 3 + 3, 3 + + + 75, 23 + 75, 23 + + + 5 + 5 + + + Visit Page + Visit Page + + + 349, 423 + 349, 423 + + + 244, 29 + 244, 29 + + + 5 + 5 + + + Bottom, Left, Right + Bottom, Left, Right + + + True + True + + + Microsoft Sans Serif, 11.25pt + Microsoft Sans Serif, 11.25pt + + + 3, 0 + 3, 0 + + + 154, 18 + 154, 18 + + + 0 + 0 + + + Downloading update... + Downloading update... + + + 12, 366 + 12, 366 + + + 584, 51 + 584, 51 + + + 6 + 6 + + + False + False + + + 624, 503 + 624, 503 + + + 3, 25 + 3, 25 + + + 578, 23 + 578, 23 + + + 1 + 1 + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + +
\ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf index 4993e95..341c97e 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.uk-UA.xlf @@ -107,151 +107,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} - -
- -
- - - - 6, 42 - 6, 42 - - - True - True - - - Vertical - Vertical - - - 500, 160 - 500, 160 - - - 1 - 1 - - - True - True - - - Microsoft Sans Serif, 12pt - Microsoft Sans Serif, 12pt - - - 6, 16 - 6, 16 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 0 - 0 - - - Update Available : Version {0} - Доступно оновлення: Версія {0} - - - MiddleCenter - MiddleCenter - - - 12, 12 - 12, 12 - - - 513, 212 - 513, 212 - - - 0 - 0 - - - 18, 230 - 18, 230 - - - 145, 23 - 145, 23 - - - 2 - 2 - - - Update - Оновити - - - 196, 230 - 196, 230 - - - 145, 23 - 145, 23 - - - 3 - 3 - - - Show ChangeLog - Показати список змін - - - 374, 230 - 374, 230 - - - 145, 23 - 145, 23 - - - 4 - 4 - - - Close - Закрити - - - 6, 13 - 6, 13 - - - 536, 264 - 536, 264 - - - CenterScreen - CenterScreen - - - Update - Оновити - - - True - True - - - -
@@ -690,30 +545,6 @@ Remaining Time : {1} Заряд : {0} Залишилось часу : {1} - - Update Available : Version {0} - Доступно оновлення: Версія {0} - - - Show ChangeLog - Показати список змін - - - Hide ChangeLog - Приховати список змін - - - Update WinNUT-Client Now? -Ok to Close WinNut and Install New Version -Cancel to Save Msi and Install Later - Оновити WinNUT зараз? -"ОК" - закрити WinNUT та встановити нову версію. -"Скасувати" - зберегти MSI та встановити пізніше. - - - Download New Version from : - Скачати нову версію с: - https://github.com/nutdotnet/WinNUT-Client https://github.com/nutdotnet/WinNUT-Client @@ -864,6 +695,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa Недоступно Indicate that a variable is unavailable + + Checking for update... + Checking for update... + Inform the user that WinNUT is checking for an update. + @@ -993,8 +829,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. Відлагоджувальна версія - 196, 101 - 196, 101 + 196, 63 + 196, 63 120, 21 @@ -1021,8 +857,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. Щомісячно - 196, 71 - 196, 71 + 196, 36 + 196, 36 120, 21 @@ -1041,8 +877,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. True - 6, 102 - 6, 102 + 3, 66 + 3, 66 111, 13 @@ -1061,8 +897,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. True - 6, 72 - 6, 72 + 3, 39 + 3, 39 134, 13 @@ -1085,8 +921,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. MiddleRight - 6, 42 - 6, 42 + 3, 13 + 3, 13 310, 0 @@ -1108,38 +944,6 @@ along with this program. If not, see https://www.gnu.org/licenses/. Checks for updates at startup. Перевіряє наявність оновлень під час запуску. - - True - True - - - MiddleRight - MiddleRight - - - 6, 12 - 6, 12 - - - 310, 0 - 310, 0 - - - 310, 17 - 310, 17 - - - 0 - 0 - - - Verify Update - Перевіряти оновлення - - - Check for updates. - Перевірка оновлень. - 4, 22 4, 22 @@ -4095,4 +3899,253 @@ Accepted value: Numeric value from 0 to 100. + +
+ +
+ + + + Microsoft Sans Serif, 12pt, style=Bold + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + 6, 16 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 0 + 0 + + + MiddleCenter + MiddleCenter + + + 6, 42 + 6, 42 + + + True + True + + + Vertical + Vertical + + + 572, 300 + 572, 300 + + + 1 + 1 + + + 12, 12 + 12, 12 + + + 584, 348 + 584, 348 + + + 0 + 0 + + + 84, 3 + 84, 3 + + + 75, 23 + 75, 23 + + + 2 + 2 + + + Update + Update + + + 165, 3 + 165, 3 + + + 75, 23 + 75, 23 + + + 4 + 4 + + + Close + Close + + + 6, 13 + 6, 13 + + + 608, 464 + 608, 464 + + + CenterScreen + CenterScreen + + + Update Available + Update Available + + + True + True + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Bottom, Right + Bottom, Right + + + NoControl + NoControl + + + 3, 3 + 3, 3 + + + 75, 23 + 75, 23 + + + 5 + 5 + + + Visit Page + Visit Page + + + 349, 423 + 349, 423 + + + 244, 29 + 244, 29 + + + 5 + 5 + + + Bottom, Left, Right + Bottom, Left, Right + + + True + True + + + Microsoft Sans Serif, 11.25pt + Microsoft Sans Serif, 11.25pt + + + 3, 0 + 3, 0 + + + 154, 18 + 154, 18 + + + 0 + 0 + + + Downloading update... + Downloading update... + + + 12, 366 + 12, 366 + + + 584, 51 + 584, 51 + + + 6 + 6 + + + False + False + + + 624, 503 + 624, 503 + + + 3, 25 + 3, 25 + + + 578, 23 + 578, 23 + + + 1 + 1 + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + +
\ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf index d9410c0..6fa92c1 100644 --- a/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf +++ b/WinNUT_V2/WinNUT-Client/MultilingualResources/WinNUT-client.zh-CN.xlf @@ -348,151 +348,6 @@ Remaining Time : {WinNUT.Lbl_VRTime.Text} - -
- -
- - - - 6, 42 - 6, 42 - - - True - True - - - Vertical - Vertical - - - 500, 160 - 500, 160 - - - 1 - 1 - - - True - True - - - Microsoft Sans Serif, 12pt - Microsoft Sans Serif, 12pt - - - 6, 16 - 6, 16 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 500, 20 - 500, 20 - - - 0 - 0 - - - Update Available : Version {0} - 可用的新版本:{0} - - - MiddleCenter - MiddleCenter - - - 12, 12 - 12, 12 - - - 513, 212 - 513, 212 - - - 0 - 0 - - - 18, 230 - 18, 230 - - - 145, 23 - 145, 23 - - - 2 - 2 - - - Update - 更新 - - - 196, 230 - 196, 230 - - - 145, 23 - 145, 23 - - - 3 - 3 - - - Show ChangeLog - 显示更新日志 - - - 374, 230 - 374, 230 - - - 145, 23 - 145, 23 - - - 4 - 4 - - - Close - 关闭 - - - 6, 13 - 6, 13 - - - 536, 264 - 536, 264 - - - CenterScreen - CenterScreen - - - Update - 更新 - - - True - True - - - -
@@ -671,30 +526,6 @@ Remaining Time : {1} 电池电量 : {0} 剩余时间 : {1} - - Update Available : Version {0} - 可用的新版本:{0} - - - Show ChangeLog - 显示更新日志 - - - Hide ChangeLog - 隐藏更新日志 - - - Update WinNUT-Client Now? -Ok to Close WinNut and Install New Version -Cancel to Save Msi and Install Later - 立即更新WinNUT-Client吗? -单击确定以关闭WinNut并安装新版本 -取消以保存 Msi 并于稍后安装 - - - Download New Version from : - 下载了新版本于: - https://github.com/nutdotnet/WinNUT-Client https://github.com/nutdotnet/WinNUT-Client @@ -864,6 +695,11 @@ Please correct the error, or cancel the upgrade dialog to continue with the defa 参数无效 Indicate that a variable is unavailable + + Checking for update... + Checking for update... + Inform the user that WinNUT is checking for an update. + @@ -2178,8 +2014,8 @@ Accepted value: Numeric value from 0 to 100. 开发版 - 196, 101 - 196, 101 + 196, 63 + 196, 63 120, 21 @@ -2206,8 +2042,8 @@ Accepted value: Numeric value from 0 to 100. 每月 - 196, 71 - 196, 71 + 196, 36 + 196, 36 120, 21 @@ -2226,8 +2062,8 @@ Accepted value: Numeric value from 0 to 100. True - 6, 102 - 6, 102 + 3, 66 + 3, 66 111, 13 @@ -2246,8 +2082,8 @@ Accepted value: Numeric value from 0 to 100. True - 6, 72 - 6, 72 + 3, 39 + 3, 39 134, 13 @@ -2270,8 +2106,8 @@ Accepted value: Numeric value from 0 to 100. MiddleRight - 6, 42 - 6, 42 + 3, 13 + 3, 13 310, 0 @@ -2293,38 +2129,6 @@ Accepted value: Numeric value from 0 to 100. Checks for updates at startup. 在启动时检查更新。 - - True - True - - - MiddleRight - MiddleRight - - - 6, 12 - 6, 12 - - - 310, 0 - 310, 0 - - - 310, 17 - 310, 17 - - - 0 - 0 - - - Verify Update - 验证更新 - - - Check for updates. - 检查应用更新。 - 105, 278 105, 278 @@ -4092,4 +3896,253 @@ Accepted value: Numeric value from 0 to 100. + +
+ +
+ + + + Microsoft Sans Serif, 12pt, style=Bold + Microsoft Sans Serif, 12pt, style=Bold + + + 6, 16 + 6, 16 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 500, 20 + 500, 20 + + + 0 + 0 + + + MiddleCenter + MiddleCenter + + + 6, 42 + 6, 42 + + + True + True + + + Vertical + Vertical + + + 572, 300 + 572, 300 + + + 1 + 1 + + + 12, 12 + 12, 12 + + + 584, 348 + 584, 348 + + + 0 + 0 + + + 84, 3 + 84, 3 + + + 75, 23 + 75, 23 + + + 2 + 2 + + + Update + Update + + + 165, 3 + 165, 3 + + + 75, 23 + 75, 23 + + + 4 + 4 + + + Close + Close + + + 6, 13 + 6, 13 + + + 608, 464 + 608, 464 + + + CenterScreen + CenterScreen + + + Update Available + Update Available + + + True + True + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Top, Bottom, Left, Right + Top, Bottom, Left, Right + + + Bottom, Right + Bottom, Right + + + NoControl + NoControl + + + 3, 3 + 3, 3 + + + 75, 23 + 75, 23 + + + 5 + 5 + + + Visit Page + Visit Page + + + 349, 423 + 349, 423 + + + 244, 29 + 244, 29 + + + 5 + 5 + + + Bottom, Left, Right + Bottom, Left, Right + + + True + True + + + Microsoft Sans Serif, 11.25pt + Microsoft Sans Serif, 11.25pt + + + 3, 0 + 3, 0 + + + 154, 18 + 154, 18 + + + 0 + 0 + + + Downloading update... + Downloading update... + + + 12, 366 + 12, 366 + + + 584, 51 + 584, 51 + + + 6 + 6 + + + False + False + + + 624, 503 + 624, 503 + + + 3, 25 + 3, 25 + + + 578, 23 + 578, 23 + + + 1 + 1 + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + NoControl + NoControl + + + +
\ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb index 57b121c..e4e8f4d 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.Designer.vb @@ -524,53 +524,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to Update Available : Version {0}. - ''' - Public ReadOnly Property Frm_Update_Str_01() As String - Get - Return ResourceManager.GetString("Frm_Update_Str_01", resourceCulture) - End Get - End Property - - ''' - ''' Looks up a localized string similar to Show ChangeLog. - ''' - Public ReadOnly Property Frm_Update_Str_02() As String - Get - Return ResourceManager.GetString("Frm_Update_Str_02", resourceCulture) - End Get - End Property - - ''' - ''' Looks up a localized string similar to Hide ChangeLog. - ''' - Public ReadOnly Property Frm_Update_Str_03() As String - Get - Return ResourceManager.GetString("Frm_Update_Str_03", resourceCulture) - End Get - End Property - - ''' - ''' Looks up a localized string similar to Update WinNUT-Client Now? - '''Ok to Close WinNut and Install New Version - '''Cancel to Save Msi and Install Later. - ''' - Public ReadOnly Property Frm_Update_Str_04() As String - Get - Return ResourceManager.GetString("Frm_Update_Str_04", resourceCulture) - End Get - End Property - - ''' - ''' Looks up a localized string similar to Download New Version from :. - ''' - Public ReadOnly Property Frm_Update_Str_05() As String - Get - Return ResourceManager.GetString("Frm_Update_Str_05", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to https://github.com/nutdotnet/WinNUT-Client. ''' @@ -688,6 +641,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Checking for update.... + ''' + Public ReadOnly Property LogCheckingForUpdate() As String + Get + Return ResourceManager.GetString("LogCheckingForUpdate", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Old preferences were not detected in your system.. ''' diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx index a8be22f..6994603 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.de-DE.resx @@ -18,21 +18,6 @@ Akkuladung: {0} Verbleibende Zeit: {1} - - Update verfügbar : Version {0} - - - Change-Log anzeigen - - - Change-Log ausblenden - - - WinNUT-Client jetzt aktualisieren? OK um WinNUT zu schließen und neue Version zu installieren Abbrechen um MSI-Datei zu speichern und später zu installieren - - - Neue Version herunterladen von : - Alte ups.ini importiert INI-Datei nach {0}.old verschoben diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx index 9cbc563..833f7c5 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.fr-FR.resx @@ -19,23 +19,6 @@ Charge Batterie : {0} Temps restant : {1} - - Mise à jour disponible : version {0} - - - Afficher ChangeLog - - - Cacher ChangeLog - - - Mettre à jour WinNUT-Client maintenant? -Ok pour fermer WinNut et installer une nouvelle version -Annuler pour enregistrer Msi et installer plus tard - - - Téléchargez la nouvelle version depuis : - Ancien Fichier "ups.ini" importé Fichier Ini déplacé vers {0}.old diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx index 8786915..0aa6d9c 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.resx @@ -265,26 +265,13 @@ Ini File Moved to {0}.old Battery_Charge : {0} Remaining Time : {1} - - Update Available : Version {0} - - - Show ChangeLog - - - Hide ChangeLog - - - Update WinNUT-Client Now? -Ok to Close WinNut and Install New Version -Cancel to Save Msi and Install Later - - - Download New Version from : - https://github.com/nutdotnet/WinNUT-Client + + Checking for update... + Inform the user that WinNUT is checking for an update. + WinNut Preferences Changed diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx index eab5879..d3a139f 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.ru-RU.resx @@ -64,23 +64,6 @@ Заряд : {0} Осталось времени : {1} - - Доступно обновление: Версия {0} - - - Показать список изменений - - - Скрыть список изменений - - - Обновить WinNUT сейчас? -"ОК" - закрыть WinNUT и установить новую версию. -"Отмена" - сохранить MSI и установить позже. - - - Скачать новую версию с: - Настройки WinNUT изменены diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx index 1a45d19..d96aae8 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.uk-UA.resx @@ -64,23 +64,6 @@ Заряд : {0} Залишилось часу : {1} - - Доступно оновлення: Версія {0} - - - Показати список змін - - - Приховати список змін - - - Оновити WinNUT зараз? -"ОК" - закрити WinNUT та встановити нову версію. -"Скасувати" - зберегти MSI та встановити пізніше. - - - Скачати нову версію с: - Налаштування WinNUT змінено diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx index 9969265..26b79a0 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-CN.resx @@ -59,23 +59,6 @@ Ini 文件重命名为 {0}.old 电池电量 : {0} 剩余时间 : {1} - - 可用的新版本:{0} - - - 显示更新日志 - - - 隐藏更新日志 - - - 立即更新WinNUT-Client吗? -单击确定以关闭WinNut并安装新版本 -取消以保存 Msi 并于稍后安装 - - - 下载了新版本于: - WinNut 设置已修改 diff --git a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx index 6af9c08..d8fa329 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx +++ b/WinNUT_V2/WinNUT-Client/My Project/Resources.zh-TW.resx @@ -63,21 +63,6 @@ 電池電量:{0} 剩餘時間:{1} - - 可用的新版本:{0} - - - 顯示更新日誌 - - - 隱藏更新日誌 - - - 您是否要立即更新 WinNUT Client?點選確定以關閉 WinNUT 並安裝新版本,點選取消以儲存 msi 檔案並於稍後手動安裝。 - - - 下載新版本來源: - WinNUT 設定已變更 diff --git a/WinNUT_V2/WinNUT-Client/My Project/Settings.Designer.vb b/WinNUT_V2/WinNUT-Client/My Project/Settings.Designer.vb index 1933ec7..4e2f6c4 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 @@ -138,18 +138,6 @@ Namespace My End Set End Property - _ - Public Property UP_AutoUpdate() As Boolean - Get - Return CType(Me("UP_AutoUpdate"),Boolean) - End Get - Set - Me("UP_AutoUpdate") = 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 6496226..13fdede 100644 --- a/WinNUT_V2/WinNUT-Client/My Project/Settings.settings +++ b/WinNUT_V2/WinNUT-Client/My Project/Settings.settings @@ -23,9 +23,6 @@ 0 - - False - False diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.Designer.vb b/WinNUT_V2/WinNUT-Client/Pref_Gui.Designer.vb index 18a237e..cf76326 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.Designer.vb +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.Designer.vb @@ -90,7 +90,6 @@ Partial Class Pref_Gui Me.Lbl_Branch_Update = New System.Windows.Forms.Label() Me.Lbl_Delay_Verif = New System.Windows.Forms.Label() Me.Cb_Update_At_Start = New System.Windows.Forms.CheckBox() - Me.Cb_Verify_Update = New System.Windows.Forms.CheckBox() Me.Btn_Ok = New System.Windows.Forms.Button() Me.Btn_Apply = New System.Windows.Forms.Button() Me.Btn_Cancel = New System.Windows.Forms.Button() @@ -534,7 +533,6 @@ Partial Class Pref_Gui Me.Tab_Update.Controls.Add(Me.Lbl_Branch_Update) Me.Tab_Update.Controls.Add(Me.Lbl_Delay_Verif) Me.Tab_Update.Controls.Add(Me.Cb_Update_At_Start) - Me.Tab_Update.Controls.Add(Me.Cb_Verify_Update) resources.ApplyResources(Me.Tab_Update, "Tab_Update") Me.Tab_Update.Name = "Tab_Update" Me.Tab_Update.UseVisualStyleBackColor = True @@ -572,13 +570,6 @@ Partial Class Pref_Gui Me.Pref_TlTip.SetToolTip(Me.Cb_Update_At_Start, resources.GetString("Cb_Update_At_Start.ToolTip")) Me.Cb_Update_At_Start.UseVisualStyleBackColor = True ' - 'Cb_Verify_Update - ' - resources.ApplyResources(Me.Cb_Verify_Update, "Cb_Verify_Update") - Me.Cb_Verify_Update.Name = "Cb_Verify_Update" - Me.Pref_TlTip.SetToolTip(Me.Cb_Verify_Update, resources.GetString("Cb_Verify_Update.ToolTip")) - Me.Cb_Verify_Update.UseVisualStyleBackColor = True - ' 'Btn_Ok ' resources.ApplyResources(Me.Btn_Ok, "Btn_Ok") @@ -593,11 +584,8 @@ Partial Class Pref_Gui ' 'Btn_Cancel ' - Me.Btn_Cancel.CausesValidation = False resources.ApplyResources(Me.Btn_Cancel, "Btn_Cancel") Me.Btn_Cancel.Name = "Btn_Cancel" - Me.Btn_Cancel.UseVisualStyleBackColor = True - Me.Btn_Cancel.UseWaitCursor = True ' 'Pref_Gui ' @@ -640,7 +628,6 @@ Partial Class Pref_Gui Friend WithEvents Tab_Update As TabPage Friend WithEvents Btn_Ok As Button Friend WithEvents Btn_Apply As Button - Friend WithEvents Btn_Cancel As Button Friend WithEvents Tb_Server_IP As TextBox Friend WithEvents Tb_Port As TextBox Friend WithEvents Tb_UPS_Name As TextBox @@ -689,7 +676,6 @@ Partial Class Pref_Gui Friend WithEvents Lbl_Branch_Update As Label Friend WithEvents Lbl_Delay_Verif As Label Friend WithEvents Cb_Update_At_Start As CheckBox - Friend WithEvents Cb_Verify_Update As CheckBox Friend WithEvents Tb_Pwd_Nut As TextBox Friend WithEvents Tb_Login_Nut As TextBox Friend WithEvents Label3 As Label @@ -698,4 +684,5 @@ Partial Class Pref_Gui Friend WithEvents CB_Follow_FSD As CheckBox Friend WithEvents pollingIntervalUnitLabel As Label Private WithEvents pollingIntervalValue As NumericUpDown + Private WithEvents Btn_Cancel As Button End Class diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.de-DE.resx b/WinNUT_V2/WinNUT-Client/Pref_Gui.de-DE.resx index d8d141b..dcc9006 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.de-DE.resx +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.de-DE.resx @@ -147,9 +147,6 @@ Beim Start auf Updates prüfen - - Auf Update prüfen - Aktualisieren @@ -258,9 +255,6 @@ Sucht beim Start nach Updates. - - Auf Updates prüfen. - Anmeldekennwort des NUT-Servers diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.fr-FR.resx b/WinNUT_V2/WinNUT-Client/Pref_Gui.fr-FR.resx index 1ad13ea..82a0fea 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.fr-FR.resx +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.fr-FR.resx @@ -153,9 +153,6 @@ inférieur à Vérifier la mise à jour au Démarrage - - Vérifier la mise à jour - Mise à jour @@ -278,9 +275,6 @@ Valeur acceptée: valeur numérique de 0 à 100. Vérifie les mises à jour au démarrage. - - Vérifiez les mises à jour. - Mot de Passe de connexion au serveur NUT diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.resx b/WinNUT_V2/WinNUT-Client/Pref_Gui.resx index 2a95068..5404739 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.resx +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.resx @@ -570,681 +570,6 @@ Accepted value: IPV4 / IPV6 / FQDN address. 0 - - Cbx_Freq_Input - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 0 - - - Tb_BattV_Max - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 1 - - - Tb_OutV_Max - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 2 - - - Tb_InF_Max - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 3 - - - Tb_BattV_Min - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 4 - - - Tb_OutV_Min - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 5 - - - Tb_InF_Min - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 6 - - - Tb_InV_Max - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 7 - - - Tb_InV_Min - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 8 - - - Lbl_Maxi - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 9 - - - Lbl_Mini - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 10 - - - Lbl_BattV - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 11 - - - Lbl_LoadUPS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 12 - - - Lbl_OutputV - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 13 - - - Lbl_InputF - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 14 - - - Lbl_PowerF - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 15 - - - Lbl_InputV - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Calibrage - - - 16 - - - 4, 22 - - - 3, 3, 3, 3 - - - 322, 234 - - - 1 - - - Calibration - - - Tab_Calibrage - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabControl_Options - - - 1 - - - Cbx_LogLevel - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 0 - - - Btn_DeleteLog - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 1 - - - Btn_ViewLog - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 2 - - - Lbl_LevelLog - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 3 - - - CB_Use_Logfile - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 4 - - - CB_Start_W_Win - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 5 - - - CB_Close_Tray - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 6 - - - CB_Start_Mini - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 7 - - - CB_Systray - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Miscellanous - - - 8 - - - 4, 22 - - - 322, 234 - - - 3 - - - Miscellanous - - - Tab_Miscellanous - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabControl_Options - - - 2 - - - CB_Follow_FSD - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 0 - - - Lbl_Percent - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 1 - - - Tb_GraceTime - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 2 - - - Cb_ExtendTime - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 3 - - - Tb_Delay_Stop - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 4 - - - Cbx_TypeStop - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 5 - - - Cb_ImmediateStop - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 6 - - - Tb_BattLimit_Time - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 7 - - - Tb_BattLimit_Load - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 8 - - - Lbl_GraceTime - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 9 - - - Lbl_Delay_Stop - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 10 - - - Lbl_StopType - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 11 - - - Lbl_BattLimit_Time - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 12 - - - Lbl_BattLimit_Load - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Shutdown - - - 13 - - - 4, 22 - - - 0, 0, 0, 0 - - - 322, 234 - - - 2 - - - Shutdown Options - - - Tab_Shutdown - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabControl_Options - - - 3 - - - Cbx_Branch_Update - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Update - - - 0 - - - Cbx_Delay_Verif - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Update - - - 1 - - - Lbl_Branch_Update - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Update - - - 2 - - - Lbl_Delay_Verif - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Update - - - 3 - - - Cb_Update_At_Start - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Update - - - 4 - - - Cb_Verify_Update - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Tab_Update - - - 5 - - - 4, 22 - - - 322, 234 - - - 4 - - - Update - - - Tab_Update - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TabControl_Options - - - 4 - - - 12, 12 - - - 330, 260 - - - 4 - - - TabControl_Options - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - 50 @@ -1706,6 +1031,33 @@ Accepted value: Numeric value from 0 to 999. 16 + + 4, 22 + + + 3, 3, 3, 3 + + + 322, 234 + + + 1 + + + Calibration + + + Tab_Calibrage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabControl_Options + + + 1 + Notice @@ -2015,6 +1367,30 @@ Accepted value: Numeric value from 0 to 999. 8 + + 4, 22 + + + 322, 234 + + + 3 + + + Miscellanous + + + Tab_Miscellanous + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabControl_Options + + + 2 + True @@ -2423,6 +1799,33 @@ Accepted value: Numeric value from 0 to 100. 13 + + 4, 22 + + + 0, 0, 0, 0 + + + 322, 234 + + + 2 + + + Shutdown Options + + + Tab_Shutdown + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TabControl_Options + + + 3 + Stable @@ -2430,7 +1833,7 @@ Accepted value: Numeric value from 0 to 100. Development - 196, 101 + 196, 63 120, 21 @@ -2463,7 +1866,7 @@ Accepted value: Numeric value from 0 to 100. Monthly - 196, 71 + 196, 36 120, 21 @@ -2490,7 +1893,7 @@ Accepted value: Numeric value from 0 to 100. True - 6, 102 + 3, 66 111, 13 @@ -2517,7 +1920,7 @@ Accepted value: Numeric value from 0 to 100. True - 6, 72 + 3, 39 134, 13 @@ -2547,7 +1950,7 @@ Accepted value: Numeric value from 0 to 100. MiddleRight - 6, 42 + 3, 13 310, 0 @@ -2576,41 +1979,50 @@ Accepted value: Numeric value from 0 to 100. 4 - - True + + 4, 22 - - MiddleRight + + 322, 234 - - 6, 12 + + 4 - - 310, 0 + + Update - - 310, 17 + + Tab_Update - - 0 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Verify Update + + TabControl_Options - - Check for updates. + + 4 - - Cb_Verify_Update + + 12, 12 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 330, 260 - - Tab_Update + + 4 - - 5 + + TabControl_Options + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 105, 278 diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.ru-RU.resx b/WinNUT_V2/WinNUT-Client/Pref_Gui.ru-RU.resx index 64d20c1..95912e2 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.ru-RU.resx +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.ru-RU.resx @@ -57,12 +57,6 @@ Проверяет обновления при запуске. - - Проверять обновления - - - Проверка обновлений. - Обновить diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.uk-UA.resx b/WinNUT_V2/WinNUT-Client/Pref_Gui.uk-UA.resx index 8ce04a0..5bb9510 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.uk-UA.resx +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.uk-UA.resx @@ -57,12 +57,6 @@ Перевіряє наявність оновлень під час запуску. - - Перевіряти оновлення - - - Перевірка оновлень. - Оновити diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.vb b/WinNUT_V2/WinNUT-Client/Pref_Gui.vb index 118b2b0..41708e9 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.vb +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.vb @@ -54,7 +54,6 @@ Public Class Pref_Gui My.Settings.PW_StopDelaySec = CInt(Tb_Delay_Stop.Text) My.Settings.PW_UserExtendStopTimer = Cb_ExtendTime.Checked My.Settings.PW_ExtendDelaySec = CInt(Tb_GraceTime.Text) - My.Settings.UP_AutoUpdate = Cb_Verify_Update.Checked My.Settings.UP_CheckAtStart = Cb_Update_At_Start.Checked My.Settings.UP_AutoChkDelay = Cbx_Delay_Verif.SelectedIndex My.Settings.UP_Branch = Cbx_Branch_Update.SelectedIndex @@ -132,7 +131,6 @@ Public Class Pref_Gui Tb_Delay_Stop.Text = My.Settings.PW_StopDelaySec Cb_ExtendTime.Checked = My.Settings.PW_UserExtendStopTimer Tb_GraceTime.Text = My.Settings.PW_ExtendDelaySec - Cb_Verify_Update.Checked = My.Settings.UP_AutoUpdate Cb_Update_At_Start.Checked = My.Settings.UP_CheckAtStart Cbx_Delay_Verif.SelectedIndex = My.Settings.UP_AutoChkDelay Cbx_Branch_Update.SelectedIndex = My.Settings.UP_Branch @@ -153,15 +151,8 @@ Public Class Pref_Gui Else Tb_GraceTime.Enabled = False End If - If Cb_Verify_Update.Checked Then - Cb_Update_At_Start.Enabled = True - Cbx_Delay_Verif.Enabled = True - Cbx_Branch_Update.Enabled = True - Else - Cb_Update_At_Start.Enabled = False - Cbx_Delay_Verif.Enabled = False - Cbx_Branch_Update.Enabled = False - End If + + Cb_Update_At_Start_CheckedChanged(Me, EventArgs.Empty) For Each TabCtrl In TabControl_Options.Controls.OfType(Of TabPage)() Dim TBoxes = TabCtrl.Controls.OfType(Of TextBox)() @@ -217,16 +208,8 @@ Public Class Pref_Gui End If End Sub - Private Sub Cb_Verify_Update_CheckedChanged(sender As Object, e As EventArgs) Handles Cb_Verify_Update.CheckedChanged - If Cb_Verify_Update.Checked Then - Cb_Update_At_Start.Enabled = True - Cbx_Delay_Verif.Enabled = True - Cbx_Branch_Update.Enabled = True - Else - Cb_Update_At_Start.Enabled = False - Cbx_Delay_Verif.Enabled = False - Cbx_Branch_Update.Enabled = False - End If + Private Sub Cb_Update_At_Start_CheckedChanged(sender As Object, e As EventArgs) Handles Cb_Update_At_Start.CheckedChanged + Cbx_Delay_Verif.Enabled = Cb_Update_At_Start.Checked End Sub Private Sub Number_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Tb_Port.Validating, Tb_OutV_Min.Validating, Tb_OutV_Max.Validating, Tb_InV_Min.Validating, Tb_InV_Max.Validating, Tb_InF_Min.Validating, Tb_InF_Max.Validating, Tb_GraceTime.Validating, Tb_Delay_Stop.Validating, Tb_BattV_Min.Validating, Tb_BattV_Max.Validating, Tb_BattLimit_Time.Validating, Tb_BattLimit_Load.Validating diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-CN.resx b/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-CN.resx index 0f0a667..b999212 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-CN.resx +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-CN.resx @@ -280,12 +280,6 @@ 在启动时检查更新。 - - 验证更新 - - - 检查应用更新。 - 确认 diff --git a/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-TW.resx b/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-TW.resx index 6b14f76..fb1a016 100644 --- a/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-TW.resx +++ b/WinNUT_V2/WinNUT-Client/Pref_Gui.zh-TW.resx @@ -30,9 +30,6 @@ 每天 - - 檢查更新 - 每週 @@ -255,9 +252,6 @@ 套用 - - 檢查應用程式更新。 - 選項 diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.Designer.vb b/WinNUT_V2/WinNUT-Client/Update_Gui.Designer.vb deleted file mode 100644 index 693326a..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.Designer.vb +++ /dev/null @@ -1,94 +0,0 @@ - _ -Partial Class Update_Gui - Inherits System.Windows.Forms.Form - - 'Form remplace la méthode Dispose pour nettoyer la liste des composants. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Requise par le Concepteur Windows Form - Private components As System.ComponentModel.IContainer - - 'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form - 'Elle peut être modifiée à l'aide du Concepteur Windows Form. - 'Ne la modifiez pas à l'aide de l'éditeur de code. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Update_Gui)) - Me.GB1 = New System.Windows.Forms.GroupBox() - Me.TB_ChgLog = New System.Windows.Forms.TextBox() - Me.Lbl = New System.Windows.Forms.Label() - Me.Update_Btn = New System.Windows.Forms.Button() - Me.ShowLog_Button = New System.Windows.Forms.Button() - Me.Close_Btn = New System.Windows.Forms.Button() - Me.GB1.SuspendLayout() - Me.SuspendLayout() - ' - 'GB1 - ' - resources.ApplyResources(Me.GB1, "GB1") - Me.GB1.Controls.Add(Me.TB_ChgLog) - Me.GB1.Controls.Add(Me.Lbl) - Me.GB1.Name = "GB1" - Me.GB1.TabStop = False - ' - 'TB_ChgLog - ' - resources.ApplyResources(Me.TB_ChgLog, "TB_ChgLog") - Me.TB_ChgLog.Name = "TB_ChgLog" - ' - 'Lbl - ' - resources.ApplyResources(Me.Lbl, "Lbl") - Me.Lbl.Name = "Lbl" - ' - 'Update_Btn - ' - resources.ApplyResources(Me.Update_Btn, "Update_Btn") - Me.Update_Btn.Name = "Update_Btn" - Me.Update_Btn.UseVisualStyleBackColor = True - ' - 'ShowLog_Button - ' - resources.ApplyResources(Me.ShowLog_Button, "ShowLog_Button") - Me.ShowLog_Button.Name = "ShowLog_Button" - Me.ShowLog_Button.UseVisualStyleBackColor = True - ' - 'Close_Btn - ' - resources.ApplyResources(Me.Close_Btn, "Close_Btn") - Me.Close_Btn.Name = "Close_Btn" - Me.Close_Btn.UseVisualStyleBackColor = True - ' - 'Update_Gui - ' - resources.ApplyResources(Me, "$this") - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.Close_Btn) - Me.Controls.Add(Me.GB1) - Me.Controls.Add(Me.Update_Btn) - Me.Controls.Add(Me.ShowLog_Button) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "Update_Gui" - Me.GB1.ResumeLayout(False) - Me.GB1.PerformLayout() - Me.ResumeLayout(False) - - End Sub - - Friend WithEvents GB1 As GroupBox - Friend WithEvents Lbl As Label - Friend WithEvents Close_Btn As Button - Friend WithEvents ShowLog_Button As Button - Friend WithEvents Update_Btn As Button - Friend WithEvents TB_ChgLog As TextBox -End Class diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.de-DE.resx b/WinNUT_V2/WinNUT-Client/Update_Gui.de-DE.resx deleted file mode 100644 index 0d07ad7..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.de-DE.resx +++ /dev/null @@ -1,30 +0,0 @@ - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Update verfügbar: Version {0} - - - Aktualisieren - - - Change-Log anzeigen - - - Schließen - - - Aktualisieren - - \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.fr-FR.resx b/WinNUT_V2/WinNUT-Client/Update_Gui.fr-FR.resx deleted file mode 100644 index ca342cb..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.fr-FR.resx +++ /dev/null @@ -1,30 +0,0 @@ - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Mise à jour disponible : version {0} - - - Mise à jour - - - Afficher ChangeLog - - - Fermer - - - Mise à jour - - \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.ru-RU.resx b/WinNUT_V2/WinNUT-Client/Update_Gui.ru-RU.resx deleted file mode 100644 index b954710..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.ru-RU.resx +++ /dev/null @@ -1,30 +0,0 @@ - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Доступно обновление: Версия {0} - - - Обновить - - - Показать список изменений - - - Закрыть - - - Обновить - - \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.uk-UA.resx b/WinNUT_V2/WinNUT-Client/Update_Gui.uk-UA.resx deleted file mode 100644 index 8e33b84..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.uk-UA.resx +++ /dev/null @@ -1,30 +0,0 @@ - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Доступно оновлення: Версія {0} - - - Оновити - - - Показати список змін - - - Закрити - - - Оновити - - \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.vb b/WinNUT_V2/WinNUT-Client/Update_Gui.vb deleted file mode 100644 index dfc0ec2..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.vb +++ /dev/null @@ -1,252 +0,0 @@ -' 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 LogLvl = WinNUT_Client_Common.LogLvl -Imports AppResxStr = WinNUT_Client_Common.AppResxStr -Imports WinNUT_Globals = WinNUT_Client_Common.WinNUT_Globals - -Public Class Update_Gui - - Private LogFile As WinNUT_Client_Common.Logger = WinNUT_Globals.LogFile - Private ChangeLogByteSize As Long - Private Const GitApiURL As String = "https://api.github.com/repos/nutdotnet/WinNUT-Client/releases" - Private WithEvents WebC As New Net.WebClient - Private JSONReleaseFile As Object - Private sChangeLog As String - Private ReadOnly ManualUpdate As Boolean = False - Private UpdateInfoRetrieved As Boolean = False - Private HasUpdate As Boolean = False - Private NewVersion As String = Nothing - Private NewVersionMsiURL As String - Private Download_Form As Form - Private DPBar As WinFormControls.CProgressBar - Private Dlbl As Label - - Public Sub New(Optional ByRef mUpdate As Boolean = False) - InitializeComponent() - ManualUpdate = mUpdate - End Sub - - Protected Overrides Sub SetVisibleCore(value As Boolean) - If UpdateInfoRetrieved Then - If HasUpdate Then - MyBase.SetVisibleCore(True) - Else - Close() - End If - Else - MyBase.SetVisibleCore(False) - WinNUT.NotifyIcon.Visible = False - Icon = WinNUT.Icon - ' LogFile = WinNUT.LogFile - VerifyUpdate() - End If - End Sub - - Public Function GetDownloadSize(ByVal URL As String) As Long - Net.ServicePointManager.Expect100Continue = True - Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls12 - Dim Req As Net.WebRequest = Net.WebRequest.Create(URL) - Req.Method = Net.WebRequestMethods.Http.Head - Using Resp = Req.GetResponse() - Return Resp.ContentLength - End Using - End Function - - Public Sub VerifyUpdate() - LogFile.LogTracing("Verify Update", LogLvl.LOG_DEBUG, Me) - If My.Settings.UP_AutoUpdate Or ManualUpdate Then - Dim DelayVerif As DateInterval = DateInterval.Month - Select Case My.Settings.UP_AutoChkDelay - Case 0 - DelayVerif = DateInterval.Day - Case 1 - DelayVerif = DateInterval.Weekday - Case 2 - DelayVerif = DateInterval.Month - End Select - Dim Today As Date = Now - Dim Diff As Integer = 1 - Dim lastCheckDate = My.Settings.UP_LastCheck - - If lastCheckDate <> Date.MinValue Then - Diff = DateDiff(DelayVerif, lastCheckDate, Today) - End If - - If Diff >= 1 Or ManualUpdate Then - Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls12 - WebC.Headers.Add(Net.HttpRequestHeader.Accept, "application/json") - WebC.Headers.Add(Net.HttpRequestHeader.UserAgent, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 OPR/73.0.3856.344") - WebC.Headers.Add(Net.HttpRequestHeader.AcceptLanguage, "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7") - AddHandler WebC.DownloadStringCompleted, AddressOf Changelog_Downloaded - WebC.DownloadStringAsync(New Uri(GitApiURL)) - Else - Close() - End If - End If - End Sub - - Private Sub Changelog_Downloaded(ByVal sender As Object, ByVal e As System.Net.DownloadStringCompletedEventArgs) - Dim ChangeLogDiff As String = Nothing - - Try - If (Not e.Cancelled And e.Error Is Nothing) Then - If e.Result.Length <> 0 Then - Dim JSONReleases = Newtonsoft.Json.JsonConvert.DeserializeObject(e.Result) - Dim HighestVersion As String = Nothing - Dim ActualVersion As Version = Version.Parse(WinNUT_Globals.ProgramVersion) - Dim sPattern As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex("[Vv](\d+\.\d+\.\d+\.?\d+).*$") - For Each JSONRelease In JSONReleases - Dim PreRelease = Convert.ToBoolean(JSONRelease("prerelease").ToString) - Dim DraftRelease = Convert.ToBoolean(JSONRelease("draft").ToString) - Dim ReleaseName = JSONRelease("name") - Dim RegExVersion = sPattern.Match(ReleaseName) - - If Not DraftRelease And ((PreRelease And My.Settings.UP_Branch = 1) Or Not PreRelease) Then - If RegExVersion.Groups.Count > 1 Then - Dim ReleaseVersion As Version = Version.Parse(RegExVersion.Groups(1).Value) - If ActualVersion.CompareTo(ReleaseVersion) = -1 Then - If HighestVersion = Nothing Or (HighestVersion <> Nothing AndAlso ReleaseVersion.CompareTo(Version.Parse(HighestVersion))) > 0 Then - HighestVersion = RegExVersion.Groups(1).Value - NewVersion = HighestVersion - ChangeLogDiff = "Changelog :" & vbNewLine - ChangeLogDiff &= WinNUT_Globals.ProgramVersion & " => " & ReleaseVersion.ToString & vbNewLine - NewVersionMsiURL = JSONRelease("assets")(0)("browser_download_url").ToString - End If - ChangeLogDiff &= vbNewLine & ReleaseName & vbNewLine & JSONRelease("body").ToString & vbNewLine - End If - End If - ElseIf Not DraftRelease Then - ChangeLogDiff &= vbNewLine & ReleaseName & vbNewLine & JSONRelease("body").ToString & vbNewLine - End If - Next - If ChangeLogDiff IsNot Nothing And NewVersionMsiURL IsNot Nothing Then - sChangeLog = ChangeLogDiff - HasUpdate = True - LogFile.LogTracing(String.Format("New Version Available : {0}", NewVersion), LogLvl.LOG_DEBUG, Me, String.Format(WinNUT_Globals.StrLog.Item(AppResxStr.STR_LOG_UPDATE), NewVersion)) - Else - HighestVersion = Nothing - LogFile.LogTracing("No Update Available", LogLvl.LOG_DEBUG, Me, WinNUT_Globals.StrLog.Item(AppResxStr.STR_LOG_NO_UPDATE)) - End If - End If - End If - Catch excep As Exception - LogFile.LogTracing(excep.Message, LogLvl.LOG_ERROR, Me) - End Try - - My.Settings.UP_LastCheck = Date.Now - My.Settings.Save() - UpdateInfoRetrieved = True - Show() - End Sub - - Private Sub Update_Gui_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown - TB_ChgLog.Text = sChangeLog - TB_ChgLog.Visible = False - Lbl.Text = String.Format(WinNUT_Globals.StrLog.Item(AppResxStr.STR_UP_AVAIL), NewVersion) - GB1.Size = New Point(GB1.Size.Width, GB1.Size.Height - 160) - Update_Btn.Location = New Point(Update_Btn.Location.X, Update_Btn.Location.Y - 160) - ShowLog_Button.Location = New Point(ShowLog_Button.Location.X, ShowLog_Button.Location.Y - 160) - Close_Btn.Location = New Point(Close_Btn.Location.X, Close_Btn.Location.Y - 160) - Size = New Point(Size.Width, Size.Height - 160) - End Sub - - Private Sub Close_Btn_Click(sender As Object, e As EventArgs) Handles Close_Btn.Click - Close() - End Sub - - Private Sub ShowLog_Button_Click(sender As Object, e As EventArgs) Handles ShowLog_Button.Click - If TB_ChgLog.Visible Then - TB_ChgLog.Visible = False - ShowLog_Button.Text = WinNUT_Globals.StrLog.Item(AppResxStr.STR_UP_SHOW) - GB1.Size = New Point(GB1.Size.Width, GB1.Size.Height - 160) - Update_Btn.Location = New Point(Update_Btn.Location.X, Update_Btn.Location.Y - 160) - ShowLog_Button.Location = New Point(ShowLog_Button.Location.X, ShowLog_Button.Location.Y - 160) - Close_Btn.Location = New Point(Close_Btn.Location.X, Close_Btn.Location.Y - 160) - Size = New Point(Size.Width, Size.Height - 160) - Else - TB_ChgLog.Visible = True - ShowLog_Button.Text = WinNUT_Globals.StrLog.Item(AppResxStr.STR_UP_SHOW) - GB1.Size = New Point(GB1.Size.Width, GB1.Size.Height + 160) - Update_Btn.Location = New Point(Update_Btn.Location.X, Update_Btn.Location.Y + 160) - ShowLog_Button.Location = New Point(ShowLog_Button.Location.X, ShowLog_Button.Location.Y + 160) - Close_Btn.Location = New Point(Close_Btn.Location.X, Close_Btn.Location.Y + 160) - Size = New Point(Size.Width, Size.Height + 160) - End If - End Sub - - Private Sub Update_Btn_Click(sender As Object, e As EventArgs) Handles Update_Btn.Click - Dim MSIURL As String = Nothing - MSIURL = NewVersionMsiURL - Download_Form = New Form - DPBar = New WinFormControls.CProgressBar - Dlbl = New Label - - With Download_Form - .Icon = Icon - .Size = New Point(320, 150) - .FormBorderStyle = FormBorderStyle.Sizable - .MaximizeBox = False - .MinimizeBox = False - .Controls.Add(DPBar) - .Controls.Add(Dlbl) - .StartPosition = FormStartPosition.CenterParent - End With - With DPBar - .Location = New Point(12, 80) - .Style = ProgressBarStyle.Continuous - .Size = New Point(280, .Size.Height) - .ForeColor = Color.Black - End With - With Dlbl - .Location = New Point(12, 20) - .TextAlign = ContentAlignment.MiddleCenter - .Text = WinNUT_Globals.StrLog.Item(AppResxStr.STR_UP_DOWNFROM) & vbNewLine & MSIURL - .Size = New Point(280, (.Size.Height * 2)) - End With - Download_Form.Show() - Dim MSIFile = IO.Path.GetTempPath() + "WinNUT_" & NewVersion & "_Setup.msi" - - Using WebC = New Net.WebClient - Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls12 - AddHandler WebC.DownloadFileCompleted, AddressOf New_Version_Downloaded - AddHandler WebC.DownloadProgressChanged, AddressOf Update_DPBar - WebC.QueryString.Add("FileName", MSIFile) - WebC.DownloadFileAsync(New Uri(MSIURL), MSIFile) - End Using - End Sub - - Private Sub Update_DPBar(sender As Object, e As System.Net.DownloadProgressChangedEventArgs) - DPBar.Value = 90 * (e.ProgressPercentage / 100) - DPBar.Text = String.Format("{0:N}Kb / {1:N}Kb", (e.BytesReceived / 1024), (e.TotalBytesToReceive / 1024)) - End Sub - - Private Sub New_Version_Downloaded(sender As Object, e As System.ComponentModel.AsyncCompletedEventArgs) - Dim Filename = sender.QueryString.Item("FileName") - Select Case MsgBox(WinNUT_Globals.StrLog.Item(AppResxStr.STR_UP_UPMSG), vbOKCancel, "Update Now") - Case vbOK - DPBar.Value = 100 - Process.Start(Filename) - End - Case vbCancel - Dim SaveFile As SaveFileDialog = New SaveFileDialog - With SaveFile - .Filter = "MSI Files (*.msi)|*.msi" - .FileName = IO.Path.GetFileName(Filename) - End With - If SaveFile.ShowDialog() = DialogResult.OK Then - My.Computer.FileSystem.MoveFile(Filename, SaveFile.FileName, True) - End If - DPBar.Value = 100 - Threading.Thread.Sleep(1000) - Download_Form.Close() - Close() - End Select - End Sub -End Class diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.zh-CN.resx b/WinNUT_V2/WinNUT-Client/Update_Gui.zh-CN.resx deleted file mode 100644 index 7f2b67d..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.zh-CN.resx +++ /dev/null @@ -1,30 +0,0 @@ - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 可用的新版本:{0} - - - 更新 - - - 显示更新日志 - - - 关闭 - - - 更新 - - \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/Update_Gui.zh-TW.resx b/WinNUT_V2/WinNUT-Client/Update_Gui.zh-TW.resx deleted file mode 100644 index d65adf1..0000000 --- a/WinNUT_V2/WinNUT-Client/Update_Gui.zh-TW.resx +++ /dev/null @@ -1,30 +0,0 @@ - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 顯示更新日誌 - - - 更新 - - - 更新 - - - 可用的新版本:{0} - - - 關閉 - - \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj index 65049f4..b23c725 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj +++ b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj @@ -165,10 +165,10 @@ Resources.resx - - Update_Gui.vb + + UpdateAvailableForm.vb - + Form @@ -306,26 +306,26 @@ Shutdown_Gui.vb - - Update_Gui.vb + + UpdateAvailableForm.vb - - Update_Gui.vb + + UpdateAvailableForm.vb - - Update_Gui.vb + + UpdateAvailableForm.vb - - Update_Gui.vb + + UpdateAvailableForm.vb - - Update_Gui.vb + + UpdateAvailableForm.vb - - Update_Gui.vb + + UpdateAvailableForm.vb - - Update_Gui.vb + + UpdateAvailableForm.vb UpgradePrefsDialog.vb @@ -466,11 +466,13 @@ 13.0.3 + + 13.0.1 + - diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index 1cab472..51c84de 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -1,13 +1,4 @@ -' 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 WinNUT_Client_Common +Imports WinNUT_Client_Common Public Class WinNUT #Region "Properties" @@ -35,7 +26,6 @@ Public Class WinNUT Private UPS_MaxRetry As Integer = 30 'Variable used with Toast Functionnality - Public WithEvents FrmBuild As Update_Gui Public ToastPopup As New ToastPopup Private WindowsVersion As Version = Version.Parse(My.Computer.Info.OSVersion) Private MinOsVersionToast As Version = Version.Parse("10.0.18362.0") @@ -96,13 +86,6 @@ Public Class WinNUT StrLog.Insert(AppResxStr.STR_MAIN_EXITSLEEP, My.Resources.Frm_Main_Str_14) StrLog.Insert(AppResxStr.STR_MAIN_GOTOSLEEP, My.Resources.Frm_Main_Str_15) - 'Add Update Gui's Strings - StrLog.Insert(AppResxStr.STR_UP_AVAIL, My.Resources.Frm_Update_Str_01) - StrLog.Insert(AppResxStr.STR_UP_SHOW, My.Resources.Frm_Update_Str_02) - StrLog.Insert(AppResxStr.STR_UP_HIDE, My.Resources.Frm_Update_Str_03) - StrLog.Insert(AppResxStr.STR_UP_UPMSG, My.Resources.Frm_Update_Str_04) - StrLog.Insert(AppResxStr.STR_UP_DOWNFROM, My.Resources.Frm_Update_Str_05) - 'Add Shutdown Gui's Strings StrLog.Insert(AppResxStr.STR_SHUT_STAT, My.Resources.Frm_Shutdown_Str_01) @@ -188,6 +171,7 @@ 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() ' If this is the first time WinNUT has been launched with the Settings system, check if old preferences exist @@ -199,13 +183,11 @@ Public Class WinNUT RunRegPrefsUpgrade() End If + AddHandler UpdateController.UpdateCheckCompleted, AddressOf OnCheckForUpdateCompleted 'Run Update - If My.Settings.UP_AutoUpdate And My.Settings.UP_CheckAtStart Then - LogFile.LogTracing("Run Automatic Update", LogLvl.LOG_DEBUG, Me) - Dim Update_Frm = New Update_Gui() - Update_Frm.Activate() - Update_Frm.Visible = True - HasFocus = False + If My.Settings.UP_CheckAtStart AndAlso Updater.UpdateUtil.UpdateCheckDelayPassed(My.Settings.UP_AutoChkDelay, My.Settings.UP_LastCheck) Then + LogFile.LogTracing("Auto update delay passed, checking for updates...", LogLvl.LOG_DEBUG, Me) + StartUpdateCheck() End If AddHandler Microsoft.Win32.SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged @@ -327,6 +309,7 @@ Public Class WinNUT End Sub #End Region + Private Sub SystemEvents_PowerModeChanged(sender As Object, e As Microsoft.Win32.PowerModeChangedEventArgs) LogFile.LogTracing("PowerModeChangedEvent: " & [Enum].GetName(GetType(Microsoft.Win32.PowerModes), e.Mode), LogLvl.LOG_NOTICE, Me) Select Case e.Mode @@ -1033,19 +1016,52 @@ Public Class WinNUT #End If End Sub + Private Sub ManageOldPrefsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ManageOldPrefsToolStripMenuItem.Click + RunRegPrefsUpgrade() + End Sub + Private Sub Menu_Update_Click(sender As Object, e As EventArgs) Handles Menu_Update.Click - 'Dim th As System.Threading.Thread = New Threading.Thread(New System.Threading.ParameterizedThreadStart(AddressOf Run_Update)) - 'th.SetApartmentState(System.Threading.ApartmentState.STA) - 'th.Start(Me.UpdateMethod) - LogFile.LogTracing("Open About Gui From Menu", LogLvl.LOG_DEBUG, Me) - Dim Update_Frm = New Update_Gui(True) - Update_Frm.Activate() - Update_Frm.Visible = True - HasFocus = False + LogFile.LogTracing("Check for update menu item clicked.", LogLvl.LOG_DEBUG, Me) + StartUpdateCheck() End Sub - Private Sub ManageOldPrefsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ManageOldPrefsToolStripMenuItem.Click - RunRegPrefsUpgrade() + Private Sub StartUpdateCheck() + LogFile.LogTracing("Beginning update check in background...", LogLvl.LOG_NOTICE, Me, My.Resources.LogCheckingForUpdate) + UpdateController.BeginUpdateCheck(My.Settings.UP_Branch = 1) + End Sub + + Private Sub OnCheckForUpdateCompleted(sender As Updater.UpdateUtil, eventArgs As Updater.UpdateCheckCompletedEventArgs) + LogFile.LogTracing("UpdateCheckCompleted event firing.", LogLvl.LOG_DEBUG, Me) + My.Settings.UP_LastCheck = Date.Now + My.Settings.Save() + + If eventArgs.LatestRelease Is Nothing Then + LogFile.LogTracing($"No updates matching the parameter (acceptPreRelease = {My.Settings.UP_Branch = 1}) were found.", + LogLvl.LOG_NOTICE, Me, StrLog.Item(AppResxStr.STR_LOG_NO_UPDATE)) + If eventArgs.Error IsNot Nothing Then + LogFile.LogTracing("CheckForUpdate reported an error:", LogLvl.LOG_ERROR, Me) + LogFile.LogException(eventArgs.Error, Me) + End If + + Return + Else + If New Version(eventArgs.LatestRelease.TagName.Substring(1)) <= New Version(ProgramVersion) Then + LogFile.LogTracing("No newer version available.", LogLvl.LOG_NOTICE, Me, + StrLog(AppResxStr.STR_LOG_NO_UPDATE)) + Return + ElseIf UpdateController.LatestReleaseAsset Is Nothing Then + LogFile.LogTracing("New update was found on GitHub, but no valid Release Asset was attached.", + LogLvl.LOG_ERROR, Me, StrLog.Item(AppResxStr.STR_LOG_NO_UPDATE)) + Return + End If + End If + + LogFile.LogTracing($"New update found: { eventArgs.LatestRelease.Name }", LogLvl.LOG_NOTICE, Me, + String.Format(StrLog(AppResxStr.STR_LOG_UPDATE), eventArgs.LatestRelease.Name)) + + Dim Update_Frm = New Forms.UpdateAvailableForm() + Update_Frm.Show() + HasFocus = False End Sub End Class diff --git a/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb b/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb index 648da9e..2d2da7f 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Common_Enums.vb @@ -46,11 +46,6 @@ Public Enum AppResxStr STR_MAIN_INVALIDLOGIN STR_MAIN_EXITSLEEP STR_MAIN_GOTOSLEEP - STR_UP_AVAIL - STR_UP_SHOW - STR_UP_HIDE - STR_UP_UPMSG - STR_UP_DOWNFROM STR_SHUT_STAT STR_APP_SHUT STR_LOG_PREFS From fb02c364781084d976499cb250385aca2ce61d0f Mon Sep 17 00:00:00 2001 From: gbakeman Date: Sat, 10 Aug 2024 13:49:33 -0400 Subject: [PATCH 5/6] Small WinNUT.vb corrections Corrected references, and fixed a String.Format call. --- WinNUT_V2/WinNUT-Client/WinNUT.vb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/WinNUT_V2/WinNUT-Client/WinNUT.vb b/WinNUT_V2/WinNUT-Client/WinNUT.vb index b5e442e..b222db2 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT.vb +++ b/WinNUT_V2/WinNUT-Client/WinNUT.vb @@ -1,4 +1,4 @@ -Imports WinNUT_Client_Common +Imports WinNUT_Client_Common Public Class WinNUT #Region "Properties" @@ -189,12 +189,11 @@ Public Class WinNUT StartUpdateCheck() End If - AddHandler SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged + AddHandler Microsoft.Win32.SystemEvents.PowerModeChanged, AddressOf SystemEvents_PowerModeChanged AddHandler RequestConnect, AddressOf UPS_Connect AddHandler My.Settings.PropertyChanged, AddressOf SettingsPropertyChanged - LogFile.LogTracing(String.Format("WinNUT Form completed Load.", My.Application.Info.ProductName, My.Application.Info.Version), - LogLvl.LOG_NOTICE, Me) + LogFile.LogTracing("WinNUT Form completed Load.", LogLvl.LOG_NOTICE, Me) End Sub ''' @@ -310,7 +309,7 @@ Public Class WinNUT #End Region - Private Sub SettingsPropertyChanged(sender As Object, e As PropertyChangedEventArgs) + Private Sub SettingsPropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs) LogFile.LogTracing("SettingsPropertyChanged: " & e.PropertyName, LogLvl.LOG_DEBUG, Me) UpdateMainMenuState() From f9971158b2c5dcf496f5e0ea346738b412901d88 Mon Sep 17 00:00:00 2001 From: gbakeman Date: Sat, 10 Aug 2024 16:33:12 -0400 Subject: [PATCH 6/6] Upgrade Common proj. to PackageReferences - Upgrade Common project file to PackageReferences type to try to fix the Octokit library error. - Disable ClickOnce publishing again - Fix Logger writing to a number '3' folder in DEBUG mode --- WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj | 1 - WinNUT_V2/WinNUT-Client_Common/Logger.vb | 4 ++-- .../WinNUT-Client_Common/WinNUT-Client_Common.vbproj | 9 +++++---- WinNUT_V2/WinNUT-Client_Common/packages.config | 4 ---- 4 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 WinNUT_V2/WinNUT-Client_Common/packages.config diff --git a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj index 92975c7..b17c9a8 100644 --- a/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj +++ b/WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj @@ -14,7 +14,6 @@ v4.8 false - publish\ true Disk false diff --git a/WinNUT_V2/WinNUT-Client_Common/Logger.vb b/WinNUT_V2/WinNUT-Client_Common/Logger.vb index da5aaa8..2cf31bd 100644 --- a/WinNUT_V2/WinNUT-Client_Common/Logger.vb +++ b/WinNUT_V2/WinNUT-Client_Common/Logger.vb @@ -18,9 +18,9 @@ Public Class Logger Private Const LOG_FILE_CREATION_SCHEDULE = LogFileCreationScheduleOption.Daily ' Set TEST_RELEASE_DIRS in the custom compiler constants dialog for file storage to behave like release. -#If DEBUG And Not TEST_RELEASE_DIRS Then +#If DEBUG AndAlso Not TEST_RELEASE_DIRS Then Private Shared ReadOnly DEFAULT_DATETIMEFORMAT = DateTimeFormatInfo.InvariantInfo - Private Shared ReadOnly DEFAULT_LOCATION = LogFileLocation.ExecutableDirectory + Private Shared ReadOnly DEFAULT_LOCATION = Application.StartupPath #Else Private Shared ReadOnly DEFAULT_DATETIMEFORMAT = DateTimeFormatInfo.CurrentInfo Private Shared ReadOnly DEFAULT_LOCATION = Application.LocalUserAppDataPath diff --git a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj index dff0c09..3747b60 100644 --- a/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj +++ b/WinNUT_V2/WinNUT-Client_Common/WinNUT-Client_Common.vbproj @@ -61,9 +61,6 @@ true - - ..\packages\Octokit.13.0.1\lib\netstandard2.0\Octokit.dll - @@ -131,7 +128,11 @@ MyApplicationCodeGenerator Application.Designer.vb - + + + + 13.0.1 + \ No newline at end of file diff --git a/WinNUT_V2/WinNUT-Client_Common/packages.config b/WinNUT_V2/WinNUT-Client_Common/packages.config deleted file mode 100644 index e6bb536..0000000 --- a/WinNUT_V2/WinNUT-Client_Common/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file