diff options
author | Jeremy Katz <katzj@redhat.com> | 2006-02-03 23:36:20 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2006-02-03 23:36:20 +0000 |
commit | 8144979fc7a558503691f9a6a3d0a28848b6d7fc (patch) | |
tree | 0bde84c0ad001e9719d7653dd03259ba44f97191 /textw | |
parent | d9e9e16488436c407e6115b30b54b6142eaa9a72 (diff) | |
download | anaconda-8144979fc7a558503691f9a6a3d0a28848b6d7fc.tar.gz anaconda-8144979fc7a558503691f9a6a3d0a28848b6d7fc.tar.xz anaconda-8144979fc7a558503691f9a6a3d0a28848b6d7fc.zip |
2006-02-03 Jeremy Katz <katzj@redhat.com>
* iw/task_gui.py: Adjust for dynamic set of tasks
* ui/tasksel.glade: Don't list tasks in the glade file, they're
now auto-generated.
* textw/task_text.py (TaskWindow.__call__): Likewise.
* dispatch.py (installSteps): Pass new arg to tasksel step
* installclasses/fedora.py (tasks): Define set of tasks to show on
task selection screen here.
* installclass.py (tasks): Parent placeholder.
Diffstat (limited to 'textw')
-rw-r--r-- | textw/task_text.py | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/textw/task_text.py b/textw/task_text.py index 98bde4c20..b4c6c20f2 100644 --- a/textw/task_text.py +++ b/textw/task_text.py @@ -13,14 +13,6 @@ from constants_text import * from rhpl.translate import _, N_ from constants import productName -grpTaskMap = {N_("Office and Productivity"): ["graphics", "office", - "games", "sound-and-video"], - N_("Software Development"): ["development-libs", "development-tools", - "gnome-software-development", - "x-software-development"], - N_("Web Server"): ["web-server"], - N_("Virtualization (Xen)"): ["xen"] } - class TaskWindow: def groupsInstalled(self, lst): # FIXME: yum specific @@ -32,9 +24,18 @@ class TaskWindow: elif g: rc = True return rc + + def groupsExist(self, lst): + # FIXME: yum specific + for gid in lst: + g = self.backend.ayum.comps.return_group(gid) + if not g: + return False + return True - def __call__(self, screen, intf, backend, dispatch): + def __call__(self, screen, intf, backend, dispatch, instClass): self.backend = backend + tasks = instClass.tasks bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) @@ -44,12 +45,15 @@ class TaskWindow: labeltxt = _("The default installation of %s includes a set of software applicable for general internet usage. What additional tasks would you like your system to include support for?") %(productName,) toplevel.add (TextboxReflowed(55, labeltxt), 0, 0, (0, 0, 0, 1)) - ct = CheckboxTree(height = 4, scroll = (len(grpTaskMap.keys()) > 4)) - for (cb, grps) in grpTaskMap.items(): + ct = CheckboxTree(height = 4, scroll = (len(tasks) > 4)) + for (txt, grps) in tasks: + if not self.groupsExist(grps): + continue + if self.groupsInstalled(grps): - ct.append(_(cb), cb, True) + ct.append(_(txt), txt, True) else: - ct.append(_(cb), cb, False) + ct.append(_(txt), txt, False) toplevel.add (ct, 0, 2, (0,0,0,1)) custom = not dispatch.stepInSkipList("group-selection") @@ -69,8 +73,8 @@ class TaskWindow: dispatch.skipStep("group-selection") sel = ct.getSelection() - for (cb, grps) in grpTaskMap.items(): - if cb in sel: + for (txt, grps) in tasks: + if txt in sel: map(backend.selectGroup, grps) else: map(backend.deselectGroup, grps) |