本文整理汇总了Python中choice_dialog.ChoiceDialog.open方法的典型用法代码示例。如果您正苦于以下问题:Python ChoiceDialog.open方法的具体用法?Python ChoiceDialog.open怎么用?Python ChoiceDialog.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类choice_dialog.ChoiceDialog
的用法示例。
在下文中一共展示了ChoiceDialog.open方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unit_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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()
示例2: unit_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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()
示例3: language_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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()
示例4: language_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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()
示例5: coinselect_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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()
示例6: fiat_source_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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()
示例7: fiat_currency_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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()
示例8: SettingsDialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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'
#.........这里部分代码省略.........
示例9: SettingsDialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
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'
#.........这里部分代码省略.........
示例10: fiat_dialog
# 需要导入模块: from choice_dialog import ChoiceDialog [as 别名]
# 或者: from choice_dialog.ChoiceDialog import open [as 别名]
def fiat_dialog(self, item):
from choice_dialog import ChoiceDialog
def cb(text):
pass
d = ChoiceDialog(_('Fiat Currency'), {}, '', cb)
d.open()