Merge commit 'origin/pootle-import' into experimental
authoracid-burn <acid-burn@opendreambox.org>
Mon, 15 Nov 2010 12:20:26 +0000 (13:20 +0100)
committeracid-burn <acid-burn@opendreambox.org>
Mon, 15 Nov 2010 12:20:26 +0000 (13:20 +0100)
21 files changed:
data/defaults/Dream/Makefile.am
data/defaults/Dream/dm7020hd.info [new file with mode: 0644]
data/defaults/Dream/settings.7020hd [new file with mode: 0644]
data/skin.xml
data/skin_default.xml
lib/dvb/demux.cpp
lib/dvb/epgcache.cpp
lib/dvb/epgcache.h
lib/gdi/picload.cpp
lib/gui/elistboxcontent.cpp
lib/gui/ewindowstyle.cpp
lib/python/Components/ParentalControlList.py
lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py
lib/python/Plugins/SystemPlugins/TempFanControl/meta/plugin_tempfancontrol.xml
lib/python/Plugins/SystemPlugins/VideoEnhancement/meta/plugin_videoenhancement.xml
lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
lib/python/Screens/ChannelSelection.py
lib/python/Screens/ParentalControlSetup.py
lib/python/Screens/ScanSetup.py
mytest.py

index cda5583..1758f67 100644 (file)
@@ -6,11 +6,13 @@ dist_install_DATA = \
        bouquets.tv \
        dm800se.info \
        dm500hd.info \
+       dm7020hd.info \
        dm7025.info \
        dm8000.info \
        dm800.info \
        settings.800se \
        settings.500hd \
+       settings.7020hd \
        settings.7025 \
        settings.800 \
        settings.8000
diff --git a/data/defaults/Dream/dm7020hd.info b/data/defaults/Dream/dm7020hd.info
new file mode 100644 (file)
index 0000000..3af4679
--- /dev/null
@@ -0,0 +1,26 @@
+<default>
+       <prerequisites>
+               <!-- hardware can occur more than once -->
+               <hardware type="dm7020hd" />
+       </prerequisites>
+       
+       <info>
+               <author>Dream Multimedia GmbH</author>
+               <name>Dream Multimedia Default</name>
+       </info>
+
+               <!-- available types: "directories" -->
+       <files type="directories">
+               <!--file type="skin" directory="test_skin/" flag="default" name="Default Skin" /-->
+               <file type="config" name="settings.7020hd" />
+               <!--file type="services" name="lamedb.192">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <satellite type="192" />
+                       </prerequisites>
+               </file-->
+               <file type="favourites" directory="" name="bouquets.tv" />              
+               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv" />
+               <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
+       </files>
+</default>
diff --git a/data/defaults/Dream/settings.7020hd b/data/defaults/Dream/settings.7020hd
new file mode 100644 (file)
index 0000000..ae2963b
--- /dev/null
@@ -0,0 +1 @@
+config.misc.rcused=1
\ No newline at end of file
index 868fbc4..b4b6cbc 100755 (executable)
                        <pixmap pos="bpBottomRight" filename="skin_default/b_br.png" />
                </borderset>
        </windowstyle>
-       <!-- Main screen colors (id=1 LCD) -->
-       <windowstyle type="skinned" id="1">
-               <color name="Background" color="#000000" />
-               <color name="LabelForeground" color="#ffffff" />
-               <color name="ListboxBackground" color="#000000" />
-               <color name="ListboxForeground" color="#ffffff" />
-               <color name="ListboxSelectedBackground" color="#000000" />
-               <color name="ListboxSelectedForeground" color="#ffffff" />
-               <color name="ListboxMarkedBackground" color="#000000" />
-               <color name="ListboxMarkedForeground" color="#ffffff" />
-               <color name="ListboxMarkedAndSelectedBackground" color="#000000" />
-               <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
-               <color name="WindowTitleForeground" color="#ffffff" />
-               <color name="WindowTitleBackground" color="#000000" />
-       </windowstyle>
-       <windowstyle type="skinned" id="2">
-               <color name="Background" color="#000000" />
-               <color name="LabelForeground" color="#ffffff" />
-               <color name="ListboxBackground" color="#000000" />
-               <color name="ListboxForeground" color="#ffffff" />
-               <color name="ListboxSelectedBackground" color="#000000" />
-               <color name="ListboxSelectedForeground" color="#ffffff" />
-               <color name="ListboxMarkedBackground" color="#000000" />
-               <color name="ListboxMarkedForeground" color="#ffffff" />
-               <color name="ListboxMarkedAndSelectedBackground" color="#000000" />
-               <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
-               <color name="WindowTitleForeground" color="#ffffff" />
-               <color name="WindowTitleBackground" color="#000000" />
-       </windowstyle>
        <!-- Fonts -->
        <fonts>
                <!-- <font filename="md_khmurabi_10.ttf" name="Regular" scale="90" /> -->
index e5b3132..272fdcf 100755 (executable)
@@ -1,4 +1,34 @@
 <skin>
+       <!-- Main screen colors (id=1 LCD) -->
+       <windowstyle type="skinned" id="1">
+               <color name="Background" color="#000000" />
+               <color name="LabelForeground" color="#ffffff" />
+               <color name="ListboxBackground" color="#000000" />
+               <color name="ListboxForeground" color="#ffffff" />
+               <color name="ListboxSelectedBackground" color="#000000" />
+               <color name="ListboxSelectedForeground" color="#ffffff" />
+               <color name="ListboxMarkedBackground" color="#000000" />
+               <color name="ListboxMarkedForeground" color="#ffffff" />
+               <color name="ListboxMarkedAndSelectedBackground" color="#000000" />
+               <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
+               <color name="WindowTitleForeground" color="#ffffff" />
+               <color name="WindowTitleBackground" color="#000000" />
+       </windowstyle>
+       <!-- Main screen colors (id=2 Color OLED (dm800se)) -->
+       <windowstyle type="skinned" id="2">
+               <color name="Background" color="#000000" />
+               <color name="LabelForeground" color="#ffffff" />
+               <color name="ListboxBackground" color="#000000" />
+               <color name="ListboxForeground" color="#ffffff" />
+               <color name="ListboxSelectedBackground" color="#000000" />
+               <color name="ListboxSelectedForeground" color="#ffffff" />
+               <color name="ListboxMarkedBackground" color="#000000" />
+               <color name="ListboxMarkedForeground" color="#ffffff" />
+               <color name="ListboxMarkedAndSelectedBackground" color="#000000" />
+               <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
+               <color name="WindowTitleForeground" color="#ffffff" />
+               <color name="WindowTitleBackground" color="#000000" />
+       </windowstyle>
        <!-- Screwed Stone II skin (skin_default.xml) /Nemesis -->
        <!-- About screen -->
        <screen name="About" position="center,center" size="420,350" title="About">
index 081059b..0c736c5 100644 (file)
@@ -648,18 +648,36 @@ RESULT eDVBTSRecorder::setBoundary(off_t max)
 
 RESULT eDVBTSRecorder::stop()
 {
+       int state=3;
+
        for (std::map<int,int>::iterator i(m_pids.begin()); i != m_pids.end(); ++i)
                stopPID(i->first);
 
        if (!m_running)
                return -1;
+
+#if HAVE_DVB_API_VERSION >= 5
+       /* workaround for record thread stop */
+       if (::ioctl(m_source_fd, DMX_STOP) < 0)
+               perror("DMX_STOP");
+       else
+               state &= ~1;
+
+       if (::close(m_source_fd) < 0)
+               perror("close");
+       else
+               state &= ~2;
+#endif
+
        m_thread->stop();
-       
-       close(m_source_fd);
+
+       if (state & 3)
+               ::close(m_source_fd);
+
+       m_running = 0;
        m_source_fd = -1;
-       
+
        m_thread->stopSaveMetaInformation();
-       
        return 0;
 }
 
index 119223a..8ac0c71 100644 (file)
@@ -213,9 +213,9 @@ pthread_mutex_t eEPGCache::channel_map_lock=
 DEFINE_REF(eEPGCache)
 
 eEPGCache::eEPGCache()
-       :messages(this,1), cleanTimer(eTimer::create(this))//, paused(0)
+       :messages(this,1), cleanTimer(eTimer::create(this)), m_running(0)//, paused(0)
 {
-       eDebug("[EPGC] Initialized EPGCache");
+       eDebug("[EPGC] Initialized EPGCache (wait for setCacheFile call now)");
 
        CONNECT(messages.recv_msg, eEPGCache::gotMessage);
        CONNECT(eDVBLocalTimeHandler::getInstance()->m_timeUpdated, eEPGCache::timeUpdated);
@@ -226,22 +226,46 @@ eEPGCache::eEPGCache()
        if (!res_mgr)
                eDebug("[eEPGCache] no resource manager !!!!!!!");
        else
-       {
                res_mgr->connectChannelAdded(slot(*this,&eEPGCache::DVBChannelAdded), m_chanAddedConn);
+
+       instance=this;
+       memset(m_filename, 0, sizeof(m_filename));
+}
+
+void eEPGCache::setCacheFile(const char *path)
+{
+       bool inited = !!strlen(m_filename);
+       strncpy(m_filename, path, 1024);
+       if (!inited)
+       {
+               eDebug("[EPGC] setCacheFile read/write epg data from/to '%s'", m_filename);
                if (eDVBLocalTimeHandler::getInstance()->ready())
                        timeUpdated();
        }
-       instance=this;
 }
 
 void eEPGCache::timeUpdated()
 {
-       if (!sync())
+       if (strlen(m_filename))
        {
-               eDebug("[EPGC] time updated.. start EPG Mainloop");
-               run();
-       } else
-               messages.send(Message(Message::timeChanged));
+               if (!sync())
+               {
+                       eDebug("[EPGC] time updated.. start EPG Mainloop");
+                       run();
+                       singleLock s(channel_map_lock);
+                       channelMapIterator it = m_knownChannels.begin();
+                       for (; it != m_knownChannels.end(); ++it)
+                       {
+                               if (it->second->state == -1) {
+                                       it->second->state=0;
+                                       messages.send(Message(Message::startChannel, it->second));
+                               }
+                       }
+               } else
+                       messages.send(Message(Message::timeChanged));
+       }
+       else
+               eDebug("[EPGC] time updated.. but cache file not set yet.. dont start epg!!");
 }
 
 void eEPGCache::DVBChannelAdded(eDVBChannel *chan)
@@ -337,8 +361,11 @@ void eEPGCache::DVBChannelRunning(iDVBChannel *chan)
                                        return;
                                }
 #endif
-                               messages.send(Message(Message::startChannel, chan));
-                               // -> gotMessage -> changedService
+                               if (m_running) {
+                                       data.state=0;
+                                       messages.send(Message(Message::startChannel, chan));
+                                       // -> gotMessage -> changedService
+                               }
                        }
                }
        }
@@ -365,7 +392,8 @@ void eEPGCache::DVBChannelStateChanged(iDVBChannel *chan)
                                case iDVBChannel::state_release:
                                {
                                        eDebug("[eEPGCache] remove channel %p", chan);
-                                       messages.send(Message(Message::leaveChannel, chan));
+                                       if (it->second->state >= 0)
+                                               messages.send(Message(Message::leaveChannel, chan));
                                        pthread_mutex_lock(&it->second->channel_active);
                                        singleLock s(channel_map_lock);
                                        m_knownChannels.erase(it);
@@ -953,39 +981,24 @@ void eEPGCache::gotMessage( const Message &msg )
 void eEPGCache::thread()
 {
        hasStarted();
+       m_running=1;
        nice(4);
        load();
        cleanLoop();
        runLoop();
        save();
+       m_running=0;
 }
 
 void eEPGCache::load()
 {
-       FILE *f = fopen("/hdd/epg.dat", "r");
+       FILE *f = fopen(m_filename, "r");
        if (f)
        {
-               unlink("/hdd/epg.dat");
+               unlink(m_filename);
                int size=0;
                int cnt=0;
-#if 0
-               unsigned char md5_saved[16];
-               unsigned char md5[16];
-               bool md5ok=false;
 
-               if (!md5_file("/hdd/epg.dat", 1, md5))
-               {
-                       FILE *f = fopen("/hdd/epg.dat.md5", "r");
-                       if (f)
-                       {
-                               fread( md5_saved, 16, 1, f);
-                               fclose(f);
-                               if ( !memcmp(md5_saved, md5, 16) )
-                                       md5ok=true;
-                       }
-               }
-               if ( md5ok )
-#endif
                {
                        unsigned int magic=0;
                        fread( &magic, sizeof(int), 1, f);
@@ -1027,7 +1040,7 @@ void eEPGCache::load()
                                        eventDB[key]=std::pair<eventMap,timeMap>(evMap,tmMap);
                                }
                                eventData::load(f);
-                               eDebug("[EPGC] %d events read from /hdd/epg.dat", cnt);
+                               eDebug("[EPGC] %d events read from %s", cnt, m_filename);
 #ifdef ENABLE_PRIVATE_EPG
                                char text2[11];
                                fread( text2, 11, 1, f);
@@ -1075,103 +1088,106 @@ void eEPGCache::load()
 
 void eEPGCache::save()
 {
-       struct statfs s;
-       off64_t tmp;
-       if (statfs("/hdd", &s)<0)
-               tmp=0;
-       else
+       /* create empty file */
+       FILE *f = fopen(m_filename, "w");
+
+       if (!f)
+       {
+               eDebug("[EPGC] couldn't save epg data to '%s'(%m)", m_filename);
+               return;
+       }
+
+       char *buf = realpath(m_filename, NULL);
+       if (!buf)
        {
-               tmp=s.f_blocks;
-               tmp*=s.f_bsize;
+               eDebug("[EPGC] realpath to '%s' failed in save (%m)", m_filename);
+               fclose(f);
+               return;
        }
 
-       // prevent writes to builtin flash
-       if ( tmp < 1024*1024*50 ) // storage size < 50MB
+       eDebug("[EPGC] store epg to realpath '%s'", buf);
+
+       struct statfs s;
+       off64_t tmp;
+       if (statfs(buf, &s) < 0) {
+               eDebug("[EPGC] statfs '%s' failed in save (%m)", buf);
+               fclose(f);
                return;
+       }
+
+       free(buf);
 
        // check for enough free space on storage
        tmp=s.f_bfree;
        tmp*=s.f_bsize;
        if ( tmp < (eventData::CacheSize*12)/10 ) // 20% overhead
+       {
+               eDebug("[EPGC] not enough free space at path '%s' %lld bytes availd but %d needed", buf, tmp, (eventData::CacheSize*12)/10);
+               fclose(f);
                return;
+       }
 
-       FILE *f = fopen("/hdd/epg.dat", "w");
        int cnt=0;
-       if ( f )
-       {
-               unsigned int magic = 0x98765432;
-               fwrite( &magic, sizeof(int), 1, f);
-               const char *text = "UNFINISHED_V7";
-               fwrite( text, 13, 1, f );
-               int size = eventDB.size();
-               fwrite( &size, sizeof(int), 1, f );
-               for (eventCache::iterator service_it(eventDB.begin()); service_it != eventDB.end(); ++service_it)
-               {
-                       timeMap &timemap = service_it->second.second;
-                       fwrite( &service_it->first, sizeof(uniqueEPGKey), 1, f);
-                       size = timemap.size();
-                       fwrite( &size, sizeof(int), 1, f);
-                       for (timeMap::iterator time_it(timemap.begin()); time_it != timemap.end(); ++time_it)
-                       {
-                               __u8 len = time_it->second->ByteSize;
-                               fwrite( &time_it->second->type, sizeof(__u8), 1, f );
-                               fwrite( &len, sizeof(__u8), 1, f);
-                               fwrite( time_it->second->EITdata, len, 1, f);
-                               ++cnt;
-                       }
+       unsigned int magic = 0x98765432;
+       fwrite( &magic, sizeof(int), 1, f);
+       const char *text = "UNFINISHED_V7";
+       fwrite( text, 13, 1, f );
+       int size = eventDB.size();
+       fwrite( &size, sizeof(int), 1, f );
+       for (eventCache::iterator service_it(eventDB.begin()); service_it != eventDB.end(); ++service_it)
+       {
+               timeMap &timemap = service_it->second.second;
+               fwrite( &service_it->first, sizeof(uniqueEPGKey), 1, f);
+               size = timemap.size();
+               fwrite( &size, sizeof(int), 1, f);
+               for (timeMap::iterator time_it(timemap.begin()); time_it != timemap.end(); ++time_it)
+               {
+                       __u8 len = time_it->second->ByteSize;
+                       fwrite( &time_it->second->type, sizeof(__u8), 1, f );
+                       fwrite( &len, sizeof(__u8), 1, f);
+                       fwrite( time_it->second->EITdata, len, 1, f);
+                       ++cnt;
                }
-               eDebug("[EPGC] %d events written to /hdd/epg.dat", cnt);
-               eventData::save(f);
+       }
+       eDebug("[EPGC] %d events written to %s", cnt, m_filename);
+       eventData::save(f);
 #ifdef ENABLE_PRIVATE_EPG
-               const char* text3 = "PRIVATE_EPG";
-               fwrite( text3, 11, 1, f );
-               size = content_time_tables.size();
+       const char* text3 = "PRIVATE_EPG";
+       fwrite( text3, 11, 1, f );
+       size = content_time_tables.size();
+       fwrite( &size, sizeof(int), 1, f);
+       for (contentMaps::iterator a = content_time_tables.begin(); a != content_time_tables.end(); ++a)
+       {
+               contentMap &content_time_table = a->second;
+               fwrite( &a->first, sizeof(uniqueEPGKey), 1, f);
+               int size = content_time_table.size();
                fwrite( &size, sizeof(int), 1, f);
-               for (contentMaps::iterator a = content_time_tables.begin(); a != content_time_tables.end(); ++a)
+               for (contentMap::iterator i = content_time_table.begin(); i != content_time_table.end(); ++i )
                {
-                       contentMap &content_time_table = a->second;
-                       fwrite( &a->first, sizeof(uniqueEPGKey), 1, f);
-                       int size = content_time_table.size();
+                       int size = i->second.size();
+                       fwrite( &i->first, sizeof(int), 1, f);
                        fwrite( &size, sizeof(int), 1, f);
-                       for (contentMap::iterator i = content_time_table.begin(); i != content_time_table.end(); ++i )
-                       {
-                               int size = i->second.size();
-                               fwrite( &i->first, sizeof(int), 1, f);
-                               fwrite( &size, sizeof(int), 1, f);
-                               for ( contentTimeMap::iterator it(i->second.begin());
-                                       it != i->second.end(); ++it )
-                               {
-                                       fwrite( &it->first, sizeof(time_t), 1, f);
-                                       fwrite( &it->second.first, sizeof(time_t), 1, f);
-                                       fwrite( &it->second.second, sizeof(__u16), 1, f);
-                               }
-                       }
-               }
-#endif
-               // write version string after binary data
-               // has been written to disk.
-               fsync(fileno(f));
-               fseek(f, sizeof(int), SEEK_SET);
-               fwrite("ENIGMA_EPG_V7", 13, 1, f);
-               fclose(f);
-#if 0
-               unsigned char md5[16];
-               if (!md5_file("/hdd/epg.dat", 1, md5))
-               {
-                       FILE *f = fopen("/hdd/epg.dat.md5", "w");
-                       if (f)
+                       for ( contentTimeMap::iterator it(i->second.begin());
+                               it != i->second.end(); ++it )
                        {
-                               fwrite( md5, 16, 1, f);
-                               fclose(f);
+                               fwrite( &it->first, sizeof(time_t), 1, f);
+                               fwrite( &it->second.first, sizeof(time_t), 1, f);
+                               fwrite( &it->second.second, sizeof(__u16), 1, f);
                        }
                }
-#endif
        }
+#endif
+       // write version string after binary data
+       // has been written to disk.
+       fsync(fileno(f));
+       fseek(f, sizeof(int), SEEK_SET);
+       fwrite("ENIGMA_EPG_V7", 13, 1, f);
+       fclose(f);
 }
 
 eEPGCache::channel_data::channel_data(eEPGCache *ml)
        :cache(ml)
-       ,abortTimer(eTimer::create(ml)), zapTimer(eTimer::create(ml)), state(0)
+       ,abortTimer(eTimer::create(ml)), zapTimer(eTimer::create(ml)), state(-1)
        ,isRunning(0), haveData(0)
 #ifdef ENABLE_PRIVATE_EPG
        ,startPrivateTimer(eTimer::create(ml))
index 4d45d87..90aff6c 100644 (file)
@@ -177,7 +177,8 @@ class eEPGCache: public eMainloop, private eThread, public Object
                eEPGCache *cache;
                ePtr<eTimer> abortTimer, zapTimer;
                int prevChannelState;
-               __u8 state, isRunning, haveData;
+               int state;
+               __u8 isRunning, haveData;
                ePtr<eDVBChannel> channel;
                ePtr<eConnection> m_stateChangedConn, m_NowNextConn, m_ScheduleConn, m_ScheduleOtherConn, m_ViasatConn;
                ePtr<iDVBSectionReader> m_NowNextReader, m_ScheduleReader, m_ScheduleOtherReader, m_ViasatReader;
@@ -290,6 +291,8 @@ private:
        void thread();  // thread function
 
 // called from epgcache thread
+       int m_running;
+       char m_filename[1024];
        void save();
        void load();
 #ifdef ENABLE_PRIVATE_EPG
@@ -325,6 +328,9 @@ public:
 #endif
 
 #endif
+       // must be called once!
+       void setCacheFile(const char *filename);
+
        // called from main thread
        inline void Lock();
        inline void Unlock();
index c162f89..7fabef5 100644 (file)
@@ -671,6 +671,7 @@ void ePicLoad::decodeThumb()
                                m_filepara->id = F_JPEG;
                                eDebug("[Picload] Cache File found");
                        }
+                       fclose(f);
                }
        }
 
index 43fbc59..97e2cc6 100644 (file)
@@ -967,6 +967,9 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                if (ppixmap)
                                {
                                        ePtr<gPixmap> pixmap;
+                                       if (PyInt_Check(ppixmap) && data) /* if the pixmap is in fact a number, it refers to the data list */
+                                               ppixmap = PyTuple_GetItem(data, PyInt_AsLong(ppixmap));
+
                                        if (SwigFromPython(pixmap, ppixmap))
                                        {
                                                eDebug("eListboxPythonMultiContent (Pixmap) get pixmap failed");
index 68a74e0..0ecdc2a 100644 (file)
@@ -28,7 +28,9 @@ eWindowStyleManager::~eWindowStyleManager()
 
 void eWindowStyleManager::getStyle(int style_id, ePtr<eWindowStyle> &style)
 {
-       style = m_current_style[style_id];
+       std::map<int, ePtr<eWindowStyle> >::iterator it = m_current_style.find(style_id);
+       ASSERT(it != m_current_style.end());
+       style = it->second;
 }
 
 void eWindowStyleManager::setStyle(int style_id, eWindowStyle *style)
index 797ea39..0e65257 100644 (file)
@@ -1,5 +1,5 @@
 from MenuList import MenuList
-from Components.ParentalControl import parentalControl, IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET
+from Components.ParentalControl import IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET
 from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
 
 from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
@@ -32,13 +32,14 @@ class ParentalControlList(MenuList):
                self.l.setItemHeight(32)
 
        def toggleSelectedLock(self):
+               from Components.ParentalControl import parentalControl
                print "self.l.getCurrentSelection():", self.l.getCurrentSelection()
                print "self.l.getCurrentSelectionIndex():", self.l.getCurrentSelectionIndex()
                curSel = self.l.getCurrentSelection()
                if curSel[0][2]:
                        parentalControl.unProtectService(self.l.getCurrentSelection()[0][0])
                else:
-                       parentalControl.protectService(self.l.getCurrentSelection()[0][0])      
+                       parentalControl.protectService(self.l.getCurrentSelection()[0][0])
                #Instead of just negating the locked- flag, now I call the getProtectionType every time...
                self.list[self.l.getCurrentSelectionIndex()] = ParentalControlEntryComponent(curSel[0][0], curSel[0][1], parentalControl.getProtectionType(curSel[0][0]))
                self.l.setList(self.list)
index 00608ee..707663a 100755 (executable)
@@ -1679,6 +1679,7 @@ class PacketManager(Screen, NumericalTextInput):
                self.list_updating = True
                self.packetlist = []
                self.installed_packetlist = {}
+               self.upgradeable_packages = {}
                self.Console = Console()
                self.cmdList = []
                self.cachelist = []
@@ -1686,6 +1687,7 @@ class PacketManager(Screen, NumericalTextInput):
                self.cache_file = '/usr/lib/enigma2/python/Plugins/SystemPlugins/SoftwareManager/packetmanager.cache' #Path to cache directory   
                self.oktext = _("\nAfter pressing OK, please wait!")
                self.unwanted_extensions = ('-dbg', '-dev', '-doc', 'busybox')
+               self.opkgAvail = fileExists('/usr/bin/opkg')
 
                self.ipkg = IpkgComponent()
                self.ipkg.addCallback(self.ipkgCallback)
@@ -1847,14 +1849,19 @@ class PacketManager(Screen, NumericalTextInput):
        def IpkgList_Finished(self, result, retval, extra_args = None):
                if result:
                        self.packetlist = []
+                       last_name = ""
                        for x in result.splitlines():
-                               tokens = x.split(' - ')   #self.blacklisted_packages
+                               tokens = x.split(' - ') 
                                name = tokens[0].strip()
                                if not any(name.endswith(x) for x in self.unwanted_extensions):
                                        l = len(tokens)
                                        version = l > 1 and tokens[1].strip() or ""
                                        descr = l > 2 and tokens[2].strip() or ""
+                                       if name == last_name:
+                                               continue
+                                       last_name = name 
                                        self.packetlist.append([name, version, descr])
+
                if not self.Console:
                        self.Console = Console()
                cmd = "ipkg list_installed"
@@ -1864,30 +1871,47 @@ class PacketManager(Screen, NumericalTextInput):
                if result:
                        self.installed_packetlist = {}
                        for x in result.splitlines():
-                               tokens = x.split(' - ')   #self.blacklisted_packages
+                               tokens = x.split(' - ')
                                name = tokens[0].strip()
                                if not any(name.endswith(x) for x in self.unwanted_extensions):
                                        l = len(tokens)
                                        version = l > 1 and tokens[1].strip() or ""
                                        self.installed_packetlist[name] = version
-               self.buildPacketList()
+               if self.opkgAvail:
+                       if not self.Console:
+                               self.Console = Console()
+                       cmd = "opkg list-upgradable"
+                       self.Console.ePopen(cmd, self.OpkgListUpgradeable_Finished)
+               else:
+                       self.buildPacketList()
 
+       def OpkgListUpgradeable_Finished(self, result, retval, extra_args = None):
+               if result:
+                       self.upgradeable_packages = {}
+                       for x in result.splitlines():
+                               tokens = x.split(' - ')
+                               name = tokens[0].strip()
+                               if not any(name.endswith(x) for x in self.unwanted_extensions):
+                                       l = len(tokens)
+                                       version = l > 2 and tokens[2].strip() or ""
+                                       self.upgradeable_packages[name] = version
+               self.buildPacketList()
+       
        def buildEntryComponent(self, name, version, description, state):
                divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png"))
                if state == 'installed':
                        installedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installed.png"))
-                       return((name, version, description, state, installedpng, divpng))       
+                       return((name, version, _(description), state, installedpng, divpng))    
                elif state == 'upgradeable':
                        upgradeablepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgradeable.png"))
-                       return((name, version, description, state, upgradeablepng, divpng))     
+                       return((name, version, _(description), state, upgradeablepng, divpng))  
                else:
                        installablepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installable.png"))
-                       return((name, version, description, state, installablepng, divpng))
+                       return((name, version, _(description), state, installablepng, divpng))
 
        def buildPacketList(self):
                self.list = []
                self.cachelist = []
-
                if self.cache_ttl > 0 and self.vc != 0:
                        print 'Loading packagelist cache from ',self.cache_file
                        try:
@@ -1903,24 +1927,28 @@ class PacketManager(Screen, NumericalTextInput):
                        print 'rebuilding fresh package list'
                        for x in self.packetlist:
                                status = ""
-                               if self.installed_packetlist.has_key(x[0].strip()):
-                                       if self.installed_packetlist[x[0].strip()] == x[1].strip():
-                                               status = "installed"
-                                               self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status))
+                               if self.installed_packetlist.has_key(x[0]):
+                                       if self.opkgAvail:
+                                               if self.upgradeable_packages.has_key(x[0]):
+                                                       status = "upgradeable"
+                                               else:
+                                                       status = "installed"
                                        else:
-                                               status = "upgradeable"
-                                               self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status))
+                                               if self.installed_packetlist[x[0]] == x[1]:
+                                                       status = "installed"
+                                               else:
+                                                       status = "upgradeable"
                                else:
                                        status = "installable"
-                                       self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status))
-                               if not any(x[0].strip().endswith(x) for x in self.unwanted_extensions):
-                                       self.cachelist.append([x[0].strip(), x[1].strip(), x[2].strip(), status])
+                               self.list.append(self.buildEntryComponent(x[0], x[1], x[2], status))    
+                               self.cachelist.append([x[0], x[1], x[2], status])
                        write_cache(self.cache_file, self.cachelist)
                        self['list'].setList(self.list)
 
        def reloadPluginlist(self):
                plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
 
+
 class IpkgInstaller(Screen):
        skin = """
                <screen name="IpkgInstaller" position="center,center" size="550,450" title="Install extensions" >
index a0bb5fa..5c6565a 100755 (executable)
@@ -2,6 +2,8 @@
          <prerequisites>
                     <hardware type="dm8000" />
                     <hardware type="dm500hd" />
+                    <hardware type="dm800se" />
+                    <hardware type="dm7020hd" />
                     <tag type="System" />
          </prerequisites>
           <info>
index 11b0c59..f52b4da 100755 (executable)
@@ -3,6 +3,8 @@
                     <hardware type="dm8000" />
                     <hardware type="dm800" />
                     <hardware type="dm500hd" />
+                    <hardware type="dm800se" />
+                    <hardware type="dm7020hd" />
                     <tag type="Display" />
                     <tag type="System" />
          </prerequisites>
index 59c5047..dc4e8c5 100644 (file)
@@ -239,9 +239,9 @@ class VideoHardware:
                portlist = self.getPortList()
                for port in portlist:
                        descr = port
-                       if descr == 'DVI' and hw_type in ('dm500hd', 'dm800se'):
+                       if descr == 'DVI' and hw_type in ('dm500hd', 'dm800se', 'dm7020hd'):
                                descr = 'HDMI'
-                       elif descr == 'DVI-PC' and hw_type in ('dm500hd', 'dm800se'):
+                       elif descr == 'DVI-PC' and hw_type in ('dm500hd', 'dm800se', 'dm7020hd'):
                                descr = 'HDMI-PC'
                        lst.append((port, descr))
 
index 9b9044e..18e8176 100755 (executable)
@@ -90,7 +90,7 @@ class VideoWizard(WizardLanguage, Rc):
                for port in self.hw.getPortList():
                        if self.hw.isPortUsed(port):
                                descr = port
-                               if descr == 'DVI' and hw_type in ('dm500hd', 'dm800se'):
+                               if descr == 'DVI' and hw_type in ('dm500hd', 'dm800se', 'dm7020hd'):
                                        descr = 'HDMI'
                                if port != "DVI-PC":
                                        list.append((descr,port))
@@ -108,7 +108,7 @@ class VideoWizard(WizardLanguage, Rc):
                self.inputSelect(self.selection)
                if self["portpic"].instance is not None:
                        picname = self.selection
-                       if picname == "DVI" and HardwareInfo().get_device_name() in ("dm500hd", "dm800se"):
+                       if picname == "DVI" and HardwareInfo().get_device_name() in ("dm500hd", "dm800se", "dm7020hd"):
                                picname = "HDMI"
                        self["portpic"].instance.setPixmapFromFile(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/" + picname + ".png"))
                
index c872bce..34316f0 100644 (file)
@@ -76,7 +76,7 @@ def append_when_current_valid(current, menu, args, level = 0, key = ""):
 
 class ChannelContextMenu(Screen):
        def __init__(self, session, csel):
-               from Components.ParentalControl import parentalControl
+
                Screen.__init__(self, session)
                #raise Exception("we need a better summary screen here")
                self.csel = csel
@@ -106,6 +106,7 @@ class ChannelContextMenu(Screen):
                                isPlayable = not (current_sel_flags & (eServiceReference.isMarker|eServiceReference.isDirectory))
                                if isPlayable:
                                        if config.ParentalControl.configured.value:
+                                               from Components.ParentalControl import parentalControl
                                                if parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1:
                                                        append_when_current_valid(current, menu, (_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())), level = 0)
                                                else:
@@ -191,6 +192,7 @@ class ChannelContextMenu(Screen):
                self.close()
 
        def addParentalProtection(self, service):
+               from Components.ParentalControl import parentalControl
                parentalControl.protectService(service.toCompareString())
                self.close()
 
@@ -199,6 +201,7 @@ class ChannelContextMenu(Screen):
 
        def pinEntered(self, service, result):
                if result:
+                       from Components.ParentalControl import parentalControl
                        parentalControl.unProtectService(service)
                        self.close()
                else:
index f174b58..284294f 100644 (file)
@@ -3,7 +3,7 @@ from Components.ConfigList import ConfigListScreen
 from Components.ActionMap import NumberActionMap
 from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN
 from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList 
-from Components.ParentalControl import parentalControl
+
 from Components.Sources.StaticText import StaticText
 from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
@@ -119,6 +119,7 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen):
                elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
                        self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
                elif self["config"].l.getCurrentSelection() == self.reloadLists:
+                       from Components.ParentalControl import parentalControl
                        parentalControl.open()
                else:
                        ConfigListScreen.keyRight(self)
@@ -255,6 +256,7 @@ class ParentalControlEditor(Screen):
                self.session.openWithCallback(self.letterChosen, ChoiceBox, title=_("Show services beginning with"), list=mylist, keys = [], selection = sel)
 
        def letterChosen(self, result):
+               from Components.ParentalControl import parentalControl
                if result is not None:
                        print "result:", result
                        self.currentLetter = result[1]
@@ -284,6 +286,7 @@ class ParentalControlBouquetEditor(Screen):
                }, -1)
 
        def cancel(self):
+               from Components.ParentalControl import parentalControl
                parentalControl.save()
                self.close()
 
@@ -300,6 +303,7 @@ class ParentalControlBouquetEditor(Screen):
                        self.bouquetlist = list.getContent("CN", True)
        
        def selectBouquet(self):
+               from Components.ParentalControl import parentalControl
                self.list = [ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionType(x[0])) for x in self.bouquetlist]
                self.bouquetslist.setList(self.list)
 
index 2e2f836..f9263d8 100644 (file)
@@ -107,6 +107,7 @@ class CableTransponderSearchSupport:
                        if raw_channel:
                                frontend = raw_channel.getFrontend()
                                if frontend:
+                                       frontend.closeFrontend() # immediate close... 
                                        del frontend
                                        del raw_channel
                                        return True
@@ -114,13 +115,16 @@ class CableTransponderSearchSupport:
 
        def cableTransponderSearchSessionClosed(self, *val):
                print "cableTransponderSearchSessionClosed, val", val
-               self.resetTimeout()
                self.cable_search_container.appClosed.remove(self.cableTransponderSearchClosed)
                self.cable_search_container.dataAvail.remove(self.getCableTransponderData)
+               if val and len(val):
+                       if val[0]:
+                               self.setCableTransponderSearchResult(self.__tlist)
+                       else:
+                               self.cable_search_container.sendCtrlC()
+                               self.setCableTransponderSearchResult(None)
                self.cable_search_container = None
                self.cable_search_session = None
-               if val and len(val) and val[0]:
-                       self.setCableTransponderSearchResult(self.__tlist)
                self.__tlist = None
                self.cableTransponderSearchFinished()
 
@@ -156,25 +160,12 @@ class CableTransponderSearchSupport:
                                parm.modulation = qam[data[4]]
                                parm.inversion = inv[data[5]]
                                self.__tlist.append(parm)
-               tmpstr = _("Try to find used Transponders in cable network.. please wait...")
-               tmpstr += "\n\n"
-               tmpstr += data[1]
-               tmpstr += " kHz "
-               tmpstr += data[0]
-               self.cable_search_session["text"].setText(tmpstr)
-               
-       def setTimeout(self):
-               try:
-                       self.oldtimeoutvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
-                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
-               except:
-                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"                
-               
-       def resetTimeout(self):
-               try:
-                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(self.oldtimeoutvalue)
-               except:
-                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
+                       tmpstr = _("Try to find used Transponders in cable network.. please wait...")
+                       tmpstr += "\n\n"
+                       tmpstr += data[1]
+                       tmpstr += " kHz "
+                       tmpstr += data[0]
+                       self.cable_search_session["text"].setText(tmpstr)
 
        def startCableTransponderSearch(self, nim_idx):
                if not self.tryGetRawFrontend(nim_idx):
@@ -260,7 +251,6 @@ class CableTransponderSearchSupport:
                self.cable_search_container.execute(cmd)
                tmpstr = _("Try to find used transponders in cable network.. please wait...")
                tmpstr += "\n\n..."
-               self.setTimeout()
                self.cable_search_session = self.session.openWithCallback(self.cableTransponderSearchSessionClosed, MessageBox, tmpstr, MessageBox.TYPE_INFO)
 
 class DefaultSatLists(DefaultWizard):
@@ -845,7 +835,10 @@ class ScanSetup(ConfigListScreen, Screen, CableTransponderSearchSupport):
                self.tlist = tlist
 
        def cableTransponderSearchFinished(self):
-               self.startScan(self.tlist, self.flags, self.feid)
+               if self.tlist is None:
+                       self.tlist = []
+               else:
+                       self.startScan(self.tlist, self.flags, self.feid)
 
        def startScan(self, tlist, flags, feid):
                if len(tlist):
@@ -1011,7 +1004,8 @@ class ScanSimple(ConfigListScreen, Screen, CableTransponderSearchSupport):
                                self.session.open(MessageBox, _("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."), MessageBox.TYPE_ERROR)
 
        def setCableTransponderSearchResult(self, tlist):
-               self.scanList.append({"transponders": tlist, "feid": self.feid, "flags": self.flags})
+               if tlist is not None:
+                       self.scanList.append({"transponders": tlist, "feid": self.feid, "flags": self.flags})
 
        def cableTransponderSearchFinished(self):
                self.buildTransponderList()
index a3cfb5a..d34924b 100755 (executable)
--- a/mytest.py
+++ b/mytest.py
@@ -10,7 +10,8 @@ from Tools.Profile import profile, profile_final
 profile("PYTHON_START")
 
 from enigma import runMainloop, eDVBDB, eTimer, quitMainloop, \
-       getDesktop, ePythonConfigQuery, eAVSwitch, eServiceEvent
+       getDesktop, ePythonConfigQuery, eAVSwitch, eServiceEvent, \
+       eEPGCache
 from tools import *
 
 profile("LANGUAGE")
@@ -55,6 +56,11 @@ config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False)
 config.misc.useTransponderTime = ConfigYesNo(default=True)
 config.misc.startCounter = ConfigInteger(default=0) # number of e2 starts...
 config.misc.standbyCounter = NoSave(ConfigInteger(default=0)) # number of standby
+config.misc.epgcache_filename = ConfigText(default = "/hdd/epg.dat")
+
+def setEPGCachePath(configElement):
+       eEPGCache.getInstance().setCacheFile(configElement.value)
+config.misc.epgcache_filename.addNotifier(setEPGCachePath)
 
 #demo code for use of standby enter leave callbacks
 #def leaveStandby():