Skip to content

Commit

Permalink
Do not display a popup that no channels were found when using IPTV.
Browse files Browse the repository at this point in the history
IPTV doesn't use transport streams; so at the end of a scan we always got the message that no new channels were found, even when we did
  • Loading branch information
jyavenard committed Jul 19, 2013
1 parent 639a1fc commit dd919dc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
14 changes: 10 additions & 4 deletions mythtv/libs/libmythtv/channelscan/channelimporter.cpp
Expand Up @@ -35,13 +35,19 @@ void ChannelImporter::Process(const ScanDTVTransportList &_transports)
{
if (use_gui)
{
LOG(VB_GENERAL, LOG_INFO, LOC + (ChannelUtil::GetChannelCount() ?
"No new channels to process" :
int channels = ChannelUtil::GetChannelCount();

LOG(VB_GENERAL, LOG_INFO, LOC + (channels ?
(m_success ?
QString("Found %1 channels").arg(channels) :
"No new channels to process") :
"No channels to process.."));

MythPopupBox::showOkPopup(
GetMythMainWindow(), QObject::tr("Channel Importer"),
ChannelUtil::GetChannelCount()
? QObject::tr("Failed to find any new channels!")
channels ?
(m_success ? QObject::tr("Found %1 channels").arg(channels) :
QObject::tr("Failed to find any new channels!"))
: QObject::tr("Failed to find any channels."));
}
else
Expand Down
8 changes: 6 additions & 2 deletions mythtv/libs/libmythtv/channelscan/channelimporter.h
Expand Up @@ -78,11 +78,13 @@ class MTV_PUBLIC ChannelImporter
public:
ChannelImporter(bool gui, bool interactive,
bool _delete, bool insert, bool save,
bool fta_only, ServiceRequirements service_requirements) :
bool fta_only, ServiceRequirements service_requirements,
bool success = false) :
use_gui(gui), is_interactive(interactive),
do_delete(_delete),
do_insert(insert), do_save(save), m_fta_only(fta_only),
m_service_requirements(service_requirements) { }
m_service_requirements(service_requirements),
m_success(success) { }

void Process(const ScanDTVTransportList&);

Expand Down Expand Up @@ -228,6 +230,8 @@ class MTV_PUBLIC ChannelImporter
bool do_save;
/// Only FreeToAir (non-encrypted) channels desired post scan?
bool m_fta_only;
/// To pass information IPTV channel scan succeeded
bool m_success;
/// Services desired post scan
ServiceRequirements m_service_requirements;
};
Expand Down
7 changes: 4 additions & 3 deletions mythtv/libs/libmythtv/channelscan/channelscanner_gui.cpp
Expand Up @@ -112,12 +112,13 @@ void ChannelScannerGUI::HandleEvent(const ScannerEvent *scanEvent)
transports = sigmonScanner->GetChannelList();
}

bool wasIPTV = iptvScanner != NULL;
Teardown();

int ret = scanEvent->intValue();
if (!transports.empty() || (MythDialog::Rejected != ret))
{
Process(transports);
Process(transports, wasIPTV);
}
}
else if (scanEvent->type() == ScannerEvent::AppendTextToLog)
Expand Down Expand Up @@ -147,10 +148,10 @@ void ChannelScannerGUI::HandleEvent(const ScannerEvent *scanEvent)
scanStage->SetStatusSignalStrength(scanEvent->intValue());
}

void ChannelScannerGUI::Process(const ScanDTVTransportList &_transports)
void ChannelScannerGUI::Process(const ScanDTVTransportList &_transports, bool success)
{
ChannelImporter ci(true, true, true, true, true,
freeToAirOnly, serviceRequirements);
freeToAirOnly, serviceRequirements, success);
ci.Process(_transports);
}

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/channelscan/channelscanner_gui.h
Expand Up @@ -67,7 +67,7 @@ class ChannelScannerGUI :

virtual void InformUser(const QString &error);

virtual void Process(const ScanDTVTransportList&);
virtual void Process(const ScanDTVTransportList&, bool success = false);

virtual void MonitorProgress(bool lock, bool strength,
bool snr, bool rotor);
Expand Down

0 comments on commit dd919dc

Please sign in to comment.