Skip to content

Commit 0d61453

Browse files
committed
add spinner and raise questions
1 parent 3139eed commit 0d61453

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

python/tank/authentication/login_dialog.py

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

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

340+
341+
## Init UI Spinner
342+
343+
self.ui.login.setVisible(False)
344+
self.ui.password.setVisible(False)
345+
# self.ui.message.setText("Retrieving the site information...")
346+
self.__refresh_movie_icon = QtGui.QMovie(
347+
os.path.join(
348+
os.path.dirname(__file__),
349+
"resources",
350+
"spinning-wheel_40x40.gif",
351+
)
352+
)
353+
if self.__refresh_movie_icon.loopCount() != -1:
354+
self.__refresh_movie_icon.finished.connect(self.__refresh_movie_icon.start)
355+
356+
# movie.setLoopCount(-1) # Loop forever
357+
self.ui.message.setMovie(self.__refresh_movie_icon) # TODO create another widget for the spinner
358+
self.__refresh_movie_icon.start()
359+
360+
340361
def __del__(self):
341362
"""
342363
Destructor.
@@ -472,6 +493,7 @@ def _link_activated(self, site=None):
472493
)
473494

474495
def _toggle_web(self, method_selected=None):
496+
return
475497
"""
476498
Sets up the dialog GUI according to the use of web login or not.
477499
"""
@@ -701,13 +723,16 @@ def result(self):
701723

702724
return self._sso_saml2.get_session_data()
703725

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-
)
726+
# # We want to wait until we know what is supported by the site, to avoid
727+
# # flickering GUI.
728+
# if not self._query_task.wait(THREAD_WAIT_TIMEOUT_MS):
729+
# logger.warning(
730+
# "Timed out awaiting requesting information: %s"
731+
# % self._get_current_site()
732+
# )
733+
734+
# Configure the GUI according to what we know: site and user preferences
735+
# TODO -> self._toggle_web....
711736

712737
res = self.exec_()
713738
if res != QtGui.QDialog.Accepted:
13.6 KB
Loading

python/tank/authentication/site_info.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ def reload(self, url, http_proxy=None):
115115
logger.debug("Unable to connect with %s, got exception '%s'", url, exc)
116116
return
117117

118+
119+
# TODO emit a signal with the infos dict instead of waiting for the comsumer to retrieve it.
120+
# Because the thread might already run with different URL at that point....
121+
122+
123+
# ALSO, the following logs should only run if needed
124+
# ALSO, why don't we consume the cache here ?!
125+
118126
self._url = url
119127
self._infos = infos
120128

0 commit comments

Comments
 (0)