Author: jreidinger
Date: Tue Feb 24 18:09:43 2009
New Revision: 55737
URL: http://svn.opensuse.org/viewcvs/yast?rev=55737&view=rev
Log:
enable run of new global options
fix various warnings
add gfx menu chooser
Modified:
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs_i386.ycp
branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/grub_options.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=55737&r1=55736&r2=55737&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/common_options.ycp Tue Feb 24 18:09:43 2009
@@ -19,7 +19,7 @@
textdomain "bootloader";
-void InitGlobalBool(string widget, map event){
+void InitGlobalBool(string widget){
boolean value = false;
if (BootCommon::globals[widget]:"false" == "true"){
value = true;
@@ -36,7 +36,7 @@
}
}
-void CommonCheckboxWidget(string label, string help){
+map CommonCheckboxWidget(string label, string help){
return $[
"widget" : `checkbox,
"label" : label,
@@ -50,20 +50,20 @@
integer value = tointeger(BootCommon::globals[widget]:"0");
UI::ChangeWidget (`id (widget), `Value, value);
}
-void StoreGlobalInt(string widget){
+void StoreGlobalInt(string widget, map event){
integer value = (integer)UI::QueryWidget (`id (widget), `Value);
- BootCommon::globals[widget] = sformat ("%1", timeout);
+ BootCommon::globals[widget] = sformat ("%1", value);
}
map TimeoutWidget () {
return $[
"widget" : `intfield,
- "label" : _("Boot Menu"),
+ "label" : _("&Timeout"),
"minimum" : 0,
"maximum" : 300,
"init" : InitGlobalInt,
"store" : StoreGlobalInt,
- //"help" : i386BootMenuHelp (), //TODO
+ "help" : "", //TODO
];
}
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs_i386.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs_i386.ycp?rev=55737&r1=55736&r2=55737&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs_i386.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/dialogs_i386.ycp Tue Feb 24 18:09:43 2009
@@ -28,6 +28,7 @@
include "bootloader/routines/helps_i386.ycp";
include "bootloader/routines/widgets_i386.ycp";
+include "bootloader/routines/grub_options.ycp";
@@ -62,26 +63,34 @@
term contents = `HBox (`HSpacing (2), `VBox (
`VStretch (),
- "boot_menu",
+ "activate",
`VStretch (),
- "password",
+ "debug",
+ `VStretch (),
+ "generic_mbr",
+ `VStretch (),
+ "trusted_grub",
+ `VStretch (),
+ "hiddenmenu",
+ `VStretch (),
+ "gfxmenu",
+ `VStretch (),
+ "timeout",
`VStretch ()
+
), `HSpacing (2));
- list<string> widget_names = ["boot_menu", "password"];
- map > widget_descr = (map >)
- i386Widgets ();
- // dialog caption
+ list<string> widget_names = ["activate","debug","generic_mbr",
+ "trusted_grub","hiddenmenu","gfxmenu","timeout"];
string caption = _("Boot Loader Options");
return CWM::ShowAndRun ($[
- "widget_descr" : widget_descr,
+ "widget_descr" : GrubOptions(),
"widget_names" : widget_names,
"contents" : contents,
"caption" : caption,
"back_button" : Label::BackButton (),
"abort_button" : Label::AbortButton (),
"next_button" : Label::OKButton (),
-// "fallback_functions" : section_handlers,
]);
}
Modified: branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/grub_options.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/grub_options.ycp?rev=55737&r1=55736&r2=55737&view=diff
==============================================================================
--- branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/grub_options.ycp (original)
+++ branches/tmp/juhliarik/bootloader-UIrefactor/src/routines/grub_options.ycp Tue Feb 24 18:09:43 2009
@@ -19,27 +19,69 @@
textdomain "bootloader";
-include "bootloader/routines/common_widget.ycp";
+include "bootloader/routines/common_options.ycp";
+
+void InitGfx(string widget){
+ UI::ChangeWidget(`id(`gfxinput),`Value,BootCommon::globals[widget]:"");
+}
+
+void StoreGfx(string widget, map event){
+ string result = (string)UI::QueryWidget(`id(`gfxinput),`Value);
+ if (result == ""){
+ BootCommon::global_options = remove(BootCommon::global_options, widget);
+ } else {
+ BootCommon::global_options[widget] = result;
+ }
+}
+
+symbol HandleGfx(string widget, map event){
+ string file = UI::AskForExistingFile("/boot", "",
+ _("Choose new graphical menu file"));
+
+ if (file != nil){
+ UI::ChangeWidget(`id(`gfxinput),`Value,file);
+ }
+
+ return nil;
+}
+
+map GfxWidget(){
+ return $[
+ "widget" : `custom,
+ "custom_widget" : `HBox(`Left(`InputField(`id(`gfxinput),_("&Graphical Menu File"))),
+ `VBox(
+ `Left(`Label("")),
+ `Left(`PushButton(`id(`browsegfx),`opt(`notify), _("Brows&e")))
+ )
+ ),
+ "init" : InitGfx,
+ "store" : StoreGfx,
+ "handle" : HandleGfx,
+ "handle_events" : [`browsegfx],
+ "help" : ""
+ ];
+}
//TODO
// check if works translated global variables
// helps for widgets
const string activateLabel =
- _("Set active Flag in Partition Table for Boot Partition");
-const string debugLabel = _("Debugging Flag");
-const string genericLabel = _("Write generic Boot Code to MBR");
-const string trustedLabel = _("Use Trusted Grub");
-const string hiddenLabel = _("Hide Menu on Boot");
+ _("&Set active Flag in Partition Table for Boot Partition");
+const string debugLabel = _("&Debugging Flag");
+const string genericLabel = _("&Write generic Boot Code to MBR");
+const string trustedLabel = _("&Use Trusted Grub");
+const string hiddenLabel = _("&Hide Menu on Boot");
-map