Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N0K2n-0002Gp-Qm for mharc-grub-devel@gnu.org; Tue, 20 Oct 2009 15:06:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0K2l-0002F0-Al for grub-devel@gnu.org; Tue, 20 Oct 2009 15:06:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0K2i-0002Ch-P4 for grub-devel@gnu.org; Tue, 20 Oct 2009 15:06:49 -0400 Received: from [199.232.76.173] (port=38590 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0K2i-0002CS-Ao for grub-devel@gnu.org; Tue, 20 Oct 2009 15:06:48 -0400 Received: from fg-out-1718.google.com ([72.14.220.153]:1250) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0K2h-00083S-Ff for grub-devel@gnu.org; Tue, 20 Oct 2009 15:06:47 -0400 Received: by fg-out-1718.google.com with SMTP id e21so1876462fga.12 for ; Tue, 20 Oct 2009 12:06:46 -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=MMR6Xw/xADIXsjQvGnyb0Co2S31fNZ/eGjbMo+4ipLc=; b=Xf3/0UoOcF+BIJWV8fsAKOxEYy8SWtzZMip0uX/ZalUTGCTPpzADcFGrIURT0Nmj2x 3yvfgCoA31tgzIWMudwo44zzb6YIQxKkoDlTSBEeoOXH0p0TTE8sTXpSP65SodkhPb+2 6hTnKLlz/I9kVU42/l3gBXBmmirD4WFbvLTOE= 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=weoTxSoWDtOQfseR/M17WDY2aw+VTWFZNMuGkMs5tnkmvMViwquCqZunCxu82Xb4+O Cet3kl4q87XrFbAcSwFKGqw5BsCMv3kQrNQZzQNJlhs76FoHex+LhQVbiM+EmS9M4zJV /oaxWPopKNX1Hn3WS5+o2+S2guzjyfH3OZVzQ= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.86.170.22 with SMTP id s22mr3960075fge.37.1256065606144; Tue, 20 Oct 2009 12:06:46 -0700 (PDT) In-Reply-To: References: From: Michal Suchanek Date: Tue, 20 Oct 2009 21:06:25 +0200 X-Google-Sender-Auth: 5840dcbe6c17e0a5 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:06:51 -0000 Hello 2009/10/17 Bean : > Hi, > > Update: > > Add sub menu support, generate widgets dynamically using menu entries. The example is very complex and I don't quite understand what is the advantage of this baroque scheme over generating the menus in grub.d in files like 00_header or 10_linux. For example, each menuentry for loading a linux kernel is generated by a function in 10_linux which in turn calls functions from grub-mkconfig_lib. Thus it is possible to create arbitrarily complex menu entries without additional C code in grub or user-edited configuration. I don't see why these shell scripts cannot include all the panels and stuff needed for the new menu and have to be generated by C code in grub. > > Now grub.cfg should look like this: > > menuentry "AAA" { > =C2=A0set root=3D(hd0,1) > =C2=A0chainloader +1 > } > > menuentry "BBB" --class ubuntu { > =C2=A0true > } > > . /menu/menu.cfg > > The menu have three items, AAA, BBB and Tools, which is a menu > appended in menu.cfg. > > Tools are a submenu, its content is defined using menu section: > > menu { > =C2=A0Tools { > =C2=A0 =C2=A0"Toggle Mode" { > =C2=A0 =C2=A0 =C2=A0command =3D menu_toggle_mode > =C2=A0 =C2=A0} > > =C2=A0 =C2=A0"Terminal" { > =C2=A0 =C2=A0 =C2=A0command =3D "menu_popup term_window" > =C2=A0 =C2=A0} > > =C2=A0 =C2=A0"Change Theme" { > =C2=A0 =C2=A0 =C2=A0Default { > =C2=A0 =C2=A0 =C2=A0 =C2=A0command=3D"load_config /menu/blue.txt\nmenu_re= fresh" > =C2=A0 =C2=A0 =C2=A0} > > =C2=A0 =C2=A0 =C2=A0Green { > =C2=A0 =C2=A0 =C2=A0 =C2=A0command=3D"load_config /menu/green.txt\nmenu_r= efresh" > =C2=A0 =C2=A0 =C2=A0} > > =C2=A0 =C2=A0 =C2=A0White { > =C2=A0 =C2=A0 =C2=A0 =C2=A0command=3D"load_config /menu/white.txt\nmenu_r= efresh" > =C2=A0 =C2=A0 =C2=A0} > =C2=A0 =C2=A0} > > =C2=A0 =C2=A0"Layout Demo" { > =C2=A0 =C2=A0 =C2=A0command =3D "menu_popup layout_test" > =C2=A0 =C2=A0} > > =C2=A0 =C2=A0Halt { > =C2=A0 =C2=A0 =C2=A0command =3D "halt" > =C2=A0 =C2=A0} > > =C2=A0 =C2=A0Reboot { > =C2=A0 =C2=A0 =C2=A0command =3D "reboot" > =C2=A0 =C2=A0} > =C2=A0} > } > > merge_config command would append this with user defined menu items. > > The screen section is very simple now: > > screen { > =C2=A0panel { > =C2=A0 =C2=A0extend =3D 1 > =C2=A0 =C2=A0valign =3D center > =C2=A0 =C2=A0halign =3D center > > =C2=A0 =C2=A0panel { > =C2=A0 =C2=A0 =C2=A0class =3D frame > =C2=A0 =C2=A0 =C2=A0id =3D __menu__ > =C2=A0 =C2=A0} > =C2=A0} > } So you invent a new property here just to bind the menu to a panel. If you insist then screen should be a panel { id =3D __screen__ }. > > command menu_create would scan screen for id __menu__, and add widgets > according to the menu content. The generated widget entry looks like > this: > > panel > { > =C2=A0class =3D select > =C2=A0command =3D COMMAND > =C2=A0image { class =3D =C2=A0CLASS } > =C2=A0text { text =3D TITLE } > } And if I want a slightly different structure I have to patch and recompile grub. I also wonder how do you specify the image bitmap here because it's the sole content of the image so it should not be specified by style. > > The submenu is this: > > panel > { > =C2=A0class =3D frame > =C2=A0command =3D "menu_popup -r menu_tree N" > } > I have no idea what the above is supposed to mean. Care to explain? Thanks Michal