Author: juhliarik
Date: Mon Mar 30 17:37:25 2009
New Revision: 56471
URL: http://svn.opensuse.org/viewcvs/yast?rev=56471&view=rev
Log:
added updated for PPC bootloader UI
Modified:
branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootPOWERLILO.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_dialogs.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_options.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/section_widgets.ycp
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootPOWERLILO.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootPOWERLILO.ycp?rev=56471&r1=56470&r2=56471&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootPOWERLILO.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/modules/BootPOWERLILO.ycp Mon Mar 30 17:37:25 2009
@@ -43,7 +43,8 @@
* read my dialogs
*/
include "bootloader/routines/popups.ycp"; // define confirmSectionDeletePopup
-include "bootloader/generic/dialogs.ycp";
+//include "bootloader/generic/dialogs.ycp";
+
@@ -62,6 +63,9 @@
// map available of 41 PReP partitions, used on iSeries and CHRP
global list<string> prep_boot_partitions = [];
+// map available HFS partitions, used on PMac
+global list<string> pmac_boot_partitions = [];
+
// PReP boot partitions that were proposed by partitioner to install BL
global list<string> install_prep_boot_partitions = [];
@@ -559,7 +563,7 @@
);
});
y2milestone ("Detected pmac boot partitions: %1", boot_partitions);
-
+ pmac_boot_partitions = boot_partitions;
if (selected_boot_partition == "")
{
selected_boot_partition = boot_partitions[0]:"";
@@ -917,7 +921,7 @@
boolean ret = BootCommon::Read (false, avoid_reading_device_map);
y2milestone (":: Read globals: %1", BootCommon::globals);
- importMetaData();
+ //importMetaData();
return ret;
}
@@ -992,7 +996,7 @@
if (flush)
ret = ret && BootCommon::CommitSettings ();
- importMetaData();
+ //importMetaData();
BootCommon::WriteToSysconf(false);
return ret;
@@ -1302,7 +1306,7 @@
"summary" : Summary,
"update" : Update,
"write" : Write,
- "widgets" : genericWidgets,
+ "widgets" : ppcWidgets,
"wizard_sequencer" : WizardSequenzer,
"dialogs" : Dialogs,
"section_types" : ppc_section_types,
@@ -1337,7 +1341,7 @@
y2debug("Initialized descriptions to %1", BootCommon::descriptions);
BootCommon::InitializeLibrary (false, "ppc");
- importMetaData();
+ //importMetaData();
}
/**
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_dialogs.ycp?rev=56471&r1=56470&r2=56471&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_dialogs.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_dialogs.ycp Mon Mar 30 17:37:25 2009
@@ -27,7 +27,50 @@
include "bootloader/ppc/ppc_options.ycp";
+list<string> arch_widget_names = ["append", "initrd", "root", "timeout", "activate"];
+term arch_term = `Empty();
+
+void PPCArchDep()
+{
+ string board_type = getBoardType ();
+
+ switch(board_type) {
+ case ("prep"):
+ arch_term = `Frame ( _("PReP Specific Settings"),`HBox(`HSpacing(1),`VBox(
+ "bootfolder"
+ )));
+ arch_widget_names = ["append", "initrd", "root", "timeout", "activate",
+ "bootfolder"];
+ break;
+
+ case ("pmac"):
+ arch_term = `Frame ( _("Mac Specific Settings"),`HBox(`HSpacing(1),`VBox(
+ `Left("no_os_chooser"),
+ `Left("macos_timeout"),
+ "bootfolder"
+
+ )));
+ arch_widget_names = ["append", "initrd", "root", "timeout", "activate",
+ "no_os_chooser", "bootfolder", "macos_timeout"];
+ break;
+
+ case ("iseries"):
+
+ break;
+ default:
+ arch_term = `Frame ( _("CHRP Specific Settings"),`HBox(`HSpacing(1),`VBox(
+ `Left("force_fat"),
+ `Left("force"),
+ `Left("clone")
+ )));
+ arch_widget_names = ["append", "initrd", "root", "timeout", "activate",
+ "force", "force_fat", "clone"];
+
+ break;
+
+ }
+}
/**
* Run dialog to adjust installation on i386 and AMD64
@@ -35,20 +78,22 @@
*/
symbol PPCDetailsDialog () {
y2milestone ("Running ppc loader details dialog");
+ PPCArchDep();
- term contents = `VBox (
+ term contents = `HBox(`HSpacing(1), `VBox (
`Frame ( _("Global Section Options"),`HBox(`HSpacing(1),`VBox(
`Left("append"),
"initrd",
- `Left("root")
+ `Left("root"),
+ "timeout",
+ `Left("activate")
))),
- "timeout",
- "default",
- "activate",
- `VStretch ()
- );
+ `VSpacing(1),
+ // add board specific settings
+ arch_term
+ ));
- list<string> widget_names = ["append", "initrd", "root", "timeout", "default", "activate",];
+ list<string> widget_names = arch_widget_names;
return CWM::ShowAndRun ($[
"widget_descr": PPCOptions(),
@@ -61,6 +106,51 @@
]);
}
+map ppcBootLoaderLocationWidget ()
+{
+
+ string board_type = getBoardType ();
+
+ switch(board_type) {
+ case ("prep"):
+ return BootPReP();
+ break;
+
+ case ("pmac"):
+ return BootPMAC();
+ break;
+
+ case ("iseries"):
+ return $[];
+ break;
+ default:
+
+ return BootCHRP();
+ break;
+
+ }
+
+}
+
+
+/**
+ * Cache for genericWidgets function
+ */
+map > _ppc_widgets = nil;
+
+/**
+ * Get generic widgets
+ * @return a map describing all generic widgets
+ */
+global map > ppcWidgets () {
+ if (_ppc_widgets == nil)
+ {
+ _ppc_widgets = $[
+ "loader_location" : ppcBootLoaderLocationWidget (),
+ ];
+ }
+ return _ppc_widgets;
+}
}
\ No newline at end of file
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_options.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_options.ycp?rev=56471&r1=56470&r2=56471&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_options.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/ppc/ppc_options.ycp Mon Mar 30 17:37:25 2009
@@ -23,7 +23,6 @@
include "bootloader/ppc/helps.ycp";
-
// FIXME:
// add widget "boot"
/*
@@ -32,12 +31,6 @@
: "select:PPC Boot loader location:",
*/
-// FIXME:
-// add widget "clone" CHRP
-/*
- $go->{clone} = "selectdevice:Partition for boot loader duplication::" . ":" . $boot_partitions;
-
-*/
// add widget "boot_chrp_custom" CHRP
/*
@@ -45,39 +38,232 @@
*/
-// FIXME:
-// add widget "boot_prep_custom" PREP
-/*
-$go->{boot_prep_custom}
- = "selectdevice:PReP partition::" .
-$boot_partitions;
-*/
+void InitDuplicatePartition(string widget) {
+ list <string> devices = prep_boot_partitions;
+ if (size(devices) != 0)
+ {
+ UI::ChangeWidget (`id ("clone"), `Items, devices);
+ }
+ UI::ChangeWidget (`id ("clone"), `Value, BootCommon::globals["clone"]:"");
+}
+void StoreDuplicatePartition (string widget, map event) {
-// FIXME:
-// add widget "boot_slot" iSERIES
+ BootCommon::globals["clone"]
+ = (splitstring( (string)UI::QueryWidget (`id ("clone"), `Value), " "))[0]:"";
+
+}
-/*
- $go->{boot_slot} = "select:Write to boot slot:B:" . "A:B:C:D";
-*/
-// add widget "boot_iseries_custom" iSERIES
+map DuplicatePartition(){
+ return $[
+ "widget" : `combobox,
+ "label" : _("Partition for Boot Loader &Duplication"),
+ "items" : [""],
+ "opt" : [`editable, `hstretch],
+ "help" : ppc_help_messages["clone"]:"",
+ "init" : InitDuplicatePartition,
+ "store" : StoreDuplicatePartition,
+ ];
+}
-/*
-$go->{boot_iseries_custom}
-*/
+void InitBootPMAC(string widget) {
+ list <string> devices = pmac_boot_partitions;
+ if (size(devices) != 0)
+ {
+ UI::ChangeWidget (`id ("boot_pmac_custom"), `Items, devices);
+ }
+
+ if (BootCommon::globals["boot_pmac_custom"]:"" == "")
+ {
+ UI::ChangeWidget (`id ("enable_pmac"), `Value, false);
+ UI::ChangeWidget (`id ("boot_pmac_custom"), `Enabled, false);
+ } else {
+ UI::ChangeWidget (`id ("enable_pmac"), `Value, true);
+ UI::ChangeWidget (`id ("boot_pmac_custom"), `Enabled, true);
+ UI::ChangeWidget (`id ("boot_pmac_custom"), `Value, BootCommon::globals["boot_pmac_custom"]:"");
+ }
+}
+
+void StoreBootPMAC (string widget, map event) {
+ if ((boolean) UI::QueryWidget(`id("enable_pmac"), `Value))
+ {
+ BootCommon::globals["boot_pmac_custom"]
+ = (splitstring( (string)UI::QueryWidget (`id ("boot_pmac_custom"), `Value), " "))[0]:"";
+ } else {
+ BootCommon::globals["boot_pmac_custom"] = "";
+ }
+}
+
+
+symbol HandleBootPMAC (string key, map event) {
+ any ret = event["ID"]:nil;
+ if (ret == "enable_pmac") {
+ UI::ChangeWidget (`id ("boot_pmac_custom"), `Enabled,
+ (boolean) UI::QueryWidget(`id("enable_pmac"), `Value));
+ }
+}
+
+map BootPMAC(){
+ return $[
+ "widget" : `custom,
+ "custom_widget" : `VBox(
+ `Frame ( _("Boot Loader Location"), `VBox(
+ `Left(`HBox(`HSpacing(1),`VBox(
+ `Left(`CheckBox(`id("enable_pmac"), `opt(`notify), _("HFS Boot &Partition"))),
+ `Left(`ComboBox(`id("boot_pmac_custom"), `opt(`editable, `hstretch), "", [""]))
+ )))
+ ))),
+ "help" : ppc_help_messages["boot_pmac_custom"]:"",
+ "init" : InitBootPMAC,
+ "handle" : HandleBootPMAC,
+ "store" : StoreBootPMAC,
+ ];
+}
+
+
+void InitBootCHRP(string widget) {
+ list <string> devices = prep_boot_partitions;
+ if (size(devices) != 0)
+ {
+ UI::ChangeWidget (`id ("boot_chrp_custom"), `Items, devices);
+ }
+
+ if (BootCommon::globals["boot_chrp_custom"]:"" == "")
+ {
+ UI::ChangeWidget (`id ("enable_chrp"), `Value, false);
+ UI::ChangeWidget (`id ("boot_chrp_custom"), `Enabled, false);
+ } else {
+ UI::ChangeWidget (`id ("enable_chrp"), `Value, true);
+ UI::ChangeWidget (`id ("boot_chrp_custom"), `Enabled, true);
+ UI::ChangeWidget (`id ("boot_chrp_custom"), `Value, BootCommon::globals["boot_chrp_custom"]:"");
+ }
+}
+
+void StoreBootCHRP (string widget, map event) {
+ if ((boolean) UI::QueryWidget(`id("enable_chrp"), `Value))
+ {
+ BootCommon::globals["boot_chrp_custom"]
+ = (splitstring( (string)UI::QueryWidget (`id ("boot_chrp_custom"), `Value), " "))[0]:"";
+ } else {
+ BootCommon::globals["boot_chrp_custom"] = "";
+ }
+}
+
+
+symbol HandleBootCHRP (string key, map event) {
+ any ret = event["ID"]:nil;
+ if (ret == "enable_chrp") {
+ UI::ChangeWidget (`id ("boot_chrp_custom"), `Enabled,
+ (boolean) UI::QueryWidget(`id("enable_chrp"), `Value));
+ }
+}
+
+map BootCHRP(){
+ return $[
+ "widget" : `custom,
+ "custom_widget" : `VBox(
+ `Frame ( _("Boot Loader Location"), `VBox(
+ `Left(`HBox(`HSpacing(1),`VBox(
+ `Left(`CheckBox(`id("enable_chrp"), `opt(`notify), _("&PReP or FAT Partition"))),
+ `Left(`ComboBox(`id("boot_chrp_custom"), `opt(`editable, `hstretch), "", [""]))
+ )))
+ ))),
+ "help" : ppc_help_messages["boot_chrp_custom"]:"",
+ "init" : InitBootCHRP,
+ "handle" : HandleBootCHRP,
+ "store" : StoreBootCHRP,
+ ];
+}
+
+
+void InitBootPReP(string widget) {
+ list <string> devices = prep_boot_partitions;
+ if (size(devices) != 0)
+ {
+ UI::ChangeWidget (`id ("boot_prep_custom"), `Items, devices);
+ }
+
+ if (BootCommon::globals["boot_prep_custom"]:"" == "")
+ {
+ UI::ChangeWidget (`id ("enable_prep"), `Value, false);
+ UI::ChangeWidget (`id ("boot_prep_custom"), `Enabled, false);
+ } else {
+ UI::ChangeWidget (`id ("enable_prep"), `Value, true);
+ UI::ChangeWidget (`id ("boot_prep_custom"), `Enabled, true);
+ UI::ChangeWidget (`id ("boot_prep_custom"), `Value, BootCommon::globals["boot_prep_custom"]:"");
+ }
+}
+
+void StoreBootPReP (string widget, map event) {
+ if ((boolean) UI::QueryWidget(`id("enable_prep"), `Value))
+ {
+ BootCommon::globals["boot_prep_custom"]
+ = (splitstring( (string)UI::QueryWidget (`id ("boot_prep_custom"), `Value), " "))[0]:"";
+ } else {
+ BootCommon::globals["boot_prep_custom"] = "";
+ }
+}
+
+
+symbol HandleBootPReP (string key, map event) {
+ any ret = event["ID"]:nil;
+ if (ret == "enable_prep") {
+ UI::ChangeWidget (`id ("boot_prep_custom"), `Enabled,
+ (boolean) UI::QueryWidget(`id("enable_prep"), `Value));
+ }
+}
+
+map BootPReP(){
+ return $[
+ "widget" : `custom,
+ "custom_widget" : `VBox(
+ `Frame ( _("Boot Loader Location"), `VBox(
+ `Left(`HBox(`HSpacing(1),`VBox(
+ `Left(`CheckBox(`id("enable_prep"), `opt(`notify), _("&PReP partitions"))),
+ `Left(`ComboBox(`id("boot_prep_custom"), `opt(`editable, `hstretch), "", [""]))
+ )))
+ ))),
+ "help" : ppc_help_messages["boot_prep_custom"]:"",
+ "init" : InitBootPReP,
+ "handle" : HandleBootPReP,
+ "store" : StoreBootPReP,
+ ];
+}
-// FIXME:
-// add widget "boot_pmac_custom" PMAC
/*
- $go->{boot_pmac_custom}
- = "select:HFS boot partition::" .
-$boot_partitions;
+void InitBootPMac(string widget) {
+ list <string> devices = pmac_boot_partitions;
+ if (device != "")
+ {
+ UI::ChangeWidget (`id (widget), `Items, [device]);
+ }
+ UI::ChangeWidget (`id (widget), `Value,
+ ([device]([BootCommon::globals[widget]:""]))[0]:"");
+}
+
+void StoreBootPMac (string widget, map event) {
+BootCommon::globals[widget]
+ = (splitstring( (string)UI::QueryWidget (`id (widget), `Value), " "))[0]:"";
+}
+
+map BootPMac(){
+ return $[
+ "widget" : `combobox,
+ "label" : _("HF&S boot partition"),
+ "items" : [],
+ "opt" : [`editable],
+ "help" : ppc_help_messages["boot_pmac_custom"]:"",
+ "init" : InitBootPMac,
+ "store" : StoreBootPMac,
+ ];
+}
*/
+
void BootInit(string widget){
UI::ChangeWidget(`id(widget+"_enabled"),`Value, haskey(BootCommon::globals,widget));
UI::ChangeWidget(`id(widget), `Enabled, haskey(BootCommon::globals,widget));
@@ -121,7 +307,7 @@
* @return a map the description of the tabs
*/
map PPCBootWidget(){
- string from;
+ string from = "";
if (Arch::board_chrp())
from = "boot_chrp_custom";
else if (Arch::board_iseries())
@@ -144,17 +330,17 @@
map > ppc_specific = $[
"append" : CommonInputFieldWidget(_("Global Append &String of Options to Kernel Command Line"),
ppc_help_messages["append"]:""),
- "default" : CommonInputFieldWidget(_("&Default Boot Section"),
- ppc_help_messages["default"]:""),
"initrd" : CommonInputFieldBrowseWidget(_("Nam&e of Default Initrd File"),
ppc_help_messages["initrd"]:"", "initrd"),
"root" : CommonInputFieldWidget(_("Set Default &Root Filesystem"),
ppc_help_messages["root"]:""),
- "activate": CommonCheckboxWidget(_("Change Boot Device in &NV-RAM"), elilo_help_messages["activate"]:""),
+ "activate": CommonCheckboxWidget(_("Change Boot Device in &NV-RAM"), ppc_help_messages["activate"]:""),
// CHRP
- "force_fat": CommonCheckboxWidget(_("&Always Boot from FAT Partition"), elilo_help_messages["force_fat"]:""),
+ "force_fat": CommonCheckboxWidget(_("&Always Boot from FAT Partition"), ppc_help_messages["force_fat"]:""),
+
+ "force" : CommonCheckboxWidget(_("&Install Boot Loader Even on Errors"), ppc_help_messages["force"]:""),
- "force" : CommonCheckboxWidget(_("&Install Boot Loader Even on Errors"), elilo_help_messages["force"]:""),
+ "clone" : DuplicatePartition(),
// end CHRP
// PREP also for PMAC
@@ -163,12 +349,10 @@
// end PREP
- // iSERIES
-
- // end iSERIES
-
// PMAC
- "no_os_chooser" : CommonCheckboxWidget(_("Do not use OS-chooser") elilo_help_messages["no_os_chooser"]:""),
+ "no_os_chooser" : CommonCheckboxWidget(_("Do not use OS-chooser"), ppc_help_messages["no_os_chooser"]:""),
+ "macos_timeout" : CommonIntFieldWidget (_("Timeout in Seconds for MacOS/Linux"),
+ ppc_help_messages["macos_timeout"]:"",0,60),
// end PMAC
];
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=56471&r1=56470&r2=56471&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 30 17:37:25 2009
@@ -53,6 +53,8 @@
}
}
}
+
+ return true;
}
boolean validate_initrd(string widget, map event){
@@ -65,6 +67,7 @@
}
}
}
+ return true;
}
map validation_map = $[
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org