Author: juhliarik
Date: Thu Mar 5 18:15:39 2009
New Revision: 55949
URL: http://svn.opensuse.org/viewcvs/yast?rev=55949&view=rev
Log:
updated UI for GRUB
Removed:
branches/tmp/juhliarik/bootloader-UIrefactor/src/generic/device_map_edit_widget.ycp
Modified:
branches/tmp/juhliarik/bootloader-UIrefactor/src/generic/Makefile.am
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/wizards.ycp
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/generic/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/generic/Makefile.am?rev=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/generic/Makefile.am (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/generic/Makefile.am Thu Mar 5 18:15:39 2009
@@ -14,8 +14,7 @@
section_widgets.ycp \
sections_widget.ycp \
widget_funcs.ycp \
- wizards.ycp \
- device_map_edit_widget.ycp
+ wizards.ycp
EXTRA_DIST = \
$(ynclude_DATA)
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=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootGRUB.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootGRUB.ycp Thu Mar 5 18:15:39 2009
@@ -520,7 +520,7 @@
BootCommon::ProposeDeviceMap ();
}
- importMetaData();
+ //importMetaData();
return ret;
}
@@ -645,7 +645,7 @@
// now really save the settings
boolean ret = BootCommon::Save (clean, init, flush);
- importMetaData();
+ //importMetaData();
return ret;
}
@@ -858,7 +858,7 @@
y2debug("Initialized help_messages to %1", BootCommon::help_messages);
BootCommon::InitializeLibrary (false, "grub");
- importMetaData();
+ //importMetaData();
}
/**
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=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs.ycp Thu Mar 5 18:15:39 2009
@@ -101,8 +101,10 @@
//F#300779: end
list<string> widget_names = ["tab", "adv_button"];
- map > widget_descr = (map >)
- union (CommonGlobalWidgets (), Bootloader::blWidgetMaps ());
+ //map > widget_descr = (map >)
+ // union (CommonGlobalWidgets (), Bootloader::blWidgetMaps ());
+
+ map > widget_descr = CommonGlobalWidgets ();
widget_descr["tab"] = CWMTab::CreateWidget($[
"tab_order": ["sections", "installation"],
"tabs": TabsDescr (),
@@ -310,8 +312,10 @@
list<string> widget_names = ["name", "chainloader", "makeactive",
"noverifyroot", "remap", "blockoffset"];
- map > widget_descr = (map >)
- union (CommonSectionWidgets (), Bootloader::blWidgetMaps ());
+ //map > widget_descr = (map >)
+ // union (CommonSectionWidgets (), Bootloader::blWidgetMaps ());
+
+ map > widget_descr = CommonSectionWidgets ();
// dialog caption
string caption = _("Boot Loader Settings: Section Management");
return CWM::ShowAndRun ($[
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=55949&r1=55948&r2=55949&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/global_widgets.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/global_widgets.ycp Thu Mar 5 18:15:39 2009
@@ -110,18 +110,23 @@
list sec = maplist (map s, sects, {
string image = s["image"]:"";
string root = (BootCommon::getHintedPartitionList ([s["root"]:""]))[0]:"";
-
+
+ string type = _("Other");
+ if (s["type"]:"" == "image")
+ type = _("Image");
+ if (s["type"]:"" == "xen")
+ type = _("Xen");
+ if (s["type"]:"" == "floppy")
+ type = _("Floppy");
+ if (s["type"]:"" == "menu")
+ type = _("Menu");
return `item (`id (s["name"]:""),
// FIXME: do not match against key "name" (can be changed by user when editing section)
tolower (BootCommon::globals["default"]:"")
== tolower (s["name"]:"")
? UI::Glyph (`CheckMark) : "",
s["name"]:"",
- (image == nil || image == "")
- // table header
- ? _("Other")
- // table header
- : _("Image"),
+ type,
(image != "" && image != nil)
? sformat ("%1 (%2%3)",
image,
@@ -512,102 +517,26 @@
{
return `Empty ();
}
- list<string> boot_devices = BootCommon::getPartitionList(`boot);
- boolean allow_boot = contains (boot_devices,
- BootCommon::BootPartitionDevice);
- boolean allow_root = contains (boot_devices,
- BootCommon::RootPartitionDevice);
- boolean all_mbr = size (BootCommon::Md2Partitions (
- BootCommon::BootPartitionDevice)) > 1;
-
- term targetlist = `VBox (
- `VSpacing (0.4),
- `Left (`RadioButton (`id ("mbr"), `opt (`notify),
- BootCommon::mbrDisk == ""
- // radio button
- ? _("&Master Boot Record")
- // radiobutton, %1 is device (eg. /dev/hda)
- : sformat(_("&Master Boot Record of %1"),
- BootCommon::mbrDisk),
- (BootCommon::selected_location == "mbr")
- ))
- );
-
- if (all_mbr && Bootloader::getLoaderType () == "grub")
+ term widget = `Empty ();
+ if (lt == "grub")
{
- list<string> mbrs = maplist (string d, integer id,
- BootCommon::Md2Partitions (BootCommon::BootPartitionDevice),
- {
- map p_dev = Storage::GetDiskPartition (d);
- return p_dev["disk"]:"";
- });
- mbrs = toset (mbrs);
- targetlist = add (targetlist, `VSpacing (0.4));
- targetlist = add (targetlist, `Left (
- `RadioButton (`id ("mbr_md"), `opt (`notify),
- // radiobutton, %1 is a list of devices (eg. /dev/hda1)
- sformat(_("MB&Rs of Disks %1"),
- mergestring (mbrs, ", ")),
- (BootCommon::selected_location == "mbr_md")
- )));
- }
- if (allow_boot)
- {
- targetlist = add (targetlist, `VSpacing (0.4));
- targetlist = add (targetlist, `Left (
- `RadioButton (`id ("boot"), `opt (`notify),
- // radiobutton, %1 is device (eg. /dev/hda1)
- sformat(_("Boot &Sector of Boot Partition %1"),
- BootCommon::BootPartitionDevice),
- (BootCommon::selected_location == "boot")
- )));
- };
- if (allow_root
- && BootCommon::BootPartitionDevice != BootCommon::RootPartitionDevice)
- {
- targetlist = add (targetlist, `VSpacing (0.4));
- targetlist = add (targetlist, `Left (
- `RadioButton (`id ("root"), `opt (`notify),
- // radiobutton, %1 is device (eg. /dev/hda1)
- sformat(_("Boot Sector of Roo&t Partition %1"),
- BootCommon::RootPartitionDevice),
- (BootCommon::selected_location == "root")
- )));
- };
-
- if (StorageDevices::FloppyPresent())
- {
- targetlist = add (targetlist, `VSpacing (1));
- targetlist = add (targetlist, `Left (`RadioButton (`id ("floppy"),
- `opt (`notify),
- // radiobutton, %1 is device name, typically /dev/fd0
- sformat (_("&Floppy Disk %1"), StorageDevices::FloppyDevice()),
- (BootCommon::selected_location == "floppy")
- )));
- }
-
- targetlist = add (targetlist, `HBox (
- `VBox (`Label (""), `RadioButton (`id ("custom"), `opt (`notify),
- // radiobutton
- _("Ot&her"),
- (BootCommon::selected_location == "custom"))),
- `HSpacing (2),
- `VBox (
- `ComboBox (`id (`loc), `opt (`editable, `hstretch, `notify, `notify, `immediate), "",
- boot_devices),
- `HSpacing (15)
- ),
- `HStretch ()
- ));
-
- targetlist = add (targetlist, `VSpacing (0.4));
-
- // frame
- term widget = `Frame (_("Boot Loader Location"),
- `RadioButtonGroup (`id (`location),
- targetlist
- )
- );
+ 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"), _("Boot from &Boot Partition"))),
+ `Left(`CheckBox( `id("boot_extended"), _("Boot from &Extended Partition"))),
+ `Left(`CheckBox( `id("boot_custom"), `opt(`notify), _("Custom Boot &Partition"))),
+ `Left(`ComboBox( `id("boot_custom_list"), `opt(`hstretch),"", [])),
+ `VStretch()
+ )));
+
+
+ // frame
+ widget = `VBox (
+ `Frame (_("Boot Loader Location"), targetlist),
+ `VStretch()
+ );
+ }
return widget;
}
@@ -621,22 +550,29 @@
{
return;
}
- if (BootCommon::BootPartitionDevice == BootCommon::RootPartitionDevice
- && BootCommon::selected_location == "root")
+ if (lt == "grub")
{
- BootCommon::selected_location = "boot";
+ 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"))
+ {
+ 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");
+ }
}
- if (BootCommon::loader_device != "mbr_md")
- UI::ChangeWidget (`id (`loc), `Value, BootCommon::loader_device == "mbr_md"
- ? BootCommon::getPartitionList(`boot)[0]:""
- : BootCommon::loader_device);
- UI::ChangeWidget (`id (`location), `CurrentButton,
- BootCommon::selected_location);
- UI::SetFocus (`id (`loc));
}
symbol TargetHandle (string widget, map event) {
- UI::ChangeWidget (`id (`location), `CurrentButton, "custom");
+ y2error("FIXME: TargetHandle() add handling boot custom");
return nil;
}
@@ -651,12 +587,17 @@
{
return;
}
- BootCommon::selected_location = (string)
- UI::QueryWidget (`id (`location), `CurrentButton);
- BootCommon::loader_device = (string)UI::QueryWidget (`id (`loc), `Value);
- BootCommon::loader_device = BootCommon::GetBootloaderDevice ();
- BootCommon::location_changed = true;
- BootCommon::changed = true;
+ 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");
}
/**
@@ -671,53 +612,6 @@
{
return true;
}
- string rb = (string)UI::QueryWidget (`id (`location), `CurrentButton);
- if (rb == nil)
- {
- setLocationErrorPopup ();
- UI::SetFocus (`id (`location));
- return false;
- }
- if (rb == "custom" && UI::QueryWidget (`id (`loc), `Value) == "")
- {
- setLocationErrorPopup ();
- UI::SetFocus (`id (`loc));
- return false;
- }
- if (rb == "custom")
- {
- boolean ok = true;
- string ld = (string)UI::QueryWidget (`id (`loc), `Value);
- map tm = Storage::GetTargetMap ();
- foreach (string disk_dev, map disk, tm, {
- list