diff options
Diffstat (limited to '')
-rw-r--r-- | portato/gui/gtk/usetips.py | 22 | ||||
-rw-r--r-- | portato/gui/gtk/windows.py | 26 | ||||
-rw-r--r-- | portato/gui/gtk/wrapper.py | 17 |
3 files changed, 50 insertions, 15 deletions
diff --git a/portato/gui/gtk/usetips.py b/portato/gui/gtk/usetips.py index 1d8ce20..2c51d88 100644 --- a/portato/gui/gtk/usetips.py +++ b/portato/gui/gtk/usetips.py @@ -53,21 +53,35 @@ class UseTips (TreeViewTooltips): disabled = [] expanded = set() - pkg_flags = pkg.get_all_use_flags() + pkg_flags = pkg.get_iuse_flags() if not pkg_flags: # no flags - stop here return None pkg_flags.sort() + actual = pkg.get_actual_use_flags() + + if pkg.is_installed(): + installed = pkg.get_installed_use_flags() + else: + inst = system.find_installed_packages(pkg.get_slot_cp()) + if inst: + installed = inst[0].get_installed_use_flags() + else: + installed = [] + for use in pkg_flags: exp = pkg.use_expanded(use) if exp: expanded.add(exp) else: - if pkg.is_use_flag_enabled(use): - enabled.append(use) + useStr = use + if installed and ((use in actual) != (use in installed)): + useStr += " %" + if use in actual: + enabled.append(useStr) else: - disabled.append(use) + disabled.append(useStr) string = "" diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py index c0037af..bf6f0f7 100644 --- a/portato/gui/gtk/windows.py +++ b/portato/gui/gtk/windows.py @@ -509,41 +509,49 @@ class PackageTable: def fill_use_list(self): pkg = self.actual_package() - pkg_flags = pkg.get_all_use_flags() + pkg_flags = pkg.get_iuse_flags() pkg_flags.sort() actual_exp = None actual_exp_it = None + euse = pkg.get_actual_use_flags() + instuse = pkg.get_installed_use_flags() + store = self.useList.get_model() for use in pkg_flags: exp = pkg.use_expanded(use, suggest = actual_exp) if exp is not None: if exp != actual_exp: - actual_exp_it = store.append(None, [None, exp, "<i>%s</i>" % _("This is an expanded use flag and cannot be selected")]) + actual_exp_it = store.append(None, [None, None, exp, "<i>%s</i>" % _("This is an expanded use flag and cannot be selected")]) actual_exp = exp else: actual_exp_it = None actual_exp = None - store.append(actual_exp_it, [pkg.is_use_flag_enabled(use), use, system.get_use_desc(use, self.cp)]) + enabled = use in euse + installed = use in instuse + store.append(actual_exp_it, [enabled, installed, use, system.get_use_desc(use, self.cp)]) def build_use_list (self): """Builds the useList.""" - store = gtk.TreeStore(bool, str, str) + store = gtk.TreeStore(bool, bool, str, str) self.useList.set_model(store) # build view cell = gtk.CellRendererText() + iCell = gtk.CellRendererToggle() + iCell.set_property("activatable", False) tCell = gtk.CellRendererToggle() tCell.set_property("activatable", True) tCell.connect("toggled", self.cb_use_flag_toggled, store) self.useList.append_column(gtk.TreeViewColumn(_("Enabled"), tCell, active = 0)) - self.useList.append_column(gtk.TreeViewColumn(_("Flag"), cell, text = 1)) - self.useList.append_column(gtk.TreeViewColumn(_("Description"), cell, markup = 2)) + self.useList.append_column(gtk.TreeViewColumn(_("Installed"), iCell, active = 1)) + self.useList.append_column(gtk.TreeViewColumn(_("Flag"), cell, text = 2)) + self.useList.append_column(gtk.TreeViewColumn(_("Description"), cell, markup = 3)) - self.useList.set_search_column(1) + self.useList.set_search_column(2) self.useList.set_enable_tree_lines(True) def build_vers_list (self): @@ -793,10 +801,10 @@ class PackageTable: def cb_use_flag_toggled (self, cell, path, store): """Callback for a toggled use-flag button.""" - flag = store[path][1] + flag = store[path][2] pkg = self.actual_package() - if flag in pkg.get_global_settings("USE_EXPAND").split(" "): # ignore expanded flags + if flag in pkg.get_global_settings("USE_EXPAND").split(): # ignore expanded flags return False store[path][0] = not store[path][0] diff --git a/portato/gui/gtk/wrapper.py b/portato/gui/gtk/wrapper.py index 286cffd..f085efa 100644 --- a/portato/gui/gtk/wrapper.py +++ b/portato/gui/gtk/wrapper.py @@ -30,19 +30,32 @@ class GtkTree (Tree): self.emergeIt = self.append(None, ["Emerge", ""]) self.unmergeIt = self.append(None, ["Unmerge", ""]) - def build_append_value (self, cpv, oneshot = False, update = False, version = None): + def build_append_value (self, cpv, oneshot = False, update = False, downgrade = False, version = None, useChange = []): string = "" if oneshot: string += "<i>%s</i>" % _("oneshot") - if update: string += "; " if update: + if oneshot: string += "; " if version is not None: string += "<i>%s</i>" % (_("updating from version %s") % version) else: string += "<i>%s</i>" % _("updating") + elif downgrade: + if oneshot: string += "; " + if version is not None: + string += "<i>%s</i>" % (_("downgrading from version %s") % version) + else: + string += "<i>%s</i>" % _("downgrading") + + if useChange: + if update or downgrade or oneshot: string += "; " + string += "<i><b>%s </b></i>" % _("IUSE changes:") + useChange.sort() + string += "<i>%s</i>" % " ".join(useChange) + return [cpv, string] def get_emerge_it (self): |