Author: jreidinger Date: Thu Apr 2 16:41:51 2009 New Revision: 56590 URL: http://svn.opensuse.org/viewcvs/yast?rev=56590&view=rev Log: separate common help from grub help Modified: trunk/bootloader/src/elilo/helps.ycp trunk/bootloader/src/routines/Makefile.am trunk/bootloader/src/routines/common_options.ycp trunk/bootloader/src/routines/grub_options.ycp Modified: trunk/bootloader/src/elilo/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/elilo/helps.ycp?rev=56590&r1=56589&r2=56590&view=diff ============================================================================== --- trunk/bootloader/src/elilo/helps.ycp (original) +++ trunk/bootloader/src/elilo/helps.ycp Thu Apr 2 16:41:51 2009 @@ -23,12 +23,6 @@ global map<string,string> elilo_help_messages = $[ "boot-loader-location" : _("<p><big><b>Boot Loader Location</b></big><br>"), "boot" : _("<p><b>Boot Image Location</b></p>"), - "default" : _("<p><b>Default Boot Section</b></p>"), - "timeout" : - _("<p><b>Timeout in tenths of a second</b><br> Specifies the time the -bootloader will wait in interactive mode until booting the default -entry.</p> -"), "verbose" : _("<p><b>Set level of verbosity [0-5]</b><br> Increase verbosity of ELILO in case of boot problems.</p>"), @@ -100,8 +94,6 @@ global map<string,string> elilo_descriptions = $[ "boot" : _("Boot Image Location"), - "default" : _("Default Boot Section"), - "timeout" : _("Timeout in tenth of seconds (in interactive mode)"), "delay" : _("Delay to wait before auto booting in seconds (used if not in interactive mode)"), "prompt" : _("Force interactive mode"), "verbose" : _("Set level of verbosity [0-5]"), Modified: trunk/bootloader/src/routines/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/Makefile.am?rev=56590&r1=56589&r2=56590&view=diff ============================================================================== --- trunk/bootloader/src/routines/Makefile.am (original) +++ trunk/bootloader/src/routines/Makefile.am Thu Apr 2 16:41:51 2009 @@ -22,7 +22,8 @@ helps_i386.ycp \ autoinstall.ycp \ grub_options.ycp \ - common_options.ycp + common_options.ycp \ + common_helps.ycp EXTRA_DIST = \ $(ynclude_DATA) Modified: trunk/bootloader/src/routines/common_options.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/common_options.ycp?rev=56590&r1=56589&r2=56590&view=diff ============================================================================== --- trunk/bootloader/src/routines/common_options.ycp (original) +++ trunk/bootloader/src/routines/common_options.ycp Thu Apr 2 16:41:51 2009 @@ -19,7 +19,7 @@ textdomain "bootloader"; -include "bootloader/grub/helps.ycp"; //TODO merge helps +include "bootloader/routines/common_helps.ycp"; /** * Init function for widget value (InputField) @@ -187,89 +187,21 @@ map<string,any> TimeoutWidget () { return $[ "widget" : `intfield, - "label" : grub_descriptions["timeout"]:"timeout", + "label" : common_descriptions["timeout"]:"timeout", "minimum" : 0, "maximum" : 300, "init" : InitGlobalInt, "store" : StoreGlobalInt, - "help" : grub_help_messages["timeout"]:"" + "help" : common_help_messages["timeout"]:"" ]; } /** - * Init function for console - * @param string widget - */ -void InitConsole( string widget){ - boolean enable = BootCommon::globals["terminal"]:"" == "serial"; - UI::ChangeWidget(`id(`console_frame),`Value, enable); - string args = BootCommon::globals["serial"]:""; - UI::ChangeWidget(`id(`console_args),`Value, args); -} - -/** - * Store function of a console - * @param widget any widget key - * @param event map event description of event that occured - */ -void StoreConsole(string widget, map event){ - boolean use_serial = (boolean) UI::QueryWidget(`id(`console_frame),`Value); - if (use_serial) - { - BootCommon::globals["terminal"] = "serial"; - string console_value = (string) UI::QueryWidget(`id(`console_args),`Value); - if (console_value != "") - BootCommon::globals["serial"] = console_value; - } else { - if (haskey(BootCommon::globals, "terminal")) - BootCommon::globals = remove(BootCommon::globals, "terminal"); - if (haskey(BootCommon::globals, "serial")) - BootCommon::globals = remove(BootCommon::globals, "serial"); - } - // FATE: #110038: Serial console - // add or remove console key with value for sections - BootCommon::HandleConsole(); -} - -/** - * Handle function of a console - * @param widget any widget key - * @param event map event description of event that occured - * @return symbol nil - */ -symbol HandleConsole(string widget, map event){ - boolean enable = (boolean) UI::QueryWidget(`id(`enable_console),`Value); - UI::ChangeWidget(`id(`console_args),`Enabled, enable); - return nil; -} - -/** - * Common widget of a console - * @return map<string,any> CWS widget - */ -map<string,any> ConsoleWidget() { - return $[ - "widget" : `custom, - "custom_widget" : `HBox( - `CheckBoxFrame(`id(`console_frame),_("Use &serial console"),true, - `HBox( - `HSpacing(2), - `InputField(`id(`console_args),`opt(`hstretch), _("&Console arguments")), - `HStretch())) - ), - "init" : InitConsole, - "store" : StoreConsole, - "help" : grub_help_messages["serial"]:"" - ]; -} - -/** * Common widgets of global settings * @return map<string, map<string,any> > CWS widgets */ map<string,map<string,any> > CommonOptions(){ return $[ "timeout" : TimeoutWidget(), - "console" : ConsoleWidget() ]; } Modified: trunk/bootloader/src/routines/grub_options.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/bootloader/src/routines/grub_options.ycp?rev=56590&r1=56589&r2=56590&view=diff ============================================================================== --- trunk/bootloader/src/routines/grub_options.ycp (original) +++ trunk/bootloader/src/routines/grub_options.ycp Thu Apr 2 16:41:51 2009 @@ -209,6 +209,73 @@ ]; } +/** + * Init function for console + * @param string widget + */ +void InitConsole( string widget){ + boolean enable = BootCommon::globals["terminal"]:"" == "serial"; + UI::ChangeWidget(`id(`console_frame),`Value, enable); + string args = BootCommon::globals["serial"]:""; + UI::ChangeWidget(`id(`console_args),`Value, args); +} + +/** + * Store function of a console + * @param widget any widget key + * @param event map event description of event that occured + */ +void StoreConsole(string widget, map event){ + boolean use_serial = (boolean) UI::QueryWidget(`id(`console_frame),`Value); + if (use_serial) + { + BootCommon::globals["terminal"] = "serial"; + string console_value = (string) UI::QueryWidget(`id(`console_args),`Value); + if (console_value != "") + BootCommon::globals["serial"] = console_value; + } else { + if (haskey(BootCommon::globals, "terminal")) + BootCommon::globals = remove(BootCommon::globals, "terminal"); + if (haskey(BootCommon::globals, "serial")) + BootCommon::globals = remove(BootCommon::globals, "serial"); + } + // FATE: #110038: Serial console + // add or remove console key with value for sections + BootCommon::HandleConsole(); +} + +/** + * Handle function of a console + * @param widget any widget key + * @param event map event description of event that occured + * @return symbol nil + */ +symbol HandleConsole(string widget, map event){ + boolean enable = (boolean) UI::QueryWidget(`id(`enable_console),`Value); + UI::ChangeWidget(`id(`console_args),`Enabled, enable); + return nil; +} + +/** + * Common widget of a console + * @return map<string,any> CWS widget + */ +map<string,any> ConsoleWidget() { + return $[ + "widget" : `custom, + "custom_widget" : `HBox( + `CheckBoxFrame(`id(`console_frame),_("Use &serial console"),true, + `HBox( + `HSpacing(2), + `InputField(`id(`console_args),`opt(`hstretch), _("&Console arguments")), + `HStretch())) + ), + "init" : InitConsole, + "store" : StoreConsole, + "help" : grub_help_messages["serial"]:"" + ]; +} + map<string,map<string,any> > GrubOptions(){ map<string,map<string,any> > grub_specific = $[ "activate" : CommonCheckboxWidget(grub_descriptions["activate"]:"activate", @@ -222,6 +289,7 @@ grub_help_messages["hiddenmenu"]:""), "gfxmenu" : GfxWidget(), "password" : PasswordWidget(), + "console" : ConsoleWidget(), ]; return (map<string,map<string,any> >)union(grub_specific,CommonOptions()); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org