aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-01-14 17:59:32 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-01-14 17:59:32 +0000
commitcc9862b55b147eb78581813ba70d574940ac103d (patch)
tree895468d5149bb56e7f751c98ea6c42d168736e5c
parent742956672b795d0ffa44575f9a8e0255b768915c (diff)
downloadenigma2-cc9862b55b147eb78581813ba70d574940ac103d.tar.gz
enigma2-cc9862b55b147eb78581813ba70d574940ac103d.zip
display last 7 services during scan
-rw-r--r--data/skin.xml4
-rw-r--r--lib/components/scan.cpp13
-rw-r--r--lib/components/scan.h4
-rw-r--r--lib/dvb/scan.cpp17
-rw-r--r--lib/dvb/scan.h4
-rw-r--r--lib/python/Components/FIFOList.py12
-rw-r--r--lib/python/Components/Makefile.am3
7 files changed, 52 insertions, 5 deletions
diff --git a/data/skin.xml b/data/skin.xml
index 5c4482b5..a9398fd7 100644
--- a/data/skin.xml
+++ b/data/skin.xml
@@ -184,7 +184,6 @@
<widget name="ButtonGreenText" position="350,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" />
<widget name="ButtonYellow" pixmap="/usr/share/enigma2/button_yellow.png" position="430,132" size="27,12" />
<widget name="ButtonBlue" pixmap="/usr/share/enigma2/button_blue.png" position="540,132" size="27,12" />
-
</screen>
<screen name="MoviePlayer" flags="wfNoBorder" position="0,370" size="720,148" title="InfoBar">
@@ -276,9 +275,10 @@
<widget name="list" position="0,0" size="560,375" zPosition="1" scrollbarMode="showOnDemand" />
<widget name="freeDiskSpace" position="10,380" size="540,30" font="Regular;25" />
</screen>
- <screen name="ServiceScan" position="200,100" size="300,200" title="Service Scan">
+ <screen name="ServiceScan" position="200,100" size="300,300" title="Service Scan">
<widget name="scan_progress" position="10,10" size="300,20" />
<widget name="scan_state" position="10,40" size="280,60" font="Regular;20" />
+ <widget name="servicelist" position="10,110" size="280,175" selectionDisabled="1" />
</screen>
<screen name="TimerEdit" position="70,100" size="590,335" title="Timer Edit">
<widget name="description" position="10,10" size="580,40" font="Regular;25" />
diff --git a/lib/components/scan.cpp b/lib/components/scan.cpp
index bfbb02da..c21e8f4b 100644
--- a/lib/components/scan.cpp
+++ b/lib/components/scan.cpp
@@ -33,6 +33,12 @@ void eComponentScan::scanEvent(int evt)
}
}
+ if (evt == eDVBScan::evtNewService)
+ {
+ newService();
+ return;
+ }
+
if (evt == eDVBScan::evtFail)
{
eDebug("scan failed.");
@@ -137,3 +143,10 @@ int eComponentScan::getError()
{
return m_failed;
}
+
+void eComponentScan::getLastServiceName(std::string &string)
+{
+ if (!m_scan)
+ return;
+ m_scan->getLastServiceName(string);
+}
diff --git a/lib/components/scan.h b/lib/components/scan.h
index eb18f104..9ce6539f 100644
--- a/lib/components/scan.h
+++ b/lib/components/scan.h
@@ -23,6 +23,7 @@ public:
~eComponentScan();
PSignal0<void> statusChanged;
+ PSignal0<void> newService;
/* progress between 0 and 100 */
int getProgress();
@@ -33,6 +34,9 @@ public:
/* true when done or error */
int isDone();
+ /* get last added service */
+ void getLastServiceName(std::string &SWIG_OUTPUT);
+
int getError();
void clear();
diff --git a/lib/dvb/scan.cpp b/lib/dvb/scan.cpp
index ba63ed9f..7f4f6b10 100644
--- a/lib/dvb/scan.cpp
+++ b/lib/dvb/scan.cpp
@@ -375,6 +375,7 @@ void eDVBScan::start(const eSmartPtrList<iDVBFrontendParameters> &known_transpon
m_ch_unavailable.clear();
m_new_channels.clear();
m_new_services.clear();
+ m_last_service = m_new_services.end();
for (eSmartPtrList<iDVBFrontendParameters>::const_iterator i(known_transponders.begin()); i != known_transponders.end(); ++i)
{
@@ -469,7 +470,13 @@ RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescription
}
}
- m_new_services.insert(std::pair<eServiceReferenceDVB, ePtr<eDVBService> >(ref, service));
+ std::pair<std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator, bool> i = m_new_services.insert(std::pair<eServiceReferenceDVB, ePtr<eDVBService> >(ref, service));
+
+ if (i.second)
+ {
+ m_last_service = i.first;
+ m_event(evtNewService);
+ }
}
return 0;
}
@@ -486,3 +493,11 @@ void eDVBScan::getStats(int &transponders_done, int &transponders_total, int &se
transponders_total = m_ch_toScan.size() + transponders_done;
services = m_new_services.size();
}
+
+void eDVBScan::getLastServiceName(std::string &last_service_name)
+{
+ if (m_last_service == m_new_services.end())
+ last_service_name = "";
+ else
+ last_service_name = m_last_service->second->m_service_name;
+}
diff --git a/lib/dvb/scan.h b/lib/dvb/scan.h
index 11d0efdc..2756fb12 100644
--- a/lib/dvb/scan.h
+++ b/lib/dvb/scan.h
@@ -40,6 +40,7 @@ private:
std::map<eDVBChannelID, ePtr<iDVBFrontendParameters> > m_new_channels;
std::map<eServiceReferenceDVB, ePtr<eDVBService> > m_new_services;
+ std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator m_last_service;
std::list<ePtr<iDVBFrontendParameters> > m_ch_toScan, m_ch_scanned, m_ch_unavailable;
ePtr<iDVBFrontendParameters> m_ch_current;
@@ -70,11 +71,12 @@ public:
enum { scanNetworkSearch = 1, scanSearchBAT = 2 };
void start(const eSmartPtrList<iDVBFrontendParameters> &known_transponders, int flags);
- enum { evtUpdate, evtFinish, evtFail };
+ enum { evtUpdate, evtNewService, evtFinish, evtFail };
RESULT connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &connection);
void insertInto(iDVBChannelList *db);
void getStats(int &transponders_done, int &transponders_total, int &services);
+ void getLastServiceName(std::string &name);
};
#endif
diff --git a/lib/python/Components/FIFOList.py b/lib/python/Components/FIFOList.py
new file mode 100644
index 00000000..16b51c89
--- /dev/null
+++ b/lib/python/Components/FIFOList.py
@@ -0,0 +1,12 @@
+from Components.MenuList import MenuList
+
+class FIFOList(MenuList):
+ def __init__(self, list = [ ], len = 10):
+ self.len = len
+ self.list = list
+ MenuList.__init__(self, self.list)
+
+ def addItem(self, item):
+ self.list.append(item)
+ self.list = self.list[-self.len:]
+ self.l.setList(self.list)
diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am
index 9826daab..fcb5f8fd 100644
--- a/lib/python/Components/Makefile.am
+++ b/lib/python/Components/Makefile.am
@@ -11,4 +11,5 @@ install_PYTHON = \
AVSwitch.py Network.py RFmod.py DiskInfo.py NimManager.py Lcd.py \
EpgList.py ScrollLabel.py Timezones.py Language.py HelpMenuList.py \
BlinkingPixmap.py Pixmap.py ConditionalWidget.py Slider.py LanguageList.py \
- PluginList.py PluginComponent.py RecordingConfig.py About.py UsageConfig.py
+ PluginList.py PluginComponent.py RecordingConfig.py About.py UsageConfig.py \
+ FIFOList.py