mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 03:34:15 +02:00
fix: cleaning tray icon update state after updating
This commit is contained in:
@@ -27,7 +27,6 @@ class UpdateCheck(QThread):
|
||||
def run(self):
|
||||
|
||||
while True:
|
||||
|
||||
updates = self.manager.list_updates()
|
||||
self.signal.emit(updates)
|
||||
time.sleep(self.check_interval)
|
||||
@@ -81,6 +80,9 @@ class TrayIcon(QSystemTrayIcon):
|
||||
if reason == self.Trigger:
|
||||
self.show_manage_window()
|
||||
|
||||
def verify_updates(self):
|
||||
self.notify_updates(self.manager.list_updates())
|
||||
|
||||
def notify_updates(self, updates: List[ApplicationUpdate]):
|
||||
|
||||
self.lock_notify.acquire()
|
||||
|
||||
@@ -499,6 +499,9 @@ class ManageWindow(QWidget):
|
||||
system.notify_user('{} {}'.format(updated, self.locale_keys['notification.update_selected.success']))
|
||||
|
||||
self.refresh_apps()
|
||||
|
||||
if self.tray_icon:
|
||||
self.tray_icon.verify_updates()
|
||||
else:
|
||||
if self._can_notify_user():
|
||||
system.notify_user(self.locale_keys['notification.update_selected.failed'])
|
||||
|
||||
Reference in New Issue
Block a user