From 98384361a7c49ad4e0ff0127fd923a8b72cc910a Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Tue, 8 Dec 2015 21:04:11 -0400
Subject: [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
---
src/leap/bitmask/gui/mainwindow.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
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(
"{0}
"
--
cgit v1.2.3
From 7b80dd1fca9828331f3327c418913539a3a303c0 Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Wed, 16 Dec 2015 15:33:25 -0400
Subject: [feat] adapt to use cred-based authentication for smtp
---
src/leap/bitmask/gui/mainwindow.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 189a6295..759b454f 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -1075,11 +1075,14 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
manual_smtp = self.tr("SMTP: localhost, port {0}".format(smtp_port))
manual_username = self.tr("Username: your full email address")
- # 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, )
+ # FIXME on i3, this doens't allow to mouse-select.
+ # Switch to a dialog in which we can set the QLabel
+ imap_token = (self._service_tokens.get('imap', None) or
+ "??? (log in to unlock)")
+ smtp_token = (self._service_tokens.get('smtp', None) or
+ "??? (log in to unlock)")
+ imap_password = self.tr("IMAP Password:") + " %s" % (imap_token,)
+ smtp_password = self.tr("SMTP Password:") + " %s" % (smtp_token,)
msg = help_url + self.tr(
"{0}
"
@@ -1090,9 +1093,10 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
" {4}"
" {5}"
" {6}"
+ " {7}"
"
").format(email_quick_reference, thunderbird_text,
manual_text, manual_imap, manual_smtp,
- manual_username, manual_password)
+ manual_username, imap_password, smtp_password)
QtGui.QMessageBox.about(self, self.tr("Bitmask Help"), msg)
def _needs_update(self):
--
cgit v1.2.3
From f9cb960dea642ec2e9cced1ab4712577cc0f3469 Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Wed, 23 Mar 2016 19:30:54 -0400
Subject: [feature] add QtWebView to render pixelated mua
---
src/leap/bitmask/gui/mainwindow.py | 8 ++++++++
1 file changed, 8 insertions(+)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 759b454f..1f497d2d 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -60,6 +60,8 @@ from leap.bitmask.util.keyring_helpers import has_keyring
from leap.common.events import register
from leap.common.events import catalog
+from .qt_browser import PixelatedWindow
+
from leap.mail.imap.service.imap import IMAP_PORT
from ui_mainwindow import Ui_MainWindow
@@ -218,6 +220,8 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
self._backend_connect()
self.ui.action_preferences.triggered.connect(self._show_preferences)
+ self.ui.action_pixelated_mail.triggered.connect(
+ self._show_pixelated_browser)
self.ui.action_about_leap.triggered.connect(self._about)
self.ui.action_quit.triggered.connect(self.quit)
self.ui.action_wizard.triggered.connect(self._show_wizard)
@@ -568,6 +572,10 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
pref_win = PreferencesWindow(self, account, self.app)
pref_win.show()
+ def _show_pixelated_browser(self):
+ win = PixelatedWindow(self)
+ win.show()
+
def _update_eip_enabled_status(self, account=None, services=None):
"""
TRIGGER:
--
cgit v1.2.3
From 106d202012f8f052a3cabe044d7287d2283655fc Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Thu, 24 Mar 2016 10:04:38 -0400
Subject: [feature] hide browser menu entry if pixelated is disabled
---
src/leap/bitmask/gui/mainwindow.py | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 1f497d2d..839aae87 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -222,6 +222,10 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
self.ui.action_preferences.triggered.connect(self._show_preferences)
self.ui.action_pixelated_mail.triggered.connect(
self._show_pixelated_browser)
+
+ pixelated_enabled = self._settings.get_pixelmail_enabled()
+ self.ui.action_pixelated_mail.setVisible(pixelated_enabled)
+
self.ui.action_about_leap.triggered.connect(self._about)
self.ui.action_quit.triggered.connect(self.quit)
self.ui.action_wizard.triggered.connect(self._show_wizard)
--
cgit v1.2.3
From 3340e1a898bacdd05fb6e6bf8d37596f7aff81a2 Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Thu, 7 Apr 2016 09:56:36 -0400
Subject: [feat] use same token for imap/smtp authentication
This greatly simplifies the handling of the password in the thunderbird
extension.
- Related: #6041
---
src/leap/bitmask/gui/mainwindow.py | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 839aae87..ace3f863 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -1089,12 +1089,11 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
# FIXME on i3, this doens't allow to mouse-select.
# Switch to a dialog in which we can set the QLabel
- imap_token = (self._service_tokens.get('imap', None) or
- "??? (log in to unlock)")
- smtp_token = (self._service_tokens.get('smtp', None) or
- "??? (log in to unlock)")
- imap_password = self.tr("IMAP Password:") + " %s" % (imap_token,)
- smtp_password = self.tr("SMTP Password:") + " %s" % (smtp_token,)
+ mail_auth_token = (
+ self._service_tokens.get('mail_auth', None) or
+ "??? (log in to unlock)")
+ mail_password = self.tr("IMAP/SMTP Password:") + " %s" % (
+ mail_auth_token,)
msg = help_url + self.tr(
"{0}
"
@@ -1105,10 +1104,9 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
" {4}"
" {5}"
" {6}"
- " {7}"
"").format(email_quick_reference, thunderbird_text,
manual_text, manual_imap, manual_smtp,
- manual_username, imap_password, smtp_password)
+ manual_username, mail_password)
QtGui.QMessageBox.about(self, self.tr("Bitmask Help"), msg)
def _needs_update(self):
--
cgit v1.2.3
From 130f1a8753bfe63f5575fc2011a15af9a0752170 Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Thu, 7 Apr 2016 12:18:24 -0400
Subject: [bug] allow resizing browser window
---
src/leap/bitmask/gui/mainwindow.py | 1 +
1 file changed, 1 insertion(+)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index ace3f863..168de8ed 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -579,6 +579,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
def _show_pixelated_browser(self):
win = PixelatedWindow(self)
win.show()
+ win.load_app()
def _update_eip_enabled_status(self, account=None, services=None):
"""
--
cgit v1.2.3
From b91263cba4078a7c4d19de0c31060cb7564ae410 Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Sun, 17 Apr 2016 08:52:26 -0700
Subject: [bug] enable first page in wizard
- Resolves: #8041
- Releases: 0.9.2
---
src/leap/bitmask/gui/mainwindow.py | 3 +++
1 file changed, 3 insertions(+)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 168de8ed..20909038 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -448,6 +448,9 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
# Refer to http://www.themacaque.com/?p=1067 for funny details.
self._wizard.show()
if IS_MAC:
+ # XXX hack. For some reason, there's a signal that doesn't arrive
+ # on time, so that the next button is disabled. See #8041
+ self._wizard.page(self._wizard.INTRO_PAGE).set_completed()
self._wizard.raise_()
self._settings.set_skip_first_run(True)
--
cgit v1.2.3
From 60aed8f499f6581e6568c6f66090da1aa8ac2fe0 Mon Sep 17 00:00:00 2001
From: Paixu Aabuizia
Date: Wed, 3 Feb 2016 21:40:30 +0100
Subject: [bug] vindows initializer does not return state causing the
application to always quit
- log the init_platform failure to the critical log
- return True/False in initializer
- remove implementation to install driver and display informative message instead
---
src/leap/bitmask/gui/mainwindow.py | 1 +
1 file changed, 1 insertion(+)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 20909038..cde44f7b 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -302,6 +302,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
self._mail_conductor.connect_mail_signals(self._mail_status)
if not init_platform():
+ logger.critical('init_platform failed, quitting application.')
self.quit()
return
--
cgit v1.2.3
From 229f803235ae9b9a71313d11071c7a0fbea0a681 Mon Sep 17 00:00:00 2001
From: elijah
Date: Mon, 18 Apr 2016 23:44:12 -0700
Subject: [feature] add email panel to preferences
---
src/leap/bitmask/gui/mainwindow.py | 32 ++++++++++----------------------
1 file changed, 10 insertions(+), 22 deletions(-)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index cde44f7b..ca14e631 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -46,7 +46,6 @@ from leap.bitmask.gui.signaltracker import SignalTracker
from leap.bitmask.gui.systray import SysTray
from leap.bitmask.gui.wizard import Wizard
from leap.bitmask.gui.providers import Providers
-from leap.bitmask.gui.account import Account
from leap.bitmask.gui.app import App
from leap.bitmask.platform_init import IS_WIN, IS_MAC, IS_LINUX
@@ -154,6 +153,14 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
# Provider List
self._providers = Providers(self.ui.cmbProviders)
+ ##
+ ## tmphack: important state information about the application is stored
+ ## in widgets. Rather than rewrite the UI, for now we simulate this
+ ## info being stored in an application object:
+ ##
+ self.app.login_state = self._login_widget._state
+ self.app.providers_widget = self._providers
+
# Qt Signal Connections #####################################
# TODO separate logic from ui signals.
@@ -416,10 +423,6 @@ 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()
@@ -569,15 +572,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
Display the preferences window.
"""
- logged_user = self._login_widget.get_logged_user()
- if logged_user is not None:
- user, domain = logged_user.split('@')
- else:
- user = None
- domain = self._providers.get_selected_provider()
-
- account = Account(user, domain)
- pref_win = PreferencesWindow(self, account, self.app)
+ pref_win = PreferencesWindow(self, self.app)
pref_win.show()
def _show_pixelated_browser(self):
@@ -1054,13 +1049,6 @@ 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:
@@ -1095,7 +1083,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
# FIXME on i3, this doens't allow to mouse-select.
# Switch to a dialog in which we can set the QLabel
mail_auth_token = (
- self._service_tokens.get('mail_auth', None) or
+ self.app.service_tokens.get('mail_auth', None) or
"??? (log in to unlock)")
mail_password = self.tr("IMAP/SMTP Password:") + " %s" % (
mail_auth_token,)
--
cgit v1.2.3
From 5b90ad3552025436edb40665203ab98eceaa065b Mon Sep 17 00:00:00 2001
From: Kali Kaneko
Date: Tue, 19 Apr 2016 12:07:09 -0400
Subject: pep8/flake8
---
src/leap/bitmask/gui/mainwindow.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'src/leap/bitmask/gui/mainwindow.py')
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index ca14e631..daf49eb6 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -154,11 +154,11 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
self._providers = Providers(self.ui.cmbProviders)
##
- ## tmphack: important state information about the application is stored
- ## in widgets. Rather than rewrite the UI, for now we simulate this
- ## info being stored in an application object:
+ # tmphack: important state information about the application is stored
+ # in widgets. Rather than rewrite the UI, for now we simulate this
+ # info being stored in an application object:
##
- self.app.login_state = self._login_widget._state
+ self.app.login_state = self._login_widget._state
self.app.providers_widget = self._providers
# Qt Signal Connections #####################################
--
cgit v1.2.3