#3817 fixes
This commit is contained in:
@@ -29,6 +29,11 @@
|
|||||||
int currentBitmapIndex = 0;
|
int currentBitmapIndex = 0;
|
||||||
BitmapBuffer * currentBitmap = NULL;
|
BitmapBuffer * currentBitmap = NULL;
|
||||||
|
|
||||||
|
bool isImageFileExtension(const char * ext)
|
||||||
|
{
|
||||||
|
return (ext && (!strcasecmp(ext, BMP_EXT) || !strcasecmp(ext, JPG_EXT) || !strcasecmp(ext, PNG_EXT)));
|
||||||
|
}
|
||||||
|
|
||||||
bool menuRadioSdManagerInfo(event_t event)
|
bool menuRadioSdManagerInfo(event_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_SUBMENU(STR_SD_INFO_TITLE, ICON_RADIO_SD_BROWSER, 1);
|
SIMPLE_SUBMENU(STR_SD_INFO_TITLE, ICON_RADIO_SD_BROWSER, 1);
|
||||||
@@ -224,8 +229,10 @@ bool menuRadioSdManager(event_t _event)
|
|||||||
if (!strcasecmp(ext, SOUNDS_EXT)) {
|
if (!strcasecmp(ext, SOUNDS_EXT)) {
|
||||||
POPUP_MENU_ADD_ITEM(STR_PLAY_FILE);
|
POPUP_MENU_ADD_ITEM(STR_PLAY_FILE);
|
||||||
}
|
}
|
||||||
else if (!strcasecmp(ext, BMP_EXT) || !strcasecmp(ext, JPG_EXT) || !strcasecmp(ext, PNG_EXT)) {
|
else if (isImageFileExtension(ext)) {
|
||||||
if (!READ_ONLY() && (ext-line) <= (int)sizeof(g_model.header.bitmap)) {
|
TCHAR lfn[_MAX_LFN+1];
|
||||||
|
f_getcwd(lfn, _MAX_LFN);
|
||||||
|
if (!READ_ONLY() && unsigned(LEN_FILE_EXTENSION+ext-line) <= sizeof(g_model.header.bitmap) && !strcmp(lfn, BITMAPS_PATH)) {
|
||||||
POPUP_MENU_ADD_ITEM(STR_ASSIGN_BITMAP);
|
POPUP_MENU_ADD_ITEM(STR_ASSIGN_BITMAP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,7 +383,7 @@ bool menuRadioSdManager(event_t _event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char * ext = getFileExtension(reusableBuffer.sdmanager.lines[index], SD_SCREEN_FILE_LENGTH+1);
|
char * ext = getFileExtension(reusableBuffer.sdmanager.lines[index], SD_SCREEN_FILE_LENGTH+1);
|
||||||
if (ext && (!strcasecmp(ext, BMP_EXT) || !strcasecmp(ext, PNG_EXT) || !strcasecmp(ext, JPG_EXT))) {
|
if (isImageFileExtension(ext)) {
|
||||||
if (currentBitmapIndex != menuVerticalPosition) {
|
if (currentBitmapIndex != menuVerticalPosition) {
|
||||||
currentBitmapIndex = menuVerticalPosition;
|
currentBitmapIndex = menuVerticalPosition;
|
||||||
delete currentBitmap;
|
delete currentBitmap;
|
||||||
|
|||||||
Reference in New Issue
Block a user