Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/181'
Browse files Browse the repository at this point in the history
* origin/pr/181:
  Add tooltip to application list in VM settings
  • Loading branch information
marmarek committed Aug 28, 2019
2 parents 1edf363 + 4567707 commit c32d63d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions qubesmanager/appmenu_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@
# TODO icon
# pylint: disable=too-few-public-methods
class AppListWidgetItem(PyQt5.QtWidgets.QListWidgetItem):
def __init__(self, name, ident, parent=None):
def __init__(self, name, ident, tooltip=None, parent=None):
super(AppListWidgetItem, self).__init__(name, parent)
# self.setToolTip(command)
if tooltip:
self.setToolTip(tooltip)
self.ident = ident

@classmethod
def from_line(cls, line):
ident, _icon_name, name = line.strip().split(maxsplit=2)
return cls(name=name, ident=ident)
ident, name, comment = line.split('|', maxsplit=3)
return cls(name=name, ident=ident, tooltip=comment)


class AppmenuSelectManager:
Expand All @@ -58,10 +59,10 @@ def fill_apps_list(self):
self.app_list.clear()

available_appmenus = [AppListWidgetItem.from_line(line)
for line in subprocess.check_output(
['qvm-appmenus',
'--get-available', '--i-understand-format-is-unstable',
self.vm.name]).decode().splitlines()]
for line in subprocess.check_output(
['qvm-appmenus', '--get-available',
'--i-understand-format-is-unstable', '--file-field',
'Comment', self.vm.name]).decode().splitlines()]

for app in available_appmenus:
if app.ident in self.whitelisted:
Expand Down

0 comments on commit c32d63d

Please sign in to comment.