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):
On Wed, 2013-08-28 at 11:55 -0400, David Shea wrote:
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):
This looks good to me, but if you are willing to spend two more minutes on it, I'd love to see really_hide() and really_show() methods moved from the pyanaconda/ui/gui/spokes/custom.py to pyanaconda/ui/gui/utils.py (an old patch I had for it attached) and used to hide the updates box.
On 08/29/2013 03:32 AM, Vratislav Podzimek wrote:
This looks good to me, but if you are willing to spend two more minutes on it, I'd love to see really_hide() and really_show() methods moved from the pyanaconda/ui/gui/spokes/custom.py to pyanaconda/ui/gui/utils.py (an old patch I had for it attached) and used to hide the updates box.
Sounds good to me.
From: Vratislav Podzimek vpodzime@redhat.com
These functions may come handy in other spokes as well. --- pyanaconda/ui/gui/spokes/custom.py | 19 ++----------------- pyanaconda/ui/gui/utils.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index f7a7f9d..dafd7c0 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -74,7 +74,8 @@ from pyanaconda.ui.gui.spokes.lib.passphrase import PassphraseDialog from pyanaconda.ui.gui.spokes.lib.accordion import selectorFromDevice, Accordion, Page, CreateNewPage, UnknownPage from pyanaconda.ui.gui.spokes.lib.refresh import RefreshDialog from pyanaconda.ui.gui.spokes.lib.summary import ActionSummaryDialog -from pyanaconda.ui.gui.utils import setViewportBackground, gtk_action_wait, enlightbox, fancy_set_sensitive, ignoreEscape +from pyanaconda.ui.gui.utils import setViewportBackground, gtk_action_wait, enlightbox, fancy_set_sensitive, ignoreEscape,\ + really_hide, really_show from pyanaconda.ui.gui.categories.system import SystemCategory from pyanaconda.ui.lib.disks import size_str
@@ -222,22 +223,6 @@ def validate_mountpoint(mountpoint, used_mountpoints, strict=True):
return valid
-def really_hide(widget): - """Some widgets need to be both hidden, and have no_show_all set on them - to prevent them from being shown later when the screen is redrawn. - This method takes care of that. - """ - widget.set_no_show_all(True) - widget.hide() - -def really_show(widget): - """Some widgets need to have no_show_all unset before they can also be - shown, so they are displayed later when the screen is redrawn. This - method takes care of that. - """ - widget.set_no_show_all(False) - widget.show() - def selectedRaidLevel(raidLevelCombo): """Interpret the selection of a RAID level combo box.""" itr = raidLevelCombo.get_active_iter() diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py index c630a16..efd9f74 100644 --- a/pyanaconda/ui/gui/utils.py +++ b/pyanaconda/ui/gui/utils.py @@ -137,3 +137,19 @@ def fancy_set_sensitive(widget, value): widget.set_sensitive(value) for w in widget.list_mnemonic_labels(): w.set_sensitive(value) + +def really_hide(widget): + """Some widgets need to be both hidden, and have no_show_all set on them + to prevent them from being shown later when the screen is redrawn. + This method takes care of that. + """ + widget.set_no_show_all(True) + widget.hide() + +def really_show(widget): + """Some widgets need to have no_show_all unset before they can also be + shown, so they are displayed later when the screen is redrawn. This + method takes care of that. + """ + widget.set_no_show_all(False) + widget.show()
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 | 11 +++++- 5 files changed, 58 insertions(+), 29 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..35a4aaf 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -38,7 +38,7 @@ from pyanaconda.ui.gui.spokes import NormalSpoke from pyanaconda.ui.gui.categories.software import SoftwareCategory from pyanaconda.ui.gui.utils import enlightbox, gtk_action_wait from pyanaconda.iutil import ProxyString, ProxyStringError, cmp_obj_attrs -from pyanaconda.ui.gui.utils import gtk_call_once +from pyanaconda.ui.gui.utils import gtk_call_once, really_hide, really_show from pyanaconda.threads import threadMgr, AnacondaThread from pyanaconda.packaging import PayloadError, MetadataError from pyanaconda import constants @@ -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,12 @@ 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 + if self.instclass.installUpdates: + really_show(self._updatesBox) + else: + really_hide(self._updatesBox) + threadMgr.add(AnacondaThread(name=constants.THREAD_SOURCE_WATCHER, target=self._initialize))
def _initialize(self):
On Thu, 2013-08-29 at 09:33 -0400, David Shea wrote:
On 08/29/2013 03:32 AM, Vratislav Podzimek wrote:
This looks good to me, but if you are willing to spend two more minutes on it, I'd love to see really_hide() and really_show() methods moved from the pyanaconda/ui/gui/spokes/custom.py to pyanaconda/ui/gui/utils.py (an old patch I had for it attached) and used to hide the updates box.
Sounds good to me.
Great, thanks! Both patches look good to me. ACK.
anaconda-patches@lists.fedorahosted.org