Hi,

Currently, there is no mechanism to support running command at a
specific event, such as, whenever a menu is selected, this makes it
difficult to implement functions like savedefault or password. I
sugguest the following model.

First, UI components register events, which is a subclass of named list:

struct grub_event
{
  next;
  name;
  event_list;
};

It then fires the event at apropriate time:

grub_err_t grub_dispatch_event (struct grub_event *);

Also add a command "event" to let user assign action to a event,
something like this:

event list [event_name]
event insert event_name command [arguments]
event remove event_name command

With this, safedefault could be implemented as:

event insert menu_select save_env default

-- 
Bean


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to