diff options
author | Angelo Naselli <anaselli@linux.it> | 2021-01-18 22:36:30 +0100 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2021-01-18 22:36:30 +0100 |
commit | 076f95aa050a773982ee536440f6dadeae55dfaf (patch) | |
tree | 009c0804e81a6a0d67d558d381381c2a4baaf91f /lib/isodumper.py | |
parent | 32ada7135cf4e7789046e73424e19325ebf830e8 (diff) | |
download | isodumper-076f95aa050a773982ee536440f6dadeae55dfaf.tar isodumper-076f95aa050a773982ee536440f6dadeae55dfaf.tar.gz isodumper-076f95aa050a773982ee536440f6dadeae55dfaf.tar.bz2 isodumper-076f95aa050a773982ee536440f6dadeae55dfaf.tar.xz isodumper-076f95aa050a773982ee536440f6dadeae55dfaf.zip |
Managed loop in TUI
Diffstat (limited to 'lib/isodumper.py')
-rwxr-xr-x | lib/isodumper.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index 4770837..eba86c2 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -529,9 +529,10 @@ class IsoDumper(object): self.write_logfile() self.dialog.destroy() self.dialog = None - #TODO REMOVE if it works as it seems - #self.glib_loop.quit() - #self.glib_thread.join() + if yui.YUI.app().isTextMode(): + self.glib_loop.quit() + if yui.YUI.app().isTextMode(): + self.glib_thread.join() def write_logfile(self): logpath = os.path.join(os.path.expanduser('~'), '.isodumper') @@ -722,21 +723,20 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.dialog.recalcLayout() self.ancrage.showChild() self.uEventQueue = SimpleQueue() + if yui.YUI.app().isTextMode(): + self.glib_loop = GLib.MainLoop() + self.glib_thread = threading.Thread(target=self.glib_mainloop, args=(self.glib_loop,)) + self.glib_thread.start() + self.u.iface["org.freedesktop.DBus.ObjectManager"].InterfacesAdded.connect(self.device_changed) - #TODO REMOVE if it works as it seems - #self.glib_loop = GLib.MainLoop() - #self.glib_thread = threading.Thread(target=self.glib_mainloop, args=(self.glib_loop,)) - #self.glib_thread.start() - - #TODO REMOVE if it works as it seems - #def glib_mainloop(self, loop): - #''' - #thread function for glib main loop - #listen to signal from udisks - #''' - #self.u.iface["org.freedesktop.DBus.ObjectManager"].InterfacesAdded.connect(self.device_changed) - - #loop.run() + + + def glib_mainloop(self, loop): + ''' + thread function for glib main loop + ''' + loop.run() + def device_changed(self, a, b): self.uEventQueue.put({'event': "device-changed", 'value': True}) |