Skip to content

Commit

Permalink
Visually indicate unsupported Templates & StandaloneVMs in Qube Manager
Browse files Browse the repository at this point in the history
Fixes: QubesOS/qubes-issues#4581
(cherry picked from commit 31ec13c)
  • Loading branch information
alimirjamali authored and marmarek committed Sep 2, 2024
1 parent f701e83 commit b6985c5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def __init__(self):
"update" : QIcon(":/update-recommended.png"),
"outdated" : QIcon(":/outdated.png"),
"to-be-outdated" : QIcon(":/to-be-outdated.png"),
"eol": QIcon(':/warning.png')
}
self.outdatedTooltips = {
"update" : self.tr("Updates pending!"),
Expand All @@ -111,6 +112,9 @@ def __init__(self):
"to-be-outdated" : self.tr(
"The Template must be stopped before changes from its "
"current session can be picked up by this qube."),
"eol": self.tr(
"This qube is based on a distribution that is no longer "
"supported\nInstall new template with Template Manager")
}

def sizeHint(self, option, index):
Expand Down Expand Up @@ -239,10 +243,16 @@ def update_power_state(self):
except exc.QubesDaemonAccessError:
pass

if self.vm.klass in {'TemplateVM', 'StandaloneVM'} and \
manager_utils.get_feature(
if self.vm.klass in {'TemplateVM', 'StandaloneVM'}:
if manager_utils.get_feature(
self.vm, 'updates-available', False):
self.state['outdated'] = 'update'
self.state['outdated'] = 'update'
elif manager_utils.get_feature(
self.vm, 'os-eol', None):
eol_string: str = self.vm.features.get('os-eol', '')
eol = datetime.strptime(eol_string, '%Y-%m-%d')
if datetime.now() > eol:
self.state['outdated'] = 'eol'
except exc.QubesDaemonAccessError:
pass

Expand Down

0 comments on commit b6985c5

Please sign in to comment.