a1ive / grub

Fork of GRUB 2 to add various features.
GNU General Public License v3.0
138 stars 38 forks source link

change menu option 'help' to 'help-msg' #85

Closed sTeeLM closed 4 years ago

a1ive commented 4 years ago

感觉还是有点bug啊。

menuentry "menu 1" --help-msg="qwertyasdfghjkl" {
  echo menu;
}

menuentry "menu 2" --help-msg="test menu 2" {
  echo menu;
}

menuentry "menu 3" {
  echo menu;
}

menuentry "menu 4" --help-msg="fuck fuck fuckfuck fuck" {
  echo menu;
}

theme.txt

# Global Property
title-text: ""
title-color: "#000000"
message-color: "#333333"
message-bg-color: "#f2f2f2"
desktop-color: "#000000"
desktop-image: "background.png"
terminal-box: "term_bkg_*.png"

# Show the boot menu
+ boot_menu {
  left = 15%
  width = 70%
  top = 15%
  height = 70%
  item_color = "#f5f5f5"
  selected_item_color = "#f5f5f5"
  item_height = 38
  item_padding = 15
  item_spacing = 5
  icon_width = 32
  icon_height = 32
  item_icon_space = 20
  selected_item_pixmap_style= "select_bkg_*.png"
  menu_pixmap_style = "menu_bkg_*.png"
  scrollbar = true
  scrollbar_width = 16
  scrollbar_thumb = "sb_thumb_*.png"
  scrollbar_frame = "sb_frame_*.png"
}

+ vbox {
    left = 0%
    top = 0%
    + hbox {
        + label {text = "HELP: " color = "#ffffff"}
        + label {id = "__help__" color = "#ffffff"}
    }
}

深度截图_选择区域_20201112140549

steve6375 commented 4 years ago

Remove HELP: ?? so will work for all languages? User can easily add 'HELP:' to each menuentry if they want it to display 'HELP:'. image If use for grubfm slack theme

steve6375 commented 4 years ago

Can we have more than one line of help text?

a1ive commented 4 years ago

Remove HELP: ?? so will work for all languages? User can easily add 'HELP:' to each menuentry if they want it to display 'HELP:'. image If use for grubfm slack theme

I'm talking about bugs: --help-msg="qwertyasdfghjkl" it shows qwertyasdfg

steve6375 commented 4 years ago

image Could this be a typo? grub-core/commands/menuentry.c

steve6375 commented 4 years ago

I tried different test cases for .cfg file. The results are very unpredictable! it depends on contents/size of the .cfg file which contains the menuentry commands!

image

# FIRST MENU ENTRY HERE - this must always be the default menu entry (always use 'set default=0')

#a1ive grub file manager must be first menu entry (either keep as entry 0 or remove this entry)
if [ -d "(${bootdev},msdos1)/_ISO/MAINMENU" ] ; then 
    menuentry "a1ive grub2 File Manager (/_ISO/MAINMENUX)" --help-msg="qwertyasdfghjkl"  --class=dir {
        delvars
        grubfm "(${bootdev},msdos1)/_ISO/MAINMENU/"
    }
else
    menuentry "a1ive grub2 File Manager" --class=dir {
        delvars
        grubfm
    }
fi

if [ -f "${grubfm0}" ] ; then 
    menuentry "${grubfm0_title}" --class=exe --help-msg="qwertyasdfghjkl" {
        set grubfm_file="${grubfm0}"
        if [ "${grubfm0_type}" = "wininst" ] ; then delvars; configfile (${user})/boot/grubfm/rules/iso/win.sh ; fi
        if [ "${grubfm0_type}" = "e2biso" ]  ; then delvars; configfile (${user})/boot/grubfm/rules/iso/e2b.sh ; fi
        delvars; grubfm_open "${grubfm_file}"
    }
fi

if [ -f "${grubfm1}" ] ; then 
    menuentry "${grubfm1_title}" --help-msg="qwertyasdfghjkl" --class=exe {
        set grubfm_file="${grubfm1}"
        if [ "${grubfm1_type}" = "wininst" ] ; then delvars; configfile (${user})/boot/grubfm/rules/iso/win.sh ; fi
        if [ "${grubfm1_type}" = "e2biso" ]  ; then delvars; configfile (${user})/boot/grubfm/rules/iso/e2b.sh ; fi
        delvars; grubfm_open "${grubfm_file}"
    }
fi

image

Seems to be similar to the theme bug we have found before???

Using up-down keys - sometimes help message is not updated or is blank!