From 6a955ecef09ebe43ed348851e49b2fb115ff00a9 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 6 Apr 2013 14:41:06 +0200 Subject: [PATCH] fix build / progressbar setup after pu/cc merge * CProgressBar::PB_MONO is no longer available * PB color setup is split over two configuration variables Fix this while still keeping seamless update compatibility. --- src/gui/osd_setup.cpp | 11 +++++++++-- src/neutrino.cpp | 10 ++++++++++ src/system/settings.h | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index ba15a67c6..333549647 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -392,7 +392,7 @@ const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_ #define PROGRESSBAR_COLOR_OPTION_COUNT 5 const CMenuOptionChooser::keyval PROGRESSBAR_COLOR_OPTIONS[PROGRESSBAR_COLOR_OPTION_COUNT] = { - { CProgressBar::PB_MONO, LOCALE_PROGRESSBAR_COLOR_MONO }, + { -1, LOCALE_PROGRESSBAR_COLOR_MONO }, { CProgressBar::PB_MATRIX, LOCALE_PROGRESSBAR_COLOR_MATRIX }, { CProgressBar::PB_LINES_V, LOCALE_PROGRESSBAR_COLOR_VERTICAL }, { CProgressBar::PB_LINES_H, LOCALE_PROGRESSBAR_COLOR_HORIZONTAL }, @@ -522,12 +522,19 @@ int COsdSetup::showOsdSetup() osd_menu->addItem(mc); // color progress bar - mc = new CMenuOptionChooser(LOCALE_PROGRESSBAR_COLOR, &g_settings.progressbar_color, PROGRESSBAR_COLOR_OPTIONS, PROGRESSBAR_COLOR_OPTION_COUNT, true); + int pb_color = g_settings.progressbar_color ? g_settings.progressbar_design : -1; + mc = new CMenuOptionChooser(LOCALE_PROGRESSBAR_COLOR, &pb_color, PROGRESSBAR_COLOR_OPTIONS, PROGRESSBAR_COLOR_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_COLOR); osd_menu->addItem(mc); int res = osd_menu->exec(NULL, ""); + if (pb_color == -1) + g_settings.progressbar_color = 0; + else { + g_settings.progressbar_color = 1; + g_settings.progressbar_design = pb_color; + } delete osd_menu; return res; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a86a63d29..d2f8be34e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -419,6 +419,15 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.progressbar_color = 1; else /* the config file already contains an int or nothing at all */ g_settings.progressbar_color = configfile.getInt32("progressbar_color", 1); + g_settings.progressbar_design = configfile.getInt32("progressbar_design", -1); + if (g_settings.progressbar_design == -1) { + /* new setting -> not present before. migrate old progressbar_color value */ + if (g_settings.progressbar_color == 0) + g_settings.progressbar_design = 0; + else /* the values changed... :-( */ + g_settings.progressbar_design = g_settings.progressbar_color - 1; + g_settings.progressbar_color = !!g_settings.progressbar_color; + } g_settings.infobar_show = configfile.getInt32("infobar_show", 1); g_settings.infobar_show_channellogo = configfile.getInt32("infobar_show_channellogo" , 3 ); g_settings.infobar_progressbar = configfile.getInt32("infobar_progressbar" , 0 ); @@ -885,6 +894,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); configfile.setInt32("progressbar_color", g_settings.progressbar_color); + configfile.setInt32("progressbar_design", g_settings.progressbar_design); configfile.setInt32("infobar_show", g_settings.infobar_show); configfile.setInt32("infobar_show_channellogo" , g_settings.infobar_show_channellogo ); configfile.setInt32("infobar_progressbar" , g_settings.infobar_progressbar ); diff --git a/src/system/settings.h b/src/system/settings.h index c8838092a..47ff8d805 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -75,6 +75,7 @@ struct SNeutrinoSettings int infobar_show_channellogo; int infobar_progressbar; int progressbar_color; + int progressbar_design; int casystem_display; int scrambled_message; int volume_pos;