Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions qubes/api/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class SystemInfoCache:
"property-reset:default_dispvm",
"property-set:icon",
"property-reset:icon",
"property-set:label",
"property-reset:label",
"property-set:guivm",
"property-reset:guivm",
"property-set:relayvm",
Expand Down Expand Up @@ -131,6 +133,7 @@ def get_system_info(cls, app):
else None
),
"icon": str(domain.label.icon),
"label": str(domain.label.color),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See vm_events at the top of the file. See how icon was handled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Thanks for the tip.

"guivm": (
domain.guivm.name
if getattr(domain, "guivm", None)
Expand Down
4 changes: 4 additions & 0 deletions qubes/tests/api_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def test_010_get_system_info(self):
self.dom0.default_dispvm = None
self.dom0.template_for_dispvms = False
self.dom0.label.icon = "icon-dom0"
self.dom0.label.color = "0xffffff"
self.dom0.get_power_state.return_value = "Running"
self.dom0.uuid = uuid.UUID("00000000-0000-0000-0000-000000000000")
del self.dom0.guivm
Expand All @@ -232,6 +233,7 @@ def test_010_get_system_info(self):
vm.default_dispvm = vm
vm.template_for_dispvms = True
vm.label.icon = "icon-vm"
vm.label.color = "0xcc0000"
vm.guivm = vm
vm.get_power_state.return_value = "Halted"
vm.uuid = TEST_UUID
Expand All @@ -246,6 +248,7 @@ def test_010_get_system_info(self):
"template_for_dispvms": False,
"icon": "icon-dom0",
"internal": None,
"label": "0xffffff",
"guivm": None,
"power_state": "Running",
"relayvm": None,
Expand All @@ -259,6 +262,7 @@ def test_010_get_system_info(self):
"template_for_dispvms": True,
"icon": "icon-vm",
"internal": 1,
"label": "0xcc0000",
"guivm": "vm",
"power_state": "Halted",
"relayvm": None,
Expand Down