From 49050b465982135265d42471646d232841d93ceb Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 17 Jan 2012 17:13:54 +0000 Subject: [PATCH 01/13] satellites: update Astra 1H/1KR/1L/1M (19.2E) & Hot Bird 6/8/9 (13.0E) git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2063 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/satellites.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/data/satellites.xml b/data/satellites.xml index cff4d3a29..bcd66a36a 100755 --- a/data/satellites.xml +++ b/data/satellites.xml @@ -1368,7 +1368,7 @@ - + @@ -1384,7 +1384,7 @@ - + @@ -1400,7 +1400,7 @@ - + @@ -1571,11 +1571,15 @@ + + + + @@ -1583,7 +1587,8 @@ - + + @@ -1595,7 +1600,6 @@ - From f7bf5932a9040c41230cef92e242c6ef4220645a Mon Sep 17 00:00:00 2001 From: thilo Date: Tue, 17 Jan 2012 19:44:42 +0000 Subject: [PATCH 02/13] *neutrino media player menu: call moviebrowser from media player object We had 2 ways to open the moviebrowser and one was with parental lock, the other without. btw: Is it really necessary to lock here? Moviebrowser got its own configurable parental lock. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2064 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/mediaplayer.cpp | 31 +++++++++++++++++++++++++++---- src/neutrino.cpp | 17 ++--------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 5df2aac8f..adcb33ca4 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include "gui/movieplayer.h" #include "gui/pictureviewer.h" @@ -48,7 +49,8 @@ #include #include - +#include +extern cVideo * videoDecoder; CMediaPlayerMenu::CMediaPlayerMenu() { @@ -101,6 +103,28 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } + else if (actionKey == "movieplayer") + { +#if 0 //Is it really necessary to lock here? Moviebrowser got its own configurable parental lock. + bool show = true; + if ((g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL) || (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED)) { + CZapProtection zapProtection( g_settings.parentallock_pincode, 0x100 ); + show = zapProtection.check(); + } + + if(show){ +#endif + int mode = CNeutrinoApp::getInstance()->getMode(); + if( mode == NeutrinoMessages::mode_radio ) + videoDecoder->StopPicture(); + CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); + if( mode == NeutrinoMessages::mode_radio ) + videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); +#if 0 + } +#endif + return menu_return::RETURN_REPAINT;; + } int res = initMenuMedia(); @@ -216,9 +240,8 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) //show movieplayer submenu with selectable items for moviebrowser or filebrowser void CMediaPlayerMenu::showMoviePlayer(CMenuWidget *moviePlayer, CPersonalizeGui *p) { - CMoviePlayerGui *movieplayer_gui = &CMoviePlayerGui::getInstance(); - CMenuForwarder *fw_mbrowser = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, movieplayer_gui, "tsmoviebrowser", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); - CMenuForwarder *fw_file = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, true, NULL, movieplayer_gui, "fileplayback", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + CMenuForwarder *fw_mbrowser = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, this, "movieplayer", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + CMenuForwarder *fw_file = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, true, NULL, &CMoviePlayerGui::getInstance(), "fileplayback", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); p->addIntroItems(moviePlayer); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d986f00d5..f9fa0b1b4 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2131,21 +2131,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) media->exec(NULL, ""); } else if( msg == CRCInput::RC_video || msg == CRCInput::RC_play ) { - bool show = true; - if ((g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL) || (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED)) { - CZapProtection* zapProtection = new CZapProtection( g_settings.parentallock_pincode, 0x100 ); - show = zapProtection->check(); - delete zapProtection; - } - if(show) { - //StopSubtitles(); - if( mode == mode_radio ) - videoDecoder->StopPicture(); - CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); - if( mode == mode_radio ) - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); - //StartSubtitles(); - } + //open moviebrowser via media player menu object + CMediaPlayerMenu::getInstance()->exec(NULL,"movieplayer"); } else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) { g_RemoteControl->setSubChannel(CRCInput::getNumericValue(msg)); From 163052cd396d3634326aeb5e97b00797023f4baf Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 17 Jan 2012 20:07:13 +0000 Subject: [PATCH 03/13] dont reload chanellist after manuel reload git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2065 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/bouquetlist.cpp | 3 +-- src/gui/channellist.cpp | 5 ++--- src/gui/scan_setup.cpp | 1 + src/neutrino.cpp | 2 -- src/neutrino.h | 3 ++- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 7eeff4335..62774d385 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -57,7 +57,6 @@ #include extern CBouquetManager *g_bouquetManager; -extern int g_channel_list_changed; CBouquetList::CBouquetList(const char * const Name) { @@ -381,7 +380,7 @@ int CBouquetList::show(bool bShowChannelList) else if ( msg == CRCInput::RC_setup) { int ret = doMenu(); if(ret > 0) { - g_channel_list_changed = true; + CNeutrinoApp::getInstance ()->g_channel_list_changed = true; res = -4; loop = false; } else if(ret < 0) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index b386ebe8f..7376d6212 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -84,7 +84,6 @@ extern CBouquetList * RADIOallList; //extern t_channel_id rec_channel_id; extern bool autoshift; -extern int g_channel_list_changed; extern CBouquetManager *g_bouquetManager; void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode, t_channel_id *chidlist, int clen); @@ -662,8 +661,8 @@ int CChannelList::show() else if ( msg == CRCInput::RC_setup) { old_b_id = bouquetList->getActiveBouquetNumber(); fader.Stop(); - g_channel_list_changed = doChannelMenu(); - if(g_channel_list_changed) { + CNeutrinoApp::getInstance ()->g_channel_list_changed = doChannelMenu(); + if(CNeutrinoApp::getInstance ()->g_channel_list_changed) { res = -4; loop = false; } else { diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index e8170cda5..3294c070b 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -236,6 +236,7 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) g_Zapit->reinitChannels(); if (reloadhintBox) reloadhintBox->hide(); + CNeutrinoApp::getInstance ()->SDTreloadChannels = false; return res; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f9fa0b1b4..63a4f6b47 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -148,8 +148,6 @@ extern cAudio * audioDecoder; cPowerManager *powerManager; cCpuFreqManager * cpuFreq; -int g_channel_list_changed; - void stop_daemons(bool stopall = true); // uncomment if you want to have a "test" menue entry (rasc) diff --git a/src/neutrino.h b/src/neutrino.h index 79b2100cd..117a7ae90 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -130,7 +130,6 @@ private: // bool fromflash; bool init_cec_setting; int lastChannelMode; - bool SDTreloadChannels; struct timeval standby_pressed_at; CZapitClient::responseGetLastChannel firstchannel; @@ -229,6 +228,8 @@ public: void SelectSubtitles(); void showInfo(void); CConfigFile* getConfigFile() {return &configfile;}; + bool SDTreloadChannels; + bool g_channel_list_changed; }; #endif From e17d63131efe92314e34bd568717d69c477d12a6 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 17 Jan 2012 21:03:01 +0000 Subject: [PATCH 04/13] seife:The svn is coolstream svn and not the other way git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2066 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/rcinput.cpp | 10 +++++----- src/driver/rcinput.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 76bdd0645..3689699e1 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1529,7 +1529,11 @@ void CRCInput::play_click() } -#ifdef HAVE_COOLSTREAM_NEVIS_IR_H +#ifdef HAVE_TRIPLEDRAGON +void CRCInput::set_rc_hw(void) +{ +} +#else // hint: ir_protocol_t and other useful things are defined in nevis_ir.h void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) { @@ -1592,8 +1596,4 @@ void CRCInput::set_rc_hw(void) set_rc_hw(ir_protocol, ir_address); } -#else -void CRCInput::set_rc_hw(void) -{ -} #endif diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 981a878bf..5a6355303 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -38,7 +38,7 @@ #include #include #include -#ifdef HAVE_COOLSTREAM_NEVIS_IR_H +#ifndef HAVE_TRIPLEDRAGON #include #endif @@ -152,7 +152,7 @@ class CRCInput int translate(int code, int num); void calculateMaxFd(void); int checkTimers(); -#ifdef HAVE_COOLSTREAM_NEVIS_IR_H +#ifndef HAVE_TRIPLEDRAGON void set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address); #endif public: From 46b07752b9b69760c76cc6d35cf3bf1d4b55aed7 Mon Sep 17 00:00:00 2001 From: focus Date: Wed, 18 Jan 2012 08:58:13 +0000 Subject: [PATCH 05/13] Revert rev.2066 changes. Peace please. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2067 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/rcinput.cpp | 10 +++++----- src/driver/rcinput.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 3689699e1..76bdd0645 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1529,11 +1529,7 @@ void CRCInput::play_click() } -#ifdef HAVE_TRIPLEDRAGON -void CRCInput::set_rc_hw(void) -{ -} -#else +#ifdef HAVE_COOLSTREAM_NEVIS_IR_H // hint: ir_protocol_t and other useful things are defined in nevis_ir.h void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) { @@ -1596,4 +1592,8 @@ void CRCInput::set_rc_hw(void) set_rc_hw(ir_protocol, ir_address); } +#else +void CRCInput::set_rc_hw(void) +{ +} #endif diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 5a6355303..981a878bf 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -38,7 +38,7 @@ #include #include #include -#ifndef HAVE_TRIPLEDRAGON +#ifdef HAVE_COOLSTREAM_NEVIS_IR_H #include #endif @@ -152,7 +152,7 @@ class CRCInput int translate(int code, int num); void calculateMaxFd(void); int checkTimers(); -#ifndef HAVE_TRIPLEDRAGON +#ifdef HAVE_COOLSTREAM_NEVIS_IR_H void set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address); #endif public: From 211ed924738b53d0aa1367545a247f6d124f8350 Mon Sep 17 00:00:00 2001 From: seife Date: Wed, 18 Jan 2012 19:41:07 +0000 Subject: [PATCH 06/13] neutrino: also disable RCU selection menu when nevis_ir include is not present git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2068 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/keybind_setup.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 4587b47d7..abb70d9b9 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -33,6 +33,19 @@ #include #endif +#ifdef HAVE_COOLSTREAM_NEVIS_IR_H +/* define constants instead of #ifdef'ing the corresponding code. + * the compiler will optimize it away anyway, but the syntax is + * still checked */ +#define RC_HW_SELECT true +#else +#define RC_HW_SELECT false +#ifdef HAVE_COOL_HARDWARE +#warning header coolstream/nevis_ir.h not found +#warning you probably have an old driver installation +#warning you´ll be missing the remotecontrol selection feature! +#endif +#endif #include "gui/keybind_setup.h" @@ -218,7 +231,8 @@ int CKeybindSetup::showKeySetup() keySetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL); keySettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_RC)); - keySettings->addItem(new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE, &g_settings.remote_control_hardware, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT, true)); + if (RC_HW_SELECT) + keySettings->addItem(new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE, &g_settings.remote_control_hardware, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT, true)); keySettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCK, true, g_settings.repeat_blocker, keySettings_repeatBlocker)); keySettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, true, g_settings.repeat_genericblocker, keySettings_repeat_genericblocker)); From 6593d693e487f5495418d1fd70350b3351e28d0a Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Fri, 20 Jan 2012 16:28:21 +0000 Subject: [PATCH 07/13] * CMessageBox: Buttons draw better - Improved button layout - Alignment either left / right / center git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2069 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/widget/messagebox.cpp | 183 +++++++++++++++++----------------- src/gui/widget/messagebox.h | 30 ++++-- 2 files changed, 113 insertions(+), 100 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index bf01a8d44..e29140b9a 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -42,39 +42,43 @@ CMessageBox::CMessageBox(const neutrino_locale_t Caption, const char * const Text, const int Width, const char * const Icon, const CMessageBox::result_ Default, const uint32_t ShowButtons) : CHintBoxExt(Caption, Text, Width, Icon) { - returnDefaultOnTimeout = false; - - m_height += (m_fheight << 1); - - result = Default; - - showbuttons = ShowButtons; - - int MaxButtonTextWidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_CANCEL), true); // UTF-8 - int ButtonWidth = 20 + 33 + MaxButtonTextWidth + 5; - int num = 0; - if (showbuttons & mbYes) - num++; - if (showbuttons & mbNo) - num++; - if (showbuttons & (mbCancel | mbBack | mbOk)) - num++; - int new_width = 15 + num*ButtonWidth; - if(new_width > m_width) - m_width = new_width; + Init(Default, ShowButtons); } CMessageBox::CMessageBox(const neutrino_locale_t Caption, ContentLines& Lines, const int Width, const char * const Icon, const CMessageBox::result_ Default, const uint32_t ShowButtons) : CHintBoxExt(Caption, Lines, Width, Icon) +{ + Init(Default, ShowButtons); +} + +void CMessageBox::Init(const CMessageBox::result_ Default, const uint32_t ShowButtons) { returnDefaultOnTimeout = false; + ButtonSpacing = 15; +#define BtnCount 3 + int w = 0, h = 0, ih = 0; + i_maxw = 0; + std::string Btns[BtnCount] = {NEUTRINO_ICON_BUTTON_RED, NEUTRINO_ICON_BUTTON_GREEN, NEUTRINO_ICON_BUTTON_HOME}; + for (int i = 0; i < BtnCount; i++) { + CFrameBuffer::getInstance()->getIconSize(Btns[i].c_str(), &w, &h); + ih = std::max(h, ih); + i_maxw = std::max(w, i_maxw); + } + fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + b_height = std::max(fh, ih) + 8 + (RADIUS_LARGE / 2); + bb_height = b_height + fh/2 + ButtonSpacing; + m_height += bb_height; + result = Default; + int ButtonWidth = getButtonWidth() + 5; + if (ShowButtons & CMessageBox::mbBtnAlignCenter) + mbBtnAlign = CMessageBox::mbBtnAlignCenter; + else if (ShowButtons & CMessageBox::mbBtnAlignLeft) + mbBtnAlign = CMessageBox::mbBtnAlignLeft; + else if (ShowButtons & CMessageBox::mbBtnAlignRight) + mbBtnAlign = CMessageBox::mbBtnAlignRight; + else + mbBtnAlign = CMessageBox::mbBtnAlignCenter; // or g_settings.mbBtnAlign? ;-) + showbuttons = ShowButtons & 0xFF; - m_height += (m_fheight << 1); - - result = Default; - - showbuttons = ShowButtons; - int MaxButtonTextWidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_CANCEL), true); // UTF-8 - int ButtonWidth = 20 + 33 + MaxButtonTextWidth + 5; int num = 0; if (showbuttons & mbYes) num++; @@ -92,87 +96,78 @@ void CMessageBox::returnDefaultValueOnTimeout(bool returnDefault) returnDefaultOnTimeout = returnDefault; } +int CMessageBox::getButtonWidth() +{ +#define localeMsgCount 3 + neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL}; + int MaxButtonTextWidth = 0; + for (int i = 0; i < localeMsgCount; i++) + MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(localeMsg[i]), true), MaxButtonTextWidth); + + return MaxButtonTextWidth + i_maxw + 31 + (RADIUS_LARGE / 2); +} + void CMessageBox::paintButtons() { - uint8_t color; +#define MaxButtons 3 + fb_pixel_t color; fb_pixel_t bgcolor; + struct mbButtons Buttons[MaxButtons]; + int ButtonCount = 0; - m_window->paintBoxRel(0, m_height - (m_fheight << 1) - RADIUS_LARGE, m_width, (m_fheight << 1) + RADIUS_LARGE, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + int ButtonWidth = getButtonWidth(); - //irgendwann alle vergleichen - aber cancel ist sicher der l�ngste - int MaxButtonTextWidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MESSAGEBOX_CANCEL), true); // UTF-8 + if (showbuttons & mbYes) { + Buttons[ButtonCount].active = true; + Buttons[ButtonCount].def = (result == mbrYes) ? true : false; + Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_RED; + Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_YES); + ButtonCount++; + } + if (showbuttons & mbNo) { + Buttons[ButtonCount].active = true; + Buttons[ButtonCount].def = (result == mbrNo) ? true : false; + Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_GREEN; + Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_NO); + ButtonCount++; + } + if (showbuttons & (mbCancel | mbBack | mbOk)) { + Buttons[ButtonCount].active = true; + Buttons[ButtonCount].def = (result >= mbrCancel) ? true : false; + Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_HOME; + Buttons[ButtonCount].text = g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK); + ButtonCount++; + } - int ButtonWidth = 20 + 33 + MaxButtonTextWidth; - - int ButtonSpacing = (m_width - 20 - (ButtonWidth * 3)) / 2; - if(ButtonSpacing <= 5) ButtonSpacing = 5; - - int xpos = 10; int iw, ih; - int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - const int noname = 20; - if (showbuttons & mbYes) - { - if (result == mbrYes) - { + int ButtonbarWidth = ButtonWidth * ButtonCount + ButtonSpacing * (ButtonCount - 1); + int xpos = (m_width - ButtonbarWidth) / 2; + if (mbBtnAlign == CMessageBox::mbBtnAlignCenter) + xpos = (m_width - ButtonbarWidth) / 2; + else if (mbBtnAlign == CMessageBox::mbBtnAlignLeft) + xpos = ButtonSpacing; + else if (mbBtnAlign == CMessageBox::mbBtnAlignRight) + xpos = m_width - ButtonbarWidth - ButtonSpacing; + + int ypos = (m_height - bb_height) + fh/2; + + m_window->paintBoxRel(0, m_height - bb_height, m_width, bb_height, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + + for (int i = 0; i < ButtonCount; i++) { + if (Buttons[i].def) { color = COL_MENUCONTENTSELECTED; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { + } else { color = COL_INFOBAR_SHADOW; bgcolor = COL_INFOBAR_SHADOW_PLUS_0; } - CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &iw, &ih); - m_window->paintBoxRel(xpos, m_height - m_fheight - noname, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor, RADIUS_LARGE);//round - //m_window->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14, m_height - m_fheight - 15); - //m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, m_height-m_fheight+4, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color, 0, true); // UTF-8 - m_window->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14, m_height - m_fheight - noname, m_fheight); - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, (m_height - noname)-(m_fheight-fh)/2, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color, 0, true); // UTF-8 + CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih); + m_window->paintBoxRel(xpos, ypos, ButtonWidth, b_height, (CFBWindow::color_t)bgcolor, RADIUS_LARGE); + m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); + m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), + ButtonWidth - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color, 0, true); xpos += ButtonWidth + ButtonSpacing; } - - if (showbuttons & mbNo) - { - if (result == mbrNo) - { - color = COL_MENUCONTENTSELECTED; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_INFOBAR_SHADOW; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; - } - - m_window->paintBoxRel(xpos, m_height-m_fheight-noname, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor, RADIUS_LARGE);//round - //m_window->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos+14, m_height-m_fheight-15); - m_window->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos+14, m_height-m_fheight - noname, m_fheight); - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, (m_height - noname)-(m_fheight-fh)/2, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color, 0, true); // UTF-8 - xpos += ButtonWidth + ButtonSpacing; - } - - - if (showbuttons & (mbCancel | mbBack | mbOk)) - { - if (result >= mbrCancel) - { - color = COL_MENUCONTENTSELECTED; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_INFOBAR_SHADOW; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; - } - - m_window->paintBoxRel(xpos, m_height-m_fheight-noname, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor, RADIUS_LARGE);//round - //m_window->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10, m_height-m_fheight-19); - m_window->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+14, m_height-m_fheight - noname, m_fheight); - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, (m_height - noname)-(m_fheight-fh)/2, ButtonWidth- 53, - g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK), - (CFBWindow::color_t)color, 0, true); // UTF-8 - } } int CMessageBox::exec(int timeout) diff --git a/src/gui/widget/messagebox.h b/src/gui/widget/messagebox.h index 54e94f5f8..7ac456019 100644 --- a/src/gui/widget/messagebox.h +++ b/src/gui/widget/messagebox.h @@ -42,11 +42,23 @@ class CMessageBox : public CHintBoxExt { private: + struct mbButtons + { + bool active; + bool def; + const char* icon; + const char* text; + }; int showbuttons; bool returnDefaultOnTimeout; + int mbBtnAlign; + int ButtonSpacing; + int fh, i_maxw; + int b_height, bb_height; void paintButtons(); + int getButtonWidth(); public: enum result_ @@ -60,12 +72,15 @@ class CMessageBox : public CHintBoxExt enum buttons_ { - mbYes= 0x01, - mbNo = 0x02, - mbCancel = 0x04, - mbAll = 0x07, - mbBack = 0x08, - mbOk = 0x10 + mbYes = 0x01, + mbNo = 0x02, + mbCancel = 0x04, + mbAll = 0x07, + mbBack = 0x08, + mbOk = 0x10, + mbBtnAlignCenter = 0x0100, + mbBtnAlignLeft = 0x0200, + mbBtnAlignRight = 0x0400 } buttons; // Text & Caption are always UTF-8 encoded @@ -75,6 +90,9 @@ class CMessageBox : public CHintBoxExt int exec(int timeout = -1); void returnDefaultValueOnTimeout(bool returnDefault); + + private: + void Init(const CMessageBox::result_ Default, const uint32_t ShowButtons); }; // Text is always UTF-8 encoded From df378158ca6febdc687695a89fcc4520edcba899 Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 20 Jan 2012 17:15:04 +0000 Subject: [PATCH 08/13] -fix memory leak git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2070 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/screenshot.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index c91ddd28d..35b6aa062 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -197,6 +197,7 @@ bool CScreenShot::SavePng() { printf("CScreenShot::SavePng: %s save error\n", filename.c_str()); png_destroy_write_struct(&png_ptr, &info_ptr); + free(row_pointers); fclose(fd); return false; } From bb4bb6df21ef53c07c35f81246234479ec716b02 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Sun, 22 Jan 2012 11:53:02 +0000 Subject: [PATCH 09/13] * CMessageBox: Buttons draw better - New standard variant for centered display the buttons - optimized code git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2072 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/widget/messagebox.cpp | 104 ++++++++++++++++------------------ src/gui/widget/messagebox.h | 27 +++++---- 2 files changed, 63 insertions(+), 68 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index e29140b9a..ee8a4f52b 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -52,9 +52,9 @@ CMessageBox::CMessageBox(const neutrino_locale_t Caption, ContentLines& Lines, c void CMessageBox::Init(const CMessageBox::result_ Default, const uint32_t ShowButtons) { +#define BtnCount 3 returnDefaultOnTimeout = false; ButtonSpacing = 15; -#define BtnCount 3 int w = 0, h = 0, ih = 0; i_maxw = 0; std::string Btns[BtnCount] = {NEUTRINO_ICON_BUTTON_RED, NEUTRINO_ICON_BUTTON_GREEN, NEUTRINO_ICON_BUTTON_HOME}; @@ -68,27 +68,46 @@ void CMessageBox::Init(const CMessageBox::result_ Default, const uint32_t ShowBu bb_height = b_height + fh/2 + ButtonSpacing; m_height += bb_height; result = Default; - int ButtonWidth = getButtonWidth() + 5; - if (ShowButtons & CMessageBox::mbBtnAlignCenter) - mbBtnAlign = CMessageBox::mbBtnAlignCenter; - else if (ShowButtons & CMessageBox::mbBtnAlignLeft) + b_width = getButtonWidth(); + if (ShowButtons & CMessageBox::mbBtnAlignCenter1) + mbBtnAlign = CMessageBox::mbBtnAlignCenter1; // centered, large distances + else if (ShowButtons & CMessageBox::mbBtnAlignCenter2) + mbBtnAlign = CMessageBox::mbBtnAlignCenter2; // centered, small distances + else if (ShowButtons & CMessageBox::mbBtnAlignLeft) mbBtnAlign = CMessageBox::mbBtnAlignLeft; - else if (ShowButtons & CMessageBox::mbBtnAlignRight) + else if (ShowButtons & CMessageBox::mbBtnAlignRight) mbBtnAlign = CMessageBox::mbBtnAlignRight; else - mbBtnAlign = CMessageBox::mbBtnAlignCenter; // or g_settings.mbBtnAlign? ;-) + mbBtnAlign = CMessageBox::mbBtnAlignCenter1; // or g_settings.mbBtnAlign? ;-) showbuttons = ShowButtons & 0xFF; - int num = 0; - if (showbuttons & mbYes) - num++; - if (showbuttons & mbNo) - num++; - if (showbuttons & (mbCancel | mbBack | mbOk)) - num++; - int new_width = 15 + num*ButtonWidth; - if(new_width > m_width) - m_width = new_width; + ButtonCount = 0; + if (showbuttons & mbYes) { + Buttons[ButtonCount].def = (result == mbrYes) ? true : false; + Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_RED; + Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_YES); + ButtonCount++; + } + if (showbuttons & mbNo) { + Buttons[ButtonCount].def = (result == mbrNo) ? true : false; + Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_GREEN; + Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_NO); + ButtonCount++; + } + if (showbuttons & (mbCancel | mbBack | mbOk)) { + Buttons[ButtonCount].def = (result >= mbrCancel) ? true : false; + Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_HOME; + Buttons[ButtonCount].text = g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK); + ButtonCount++; + } + + ButtonDistance = ButtonSpacing; + bb_width = b_width * ButtonCount + ButtonDistance * (ButtonCount - 1); + if(bb_width > m_width) + m_width = bb_width; + else + if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1) + ButtonDistance = (m_width - b_width * ButtonCount) / (ButtonCount + 1); } void CMessageBox::returnDefaultValueOnTimeout(bool returnDefault) @@ -98,56 +117,29 @@ void CMessageBox::returnDefaultValueOnTimeout(bool returnDefault) int CMessageBox::getButtonWidth() { -#define localeMsgCount 3 - neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL}; +#define localeMsgCount 5 + neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL, LOCALE_MESSAGEBOX_OK, LOCALE_MESSAGEBOX_BACK}; int MaxButtonTextWidth = 0; for (int i = 0; i < localeMsgCount; i++) MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(localeMsg[i]), true), MaxButtonTextWidth); - - return MaxButtonTextWidth + i_maxw + 31 + (RADIUS_LARGE / 2); + return MaxButtonTextWidth + i_maxw + 36 + (RADIUS_LARGE / 2); } void CMessageBox::paintButtons() { -#define MaxButtons 3 fb_pixel_t color; fb_pixel_t bgcolor; - struct mbButtons Buttons[MaxButtons]; - int ButtonCount = 0; - - int ButtonWidth = getButtonWidth(); - - if (showbuttons & mbYes) { - Buttons[ButtonCount].active = true; - Buttons[ButtonCount].def = (result == mbrYes) ? true : false; - Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_RED; - Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_YES); - ButtonCount++; - } - if (showbuttons & mbNo) { - Buttons[ButtonCount].active = true; - Buttons[ButtonCount].def = (result == mbrNo) ? true : false; - Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_GREEN; - Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_NO); - ButtonCount++; - } - if (showbuttons & (mbCancel | mbBack | mbOk)) { - Buttons[ButtonCount].active = true; - Buttons[ButtonCount].def = (result >= mbrCancel) ? true : false; - Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_HOME; - Buttons[ButtonCount].text = g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK); - ButtonCount++; - } int iw, ih; - int ButtonbarWidth = ButtonWidth * ButtonCount + ButtonSpacing * (ButtonCount - 1); - int xpos = (m_width - ButtonbarWidth) / 2; - if (mbBtnAlign == CMessageBox::mbBtnAlignCenter) - xpos = (m_width - ButtonbarWidth) / 2; + int xpos = (m_width - bb_width) / 2; + if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1) + xpos = ButtonDistance; + if (mbBtnAlign == CMessageBox::mbBtnAlignCenter2) + xpos = (m_width - bb_width) / 2; else if (mbBtnAlign == CMessageBox::mbBtnAlignLeft) xpos = ButtonSpacing; else if (mbBtnAlign == CMessageBox::mbBtnAlignRight) - xpos = m_width - ButtonbarWidth - ButtonSpacing; + xpos = m_width - bb_width - ButtonSpacing; int ypos = (m_height - bb_height) + fh/2; @@ -162,11 +154,11 @@ void CMessageBox::paintButtons() bgcolor = COL_INFOBAR_SHADOW_PLUS_0; } CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih); - m_window->paintBoxRel(xpos, ypos, ButtonWidth, b_height, (CFBWindow::color_t)bgcolor, RADIUS_LARGE); + m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_LARGE); m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), - ButtonWidth - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color, 0, true); - xpos += ButtonWidth + ButtonSpacing; + b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color, 0, true); + xpos += b_width + ButtonDistance; } } diff --git a/src/gui/widget/messagebox.h b/src/gui/widget/messagebox.h index 7ac456019..67e063e0a 100644 --- a/src/gui/widget/messagebox.h +++ b/src/gui/widget/messagebox.h @@ -38,24 +38,26 @@ #include #include +#define MaxButtons 3 class CMessageBox : public CHintBoxExt { private: struct mbButtons { - bool active; bool def; const char* icon; const char* text; }; + struct mbButtons Buttons[MaxButtons]; int showbuttons; bool returnDefaultOnTimeout; int mbBtnAlign; - int ButtonSpacing; + int ButtonSpacing, ButtonDistance; int fh, i_maxw; - int b_height, bb_height; + int b_height, b_width, bb_height, bb_width; + int ButtonCount; void paintButtons(); int getButtonWidth(); @@ -72,15 +74,16 @@ class CMessageBox : public CHintBoxExt enum buttons_ { - mbYes = 0x01, - mbNo = 0x02, - mbCancel = 0x04, - mbAll = 0x07, - mbBack = 0x08, - mbOk = 0x10, - mbBtnAlignCenter = 0x0100, - mbBtnAlignLeft = 0x0200, - mbBtnAlignRight = 0x0400 + mbYes = 0x01, + mbNo = 0x02, + mbCancel = 0x04, + mbAll = 0x07, + mbBack = 0x08, + mbOk = 0x10, + mbBtnAlignCenter1 = 0x0100, /* centered, large distances */ + mbBtnAlignCenter2 = 0x0200, /* centered, small distances */ + mbBtnAlignLeft = 0x0400, + mbBtnAlignRight = 0x0800 } buttons; // Text & Caption are always UTF-8 encoded From 7530e5b7bf540b6530d58549d9750845fc4e3c67 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Sun, 22 Jan 2012 11:54:37 +0000 Subject: [PATCH 10/13] * alternative remote controls - locale changed from 'dbox' to 'd-box Nokia (old)' (patch by bellum) git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2073 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f7769be5b..9df964e96 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -594,7 +594,7 @@ keybindingmenu.poweroff Umschalter keybindingmenu.quickzap Schnellumschaltung keybindingmenu.remotecontrol_hardware Hardware keybindingmenu.remotecontrol_hardware_coolstream Coolstream -keybindingmenu.remotecontrol_hardware_dbox dbox +keybindingmenu.remotecontrol_hardware_dbox d-box Nokia (alt) keybindingmenu.remotecontrol_hardware_msg_part1 Die Fernbedienung wurde von ' keybindingmenu.remotecontrol_hardware_msg_part2 ' auf ' keybindingmenu.remotecontrol_hardware_msg_part3 ' geändert.\nIst dies korrekt?\nBitte die Auswahl innerhalb 15 Sekunden mit der neuen Fernbedienung\nbestätigen. Ansonsten wird die Auswahl zurückgesetzt. diff --git a/data/locale/english.locale b/data/locale/english.locale index bae622dfa..4cfbc83ab 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -594,7 +594,7 @@ keybindingmenu.poweroff Power toggle keybindingmenu.quickzap Quickzap keybindingmenu.remotecontrol_hardware Hardware keybindingmenu.remotecontrol_hardware_coolstream Coolstream -keybindingmenu.remotecontrol_hardware_dbox dbox +keybindingmenu.remotecontrol_hardware_dbox d-box Nokia (old) keybindingmenu.remotecontrol_hardware_msg_part1 The remote control has been changed from ' keybindingmenu.remotecontrol_hardware_msg_part2 ' to ' keybindingmenu.remotecontrol_hardware_msg_part3 ' \nIs this correct?\nPlease confirm the selection within 15 seconds by using the new remote control.\nOtherwise the selection will be reverted. From 6bd78334dc40d64a34e45640cee48d9f2d15d758 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Mon, 23 Jan 2012 18:00:02 +0000 Subject: [PATCH 11/13] * CMessageBox: Buttons draw better - Paint the default button corrected. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2074 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/widget/messagebox.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index ee8a4f52b..8670fda04 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -83,19 +83,16 @@ void CMessageBox::Init(const CMessageBox::result_ Default, const uint32_t ShowBu ButtonCount = 0; if (showbuttons & mbYes) { - Buttons[ButtonCount].def = (result == mbrYes) ? true : false; Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_RED; Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_YES); ButtonCount++; } if (showbuttons & mbNo) { - Buttons[ButtonCount].def = (result == mbrNo) ? true : false; Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_GREEN; Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_NO); ButtonCount++; } if (showbuttons & (mbCancel | mbBack | mbOk)) { - Buttons[ButtonCount].def = (result >= mbrCancel) ? true : false; Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_HOME; Buttons[ButtonCount].text = g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK); ButtonCount++; @@ -129,8 +126,8 @@ void CMessageBox::paintButtons() { fb_pixel_t color; fb_pixel_t bgcolor; + int iw, ih, i; - int iw, ih; int xpos = (m_width - bb_width) / 2; if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1) xpos = ButtonDistance; @@ -145,7 +142,19 @@ void CMessageBox::paintButtons() m_window->paintBoxRel(0, m_height - bb_height, m_width, bb_height, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - for (int i = 0; i < ButtonCount; i++) { + i = 0; + if (showbuttons & mbYes) { + Buttons[i].def = (result == mbrYes) ? true : false; + i++; + } + if (showbuttons & mbNo) { + Buttons[i].def = (result == mbrNo) ? true : false; + i++; + } + if (showbuttons & (mbCancel | mbBack | mbOk)) + Buttons[i].def = (result >= mbrCancel) ? true : false; + + for (i = 0; i < ButtonCount; i++) { if (Buttons[i].def) { color = COL_MENUCONTENTSELECTED; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; From d85f287f5e669a8cd1eec065309356def966ea26 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Wed, 25 Jan 2012 04:23:36 +0000 Subject: [PATCH 12/13] * CMessageBox: Buttons draw better - Missing 'else' added. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2075 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/widget/messagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 8670fda04..9e8bddfbf 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -131,7 +131,7 @@ void CMessageBox::paintButtons() int xpos = (m_width - bb_width) / 2; if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1) xpos = ButtonDistance; - if (mbBtnAlign == CMessageBox::mbBtnAlignCenter2) + else if (mbBtnAlign == CMessageBox::mbBtnAlignCenter2) xpos = (m_width - bb_width) / 2; else if (mbBtnAlign == CMessageBox::mbBtnAlignLeft) xpos = ButtonSpacing; From 4ef07363db12de1a222ba0042696539c4d3aa0e8 Mon Sep 17 00:00:00 2001 From: focus Date: Thu, 26 Jan 2012 13:09:49 +0000 Subject: [PATCH 13/13] Fix DD audio pid auto-selection if DD prefered is set git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2076 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/daemonc/remotecontrol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 0092df048..3399d7b0b 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -505,9 +505,11 @@ void CRemoteControl::processAPIDnames() if(!strstr(current_PIDs.APIDs[count].desc, " (AC3)")) strncat(current_PIDs.APIDs[count].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)); has_ac3 = true; - if((strlen( current_PIDs.APIDs[count].desc ) == 3) && g_settings.audio_DolbyDigital && (ac3_found < 0)) + if(g_settings.audio_DolbyDigital && (ac3_found < 0)) ac3_found = count; } + else if (current_PIDs.APIDs[count].is_aac && !strstr(current_PIDs.APIDs[count].desc, " (AAC)")) + strncat(current_PIDs.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)); } if ( has_unresolved_ctags )