[PATCH] Provide a single checkbox for a minimal install (#523839).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch allows the user to select "Minimal" from the task list and get
just a bare minimum of packages.  Note that the first task to have all its
groups selected by default will be the only one selected in the task list.
---
 installclasses/fedora.py |   25 +++++++++++++++++++------
 iw/task_gui.py           |   24 ++++++++++++++++++------
 2 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/installclasses/fedora.py b/installclasses/fedora.py
index 009fa7a..bd3aa97 100644
--- a/installclasses/fedora.py
+++ b/installclasses/fedora.py
@@ -38,17 +38,30 @@ class InstallClass(BaseInstallClass):
     id = "fedora"
     name = N_("_Fedora")
     _description = N_("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?") 
+                      "software applicable for general internet usage. "
+                      "You can optionally select a different software set.")
     _descriptionFields = (productName,)
     sortPriority = 10000
     if productName.startswith("Red Hat Enterprise"):
         hidden = 1
 
-    tasks = [(N_("Office and Productivity"), ["graphics", "office"]),
-             (N_("Software Development"), ["development-libs", "development-tools", "gnome-software-development", "x-software-development"],),
-             (N_("Web Server"), ["web-server"])]
+    # (Translated Name, Default?, Group List)
+    tasks = [(N_("Graphical Desktop"),
+              ["admin-tools", "base", "base-x", "core", "editors", "fonts",
+               "games", "gnome-desktop", "graphical-internet", "graphics",
+               "hardware-support", "input-methods", "java", "office",
+               "printing", "sound-and-video", "text-internet"]),
+             (N_("Software Development"),
+              ["base", "base-x", "core", "development-libs",
+               "development-tools", "editors", "fonts", "gnome-desktop",
+               "gnome-software-development", "graphical-internet", "graphics",
+               "hardware-support", "input-methods", "java", "text-internet",
+               "x-software-development"]),
+             (N_("Web Server"),
+              ["admin-tools", "base", "base-x", "core", "editors",
+               "gnome-desktop", "graphical-internet", "hardware-support",
+               "java", "text-internet", "web-server"]),
+             (N_("Minimal"), ["core"])]
 
     bugFiler = BugzillaFiler("https://bugzilla.redhat.com/xmlrpc.cgi";,
                              "https://bugzilla.redhat.com/";,
diff --git a/iw/task_gui.py b/iw/task_gui.py
index aeacd48..067e6cd 100644
--- a/iw/task_gui.py
+++ b/iw/task_gui.py
@@ -534,10 +534,13 @@ class TaskWindow(InstallWindow):
         s = self.xml.get_widget("repoList").get_model()
         s.append([dialog.repo.isEnabled(), dialog.repo.name, dialog.repo])
 
-    def _taskToggled(self, button, row, store):
-        i = store.get_iter(int(row))
-        val = store.get_value(i, 0)
-        store.set_value(i, 0, not val)
+    def _taskToggled(self, button, path, store):
+        # First, untoggle everything in the store.
+        for row in store:
+            row[0] = False
+
+        # Then, enable the one that was clicked.
+        store[path][0] = True
 
     def _anyRepoEnabled(self):
         model = self.rs.get_model()
@@ -580,18 +583,27 @@ class TaskWindow(InstallWindow):
         tl.set_model(store)
 
         cbr = gtk.CellRendererToggle()
-        col = gtk.TreeViewColumn('', cbr, active = 0)
+        cbr.set_radio(True)
         cbr.connect("toggled", self._taskToggled, store)
+
+        col = gtk.TreeViewColumn('', cbr, active = 0)
         tl.append_column(col)
 
         col = gtk.TreeViewColumn('Text', gtk.CellRendererText(), text = 1)
         col.set_clickable(False)
         tl.append_column(col)
 
+        anyEnabled = False
+
         for (txt, grps) in self.tasks:
             if not self.backend.groupListExists(grps):
                 continue
-            store.append([self.backend.groupListDefault(grps), _(txt), grps])
+
+            enabled = self.backend.groupListDefault(grps)
+            store.append([not anyEnabled and enabled, _(txt), grps])
+
+            if enabled:
+                anyEnabled = True
 
         return tl
 
-- 
1.6.5.rc2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux