Author: juhliarik
Date: Fri Mar 6 16:27:30 2009
New Revision: 55981
URL: http://svn.opensuse.org/viewcvs/yast?rev=55981&view=rev
Log:
updated bootloader UI for GRUB
Modified:
branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootGRUB.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/global_widgets.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootGRUB.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootGRUB.ycp?rev=55981&r1=55980&r2=55981&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootGRUB.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootGRUB.ycp Fri Mar 6 16:27:30 2009
@@ -804,8 +804,6 @@
*/
global map GetFunctions () {
return $[
- //"export" : Export,
- //"import" : Import,
"read" : Read,
"reset" : Reset,
"propose" : Propose,
@@ -813,6 +811,7 @@
"summary" : Summary,
"update" : Update,
"write" : Write,
+ "widgets" : grubWidgets,
"wizard_sequencer" : WizardSequenzer,
"dialogs" : Dialogs,
"section_types" : grub_section_types,
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=55981&r1=55980&r2=55981&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp Fri Mar 6 16:27:30 2009
@@ -81,14 +81,13 @@
*/
symbol MainDialog () {
y2milestone ("Running Main Dialog");
- string lt = Bootloader::getLoaderType ();
term contents = `VBox (
"tab",
`Right ("adv_button")
);
- //F#300779 - Install diskless client (NFS-root)
- //kokso: additional warning that root partition is nfs type -> bootloader will not be installed
+ // F#300779 - Install diskless client (NFS-root)
+ // kokso: additional warning that root partition is nfs type -> bootloader will not be installed
string device = BootCommon::getBootDisk();
if ((device == "/dev/nfs") && (Mode::installation()))
@@ -97,15 +96,11 @@
y2milestone("dialogs::MainDialog() -> Boot partition is nfs type, bootloader will not be installed.");
return `next;
}
-
- //F#300779: end
+ // F#300779: end
list<string> widget_names = ["tab", "adv_button"];
map > widget_descr = $[];
- if (lt != "grub")
- widget_descr = (map >) union (CommonGlobalWidgets (), Bootloader::blWidgetMaps ());
- else
- widget_descr = CommonGlobalWidgets ();
+ widget_descr = (map >) union (CommonGlobalWidgets (), Bootloader::blWidgetMaps ());
widget_descr["tab"] = CWMTab::CreateWidget($[
"tab_order": ["sections", "installation"],
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/global_widgets.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/global_widgets.ycp?rev=55981&r1=55980&r2=55981&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/global_widgets.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/global_widgets.ycp Fri Mar 6 16:27:30 2009
@@ -505,117 +505,6 @@
}
}
-// loader target widget
-
-/**
- * Get the target widget to be displayed
- * @return term widget to be displayed
- */
-term TargetWidget () {
- string lt = Bootloader::getLoaderType ();
- if (lt == "none" || lt == "default")
- {
- return `Empty ();
- }
- term widget = `Empty ();
- if (lt == "grub")
- {
- term targetlist = `VBox (`HBox(`HSpacing(1),`VBox(
- `Left(`CheckBox( `id("boot_mbr"), _("Boot from &Master Boot Record"))),
- `Left(`CheckBox( `id("boot_root"), _("Boot from &Root Partition"))),
- `Left(`CheckBox( `id("boot_boot"), _("Boo&t from Boot Partition"))),
- `Left(`CheckBox( `id("boot_extended"), _("Boot from &Extended Partition"))),
- `Left(`CheckBox( `id("boot_custom"), `opt(`notify), _("C&ustom Boot Partition"))),
- `Left(`ComboBox( `id("boot_custom_list"), `opt(`hstretch),"", [])),
- `VStretch()
- )));
-
- // frame
- widget = `VBox (
- `Frame (_("Boot Loader Location"), targetlist),
- `VStretch()
- );
- }
- return widget;
-}
-
-/**
- * Init function of a widget
- * @param widget string widget key
- */
-void TargetInit (string widget) {
- string lt = Bootloader::getLoaderType ();
- if (lt == "none" || lt == "default")
- {
- return;
- }
- if (lt == "grub")
- {
- y2error("FIXME: TargetInit() add devices to combobox \"boot_custom_list\"");
- list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
- foreach(string key, list_global_target_keys,
- {
- string value = BootCommon::globals[key]:nil;
- if (value != nil)
- UI::ChangeWidget (`id (key), `Value, (value == "true")? true: false);
- });
-
- if ((!haskey(BootCommon::globals,"boot_custom")) &&
- (BootCommon::globals["boot_custom"]:"" != ""))
- {
- UI::ChangeWidget (`id ("boot_custom_list"),`Enabled, false);
- } else {
- UI::ChangeWidget (`id ("boot_custom_list"),`Enabled, true);
- y2error("FIXME: TargetInit() add init for combobox -> set correct value");
- }
- }
-}
-
-symbol TargetHandle (string widget, map event) {
- y2error("FIXME: TargetHandle() add handling boot custom");
- return nil;
-}
-
-/**
- * Store function of a widget
- * @param widget string widget key
- * @param event map event that caused the operation
- */
-void TargetStore (string widget, map event) {
- string lt = Bootloader::getLoaderType ();
- if (lt == "none" || lt == "default")
- {
- return;
- }
- if (lt == "grub")
- {
- list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
- foreach(string key, list_global_target_keys,
- {
- string value = ((boolean)UI::QueryWidget(`id(key), `Value))?"true":"false";
- BootCommon::globals[key]= value;
- });
-
- }
- y2error("FIXME: TargetStore() add handling boot custom");
-}
-
-/**
- * Validate function of a widget
- * @param widget string widget key
- * @param event map event that caused validation
- * @return boolean true if validation succeeded
- */
-boolean TargetValidate (string widget, map event){
- string lt = Bootloader::getLoaderType ();
- if (lt == "none" || lt == "default")
- {
- return true;
- }
- return true;
-}
-
-
// manual edit button
/**
@@ -887,17 +776,8 @@
"handle" : LoaderOptionsButtonHandle,
"help" : LoaderOptionsHelp (),
],
- "loader_location" : $[
- "widget" : `func,
- "widget_func" : TargetWidget,
- "init" : TargetInit,
- "handle" : TargetHandle,
- "handle_events" : [ `loc ],
- "store" : TargetStore,
- "help" : LocationsHelp (),
- "validate_type" : `function,
- "validate_function" : TargetValidate,
- ],
+ //FIXME: after deleting all using of metadata delete widget from
+ // from CommonGlobalWidgets the button is only for GRUB...
"inst_details" : $[
"widget" : `push_button,
// push button
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp?rev=55981&r1=55980&r2=55981&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/widgets_i386.ycp Fri Mar 6 16:27:30 2009
@@ -20,6 +20,7 @@
textdomain "bootloader";
+include "bootloader/routines/helps.ycp";
include "bootloader/routines/popups.ycp";
/**
@@ -359,6 +360,118 @@
];
}
+
+/**
+ * Init function of a widget
+ * @param widget string widget key
+ */
+void InitBootLoaderLocationWidget(string widget) {
+
+ y2error("FIXME: InitBootLoaderLocationWidget() add devices to combobox \"boot_custom_list\"");
+ list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
+ foreach(string key, list_global_target_keys,
+ {
+ string value = BootCommon::globals[key]:nil;
+ if (value != nil)
+ UI::ChangeWidget (`id (key), `Value, (value == "true")? true: false);
+ });
+
+ if ((!haskey(BootCommon::globals,"boot_custom")) &&
+ (BootCommon::globals["boot_custom"]:"" == ""))
+ {
+ UI::ChangeWidget (`id ("boot_custom_list"),`Enabled, false);
+ } else {
+ UI::ChangeWidget (`id ("boot_custom_list"),`Enabled, true);
+ y2error("FIXME: InitBootLoaderLocationWidget() add init for combobox -> set correct value");
+ }
+}
+/**
+ * handle function of a widget
+ * @param widget string widget key
+ * @param event map event that caused the operation
+ * @return symbol
+ */
+symbol HandleBootLoaderLocationWidget (string widget, map event) {
+ any ret = event["ID"]:nil;
+ if (ret == "boot_custom")
+ {
+ if ((boolean)UI::QueryWidget(`id("boot_custom"), `Value))
+ UI::ChangeWidget (`id ("boot_custom_list"),`Enabled, true);
+ else
+ UI::ChangeWidget (`id ("boot_custom_list"),`Enabled, false);
+ }
+ return nil;
+}
+
+
+/**
+ * Store function of a widget
+ * @param widget string widget key
+ * @param event map event that caused the operation
+ */
+void StoreBootLoaderLocationWidget (string widget, map event) {
+
+ list <string> list_global_target_keys = ["boot_mbr", "boot_boot", "boot_root", "boot_extended"];
+ foreach(string key, list_global_target_keys,
+ {
+ string value = ((boolean)UI::QueryWidget(`id(key), `Value))?"true":"false";
+ BootCommon::globals[key]= value;
+ });
+ y2error("FIXME: StoreBootLoaderLocationWidget() add handling boot custom");
+}
+
+map grubBootLoaderLocationWidget ()
+{
+ term contents = `VBox (
+ `Frame (_("Boot Loader Location"),
+ `VBox (`HBox(`HSpacing(1),`VBox(
+ `Left(`CheckBox( `id("boot_mbr"), _("Boot from &Master Boot Record"))),
+ `Left(`CheckBox( `id("boot_root"), _("Boot from &Root Partition"))),
+ `Left(`CheckBox( `id("boot_boot"), _("Boo&t from Boot Partition"))),
+ `Left(`CheckBox( `id("boot_extended"), _("Boot from &Extended Partition"))),
+ `Left(`CheckBox( `id("boot_custom"), `opt(`notify), _("C&ustom Boot Partition"))),
+ `Left(`ComboBox( `id("boot_custom_list"), `opt(`hstretch),"", [])),
+ `VStretch()
+ )))
+ ),
+ `VStretch()
+ );
+
+ return $[
+ "widget" : `custom,
+ "custom_widget" : contents,
+ "init" : InitBootLoaderLocationWidget,
+ "handle" : HandleBootLoaderLocationWidget,
+ "store" : StoreBootLoaderLocationWidget,
+ "help" : "",
+ ];
+}
+
+/**
+ * Handle function of a widget
+ * @param widget string widget key
+ * @param event map event description of event that occured
+ * @return symbol to return to wizard sequencer, or nil
+ */
+symbol InstDetailsButtonHandle (string widget, map event)
+{
+ return `inst_details;
+}
+
+
+map grubInstalationDetials ()
+{
+ return $[
+ "widget" : `push_button,
+ // push button
+ "label" : _("Boot Loader Installation &Details"),
+ "handle_events" : ["inst_details"],
+ "handle" : InstDetailsButtonHandle,
+ "help" : InstDetailsHelp (),
+ ];
+}
+
+
/**
* Cache for i386Widgets function
*/
@@ -379,4 +492,26 @@
return _i386_widgets;
}
+
+/**
+ * Cache for genericWidgets function
+ */
+map > _grub_widgets = nil;
+
+/**
+ * Get generic widgets
+ * @return a map describing all generic widgets
+ */
+global map > grubWidgets () {
+ if (_grub_widgets == nil)
+ {
+ _grub_widgets = $[
+ "loader_location" : grubBootLoaderLocationWidget (),
+ "inst_details" : grubInstalationDetials (),
+ ];
+ }
+ return _grub_widgets;
+}
+
+
} // include end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org