Merge remote-tracking branch 'origin/pr/181'
* origin/pr/181: Add tooltip to application list in VM settings
This commit is contained in:
		
						commit
						c32d63df58
					
				| @ -27,15 +27,16 @@ import PyQt5.QtWidgets  # pylint: disable=import-error | ||||
| # 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: | ||||
| @ -59,9 +60,9 @@ class AppmenuSelectManager: | ||||
| 
 | ||||
|         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()] | ||||
|                 ['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: | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Marek Marczykowski-Górecki
						Marek Marczykowski-Górecki