mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 17:01:34 +00:00
lightning: paste sample using clipboard
This commit is contained in:
parent
6aebc0fd5d
commit
ae7bce3385
1 changed files with 6 additions and 4 deletions
|
@ -28,8 +28,8 @@ Builder.load_string('''
|
||||||
text: _('Paste')
|
text: _('Paste')
|
||||||
on_release: s.do_paste()
|
on_release: s.do_paste()
|
||||||
Button:
|
Button:
|
||||||
text: _('Paste sample')
|
text: _('Paste using xclip')
|
||||||
on_release: s.do_paste_sample()
|
on_release: s.do_paste_xclip()
|
||||||
Button:
|
Button:
|
||||||
text: _('Clear')
|
text: _('Clear')
|
||||||
on_release: s.do_clear()
|
on_release: s.do_clear()
|
||||||
|
@ -60,8 +60,10 @@ class LightningPayerDialog(Factory.Popup):
|
||||||
def dismiss(self, *args, **kwargs):
|
def dismiss(self, *args, **kwargs):
|
||||||
super(LightningPayerDialog, self).dismiss(*args, **kwargs)
|
super(LightningPayerDialog, self).dismiss(*args, **kwargs)
|
||||||
self.app.wallet.network.lightningrpc.setConsole(None)
|
self.app.wallet.network.lightningrpc.setConsole(None)
|
||||||
def do_paste_sample(self):
|
def do_paste_xclip(self):
|
||||||
self.invoice_data = "lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d73gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ecky03ylcqca784w"
|
import subprocess
|
||||||
|
proc = subprocess.run(["xclip","-sel","clipboard","-o"], stdout=subprocess.PIPE)
|
||||||
|
self.invoice_data = proc.stdout.decode("ascii")
|
||||||
def do_paste(self):
|
def do_paste(self):
|
||||||
contents = self.app._clipboard.paste()
|
contents = self.app._clipboard.paste()
|
||||||
if not contents:
|
if not contents:
|
||||||
|
|
Loading…
Add table
Reference in a new issue