Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MnC9h-00078f-7d for mharc-grub-devel@gnu.org; Mon, 14 Sep 2009 10:03:45 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnC9f-00077M-C2 for grub-devel@gnu.org; Mon, 14 Sep 2009 10:03:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnC9b-00077A-S5 for grub-devel@gnu.org; Mon, 14 Sep 2009 10:03:43 -0400 Received: from [199.232.76.173] (port=60121 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnC9b-000777-Oj for grub-devel@gnu.org; Mon, 14 Sep 2009 10:03:39 -0400 Received: from mail-px0-f171.google.com ([209.85.216.171]:50850) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnC9b-0005i3-52 for grub-devel@gnu.org; Mon, 14 Sep 2009 10:03:39 -0400 Received: by pxi1 with SMTP id 1so2539882pxi.1 for ; Mon, 14 Sep 2009 07:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=gJ2QYrEETFETrshtZKPvD/K5nPHt6W1MhQLnVYvLUIQ=; b=q2dCOqSC5m33mMVxVDi269x0jOZnxt9qs/TxciC8ZxGIT9I6CZeTZEv0Y4IA4uldx+ 6L2BsiLPOvZAJjX4QCJwqvp/32SNqbX0v/6rHPK7/SyBfv/y0EfJgz2lvvSzw01UVNhi dwM6z6S9flxoPOAy44VoHyo/EYJmf14zSmcHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=xdNkhPcZ+qp1xHnvp3CMZuNY7ZUJWzkC3Cz72TjP1P3jyIN6R/IrQ1HrFvPM5Ys3GH FX34kK7ZpDH4GF+WHnz7Y+Nu5Ghvtwe8iHeGs6OQqpZusN53vAvAFJGGXwH5nTy/Owbh cz9ANgC70A4qpmaRRrZucVguLkTSle0ih16tQ= MIME-Version: 1.0 Received: by 10.140.147.2 with SMTP id u2mr892670rvd.214.1252937018038; Mon, 14 Sep 2009 07:03:38 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Sep 2009 22:03:38 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [GITGRUB] New menu interface (second draft) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 14:03:43 -0000 On Mon, Sep 14, 2009 at 5:56 PM, Michal Suchanek wrot= e: > 2009/9/14 Bean : >>Hi, >> >>Thanks a lot for your advice, most of them looks good, although some >>details may need adjustment. > > Thank you for working on the new menu system. > > Of course, this discussion is here to select the best ways to > implement the menu we can think of and refine them so that we can save > work on (re-)implementation and maintenance. > >> >> About edit boxes, I'd prefer to use a command like popup to open a new >> window, perhaps something like: >> >> popup "+ term { class=3Dgfxterm }" >> >> Then we can bind it to specific keys using onkey event: >> >> +onkey >> { >> =A0key =3D "e" >> =A0command =3D "popup \"+ edit { class=3Dedit_box text=3D\\\"$CURITEM\\\= " }\"" >> } > > I thought that the editbox should be able to actually edit something > but currently it is not so, it loads a list of commands from the item > and either the list is executed (possibly after modifications) or it > is thrown away so this would probably work. > > But it is still somewhat problematic because this does not tie the > edit the the particular label which is going to be edited. > > If the label was special in some way (ie linux kernel versus other > kernel) and it was somehow reflected in its properties (which is easy > because linux kernels are done with 10_linux in grub.d while others > are done elsewhere) or it was the single user variant this information > is lost now. What I have in mind here is that people might want the > edit dialog for a red menu item to have red border or something like > that. > > This also makes password protection somewhat hard to hook in. If > editing the item is password protected and this key is bound globally > then this seems to bypass the password unless special measures are > taken. > > Also there is not only "edit action" but also "execute action" key > binding that applies to labels with an action. This should be also > globally(?) customizable,but possibly password protected. > > It's not like the "onkey" handler cannot check the password protection > properties but it's more natural (and probably easier to understand in > the code) if this is handled in the component itself. > Hi, Right, the previous example doesn't cover the data binding between edit box and popup window, perhaps we can write something like this: (text is the attribute name). popup " + edit { src=3Dtext }" We could have multiple edit box, for example, one to edit label, another to edit content. As for password protection, we could just use a attribute, for example: + onkey { key =3D "F1" password =3D "true" command =3D "..." } We could also put the password attribute in css. With this, we can fine tune which command needs protection. >> >> + onkey >> { >> =A0key =3D "c" >> =A0command =3D "popup \"+ term { class=3Dterm_box }\"" >> } > > This is fine, it opens a terminal which is just a new toplevel window. > I would prefer the keyword was "show" instead of "popup" because it > should hide the current window and show the one specified instead. > Popup typically refers to a small additional window in windowing > systems (and we don't really need a windowing system, only > single-window system should be fine). > > The other thing with onkey is that if you want to make the key known > you have to replicate the information somewhere in a label. > It might be better to have an element that reacts to a hotkey and also > displays it. > > ie > > + label { > =A0text =3D Help > =A0hotkey =3D F1,h > =A0action { > =A0show { > > > }}} > > or if this is easier > > + hotkey { > =A0key =3D F1,h > =A0+ label { > =A0text =3D Help > .... > > # problematic keys > key =3D space,comma Each label can have associated hotkey, but onkey is different, it's the event dispatcher, for example: + menu { + onkey { key =3D "c" password =3D "true" command =3D "" } + onkey { key =3D "e" password =3D "true" command =3D "" } + label { text =3D "help" hotkey =3D "F1" } + label { text =3D "1. Boot Windows" password =3D "true" hotkey =3D "1" } } Pressing F1 or 1 select the item, while pressing c or e laugh specific command, regardless of which item is currently selected. > > I wonder if writing the whole element structure in the show command > directly is the best approach. Perhaps the show commnad should only > accept a class name and try to find a previously defined toplevel (not > inside other element) panel with that class or perhaps there should be > some other naming that would make it possible to define and recall > windows. Yep, both method works. In previous post, I've suggested adding dialog tree, then we can use something like "show dialog_name". But being able to embed the component in a string means we can construct it dynamically, this could be useful when appending to the component tree in sh/lua script. --=20 Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/