summaryrefslogtreecommitdiff
path: root/portato/gui/gtk/usetips.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/gui/gtk/usetips.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/portato/gui/gtk/usetips.py b/portato/gui/gtk/usetips.py
index 75bb63f..db970c1 100644
--- a/portato/gui/gtk/usetips.py
+++ b/portato/gui/gtk/usetips.py
@@ -51,26 +51,35 @@ class UseTips (TreeViewTooltips):
pkg = system.new_package(cpv)
enabled = []
disabled = []
+ expanded = set()
pkg_flags = pkg.get_all_use_flags()
- if len(pkg_flags) == 0: # no flags - stop here
+ if not pkg_flags: # no flags - stop here
return None
pkg_flags.sort()
for use in pkg_flags:
- if pkg.is_use_flag_enabled(use):
- enabled.append(use)
+ exp = pkg.use_expanded(use)
+ if exp:
+ expanded.add(exp)
+
else:
- disabled.append(use)
+ if pkg.is_use_flag_enabled(use):
+ enabled.append(use)
+ else:
+ disabled.append(use)
string = ""
- if len(enabled) > 0:
+ if enabled:
string = "<b>+%s</b>" % ("\n+".join(enabled),)
if len(disabled) > 0:
string = string + "\n"
- if len(disabled) > 0:
+ if disabled:
string = string+"<i>- %s</i>" % ("\n- ".join(disabled),)
+ if expanded:
+ string = string+"\n\n"+"\n".join(expanded)
+
return string