Author: jreidinger Date: Tue Mar 3 17:05:44 2009 New Revision: 55901 URL: http://svn.opensuse.org/viewcvs/yast?rev=55901&view=rev Log: xen implemented 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-UIref... ============================================================================== --- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp (original) +++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp Tue Mar 3 17:05:44 2009 @@ -198,6 +198,52 @@ ]); } +symbol XenSectionDialog () { + y2milestone ("Running kernel section dialog"); + + term contents = `HBox (`HSpacing (2), `VBox ( + `VStretch (), + // heading + `Left (`Heading (_("Xen Section"))), + `VSpacing (1), + "name", + `VStretch (), + // frame + `Frame (_("Section Settings"), `HBox (`HSpacing (2), `VBox ( + `VSpacing (1), + "xen", + "image", + "initrd", + `HBox ( + `HWeight (1, "root"), + `HWeight (1, "vgamode") + ), + "append", + "xen_append", + `VSpacing (1) + ), `HSpacing (2))), + `VStretch () + ), `HSpacing (2)); + + list<string> widget_names = ["name", "image", "initrd", "root", "vgamode", "append" + ,"xen_append","xen"]; + //map<string,map<string,any> > widget_descr = (map<string,map<string,any> >) + // union (CommonSectionWidgets (), Bootloader::blWidgetMaps ()); + + map<string,map<string,any> > widget_descr =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, + ]); +} /** * Run dialog for kernel section editation * @return symbol for wizard sequencer @@ -287,7 +333,8 @@ string type = BootCommon::current_section["type"]:""; if (type == "chainloader" || type == "other") return `chainloader; - + if (type == "xen") + return `xen; else return `kernel; } Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIref... ============================================================================== --- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp (original) +++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp Tue Mar 3 17:05:44 2009 @@ -208,6 +208,31 @@ return nil; } +/** + * Init function of widget + * @param widget any id of the widget + */ +void XenInit (string widget) { + string xen = BootCommon::current_section["xen"]:""; + list<string> available = [xen]; + UI::ChangeWidget (`id (widget), `Items, available); + SectionOptionInit (widget); +} + +/** + * 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 XenHandle (string widget, map event) { + string current = (string)UI::QueryWidget (`id (widget), `Value); + // file open popup caption + current = UI::AskForExistingFile (current, "*", _("Xen hypervisor")); + if (current != nil) + UI::ChangeWidget (`id (widget), `Value, current); + return nil; +} /** * Init function of the root device widget @@ -450,6 +475,28 @@ "handle_events" : [ `initrd_browse ], "help" : InitrdHelp (), ], + "xen" : $[ + "widget" : `custom, + "custom_widget" : Stage::initial () + ? `InputField (`id ("xen"), `opt (`hstretch), + _("Hypervisor")// text entry + ) + : `HBox ( + `ComboBox (`id ("xen"), `opt (`editable, `hstretch), + // combo box + _("Hypervisor"), + []), + `VBox ( + `Label (""), + `PushButton (`id (`xen_browse), + Label::BrowseButton ()) + ) + ), + "init" : XenInit, + "handle" : XenHandle, + "handle_events" : [ `xen_browse ], + "help" : "", + ], "root" : $[ "widget" : `combobox, // combo box Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIref... ============================================================================== --- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp (original) +++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/wizards.ycp Tue Mar 3 17:05:44 2009 @@ -50,6 +50,7 @@ "edit_section_switch" : [``(EditSectionSwitch ()), true], "kernel_section" : ``(KernelSectionDialog ()), "kernel_details" : ``(DetailsDialog ("kernel_section")), + "xen_section" : ``(XenSectionDialog ()), "chainloader_section" : ``(ChainloaderSectionDialog ()), "chainloader_details" : ``(DetailsDialog ("chainloader_section")), "main" : ``(MainDialog ()), @@ -96,6 +97,10 @@ `next : "kernel_section", `abort : `abort, ], + "xen_section" : $[ + `next : "store_section", + `abort : `abort, + ], "chainloader_section" : $[ `next : "store_section", `abort : `abort, @@ -114,6 +119,7 @@ "edit_section_switch" : $[ `kernel : "kernel_section", `chainloader : "chainloader_section", + `xen : "xen_section" ], ]; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org