diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 2f4a3722c..80b40377e 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -142,7 +142,7 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) if (initRenderClass) { if (g_fontRenderer != NULL) delete g_fontRenderer; - g_fontRenderer = new FBFontRenderClass(72 * g_settings.screen_xres / 100, 72 * g_settings.screen_yres / 100); + g_fontRenderer = new FBFontRenderClass(72 * g_settings.font_scaling_x / 100, 72 * g_settings.font_scaling_y / 100); old_fontDescr.size_offset = fontDescr.size_offset; old_fontDescr.filename = fontDescr.filename; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index a45a0ca5f..8a31cf3c2 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -267,26 +267,26 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if (actionKey == "font_scaling") { - int xre = g_settings.screen_xres; - int yre = g_settings.screen_yres; + int fs_x = g_settings.font_scaling_x; + int fs_y = g_settings.font_scaling_y; CMenuWidget fontscale(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_FONTSCALE); fontscale.addIntroItems(LOCALE_FONTMENU_SCALING); - CMenuOptionNumberChooser* mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_X, &g_settings.screen_xres, true, 50, 200, this); + CMenuOptionNumberChooser* mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_X, &g_settings.font_scaling_x, true, 50, 200, this); mc->setNumericInput(true); mc->setNumberFormat("%d%%"); fontscale.addItem(mc); - mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_Y, &g_settings.screen_yres, true, 50, 200, this); + mc = new CMenuOptionNumberChooser(LOCALE_FONTMENU_SCALING_Y, &g_settings.font_scaling_y, true, 50, 200, this); mc->setNumericInput(true); mc->setNumberFormat("%d%%"); fontscale.addItem(mc); res = fontscale.exec(NULL, ""); - if (xre != g_settings.screen_xres || yre != g_settings.screen_yres) { - printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", g_settings.screen_xres, g_settings.screen_yres); + if (fs_x != g_settings.font_scaling_x || fs_y != g_settings.font_scaling_y) { + printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", g_settings.font_scaling_x, g_settings.font_scaling_y); CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST | CNeutrinoFonts::FONTSETUP_DYN_FONT); if (CNeutrinoApp::getInstance()->channelList) CNeutrinoApp::getInstance()->channelList->ResetModules(); //force re init of all modules diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f1416d10d..d449a78f2 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -721,8 +721,6 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1); //screen configuration - g_settings.screen_xres = configfile.getInt32("screen_xres", 100); - g_settings.screen_yres = configfile.getInt32("screen_yres", 100); g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD); g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD ); g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD); @@ -783,6 +781,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.ttx_font_file = configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf"); ttx_font_file = g_settings.ttx_font_file.c_str(); + g_settings.font_scaling_x = configfile.getInt32("font_scaling_x", 100); + g_settings.font_scaling_y = configfile.getInt32("font_scaling_y", 100); + g_settings.update_dir = configfile.getString("update_dir", "/tmp"); g_settings.update_dir_opkg = configfile.getString("update_dir_opkg", g_settings.update_dir); @@ -987,6 +988,16 @@ void CNeutrinoApp::upgradeSetup(const char * fname) configfile.deleteKey("progressbar_timescale_yellow"); configfile.deleteKey("progressbar_timescale_invert"); } + if (g_settings.version_pseudo < "20170209181001") + { + //convert screen_x/yres keys to font_scaling_x/y + + g_settings.font_scaling_x = configfile.getInt32("screen_xres", 100); + g_settings.font_scaling_y = configfile.getInt32("screen_yres", 100); + + configfile.deleteKey("screen_xres"); + configfile.deleteKey("screen_yres"); + } g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO; configfile.setString("version_pseudo", g_settings.version_pseudo); @@ -1297,8 +1308,6 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers); //screen configuration - configfile.setInt32( "screen_xres", g_settings.screen_xres); - configfile.setInt32( "screen_yres", g_settings.screen_yres); configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd ); configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd ); configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd ); @@ -1338,6 +1347,9 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString("font_file", g_settings.font_file); configfile.setString("ttx_font_file", g_settings.ttx_font_file); + configfile.setInt32( "font_scaling_x", g_settings.font_scaling_x); + configfile.setInt32( "font_scaling_y", g_settings.font_scaling_y); + //parentallock configfile.setInt32( "parentallock_prompt", g_settings.parentallock_prompt ); configfile.setInt32( "parentallock_lockage", g_settings.parentallock_lockage ); diff --git a/src/system/settings.h b/src/system/settings.h index 2d9d302d4..f352cefc7 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -619,8 +619,6 @@ struct SNeutrinoSettings int screen_preset; int screen_width; int screen_height; - int screen_xres; - int screen_yres; //Software-update int softupdate_mode; @@ -778,9 +776,13 @@ struct SNeutrinoSettings int zap_cycle; int sms_channel; int sms_movie; + std::string font_file; std::string ttx_font_file; + int font_scaling_x; + int font_scaling_y; + int livestreamResolution; std::string livestreamScriptPath; diff --git a/version_pseudo.h b/version_pseudo.h index bdfc25f5d..6f6e6e9a0 100644 --- a/version_pseudo.h +++ b/version_pseudo.h @@ -1 +1 @@ -#define NEUTRINO_VERSION_PSEUDO "20162912080000" +#define NEUTRINO_VERSION_PSEUDO "20170209181001"