From e92e4f1e4d57957af5d8c9e08a6c3c9152409612 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 23 Mar 2016 12:03:46 -0400 Subject: [feature] allow to disable pixelmail integration --- src/leap/bitmask/config/leapsettings.py | 11 ++++++++++- src/leap/bitmask/services/mail/conductor.py | 7 +++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py index 484a8a25..a060c8a4 100644 --- a/src/leap/bitmask/config/leapsettings.py +++ b/src/leap/bitmask/config/leapsettings.py @@ -70,6 +70,7 @@ class LeapSettings(object): PINNED_KEY = "Pinned" SKIPFIRSTRUN_KEY = "SkipFirstRun" UUIDFORUSER_KEY = "%s/%s_uuid" + PIXELMAIL_KEY = "Pixmail" # values GATEWAY_AUTOMATIC = "Automatic" @@ -352,4 +353,12 @@ class LeapSettings(object): :type skip: bool """ leap_assert_type(skip, bool) - self._settings.setValue(self.SKIPFIRSTRUN_KEY, skip) + self._settings.setvalue(self.skipfirstrun_key, skip) + + def get_pixelmail_enabled(self): + return to_bool(self._settings.value(self.PIXELMAIL_KEY, False)) + + def set_pixelmail_enabled(self, enabled): + leap_assert_type(enabled, bool) + self._settings.setvalue(self.PIXELMAIL_KEY, enabled) + diff --git a/src/leap/bitmask/services/mail/conductor.py b/src/leap/bitmask/services/mail/conductor.py index 05fafa1a..cccbcf14 100644 --- a/src/leap/bitmask/services/mail/conductor.py +++ b/src/leap/bitmask/services/mail/conductor.py @@ -18,6 +18,7 @@ Mail Services Conductor """ from leap.bitmask.config import flags +from leap.bitmask.config.leapsettings import LeapSettings from leap.bitmask.logs.utils import get_logger from leap.bitmask.gui import statemachines from leap.bitmask.services.mail import connection as mail_connection @@ -279,8 +280,10 @@ class MailConductor(IMAPControl, SMTPControl, PixelatedControl): self.start_smtp_service(download_if_needed=download_if_needed) self.start_imap_service() - # TODO --- check if it's enabled!!! - self.start_pixelated_service() + settings = LeapSettings() + pixelmail = settings.get_pixelmail_enabled() + if pixelmail: + self.start_pixelated_service() self._mail_services_started = True -- cgit v1.2.3