[magneto] tell the user not to shutdown nor reboot if the system upgrade started
This commit is contained in:
@@ -290,6 +290,8 @@ class MagnetoCore(MagnetoCoreUI):
|
||||
"""
|
||||
if activity == ActivityStates.UPDATING_REPOSITORIES:
|
||||
self.updating_signal()
|
||||
elif activity == ActivityStates.UPGRADING_SYSTEM:
|
||||
self.upgrading_signal()
|
||||
|
||||
def _repositories_updated_signal(self, result, message):
|
||||
"""
|
||||
@@ -394,6 +396,16 @@ class MagnetoCore(MagnetoCoreUI):
|
||||
_("Repositories are being updated automatically")
|
||||
)
|
||||
|
||||
def upgrading_signal(self):
|
||||
if not config.settings['APPLET_ENABLED']:
|
||||
return
|
||||
|
||||
# all fine, no updates
|
||||
self.update_tooltip(_("System upgrade started"))
|
||||
self.show_alert(_("System upgrade started"),
|
||||
_("Do not shutdown nor reboot the computer!")
|
||||
)
|
||||
|
||||
def is_system_on_batteries(self):
|
||||
"""
|
||||
Return whether System is running on batteries.
|
||||
|
||||
Reference in New Issue
Block a user