add send UI when using filepicker

This commit is contained in:
rra 2020-08-05 09:55:37 +02:00
parent 9416906649
commit 27a9de7c7b

View File

@ -100,16 +100,19 @@ class DropShip:
fpath = files[0].replace("file://", "")
Thread(target=self.wormhole_send, args=(self, fpath,)).start()
# UI response
self.update_send_ui()
else:
log.info("Multiple file sending coming soon ™")
def update_send_ui (self):
# UI response after adding files
self.drop_label.set_visible(False)
self.drop_label.set_vexpand(False)
self.drop_spinner.set_vexpand(True)
self.drop_spinner.set_visible(True)
self.drop_spinner.start()
else:
log.info("Multiple file sending coming soon ™")
def add_files(self, widget, event):
"""Handler for adding files with system interface"""
response = self.file_chooser.run()
@ -118,6 +121,8 @@ class DropShip:
fpath = self.file_chooser.get_filenames()[0]
Thread(target=self.wormhole_send, args=(self, fpath,)).start()
self.update_send_ui()
self.file_chooser.hide()
def read_wormhole_send_code(self, process):