Zooflow: Improve frmServiceConfig, Init Errors Handling, Hide Backnavigation in Results
This commit is contained in:
@@ -5,6 +5,12 @@ Public Class frmServiceConfig
|
||||
Private Client As Client
|
||||
Private Logger As Logger
|
||||
|
||||
Private Const STATUS_CONNECTED = "Connection Established"
|
||||
Private Const STATUS_CONNECTING = "Trying to create connection..."
|
||||
Private Const STATUS_FAILED = "Connection Failed!"
|
||||
|
||||
Private ConnectionChanged As Boolean = False
|
||||
|
||||
Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Logger = My.LogConfig.GetLogger()
|
||||
|
||||
@@ -14,6 +20,10 @@ Public Class frmServiceConfig
|
||||
txtServicePort.Text = oAddress.Item2
|
||||
End If
|
||||
|
||||
If My.Application.Service.IsActive Then
|
||||
txtStatus.Text = STATUS_CONNECTED
|
||||
End If
|
||||
|
||||
txtServiceAddress.Focus()
|
||||
End Sub
|
||||
|
||||
@@ -25,16 +35,16 @@ Public Class frmServiceConfig
|
||||
|
||||
Client = New Client(My.LogConfig, oIPAddress, oPort)
|
||||
|
||||
lblStatus.Text = "Trying to create connection..."
|
||||
txtStatus.Text = STATUS_CONNECTING
|
||||
Dim oResult = Client.Connect()
|
||||
|
||||
If oResult = True Then
|
||||
My.SystemConfig.AppServerConfig = $"{oIPAddress}:{oPort.ToString}"
|
||||
My.SystemConfig.AppServerConfig = $"{oIPAddress}:{oPort}"
|
||||
My.SystemConfigManager.Save()
|
||||
lblStatus.Text = "Successfully Connected to service"
|
||||
txtStatus.Text = STATUS_CONNECTED
|
||||
|
||||
Else
|
||||
lblStatus.Text = "Connection not successful."
|
||||
txtStatus.Text = STATUS_FAILED
|
||||
' TODO: Make a connection test that is as elaborate as this one :D
|
||||
'Select Case oResult
|
||||
' Case ClassService.ConnectionTestResult.NotFound
|
||||
|
||||
Reference in New Issue
Block a user