Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MzFSt-0005dp-B5 for mharc-grub-devel@gnu.org; Sat, 17 Oct 2009 16:01:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzFSr-0005dC-24 for grub-devel@gnu.org; Sat, 17 Oct 2009 16:01:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzFSm-0005cE-IK for grub-devel@gnu.org; Sat, 17 Oct 2009 16:01:20 -0400 Received: from [199.232.76.173] (port=42532 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzFSm-0005c4-9d for grub-devel@gnu.org; Sat, 17 Oct 2009 16:01:16 -0400 Received: from mail-pw0-f47.google.com ([209.85.160.47]:34625) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MzFSl-0000tB-MT for grub-devel@gnu.org; Sat, 17 Oct 2009 16:01:15 -0400 Received: by pwj10 with SMTP id 10so460169pwj.26 for ; Sat, 17 Oct 2009 13:01:13 -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; bh=cHC154j8TxIiGl7K6/v4upeZEastE+9TeJAHi7qmg+g=; b=nCebJK5xl9/X5RAz//A1wZNPYZ8pDIs8kqJpU2JSPBoG+LePExDIdVtuawXHdF57Er lDtbBWZBUJYPrv+Uf8qr8IFG2mu3EHhpAjlAlPkCQS60tSvX6Nk7C3MEtRgfBep1fSOU sCPJ0NCvwWS9w4dlF0C4Q6QnmtMLr8e6n9qbQ= 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; b=U8xACSFM84oHtZEqOoaoQxXpRK4eFEoSt3a/fKUBiiFD1PJ+dl3h+iFp7c4Bws7bfY pJlLpf5VNs8drPyuFdOXReIKc0P0an5x5S7MY6ScyuD247q3EC+Wlksq0fUJpTSRrT6q 8aYoUl7d0cM16B9QSyp7PjM7p2Xmcvg2CI8iU= MIME-Version: 1.0 Received: by 10.141.40.7 with SMTP id s7mr1478461rvj.25.1255809673110; Sat, 17 Oct 2009 13:01:13 -0700 (PDT) In-Reply-To: References: Date: Sun, 18 Oct 2009 04:01:13 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 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: Sat, 17 Oct 2009 20:01:21 -0000 Hi, Update: Add sub menu support, generate widgets dynamically using menu entries. Now grub.cfg should look like this: menuentry "AAA" { set root=(hd0,1) chainloader +1 } menuentry "BBB" --class ubuntu { true } . /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 { Tools { "Toggle Mode" { command = menu_toggle_mode } "Terminal" { command = "menu_popup term_window" } "Change Theme" { Default { command="load_config /menu/blue.txt\nmenu_refresh" } Green { command="load_config /menu/green.txt\nmenu_refresh" } White { command="load_config /menu/white.txt\nmenu_refresh" } } "Layout Demo" { command = "menu_popup layout_test" } Halt { command = "halt" } Reboot { command = "reboot" } } } merge_config command would append this with user defined menu items. The screen section is very simple now: screen { panel { extend = 1 valign = center halign = center panel { class = frame id = __menu__ } } } 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 { class = select command = COMMAND image { class = CLASS } text { text = TITLE } } The submenu is this: panel { class = frame command = "menu_popup -r menu_tree N" } -- Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/