Re: Idea: use menu hook to implement the savedefault command

2008-08-13 Thread Robert Millan
On Wed, Aug 13, 2008 at 02:11:54PM +0200, Javier Martín wrote: > El mié, 13-08-2008 a las 13:48 +0200, Robert Millan escribió: > > On Wed, Aug 13, 2008 at 01:36:44PM +0200, Javier Martín wrote: > > > It might be unnecessarily complex, yes. What about a C#-delegate-like > > > approach? e.g.: > > >

Re: Idea: use menu hook to implement the savedefault command

2008-08-13 Thread Javier Martín
El mié, 13-08-2008 a las 13:48 +0200, Robert Millan escribió: > On Wed, Aug 13, 2008 at 01:36:44PM +0200, Javier Martín wrote: > > It might be unnecessarily complex, yes. What about a C#-delegate-like > > approach? e.g.: > > > > function myhook() { > > save_env > > } > > While in the process of

Re: Idea: use menu hook to implement the savedefault command

2008-08-13 Thread Robert Millan
On Wed, Aug 13, 2008 at 01:36:44PM +0200, Javier Martín wrote: > It might be unnecessarily complex, yes. What about a C#-delegate-like > approach? e.g.: > > function myhook() { > save_env > } While in the process of designing interfaces, finding inspiration in patent encumbered technologies is

Re: Idea: use menu hook to implement the savedefault command

2008-08-13 Thread Javier Martín
El mié, 13-08-2008 a las 12:31 +0200, Marco Gerards escribió: > Bean <[EMAIL PROTECTED]> writes: > > > Hi, > > > > Now it's possible to implement savedefault with load_env and save_env, > > but the problem is we need to add it to every menuitem, it's tedious > > process, and new item don't get it

Re: Idea: use menu hook to implement the savedefault command

2008-08-13 Thread Marco Gerards
Bean <[EMAIL PROTECTED]> writes: > Hi, > > Now it's possible to implement savedefault with load_env and save_env, > but the problem is we need to add it to every menuitem, it's tedious > process, and new item don't get it automatically. > > I'm thinking about using menu hook to solve this. I can t

Re: Idea: use menu hook to implement the savedefault command

2008-08-12 Thread Bean
On Tue, Aug 12, 2008 at 6:44 PM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Tue, Aug 12, 2008 at 06:38:08PM +0800, Bean wrote: >> > >> > My idea was to implement unlock in scripting. So you could do something >> > like: >> > >> > menuentry unlock { >> >echo Password: >> >read u

Re: Idea: use menu hook to implement the savedefault command

2008-08-12 Thread Robert Millan
On Tue, Aug 12, 2008 at 06:38:08PM +0800, Bean wrote: > > > > My idea was to implement unlock in scripting. So you could do something > > like: > > > > menuentry unlock { > >echo Password: > >read user_pass > >if [ $user_pass = foo ] ; then > >unset menu_lo

Re: Idea: use menu hook to implement the savedefault command

2008-08-12 Thread Bean
On Tue, Aug 12, 2008 at 6:15 PM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Tue, Aug 12, 2008 at 05:38:16PM +0800, Bean wrote: >> On Tue, Aug 12, 2008 at 4:52 PM, Robert Millan <[EMAIL PROTECTED]> wrote: >> > Notice there's already an implementation of a lock command: >> > >> > http://www.mail-

Re: Idea: use menu hook to implement the savedefault command

2008-08-12 Thread Robert Millan
On Tue, Aug 12, 2008 at 05:38:16PM +0800, Bean wrote: > On Tue, Aug 12, 2008 at 4:52 PM, Robert Millan <[EMAIL PROTECTED]> wrote: > > Notice there's already an implementation of a lock command: > > > > http://www.mail-archive.com/grub-devel@gnu.org/msg05350.html > > > > which, I think, even withou

Re: Idea: use menu hook to implement the savedefault command

2008-08-12 Thread Bean
On Tue, Aug 12, 2008 at 4:52 PM, Robert Millan <[EMAIL PROTECTED]> wrote: > Notice there's already an implementation of a lock command: > > http://www.mail-archive.com/grub-devel@gnu.org/msg05350.html > > which, I think, even without password it would satisfy most of the users who > want lock/pass

Re: Idea: use menu hook to implement the savedefault command

2008-08-12 Thread Robert Millan
On Tue, Aug 12, 2008 at 09:27:42AM +0800, Bean wrote: > On Tue, Aug 12, 2008 at 5:32 AM, Robert Millan <[EMAIL PROTECTED]> wrote: > > On Tue, Aug 12, 2008 at 05:03:10AM +0800, Bean wrote: > >> Hi, > >> > >> Now it's possible to implement savedefault with load_env and save_env, > >> but the problem

Re: Idea: use menu hook to implement the savedefault command

2008-08-11 Thread Bean
On Tue, Aug 12, 2008 at 5:32 AM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Tue, Aug 12, 2008 at 05:03:10AM +0800, Bean wrote: >> Hi, >> >> Now it's possible to implement savedefault with load_env and save_env, >> but the problem is we need to add it to every menuitem, it's tedious >> process, a

Re: Idea: use menu hook to implement the savedefault command

2008-08-11 Thread Robert Millan
On Tue, Aug 12, 2008 at 05:03:10AM +0800, Bean wrote: > Hi, > > Now it's possible to implement savedefault with load_env and save_env, > but the problem is we need to add it to every menuitem, it's tedious > process, and new item don't get it automatically. After discussing this on IRC, I just th

Idea: use menu hook to implement the savedefault command

2008-08-11 Thread Bean
Hi, Now it's possible to implement savedefault with load_env and save_env, but the problem is we need to add it to every menuitem, it's tedious process, and new item don't get it automatically. I'm thinking about using menu hook to solve this. I can think of two implementation: 1. Function inter

Idea: use menu hook to implement the savedefault command

2008-08-11 Thread Bean
Hi, Now it's possible to implement savedefault with load_env and save_env, but the problem is we need to add it to every menuitem, it's tedious process, and new item don't get it automatically. I'm thinking about using menu hook to solve this. I can think of two implementation: 1. Function inter