Browse Source

copy code to clipboard automagically

unifiedWindowUI
rra 4 years ago
parent
commit
d98ea0de8a
  1. 2
      dropship.py
  2. 7
      ui_templates.py

2
dropship.py

@ -138,6 +138,8 @@ class DropShip:
output = await process.stderr.receive_some()
code = output.decode().split()[-1]
self.clipboard.set_text(code, -1)
self.transfer_code = code
self.drop_label.set_text(code)

7
ui_templates.py

@ -17,9 +17,8 @@ class pendingTransmissions(Gtk.Box):
# This must occur *after* you initialize your base
self.init_template()
#TODO (Roel)
self.fileNameLabel.set_ellipsize(2)
self.fileNameLabel.set_text(fileName)
self.fileNameLabel.set_text(fileName)
self.transmissionCodeButton.set_label(transferCode)
@Gtk.Template.Callback()
@ -29,6 +28,10 @@ class pendingTransmissions(Gtk.Box):
copy the code again to clipboard
'''
print('click')
code = widget.get_label()
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
clipboard.set_text(code, -1) #-1 is auto-size
@Gtk.Template.Callback()
def cancel_transfer(self,widget):

Loading…
Cancel
Save