[PATCH][rhel7-branch/master] Optionally hide the GUI option to install updates (#999442)

David Shea dshea at redhat.com
Wed Aug 28 15:55:30 UTC 2013


Make the display of the "Don't install the latest software updates..."
option configurable through the installclass. Hide the option on RHEL,
since RHEL will not have an updates repo that is available through the
installer.
---
 pyanaconda/installclass.py            |  4 +++
 pyanaconda/installclasses/fedora.py   |  2 ++
 pyanaconda/installclasses/rhel.py     |  2 ++
 pyanaconda/ui/gui/spokes/source.glade | 68 ++++++++++++++++++++---------------
 pyanaconda/ui/gui/spokes/source.py    |  7 ++++
 5 files changed, 55 insertions(+), 28 deletions(-)

diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
index bc7e6f0..9d14b79 100644
--- a/pyanaconda/installclass.py
+++ b/pyanaconda/installclass.py
@@ -47,6 +47,10 @@ class BaseInstallClass(object):
     # mechanism.
     ignoredPackages = []
 
+    # This flag controls whether or not Anaconda should provide an option to
+    # install the latest updates during installation source selection.
+    installUpdates = True
+
     _l10n_domain = None
 
     # The default filesystem type to use.  If None, we will use whatever
diff --git a/pyanaconda/installclasses/fedora.py b/pyanaconda/installclasses/fedora.py
index 2d13ae2..5b59c35 100644
--- a/pyanaconda/installclasses/fedora.py
+++ b/pyanaconda/installclasses/fedora.py
@@ -34,6 +34,8 @@ class InstallClass(BaseInstallClass):
 
     _l10n_domain = "anaconda"
 
+    installUpdates = True
+
     efi_dir = "fedora"
 
     def configure(self, anaconda):
diff --git a/pyanaconda/installclasses/rhel.py b/pyanaconda/installclasses/rhel.py
index a89c091..4283337 100644
--- a/pyanaconda/installclasses/rhel.py
+++ b/pyanaconda/installclasses/rhel.py
@@ -35,6 +35,8 @@ class InstallClass(BaseInstallClass):
 
     ignoredPackages = ["ntfsprogs"]
 
+    installUpdates = False
+
     _l10n_domain = "comps"
 
     efi_dir = "redhat"
diff --git a/pyanaconda/ui/gui/spokes/source.glade b/pyanaconda/ui/gui/spokes/source.glade
index 366b316..3b0962a 100644
--- a/pyanaconda/ui/gui/spokes/source.glade
+++ b/pyanaconda/ui/gui/spokes/source.glade
@@ -885,35 +885,47 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel" id="label2">
-                    <property name="visible">True</property>
+                  <object class="GtkBox" id="updatesBox">
                     <property name="can_focus">False</property>
-                    <property name="halign">start</property>
-                    <property name="margin_top">12</property>
-                    <property name="label" translatable="yes">Updates</property>
-                    <attributes>
-                      <attribute name="font-desc" value="Cantarell 10"/>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">8</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="noUpdatesCheckbox">
-                    <property name="label" translatable="yes">Don't install the latest available software _updates. Install the default versions provided by the install source above.</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="margin_left">12</property>
-                    <property name="margin_bottom">12</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                    <signal name="toggled" handler="on_noUpdatesCheckbox_toggled" swapped="no"/>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="margin_top">12</property>
+                        <property name="label" translatable="yes">Updates</property>
+                        <attributes>
+                          <attribute name="font-desc" value="Cantarell 10"/>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="noUpdatesCheckbox">
+                        <property name="label" translatable="yes">Don't install the latest available software _updates. Install the default versions provided by the install source above.</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="margin_left">12</property>
+                        <property name="margin_bottom">12</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                        <signal name="toggled" handler="on_noUpdatesCheckbox_toggled" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index a5f57db..33d3aff 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -542,6 +542,9 @@ class SourceSpoke(NormalSpoke):
         self._repoProxyUsernameEntry = self.builder.get_object("repoProxyUsernameEntry")
         self._repoProxyPasswordEntry = self.builder.get_object("repoProxyPasswordEntry")
 
+        # updates option container
+        self._updatesBox = self.builder.get_object("updatesBox")
+
     def initialize(self):
         NormalSpoke.initialize(self)
 
@@ -553,6 +556,10 @@ class SourceSpoke(NormalSpoke):
         self._isoButton.connect("toggled", self.on_source_toggled, self._isoBox)
         self._networkButton.connect("toggled", self.on_source_toggled, self._networkBox)
 
+        # Show or hide the updates option based on the installclass
+        self._updatesBox.set_no_show_all(not self.instclass.installUpdates)
+        self._updatesBox.set_visible(self.instclass.installUpdates)
+
         threadMgr.add(AnacondaThread(name=constants.THREAD_SOURCE_WATCHER, target=self._initialize))
 
     def _initialize(self):
-- 
1.8.3.1



More information about the anaconda-patches mailing list