本文整理汇总了Python中uix.dialogs.password_dialog.PasswordDialog.open方法的典型用法代码示例。如果您正苦于以下问题:Python PasswordDialog.open方法的具体用法?Python PasswordDialog.open怎么用?Python PasswordDialog.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uix.dialogs.password_dialog.PasswordDialog
的用法示例。
在下文中一共展示了PasswordDialog.open方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: password_dialog
# 需要导入模块: from uix.dialogs.password_dialog import PasswordDialog [as 别名]
# 或者: from uix.dialogs.password_dialog.PasswordDialog import open [as 别名]
def password_dialog(self, title, f, args):
from uix.dialogs.password_dialog import PasswordDialog
def callback(pw):
Clock.schedule_once(lambda x: apply(f, args + (pw,)), 0.1)
popup = PasswordDialog(title, callback)
popup.open()
示例2: ElectrumWindow
# 需要导入模块: from uix.dialogs.password_dialog import PasswordDialog [as 别名]
# 或者: from uix.dialogs.password_dialog.PasswordDialog 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')
示例3: ElectrumWindow
# 需要导入模块: from uix.dialogs.password_dialog import PasswordDialog [as 别名]
# 或者: from uix.dialogs.password_dialog.PasswordDialog 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: