[GTKUI] Autofill infohash entry from clipboard
This commit is contained in:
parent
f57ee74ee2
commit
f739269dfd
|
@ -738,6 +738,12 @@ class AddTorrentDialog(component.Component):
|
||||||
dialog.set_default_response(gtk.RESPONSE_OK)
|
dialog.set_default_response(gtk.RESPONSE_OK)
|
||||||
dialog.set_transient_for(self.dialog)
|
dialog.set_transient_for(self.dialog)
|
||||||
entry.grab_focus()
|
entry.grab_focus()
|
||||||
|
|
||||||
|
text = (gtk.clipboard_get(selection='PRIMARY').wait_for_text() or
|
||||||
|
gtk.clipboard_get().wait_for_text()).strip()
|
||||||
|
if len(text) == 40:
|
||||||
|
entry.set_text(text)
|
||||||
|
|
||||||
dialog.show_all()
|
dialog.show_all()
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
infohash = entry.get_text().strip()
|
infohash = entry.get_text().strip()
|
||||||
|
|
Loading…
Reference in New Issue