summaryrefslogtreecommitdiffstats
path: root/textw
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-07-02 19:20:05 +0000
committerMike Fulbright <msf@redhat.com>2003-07-02 19:20:05 +0000
commit466d79f55190ee488d3f236914355b8a11fda1f7 (patch)
tree060b00ea27fdb4d26450f033827c56d2b9c3f606 /textw
parent03cacc2c474dbaa906e4ae74b4854842da5bedac (diff)
downloadanaconda-466d79f55190ee488d3f236914355b8a11fda1f7.tar.gz
anaconda-466d79f55190ee488d3f236914355b8a11fda1f7.tar.xz
anaconda-466d79f55190ee488d3f236914355b8a11fda1f7.zip
implement package group details for TUI
Diffstat (limited to 'textw')
-rw-r--r--textw/packages_text.py71
1 files changed, 70 insertions, 1 deletions
diff --git a/textw/packages_text.py b/textw/packages_text.py
index c539c386f..dda079b54 100644
--- a/textw/packages_text.py
+++ b/textw/packages_text.py
@@ -16,6 +16,7 @@ from snack import *
from constants_text import *
from rhpl.translate import _
from hdrlist import orderPackageGroups
+from hdrlist import ON_STATES, OFF_STATES
class PackageGroupWindow:
@@ -67,10 +68,78 @@ class PackageGroupWindow:
# g.add (cb, 0, 2, (0, 0, 0, 1))
g.add (bb, 0, 3, growx = 1)
- result = g.runOnce()
+ g.addHotKey("F2")
+
+ screen.pushHelpLine (_("<Space>,<+>,<-> selection | <F2> Group Details | <F12> next screen"))
+
+ while 1:
+ result = g.run()
+ if result != "F2":
+ break
+
+ # if current group is not selected then select it first
+ newSelection = 0
+ cur = ct.getCurrent()
+ lst = ct.getSelection()
+ if cur not in lst:
+ newSelection = 1
+ try:
+ if not cur.isSelected(justManual = 1):
+ cur.select()
+ except ValueError:
+ pass
+ ct.setEntryValue(cur, 1)
+
+ # do group details
+ gct = CheckboxTree(height = 8, scroll = 1)
+
+ origpkgselection = {}
+ for (pkg, val) in cur.packageInfo().items():
+ origpkgselection[pkg] = val
+
+ # make a copy
+ pkgselection = {}
+ for k in origpkgselection.keys():
+ pkgselection[k] = origpkgselection[k]
+
+ for pkg in origpkgselection.keys():
+ gct.append(pkg, pkg, pkgselection[pkg][1])
+
+ bb2 = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_CANCEL_BUTTON))
+
+ g2 = GridFormHelp (screen, _("Package Group Details"), "", 1, 4)
+
+ g2.add (gct, 0, 1, (0, 0, 0, 1))
+ g2.add (bb2, 0, 3, growx = 1)
+
+ rc2 = g2.runOnce()
+ if bb2.buttonPressed(rc2) == TEXT_CANCEL_CHECK:
+ # unselect group if necessary
+ if newSelection:
+ try:
+ cur.unselect()
+ except:
+ pass
+ ct.setEntryValue(cur, 0)
+ else:
+ # reflect new packages selected
+ selectedlst = gct.getSelection()
+ for pkg in origpkgselection.keys():
+ (otype, osel) = origpkgselection[pkg]
+ if pkg in selectedlst:
+ if osel in ON_STATES:
+ continue
+ cur.selectPackage(pkg)
+ else:
+ if osel in OFF_STATES:
+ continue
+ cur.unselectPackage(pkg)
rc = bb.buttonPressed (result)
+ screen.popWindow()
+ screen.popHelpLine ()
+
if rc == TEXT_BACK_CHECK:
grpset.setSelectionState(origSelection)
return INSTALL_BACK