From 660ecf34cc71b1307efc64a26516485859600771 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 27 Jul 2020 15:33:52 +0200 Subject: [PATCH] Use hide to avoid file picker explosion --- dropship.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dropship.py b/dropship.py index 609a562..478c0b8 100644 --- a/dropship.py +++ b/dropship.py @@ -108,13 +108,12 @@ class DropShip: def add_files(self, widget, event): """Handler for adding files with system interface""" response = self.file_chooser.run() + if response == gtk.ResponseType.OK: fpath = self.file_chooser.get_filenames()[0] Thread(target=self.wormhole_send, args=(self, fpath,)).start() - elif response == gtk.ResponseType.CANCEL: - # TODO(roel) something isn't right here.. maybe we need to initialize it every time we run it. - print("Cancel clicked") - self.file_chooser.destroy() + + self.file_chooser.hide() def read_wormhole_send_code(self, process): """Read wormhole send code from command-line output."""