summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/backend/flags.py3
-rw-r--r--portato/backend/package.py49
-rw-r--r--portato/backend/portage/package.py24
-rw-r--r--portato/backend/portage/system.py35
-rw-r--r--portato/gui/gtk/usetips.py22
-rw-r--r--portato/gui/gtk/windows.py26
-rw-r--r--portato/gui/gtk/wrapper.py17
-rw-r--r--portato/gui/gui_helper.py23
-rw-r--r--portato/gui/templates/portato.glade423
-rw-r--r--portato/gui/wrapper.py6
10 files changed, 324 insertions, 304 deletions
diff --git a/portato/backend/flags.py b/portato/backend/flags.py
index dd1e462..99ff56f 100644
--- a/portato/backend/flags.py
+++ b/portato/backend/flags.py
@@ -382,6 +382,7 @@ def write_use_flags ():
# reset
useFlags = {}
newUseFlags = {}
+ system.reload_settings()
### MASKING PART ###
new_masked = {}
@@ -586,6 +587,7 @@ def write_masked ():
# reset
new_masked = {}
new_unmasked = {}
+ system.reload_settings()
### TESTING PART ###
newTesting = {}
@@ -704,3 +706,4 @@ def write_testing ():
f.close()
# reset
newTesting = {}
+ system.reload_settings()
diff --git a/portato/backend/package.py b/portato/backend/package.py
index ef0be11..343dc51 100644
--- a/portato/backend/package.py
+++ b/portato/backend/package.py
@@ -74,7 +74,7 @@ class Package (object):
if self.is_installed():
uses = set(self.get_use_flags().split()) # all set at installation time
- iuses = set(self.get_all_use_flags(installed=True)) # all you can set for the package
+ iuses = set(self.get_iuse_flags(installed=True)) # all you can set for the package
return list(uses.intersection(iuses))
else:
@@ -89,23 +89,22 @@ class Package (object):
return flags.get_new_use_flags(self)
def get_actual_use_flags (self):
- """This returns the result of installed_use_flags + new_use_flags. If the package is not installed, it returns only the new flags.
+ """This returns all currently set use-flags including the new ones.
@return: list of flags
@rtype: string[]"""
- if self.is_installed():
- i_flags = self.get_installed_use_flags()
- for f in self.get_new_use_flags():
-
+ i_flags = self.get_global_settings("USE").split()
+ for f in self.get_new_use_flags():
+
+ if f[0] == '-':
if flags.invert_use_flag(f) in i_flags:
i_flags.remove(flags.invert_use_flag(f))
-
- elif f not in i_flags:
- i_flags.append(f)
- return i_flags
- else:
- return self.get_new_use_flags()
+
+ elif f not in i_flags:
+ i_flags.append(f)
+
+ return i_flags
def set_use_flag (self, flag):
"""Set a use-flag.
@@ -120,28 +119,6 @@ class Package (object):
flags.remove_new_use_flags(self)
- def is_use_flag_enabled (self, flag):
- """Looks whether a given useflag is enabled for the package, taking all options
- (ie. even the new flags) into account.
-
- @param flag: the flag to check
- @type flag: string
- @returns: True or False
- @rtype: bool"""
-
- if self.is_installed() and flag in self.get_actual_use_flags(): # flags set during install
- return True
-
- elif (not self.is_installed()) and flag in self.get_global_settings("USE").split() \
- and not flags.invert_use_flag(flag) in self.get_new_use_flags(): # flags that would be set
- return True
-
- elif flag in self.get_new_use_flags():
- return True
-
- else:
- return False
-
def use_expanded (self, flag, suggest = None):
"""Tests whether a useflag is an expanded one. If it is, this method returns the USE_EXPAND-value.
@@ -156,7 +133,7 @@ class Package (object):
if flag.startswith(suggest.lower()):
return suggest
- for exp in self.get_global_settings("USE_EXPAND").split(" "):
+ for exp in self.get_global_settings("USE_EXPAND").split():
lexp = exp.lower()
if flag.startswith(lexp):
return exp
@@ -290,7 +267,7 @@ class Package (object):
@returns: the reason for masking the package
@rtype: string"""
- def get_all_use_flags (self, installed = False):
+ def get_iuse_flags (self, installed = False):
"""Returns a list of _all_ useflags for this package, i.e. all useflags you can set for this package.
@param installed: do not take the ones stated in the ebuild, but the ones it has been installed with
diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py
index 7ab1713..65522ec 100644
--- a/portato/backend/portage/package.py
+++ b/portato/backend/portage/package.py
@@ -124,7 +124,7 @@ class PortagePackage (Package):
else:
return reason
- def get_all_use_flags (self, installed = False):
+ def get_iuse_flags (self, installed = False):
if installed or not self.is_in_system():
tree = self._settings.vartree
else:
@@ -134,22 +134,13 @@ class PortagePackage (Package):
def get_matched_dep_packages (self, depvar):
# change the useflags, because we have internally changed some, but not made them visible for portage
- newUseFlags = self.get_new_use_flags()
- actual = self.get_global_settings("USE").split()
- if newUseFlags:
- for u in newUseFlags:
- if u[0] == "-" and flags.invert_use_flag(u) in actual:
- actual.remove(flags.invert_use_flag(u))
- elif u not in actual:
- actual.append(u)
+ actual = self.get_actual_use_flags()
depstring = ""
for d in depvar:
- depstring += self.get_package_settings(d)+" "
+ depstring += self.get_package_settings(d, tree = self._settings.porttree)+" "
- portage_dep._dep_check_strict = False
deps = portage.dep_check(depstring, None, self._settings.settings, myuse = actual, trees = self._trees)
- portage_dep._dep_check_strict = True
if not deps: # FIXME: what is the difference to [1, []] ?
return []
@@ -171,14 +162,7 @@ class PortagePackage (Package):
dep_pkgs = [] # the package list
# change the useflags, because we have internally changed some, but not made them visible for portage
- newUseFlags = self.get_new_use_flags()
- actual = self.get_global_settings("USE").split()
- if newUseFlags:
- for u in newUseFlags:
- if u[0] == "-" and flags.invert_use_flag(u) in actual:
- actual.remove(flags.invert_use_flag(u))
- elif u not in actual:
- actual.append(u)
+ actual = self.get_actual_use_flags()
depstring = ""
for d in depvar:
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index c40473e..f6b2a3b 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -323,11 +323,19 @@ class PortageSystem (SystemInterface):
checked = []
updating = []
- raw_checked = []
+ raw_checked = {}
def check (p, add_not_installed = True):
"""Checks whether a package is updated or not."""
- if p.get_cp() in checked: return
- else: checked.append(p.get_cp())
+
+ if p.get_slot_cp() in checked:
+ return
+ else:
+ if (not p.is_installed()) and (not add_not_installed):
+ # don't add these packages to checked as we may see them again
+ # - and then we might have add_not_installed being True
+ return
+ else:
+ checked.append(p.get_slot_cp())
appended = False
tempDeep = False
@@ -339,11 +347,9 @@ class PortageSystem (SystemInterface):
else:
oldList = self.sort_package_list(self.find_installed_packages(p.get_cp()))
if not oldList:
- if add_not_installed:
- info(_("Found a not installed dependency: %s.") % p.get_cpv())
- oldList = [p]
- else:
- return
+ info(_("Found a not installed dependency: %s.") % p.get_cpv())
+ oldList = [p]
+
old = oldList[-1]
updating.append((p, old))
@@ -352,8 +358,8 @@ class PortageSystem (SystemInterface):
if newuse and p.is_installed() and p.is_in_system(): # there is no use to check newuse for a package which is not existing in portage anymore :)
- new_iuse = set(p.get_all_use_flags(installed = False)) # IUSE in the ebuild
- old_iuse = set(p.get_all_use_flags(installed = True)) # IUSE in the vardb
+ new_iuse = set(p.get_iuse_flags(installed = False)) # IUSE in the ebuild
+ old_iuse = set(p.get_iuse_flags(installed = True)) # IUSE in the vardb
if new_iuse.symmetric_difference(old_iuse): # difference between new_iuse and old_iuse
tempDeep = True
@@ -362,10 +368,7 @@ class PortageSystem (SystemInterface):
appended = True
else:
- old = set(p.get_installed_use_flags())
- new = set(p.get_global_settings("USE").split())
-
- if new_iuse.intersection(new) != old_iuse.intersection(old):
+ if new_iuse.intersection(p.get_actual_use_flags()).symmetric_difference(p.get_installed_use_flags()):
tempDeep = True
if not appended:
updating.append((p,p))
@@ -376,8 +379,8 @@ class PortageSystem (SystemInterface):
for state in states:
for i in p.get_matched_dep_packages(state[0]):
- if i not in raw_checked:
- raw_checked.append(i)
+ if i not in raw_checked or raw_checked[i] == False:
+ raw_checked.update({i : state[1]})
bm = self.get_new_packages([i])
if not bm:
warning(_("Bug? No best match could be found for '%(package)s'. Needed by: '%(cpv)s'."), {"package" : i, "cpv": p.get_cpv()})
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):
diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py
index 507fa41..110b241 100644
--- a/portato/gui/gui_helper.py
+++ b/portato/gui/gui_helper.py
@@ -354,15 +354,32 @@ class EmergeQueue:
# try to find an already installed instance
update = False
+ downgrade = False
uVersion = None
+ changedUse = []
try:
pkg = self._get_pkg_from_cpv(cpv, unmask)
if not pkg.is_installed():
old = system.find_installed_packages(pkg.get_slot_cp())
if old:
old = old[0] # assume we have only one there
- update = True
- uVersion = old.get_version()
+ cmp = pkg.compare_version(old)
+ if cmp > 0:
+ update = True
+ elif cmp < 0:
+ downgrade = True
+
+ if cmp != 0:
+ uVersion = old.get_version()
+
+ old_iuse = set(old.get_iuse_flags())
+ new_iuse = set(pkg.get_iuse_flags())
+
+ for i in old_iuse.difference(new_iuse):
+ changedUse.append("-"+i)
+
+ for i in new_iuse.difference(old_iuse):
+ changedUse.append("+"+i)
except backend.PackageNotFoundException, e: # package not found / package is masked -> delete current tree and re-raise the exception
if self.tree.iter_has_parent(it):
@@ -372,7 +389,7 @@ class EmergeQueue:
raise
# add iter
- subIt = self.tree.append(it, self.tree.build_append_value(cpv, oneshot = oneshot, update = update, version = uVersion))
+ subIt = self.tree.append(it, self.tree.build_append_value(cpv, oneshot = oneshot, update = update, downgrade = downgrade, version = uVersion, useChange = changedUse))
self.iters.update({cpv: subIt})
# get dependencies
diff --git a/portato/gui/templates/portato.glade b/portato/gui/templates/portato.glade
index ec4ae9d..c7598b4 100644
--- a/portato/gui/templates/portato.glade
+++ b/portato/gui/templates/portato.glade
@@ -452,54 +452,109 @@
<property name="n_rows">5</property>
<property name="n_columns">3</property>
<child>
- <widget class="GtkHBox" id="checkHB">
+ <widget class="GtkHBox" id="pkgLinkBox">
<property name="visible">True</property>
- <property name="spacing">1</property>
- <property name="homogeneous">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
- <widget class="GtkCheckButton" id="installedCheck">
- <property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes">Installed</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="button_press_event" handler="cb_button_pressed"/>
- </widget>
- <packing>
- <property name="fill">False</property>
- </packing>
+ <placeholder/>
</child>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_EXPAND</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="notInSysLabel">
+ <property name="visible">True</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Installed, but not in portage anymore&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">5</property>
<child>
- <widget class="GtkCheckButton" id="maskedCheck">
+ <widget class="GtkScrolledWindow" id="versionListScroll">
<property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes">Masked</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="cb_masked_toggled"/>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <widget class="GtkTreeView" id="versionList">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="headers_clickable">True</property>
+ <property name="show_expanders">False</property>
+ <signal name="cursor_changed" handler="cb_vers_list_changed"/>
+ </widget>
+ </child>
</widget>
<packing>
- <property name="fill">False</property>
- <property name="position">1</property>
+ <property name="expand">False</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="testingCheck">
+ <widget class="GtkScrolledWindow" id="useListScroll">
<property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes">Testing</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="cb_testing_toggled"/>
+ <property name="can_focus">False</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <child>
+ <widget class="GtkTreeView" id="useList">
+ <property name="visible">True</property>
+ </widget>
+ </child>
</widget>
<packing>
- <property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_padding">5</property>
+ <property name="y_padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="descLabel">
+ <property name="visible">True</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ <property name="y_padding">10</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="missingLabel">
+ <property name="visible">True</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">&lt;span foreground='red'&gt;&lt;b&gt;MISSING KEYWORD&lt;/b&gt;&lt;/span&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
@@ -564,90 +619,51 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="missingLabel">
- <property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes">&lt;span foreground='red'&gt;&lt;b&gt;MISSING KEYWORD&lt;/b&gt;&lt;/span&gt;</property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="descLabel">
- <property name="visible">True</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="y_padding">10</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox2">
+ <widget class="GtkHBox" id="checkHB">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="spacing">5</property>
+ <property name="spacing">1</property>
+ <property name="homogeneous">True</property>
<child>
- <widget class="GtkScrolledWindow" id="versionListScroll">
+ <widget class="GtkCheckButton" id="installedCheck">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <child>
- <widget class="GtkTreeView" id="versionList">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="headers_clickable">True</property>
- <property name="show_expanders">False</property>
- <signal name="cursor_changed" handler="cb_vers_list_changed"/>
- </widget>
- </child>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Installed</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="button_press_event" handler="cb_button_pressed"/>
</widget>
<packing>
- <property name="expand">False</property>
+ <property name="fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkScrolledWindow" id="useListScroll">
+ <widget class="GtkCheckButton" id="maskedCheck">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <child>
- <widget class="GtkTreeView" id="useList">
- <property name="visible">True</property>
- </widget>
- </child>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Masked</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="cb_masked_toggled"/>
</widget>
<packing>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">5</property>
- <property name="y_padding">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="notInSysLabel">
- <property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Installed, but not in portage anymore&lt;/b&gt;</property>
- <property name="use_markup">True</property>
+ <child>
+ <widget class="GtkCheckButton" id="testingCheck">
+ <property name="visible">True</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Testing</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="cb_testing_toggled"/>
+ </widget>
+ <packing>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="right_attach">3</property>
@@ -656,22 +672,6 @@
<property name="y_options">GTK_FILL</property>
</packing>
</child>
- <child>
- <widget class="GtkHBox" id="pkgLinkBox">
- <property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_EXPAND</property>
- <property name="y_options"></property>
- </packing>
- </child>
</widget>
<packing>
<property name="tab_expand">False</property>
@@ -1149,189 +1149,189 @@
<placeholder/>
</child>
<child>
- <widget class="GtkLabel" id="maskLabel">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes">&lt;u&gt;&lt;i&gt;Masking Keywords&lt;/i&gt;&lt;/u&gt;</property>
- <property name="use_markup">True</property>
- <property name="single_line_mode">True</property>
- </widget>
- <packing>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="y_padding">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="testLabel">
+ <widget class="GtkEntry" id="useFileEdit">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes">&lt;u&gt;&lt;i&gt;Testing Keywords&lt;/i&gt;&lt;/u&gt;</property>
- <property name="use_markup">True</property>
- <property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_padding">5</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="useLabel">
+ <widget class="GtkLabel" id="useEditLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="xpad">5</property>
- <property name="label" translatable="yes">&lt;u&gt;&lt;i&gt;Use-Flags&lt;/i&gt;&lt;/u&gt;</property>
- <property name="use_markup">True</property>
+ <property name="label" translatable="yes">File name to use, if package.use is a directory: </property>
<property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_padding">6</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
</packing>
</child>
<child>
- <widget class="GtkEventBox" id="hintEB">
+ <widget class="GtkCheckButton" id="usePerVersionCheck">
<property name="visible">True</property>
- <child>
- <widget class="GtkFrame" id="hintFrame">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <child>
- <widget class="GtkLabel" id="hintLabel">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">&lt;u&gt;You may use the following placeholders:&lt;/u&gt;
-
-&lt;i&gt;$(cat)&lt;/i&gt;: category
-&lt;i&gt;$(pkg)&lt;/i&gt;: package name
-&lt;i&gt;$(cat-1)/$(cat-2)&lt;/i&gt;: first/second part of the category</property>
- <property name="use_markup">True</property>
- </widget>
- </child>
- <child>
- <placeholder/>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- </child>
+ <property name="label" translatable="yes">Add only exact version to package.use</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="maskPerVersionCheck">
+ <widget class="GtkCheckButton" id="testPerVersionCheck">
<property name="visible">True</property>
- <property name="label" translatable="yes">Add only exact version to package.mask/package.unmask</property>
+ <property name="label" translatable="yes">Add only exact version to package.keywords</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="maskEditLabel">
+ <widget class="GtkLabel" id="testEditLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">File name to use, if package.mask/package.unmask is a directory: </property>
+ <property name="label" translatable="yes">File name to use, if package.keywords is a directory: </property>
<property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="maskFileEdit">
+ <widget class="GtkEntry" id="testFileEdit">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="testFileEdit">
+ <widget class="GtkEntry" id="maskFileEdit">
<property name="visible">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
+ <property name="top_attach">9</property>
+ <property name="bottom_attach">10</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="testEditLabel">
+ <widget class="GtkLabel" id="maskEditLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">File name to use, if package.keywords is a directory: </property>
+ <property name="label" translatable="yes">File name to use, if package.mask/package.unmask is a directory: </property>
<property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
+ <property name="top_attach">9</property>
+ <property name="bottom_attach">10</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="testPerVersionCheck">
+ <widget class="GtkCheckButton" id="maskPerVersionCheck">
<property name="visible">True</property>
- <property name="label" translatable="yes">Add only exact version to package.keywords</property>
+ <property name="label" translatable="yes">Add only exact version to package.mask/package.unmask</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
+ <property name="top_attach">8</property>
+ <property name="bottom_attach">9</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="usePerVersionCheck">
+ <widget class="GtkEventBox" id="hintEB">
<property name="visible">True</property>
- <property name="label" translatable="yes">Add only exact version to package.use</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
+ <child>
+ <widget class="GtkFrame" id="hintFrame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_OUT</property>
+ <child>
+ <widget class="GtkLabel" id="hintLabel">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">&lt;u&gt;You may use the following placeholders:&lt;/u&gt;
+
+&lt;i&gt;$(cat)&lt;/i&gt;: category
+&lt;i&gt;$(pkg)&lt;/i&gt;: package name
+&lt;i&gt;$(cat-1)/$(cat-2)&lt;/i&gt;: first/second part of the category</property>
+ <property name="use_markup">True</property>
+ </widget>
+ </child>
+ <child>
+ <placeholder/>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="useEditLabel">
+ <widget class="GtkLabel" id="useLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">File name to use, if package.use is a directory: </property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">&lt;u&gt;&lt;i&gt;Use-Flags&lt;/i&gt;&lt;/u&gt;</property>
+ <property name="use_markup">True</property>
<property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_padding">6</property>
</packing>
</child>
<child>
- <widget class="GtkEntry" id="useFileEdit">
+ <widget class="GtkLabel" id="testLabel">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">&lt;u&gt;&lt;i&gt;Testing Keywords&lt;/i&gt;&lt;/u&gt;</property>
+ <property name="use_markup">True</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="maskLabel">
<property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="xpad">5</property>
+ <property name="label" translatable="yes">&lt;u&gt;&lt;i&gt;Masking Keywords&lt;/i&gt;&lt;/u&gt;</property>
+ <property name="use_markup">True</property>
+ <property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="y_padding">5</property>
</packing>
</child>
</widget>
@@ -1584,11 +1584,8 @@
<widget class="GtkWindow" id="UpdateWindow">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="title" translatable="yes">Updateble Packages</property>
- <property name="modal">True</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="destroy_with_parent">True</property>
- <property name="skip_taskbar_hint">True</property>
- <property name="skip_pager_hint">True</property>
<property name="urgency_hint">True</property>
<child>
<widget class="GtkVBox" id="mainVB">
diff --git a/portato/gui/wrapper.py b/portato/gui/wrapper.py
index 12e4a71..1a9ef8f 100644
--- a/portato/gui/wrapper.py
+++ b/portato/gui/wrapper.py
@@ -139,7 +139,7 @@ class Tree:
@rtype: Iterator"""
raise NotImplementedError
- 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 = []):
"""Builds the list, which is going to be passed to append.
@param cpv: the cpv
@@ -148,8 +148,12 @@ class Tree:
@type oneshot: boolean
@param update: True if this is an update
@type update: boolean
+ @param downgrade: True if this is a downgrade
+ @type downgrade: boolean
@param version: the version we update from
@type version: string
+ @param useChange: list of changed useflags; use "-use" for removed and "+use" for added flags
+ @type useChange: string[]
@returns: the created list
@rtype: list"""