[yast-commit] r56588 - in /trunk/bootloader/src: elilo/helps.ycp grub/helps.ycp ppc/helps.ycp routines/Makefile.am routines/section_widgets.ycp zipl/helps.ycp
Author: jreidinger Date: Thu Apr 2 16:03:31 2009 New Revision: 56588 URL: http://svn.opensuse.org/viewcvs/yast?rev=56588&view=rev Log: reorganize section widget helps and restructualize code to better readability Modified: trunk/bootloader/src/elilo/helps.ycp trunk/bootloader/src/grub/helps.ycp trunk/bootloader/src/ppc/helps.ycp trunk/bootloader/src/routines/Makefile.am trunk/bootloader/src/routines/section_widgets.ycp trunk/bootloader/src/zipl/helps.ycp Modified: trunk/bootloader/src/elilo/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/elilo/helps.ycp?rev=56588&r1=56587&r2=56588&view=diff ============================================================================== --- trunk/bootloader/src/elilo/helps.ycp (original) +++ trunk/bootloader/src/elilo/helps.ycp Thu Apr 2 16:03:31 2009 @@ -61,15 +61,6 @@ In case of memory allocation error at initial load point of kernel, allow attempt to relocate (assume this kernel is relocatable). </p>"), - "image_append" : - _("<p><b>Optional kernel command line parameter</b></p> -May be empty, if already specified in global section.</p>"), - "image_readonly" : - _("<p><b>Force root filesystem to be mounted read-only</b><br> -Usually specified in global section</p>"), - "section_relocatable" : - _("<p><b>Allow attempt to relocate</b> -Usually specified in global section</p>"), "prompt" : _("<p><b>Force Interactive Mode</b> Force interactive mode during booting</p>"), @@ -126,15 +117,6 @@ "fpswa" : _("Specify the filename for a specific FPSWA to load"), "relocatable" : _("Allow attempt to relocate"), "boot_custom" : _("Custom Boot Partition"), - "type_image" : _("Image Section"), - "image_append" : _("Optional kernel command line parameter"), - "image_description" : _("One line text description of the image"), - "image_image" : _("Kernel image"), - "image_initrd" : _("Initial RAM disk"), - "image_noverifyroot" : _("Do not verify filesystem before booting"), - "image_readonly" : _("Force root filesystem to be mounted read-only"), - "image_relocatable" : _("Allow attempt to relocate"), - "image_root" : _("Root device"), ]; Modified: trunk/bootloader/src/grub/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/grub/helps.ycp?rev=56588&r1=56587&r2=56588&view=diff ============================================================================== --- trunk/bootloader/src/grub/helps.ycp (original) +++ trunk/bootloader/src/grub/helps.ycp Thu Apr 2 16:03:31 2009 @@ -82,66 +82,6 @@ _("<p><b>Protect Boot Loader with Password</b><br> Define the password that will be required to access the boot menu. YaST will only accept the password if you repeat it in <b>Retype Password</b>.</p>"), - "type_image" : - _("<p><b>Image Section</b></p>"), - "image" : - _("<p><b>Kernel Image</b> defines the kernel to boot. Either enter the name directly or choose via <b>Browse</b>.</p>"), - "root" : - _("<p><b>Root Device</b> sets the device to pass to the kernel as root device.</p>"), - "vgamode" : - _("<p><b>Vga Mode</b> defines the VGA mode the kernel should set the <i>console</i> to when booting.</p>"), - "append" : - _("<p><b>Optional Kernel Command Line Parameter</b> lets you define additional parameters to pass to the kernel.</p>"), - "initrd" : - _("<p><b>Initial RAM Disk</b>, if not empty, defines the initial ramdisk to use. Either enter the path and file name -directly or choose by using <b>Browse</b>.</p> -"), - "type_other" : - _("<p>Select <b>Chainloader Section</b> if you want to define a section for booting an OS other than Linux.</p>"), - "other_lock" : - _("<p>Setting <b>Use Password Protection</p> will require a password to select this section.</p>"), - "chainloader" : - _("<p><b>Other System</b> lets you choose among the non-Linux operating systems found on your computer.</p>"), - "makeactive" : - _("<p>Select <b>Activate this Partition when selected for Boot</b> if your BIOS needs this flag set in order to boot it</p>"), - "blockoffset" : - _("<p><b>Block Offset for Chainloading</b> lets you specify the list of blocks to boot. In most cases you want -to specify <code>+1</code> here. For specifics on blocklist notation see the grub documentation.</p> -"), - "type_xen" : - _("<p>Select <b>Xen Section</b> if you want to add a new Linux kernel or other image -and start it in a XEN environment.</p> -"), - "xen_image" : - _("<p><b>Kernel Image</b> defines the kernel to boot. Either enter the name directly or choose via <b>Browse</b>.</p>"), - "xen" : - _("<p><b>Hypervisor</b> specifies the Hypervisor to use.</p>"), - "xen_append" : - _("<p><b>Additional Xen Hypervisor Parameters</b> lets you define additional parameters to pass to the xen hypervisor.</p>"), - "xen_initrd" : - _("<p><b>Initial RAM Disk</b>,if not empty, defines the initial ramdisk to use. Either enter the path and file name -directly or choose by using <b>Browse</b>.</p> -"), - "type_menu" : - _("<p><b>Menu Section</b></p>"), - "menu_root" : - _("<p><b>Partition of Menu File</b></p>"), - "configfile" : - _("<p><b>Menu Description File<b></p>"), - "remap" : - _("<p><b>Map Section to the First Disk from Device Map</b> Windows usually need to be on the first disk.</p>"), - "MeasuresTableHelp" : - _("<p><b>Measures</b> includes measured files with PCR. Change table is possible via buttons: <b>Add</b> , -<b>Edit</b> and <b>Delete</b></p>"), - "PCRKernelHelp" : - _("<p><b>PCR Index of Kernel</b> is Platform Configuration Register for kernel</p>"), - "PCRInitrdHelp" : - _("<p><b>PCR Index of Initrd</b> is Platform Configuration Register for initrd</p>"), - "PCRChainloaderHelp" : - _("<p><b>PCR Index of Chainloader</b> is Platform Configuration Register for chainloader</p>"), - "PCRXenHelp" : - _("<p><b>PCR Index of XEN</b> is Platform Configuration Register for XEN</p>"), - ]; @@ -164,27 +104,6 @@ "gfxmenu" : _("Graphical &Menu File"), "password" : _("Pa&ssword for the Menu Interface"), "debug" : _("Debugg&ing Flag"), - "type_image" : _("Image Section"), - "image" : _("&Kernel Image"), - "root" : _("&Root Device"), - "vgamode" : _("&Vga Mode"), - "append" : _("O&ptional Kernel Command Line Parameter"), - "initrd" : _("&Initial RAM Disk"), - "type_other" : _("Chainloader Section"), - "other_lock" : _("Use Password Protection"), - "chainloader" : _("&Other System"), - "noverifyroot" : _("Do not &verify Filesystem before Booting"), - "makeactive" : _("&Activate this Partition when selected for Boot"), - "blockoffset" : _("B&lock Offset for Chainloading"), - "remap" : _("&Map Section to the First Disk in Device Map"), - "type_xen" : _("Xen Section"), - "xen" : _("&Hypervisor"), - "xen_append" : _("&Additional Xen Hypervisor Parameters"), - "xen_image" : _("Kernel Image"), - "xen_initrd" : _("Initial RAM Disk"), - "type_menu" : _("Menu Section"), - "menu_root" : _("&Partition of Menu File"), - "configfile" : _("&Menu Description File"), ]; Modified: trunk/bootloader/src/ppc/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/ppc/helps.ycp?rev=56588&r1=56587&r2=56588&view=diff ============================================================================== --- trunk/bootloader/src/ppc/helps.ycp (original) +++ trunk/bootloader/src/ppc/helps.ycp Thu Apr 2 16:03:31 2009 @@ -107,15 +107,6 @@ "boot_file" : _("Create Boot Image in File"), "boot_iseries_custom": _("PReP Partition"), "boot_pmac_custom" : _("HFS Boot Partition"), - "type_image" : _("Kernel Section"), - "image_image" : _("Kernel Image"), - "image_root" : _("Root Device"), - "image_append" : _("Optional Kernel Command Line Parameter"), - "image_initrd" : _("Initial RAM Disk"), - "copy" : _("Copy Image to Boot Partition"), - "optional" : _("&Skip Section gracefully on Errors"), - "type_other" : _("Boot Other System"), - "other" : _("Boot Partition of Other System"), ]; Modified: trunk/bootloader/src/routines/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/Makefile.am?rev=56588&r1=56587&r2=56588&view=diff ============================================================================== --- trunk/bootloader/src/routines/Makefile.am (original) +++ trunk/bootloader/src/routines/Makefile.am Thu Apr 2 16:03:31 2009 @@ -10,6 +10,7 @@ global_widgets.ycp \ switcher.ycp \ helps.ycp \ + section_helps.ycp \ lilolike.ycp \ popups.ycp \ i386.ycp \ Modified: trunk/bootloader/src/routines/section_widgets.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/section_widgets.ycp?rev=56588&r1=56587&r2=56588&view=diff ============================================================================== --- trunk/bootloader/src/routines/section_widgets.ycp (original) +++ trunk/bootloader/src/routines/section_widgets.ycp Thu Apr 2 16:03:31 2009 @@ -33,10 +33,7 @@ import "FileUtils"; include "bootloader/routines/helps.ycp"; -include "bootloader/grub/helps.ycp"; -include "bootloader/elilo/helps.ycp"; -include "bootloader/zipl/helps.ycp"; -include "bootloader/ppc/helps.ycp"; +include "bootloader/routines/section_helps.ycp"; boolean validate_image(string widget, map event){ string value = (string) UI::QueryWidget(`id(widget),`Value); @@ -113,16 +110,30 @@ BootCommon::current_section[widget] = value ? "true" : "false"; } -map<string,any> SectionCheckBoxWidget( string label, string help){ +map<string,any> SectionCheckBoxWidget( string name){ return $[ - "label" : label, + "label" : section_descriptions[name]:name, "widget" : `checkbox, - "help" : help, + "help" : section_help_messages[name]:"", "init" : InitSectionBool, "store" : StoreSectionBool ]; } +map<string,any> SectionTextFieldWidget( string name){ + map<string,any> ret = $[ + "label" : section_descriptions[name]:name, + "widget" : `textentry, + "help" : section_help_messages[name]:"", + ]; + + if (haskey(validation_map,name)){ + ret["validate_type"] = `function; + ret["validate_function"] = validation_map[name]:nil;//nil cannot happen + } + + return ret; +} /** * Handle function of a widget (InputField + browse button) @@ -166,12 +177,13 @@ * @param string id of widget * @return map<string,any> CWS widget */ -map<string,any> SectionInputFieldBrowseWidget(string label, string help, string id){ +map<string,any> SectionInputFieldBrowseWidget(string id){ string browse = "browse" + id; map<string,any> ret = $[ "widget" : `custom, "custom_widget" : `HBox( - `Left(`InputField(`id(id),`opt(`hstretch), label)), + `Left(`InputField(`id(id),`opt(`hstretch), + section_descriptions[id]:id)), `VBox( `Label(""), `PushButton(`id(browse),`opt(`notify), Label::BrowseButton()) @@ -181,7 +193,7 @@ "store" : SectionOptionStore, "handle" : HandleSectionBrowse, "handle_events" : [browse], - "help" : help, + "help" : section_help_messages[id]:id, ]; if (haskey(validation_map,id)){ ret["validate_type"] = `function; @@ -191,8 +203,8 @@ return ret; } -map<string,any> SectionInputFieldBrowseDirectoryWidget(string label, string help, string id){ - map<string,any> ret = SectionInputFieldBrowseWidget(label,help,id); +map<string,any> SectionInputFieldBrowseDirectoryWidget(string id){ + map<string,any> ret = SectionInputFieldBrowseWidget(id); ret["handle"] = HandleSectionBrowseDirectory; return ret; } @@ -208,12 +220,12 @@ BootCommon::current_section[widget] = tostring(value); } -map<string,any> SectionIntFieldWidget( string label, string help, +map<string,any> SectionIntFieldWidget( string name, integer min, integer max){ map<string,any> ret = $[ - "label" : label, + "label" : section_descriptions[name]:name, "widget" : `intfield, - "help" : help, + "help" : section_help_messages[name]:name, "init" : InitSectionInt, "store" : StoreSectionInt ]; @@ -457,78 +469,48 @@ "store" : SectionNameStore, "help" : SectionNameHelp (), ], - "image" : SectionInputFieldBrowseWidget( - grub_descriptions["image"]:"image", - grub_help_messages["image"]:"", - "image"), - "initrd" : SectionInputFieldBrowseWidget( - grub_descriptions["initrd"]:"initrd", - grub_help_messages["initrd"]:"", - "initrd"), - "xen" : SectionInputFieldBrowseWidget( - grub_descriptions["xen"]:"xen", - grub_help_messages["xen"]:"", - "xen"), - "target" : SectionInputFieldBrowseDirectoryWidget( - zipl_descriptions["target"]:"target", - zipl_help_messages["target"]:"", - "target"), - "parmfile" : SectionInputFieldBrowseWidget( - zipl_descriptions["parmfile"]:"parmfile", - zipl_help_messages["parmfile"]:"", - "parmfile"), + "image" : SectionInputFieldBrowseWidget("image"), + "initrd" : SectionInputFieldBrowseWidget("initrd"), + "xen" : SectionInputFieldBrowseWidget("xen"), + "target" : SectionInputFieldBrowseDirectoryWidget("target"), + "parmfile" : SectionInputFieldBrowseWidget("parmfile"), "dumpto" : $[ //FIXME when exist browse device use it - "label" : zipl_descriptions["dumpto"]:"dumpto", + "label" : section_descriptions["dumpto"]:"dumpto", "widget" : `textentry, - "help" : zipl_help_messages["dumpto"]:"" + "help" : section_help_messages["dumpto"]:"" ], "dumptofs" : $[ //FIXME when exist browse device use it - "label" : zipl_descriptions["dumptofs"]:"dumptofs", + "label" : section_descriptions["dumptofs"]:"dumptofs", "widget" : `textentry, - "help" : zipl_help_messages["dumptofs"]:"" + "help" : section_help_messages["dumptofs"]:"" ], "root" : $[ "widget" : `combobox, // combo box - "label" : grub_descriptions["root"]:"root", + "label" : section_descriptions["root"]:"root", "opt" : [ `editable, `hstretch, `notify ], "init" : RootDeviceInit, "handle" : RootDeviceHandle, "store" : RootDeviceStore, - "help" : grub_help_messages["root"]:"", + "help" : section_help_messages["root"]:"", ], "vgamode" : $[ "widget" : `combobox, // combo box - "label" : grub_descriptions["vgamode"]:"vgamode", + "label" : section_descriptions["vgamode"]:"vgamode", "opt" : [ `editable, `hstretch ], "init" : VgaModeInit, - "help" : grub_help_messages["vgamode"]:"", + "help" : section_help_messages["vgamode"]:"", ], - "append" : $[ - "label" : grub_descriptions["append"]:"append", - "widget" : `textentry, - "help" : grub_help_messages["append"]:"" - ], - "xen_append" : $[ - "label" : grub_descriptions["xen_append"]:"xen_append", - "widget" : `textentry, - "help" : grub_help_messages["xen_append"]:"", - ], - "configfile" : $[ - "label" : grub_descriptions["configfile"]:"configfile", - "widget" : `textentry, - "help" : grub_help_messages["configfile"]:"", - ], - "list" : $[ - "label" : zipl_descriptions["list"]:"list", - "widget" : `textentry, - "help" : zipl_help_messages["list"]:"", - ], + "append" : SectionTextFieldWidget("append"), + "xen_append" : SectionTextFieldWidget("xen_append"), + "configfile" : SectionTextFieldWidget("configfile"), + "list" : SectionTextFieldWidget("list"), "chainloader" : $[ "widget" : `combobox, "init" : ChainloaderInit, - "help" : grub_help_messages["chainloader"]:"", + "help" : section_help_messages["chainloader"]:"", + "label" : section_descriptions["chainloader"]:"chainloader", "opt" : [ `editable, `hstretch ], ], "section_type" : $[ @@ -537,41 +519,21 @@ "handle" : SectionTypeHandle, "help" : SectionTypeHelp (), ], - "makeactive" : SectionCheckBoxWidget( - grub_descriptions["makeactive"]:"makeactive", - grub_help_messages["makeactive"]:""), - "noverifyroot" : SectionCheckBoxWidget( - grub_descriptions["noverifyroot"]:"noverifyroot", - grub_help_messages["noverifyroot"]:""), - "remap" : SectionCheckBoxWidget( - grub_descriptions["remap"]:"remap", - grub_help_messages["remap"]:""), - "relocatable" : SectionCheckBoxWidget( - elilo_descriptions["relocatable"]:"relocatable", - elilo_help_messages["section_relocatable"]:""), - "prompt" : SectionCheckBoxWidget( - zipl_descriptions["prompt"]:"prompt", - zipl_help_messages["prompt"]:""), + "makeactive" : SectionCheckBoxWidget("makeactive"), + "noverifyroot" : SectionCheckBoxWidget("noverifyroot"), + "remap" : SectionCheckBoxWidget("remap"), + "relocatable" : SectionCheckBoxWidget("relocatable"), + "prompt" : SectionCheckBoxWidget("prompt"), "blockoffset" : SectionIntFieldWidget( - grub_descriptions["blockoffset"]:"blockoffset", - grub_help_messages["blockoffset"]:"",0,nil), + "blockoffset",0,nil), "default" : SectionIntFieldWidget( - zipl_descriptions["default"]:"default", - zipl_help_messages["default"]:"",1,10), + "default",1,10), "timeout" : SectionIntFieldWidget( - zipl_descriptions["timeout"]:"timeout", - zipl_help_messages["timeout"]:"",0,60), - "optional" : SectionCheckBoxWidget( - ppc_descriptions["optional"]:"optional", - ppc_help_messages["optional"]:""), - "copy" : SectionCheckBoxWidget( - ppc_descriptions["copy"]:"copy", - ppc_help_messages["copy"]:""), - "other" : $[ //FIXME change to combobox and add proper init function - "label" : ppc_descriptions["other"]:"other", - "widget" : `textentry, - "help" : ppc_help_messages["other"]:"" - ], + "timeout",0,60), + "optional" : SectionCheckBoxWidget("optional"), + "copy" : SectionCheckBoxWidget("copy"), + "other" : //FIXME change to combobox and add proper init function + SectionTextFieldWidget("other"), ]; } Modified: trunk/bootloader/src/zipl/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/zipl/helps.ycp?rev=56588&r1=56587&r2=56588&view=diff ============================================================================== --- trunk/bootloader/src/zipl/helps.ycp (original) +++ trunk/bootloader/src/zipl/helps.ycp Thu Apr 2 16:03:31 2009 @@ -20,35 +20,12 @@ textdomain "bootloader"; global map<string,string> zipl_help_messages = $[ - "type_dump" : - _("<p>Select <b>Dump Section</b> to add a section that specifies how to -create a system dump either on a DASD disk partition or tape device or to a -file on a SCSI disk partition.</p>"), - "type_menu" : - _("<p>Select <b>Menu Section</b> to add a new menu to the configuration. -Menu sections represent a list of tasks which are grouped together.</p> -"), ]; global map<string,string> zipl_descriptions = $[ "boot" : _("Boot Image Location"), "default" : _("Default Boot Section/Menu"), - "type_image" : _("Image Section"), - "target" : _("Tar&get Directory for Section"), - "image_image" : _("Kernel Image"), - "image_initrd" : _("Initial RAM Disk"), - "image_append" : _("Optional Kernel Parameters"), - "image_root" : _("Root device"), - "parmfile" : _("Op&tional Parameter File"), - "type_dump" : _("Dump Section (obsolete)"), - "dumpto" : _("&Dump Device"), - "dumptofs" : _("&SCSI Dump Device"), - "type_menu" : _("Menu Section"), - "list" : _("&List of Menu Entries"), - "default" : _("&Number of Default Entry"), - "timeout" : _("&Timeout in seconds"), - "prompt" : _("&Show boot menu"), ]; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jreidinger@svn.opensuse.org