Skip to content

Commit b6d084d

Browse files
committed
WIP add spinner and raise questions
1 parent 61176f0 commit b6d084d

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

python/tank/authentication/login_dialog.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,17 @@ def __init__(
337337

338338
self.confirm_box.setStyleSheet(self.styleSheet())
339339

340+
# Init UI Spinner
341+
self.ui.message.setText("Retrieving the site information...")
342+
self.ui.spinner_movie = QtGui.QMovie(
343+
":/spinning_wheel/spinning_wheel.gif"
344+
)
345+
if self.ui.spinner_movie.loopCount() != -1:
346+
self.ui.spinner_movie.finished.connect(self.ui.spinner_movie.start)
347+
348+
self.ui.spinner.setMovie(self.ui.spinner_movie)
349+
350+
340351
def __del__(self):
341352
"""
342353
Destructor.
@@ -472,6 +483,7 @@ def _link_activated(self, site=None):
472483
)
473484

474485
def _toggle_web(self, method_selected=None):
486+
return
475487
"""
476488
Sets up the dialog GUI according to the use of web login or not.
477489
"""
@@ -701,13 +713,18 @@ def result(self):
701713

702714
return self._sso_saml2.get_session_data()
703715

704-
# We want to wait until we know what is supported by the site, to avoid
705-
# flickering GUI.
706-
if not self._query_task.wait(THREAD_WAIT_TIMEOUT_MS):
707-
logger.warning(
708-
"Timed out awaiting requesting information: %s"
709-
% self._get_current_site()
710-
)
716+
# # We want to wait until we know what is supported by the site, to avoid
717+
# # flickering GUI.
718+
# if not self._query_task.wait(THREAD_WAIT_TIMEOUT_MS):
719+
# logger.warning(
720+
# "Timed out awaiting requesting information: %s"
721+
# % self._get_current_site()
722+
# )
723+
724+
# Configure the GUI according to what we know: site and user preferences
725+
# TODO -> self._toggle_web....
726+
727+
self.ui.spinner_movie.start()
711728

712729
res = self.exec_()
713730
if res != QtGui.QDialog.Accepted:

python/tank/authentication/site_info.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ def _get_site_infos(url, http_proxy=None):
4040
:returns: A dictionary with the site infos.
4141
"""
4242

43+
time.sleep(3)
44+
return {
45+
"user_authentication_method": "oxygen",
46+
"unified_login_flow_enabled": True,
47+
"authentication_app_session_launcher_enabled": True,
48+
}
49+
4350
# logger.info("Sleep for 10s")
4451
# time.sleep(30)
4552
# logger.info("done sleeping")
@@ -115,6 +122,14 @@ def reload(self, url, http_proxy=None):
115122
logger.debug("Unable to connect with %s, got exception '%s'", url, exc)
116123
return
117124

125+
126+
# TODO emit a signal with the infos dict instead of waiting for the comsumer to retrieve it.
127+
# Because the thread might already run with different URL at that point....
128+
129+
130+
# ALSO, the following logs should only run if needed
131+
# ALSO, why don't we consume the cache here ?!
132+
118133
self._url = url
119134
self._infos = infos
120135

0 commit comments

Comments
 (0)