fix: make updater show actual error messages in popup
This commit is contained in:
@@ -904,16 +904,18 @@ class App(ctk.CTk):
|
||||
self.after(0, lambda: self._set_status(msg, T["warn"]))
|
||||
self.after(0, lambda: self.total_bar.set(pct / 100))
|
||||
def _go():
|
||||
ok = download_and_install_update(rel, progress_callback=_p)
|
||||
self.after(0, lambda: self._upd_fin(ok))
|
||||
ok, msg = download_and_install_update(rel, progress_callback=_p)
|
||||
self.after(0, lambda: self._upd_fin(ok, msg))
|
||||
import threading
|
||||
threading.Thread(target=_go, daemon=True).start()
|
||||
|
||||
def _upd_fin(self, ok):
|
||||
def _upd_fin(self, ok, msg=""):
|
||||
self.update_btn.configure(state="normal", text=" Update prüfen")
|
||||
if ok:
|
||||
messagebox.showinfo("Update", "Bitte neu starten.")
|
||||
messagebox.showinfo("Update", "Update erfolgreich installiert! Bitte das Programm neu starten.")
|
||||
else:
|
||||
self._set_status("Update fehlgeschlagen", T["error"])
|
||||
messagebox.showerror("Update fehlgeschlagen", msg)
|
||||
self.after(30, self._activate)
|
||||
|
||||
# =================================================================
|
||||
|
||||
Reference in New Issue
Block a user