mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 02:54:16 +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):
|
def run(self):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
updates = self.manager.list_updates()
|
updates = self.manager.list_updates()
|
||||||
self.signal.emit(updates)
|
self.signal.emit(updates)
|
||||||
time.sleep(self.check_interval)
|
time.sleep(self.check_interval)
|
||||||
@@ -81,6 +80,9 @@ class TrayIcon(QSystemTrayIcon):
|
|||||||
if reason == self.Trigger:
|
if reason == self.Trigger:
|
||||||
self.show_manage_window()
|
self.show_manage_window()
|
||||||
|
|
||||||
|
def verify_updates(self):
|
||||||
|
self.notify_updates(self.manager.list_updates())
|
||||||
|
|
||||||
def notify_updates(self, updates: List[ApplicationUpdate]):
|
def notify_updates(self, updates: List[ApplicationUpdate]):
|
||||||
|
|
||||||
self.lock_notify.acquire()
|
self.lock_notify.acquire()
|
||||||
|
|||||||
@@ -499,6 +499,9 @@ class ManageWindow(QWidget):
|
|||||||
system.notify_user('{} {}'.format(updated, self.locale_keys['notification.update_selected.success']))
|
system.notify_user('{} {}'.format(updated, self.locale_keys['notification.update_selected.success']))
|
||||||
|
|
||||||
self.refresh_apps()
|
self.refresh_apps()
|
||||||
|
|
||||||
|
if self.tray_icon:
|
||||||
|
self.tray_icon.verify_updates()
|
||||||
else:
|
else:
|
||||||
if self._can_notify_user():
|
if self._can_notify_user():
|
||||||
system.notify_user(self.locale_keys['notification.update_selected.failed'])
|
system.notify_user(self.locale_keys['notification.update_selected.failed'])
|
||||||
|
|||||||
Reference in New Issue
Block a user