summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/Changelog1
-rw-r--r--doc/TODO1
-rw-r--r--portato/backend/package.py6
-rw-r--r--portato/backend/portage/package.py8
-rw-r--r--portato/gui/gtk/windows.py1
-rw-r--r--portato/gui/qt/windows.py3
6 files changed, 19 insertions, 1 deletions
diff --git a/doc/Changelog b/doc/Changelog
index cbe9603..1d59dc1 100644
--- a/doc/Changelog
+++ b/doc/Changelog
@@ -1,6 +1,7 @@
next:
- added name of overlay the package comes from
- filtering "--ask" from EMERGE_DEFAULT_OPTS
+- show reason for a package being masked as a tooltip
0.7.3:
- fixed bugs
diff --git a/doc/TODO b/doc/TODO
index dffba57..241b31b 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -18,7 +18,6 @@ GUI:
- show current emerge process in Window-Title (similar to the Console)
- return from console after finishing emerge
-- show reason for masked packages
Main Point: user preferences:
- window size / location
diff --git a/portato/backend/package.py b/portato/backend/package.py
index 59d552b..b32268f 100644
--- a/portato/backend/package.py
+++ b/portato/backend/package.py
@@ -283,6 +283,12 @@ class Package:
@rtype: boolean"""
raise NotImplementedError
+
+ def get_masking_reason (self):
+ """Returns the reason for masking the package. If this is not possible for the system, return None.
+
+ @returns: the reason for masking the package
+ @rtype: string"""
def get_all_use_flags (self, installed = False):
"""Returns a list of _all_ useflags for this package, i.e. all useflags you can set for this package.
diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py
index e39dbe2..9f40137 100644
--- a/portato/backend/portage/package.py
+++ b/portato/backend/portage/package.py
@@ -112,6 +112,14 @@ class PortagePackage (Package):
return False
+ def get_masking_reason(self):
+ reason = portage.getmaskingreason(self.get_cpv(), settings = self._settings.settings)
+
+ if reason:
+ return reason[:-1] # strip of last \n
+ else:
+ return reason
+
def get_all_use_flags (self, installed = False):
if installed or not self.is_in_system():
tree = self._settings.vartree
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index 79e24b4..c77787a 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -581,6 +581,7 @@ class PackageTable:
self.emergeBtn.set_sensitive(True)
self.installedCheck.set_active(pkg.is_installed())
+ gtk.Tooltips().set_tip(self.maskedCheck, pkg.get_masking_reason()) # this returns None if it is not masked =)
if pkg.is_masked(use_changed = False) and not pkg.is_masked(use_changed = True):
self.maskedCheck.set_label("<i>(Masked)</i>")
self.maskedCheck.get_child().set_use_markup(True)
diff --git a/portato/gui/qt/windows.py b/portato/gui/qt/windows.py
index 904b07f..31addc3 100644
--- a/portato/gui/qt/windows.py
+++ b/portato/gui/qt/windows.py
@@ -545,6 +545,9 @@ class PackageDetails:
self.window.pkgEmergeBtn.setEnabled(True)
self.window.installedCheck.setCheckState(qCheck(pkg.is_installed()))
+ masking_reason = pkg.get_masking_reason() or "" # set to "" if the reason is None
+ self.window.maskedCheck.setToolTip(masking_reason)
+
if pkg.is_masked(use_changed = False) and not pkg.is_masked(use_changed = True):
self.window.maskedCheck.setText("(Masked)")
else: