Skip to content

Commit 7ce814a

Browse files
Warn from system tray when reboot is required (#991)
* Add warning tray icon Based on `mintupdate-error-symbolic.svg` GTK SVG color use reference: https://docs.gtk.org/gtk4/icon-format.html#supported-svg-attributes * Use warning tray icon when reboot is required Prioritize the 'reboot required' icon over 'available updates' according to mtwebster's feedback and continue informing if there are selected updates. Also align with the opening delimiter, based on PEP8 style guide. Reference: https://peps.python.org/pep-0008/#indentation Co-authored-by: Michael Webster <[email protected]> --------- Co-authored-by: Michael Webster <[email protected]>
1 parent 1811c83 commit 7ce814a

File tree

2 files changed

+90
-4
lines changed

2 files changed

+90
-4
lines changed

usr/lib/linuxmint/mintUpdate/mintUpdate.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,13 @@ def show_error(self, error_msg):
639639

640640
@_idle
641641
def show_updates_in_UI(self, num_visible, num_software, num_security, download_size, is_self_update, model_items):
642+
status_string = ""
643+
642644
if num_visible > 0:
643645
self.logger.write("Found %d software updates" % num_visible)
644646
if is_self_update:
645647
self.ui_stack.set_visible_child_name("self_update_page")
646648
self.ui_statusbar.set_visible(False)
647-
status_string = ""
648649
details = []
649650

650651
for item in model_items:
@@ -660,13 +661,19 @@ def show_updates_in_UI(self, num_visible, num_software, num_security, download_s
660661
self.ui_install_button.set_sensitive(True)
661662
self.ui_window.set_sensitive(True)
662663
systray_tooltip = gettext.ngettext("%d update available", "%d updates available", num_visible) % num_visible
663-
self.set_status(status_string, systray_tooltip, "mintupdate-updates-available-symbolic", True)
664+
665+
if not self.reboot_required:
666+
self.set_status(status_string, systray_tooltip, "mintupdate-updates-available-symbolic", True)
664667
else:
665668
self.logger.write("System is up to date")
666669
self.ui_stack.set_visible_child_name("success_page")
667-
self.set_status("", _("Your system is up to date"), "mintupdate-up-to-date-symbolic",
668-
not self.settings.get_boolean("hide-systray"))
669670

671+
if not self.reboot_required:
672+
self.set_status("", _("Your system is up to date"), "mintupdate-up-to-date-symbolic",
673+
not self.settings.get_boolean("hide-systray"))
674+
675+
if self.reboot_required:
676+
self.set_status(status_string, _("Reboot required"), "mintupdate-warning-symbolic", True)
670677

671678
self.ui_notebook_details.set_current_page(0)
672679

Lines changed: 79 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)