From ea4ba454cbace6f65c0f8e3378f087c2c268a235 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 17 Apr 2012 19:54:45 +0400 Subject: [PATCH] gui/scan_setup.cpp: compare transponder to set selected in transponder list --- src/gui/scan_setup.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index d485eefcc..9a065969d 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1015,7 +1015,11 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/ CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); menu.addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); //add cancel button, ensures that we have enought space left from item caption + transponder ct; CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); + if(channel) + CServiceManager::getInstance()->GetTransponder(channel->getTransponderId(), ct); + CFrontend * frontend = CFEManager::getInstance()->getLiveFE(); int i = 0; transponder_list_t &select_transponders = CServiceManager::getInstance()->GetSatelliteTransponders(position); @@ -1023,10 +1027,9 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/ sprintf(cnt, "%d", i); transponder & t = tI->second; - if(!old_selected && channel && channel->getSatellitePosition() == position) { - if(channel->getFreqId() == GET_FREQ_FROM_TPID(tI->first)) - old_selected = i; - } + if(!old_selected && ct == t) + old_selected = i; + std::string tname = t.description(); CMenuForwarderNonLocalized * ts_item = new CMenuForwarderNonLocalized(tname.c_str(), true, NULL, selector, cnt, CRCInput::RC_nokey, NULL)/*, false*/; @@ -1036,7 +1039,6 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/ tmplist.insert(std::pair (i, tI->second)); i++; } - if (i == 0) { std::string text = "No transponders found for "; text += scansettings.satNameNoDiseqc;