Skip to content

Commit

Permalink
use JFScene spinner instead of progress dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Nov 22, 2023
1 parent 4e81dda commit c714bc2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
3 changes: 3 additions & 0 deletions components/login/UserSelect.bs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import "pkg:/source/utils/misc.bs"

sub init()
m.top.optionsAvailable = false
end sub

sub itemContentChanged()
stopLoadingSpinner()
m.top.findNode("UserRow").ItemContent = m.top.itemContent
redraw()
end sub
Expand Down
14 changes: 4 additions & 10 deletions source/ShowScenes.bs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ function LoginFlow()

invalidServer = true
if not startOver
' Show Connecting to Server spinner
dialog = createObject("roSGNode", "ProgressDialog")
dialog.title = tr("Connecting to Server")
m.scene.dialog = dialog
m.scene.isLoading = true
invalidServer = ServerInfo().Error
dialog.close = true
m.scene.isLoading = false
end if

m.serverSelection = "Saved"
Expand Down Expand Up @@ -302,10 +299,7 @@ function CreateServerGroup()
else if type(msg) = "roSGNodeEvent"
node = msg.getNode()
if node = "submit"
' Show Connecting to Server spinner
dialog = createObject("roSGNode", "ProgressDialog")
dialog.title = tr("Connecting to Server")
m.scene.dialog = dialog
m.scene.isLoading = true

serverUrl = inferServerUrl(screen.serverUrl)

Expand All @@ -321,7 +315,7 @@ function CreateServerGroup()
end if
set_setting("server", serverUrl)
end if
dialog.close = true
m.scene.isLoading = false

if isConnected = false or serverInfoResult = invalid
' Maybe don't unset setting, but offer as a prompt
Expand Down
4 changes: 2 additions & 2 deletions source/utils/misc.bs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ sub startLoadingSpinner(disableRemote = true as boolean)
end if

if not m.scene.isLoading
m.scene.isLoading = true
m.scene.disableRemote = disableRemote
m.scene.isLoading = true
end if
end sub

Expand All @@ -473,8 +473,8 @@ sub stopLoadingSpinner()
end if

if m.scene.isLoading
m.scene.isLoading = false
m.scene.disableRemote = false
m.scene.isLoading = false
end if
end sub

Expand Down

0 comments on commit c714bc2

Please sign in to comment.