Begin to make serverselect a dialog

This commit is contained in:
Nick Bisby 2019-03-02 16:03:11 -06:00
parent 1b635a3b3b
commit 3f59699c70
No known key found for this signature in database
GPG Key ID: F6E0C4E6D0B5EB36
3 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="ServerSelection" extends="Scene">
<component name="ServerSelection" extends="dialog">
<children>
<label text="Connect to Server"
height="70"

View File

@ -33,6 +33,8 @@ function APIRequest(url as String, params={} as Object)
end function
function parseRequest(req)
'req.retainBodyOnError(True)
'print req.GetToString()
json = ParseJson(req.GetToString())
return json
end function

View File

@ -3,21 +3,27 @@ sub Main()
screen = CreateObject("roSGScreen")
screen.setMessagePort(m.port)
m.scene = screen.CreateScene("Library")
m.screen = screen
screen.show()
if get_setting("server") = invalid then
print "Get server details"
' TODO - make this into a dialog
' TODO - be able to submit server info
' ShowServerSelect()
end if
if get_setting("active_user") = invalid then
print "Get user login"
' TODO - make this into a dialog
' screen.CreateScene("UserSignIn")
' TODO - sign in here
end if
' TODO - something here to validate that the active_user is still
' valid.
library = m.scene.findNode("LibrarySelect")
libs = LibraryList()
library.libList = libs
@ -32,10 +38,9 @@ sub Main()
end sub
sub ShowServerSelect()
screen = CreateObject("roSGScreen")
screen.setMessagePort(m.port)
scene = screen.CreateScene("ServerSelection")
screen.show()
dialog = CreateObject("roSGNode", "ServerSelection")
dialog.title = "Select Server"
m.scene.dialog = dialog
await_response()
end sub