summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/crypto/srpauth.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-03-11 13:07:38 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-03-11 13:07:38 -0300
commit5c2150723d87e8713bffe23d0fa897d1de088b3f (patch)
treee23595db1138539806dc70a219ad0f680ecf3836 /src/leap/bitmask/crypto/srpauth.py
parent55fd2d680c1d1f8cdf3433bf408858b72d55178f (diff)
Move login/logout success/error msgs to the GUI.
Also refactor signals to be more granular and notify clearly if there was an error or not, then in the GUI we show the corresponding message.
Diffstat (limited to 'src/leap/bitmask/crypto/srpauth.py')
-rw-r--r--src/leap/bitmask/crypto/srpauth.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py
index 179520d5..7cf7e55a 100644
--- a/src/leap/bitmask/crypto/srpauth.py
+++ b/src/leap/bitmask/crypto/srpauth.py
@@ -604,8 +604,9 @@ class SRPAuth(QtCore.QObject):
__instance = None
- authentication_finished = QtCore.Signal(bool, str)
- logout_finished = QtCore.Signal(bool, str)
+ authentication_finished = QtCore.Signal()
+ logout_ok = QtCore.Signal()
+ logout_error = QtCore.Signal()
def __init__(self, provider_config):
"""
@@ -679,7 +680,7 @@ class SRPAuth(QtCore.QObject):
:type _: IGNORED
"""
logger.debug("Successful login!")
- self.authentication_finished.emit(True, self.tr("Succeeded"))
+ self.authentication_finished.emit()
def get_session_id(self):
return self.__instance.get_session_id()
@@ -697,8 +698,10 @@ class SRPAuth(QtCore.QObject):
"""
try:
self.__instance.logout()
- self.logout_finished.emit(True, self.tr("Succeeded"))
+ logger.debug("Logout success")
+ self.logout_ok.emit()
return True
except Exception as e:
- self.logout_finished.emit(False, "%s" % (e,))
+ logger.debug("Logout error: {0!r}".format(e))
+ self.logout_error.emit()
return False