mirror of
https://github.com/derrod/legendary.git
synced 2025-08-28 04:21:01 +00:00
2021-02-05_21-30-09
This commit is contained in:
parent
671a8b3c1f
commit
65e95ce066
|
@ -10,7 +10,7 @@ class log_dlm:
|
||||||
else:
|
else:
|
||||||
print("bar",main_window.get_title(),main_window)
|
print("bar",main_window.get_title(),main_window)
|
||||||
#self.update_gui_setup(dlm=dlm, bar=main_window.progress_bar)
|
#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)
|
print(main_window.progress_bar)
|
||||||
return main_window.progress_bar
|
return main_window.progress_bar
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class log_dlm:
|
||||||
#r_speed)
|
#r_speed)
|
||||||
else:
|
else:
|
||||||
print("update_gui")
|
print("update_gui")
|
||||||
self.update_gui(dlm, dlm.obj_out)
|
#self.update_gui(dlm, dlm.obj_out)
|
||||||
#self.update_gui(
|
#self.update_gui(
|
||||||
# dlm,
|
# dlm,
|
||||||
# perc,
|
# perc,
|
||||||
|
|
|
@ -765,16 +765,17 @@ def install_gtk(app_name, app_title, parent):
|
||||||
dlm.proc_debug = args.dlm_debug
|
dlm.proc_debug = args.dlm_debug
|
||||||
|
|
||||||
#print("parent:",parent)
|
#print("parent:",parent)
|
||||||
dlm.perc = 0
|
# dlm.perc = 0
|
||||||
dlm.dl_speed = 0
|
# dlm.dl_speed = 0
|
||||||
dlm.hours = 0
|
# dlm.hours = 0
|
||||||
dlm.minutes = 0
|
# dlm.minutes = 0
|
||||||
dlm.seconds = 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}")
|
#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.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:
|
except Exception as e:
|
||||||
end_t = time.time()
|
end_t = time.time()
|
||||||
#log_gtk(f'Installation failed after {end_t - start_t:.02f} seconds.'
|
#log_gtk(f'Installation failed after {end_t - start_t:.02f} seconds.'
|
||||||
|
|
|
@ -19,6 +19,9 @@ from legendary.models.downloading import *
|
||||||
from legendary.models.manifest import ManifestComparison, Manifest
|
from legendary.models.manifest import ManifestComparison, Manifest
|
||||||
from legendary.downloader.log_dlm import log_dlm
|
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()
|
log_dlm = log_dlm()
|
||||||
|
|
||||||
class DLManager(Process):
|
class DLManager(Process):
|
||||||
|
@ -669,6 +672,8 @@ class DLManager(Process):
|
||||||
|
|
||||||
self.obj_out = log_dlm.create(self, main_window)
|
self.obj_out = log_dlm.create(self, main_window)
|
||||||
print("created obj_out:", self.obj_out)
|
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()
|
last_update = time.time()
|
||||||
print("before loop")
|
print("before loop")
|
||||||
|
@ -717,7 +722,7 @@ class DLManager(Process):
|
||||||
|
|
||||||
#debug print("loop")
|
#debug print("loop")
|
||||||
print("almost updated obj_out")
|
print("almost updated obj_out")
|
||||||
self.obj_out = "cli"
|
#self.obj_out = "cli"
|
||||||
#if self.obj_out == "cli":
|
#if self.obj_out == "cli":
|
||||||
log_dlm.update(self)
|
log_dlm.update(self)
|
||||||
#self.perc,
|
#self.perc,
|
||||||
|
|
Loading…
Reference in a new issue