Author: jreidinger
Date: Tue Mar 3 14:54:38 2009
New Revision: 55888
URL: http://svn.opensuse.org/viewcvs/yast?rev=55888&view=rev
Log:
implement chainloader section
Modified:
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp?rev=55888&r1=55887&r2=55888&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp Tue Mar 3 14:54:38 2009
@@ -52,7 +52,7 @@
}
void StoreGlobalInt(string widget, map event){
integer value = (integer)UI::QueryWidget (`id (widget), `Value);
- BootCommon::globals[widget] = sformat ("%1", value);
+ BootCommon::globals[widget] = tostring(value);
}
map TimeoutWidget () {
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=55888&r1=55887&r2=55888&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp Tue Mar 3 14:54:38 2009
@@ -222,12 +222,17 @@
"chainloader",
`HSpacing (4)
),
+ `Left("makeactive"),
+ `Left("noverifyroot"),
+ `Left("remap"),
+ `Left("blockoffset"),
`VSpacing (2)
), `HSpacing (2)))),
`VStretch ()
), `HSpacing (4));
- list<string> widget_names = ["name", "chainloader"];
+ list<string> widget_names = ["name", "chainloader", "makeactive",
+ "noverifyroot", "remap", "blockoffset"];
map > widget_descr = (map >)
union (CommonSectionWidgets (), Bootloader::blWidgetMaps ());
// dialog caption
@@ -238,7 +243,7 @@
"contents" : contents,
"caption" : caption,
"back_button" : Label::BackButton (),
- "abort_button" : (!Mode::installation()) ? Label::AbortButton () : Label::CancelButton (),
+ "abort_button" : Label::CancelButton (),
"next_button" : Label::OKButton (),
"fallback_functions" : section_handlers,
]);
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=55888&r1=55887&r2=55888&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp Tue Mar 3 14:54:38 2009
@@ -33,6 +33,11 @@
include "bootloader/routines/helps.ycp";
+const string activeLabel = _("Activate this Partition when selected for Boot");
+const string offsetLabel = _("Block Offset for Chainloading");
+const string remapLabel = _("Map Section to the First Disk in Device Map");
+const string noverifyLabel = _("Do not verify Filesystem before Booting");
+
/**
* Init function for widget value
* @param widget any id of the widget
@@ -61,6 +66,53 @@
];
+void InitSectionBool(string widget){
+ boolean value = BootCommon::current_section[widget]:"false" == "true";
+ UI::ChangeWidget (`id (widget), `Value, value);
+}
+
+void StoreSectionBool(string widget, map event){
+ boolean value = (boolean)UI::QueryWidget (`id (widget), `Value);
+ BootCommon::current_section[widget] = value ? "true" : "false";
+}
+
+map SectionCheckBoxWidget( string label, string help){
+ return $[
+ "label" : label,
+ "widget" : `checkbox,
+ "help" : help,
+ "init" : InitSectionBool,
+ "store" : StoreSectionBool
+ ];
+}
+
+void InitSectionInt(string widget){
+ integer value = tointeger(BootCommon::current_section[widget]:"0");
+ UI::ChangeWidget (`id (widget), `Value, value);
+}
+
+void StoreSectionInt(string widget, map event){
+ integer value = (integer)UI::QueryWidget (`id (widget), `Value);
+ BootCommon::current_section[widget] = tostring(value);
+}
+
+map SectionIntFieldWidget( string label, string help,
+ integer min, integer max){
+ map ret = $[
+ "label" : label,
+ "widget" : `intfield,
+ "help" : help,
+ "init" : InitSectionInt,
+ "store" : StoreSectionInt
+ ];
+ if ( min != nil )
+ ret["minimum"] = min;
+ if ( max != nil )
+ ret["maximum"] = max;
+
+ return ret;
+
+}
/**
* Validate function of the name widget
* @param widget any widget key
@@ -447,7 +499,10 @@
"handle" : SectionTypeHandle,
"help" : SectionTypeHelp (),
],
-
+ "makeactive" : SectionCheckBoxWidget(activeLabel,""),
+ "noverifyroot" : SectionCheckBoxWidget(noverifyLabel,""),
+ "remap" : SectionCheckBoxWidget(remapLabel,""),
+ "blockoffset" : SectionIntFieldWidget(offsetLabel,"",0,nil)
];
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org