diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index e57ebd98e..2babbebaf 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -933,7 +933,7 @@ menu.hint_plugins_hdd_dir Auswahl des Verzeichnisses zum Laden der Plugins von e menu.hint_power_leds Konfiguriert das Verhalten der LEDs an der Power-Taste menu.hint_pref_lang Wählen Sie ihre bevorzugte Tonspur und EPG-Sprache,\ndie Einstellung 'none' deaktiviert diese Option menu.hint_pref_subs Wählen Sie ihre bevorzugte Untertitel-Sprache,\ndie Einstellung 'none' deaktiviert diese Option -menu.hint_progressbar_color Bei aktivierter Option werden alle Fortschrittsbalken in Farbe und nicht im klassischen Weiß angezeigt +menu.hint_progressbar_color Erscheinungsbild der Fortschrittsbalken auswählen menu.hint_protection Schützen Sie Inhalte per PIN-Code\nStandard-PIN ist 0000 menu.hint_radiomode Schaltet zum Radio-Modus menu.hint_reboot Startet die Box neu\nDer Neustart erfolgt ohne Bestätigung! @@ -1499,7 +1499,12 @@ pinprotection.head PIN-Abfrage pinprotection.wrongcode Geben Sie den Code nocheinmal ein! plugins.hdd_dir Externes Plugin-Verz. plugins.result Pluginausgabe -progressbar.color Fortschrittsbalken Farbe +progressbar.color Fortschrittsbalkendesign +progressbar.color.full farbig +progressbar.color.horizontal farbige horizontale Linien +progressbar.color.matrix farbige Punkte +progressbar.color.mono monochrom +progressbar.color.vertical farbige vertikale Linien rclock.lockmsg Die Fernbedienung wird gesperrt.\n Um die Sperre aufzuheben, bitte\n und auf der Fernbedienung\n drücken. rclock.menueadd FB sperren rclock.title Fernbedienung sperren diff --git a/data/locale/english.locale b/data/locale/english.locale index 93985def6..066c2511a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -933,7 +933,7 @@ menu.hint_plugins_hdd_dir Select directory to load\nplugins from menu.hint_power_leds Configure power-button LEDs behavior menu.hint_pref_lang Select preferred audio and EPG language\nselect 'none' to disable menu.hint_pref_subs Select preferred subtitle language\nselect 'none' to disable -menu.hint_progressbar_color Show colored progress bars +menu.hint_progressbar_color Change appearance of progress bars menu.hint_protection Protect content by PIN code\nDefault PIN 0000 menu.hint_radiomode Switch box to radio mode menu.hint_reboot Reboot box\nNo confirmation @@ -1499,7 +1499,12 @@ pinprotection.head Enter PIN code pinprotection.wrongcode PIN-Code was wrong! Try again. plugins.hdd_dir Plugin HDD dir. plugins.result plugin output -progressbar.color Progressbar Color +progressbar.color Progressbardesign +progressbar.color.full colored +progressbar.color.horizontal colored horizontal lines +progressbar.color.matrix colored dots +progressbar.color.mono monochrome +progressbar.color.vertical colored vertical lines rclock.lockmsg Your box remote control will be locked.\n To unlock it, press \n and on your remote control. rclock.menueadd Lock RC rclock.title Lock Remote Control diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 4fec1914b..ba15a67c6 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -10,6 +10,7 @@ Copyright (C) 2010 T. Graf 'dbt' Homepage: http://www.dbox2-tuning.net/ + Copyright (C) 2010, 2012-2103 Stefan Seyfried License: GPL @@ -388,6 +389,15 @@ const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_ { 2, LOCALE_MISCSETTINGS_COLORED_EVENTS_2 }, //next }; +#define PROGRESSBAR_COLOR_OPTION_COUNT 5 +const CMenuOptionChooser::keyval PROGRESSBAR_COLOR_OPTIONS[PROGRESSBAR_COLOR_OPTION_COUNT] = +{ + { CProgressBar::PB_MONO, 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 }, + { CProgressBar::PB_COLOR, LOCALE_PROGRESSBAR_COLOR_FULL } +}; //show osd setup int COsdSetup::showOsdSetup() @@ -512,7 +522,7 @@ int COsdSetup::showOsdSetup() osd_menu->addItem(mc); // color progress bar - mc = new CMenuOptionChooser(LOCALE_PROGRESSBAR_COLOR, &g_settings.progressbar_color, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc = new CMenuOptionChooser(LOCALE_PROGRESSBAR_COLOR, &g_settings.progressbar_color, PROGRESSBAR_COLOR_OPTIONS, PROGRESSBAR_COLOR_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_COLOR); osd_menu->addItem(mc); diff --git a/src/gui/widget/progressbar.cpp b/src/gui/widget/progressbar.cpp index 6baef6dba..dcee30fc0 100644 --- a/src/gui/widget/progressbar.cpp +++ b/src/gui/widget/progressbar.cpp @@ -1,5 +1,6 @@ /* * (C) 2008 by dbt + * (C) 2009-2010, 2012-2013 Stefan Seyfried * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -190,14 +191,35 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y, } else { + int itemw = ITEMW, itemh = ITEMW, pointx = POINT, pointy = POINT; + int hcnt = height / itemh; /* how many POINTs is the bar high */ + switch ((pb_color_t)g_settings.progressbar_color) + { + default: + case PB_MATRIX: /* matrix */ + break; + case PB_LINES_V: /* vert. lines */ + itemh = height; + pointy = height; + hcnt = 0; + break; + case PB_LINES_H: /* horiz. lines */ + itemw = POINT; + break; + case PB_COLOR: /* filled color */ + itemw = POINT; + itemh = height; + pointy = height; + hcnt = 0; + break; + } /* red, yellow, green are given in percent */ - int rd = red * width / (100 * ITEMW); /* how many POINTs red */ - int yw = yellow * width / (100 * ITEMW); /* how many POINTs yellow */ - int gn = green * width / (100 * ITEMW); /* how many POINTs green */ + int rd = red * width / (100 * itemw); /* how many POINTs red */ + int yw = yellow * width / (100 * itemw); /* how many POINTs yellow */ + int gn = green * width / (100 * itemw); /* how many POINTs green */ - int hcnt = height / ITEMW; /* how many POINTs is the bar high */ - int maxi = active_pb_width / ITEMW; /* how many POINTs is the active bar */ - int total = width / ITEMW; /* total number of POINTs */ + int maxi = active_pb_width / itemw; /* how many POINTs is the active bar */ + int total = width / itemw; /* total number of POINTs */ uint32_t rgb; fb_pixel_t color; @@ -223,8 +245,8 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y, rgb = RED + ((unsigned char)(step * i) << 8); // adding green color = make16color(rgb); for(j = 0; j <= hcnt; j++) - frameBuffer->paintBoxRel(pos_x + i * ITEMW, pos_y + j * ITEMW, - POINT, POINT, color); + frameBuffer->paintBoxRel(pos_x + i * itemw, pos_y + j * itemh, + pointx, pointy, color); } for (; (i < yw) && (i < maxi); i++) { step = 255 / yw / 2; @@ -234,8 +256,8 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y, rgb = YELLOW - ((unsigned char)(step * (b++)) << 16); // removing red color = make16color(rgb); for(j = 0; j <= hcnt; j++) - frameBuffer->paintBoxRel(pos_x + i * ITEMW, pos_y + j * ITEMW, - POINT, POINT, color); + frameBuffer->paintBoxRel(pos_x + i * itemw, pos_y + j * itemh, + pointx, pointy, color); } for (; (i < gn) && (i < maxi); i++) { step = 255 / gn; @@ -245,14 +267,14 @@ void CProgressBar::realpaint(const int pos_x, const int pos_y, rgb = YELLOW - ((unsigned char) (step * (b++)) << 16); // removing red color = make16color(rgb); for(j = 0; j <= hcnt; j++) - frameBuffer->paintBoxRel(pos_x + i * ITEMW, pos_y + j * ITEMW, - POINT, POINT, color); + frameBuffer->paintBoxRel(pos_x + i * itemw, pos_y + j * itemh, + pointx, pointy, color); } } for(i = maxi; i < total; i++) { for(j = 0; j <= hcnt; j++) - frameBuffer->paintBoxRel(pos_x + i * ITEMW, pos_y + j * ITEMW, - POINT, POINT, COL_INFOBAR_PLUS_3);//fill passive + frameBuffer->paintBoxRel(pos_x + i * itemw, pos_y + j * itemh, + pointx, pointy, COL_INFOBAR_PLUS_3);//fill passive } last_width = active_pb_width; } diff --git a/src/gui/widget/progressbar.h b/src/gui/widget/progressbar.h index f66cf7e42..221dc91e6 100644 --- a/src/gui/widget/progressbar.h +++ b/src/gui/widget/progressbar.h @@ -1,7 +1,6 @@ /* - * $Id$ - * * (C) 2008 by dbt + * (C) 2009,2010,2013 Stefan Seyfried * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -131,6 +130,14 @@ class CProgressBar void reset() { last_width = -1; } /* force update on next paint */ void hide(); + + enum pb_color_t { + PB_MONO = 0, + PB_MATRIX, /* 1 */ + PB_LINES_V, /* 2 */ + PB_LINES_H, /* 3 */ + PB_COLOR /* 4 */ + }; }; #endif /* __gui_widget_progressbar_h__ */ diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9d2178e24..6635bcb52 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -412,7 +412,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos" , 0 ); - g_settings.progressbar_color = configfile.getBool("progressbar_color", true ); + g_settings.progressbar_color = configfile.getInt32("progressbar_color", 1); 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 ); @@ -877,7 +877,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); - configfile.setBool("progressbar_color" , g_settings.progressbar_color ); + configfile.setInt32("progressbar_color", g_settings.progressbar_color); 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/locals.h b/src/system/locals.h index bc8c51904..730ef7264 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1527,6 +1527,11 @@ typedef enum LOCALE_PLUGINS_HDD_DIR, LOCALE_PLUGINS_RESULT, LOCALE_PROGRESSBAR_COLOR, + LOCALE_PROGRESSBAR_COLOR_FULL, + LOCALE_PROGRESSBAR_COLOR_HORIZONTAL, + LOCALE_PROGRESSBAR_COLOR_MATRIX, + LOCALE_PROGRESSBAR_COLOR_MONO, + LOCALE_PROGRESSBAR_COLOR_VERTICAL, LOCALE_RCLOCK_LOCKMSG, LOCALE_RCLOCK_MENUEADD, LOCALE_RCLOCK_TITLE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d533f5a83..42eca2b52 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1527,6 +1527,11 @@ const char * locale_real_names[] = "plugins.hdd_dir", "plugins.result", "progressbar.color", + "progressbar.color.full", + "progressbar.color.horizontal", + "progressbar.color.matrix", + "progressbar.color.mono", + "progressbar.color.vertical", "rclock.lockmsg", "rclock.menueadd", "rclock.title",