neutrino.cpp: move theme loading to gui/themes.cpp

original commit (C) martii:
commit cf48e04c02224af37098359d1788f65edd6a7060
gui/themes, neutrino: de-duplicate get/set code
This commit is contained in:
[CST] Focus
2014-09-12 19:42:31 +04:00
parent 64ef858923
commit 58198b3f55
3 changed files with 115 additions and 217 deletions

View File

@@ -97,6 +97,7 @@
#ifdef ENABLE_PIP
#include "gui/pipsetup.h"
#endif
#include "gui/themes.h"
#include <audio.h>
#include <ca_cs.h>
@@ -510,60 +511,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.widget_fade = false;
g_settings.widget_fade = configfile.getBool("widget_fade" , false );
//colors (neutrino defaultcolors)
g_settings.theme.clock_Digit_alpha = configfile.getInt32( "clock_Digit_alpha", 0x00 );
g_settings.theme.clock_Digit_red = configfile.getInt32( "clock_Digit_red", 0x64 );
g_settings.theme.clock_Digit_green = configfile.getInt32( "clock_Digit_green", 0x64 );
g_settings.theme.clock_Digit_blue = configfile.getInt32( "clock_Digit_blue", 0x64 );
g_settings.theme.menu_Head_alpha = configfile.getInt32( "menu_Head_alpha", 0x00 );
g_settings.theme.menu_Head_red = configfile.getInt32( "menu_Head_red", 0x00 );
g_settings.theme.menu_Head_green = configfile.getInt32( "menu_Head_green", 0x0A );
g_settings.theme.menu_Head_blue = configfile.getInt32( "menu_Head_blue", 0x19 );
g_settings.theme.menu_Head_Text_alpha = configfile.getInt32( "menu_Head_Text_alpha", 0x00 );
g_settings.theme.menu_Head_Text_red = configfile.getInt32( "menu_Head_Text_red", 0x5f );
g_settings.theme.menu_Head_Text_green = configfile.getInt32( "menu_Head_Text_green", 0x46 );
g_settings.theme.menu_Head_Text_blue = configfile.getInt32( "menu_Head_Text_blue", 0x00 );
g_settings.theme.menu_Content_alpha = configfile.getInt32( "menu_Content_alpha", 0x14 );
g_settings.theme.menu_Content_red = configfile.getInt32( "menu_Content_red", 0x00 );
g_settings.theme.menu_Content_green = configfile.getInt32( "menu_Content_green", 0x0f );
g_settings.theme.menu_Content_blue = configfile.getInt32( "menu_Content_blue", 0x23 );
g_settings.theme.menu_Content_Text_alpha = configfile.getInt32( "menu_Content_Text_alpha", 0x00 );
g_settings.theme.menu_Content_Text_red = configfile.getInt32( "menu_Content_Text_red", 0x64 );
g_settings.theme.menu_Content_Text_green = configfile.getInt32( "menu_Content_Text_green", 0x64 );
g_settings.theme.menu_Content_Text_blue = configfile.getInt32( "menu_Content_Text_blue", 0x64 );
g_settings.theme.menu_Content_Selected_alpha = configfile.getInt32( "menu_Content_Selected_alpha", 0x14 );
g_settings.theme.menu_Content_Selected_red = configfile.getInt32( "menu_Content_Selected_red", 0x19 );
g_settings.theme.menu_Content_Selected_green = configfile.getInt32( "menu_Content_Selected_green", 0x37 );
g_settings.theme.menu_Content_Selected_blue = configfile.getInt32( "menu_Content_Selected_blue", 0x64 );
g_settings.theme.menu_Content_Selected_Text_alpha = configfile.getInt32( "menu_Content_Selected_Text_alpha", 0x00 );
g_settings.theme.menu_Content_Selected_Text_red = configfile.getInt32( "menu_Content_Selected_Text_red", 0x00 );
g_settings.theme.menu_Content_Selected_Text_green = configfile.getInt32( "menu_Content_Selected_Text_green", 0x00 );
g_settings.theme.menu_Content_Selected_Text_blue = configfile.getInt32( "menu_Content_Selected_Text_blue", 0x00 );
g_settings.theme.menu_Content_inactive_alpha = configfile.getInt32( "menu_Content_inactive_alpha", 0x14 );
g_settings.theme.menu_Content_inactive_red = configfile.getInt32( "menu_Content_inactive_red", 0x00 );
g_settings.theme.menu_Content_inactive_green = configfile.getInt32( "menu_Content_inactive_green", 0x0f );
g_settings.theme.menu_Content_inactive_blue = configfile.getInt32( "menu_Content_inactive_blue", 0x23 );
g_settings.theme.menu_Content_inactive_Text_alpha = configfile.getInt32( "menu_Content_inactive_Text_alpha", 0x00 );
g_settings.theme.menu_Content_inactive_Text_red = configfile.getInt32( "menu_Content_inactive_Text_red", 55 );
g_settings.theme.menu_Content_inactive_Text_green = configfile.getInt32( "menu_Content_inactive_Text_green", 70 );
g_settings.theme.menu_Content_inactive_Text_blue = configfile.getInt32( "menu_Content_inactive_Text_blue", 85 );
g_settings.theme.infobar_alpha = configfile.getInt32( "infobar_alpha", 0x14 );
g_settings.theme.infobar_red = configfile.getInt32( "infobar_red", 0x00 );
g_settings.theme.infobar_green = configfile.getInt32( "infobar_green", 0x0e );
g_settings.theme.infobar_blue = configfile.getInt32( "infobar_blue", 0x23 );
g_settings.theme.infobar_Text_alpha = configfile.getInt32( "infobar_Text_alpha", 0x00 );
g_settings.theme.infobar_Text_red = configfile.getInt32( "infobar_Text_red", 0x64 );
g_settings.theme.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 );
g_settings.theme.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 );
CThemes::getTheme(configfile);
//personalize
g_settings.personalize_pincode = configfile.getString( "personalize_pincode", "0000" );
@@ -572,10 +520,6 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.colored_events_channellist = configfile.getInt32( "colored_events_channellist" , 0 );
g_settings.colored_events_infobar = configfile.getInt32( "colored_events_infobar" , 2 ); // next
g_settings.theme.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 );
g_settings.theme.colored_events_red = configfile.getInt32( "colored_events_red", 95 );
g_settings.theme.colored_events_green = configfile.getInt32( "colored_events_green", 70 );
g_settings.theme.colored_events_blue = configfile.getInt32( "colored_events_blue", 0 );
g_settings.contrast_fonts = configfile.getInt32("contrast_fonts", 0);
@@ -1061,61 +1005,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
//widget settings
configfile.setBool("widget_fade" , g_settings.widget_fade );
//colors
configfile.setInt32( "clock_Digit_alpha", g_settings.theme.clock_Digit_alpha );
configfile.setInt32( "clock_Digit_red", g_settings.theme.clock_Digit_red );
configfile.setInt32( "clock_Digit_green", g_settings.theme.clock_Digit_green );
configfile.setInt32( "clock_Digit_blue", g_settings.theme.clock_Digit_blue );
configfile.setInt32( "menu_Head_alpha", g_settings.theme.menu_Head_alpha );
configfile.setInt32( "menu_Head_red", g_settings.theme.menu_Head_red );
configfile.setInt32( "menu_Head_green", g_settings.theme.menu_Head_green );
configfile.setInt32( "menu_Head_blue", g_settings.theme.menu_Head_blue );
configfile.setInt32( "menu_Head_Text_alpha", g_settings.theme.menu_Head_Text_alpha );
configfile.setInt32( "menu_Head_Text_red", g_settings.theme.menu_Head_Text_red );
configfile.setInt32( "menu_Head_Text_green", g_settings.theme.menu_Head_Text_green );
configfile.setInt32( "menu_Head_Text_blue", g_settings.theme.menu_Head_Text_blue );
configfile.setInt32( "menu_Content_alpha", g_settings.theme.menu_Content_alpha );
configfile.setInt32( "menu_Content_red", g_settings.theme.menu_Content_red );
configfile.setInt32( "menu_Content_green", g_settings.theme.menu_Content_green );
configfile.setInt32( "menu_Content_blue", g_settings.theme.menu_Content_blue );
configfile.setInt32( "menu_Content_Text_alpha", g_settings.theme.menu_Content_Text_alpha );
configfile.setInt32( "menu_Content_Text_red", g_settings.theme.menu_Content_Text_red );
configfile.setInt32( "menu_Content_Text_green", g_settings.theme.menu_Content_Text_green );
configfile.setInt32( "menu_Content_Text_blue", g_settings.theme.menu_Content_Text_blue );
configfile.setInt32( "menu_Content_Selected_alpha", g_settings.theme.menu_Content_Selected_alpha );
configfile.setInt32( "menu_Content_Selected_red", g_settings.theme.menu_Content_Selected_red );
configfile.setInt32( "menu_Content_Selected_green", g_settings.theme.menu_Content_Selected_green );
configfile.setInt32( "menu_Content_Selected_blue", g_settings.theme.menu_Content_Selected_blue );
configfile.setInt32( "menu_Content_Selected_Text_alpha", g_settings.theme.menu_Content_Selected_Text_alpha );
configfile.setInt32( "menu_Content_Selected_Text_red", g_settings.theme.menu_Content_Selected_Text_red );
configfile.setInt32( "menu_Content_Selected_Text_green", g_settings.theme.menu_Content_Selected_Text_green );
configfile.setInt32( "menu_Content_Selected_Text_blue", g_settings.theme.menu_Content_Selected_Text_blue );
configfile.setInt32( "menu_Content_inactive_alpha", g_settings.theme.menu_Content_inactive_alpha );
configfile.setInt32( "menu_Content_inactive_red", g_settings.theme.menu_Content_inactive_red );
configfile.setInt32( "menu_Content_inactive_green", g_settings.theme.menu_Content_inactive_green );
configfile.setInt32( "menu_Content_inactive_blue", g_settings.theme.menu_Content_inactive_blue );
configfile.setInt32( "menu_Content_inactive_Text_alpha", g_settings.theme.menu_Content_inactive_Text_alpha );
configfile.setInt32( "menu_Content_inactive_Text_red", g_settings.theme.menu_Content_inactive_Text_red );
configfile.setInt32( "menu_Content_inactive_Text_green", g_settings.theme.menu_Content_inactive_Text_green );
configfile.setInt32( "menu_Content_inactive_Text_blue", g_settings.theme.menu_Content_inactive_Text_blue );
configfile.setInt32( "infobar_alpha", g_settings.theme.infobar_alpha );
configfile.setInt32( "infobar_red", g_settings.theme.infobar_red );
configfile.setInt32( "infobar_green", g_settings.theme.infobar_green );
configfile.setInt32( "infobar_blue", g_settings.theme.infobar_blue );
configfile.setInt32( "infobar_Text_alpha", g_settings.theme.infobar_Text_alpha );
configfile.setInt32( "infobar_Text_red", g_settings.theme.infobar_Text_red );
configfile.setInt32( "infobar_Text_green", g_settings.theme.infobar_Text_green );
configfile.setInt32( "infobar_Text_blue", g_settings.theme.infobar_Text_blue );
CThemes::setTheme(configfile);
//personalize
configfile.setString("personalize_pincode", g_settings.personalize_pincode);
@@ -1124,10 +1014,6 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32( "colored_events_channellist", g_settings.colored_events_channellist );
configfile.setInt32( "colored_events_infobar", g_settings.colored_events_infobar );
configfile.setInt32( "colored_events_alpha", g_settings.theme.colored_events_alpha );
configfile.setInt32( "colored_events_red", g_settings.theme.colored_events_red );
configfile.setInt32( "colored_events_green", g_settings.theme.colored_events_green );
configfile.setInt32( "colored_events_blue", g_settings.theme.colored_events_blue );
configfile.setInt32( "contrast_fonts", g_settings.contrast_fonts );
//network