diff --git a/legendary/downloader/log_dlm.py b/legendary/downloader/log_dlm.py index 98a34d9..4b6920f 100644 --- a/legendary/downloader/log_dlm.py +++ b/legendary/downloader/log_dlm.py @@ -10,7 +10,7 @@ class log_dlm: else: print("bar",main_window.get_title(),main_window) #self.update_gui_setup(dlm=dlm, bar=main_window.progress_bar) - self.update_gui_setup(dlm, main_window.progress_bar) + #self.update_gui_setup(dlm, main_window.progress_bar) print(main_window.progress_bar) return main_window.progress_bar @@ -38,7 +38,7 @@ class log_dlm: #r_speed) else: print("update_gui") - self.update_gui(dlm, dlm.obj_out) + #self.update_gui(dlm, dlm.obj_out) #self.update_gui( # dlm, # perc, diff --git a/legendary/gui/gui.py b/legendary/gui/gui.py index 972ab5f..514909d 100755 --- a/legendary/gui/gui.py +++ b/legendary/gui/gui.py @@ -765,16 +765,17 @@ def install_gtk(app_name, app_title, parent): dlm.proc_debug = args.dlm_debug #print("parent:",parent) - dlm.perc = 0 - dlm.dl_speed = 0 - dlm.hours = 0 - dlm.minutes = 0 - dlm.seconds = 0 + # dlm.perc = 0 + # dlm.dl_speed = 0 + # dlm.hours = 0 + # dlm.minutes = 0 + # dlm.seconds = 0 #bar.set_text(f"{dlm.dl_speed / 1024 / 1024:.02f} MiB/s - {(dlm.perc*100):.02f}% - ETA: {dlm.hours:02d}:{dlm.minutes:02d}:{dlm.seconds:02d}") - parent.timeout_id = GLib.timeout_add(1000, update_gui, dlm, parent.progress_bar) - print("timeout_add -",parent.timeout_id) dlm.start() - #dlm.join() + #time.sleep(4) + #parent.timeout_id = GLib.timeout_add(1000, update_gui, dlm, parent.progress_bar) + #print("timeout_add -",parent.timeout_id) + dlm.join() except Exception as e: end_t = time.time() #log_gtk(f'Installation failed after {end_t - start_t:.02f} seconds.' diff --git a/legendary/gui/manager2.py b/legendary/gui/manager2.py index 978452d..66ceffd 100644 --- a/legendary/gui/manager2.py +++ b/legendary/gui/manager2.py @@ -19,6 +19,9 @@ from legendary.models.downloading import * from legendary.models.manifest import ManifestComparison, Manifest from legendary.downloader.log_dlm import log_dlm +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk, GLib log_dlm = log_dlm() class DLManager(Process): @@ -669,6 +672,8 @@ class DLManager(Process): self.obj_out = log_dlm.create(self, main_window) print("created obj_out:", self.obj_out) + self.timeout_id = GLib.timeout_add(100, log_dlm.update_gui, self, self.obj_out) + print("timeout_add -",self.timeout_id) last_update = time.time() print("before loop") @@ -717,7 +722,7 @@ class DLManager(Process): #debug print("loop") print("almost updated obj_out") - self.obj_out = "cli" + #self.obj_out = "cli" #if self.obj_out == "cli": log_dlm.update(self) #self.perc,