From 9a0568c18ed38558a481d5f6e4be12c68f9870a6 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 19 Apr 2016 13:14:54 -0400 Subject: [feature] enable webmail from the mail preferences window this box is only visible when the HAS_PIXELATED flag is True, that means we have pixelated-user-agent and pixelated-www in the environment. - Releases: 0.9.2 --- src/leap/bitmask/config/leapsettings.py | 2 +- src/leap/bitmask/gui/preferences_email_page.py | 19 ++++++++++++++ src/leap/bitmask/gui/ui/preferences_email_page.ui | 30 +++++++++++++++++++++-- 3 files changed, 48 insertions(+), 3 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py index 01900484..075be8a7 100644 --- a/src/leap/bitmask/config/leapsettings.py +++ b/src/leap/bitmask/config/leapsettings.py @@ -360,4 +360,4 @@ class LeapSettings(object): def set_pixelmail_enabled(self, enabled): leap_assert_type(enabled, bool) - self._settings.setvalue(self.PIXELMAIL_KEY, enabled) + self._settings.setValue(self.PIXELMAIL_KEY, enabled) diff --git a/src/leap/bitmask/gui/preferences_email_page.py b/src/leap/bitmask/gui/preferences_email_page.py index 8211aeb8..b8633f07 100644 --- a/src/leap/bitmask/gui/preferences_email_page.py +++ b/src/leap/bitmask/gui/preferences_email_page.py @@ -18,11 +18,14 @@ Widget for "email" preferences """ from PySide import QtCore, QtGui +from leap.bitmask.config.leapsettings import LeapSettings from leap.bitmask.logs.utils import get_logger from leap.bitmask.gui.ui_preferences_email_page import Ui_PreferencesEmailPage from leap.bitmask.gui.preferences_page import PreferencesPage +from leap.bitmask.pix import HAS_PIXELATED from leap.mail.imap.service.imap import IMAP_PORT + logger = get_logger() @@ -40,6 +43,7 @@ class PreferencesEmailPage(PreferencesPage): :type app: App """ PreferencesPage.__init__(self, parent, account, app) + self.settings = LeapSettings() self.ui = Ui_PreferencesEmailPage() self.ui.setupUi(self) @@ -65,6 +69,16 @@ class PreferencesEmailPage(PreferencesPage): "Alternatively, you can manually configure your mail client to " "use Bitmask Email with these options:")) + self.ui.webmail_label.setText(self.tr( + "This distribution of Bitmask ships an experimental integration " + "of the Pixelated " + "Webmail. It is not stable yet, but you can enable it to help " + "beta-testing it. (Needs restart!)")) + webmail_enabled = self.settings.get_pixelmail_enabled() + self.ui.webmail_checkbox.setChecked(webmail_enabled) + if not HAS_PIXELATED: + self.ui.webmail_box.setVisible(False) + self.ui.keys_table.horizontalHeader().setResizeMode( 0, QtGui.QHeaderView.Stretch) @@ -81,6 +95,7 @@ class PreferencesEmailPage(PreferencesPage): self._keymanager_export_error) self.ui.import_button.clicked.connect(self._import_keys) self.ui.export_button.clicked.connect(self._export_keys) + self.ui.webmail_checkbox.stateChanged.connect(self._toggle_webmail) def teardown_connections(self): """ @@ -205,3 +220,7 @@ class PreferencesEmailPage(PreferencesPage): row, 0, QtGui.QTableWidgetItem(key.address)) self.ui.keys_table.setItem( row, 1, QtGui.QTableWidgetItem(key.fingerprint)) + + def _toggle_webmail(self, state): + value = True if state == QtCore.Qt.Checked else False + self.settings.set_pixelmail_enabled(value) diff --git a/src/leap/bitmask/gui/ui/preferences_email_page.ui b/src/leap/bitmask/gui/ui/preferences_email_page.ui index 5f83426b..22d690d9 100644 --- a/src/leap/bitmask/gui/ui/preferences_email_page.ui +++ b/src/leap/bitmask/gui/ui/preferences_email_page.ui @@ -23,7 +23,7 @@ - 2 + 0 @@ -35,7 +35,7 @@ Tab 1 - + @@ -332,6 +332,32 @@ + + + + Webmail Configuration + + + + + + Enable Bitmask Webmail (beta) + + + + + + + webmail info + + + true + + + + + + -- cgit v1.2.3