本文整理匯總了Python中uix.dialogs.settings.SettingsDialog.open方法的典型用法代碼示例。如果您正苦於以下問題:Python SettingsDialog.open方法的具體用法?Python SettingsDialog.open怎麽用?Python SettingsDialog.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類uix.dialogs.settings.SettingsDialog
的用法示例。
在下文中一共展示了SettingsDialog.open方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: popup_dialog
# 需要導入模塊: from uix.dialogs.settings import SettingsDialog [as 別名]
# 或者: from uix.dialogs.settings.SettingsDialog import open [as 別名]
def popup_dialog(self, name):
if name == 'settings':
from uix.dialogs.settings import SettingsDialog
d = SettingsDialog(self)
d.open()
elif name == 'wallets':
from uix.dialogs.wallets import WalletDialog
d = WalletDialog()
d.open()
else:
popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
popup.open()
示例2: popup_dialog
# 需要導入模塊: from uix.dialogs.settings import SettingsDialog [as 別名]
# 或者: from uix.dialogs.settings.SettingsDialog import open [as 別名]
def popup_dialog(self, name):
if name == "settings":
from uix.dialogs.settings import SettingsDialog
d = SettingsDialog(self)
d.open()
elif name == "wallets":
from uix.dialogs.wallets import WalletDialog
d = WalletDialog()
d.open()
else:
popup = Builder.load_file("gui/kivy/uix/ui_screens/" + name + ".kv")
popup.open()
示例3: ElectrumWindow
# 需要導入模塊: from uix.dialogs.settings import SettingsDialog [as 別名]
# 或者: from uix.dialogs.settings.SettingsDialog import open [as 別名]
#.........這裏部分代碼省略.........
def update_tabs(self):
for tab in ['invoices', 'send', 'history', 'receive', 'requests']:
self.update_tab(tab)
def switch_to(self, name):
s = getattr(self, name + '_screen', None)
if self.send_screen is None:
s = self.tabs.ids[name + '_screen']
s.load_screen()
panel = self.tabs.ids.panel
tab = self.tabs.ids[name + '_tab']
panel.switch_to(tab)
def show_request(self, addr):
self.switch_to('receive')
self.receive_screen.screen.address = addr
def show_pr_details(self, req, status, is_invoice):
from electrum.util import format_time
requestor = req.get('requestor')
exp = req.get('exp')
memo = req.get('memo')
amount = req.get('amount')
popup = Builder.load_file('gui/kivy/uix/ui_screens/invoice.kv')
popup.is_invoice = is_invoice
popup.amount = amount
popup.requestor = requestor if is_invoice else req.get('address')
popup.exp = format_time(exp) if exp else ''
popup.description = memo if memo else ''
popup.signature = req.get('signature', '')
popup.status = status
txid = req.get('txid')
popup.tx_hash = txid or ''
popup.on_open = lambda: popup.ids.output_list.update(req.get('outputs', []))
popup.open()
def qr_dialog(self, title, data, show_text=False):
from uix.dialogs.qr_dialog import QRDialog
popup = QRDialog(title, data, show_text)
popup.open()
def scan_qr(self, on_complete):
if platform != 'android':
return
from jnius import autoclass
from android import activity
PythonActivity = autoclass('org.renpy.android.PythonActivity')
Intent = autoclass('android.content.Intent')
intent = Intent("com.google.zxing.client.android.SCAN")
intent.putExtra("SCAN_MODE", "QR_CODE_MODE")
def on_qr_result(requestCode, resultCode, intent):
if requestCode == 0:
if resultCode == -1: # RESULT_OK:
contents = intent.getStringExtra("SCAN_RESULT")
if intent.getStringExtra("SCAN_RESULT_FORMAT") == 'QR_CODE':
on_complete(contents)
else:
self.show_error("wrong format " + intent.getStringExtra("SCAN_RESULT_FORMAT"))
activity.bind(on_activity_result=on_qr_result)
try:
PythonActivity.mActivity.startActivityForResult(intent, 0)
except:
self.show_error(_('Could not start Barcode Scanner.') + ' ' + _('Please install the Barcode Scanner app from ZXing'))
def build(self):
return Builder.load_file('gui/kivy/main.kv')
示例4: ElectrumWindow
# 需要導入模塊: from uix.dialogs.settings import SettingsDialog [as 別名]
# 或者: from uix.dialogs.settings.SettingsDialog import open [as 別名]
#.........這裏部分代碼省略.........
for tab in ["invoices", "send", "history", "receive", "requests"]:
self.update_tab(tab)
def switch_to(self, name):
s = getattr(self, name + "_screen", None)
if self.send_screen is None:
s = self.tabs.ids[name + "_screen"]
s.load_screen()
panel = self.tabs.ids.panel
tab = self.tabs.ids[name + "_tab"]
panel.switch_to(tab)
def show_request(self, addr):
self.switch_to("receive")
self.receive_screen.screen.address = addr
def show_pr_details(self, req, status, is_invoice):
from electrum.util import format_time
requestor = req.get("requestor")
exp = req.get("exp")
memo = req.get("memo")
amount = req.get("amount")
popup = Builder.load_file("gui/kivy/uix/ui_screens/invoice.kv")
popup.is_invoice = is_invoice
popup.amount = amount
popup.requestor = requestor if is_invoice else req.get("address")
popup.exp = format_time(exp) if exp else ""
popup.description = memo if memo else ""
popup.signature = req.get("signature", "")
popup.status = status
txid = req.get("txid")
popup.tx_hash = txid or ""
popup.on_open = lambda: popup.ids.output_list.update(req.get("outputs", []))
popup.open()
def qr_dialog(self, title, data, show_text=False):
from uix.dialogs.qr_dialog import QRDialog
popup = QRDialog(title, data, show_text)
popup.open()
def scan_qr(self, on_complete):
if platform != "android":
return
from jnius import autoclass
from android import activity
PythonActivity = autoclass("org.renpy.android.PythonActivity")
Intent = autoclass("android.content.Intent")
intent = Intent("com.google.zxing.client.android.SCAN")
intent.putExtra("SCAN_MODE", "QR_CODE_MODE")
def on_qr_result(requestCode, resultCode, intent):
if requestCode == 0:
if resultCode == -1: # RESULT_OK:
contents = intent.getStringExtra("SCAN_RESULT")
if intent.getStringExtra("SCAN_RESULT_FORMAT") == "QR_CODE":
on_complete(contents)
else:
self.show_error("wrong format " + intent.getStringExtra("SCAN_RESULT_FORMAT"))
activity.bind(on_activity_result=on_qr_result)
try:
PythonActivity.mActivity.startActivityForResult(intent, 0)
except: