Improve gettext support. Stylistic fixes and error handling fixes while
on it.
This commit is contained in:
parent
215c90cb82
commit
9c4b5c13e6
184 changed files with 1175 additions and 959 deletions
|
@ -36,6 +36,7 @@
|
|||
#include <grub/gfxmenu_model.h>
|
||||
#include <grub/gfxmenu_view.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
@ -58,7 +59,8 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested)
|
|||
|
||||
theme_path = grub_env_get ("theme");
|
||||
if (! theme_path)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "no theme specified");
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"),
|
||||
"theme");
|
||||
|
||||
instance = grub_zalloc (sizeof (*instance));
|
||||
if (!instance)
|
||||
|
|
|
@ -151,11 +151,6 @@ rescale_image (grub_gui_image_t self)
|
|||
height,
|
||||
self->raw_bitmap,
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST);
|
||||
if (grub_errno != GRUB_ERR_NONE)
|
||||
{
|
||||
grub_error_push ();
|
||||
grub_error (grub_errno, "failed to scale bitmap for image component");
|
||||
}
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
|
@ -224,7 +219,7 @@ image_set_property (void *vself, const char *name, const char *value)
|
|||
|
||||
/* Resolve to an absolute path. */
|
||||
if (! self->theme_dir)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unspecified theme_dir");
|
||||
return grub_error (GRUB_ERR_BUG, "unspecified theme_dir");
|
||||
absvalue = grub_resolve_relative_path (self->theme_dir, value);
|
||||
if (! absvalue)
|
||||
return grub_errno;
|
||||
|
|
|
@ -169,11 +169,7 @@ try_loading_icon (grub_gfxmenu_icon_manager_t mgr,
|
|||
GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST);
|
||||
grub_video_bitmap_destroy (raw_bitmap);
|
||||
if (! scaled_bitmap)
|
||||
{
|
||||
grub_error_push ();
|
||||
grub_error (grub_errno, "failed to scale icon");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return scaled_bitmap;
|
||||
}
|
||||
|
|
|
@ -130,12 +130,6 @@ scale_pixmap (grub_gfxmenu_box_t self, int i, int w, int h)
|
|||
if (w != 0 && h != 0)
|
||||
grub_video_bitmap_create_scaled (scaled, w, h, raw,
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST);
|
||||
if (grub_errno != GRUB_ERR_NONE)
|
||||
{
|
||||
grub_error_push ();
|
||||
grub_error (grub_errno,
|
||||
"failed to scale bitmap for styled box pixmap #%d", i);
|
||||
}
|
||||
}
|
||||
|
||||
return grub_errno;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue