diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | dispatch.py | 2 | ||||
-rw-r--r-- | installclass.py | 12 | ||||
-rw-r--r-- | installclasses/fedora.py | 5 | ||||
-rw-r--r-- | iw/task_gui.py | 50 | ||||
-rw-r--r-- | textw/task_text.py | 34 | ||||
-rw-r--r-- | ui/tasksel.glade | 68 |
7 files changed, 73 insertions, 111 deletions
@@ -1,3 +1,16 @@ +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. + 2006-02-03 Peter Jones <pjones@redhat.com> * fsset.py (swapFileSystem): Fix format strings in call to diff --git a/dispatch.py b/dispatch.py index 8513c5b5b..841c3f2c7 100644 --- a/dispatch.py +++ b/dispatch.py @@ -101,7 +101,7 @@ installSteps = [ ("accounts", ("intf", "id.rootPassword")), ("reposetup", doRepoSetup, ("backend","intf", "id", "instPath")), ("basepkgsel", doBasePackageSelect, ("backend","id.instClass")), - ("tasksel", ("intf", "backend", "dispatch")), + ("tasksel", ("intf", "backend", "dispatch", "id.instClass")), ("group-selection", ("backend", "intf")), ("postselection", doPostSelection, ("backend", "intf", "id", "instPath")), #("selectlangpackages", selectLanguageSupportGroups, ("id.grpset","id.instLanguage")), diff --git a/installclass.py b/installclass.py index c773538ef..141d5c662 100644 --- a/installclass.py +++ b/installclass.py @@ -41,16 +41,8 @@ class BaseInstallClass: # default to showing the upgrade option showUpgrade = 1 # FIXME: no upgrade for now while doing yum work -# pkgstext = _("\tDesktop shell (GNOME)\n" -# "\tOffice suite (OpenOffice)\n" -# "\tWeb browser (Mozilla) \n" -# "\tEmail (Evolution)\n" -# "\tInstant messaging\n" -# "\tSound and video applications\n" -# "\tGames\n" -# "\tSoftware Development Tools\n" -# "\tAdministration Tools\n") - + # list of of (txt, grplist) tuples for task selection screen + tasks = [] # don't select this class by default default = 0 diff --git a/installclasses/fedora.py b/installclasses/fedora.py index 9c086eb6f..e9ad31a89 100644 --- a/installclasses/fedora.py +++ b/installclasses/fedora.py @@ -17,6 +17,11 @@ class InstallClass(BaseInstallClass): showLoginChoice = 1 showMinimal = 1 + tasks = [(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"])] + def setInstallData(self, id, intf = None): BaseInstallClass.setInstallData(self, id) BaseInstallClass.setDefaultPartitioning(self, id.partitions, diff --git a/iw/task_gui.py b/iw/task_gui.py index 843fb69b6..c98acb022 100644 --- a/iw/task_gui.py +++ b/iw/task_gui.py @@ -16,27 +16,19 @@ from iw_gui import * from rhpl.translate import _, N_ from constants import productName -grpTaskMap = {"officeCheckbox": ["graphics", "office", - "games", "sound-and-video"], - "develCheckbox": ["development-libs", "development-tools", - "gnome-software-development", - "x-software-development"], - "webCheckbox": ["web-server"], - "xenCheckbox": ["xen"] } - class TaskWindow(InstallWindow): def getNext(self): - def selgroups(lst): - map(self.backend.selectGroup, lst) - if self.xml.get_widget("customRadio").get_active(): self.dispatch.skipStep("group-selection", skip = 0) else: self.dispatch.skipStep("group-selection", skip = 1) - for (cb, grps) in grpTaskMap.items(): - if self.xml.get_widget(cb).get_active(): - map(self.backend.selectGroup, grps) + for (txt, grps) in self.tasks: + if not self.taskcbs.has_key(txt): + continue + cb = self.taskcbs[txt] + if cb.get_active(): + map(self.backend.selectGroup, grps) else: map(self.backend.deselectGroup, grps) @@ -51,11 +43,22 @@ class TaskWindow(InstallWindow): rc = True return rc - def getScreen (self, intf, backend, dispatch): + 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 getScreen (self, intf, backend, dispatch, instClass): self.intf = intf self.dispatch = dispatch self.backend = backend + self.tasks = instClass.tasks + self.taskcbs = {} + (self.xml, vbox) = gui.getGladeWidget("tasksel.glade", "taskBox") lbl = self.xml.get_widget("mainLabel") @@ -68,10 +71,19 @@ class TaskWindow(InstallWindow): else: self.xml.get_widget("customRadio").set_active(False) - for (cb, grps) in grpTaskMap.items(): + found = False + for (txt, grps) in self.tasks: + if not self.groupsExist(grps): + continue + found = True + cb = gtk.CheckButton(_(txt)) + self.xml.get_widget("cbVBox").pack_start(cb) if self.groupsInstalled(grps): - self.xml.get_widget(cb).set_active(True) - else: - self.xml.get_widget(cb).set_active(False) + cb.set_active(True) + self.taskcbs[txt] = cb + + if not found: + self.xml.get_widget("mainLabel").hide() + self.xml.get_widget("cbVBox").hide() return vbox 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) diff --git a/ui/tasksel.glade b/ui/tasksel.glade index a2ae407e0..bbda8a33c 100644 --- a/ui/tasksel.glade +++ b/ui/tasksel.glade @@ -52,76 +52,12 @@ </child> <child> - <widget class="GtkVBox" id="vbox2"> + <widget class="GtkVBox" id="cbVBox"> <property name="homogeneous">False</property> <property name="spacing">6</property> <child> - <widget class="GtkCheckButton" id="officeCheckbox"> - <property name="label" translatable="yes" context="yes">Office and Productivity</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="develCheckbox"> - <property name="label" translatable="yes" context="yes">Software Development</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="webCheckbox"> - <property name="label" translatable="yes" context="yes">Web server</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="xenCheckbox"> - <property name="label" translatable="yes" context="yes">Virtualization (Xen)</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> + <placeholder/> </child> </widget> <packing> |