diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 35d637838..b9da01512 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -876,7 +876,7 @@ printf("CChannelList::adjustToChannelID me %x [%s] list size %d channel_id %llx\ tuned = i; if (bToo && (bouquetList != NULL)) { - int old_mode = g_settings.channel_mode; + int old_mode = CNeutrinoApp::getInstance()->GetChannelMode(); int new_mode = old_mode; bool has_channel; if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) { diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 6e051e6d9..b4aea3391 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -802,82 +802,86 @@ void CInfoViewer::showSubchan () } if (!(subChannelName.empty ())) { - char text[100]; - sprintf (text, "%d - %s", subchannel, subChannelName.c_str ()); + if( g_settings.infobar_subchan_disp_pos == 4 ) { + g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR , 0 ); + } else { + char text[100]; + sprintf (text, "%d - %s", subchannel, subChannelName.c_str ()); - int dx = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth (text) + 20; - int dy = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); // 25; + int dx = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth (text) + 20; + int dy = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); // 25; - if (g_RemoteControl->director_mode) { - int w = 20 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth (g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), true) + 20; // UTF-8 - int h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - if (w > dx) - dx = w; - dy = dy + h + 5; //dy * 2; - } else - dy = dy + 5; + if (g_RemoteControl->director_mode) { + int w = 20 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth (g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), true) + 20; // UTF-8 + int h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + if (w > dx) + dx = w; + dy = dy + h + 5; //dy * 2; + } else + dy = dy + 5; - int x = 0, y = 0; - if (g_settings.infobar_subchan_disp_pos == 0) { - // Rechts-Oben - x = g_settings.screen_EndX - dx - 10; - y = g_settings.screen_StartY + 10; - } else if (g_settings.infobar_subchan_disp_pos == 1) { - // Links-Oben - x = g_settings.screen_StartX + 10; - y = g_settings.screen_StartY + 10; - } else if (g_settings.infobar_subchan_disp_pos == 2) { - // Links-Unten - x = g_settings.screen_StartX + 10; - y = g_settings.screen_EndY - dy - 10; - } else if (g_settings.infobar_subchan_disp_pos == 3) { - // Rechts-Unten - x = g_settings.screen_EndX - dx - 10; - y = g_settings.screen_EndY - dy - 10; - } + int x = 0, y = 0; + if (g_settings.infobar_subchan_disp_pos == 0) { + // Rechts-Oben + x = g_settings.screen_EndX - dx - 10; + y = g_settings.screen_StartY + 10; + } else if (g_settings.infobar_subchan_disp_pos == 1) { + // Links-Oben + x = g_settings.screen_StartX + 10; + y = g_settings.screen_StartY + 10; + } else if (g_settings.infobar_subchan_disp_pos == 2) { + // Links-Unten + x = g_settings.screen_StartX + 10; + y = g_settings.screen_EndY - dy - 10; + } else if (g_settings.infobar_subchan_disp_pos == 3) { + // Rechts-Unten + x = g_settings.screen_EndX - dx - 10; + y = g_settings.screen_EndY - dy - 10; + } - fb_pixel_t pixbuf[(dx + 2 * borderwidth) * (dy + 2 * borderwidth)]; - lframeBuffer->SaveScreen (x - borderwidth, y - borderwidth, dx + 2 * borderwidth, dy + 2 * borderwidth, pixbuf); + fb_pixel_t pixbuf[(dx + 2 * borderwidth) * (dy + 2 * borderwidth)]; + lframeBuffer->SaveScreen (x - borderwidth, y - borderwidth, dx + 2 * borderwidth, dy + 2 * borderwidth, pixbuf); - // clear border - lframeBuffer->paintBackgroundBoxRel (x - borderwidth, y - borderwidth, dx + 2 * borderwidth, borderwidth); - lframeBuffer->paintBackgroundBoxRel (x - borderwidth, y + dy, dx + 2 * borderwidth, borderwidth); - lframeBuffer->paintBackgroundBoxRel (x - borderwidth, y, borderwidth, dy); - lframeBuffer->paintBackgroundBoxRel (x + dx, y, borderwidth, dy); + // clear border + lframeBuffer->paintBackgroundBoxRel (x - borderwidth, y - borderwidth, dx + 2 * borderwidth, borderwidth); + lframeBuffer->paintBackgroundBoxRel (x - borderwidth, y + dy, dx + 2 * borderwidth, borderwidth); + lframeBuffer->paintBackgroundBoxRel (x - borderwidth, y, borderwidth, dy); + lframeBuffer->paintBackgroundBoxRel (x + dx, y, borderwidth, dy); - lframeBuffer->paintBoxRel (x, y, dx, dy, COL_MENUCONTENT_PLUS_0); - //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + 30, dx - 20, text, COL_MENUCONTENT, 0, true); + lframeBuffer->paintBoxRel (x, y, dx, dy, COL_MENUCONTENT_PLUS_0); + //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + 30, dx - 20, text, COL_MENUCONTENT, 0, true); - if (g_RemoteControl->director_mode) { - lframeBuffer->paintIcon (NEUTRINO_ICON_BUTTON_YELLOW, x + 8, y + dy - 20); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (x + 30, y + dy - 2, dx - 40, g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), COL_MENUCONTENT, 0, true); // UTF-8 - int h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - h - 2, dx - 20, text, COL_MENUCONTENT, 0, true); - } else - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - 2, dx - 20, text, COL_MENUCONTENT, 0, true); + if (g_RemoteControl->director_mode) { + lframeBuffer->paintIcon (NEUTRINO_ICON_BUTTON_YELLOW, x + 8, y + dy - 20); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (x + 30, y + dy - 2, dx - 40, g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), COL_MENUCONTENT, 0, true); // UTF-8 + int h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - h - 2, dx - 20, text, COL_MENUCONTENT, 0, true); + } else + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - 2, dx - 20, text, COL_MENUCONTENT, 0, true); - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd (2); - int res = messages_return::none; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd (2); + int res = messages_return::none; - neutrino_msg_t msg; - neutrino_msg_data_t data; + neutrino_msg_t msg; + neutrino_msg_data_t data; - while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) { - g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); + while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) { + g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); - if (msg == CRCInput::RC_timeout) { - res = messages_return::cancel_info; - } else { - res = neutrino->handleMsg (msg, data); - - if (res & messages_return::unhandled) { - // raus hier und im Hauptfenster behandeln... - g_RCInput->postMsg (msg, data); + if (msg == CRCInput::RC_timeout) { res = messages_return::cancel_info; + } else { + res = neutrino->handleMsg (msg, data); + + if (res & messages_return::unhandled) { + // raus hier und im Hauptfenster behandeln... + g_RCInput->postMsg (msg, data); + res = messages_return::cancel_info; + } } } + lframeBuffer->RestoreScreen (x - borderwidth, y - borderwidth, dx + 2 * borderwidth, dy + 2 * borderwidth, pixbuf); } - lframeBuffer->RestoreScreen (x - borderwidth, y - borderwidth, dx + 2 * borderwidth, dy + 2 * borderwidth, pixbuf); } else { g_RCInput->postMsg (NeutrinoMessages::SHOW_INFOBAR, 0); } diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index ff5002349..56303d1af 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -98,6 +98,8 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) neutrino_msg_data_t data; TP_params TP; int wasgrow = 0; + uint8_t origPosition; + last_snr = 0; moving = 0; @@ -131,6 +133,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) break; } } + origPosition = motorPosition; g_Zapit->setScanSatelliteList( satList); @@ -329,9 +332,26 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) case CRCInput::RC_green: case CRCInput::RC_5: - printf("[motorcontrol] 5 key received... store present satellite number: %d\n", motorPosition); - g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, motorPosition, 0); - //g_Zapit->tune_TP(TP); + { + bool store = true; + printf("[motorcontrol] 5 key received... store present satellite number: %d\n", motorPosition); + if(motorPosition != origPosition) { + printf("[motorcontrol] position changed %d -> %d\n", origPosition, motorPosition); + for(sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) { + if(sit->second.motor_position == motorPosition) + break; + } + if(sit != satellitePositions.end()) { + printf("[motorcontrol] new positions configured for %s\n", sit->second.name.c_str()); + std::string buf = g_Locale->getText(LOCALE_MOTORCONTROL_OVERRIDE); + buf += sit->second.name; + store = (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + } + } + if(store) + g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, motorPosition, 0); + //g_Zapit->tune_TP(TP); + } break; case CRCInput::RC_6: diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index faf425870..7dee27186 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1659,7 +1659,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_setup) { - if(m_movieSelectionHandler != NULL) + //if(m_movieSelectionHandler != NULL) showMenu(m_movieSelectionHandler); } else if (msg == CRCInput::RC_text || msg == CRCInput::RC_radio) { diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 37c7c75e5..03faa9edd 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -29,9 +29,19 @@ void paintButtons(CFrameBuffer * const frameBuffer, Font * const font, const CLocaleManager * const localemanager, const int x, const int y, const unsigned int buttonwidth, const unsigned int count, const struct button_label * const content) { + int fh = font->getHeight(); for (unsigned int i = 0; i < count; i++) { +#if 0 + int iw, ih, yy; + frameBuffer->getIconSize(content[i].button, &iw, &ih); + yy = y + (fh - ih)/2; + frameBuffer->paintIcon(content[i].button, x + i * buttonwidth, yy); + font->RenderString(x + i * buttonwidth + iw + 5, y + 19, buttonwidth - iw - 5, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 +#else frameBuffer->paintIcon(content[i].button, x + i * buttonwidth, y); + //FIXME why y+19 ?? font->RenderString(x + i * buttonwidth + 20, y + 19, buttonwidth - 20, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 +#endif } } diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index baa198dba..e1d69fec7 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -237,11 +237,13 @@ int ShowHintUTF(const neutrino_locale_t Caption, const char * const Text, const { g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); - if ((msg == CRCInput::RC_timeout) || - (msg == CRCInput::RC_home ) || - (msg == CRCInput::RC_ok )) + if ((msg == CRCInput::RC_timeout) || (msg == CRCInput::RC_ok)) { - res = messages_return::cancel_info; + res = messages_return::cancel_info; + } + else if(msg == CRCInput::RC_home) + { + res = messages_return::cancel_all; } else if ((hintBox->has_scrollbar()) && ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))) { @@ -252,9 +254,13 @@ int ShowHintUTF(const neutrino_locale_t Caption, const char * const Text, const } else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { } - else if((msg == CRCInput::RC_mode) || (msg == CRCInput::RC_next) || (msg == CRCInput::RC_prev)) { - res = messages_return::cancel_info; - g_RCInput->postMsg(msg, data); + else if(msg == CRCInput::RC_mode) { + res = messages_return::handled; + break; + } + else if((msg == CRCInput::RC_next) || (msg == CRCInput::RC_prev)) { + res = messages_return::cancel_all; + g_RCInput->postMsg(msg, data); } else { @@ -264,14 +270,14 @@ int ShowHintUTF(const neutrino_locale_t Caption, const char * const Text, const // raus hier und darüber behandeln... g_RCInput->postMsg(msg, data); - res = messages_return::cancel_info; + res = messages_return::cancel_all; } } } hintBox->hide(); delete hintBox; - return 1; + return res; } int ShowLocalizedHint(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width, int timeout, const char * const Icon) diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index e2a1aa25a..870e293ed 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -511,42 +511,42 @@ void CDateInput::onAfterExec() { struct tm tmTime; sscanf( value, "%02d.%02d.%04d %02d:%02d", &tmTime.tm_mday, &tmTime.tm_mon, - &tmTime.tm_year, - &tmTime.tm_hour, &tmTime.tm_min); + &tmTime.tm_year, + &tmTime.tm_hour, &tmTime.tm_min); tmTime.tm_mon-=1; tmTime.tm_year-=1900; tmTime.tm_sec=0; tmTime.tm_isdst=dst; if(tmTime.tm_year>129) - tmTime.tm_year=129; - if(tmTime.tm_year<0) - tmTime.tm_year=0; - if(tmTime.tm_mon>11) - tmTime.tm_mon=11; - if(tmTime.tm_mon<0) - tmTime.tm_mon=0; - if(tmTime.tm_mday>31) //-> eine etwas laxe pruefung, aber mktime biegt das wieder grade - tmTime.tm_mday=31; - if(tmTime.tm_mday<1) - tmTime.tm_mday=1; - if(tmTime.tm_hour>23) - tmTime.tm_hour=23; - if(tmTime.tm_hour<0) - tmTime.tm_hour=0; - if(tmTime.tm_min>59) - tmTime.tm_min=59; - if(tmTime.tm_min<0) - tmTime.tm_min=0; - if(tmTime.tm_sec>59) - tmTime.tm_sec=59; - if(tmTime.tm_sec<0) - tmTime.tm_sec=0; + tmTime.tm_year=129; + if(tmTime.tm_year<0) + tmTime.tm_year=0; + if(tmTime.tm_mon>11) + tmTime.tm_mon=11; + if(tmTime.tm_mon<0) + tmTime.tm_mon=0; + if(tmTime.tm_mday>31) //-> eine etwas laxe pruefung, aber mktime biegt das wieder grade + tmTime.tm_mday=31; + if(tmTime.tm_mday<1) + tmTime.tm_mday=1; + if(tmTime.tm_hour>23) + tmTime.tm_hour=23; + if(tmTime.tm_hour<0) + tmTime.tm_hour=0; + if(tmTime.tm_min>59) + tmTime.tm_min=59; + if(tmTime.tm_min<0) + tmTime.tm_min=0; + if(tmTime.tm_sec>59) + tmTime.tm_sec=59; + if(tmTime.tm_sec<0) + tmTime.tm_sec=0; *time=mktime(&tmTime); struct tm *tmTime2 = localtime(time); sprintf( value, "%02d.%02d.%04d %02d:%02d", tmTime2->tm_mday, tmTime2->tm_mon+1, - tmTime2->tm_year+1900, - tmTime2->tm_hour, tmTime2->tm_min); + tmTime2->tm_year+1900, + tmTime2->tm_hour, tmTime2->tm_min); } //-----------------------------#################################------------------------------------------------------- diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 80ce70d2c..c039bcec2 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -759,6 +759,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.video_43mode = configfile.getInt32("video_43mode", 0); g_settings.current_volume = configfile.getInt32("current_volume", 100); g_settings.channel_mode = configfile.getInt32("channel_mode", LIST_MODE_PROV); + g_settings.channel_mode_radio = configfile.getInt32("channel_mode_radio", LIST_MODE_PROV); g_settings.video_csync = configfile.getInt32( "video_csync", 0 ); g_settings.fan_speed = configfile.getInt32( "fan_speed", 1); @@ -1292,6 +1293,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "video_43mode", g_settings.video_43mode ); configfile.setInt32( "current_volume", g_settings.current_volume ); configfile.setInt32( "channel_mode", g_settings.channel_mode ); + configfile.setInt32( "channel_mode_radio", g_settings.channel_mode_radio ); configfile.setInt32( "video_csync", g_settings.video_csync ); configfile.setInt32( "fan_speed", g_settings.fan_speed); @@ -1859,7 +1861,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) printf("[neutrino] got %d RADIO bouquets\n", bnum); fflush(stdout); TIMER_STOP("[neutrino] took"); - SetChannelMode(g_settings.channel_mode); + SetChannelMode(lastChannelMode); dprintf(DEBUG_DEBUG, "\nAll bouquets-channels received\n"); #ifdef DEBUG @@ -1874,10 +1876,13 @@ void CNeutrinoApp::channelsInit(bool bOnly) void CNeutrinoApp::SetChannelMode(int newmode) { printf("CNeutrinoApp::SetChannelMode %d\n", newmode); - if(mode == mode_radio) + if(mode == mode_radio) { channelList = RADIOchannelList; - else + g_settings.channel_mode_radio = newmode; + } else { channelList = TVchannelList; + g_settings.channel_mode = newmode; + } switch(newmode) { case LIST_MODE_FAV: @@ -1910,7 +1915,7 @@ printf("CNeutrinoApp::SetChannelMode %d\n", newmode); } break; } - g_settings.channel_mode = newmode; + lastChannelMode = newmode; } /************************************************************************************** @@ -2269,6 +2274,7 @@ void CNeutrinoApp::InitZapper() g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str()); } firstChannel(); + lastChannelMode = g_settings.channel_mode; channelsInit(); if(firstchannel.mode == 't') { @@ -3056,7 +3062,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) int nNewChannel = -1; int old_num = 0; int old_b = bouquetList->getActiveBouquetNumber(); - int old_mode = g_settings.channel_mode; + //int old_mode = g_settings.channel_mode; + int old_mode = GetChannelMode(); printf("************************* ZAP START: bouquetList %x size %d old_b %d\n", (int) bouquetList, bouquetList->Bouquets.size(), old_b);fflush(stdout); if(bouquetList->Bouquets.size()) { @@ -3932,7 +3939,7 @@ void CNeutrinoApp::tvMode( bool rezap ) frameBuffer->paintBackground(); g_RemoteControl->tvMode(); - SetChannelMode(g_settings.channel_mode);//FIXME needed ? + SetChannelMode(g_settings.channel_mode); if( rezap ) { firstChannel(); channelList->tuned = 0xfffffff;; @@ -4111,7 +4118,7 @@ printf("radioMode: rezap %s\n", rezap ? "yes" : "no"); } g_RemoteControl->radioMode(); - SetChannelMode(g_settings.channel_mode);//FIXME needed? + SetChannelMode(g_settings.channel_mode_radio); if( rezap ) { firstChannel(); channelList->tuned = 0xfffffff;; @@ -4721,7 +4728,6 @@ int main(int argc, char **argv) for(int i = 3; i < 256; i++) close(i); - tzset(); initGlobals(); diff --git a/src/neutrino.h b/src/neutrino.h index e0cfe91e0..f1891aca3 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -125,6 +125,7 @@ private: bool fromflash; CTimerd::RecordingInfo* nextRecordingInfo; //bool record_mode; + int lastChannelMode; struct timeval standby_pressed_at; @@ -258,7 +259,7 @@ public: int recording_id; void SendSectionsdConfig(void); int GetChannelMode(void) { - return g_settings.channel_mode; + return lastChannelMode; }; void SetChannelMode(int mode); void quickZap(int msg); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index d5547efaf..def5bd224 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -311,6 +311,7 @@ void CVideoSettings::nextMode(void) const char * text; int curmode = 0; int i; + bool disp_cur = 1; for (i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key == g_settings.video_Mode) { @@ -318,26 +319,41 @@ void CVideoSettings::nextMode(void) break; } } - - i = 0; - while (true) { - curmode++; - if (curmode >= VIDEOMENU_VIDEOMODE_OPTION_COUNT) - curmode = 0; - if (g_settings.enabled_video_modes[curmode]) - break; - i++; - if (i >= VIDEOMENU_VIDEOMODE_OPTION_COUNT) - return; - } - text = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].valname; - g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; - CVFD::getInstance()->ShowText((char *)text); - videoDecoder->SetVideoSystem(g_settings.video_Mode); + while(1) { + int res = ShowHintUTF(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); - ShowHintUTF(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); + if(disp_cur && res != messages_return::handled) + return; + + disp_cur = 0; + + if(res == messages_return::handled) { + i = 0; + while (true) { + curmode++; + if (curmode >= VIDEOMENU_VIDEOMODE_OPTION_COUNT) + curmode = 0; + if (g_settings.enabled_video_modes[curmode]) + break; + i++; + if (i >= VIDEOMENU_VIDEOMODE_OPTION_COUNT) + return; + } + + text = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].valname; + } + else if(res == messages_return::cancel_info) { + g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; + CVFD::getInstance()->ShowText((char *)text); + videoDecoder->SetVideoSystem(g_settings.video_Mode); + return; + } + else + return; + } + //ShowHintUTF(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); } void CVideoSettings::next43Mode(void) @@ -720,7 +736,7 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mainSettings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "savesettings", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); CDataResetNotifier * resetNotifier = new CDataResetNotifier(); - mainSettings.addItem(new CMenuForwarder(LOCALE_RESET_SETTINGS , true, NULL, resetNotifier, "settings")); + //mainSettings.addItem(new CMenuForwarder(LOCALE_RESET_SETTINGS , true, NULL, resetNotifier, "settings")); mainSettings.addItem(GenericMenuSeparatorLine); mainSettings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_VIDEO , true, NULL, videoSettings , NULL, CRCInput::convertDigitToKey(sett_count++))); @@ -750,10 +766,15 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mainSettings.addItem(new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, new CHDDMenuHandler())); //mainSettings.addItem(new CMenuForwarder(LOCALE_CAM_SETTINGS, true, NULL, g_CamHandler)); - mainSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE)); - mainSettings.addItem(new CMenuForwarder(LOCALE_EXTRA_LOADCONFIG, true, NULL, this, "loadconfig")); - mainSettings.addItem(new CMenuForwarder(LOCALE_EXTRA_SAVECONFIG, true, NULL, this, "saveconfig")); + CMenuWidget * mset = new CMenuWidget(LOCALE_MAINSETTINGS_MANAGE, NEUTRINO_ICON_SETTINGS); + addMenueIntroItems(*mset); + mainSettings.addItem(new CMenuSeparator(CMenuSeparator::LINE)); + mset->addItem(new CMenuForwarder(LOCALE_RESET_SETTINGS , true, NULL, resetNotifier, "settings")); + mset->addItem(new CMenuForwarder(LOCALE_EXTRA_LOADCONFIG, true, NULL, this, "loadconfig")); + mset->addItem(new CMenuForwarder(LOCALE_EXTRA_SAVECONFIG, true, NULL, this, "saveconfig")); + + mainSettings.addItem(new CMenuForwarder(LOCALE_MAINSETTINGS_MANAGE, true, NULL, mset)); #ifdef TEST_MENU mainMenu.addItem(new CMenuForwarderNonLocalized("Test menu", true, NULL, TestMenu)); #endif @@ -1050,7 +1071,7 @@ void CNeutrinoApp::InitScanSettings(CMenuWidget &settings) CMenuWidget* satOnOff = NULL; sat_iterator_t sit; - t_satellite_position currentSatellitePosition = frontend->getCurrentSatellitePosition(); + //t_satellite_position currentSatellitePosition = frontend->getCurrentSatellitePosition(); if (g_info.delivery_system == DVB_S) { satSelect = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, scanSettings.satNameNoDiseqc, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true); satOnOff = new CMenuWidget(LOCALE_SATSETUP_SATELLITE, NEUTRINO_ICON_SETTINGS); @@ -1104,8 +1125,7 @@ void CNeutrinoApp::InitScanSettings(CMenuWidget &settings) for (sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) { printf("Adding cable menu for %s position %d\n", sit->second.name.c_str(), sit->first); satSelect->addOption(sit->second.name.c_str()); - if (currentSatellitePosition == sit->first) { - strcpy(scanSettings.satNameNoDiseqc, sit->second.name.c_str()); + if (strcmp(scanSettings.satNameNoDiseqc,sit->second.name.c_str()) == 0) { sfound = 1; } dprintf(DEBUG_DEBUG, "got scanprovider (cable): %s\n", sit->second.name.c_str()); @@ -1455,13 +1475,14 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSET { 1, LOCALE_FILESYSTEM_IS_UTF8_OPTION_UTF8 } }; -#define INFOBAR_SUBCHAN_DISP_POS_OPTIONS_COUNT 4 +#define INFOBAR_SUBCHAN_DISP_POS_OPTIONS_COUNT 5 const CMenuOptionChooser::keyval INFOBAR_SUBCHAN_DISP_POS_OPTIONS[INFOBAR_SUBCHAN_DISP_POS_OPTIONS_COUNT]= { { 0 , LOCALE_SETTINGS_POS_TOP_RIGHT }, { 1 , LOCALE_SETTINGS_POS_TOP_LEFT }, { 2 , LOCALE_SETTINGS_POS_BOTTOM_LEFT }, - { 3 , LOCALE_SETTINGS_POS_BOTTOM_RIGHT } + { 3 , LOCALE_SETTINGS_POS_BOTTOM_RIGHT }, + { 4 , LOCALE_INFOVIEWER_SUBCHAN_INFOBAR } }; #define CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT 2 diff --git a/src/system/locals.h b/src/system/locals.h index 3d18836c7..1eb51d9a5 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -435,6 +435,7 @@ typedef enum { LOCALE_INFOVIEWER_SELECTTIME, LOCALE_INFOVIEWER_STREAMINFO, LOCALE_INFOVIEWER_SUBCHAN_DISP_POS, + LOCALE_INFOVIEWER_SUBCHAN_INFOBAR, LOCALE_INFOVIEWER_SUBSERVICE, LOCALE_INFOVIEWER_WAITTIME, LOCALE_IPSETUP_HINT_1, @@ -515,6 +516,7 @@ typedef enum { LOCALE_MAINSETTINGS_LANGUAGE, LOCALE_MAINSETTINGS_TIMEZONE, LOCALE_MAINSETTINGS_LCD, + LOCALE_MAINSETTINGS_MANAGE, LOCALE_MAINSETTINGS_MISC, LOCALE_MAINSETTINGS_NETWORK, LOCALE_MAINSETTINGS_RECORDING, @@ -607,6 +609,7 @@ typedef enum { LOCALE_MOTORCONTROL_MSEC, LOCALE_MOTORCONTROL_STATUS, LOCALE_MOTORCONTROL_SAT_POS, + LOCALE_MOTORCONTROL_OVERRIDE, LOCALE_MOVIEBROWSER_OPTION_BROWSER, LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, LOCALE_MOVIEBROWSER_MENU_SAVE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 13f2931f0..2d706971a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -435,6 +435,7 @@ const char *locale_real_names[] = { "infoviewer.selecttime", "infoviewer.streaminfo", "infoviewer.subchan_disp_pos", + "infoviewer.subchan_infobar", "infoviewer.subservice", "infoviewer.waittime", "ipsetup.hint_1", @@ -515,6 +516,7 @@ const char *locale_real_names[] = { "mainsettings.language", "mainsettings.timezone", "mainsettings.lcd", + "mainsettings.manage", "mainsettings.misc", "mainsettings.network", "mainsettings.recording", @@ -607,6 +609,7 @@ const char *locale_real_names[] = { "motorcontrol.msec", "motorcontrol.status", "motorcontrol.sat_pos", + "motorcontrol.override", "moviebrowser.option_browser", "moviebrowser.book_clear_all", "moviebrowser.menu_save", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 7c9504376..7955cc26f 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -901,8 +901,8 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data) while (search) { if (!strcmp(xmlGetName(search), "zone")) { name = xmlGetAttribute(search, "name"); - zone = xmlGetAttribute(search, "zone"); if(!strcmp(g_settings.timezone, name.c_str())) { + zone = xmlGetAttribute(search, "zone"); found = true; break; } diff --git a/src/system/settings.h b/src/system/settings.h index 11dbc26d7..3501f00bb 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -51,6 +51,7 @@ struct SNeutrinoSettings unsigned char video_csync; char current_volume; int channel_mode; + int channel_mode_radio; //misc int shutdown_real; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 49cbb9371..0b93c0eb7 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -116,7 +116,7 @@ void* CTimerManager::timerThread(void *arg) else { time_t now = time(NULL); - dprintf("Timer Thread time: %u\n", (uint) now); + dprintf("Timer Thread time: %u: %s", (uint) now, ctime(&now)); // fire events who's time has come CTimerEvent *event; @@ -771,6 +771,30 @@ CTimerEvent::CTimerEvent( CTimerd::CTimerEventTypes evtype, time_t announcetime, stopTime = stoptime; repeatCount = repeatcount; previousState = CTimerd::TIMERSTATE_SCHEDULED; + + time_t diff = 0; + time_t mtime = time(NULL); + struct tm *tmtime = localtime(&mtime); + int isdst1 = tmtime->tm_isdst; + + mtime = alarmtime; + tmtime = localtime(&mtime); + int isdst2 = tmtime->tm_isdst; + + if(isdst2 > isdst1) //change from winter to summer + { + diff-=3600; + } + else if(isdst1 > isdst2) //change from summer to winter + { + diff+=3600; + } +#if 0 //FIXME EPG vs manual timer ? + printf("############## CTimerEvent dst %d -> %d diff %d\n", isdst1, isdst2, diff); + alarmTime += diff; + announceTime += diff; + stopTime += diff; +#endif } //------------------------------------------------------------ @@ -786,7 +810,6 @@ CTimerEvent::CTimerEvent( CTimerd::CTimerEventTypes evtype, int mon, int day, in tmtime->tm_mday = day; tmtime->tm_hour = hour; tmtime->tm_min = min; - CTimerEvent(evtype, (time_t) 0, mktime(tmtime), (time_t)0, evrepeat, repeatcount); } //------------------------------------------------------------