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


Python choice_dialog.ChoiceDialog类代码示例

本文整理汇总了Python中choice_dialog.ChoiceDialog的典型用法代码示例。如果您正苦于以下问题:Python ChoiceDialog类的具体用法?Python ChoiceDialog怎么用?Python ChoiceDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: unit_dialog

 def unit_dialog(self, item, dt):
     from choice_dialog import ChoiceDialog
     def cb(text):
         self.app._set_bu(text)
         item.bu = self.app.base_unit
     d = ChoiceDialog(_('Denomination'), base_units.keys(), self.app.base_unit, cb)
     d.open()
开发者ID:akshayaurora,项目名称:electrum,代码行数:7,代码来源:settings.py

示例2: unit_dialog

 def unit_dialog(self, item):
     from choice_dialog import ChoiceDialog
     def cb(text):
         self.app._set_bu(text)
         item.bu = self.app.base_unit
     d = ChoiceDialog(_('Denomination'), dict(map(lambda x: (x,x), base_units)), self.app.base_unit, cb)
     d.open()
开发者ID:Emzy,项目名称:electrum,代码行数:7,代码来源:settings.py

示例3: language_dialog

 def language_dialog(self, item, dt):
     l = self.config.get('language', 'en_UK')
     def cb(key):
         self.config.set_key("language", key, True)
         item.lang = self.get_language_name()
         self.app.language = key
     d = ChoiceDialog(_('Language'), languages, l, cb)
     d.open()
开发者ID:phamthaithinh,项目名称:electrum,代码行数:8,代码来源:settings.py

示例4: language_dialog

 def language_dialog(self, item):
     from choice_dialog import ChoiceDialog
     l = self.config.get('language', 'en_UK')
     def cb(key):
         self.config.set_key("language", key, True)
         item.lang = self.get_language_name()
         set_language(key)
     d = ChoiceDialog(_('Language'), languages, l, cb)
     d.open()
开发者ID:bitbandi,项目名称:electrum,代码行数:9,代码来源:settings.py

示例5: coinselect_dialog

 def coinselect_dialog(self, item, dt):
     from electrum import COIN_CHOOSERS
     choosers = sorted(COIN_CHOOSERS.keys())
     chooser_name = self.app.wallet.coin_chooser_name(self.config)
     def cb(text):
         self.config.set_key('coin_chooser', text)
         item.status = text
     d = ChoiceDialog(_('Coin selection'), choosers, chooser_name, cb)
     d.open()
开发者ID:phamthaithinh,项目名称:electrum,代码行数:9,代码来源:settings.py

示例6: fiat_source_dialog

 def fiat_source_dialog(self, item):
     from choice_dialog import ChoiceDialog
     p = self.plugins.get('exchange_rate')
     if not p:
         return
     def cb(text):
         p.set_exchange(text)
         item.status = text
     l = sorted(p.exchanges.keys())
     d = ChoiceDialog(_('Exchange rate source'), l, self.fiat_source(), cb)
     d.open()
开发者ID:bitbandi,项目名称:electrum,代码行数:11,代码来源:settings.py

示例7: fiat_currency_dialog

 def fiat_currency_dialog(self, item):
     from choice_dialog import ChoiceDialog
     p = self.app.plugins.get('exchange_rate')
     if not p:
         return
     def cb(text):
         p.set_currency(text)
         item.status = text
         self.app.fiat_unit = text
     l = sorted(p.exchange.quotes.keys()) if p else []
     d = ChoiceDialog(_('Fiat Currency'), l, p.get_currency(), cb)
     d.open()
开发者ID:bitbandi,项目名称:electrum,代码行数:12,代码来源:settings.py

示例8: unit_dialog

 def unit_dialog(self, item, dt):
     if self._unit_dialog is None:
         def cb(text):
             self.app._set_bu(text)
             item.bu = self.app.base_unit
         self._unit_dialog = ChoiceDialog(_('Denomination'), base_units.keys(), self.app.base_unit, cb)
     self._unit_dialog.open()
开发者ID:cryptapus,项目名称:electrum-myr,代码行数:7,代码来源:settings.py

示例9: coinselect_dialog

 def coinselect_dialog(self, item, dt):
     if self._coinselect_dialog is None:
         choosers = sorted(coinchooser.COIN_CHOOSERS.keys())
         chooser_name = coinchooser.get_name(self.config)
         def cb(text):
             self.config.set_key('coin_chooser', text)
             item.status = text
         self._coinselect_dialog = ChoiceDialog(_('Coin selection'), choosers, chooser_name, cb)
     self._coinselect_dialog.open()
开发者ID:Marcdnd,项目名称:electrum-cesc,代码行数:9,代码来源:settings.py

示例10: SettingsDialog

class SettingsDialog(Factory.Popup):

    def __init__(self, app):
        self.app = app
        self.plugins = self.app.plugins
        self.config = self.app.electrum_config
        Factory.Popup.__init__(self)
        layout = self.ids.scrollviewlayout
        layout.bind(minimum_height=layout.setter('height'))
        # cached dialogs
        self._fx_dialog = None
        self._fee_dialog = None
        self._network_dialog = None
        self._language_dialog = None
        self._unit_dialog = None
        self._coinselect_dialog = None

    def update(self):
        self.wallet = self.app.wallet
        self.watching_only = self.wallet.is_watching_only()
        self.use_encryption = self.wallet.use_encryption

    def get_language_name(self):
        return languages.get(self.config.get('language', 'en_UK'), '')

    def change_password(self, item, dt):
        self.app.change_password(self.update)

    def language_dialog(self, item, dt):
        if self._language_dialog is None:
            l = self.config.get('language', 'en_UK')
            def cb(key):
                self.config.set_key("language", key, True)
                item.lang = self.get_language_name()
                self.app.language = key
            self._language_dialog = ChoiceDialog(_('Language'), languages, l, cb)
        self._language_dialog.open()

    def unit_dialog(self, item, dt):
        if self._unit_dialog is None:
            def cb(text):
                self.app._set_bu(text)
                item.bu = self.app.base_unit
            self._unit_dialog = ChoiceDialog(_('Denomination'), base_units.keys(), self.app.base_unit, cb)
        self._unit_dialog.open()

    def coinselect_status(self):
        return self.app.wallet.coin_chooser_name(self.app.electrum_config)

    def coinselect_dialog(self, item, dt):
        if self._coinselect_dialog is None:
            from electrum import COIN_CHOOSERS
            choosers = sorted(COIN_CHOOSERS.keys())
            chooser_name = self.app.wallet.coin_chooser_name(self.config)
            def cb(text):
                self.config.set_key('coin_chooser', text)
                item.status = text
            self._coinselect_dialog = ChoiceDialog(_('Coin selection'), choosers, chooser_name, cb)
        self._coinselect_dialog.open()

    def network_dialog(self, item, dt):
        if self._network_dialog is None:
            server, port, protocol, proxy, auto_connect = self.app.network.get_parameters()
            def cb(popup):
                server = popup.ids.host.text
                auto_connect = popup.ids.auto_connect.active
                self.app.network.set_parameters(server, port, protocol, proxy, auto_connect)
                item.status = self.network_status()
            popup = Builder.load_file('gui/kivy/uix/ui_screens/network.kv')
            popup.ids.host.text = server
            popup.ids.auto_connect.active = auto_connect
            popup.on_dismiss = lambda: cb(popup)
            self._network_dialog = popup
        self._network_dialog.open()

    def network_status(self):
        server, port, protocol, proxy, auto_connect = self.app.network.get_parameters()
        return 'auto-connect' if auto_connect else server

    def plugin_dialog(self, name, label, dt):
        from checkbox_dialog import CheckBoxDialog
        def callback(status):
            self.plugins.enable(name) if status else self.plugins.disable(name)
            label.status = 'ON' if status else 'OFF'

        status = bool(self.plugins.get(name))
        dd = self.plugins.descriptions.get(name)
        descr = dd.get('description')
        fullname = dd.get('fullname')
        d = CheckBoxDialog(fullname, descr, status, callback)
        d.open()

    def fee_status(self):
        if self.config.get('dynamic_fees'):
            f = self.config.get('fee_factor', 50) + 50
            return 'Dynamic, %d%%'%f
        else:
            F = self.config.get('fee_per_kb', RECOMMENDED_FEE)
            return self.app.format_amount_and_units(F) + '/kB'

#.........这里部分代码省略.........
开发者ID:cryptapus,项目名称:electrum-myr,代码行数:101,代码来源:settings.py

示例11: SettingsDialog

class SettingsDialog(Factory.Popup):

    def __init__(self, app):
        self.app = app
        self.plugins = self.app.plugins
        self.config = self.app.electrum_config
        Factory.Popup.__init__(self)
        layout = self.ids.scrollviewlayout
        layout.bind(minimum_height=layout.setter('height'))
        # cached dialogs
        self._fx_dialog = None
        self._fee_dialog = None
        self._rbf_dialog = None
        self._network_dialog = None
        self._language_dialog = None
        self._unit_dialog = None
        self._coinselect_dialog = None

    def update(self):
        self.wallet = self.app.wallet
        self.disable_pin = self.wallet.is_watching_only() if self.wallet else True
        self.use_encryption = self.wallet.use_encryption if self.wallet else False

    def get_language_name(self):
        return languages.get(self.config.get('language', 'en_UK'), '')

    def change_password(self, item, dt):
        self.app.change_password(self.update)

    def language_dialog(self, item, dt):
        if self._language_dialog is None:
            l = self.config.get('language', 'en_UK')
            def cb(key):
                self.config.set_key("language", key, True)
                item.lang = self.get_language_name()
                self.app.language = key
            self._language_dialog = ChoiceDialog(_('Language'), languages, l, cb)
        self._language_dialog.open()

    def unit_dialog(self, item, dt):
        if self._unit_dialog is None:
            def cb(text):
                self.app._set_bu(text)
                item.bu = self.app.base_unit
            self._unit_dialog = ChoiceDialog(_('Denomination'), base_units.keys(), self.app.base_unit, cb)
        self._unit_dialog.open()

    def coinselect_status(self):
        return coinchooser.get_name(self.app.electrum_config)

    def coinselect_dialog(self, item, dt):
        if self._coinselect_dialog is None:
            choosers = sorted(coinchooser.COIN_CHOOSERS.keys())
            chooser_name = coinchooser.get_name(self.config)
            def cb(text):
                self.config.set_key('coin_chooser', text)
                item.status = text
            self._coinselect_dialog = ChoiceDialog(_('Coin selection'), choosers, chooser_name, cb)
        self._coinselect_dialog.open()

    def network_dialog(self, item, dt):
        if self._network_dialog is None:
            server, port, protocol, proxy, auto_connect = self.app.network.get_parameters()
            def cb(popup):
                server = popup.ids.host.text
                auto_connect = popup.ids.auto_connect.active
                self.app.network.set_parameters(server, port, protocol, proxy, auto_connect)
                item.status = self.network_status()
            popup = Builder.load_file('gui/kivy/uix/ui_screens/network.kv')
            popup.ids.host.text = server
            popup.ids.auto_connect.active = auto_connect
            popup.on_dismiss = lambda: cb(popup)
            self._network_dialog = popup
        self._network_dialog.open()

    def network_status(self):
        server, port, protocol, proxy, auto_connect = self.app.network.get_parameters()
        return 'auto-connect' if auto_connect else server

    def plugin_dialog(self, name, label, dt):
        from checkbox_dialog import CheckBoxDialog
        def callback(status):
            self.plugins.enable(name) if status else self.plugins.disable(name)
            label.status = 'ON' if status else 'OFF'

        status = bool(self.plugins.get(name))
        dd = self.plugins.descriptions.get(name)
        descr = dd.get('description')
        fullname = dd.get('fullname')
        d = CheckBoxDialog(fullname, descr, status, callback)
        d.open()

    def fee_status(self):
        if self.config.get('dynamic_fees', True):
            from electrum.util import fee_levels
            return fee_levels[self.config.get('fee_level', 2)]
        else:
            F = self.config.get('fee_per_kb', RECOMMENDED_FEE)
            return self.app.format_amount_and_units(F) + '/kB'

#.........这里部分代码省略.........
开发者ID:Marcdnd,项目名称:electrum-cesc,代码行数:101,代码来源:settings.py

示例12: fiat_dialog

 def fiat_dialog(self, item):
     from choice_dialog import ChoiceDialog
     def cb(text):
         pass
     d = ChoiceDialog(_('Fiat Currency'), {}, '', cb)
     d.open()
开发者ID:Emzy,项目名称:electrum,代码行数:6,代码来源:settings.py


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