当前位置: 首页>>代码示例>>Python>>正文


Python LeapSettings.get_pixelmail_enabled方法代码示例

本文整理汇总了Python中leap.bitmask.config.leapsettings.LeapSettings.get_pixelmail_enabled方法的典型用法代码示例。如果您正苦于以下问题:Python LeapSettings.get_pixelmail_enabled方法的具体用法?Python LeapSettings.get_pixelmail_enabled怎么用?Python LeapSettings.get_pixelmail_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在leap.bitmask.config.leapsettings.LeapSettings的用法示例。


在下文中一共展示了LeapSettings.get_pixelmail_enabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start_mail_service

# 需要导入模块: from leap.bitmask.config.leapsettings import LeapSettings [as 别名]
# 或者: from leap.bitmask.config.leapsettings.LeapSettings import get_pixelmail_enabled [as 别名]
    def start_mail_service(self, download_if_needed=False, offline=False):
        """
        Start the IMAP and SMTP servcies.
        """
        if self._firewall is not None:
            self._firewall.start()
        if not offline:
            logger.debug("Starting smtp service...")
            self.start_smtp_service(download_if_needed=download_if_needed)
        self.start_imap_service()

        settings = LeapSettings()
        pixelmail = settings.get_pixelmail_enabled()
        if pixelmail:
            self.start_pixelated_service()

        self._mail_services_started = True
开发者ID:arximboldi,项目名称:bitmask_client,代码行数:19,代码来源:conductor.py

示例2: PreferencesEmailPage

# 需要导入模块: from leap.bitmask.config.leapsettings import LeapSettings [as 别名]
# 或者: from leap.bitmask.config.leapsettings.LeapSettings import get_pixelmail_enabled [as 别名]
class PreferencesEmailPage(PreferencesPage):

    def __init__(self, parent, account, app):
        """
        :param parent: parent object of the PreferencesWindow.
        :parent type: QWidget

        :param account: user account (user + provider or just provider)
        :type account: Account

        :param app: the current App object
        :type app: App
        """
        PreferencesPage.__init__(self, parent, account, app)
        self.settings = LeapSettings()
        self.ui = Ui_PreferencesEmailPage()
        self.ui.setupUi(self)

        # the only way to set the tab titles is to re-add them:
        self.ui.email_tabs.addTab(self.ui.config_tab,
                                  self.tr("Mail Client"))
        self.ui.email_tabs.addTab(self.ui.my_key_tab,
                                  self.tr("My Key"))
        self.ui.email_tabs.addTab(self.ui.other_keys_tab,
                                  self.tr("Other Keys"))

        # set mail client configuration help text
        lang = QtCore.QLocale.system().name().replace('_', '-')
        thunderbird_extension_url = \
            "https://addons.mozilla.org/{0}/" \
            "thunderbird/addon/bitmask/".format(lang)
        self.ui.thunderbird_label.setText(self.tr(
            "For Thunderbird, you can use the Bitmask extension. "
            "Search for \"Bitmask\" in the add-on manager or "
            "download it from <a href='{0}'>addons.mozilla.org</a>.".format(
                thunderbird_extension_url)))

        self.ui.mail_client_label.setText(self.tr(
            "Alternatively, you can manually configure your mail client to "
            "use Bitmask with these options:"))

        self.ui.webmail_label.setText(self.tr(
            "Bitmask Mail is an integrated mail client based "
            "on <a href='https://pixelated-project.org/'>Pixelated "
            "User Agent</a>. If enabled, any user on your device "
            "can read your mail by opening http://localhost:9090"))

        self.ui.keys_table.horizontalHeader().setResizeMode(
            0, QtGui.QHeaderView.Stretch)

        self.setup_connections()

    def setup_connections(self):
        """
        connect signals
        """
        self.app.signaler.keymanager_key_details.connect(self._key_details)
        self.app.signaler.keymanager_keys_list.connect(
            self._keymanager_keys_list)
        self.app.signaler.keymanager_export_ok.connect(
            self._keymanager_export_ok)
        self.app.signaler.keymanager_export_error.connect(
            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):
        """
        disconnect signals
        """
        self.app.signaler.keymanager_key_details.disconnect(self._key_details)
        self.app.signaler.keymanager_export_ok.disconnect(
            self._keymanager_export_ok)
        self.app.signaler.keymanager_export_error.disconnect(
            self._keymanager_export_error)

    def showEvent(self, event):
        """
        called whenever this widget is shown
        """
        self.ui.keys_table.clearContents()

        if self.account.username is None:
            self.ui.email_tabs.setVisible(False)
            self.ui.message_label.setVisible(True)
            self.ui.message_label.setText(
                self.tr('You must be logged in to edit email settings.'))
        else:
            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.import_button.setVisible(False)  # hide this until working
            self.ui.message_label.setVisible(False)
            self.ui.email_tabs.setVisible(True)
            smtp_port = 2013
            self.ui.imap_port_edit.setText(str(IMAP_PORT))
            self.ui.imap_host_edit.setText("127.0.0.1")
            self.ui.smtp_port_edit.setText(str(smtp_port))
#.........这里部分代码省略.........
开发者ID:arximboldi,项目名称:bitmask_client,代码行数:103,代码来源:preferences_email_page.py


注:本文中的leap.bitmask.config.leapsettings.LeapSettings.get_pixelmail_enabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。