diff options
author | Kali Kaneko <kali@leap.se> | 2015-12-08 21:04:11 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-12-15 12:31:04 -0400 |
commit | 98384361a7c49ad4e0ff0127fd923a8b72cc910a (patch) | |
tree | c315b65397ac97210d6f1a3ee5e521b4d8917678 /src/leap/bitmask/gui | |
parent | 6c0299e7e2df65651ff8738fa18acbc08af18c32 (diff) |
[feat] adapt to use cred-based authentication for imap
This includes getting the token for the imap authentication, and
displaying it on the help window.
- Resolves: #4469
- Releases: 0.10.0
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index a8a4e41d..189a6295 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -407,6 +407,10 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): sig.soledad_invalid_auth_token.connect( self._mail_status.set_soledad_invalid_auth_token) + self._service_tokens = {} + sig.soledad_got_service_token.connect( + self._set_service_tokens) + # TODO: connect this with something # sig.soledad_cancelled_bootstrap.connect() @@ -1033,6 +1037,13 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): msg = msg.format(ver=VERSION, ver_hash=VERSION_HASH[:10], greet=greet) QtGui.QMessageBox.about(self, title, msg) + def _set_service_tokens(self, data): + """ + Set the received service token. + """ + service, token = data + self._service_tokens[service] = token + def _help(self): """ TRIGGERS: @@ -1063,7 +1074,12 @@ class MainWindow(QtGui.QMainWindow, SignalTracker): manual_imap = self.tr("IMAP: localhost, port {0}".format(IMAP_PORT)) manual_smtp = self.tr("SMTP: localhost, port {0}".format(smtp_port)) manual_username = self.tr("Username: your full email address") - manual_password = self.tr("Password: any non-empty text") + + # TODO this should be a widget that allows to be copied to the + # clipboard. + imap_token = (self._service_tokens.get('imap', None) + or "??? (log in to unlock)") + manual_password = self.tr("Password: ") + "%s" % (imap_token, ) msg = help_url + self.tr( "<p><strong>{0}</strong></p>" |