Author: jreidinger
Date: Mon Mar 16 09:40:04 2009
New Revision: 56126
URL: http://svn.opensuse.org/viewcvs/yast?rev=56126&view=rev
Log:
zipl refactor, but still some problems with generic part
Modified:
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp?rev=56126&r1=56125&r2=56126&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp Mon Mar 16 09:40:04 2009
@@ -151,7 +151,7 @@
* Run dialog for kernel section editation
* @return symbol for wizard sequencer
*/
-symbol KernelSectionDialog () {
+symbol CommonKernelSectionDialog () {
y2milestone ("Running kernel section dialog");
string lt = Bootloader::getLoaderType ();
term contents = `HBox (`HSpacing (2), `VBox (
@@ -201,6 +201,60 @@
]);
}
+symbol ZiplKernelSectionDialog () {
+ y2milestone ("Running kernel section dialog");
+ string lt = Bootloader::getLoaderType ();
+ term contents = `HBox (`HSpacing (2), `VBox (
+ `VStretch (),
+ // heading
+ `Left (`Heading (_("Kernel Section"))),
+ `VSpacing (1),
+ "name",
+ `VStretch (),
+ // frame
+ `Frame (_("Section Settings"), `HBox (`HSpacing (2), `VBox (
+ `VSpacing (1),
+ "target",
+ "image",
+ "initrd",
+ "root",
+ "append",
+ "parmfile",
+ `VSpacing (1)
+ ), `HSpacing (2))),
+ `VStretch ()
+ ), `HSpacing (2));
+
+ list<string> widget_names = ["name", "image", "initrd", "root", "append"
+ ,"parmfile","target"];
+
+ map > widget_descr = $[];
+ widget_descr = (map >) union (CommonGlobalWidgets (), CommonSectionWidgets ());
+
+
+ // dialog caption
+ string caption = _("Boot Loader Settings: Section Management");
+ return CWM::ShowAndRun ($[
+ "widget_descr" : widget_descr,
+ "widget_names" : widget_names,
+ "contents" : contents,
+ "caption" : caption,
+ "back_button" : Label::BackButton (),
+ "abort_button" : Label::CancelButton (),
+ "next_button" : Label::OKButton (),
+ "fallback_functions" : section_handlers,
+ ]);
+}
+
+symbol KernelSectionDialog() {
+ string bootloader = Bootloader::getLoaderType();
+ if (bootloader == "zipl"){
+ return ZiplKernelSectionDialog();
+ } else{
+ return CommonKernelSectionDialog();
+ }
+}
+
symbol XenSectionDialog () {
y2milestone ("Running kernel section dialog");
string lt = Bootloader::getLoaderType ();
@@ -249,7 +303,7 @@
]);
}
-symbol MenuSectionDialog () {
+symbol GrubMenuSectionDialog () {
y2milestone ("Running kernel section dialog");
string lt = Bootloader::getLoaderType ();
term contents = `HBox (`HSpacing (2), `VBox (
@@ -271,10 +325,7 @@
list<string> widget_names = ["name", "root", "configfile"];
map > widget_descr = $[];
- if (lt != "grub")
- widget_descr = (map >) union (CommonGlobalWidgets (), Bootloader::blWidgetMaps ());
- else
- widget_descr = (map >) union (CommonGlobalWidgets (), CommonSectionWidgets ());
+ widget_descr = (map >) union (CommonGlobalWidgets (), CommonSectionWidgets ());
// dialog caption
string caption = _("Boot Loader Settings: Section Management");
return CWM::ShowAndRun ($[
@@ -289,6 +340,91 @@
]);
}
+symbol ZiplMenuSectionDialog () {
+ y2milestone ("Running kernel section dialog");
+ term contents = `HBox (`HSpacing (2), `VBox (
+ `VStretch (),
+ // heading
+ `Left (`Heading (_("Menu Section"))),
+ `VSpacing (1),
+ "name",
+ `VStretch (),
+ // frame
+ `Frame (_("Section Settings"), `HBox (`HSpacing (2), `VBox (
+ `VSpacing (1),
+ "target",
+ "list",
+ "default",
+ "timeout",
+ `Left("prompt"),
+ `VSpacing (1)
+ ), `HSpacing (2))),
+ `VStretch ()
+ ), `HSpacing (2));
+
+ list<string> widget_names = ["name", "target", "default","list","timeout","prompt"];
+ map > widget_descr = $[];
+ widget_descr = (map >) union (CommonGlobalWidgets (), CommonSectionWidgets ());
+ // dialog caption
+ string caption = _("Boot Loader Settings: Section Management");
+ return CWM::ShowAndRun ($[
+ "widget_descr" : widget_descr,
+ "widget_names" : widget_names,
+ "contents" : contents,
+ "caption" : caption,
+ "back_button" : Label::BackButton (),
+ "abort_button" : Label::CancelButton (),
+ "next_button" : Label::OKButton (),
+ "fallback_functions" : section_handlers,
+ ]);
+}
+
+symbol DumpSectionDialog () {
+ y2milestone ("Running kernel section dialog");
+ term contents = `HBox (`HSpacing (2), `VBox (
+ `VStretch (),
+ // heading
+ `Left (`Heading (_("Dump Section"))),
+ `VSpacing (1),
+ "name",
+ `VStretch (),
+ // frame
+ `Frame (_("Section Settings"), `HBox (`HSpacing (2), `VBox (
+ `VSpacing (1),
+ "target",
+ "dumpto",
+ "dumptofs",
+ `VSpacing (1)
+ ), `HSpacing (2))),
+ `VStretch ()
+ ), `HSpacing (2));
+
+ list<string> widget_names = ["name", "target", "dumpto","dumptofs"];
+ map > widget_descr = $[];
+ widget_descr = (map >) union (CommonGlobalWidgets (), CommonSectionWidgets ());
+ // dialog caption
+ string caption = _("Boot Loader Settings: Section Management");
+ return CWM::ShowAndRun ($[
+ "widget_descr" : widget_descr,
+ "widget_names" : widget_names,
+ "contents" : contents,
+ "caption" : caption,
+ "back_button" : Label::BackButton (),
+ "abort_button" : Label::CancelButton (),
+ "next_button" : Label::OKButton (),
+ "fallback_functions" : section_handlers,
+ ]);
+}
+
+symbol MenuSectionDialog() {
+ string bootloader = Bootloader::getLoaderType();
+ if (bootloader == "grub"){
+ return GrubMenuSectionDialog();
+ } else if (bootloader == "zipl"){
+ return ZiplMenuSectionDialog();
+ }
+}
+
/**
* Run dialog for kernel section editation
* @return symbol for wizard sequencer
@@ -387,6 +523,8 @@
return `xen;
if (type == "menu")
return `menus;
+ if (type == "dump")
+ return `dump;
if (type == "image")
return `kernel;
else
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp?rev=56126&r1=56125&r2=56126&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp Mon Mar 16 09:40:04 2009
@@ -33,6 +33,8 @@
include "bootloader/routines/helps.ycp";
include "bootloader/grub/helps.ycp";
+include "bootloader/elilo/helps.ycp";
+include "bootloader/zipl/helps.ycp";
/**
@@ -234,6 +236,56 @@
}
/**
+ * Handle function of a widget
+ * @param widget any widget key
+ * @param event map event description of event that occured
+ * @return symbol to return to wizard sequencer, or nil
+ */
+symbol TargetHandle (string widget, map event) {
+ string current = (string)UI::QueryWidget (`id (widget), `Value);
+ // file open popup caption
+ if (current == nil || current == "")
+ current = "/boot";
+ current = UI::AskForExistingDirectory (current, _("Target directory"));
+ if (current != nil)
+ UI::ChangeWidget (`id (widget), `Value, current);
+ return nil;
+}
+
+/**
+ * Handle function of a widget
+ * @param widget any widget key
+ * @param event map event description of event that occured
+ * @return symbol to return to wizard sequencer, or nil
+ */
+symbol ParmfileHandle (string widget, map event) {
+ string current = (string)UI::QueryWidget (`id (widget), `Value);
+ // file open popup caption
+ if (current == nil || current == "")
+ current = "/boot/";
+ current = UI::AskForExistingFile (current, "*" , _("Select parmfile"));
+ if (current != nil)
+ UI::ChangeWidget (`id (widget), `Value, current);
+ return nil;
+}
+
+/**
+ * Handle function of a widget
+ * @param widget any widget key
+ * @param event map event description of event that occured
+ * @return symbol to return to wizard sequencer, or nil
+ */
+symbol DumptoHandle (string widget, map event) {
+ string current = (string)UI::QueryWidget (`id (widget), `Value);
+ // file open popup caption
+ if (current == nil || current == "")
+ current = "/dev/";
+ current = UI::AskForExistingFile (current, "" , _("Select device"));
+ if (current != nil)
+ UI::ChangeWidget (`id (widget), `Value, current);
+ return nil;
+}
+/**
* Init function of the root device widget
* @param widget any id of the widget
*/
@@ -500,6 +552,70 @@
"handle_events" : [ `xen_browse ],
"help" : grub_help_messages["xen"]:"",
],
+ "target" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `HBox (
+ `InputField (`id ("target"), `opt (`hstretch),
+ zipl_descriptions["target"]:"target"),
+ `VBox (
+ `Label (""),
+ `PushButton (`id (`target_browse),
+ Label::BrowseButton ())
+ )
+ ),
+ "handle" : TargetHandle,
+ "handle_events" : [ `target_browse ],
+ "help" : zipl_help_messages["target"]:"",
+ ],
+ "parmfile" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `HBox (
+ `InputField (`id ("parmfile"), `opt (`editable, `hstretch),
+ zipl_descriptions["parmfile"]:"parmfile"),
+ `VBox (
+ `Label (""),
+ `PushButton (`id (`parm_browse),
+ Label::BrowseButton ())
+ )
+ ),
+ "handle" : ParmfileHandle,
+ "handle_events" : [ `parm_browse ],
+ "help" : zipl_help_messages["parmfile"]:"",
+ ],
+ "dumpto" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `HBox (
+ `InputField (`id ("dumpto"), `opt (`editable, `hstretch),
+ zipl_descriptions["dumpto"]:"dumpto"),
+ `VBox (
+ `Label (""),
+ `PushButton (`id (`dumpto_browse),
+ Label::BrowseButton ())
+ )
+ ),
+ "handle" : DumptoHandle,
+ "handle_events" : [ `dumpto_browse ],
+ "help" : zipl_help_messages["dumpto"]:"",
+ ],
+ "dumptofs" : $[
+ "widget" : `custom,
+ "custom_widget" :
+ `HBox (
+ `InputField (`id ("dumptofs"), `opt (`editable, `hstretch),
+ zipl_descriptions["dumptofs"]:"dumptofs"),
+ `VBox (
+ `Label (""),
+ `PushButton (`id (`dumptofs_browse),
+ Label::BrowseButton ())
+ )
+ ),
+ "handle" : DumptoHandle,
+ "handle_events" : [ `dumptofs_browse ],
+ "help" : zipl_help_messages["dumptofs"]:"",
+ ],
"root" : $[
"widget" : `combobox,
// combo box
@@ -525,17 +641,20 @@
"help" : grub_help_messages["append"]:""
],
"xen_append" : $[
- // text entry
"label" : grub_descriptions["xen_append"]:"xen_append",
"widget" : `textentry,
"help" : grub_help_messages["xen_append"]:"",
],
"configfile" : $[
- // text entry
"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"]:"",
+ ],
"chainloader" : $[
"widget" : `custom,
"custom_widget" : `HBox (
@@ -544,9 +663,7 @@
// combo box
grub_descriptions["chainloader"]:"chainloader",
[]),
- Stage::initial ()
- ? `VBox ()
- : `VBox (
+ `VBox (
`Label (""),
`PushButton (`id (`chainloader_browse),
Label::BrowseButton ())
@@ -572,9 +689,21 @@
"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"]:""),
"blockoffset" : SectionIntFieldWidget(
grub_descriptions["blockoffset"]:"blockoffset",
- grub_help_messages["blockoffset"]:"",0,nil)
+ grub_help_messages["blockoffset"]:"",0,nil),
+ "default" : SectionIntFieldWidget(
+ zipl_descriptions["default"]:"default",
+ zipl_help_messages["default"]:"",1,10),
+ "timeout" : SectionIntFieldWidget(
+ zipl_descriptions["timeout"]:"timeout",
+ zipl_help_messages["timeout"]:"",0,60),
];
}
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp?rev=56126&r1=56125&r2=56126&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp Mon Mar 16 09:40:04 2009
@@ -38,7 +38,7 @@
string bl = Bootloader::getLoaderType ();
// check loader-specific sequence
- if (bl != "grub")
+ if (bl != "grub" || bl != "zipl")
{
symbol spec_ret = Bootloader::blMainSequence ();
if (spec_ret == `generic_new)
@@ -54,6 +54,7 @@
"kernel_details" : ``(DetailsDialog ("kernel_section")),
"xen_section" : ``(XenSectionDialog ()),
"menu_section" : ``(MenuSectionDialog ()),
+ "dump_section" : ``(DumpSectionDialog ()),
"chainloader_section" : ``(ChainloaderSectionDialog ()),
"chainloader_details" : ``(DetailsDialog ("chainloader_section")),
"main" : ``(MainDialog ()),
@@ -127,7 +128,8 @@
`kernel : "kernel_section",
`chainloader : "chainloader_section",
`xen : "xen_section",
- `menus : "menu_section"
+ `menus : "menu_section",
+ `dump : "dump_section",
],
];
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org