From c714bc29e5784a269b68917c27dd09b826b1e917 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Wed, 22 Nov 2023 15:28:10 -0500 Subject: [PATCH] use JFScene spinner instead of progress dialog --- components/login/UserSelect.bs | 3 +++ source/ShowScenes.bs | 14 ++++---------- source/utils/misc.bs | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/components/login/UserSelect.bs b/components/login/UserSelect.bs index 81faad141..02ab03d38 100644 --- a/components/login/UserSelect.bs +++ b/components/login/UserSelect.bs @@ -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 diff --git a/source/ShowScenes.bs b/source/ShowScenes.bs index c5cbf977e..1d3b9fe87 100644 --- a/source/ShowScenes.bs +++ b/source/ShowScenes.bs @@ -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" @@ -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) @@ -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 diff --git a/source/utils/misc.bs b/source/utils/misc.bs index 27d2866b7..7cd621f47 100644 --- a/source/utils/misc.bs +++ b/source/utils/misc.bs @@ -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 @@ -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