From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N0KRL-0006Xn-Ge for mharc-grub-devel@gnu.org; Tue, 20 Oct 2009 15:32:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0KRK-0006X6-BH for grub-devel@gnu.org; Tue, 20 Oct 2009 15:32:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0KRJ-0006WN-NW for grub-devel@gnu.org; Tue, 20 Oct 2009 15:32:13 -0400 Received: from [199.232.76.173] (port=35524 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0KRJ-0006WE-Jv for grub-devel@gnu.org; Tue, 20 Oct 2009 15:32:13 -0400 Received: from fg-out-1718.google.com ([72.14.220.157]:39902) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0KRJ-0004jY-8p for grub-devel@gnu.org; Tue, 20 Oct 2009 15:32:13 -0400 Received: by fg-out-1718.google.com with SMTP id e21so1886621fga.12 for ; Tue, 20 Oct 2009 12:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=jnx5+euJf+0xUUFRqkgrwQ5AAn4RuvssrTRuHMP+v8I=; b=UIlnL3JEURGF164HtSD54LIVZQf8Lv1sruP9KhJptL2lNWAiztFJa5kpFoLmQudGXU rnAQioHS0SyU18mkMUagPa2h7h/cBeETPeWmV2LNgT9S4hZXM+TrzHyt0V2zn9fi62cQ Gxkc8f7qayhQWIkcMuPL4MukvIvsJOSpniZWs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=rIgGDWmYnFBNSKo0do+JR1wjK8YJpKxNoEGOY1GPi7cVSp6oUMoGkB/MZyehx4MT8g H+JNkQ3P+1msRp8cvIZBCMrRcjTOooGOGeZpXeFfVPsK77lu/s3ymAkB6GVNKhOAnKG5 p82Tg0QmZqQVsz1AZcvMf+XYZhlE3kcYJj3p4= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.86.17.27 with SMTP id 27mr4148016fgq.31.1256067132098; Tue, 20 Oct 2009 12:32:12 -0700 (PDT) In-Reply-To: References: From: Michal Suchanek Date: Tue, 20 Oct 2009 21:31:52 +0200 X-Google-Sender-Auth: b13a9ceb1dd5470b Message-ID: To: The development of GRUB 2 Content-Type: text/plain; charset=UTF-8 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 (implementation) 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: Tue, 20 Oct 2009 19:32:14 -0000 2009/10/20 Bean : > Hi, > > Update: > > Add dialog support, it allows you to write a template and call it with > different parameters, for example: > > dialog_edit { > =C2=A0panel { > =C2=A0 =C2=A0parameters =3D "text=3Dedit.text" > =C2=A0 =C2=A0class =3D frame > =C2=A0 =C2=A0width =3D 80% > =C2=A0 =C2=A0attach_hcenter =3D 0 > =C2=A0 =C2=A0attach_vcenter =3D 0 > > =C2=A0 =C2=A0edit { > =C2=A0 =C2=A0 =C2=A0lines =3D 10 > =C2=A0 =C2=A0} > =C2=A0} > } I can see this used for the edit boxen and text mesasge dialogs which would be quite similar. Also the templating seems quite flexible and versatile. However, can't this be done with a shell function? Both the grub.d scripts and grub.cfg can define a function with a few parameters to achieve pretty much the same results. IIRC one of the sample menu.cfg files defined functions as part of grub configuration so we do not need another facility for this. > > The parameters property control the mapping between parameter and > internal property name. To use it to edit current command: > > menu_edit dialog_edit text=3Dcommand > > It also allows you to edit other properties, for example, the demo add > a hotkey t to edit the title: > > t =3D "menu_edit dialog_edit text=3Dtitle\nmenu_refresh" > > The generated menu also uses templates, one for submenu, and one for menu= item: > > menu_template { > =C2=A0panel { > =C2=A0 =C2=A0class =3D frame > =C2=A0} > } > > item_template { > =C2=A0panel { > =C2=A0 =C2=A0parameters =3D "class=3Dimage.class:title=3Dtext.text" > =C2=A0 =C2=A0class =3D select > =C2=A0 =C2=A0image {} > =C2=A0 =C2=A0text {} > =C2=A0} > } > > The names of the template is passed to menu_create command: > > menu_create menu_template item_template. > > Smart popup window. The sub menu would pop to the direction with the > most space, which would make sure it won't be truncated by the border. It won't. You cannot know how much space the "most space" is. > For example, if the parent menu is at the top of screen, sub menu pops > at the bottom, if it's at the bottom, sub menu pops at the top. > > add command menu_next_node, menu_prev_node, menu_next_anchor and > menu_prev_anchor, you can assign these to other keys. The demo adds > the two terminal example. Inside terminal, direction key and TAB are > all used, so you need to assign another hotkey to switch between the > two window. The demo uses f6: > > f6 =3D menu_next_anchor This is an interesting addition but I'm not sure where this would be used. Normally one terminal is enough so you can just open it fullscreen and close it when you want to do something else. Thanks Michal