summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--dispatch.py8
-rwxr-xr-xgui.py7
-rw-r--r--installclass.py4
-rw-r--r--iw/task_gui.py77
-rw-r--r--kickstart.py7
-rw-r--r--text.py8
-rw-r--r--textw/task_text.py80
-rw-r--r--ui/tasksel.glade223
9 files changed, 411 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 166106c2b..27527ded6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2006-01-25 Jeremy Katz <katzj@redhat.com>
+ * kickstart.py (Kickstart.setSteps): Don't show tasksel if
+ packages are selected.
+
+ * iw/task_gui.py: Simple task selection UI so we don't just drop
+ people into the complicated group selection screen.
+ * ui/tasksel.glade: Add glade file for task selection UI
+ * textw/task_text.py: Text version
+
+ * dispatch.py (installSteps): Add tasksel step
+ * installclass.py (BaseInstallClass.setSteps): Likewise.
+ * gui.py (stepToClass): Likewise.
+ * text.py (stepToClasses): Likewise.
+
* isys/lang.c (loadKeymap): Can't load keymaps under Xen, so don't
fail in a loud fashion.
diff --git a/dispatch.py b/dispatch.py
index b193ccc43..923fc2543 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -3,12 +3,12 @@
#
# Erik Troan <ewt@redhat.com>
#
-# Copyright 2001-2002 Red Hat, Inc.
+# Copyright 2001-2006 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
-# library public license.
+# general public license.
#
-# You should have received a copy of the GNU Library Public License
+# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
@@ -100,9 +100,9 @@ installSteps = [
("accounts", ("intf", "id.rootPassword")),
("reposetup", doRepoSetup, ("backend","intf", "id", "instPath")),
("basepkgsel", doBasePackageSelect, ("backend","id.instClass")),
+ ("tasksel", ("intf", "backend", "dispatch")),
("group-selection", ("backend", "intf")),
("postselection", doPostSelection, ("backend", "intf", "id", "instPath")),
- #("desktopchoice", ("intf", "id.instClass", "dispatch", "id.grpset")),
#("selectlangpackages", selectLanguageSupportGroups, ("id.grpset","id.instLanguage")),
#("fixupconditionals", fixupConditionals, ("id.grpset",)),
("confirminstall", ("intf", "id",)),
diff --git a/gui.py b/gui.py
index c1b423b96..ca16b7d14 100755
--- a/gui.py
+++ b/gui.py
@@ -4,12 +4,12 @@
# Matt Wilson <msw@redhat.com>
# Michael Fulbright <msf@redhat.com>
#
-# Copyright 1999-2005 Red Hat, Inc.
+# Copyright 1999-2006 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
-# library public license.
+# general public license.
#
-# You should have received a copy of the GNU Library Public License
+# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
@@ -75,6 +75,7 @@ stepToClass = {
"timezone" : ("timezone_gui", "TimezoneWindow"),
"accounts" : ("account_gui", "AccountWindow"),
"desktopchoice": ("desktop_choice_gui", "DesktopChoiceWindow"),
+ "tasksel": ("task_gui", "TaskWindow"),
"group-selection": ("package_gui", "GroupSelectionWindow"),
"indivpackage" : ("package_gui", "IndividualPackageSelectionWindow"),
"dependencies" : ("dependencies_gui", "UnresolvedDependenciesWindow"),
diff --git a/installclass.py b/installclass.py
index 1f1020551..c773538ef 100644
--- a/installclass.py
+++ b/installclass.py
@@ -4,7 +4,7 @@
# The interface to BaseInstallClass is *public* -- ISVs/OEMs can customize the
# install by creating a new derived type of this class.
#
-# Copyright 1999-2004 Red Hat, Inc.
+# Copyright 1999-2006 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
@@ -140,7 +140,7 @@ class BaseInstallClass:
"selectlangpackages",
"reposetup",
"basepkgsel",
- "group-selection",
+ "tasksel",
"postselection",
"handleX11pkgs",
"handlemiscpkgs",
diff --git a/iw/task_gui.py b/iw/task_gui.py
new file mode 100644
index 000000000..843fb69b6
--- /dev/null
+++ b/iw/task_gui.py
@@ -0,0 +1,77 @@
+#
+# task_gui.py: Choose tasks for installation
+#
+# Copyright 2006 Red Hat, Inc.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+import gtk
+import gtk.glade
+import gobject
+import gui
+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)
+ else:
+ map(self.backend.deselectGroup, grps)
+
+ def groupsInstalled(self, lst):
+ # FIXME: yum specific
+ rc = False
+ for gid in lst:
+ g = self.backend.ayum.comps.return_group(gid)
+ if g and not g.selected:
+ return False
+ elif g:
+ rc = True
+ return rc
+
+ def getScreen (self, intf, backend, dispatch):
+ self.intf = intf
+ self.dispatch = dispatch
+ self.backend = backend
+
+ (self.xml, vbox) = gui.getGladeWidget("tasksel.glade", "taskBox")
+
+ lbl = self.xml.get_widget("mainLabel")
+ txt = lbl.get_text()
+ lbl.set_text(txt %(productName,))
+
+ custom = not self.dispatch.stepInSkipList("group-selection")
+ if custom:
+ self.xml.get_widget("customRadio").set_active(True)
+ else:
+ self.xml.get_widget("customRadio").set_active(False)
+
+ for (cb, grps) in grpTaskMap.items():
+ if self.groupsInstalled(grps):
+ self.xml.get_widget(cb).set_active(True)
+ else:
+ self.xml.get_widget(cb).set_active(False)
+
+ return vbox
diff --git a/kickstart.py b/kickstart.py
index cb433be38..69a566a7b 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -1,12 +1,12 @@
#
# kickstart.py: kickstart install support
#
-# Copyright 1999-2004 Red Hat, Inc.
+# Copyright 1999-2006 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
-# library public license.
+# general public license.
#
-# You should have received a copy of the GNU Library Public License
+# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
@@ -787,6 +787,7 @@ class Kickstart(BaseInstallClass):
if len(self.ksdata.groupList) > 0 or len(self.ksdata.packageList) > 0 or \
len(self.ksdata.excludedList) > 0:
dispatch.skipStep("group-selection")
+ dispatch.skipStep("tasksel")
for n in self.handlers.skipSteps:
dispatch.skipStep(n)
diff --git a/text.py b/text.py
index f64c5d54d..2b5fc985f 100644
--- a/text.py
+++ b/text.py
@@ -4,12 +4,12 @@
# Erik Troan <ewt@redhat.com>
# Matt Wilson <msw@redhat.com>
#
-# Copyright 1999-2004 Red Hat, Inc.
+# Copyright 1999-2006 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
-# library public license.
+# general public license.
#
-# You should have received a copy of the GNU Library Public License
+# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
@@ -64,7 +64,7 @@ stepToClasses = {
"HostnameWindow")),
"timezone" : ("timezone_text", "TimezoneWindow"),
"accounts" : ("userauth_text", "RootPasswordWindow"),
- "desktopchoice": ("desktop_choice_text", "DesktopChoiceWindow"),
+ "tasksel": ("task_text", "TaskWindow"),
"package-selection" : ("packages_text", "PackageGroupWindow"),
"group-selection": ("simple_pkgselect_text", "GroupSelectionWindow"),
"indivpackage" : ("packages_text", ("IndividualPackageWindow")),
diff --git a/textw/task_text.py b/textw/task_text.py
new file mode 100644
index 000000000..98bde4c20
--- /dev/null
+++ b/textw/task_text.py
@@ -0,0 +1,80 @@
+#
+# task_gui.py: Choose tasks for installation
+#
+# Copyright 2006 Red Hat, Inc.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+from snack import *
+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
+ rc = False
+ for gid in lst:
+ g = self.backend.ayum.comps.return_group(gid)
+ if g and not g.selected:
+ return False
+ elif g:
+ rc = True
+ return rc
+
+ def __call__(self, screen, intf, backend, dispatch):
+ self.backend = backend
+
+ bb = ButtonBar (screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON))
+
+ toplevel = GridFormHelp (screen, _("Package selection"),
+ "tasksel", 1, 5)
+
+ 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():
+ if self.groupsInstalled(grps):
+ ct.append(_(cb), cb, True)
+ else:
+ ct.append(_(cb), cb, False)
+ toplevel.add (ct, 0, 2, (0,0,0,1))
+
+ custom = not dispatch.stepInSkipList("group-selection")
+ customize = Checkbox (_("Customize software selection"), custom)
+ toplevel.add (customize, 0, 3, (0, 0, 0, 1))
+ toplevel.add (bb, 0, 4, (0, 0, 0, 0), growx = 1)
+
+ result = toplevel.run()
+ rc = bb.buttonPressed (result)
+ if rc == TEXT_BACK_CHECK:
+ screen.popWindow()
+ return INSTALL_BACK
+
+ if customize.selected():
+ dispatch.skipStep("group-selection", skip = 0)
+ else:
+ dispatch.skipStep("group-selection")
+
+ sel = ct.getSelection()
+ for (cb, grps) in grpTaskMap.items():
+ if cb in sel:
+ map(backend.selectGroup, grps)
+ else:
+ map(backend.deselectGroup, grps)
+ screen.popWindow()
+
+ return INSTALL_OK
+
diff --git a/ui/tasksel.glade b/ui/tasksel.glade
new file mode 100644
index 000000000..a2ae407e0
--- /dev/null
+++ b/ui/tasksel.glade
@@ -0,0 +1,223 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="window1">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes"></property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="default_width">440</property>
+ <property name="default_height">250</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+
+ <child>
+ <widget class="GtkVBox" id="taskBox">
+ <property name="border_width">12</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="mainLabel">
+ <property name="label" translatable="yes" context="yes">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?</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <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>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="label" translatable="yes" context="yes">Further customization of the software selection can be completed now or after install via the software management application.</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="homogeneous">False</property>
+ <property name="spacing">24</property>
+
+ <child>
+ <widget class="GtkRadioButton" id="laterRadio">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" context="yes">Customize _later</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">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkRadioButton" id="customRadio">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" context="yes">_Customize now</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>
+ <property name="group">laterRadio</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>