Only show button for 10.8 servers for now.

This commit is contained in:
Jimi 2022-05-30 21:00:03 -06:00 committed by Cody Robibero
parent 771477d6b1
commit d9881e9208
2 changed files with 21 additions and 15 deletions

View File

@ -14,11 +14,9 @@
<Button <Button
id="submit" id="submit"
text="Submit" text="Submit"
showFocusFootprint="false"
translation="[150, 550]" /> translation="[150, 550]" />
<Button <Button
id="quickConnect" id="quickConnect"
showFocusFootprint="false"
translation="[550, 550]" translation="[550, 550]"
/> />
<label text="" <label text=""

View File

@ -50,33 +50,33 @@ function CreateServerGroup()
dialog.title = tr("Connecting to Server") dialog.title = tr("Connecting to Server")
m.scene.dialog = dialog m.scene.dialog = dialog
serverInfoResult = ServerInfo() m.serverInfoResult = ServerInfo()
dialog.close = true dialog.close = true
if serverInfoResult = invalid if m.serverInfoResult = invalid
' Maybe don't unset setting, but offer as a prompt ' Maybe don't unset setting, but offer as a prompt
' Server not found, is it online? New values / Retry ' Server not found, is it online? New values / Retry
print "Server not found, is it online? New values / Retry" print "Server not found, is it online? New values / Retry"
screen.errorMessage = tr("Server not found, is it online?") screen.errorMessage = tr("Server not found, is it online?")
SignOut(false) SignOut(false)
else if serverInfoResult.Error <> invalid and serverInfoResult.Error else if m.serverInfoResult.Error <> invalid and m.serverInfoResult.Error
' If server redirected received, update the URL ' If server redirected received, update the URL
if serverInfoResult.UpdatedUrl <> invalid if m.serverInfoResult.UpdatedUrl <> invalid
serverUrl = serverInfoResult.UpdatedUrl serverUrl = m.serverInfoResult.UpdatedUrl
set_setting("server", serverUrl) set_setting("server", serverUrl)
end if end if
' Display Error Message to user ' Display Error Message to user
message = tr("Error: ") message = tr("Error: ")
if serverInfoResult.ErrorCode <> invalid if m.serverInfoResult.ErrorCode <> invalid
message = message + "[" + serverInfoResult.ErrorCode.toStr() + "] " message = message + "[" + m.serverInfoResult.ErrorCode.toStr() + "] "
end if end if
screen.errorMessage = message + tr(serverInfoResult.ErrorMessage) screen.errorMessage = message + tr(m.serverInfoResult.ErrorMessage)
SignOut(false) SignOut(false)
else else
screen.visible = false screen.visible = false
if serverInfoResult.serverName <> invalid if m.serverInfoResult.serverName <> invalid
return serverInfoResult.ServerName + " (Saved)" return m.serverInfoResult.ServerName + " (Saved)"
else else
return "Saved" return "Saved"
end if end if
@ -185,10 +185,18 @@ function CreateSigninGroup(user = "")
items.appendChild(saveCheckBox) items.appendChild(saveCheckBox)
checkbox.content = items checkbox.content = items
checkbox.checkedState = [true] checkbox.checkedState = [true]
' Add option for Quick Connect
quickConnect = group.findNode("quickConnect") quickConnect = group.findNode("quickConnect")
if m.serverInfoResult = invalid
m.serverInfoResult = ServerInfo()
end if
' Quick Connect only supported for server version 10.8+ right now...
if InStr(1, m.serverInfoResult.Version, "10.7") = 0
' Add option for Quick Connect
quickConnect.text = tr("Quick Connect") quickConnect.text = tr("Quick Connect")
quickConnect.observeField("buttonSelected", port) quickConnect.observeField("buttonSelected", port)
else
quickConnect.visible = false
end if
items = [username_field, password_field] items = [username_field, password_field]
config.configItems = items config.configItems = items