Sandro Bonazzola has uploaded a new change for review. Change subject: UX: grouping and titling customization questions ......................................................................
UX: grouping and titling customization questions Grouped customization questions and given a title to each group. Change-Id: If742df163e380f89aa4aa6c465fc437f2b43f771 Signed-off-by: Sandro Bonazzola <sbona...@redhat.com> --- M src/ovirt_hosted_engine_setup/constants.py M src/plugins/ovirt-hosted-engine-setup/core/Makefile.am M src/plugins/ovirt-hosted-engine-setup/core/__init__.py A src/plugins/ovirt-hosted-engine-setup/core/titles.py M src/plugins/ovirt-hosted-engine-setup/engine/add_host.py M src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py M src/plugins/ovirt-hosted-engine-setup/network/bridge.py M src/plugins/ovirt-hosted-engine-setup/network/firewall.py M src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py M src/plugins/ovirt-hosted-engine-setup/network/gateway.py M src/plugins/ovirt-hosted-engine-setup/storage/storage.py M src/plugins/ovirt-hosted-engine-setup/system/sshd.py M src/plugins/ovirt-hosted-engine-setup/system/super_user.py M src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py M src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py M src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py M src/plugins/ovirt-hosted-engine-setup/vm/cpu.py M src/plugins/ovirt-hosted-engine-setup/vm/image.py M src/plugins/ovirt-hosted-engine-setup/vm/memory.py M src/plugins/ovirt-hosted-engine-setup/vm/runvm.py 20 files changed, 258 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup refs/changes/38/18038/1 diff --git a/src/ovirt_hosted_engine_setup/constants.py b/src/ovirt_hosted_engine_setup/constants.py index ee303ac..9094f86 100644 --- a/src/ovirt_hosted_engine_setup/constants.py +++ b/src/ovirt_hosted_engine_setup/constants.py @@ -485,6 +485,17 @@ HOST_ADDED = 'ohosted.engine.host.added' HA_START = 'ohosted.engine.ha.start' + DIALOG_TITLES_S_VM = 'ohosted.dialog.titles.vm.start' + DIALOG_TITLES_E_VM = 'ohosted.dialog.titles.vm.end' + DIALOG_TITLES_S_NETWORK = 'ohosted.dialog.titles.network.start' + DIALOG_TITLES_E_NETWORK = 'ohosted.dialog.titles.network.end' + DIALOG_TITLES_S_ENGINE = 'ohosted.dialog.titles.engine.start' + DIALOG_TITLES_E_ENGINE = 'ohosted.dialog.titles.engine.end' + DIALOG_TITLES_S_SYSTEM = 'ohosted.dialog.titles.system.start' + DIALOG_TITLES_E_SYSTEM = 'ohosted.dialog.titles.system.end' + DIALOG_TITLES_S_STORAGE = 'ohosted.dialog.titles.storage.start' + DIALOG_TITLES_E_STORAGE = 'ohosted.dialog.titles.storage.end' + @util.export @util.codegen diff --git a/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am b/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am index 99d7b7e..8f314b8 100644 --- a/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am +++ b/src/plugins/ovirt-hosted-engine-setup/core/Makefile.am @@ -32,6 +32,7 @@ offlinepackager.py \ preview.py \ shell.py \ + titles.py \ $(NULL) clean-local: \ diff --git a/src/plugins/ovirt-hosted-engine-setup/core/__init__.py b/src/plugins/ovirt-hosted-engine-setup/core/__init__.py index 79a7b8a..8efd871 100644 --- a/src/plugins/ovirt-hosted-engine-setup/core/__init__.py +++ b/src/plugins/ovirt-hosted-engine-setup/core/__init__.py @@ -30,6 +30,7 @@ from . import offlinepackager from . import preview from . import shell +from . import titles @util.export @@ -40,6 +41,7 @@ offlinepackager.Plugin(context=context) preview.Plugin(context=context) shell.Plugin(context=context) + titles.Plugin(context=context) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/plugins/ovirt-hosted-engine-setup/core/titles.py b/src/plugins/ovirt-hosted-engine-setup/core/titles.py new file mode 100644 index 0000000..274ebed --- /dev/null +++ b/src/plugins/ovirt-hosted-engine-setup/core/titles.py @@ -0,0 +1,159 @@ +# +# ovirt-hosted-engine-setup -- ovirt hosted engine setup +# Copyright (C) 2013 Red Hat, Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + + +""" +Customization sections title plugin. +""" + +import gettext + +from otopi import util +from otopi import plugin + + +from ovirt_hosted_engine_setup import constants as ohostedcons + + +_ = lambda m: gettext.dgettext(message=m, domain='ovirt-hosted-engine-setup') + + +@util.export +class Plugin(plugin.PluginBase): + """ + Customization sections title plugin. + """ + + def _title(self, text): + self.dialog.note( + text='\n--== %s ==--\n\n' % text, + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_S_STORAGE, + before=( + ohostedcons.Stages.DIALOG_TITLES_E_STORAGE, + ) + ) + def _storage_start(self): + self._title( + text=_('STORAGE CONFIGURATION'), + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_E_STORAGE, + before=( + ohostedcons.Stages.DIALOG_TITLES_S_SYSTEM, + ), + ) + def _storage_end(self): + pass + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_S_SYSTEM, + before=( + ohostedcons.Stages.DIALOG_TITLES_E_SYSTEM, + ), + ) + def _system_start(self): + self._title( + text=_('SYSTEM CONFIGURATION'), + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_E_SYSTEM, + before=( + ohostedcons.Stages.DIALOG_TITLES_S_NETWORK, + ), + ) + def _system_end(self): + pass + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_S_NETWORK, + before=( + ohostedcons.Stages.DIALOG_TITLES_E_NETWORK, + ), + ) + def _network_start(self): + self._title( + text=_('NETWORK CONFIGURATION'), + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_E_NETWORK, + before=( + ohostedcons.Stages.DIALOG_TITLES_S_VM, + ), + ) + def _network_end(self): + pass + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_S_VM, + condition=lambda self: not self.environment[ + ohostedcons.CoreEnv.IS_ADDITIONAL_HOST + ], + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, + ), + ) + def _vm_start(self): + self._title( + text=_('VM CONFIGURATION'), + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_E_VM, + condition=lambda self: not self.environment[ + ohostedcons.CoreEnv.IS_ADDITIONAL_HOST + ], + before=( + ohostedcons.Stages.DIALOG_TITLES_S_ENGINE, + ), + ) + def _vm_end(self): + pass + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_S_ENGINE, + before=( + ohostedcons.Stages.DIALOG_TITLES_E_ENGINE, + ), + ) + def _engine_start(self): + self._title( + text=_('HOSTED ENGINE CONFIGURATION'), + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=ohostedcons.Stages.DIALOG_TITLES_E_ENGINE, + ) + def _engine_end(self): + pass diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py b/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py index ff7a57a..fc39a52 100644 --- a/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py +++ b/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py @@ -185,6 +185,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, + after=( + ohostedcons.Stages.DIALOG_TITLES_S_ENGINE, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_ENGINE, + ), ) def _customization(self): interactive = ( diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py b/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py index 1ce7a69..26c819f 100644 --- a/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py +++ b/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py @@ -235,6 +235,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, + after=( + ohostedcons.Stages.DIALOG_TITLES_S_ENGINE, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_ENGINE, + ), ) def _customization(self): interactive = self.environment[ diff --git a/src/plugins/ovirt-hosted-engine-setup/network/bridge.py b/src/plugins/ovirt-hosted-engine-setup/network/bridge.py index c49a08f..cf0494f 100644 --- a/src/plugins/ovirt-hosted-engine-setup/network/bridge.py +++ b/src/plugins/ovirt-hosted-engine-setup/network/bridge.py @@ -87,6 +87,12 @@ self._enabled and not self.environment[ohostedcons.CoreEnv.IS_ADDITIONAL_HOST] ), + after=( + ohostedcons.Stages.DIALOG_TITLES_S_NETWORK, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_NETWORK, + ), ) def _customization(self): nics = ethtool.get_devices() diff --git a/src/plugins/ovirt-hosted-engine-setup/network/firewall.py b/src/plugins/ovirt-hosted-engine-setup/network/firewall.py index 94ca992..98a4c7c 100644 --- a/src/plugins/ovirt-hosted-engine-setup/network/firewall.py +++ b/src/plugins/ovirt-hosted-engine-setup/network/firewall.py @@ -46,12 +46,14 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, - before=( - ohostedcons.Stages.NET_FIREWALL_MANAGER_PROCESS_TEMPLATES, - ), after=( + ohostedcons.Stages.DIALOG_TITLES_S_NETWORK, ohostedcons.Stages.NET_FIREWALL_MANAGER_AVAILABLE, ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_NETWORK, + ohostedcons.Stages.NET_FIREWALL_MANAGER_PROCESS_TEMPLATES, + ), condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], diff --git a/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py b/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py index a6d0f3d..833b0d8 100644 --- a/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py +++ b/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py @@ -125,6 +125,12 @@ condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], + after=( + ohostedcons.Stages.DIALOG_TITLES_S_NETWORK, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_NETWORK, + ), ) def _customization(self): if self.environment[ohostedcons.NetworkEnv.FIREWALL_MANAGER] is None: diff --git a/src/plugins/ovirt-hosted-engine-setup/network/gateway.py b/src/plugins/ovirt-hosted-engine-setup/network/gateway.py index 8683560..c2e26df 100644 --- a/src/plugins/ovirt-hosted-engine-setup/network/gateway.py +++ b/src/plugins/ovirt-hosted-engine-setup/network/gateway.py @@ -79,6 +79,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, + after=( + ohostedcons.Stages.DIALOG_TITLES_S_NETWORK, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_NETWORK, + ), ) def _customization(self): diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py index 99c8630..a9dd7d7 100644 --- a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py +++ b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py @@ -485,6 +485,12 @@ stage=plugin.Stages.STAGE_CUSTOMIZATION, name=ohostedcons.Stages.CONFIG_STORAGE, priority=plugin.Stages.PRIORITY_FIRST, + after=( + ohostedcons.Stages.DIALOG_TITLES_S_STORAGE, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_STORAGE, + ), ) def _customization(self): self.dialog.note( diff --git a/src/plugins/ovirt-hosted-engine-setup/system/sshd.py b/src/plugins/ovirt-hosted-engine-setup/system/sshd.py index 0fadce1..01613fe 100644 --- a/src/plugins/ovirt-hosted-engine-setup/system/sshd.py +++ b/src/plugins/ovirt-hosted-engine-setup/system/sshd.py @@ -48,6 +48,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, priority=plugin.Stages.PRIORITY_HIGH, + after=( + ohostedcons.Stages.DIALOG_TITLES_S_SYSTEM, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_SYSTEM, + ), ) def _customization(self): if not self.services.exists(name='sshd'): diff --git a/src/plugins/ovirt-hosted-engine-setup/system/super_user.py b/src/plugins/ovirt-hosted-engine-setup/system/super_user.py index 78089c8..287c7f5 100644 --- a/src/plugins/ovirt-hosted-engine-setup/system/super_user.py +++ b/src/plugins/ovirt-hosted-engine-setup/system/super_user.py @@ -77,6 +77,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, + after=( + ohostedcons.Stages.DIALOG_TITLES_S_SYSTEM, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_SYSTEM, + ), ) def _customization(self): interactive = ( diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py b/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py index fefd792..7f32c2b 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py @@ -83,8 +83,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, after=( + ohostedcons.Stages.DIALOG_TITLES_S_VM, ohostedcons.Stages.CONFIG_BOOT_DEVICE, ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, + ), condition=lambda self: ( self.environment[ohostedcons.VMEnv.BOOT] == 'cdrom' and not self.environment[ohostedcons.CoreEnv.IS_ADDITIONAL_HOST] diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py b/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py index ab9f597..7cc2ce8 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py @@ -282,8 +282,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, after=( + ohostedcons.Stages.DIALOG_TITLES_S_VM, ohostedcons.Stages.CONFIG_BOOT_DEVICE, ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, + ), condition=lambda self: ( self.environment[ohostedcons.VMEnv.BOOT] == 'disk' and not self.environment[ohostedcons.CoreEnv.IS_ADDITIONAL_HOST] diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py b/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py index d60dbed..50837d7 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py @@ -85,6 +85,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, name=ohostedcons.Stages.CONFIG_BOOT_DEVICE, + after=( + ohostedcons.Stages.DIALOG_TITLES_S_VM, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, + ), ) def _customization(self): if self.environment[ohostedcons.CoreEnv.IS_ADDITIONAL_HOST]: diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py b/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py index 9ccddae..e18834b 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py @@ -57,8 +57,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, after=( + ohostedcons.Stages.DIALOG_TITLES_S_VM, ohostedcons.Stages.CONFIG_OVF_IMPORT, ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, + ), condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/image.py b/src/plugins/ovirt-hosted-engine-setup/vm/image.py index 458ef26..ae197f3 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/image.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/image.py @@ -73,8 +73,12 @@ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], after=( + ohostedcons.Stages.DIALOG_TITLES_S_VM, ohostedcons.Stages.CONFIG_OVF_IMPORT, ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, + ), ) def _disk_customization(self): interactive = self.environment[ diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/memory.py b/src/plugins/ovirt-hosted-engine-setup/vm/memory.py index a65e3e2..a9384b4 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/memory.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/memory.py @@ -61,6 +61,10 @@ ], after=( ohostedcons.Stages.CONFIG_OVF_IMPORT, + ohostedcons.Stages.DIALOG_TITLES_S_VM, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, ), ) def _customization(self): diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py b/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py index 152bf4a..7de9fd2 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py @@ -187,6 +187,12 @@ condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], + after=( + ohostedcons.Stages.DIALOG_TITLES_S_VM, + ), + before=( + ohostedcons.Stages.DIALOG_TITLES_E_VM, + ), ) def _customization(self): self._vdscommand = [self.command.get('vdsClient')] -- To view, visit http://gerrit.ovirt.org/18038 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If742df163e380f89aa4aa6c465fc437f2b43f771 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-hosted-engine-setup Gerrit-Branch: master Gerrit-Owner: Sandro Bonazzola <sbona...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches