From e227adc879333e6218ab1004ea3c5aac186b35ba Mon Sep 17 00:00:00 2001 From: martii Date: Tue, 26 Nov 2013 23:00:19 +0100 Subject: [PATCH] gui/filebrowser: don't crash when fonts are changed (untested) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/805a1232cf43f696d89b8eefcd4550ecc387d412 Author: martii Date: 2013-11-26 (Tue, 26 Nov 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/filebrowser.cpp | 13 +++++++++---- src/gui/filebrowser.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 85edbae55..d3e3b4872 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -274,9 +274,6 @@ CFileBrowser::CFileBrowser(const char * const _base, const tFileBrowserMode mode void CFileBrowser::commonInit() { frameBuffer = CFrameBuffer::getInstance(); - fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; - fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]; - fnt_small = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; //shoutcast sc_init_dir = "/legacy/genrelist?k=" + g_settings.shoutcast_dev_id; @@ -288,7 +285,15 @@ void CFileBrowser::commonInit() Hide_records = false; selected = 0; selections.clear(); + m_SMSKeyInput.setTimeout(SMSKEY_TIMEOUT); + fontInit(); +} +void CFileBrowser::fontInit() +{ + fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; + fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]; + fnt_small = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel(); x = getScreenStartX(width); @@ -307,7 +312,6 @@ void CFileBrowser::commonInit() height = theight + listmaxshow * fheight + 2 * foheight; y = getScreenStartY(height); - m_SMSKeyInput.setTimeout(SMSKEY_TIMEOUT); } @@ -760,6 +764,7 @@ bool CFileBrowser::exec(const char * const dirname) name = dirname; std::replace(name.begin(), name.end(), '\\', '/'); + fontInit(); paintHead(); int selection = -1; if (name == Path) diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index e3638f5a6..0a95c1556 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -194,6 +194,7 @@ class CFileBrowser protected: void commonInit(); + void fontInit(); public: CFileList filelist;