Make updateIntervals configurable (Extras->Settings) on Client-Side.
authorStephan Reichholf <sreichholf@users.schwerkraft.elitedvb.net>
Sat, 13 Feb 2010 16:28:53 +0000 (16:28 +0000)
committerStephan Reichholf <sreichholf@users.schwerkraft.elitedvb.net>
Sat, 13 Feb 2010 16:28:53 +0000 (16:28 +0000)
By increasing these settings you can lower the cpu-load (especially useful for dm800 owners).

Woohoooo we are final now - Please welcome 1.6.0!

webinterface/CONTROL/control
webinterface/src/__init__.py
webinterface/src/web-data/manifest.json
webinterface/src/web-data/tools.js
webinterface/src/web-data/tpl/default/tplSettings.htm

index f621c55..2668719 100644 (file)
@@ -1,5 +1,5 @@
 Package: enigma2-plugin-extensions-webinterface
-Version: 1.6rc2
+Version: 1.6.0
 Description: Control enigma2 with your Browser
 Section: extra
 Priority: optional
index f0ffda6..cbaaf5c 100644 (file)
@@ -3,7 +3,7 @@ from Components.Language import language
 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
 import os,gettext
 
-__version__ = "1.6rc3"
+__version__ = "1.6.0"
 
 PluginLanguageDomain = "WebInterface"
 PluginLanguagePath = "Extensions/WebInterface/locale"
index 612079b..8884efe 100644 (file)
@@ -1,6 +1,6 @@
 {
   "betaManifestVersion": 1,
-  "version": "v39",
+  "version": "v40",
   "entries": [
                { "url": "IEFixes.htc" },               
                { "url": "img/arrow_down.png" },
index 052e98d..a26ca1c 100644 (file)
@@ -36,7 +36,8 @@ var tagsList = [];
 var boxtype = "";
 
 function startUpdateCurrentPoller(){
-       updateCurrentPoller = setInterval(updateItems, 60000);
+       clearInterval(updateCurrentPoller);
+       updateCurrentPoller = setInterval(updateItems, userprefs.data.updateCurrentInterval);
 }
 
 function stopUpdateCurrentPoller(){
@@ -141,7 +142,8 @@ function simpleResultHandler(simpleResult){
 
 function startUpdateBouquetItemsPoller(){
        debug("[startUpdateBouquetItemsPoller] called");
-       updateBouquetItemsPoller = setInterval(updateItemsLazy, 300000);
+       clearInterval(updateBouquetItemsPoller);
+       updateBouquetItemsPoller = setInterval(updateItemsLazy, userprefs.data.updateBouquetInterval);
 }
 
 
@@ -329,19 +331,45 @@ function saveSettings(){
        userprefs.load();
        
        var debug = $('enableDebug').checked;
+       var changed = false;
        if(typeof(debug) != "undefined"){
                if( userprefs.data.debug != debug ){
                        userprefs.data.debug = debug;
-                       userprefs.save();
-                       
+                       changed = true;
+       
                        if(debug){
                                openDebug();
                        }
                }               
        }
        
+       var updateCurrentInterval = $F('updateCurrentInterval');
+       if( isNaN(updateCurrentInterval) || parseNr(updateCurrentInterval) < 10000){
+               updateCurrentInterval = 120000;
+       }
        
+       if( userprefs.data.updateCurrentInterval != updateCurrentInterval){
+               userprefs.data.updateCurrentInterval = updateCurrentInterval;
+               
+               changed = true;
+               startUpdateCurrentPoller();
+       }
+       
+       var updateBouquetInterval = $F('updateBouquetInterval');
+       if( isNaN(updateBouquetInterval) || parseNr(updateBouquetInterval) < 60000){
+               updateBouquetInterval = 300000;
+       }
        
+       if( userprefs.data.updateBouquetInterval != updateBouquetInterval){
+               userprefs.data.updateBouquetInterval = updateBouquetInterval;
+               
+               changed = true;
+               startUpdateBouquetItemsPoller();
+       }
+       
+       if(changed){
+               userprefs.save();
+       }
 }
 
 //Template Helpers
@@ -1204,8 +1232,15 @@ function showSettings(){
        if(debug){
                debugChecked = 'checked';
        }
+       
+       var updateCurrentInterval = userprefs.data.updateCurrentInterval;
+       var updateBouquetInterval = userprefs.data.updateBouquetInterval;
+       
 
-       data = { 'debug' : debugChecked };
+       data = {'debug' : debugChecked,
+                       'updateCurrentInterval' : updateCurrentInterval,
+                       'updateBouquetInterval' : updateBouquetInterval
+       };
        processTpl('tplSettings', data, 'contentMain');
 }
 
@@ -1628,10 +1663,21 @@ function updateItemsLazy(bouquet){
 
 function init(){
        var DBG = userprefs.data.debug || false;
+       
        if(DBG){
                openDebug();
        }
 
+       if( parseNr(userprefs.data.updateCurrentInterval) < 10000){
+               userprefs.data.updateCurrentInterval = 120000;
+               userprefs.save();
+       }
+       
+       if( parseNr(userprefs.data.updateBouquetInterval) < 60000 ){
+               userprefs.data.updateBouquetInterval = 300000;
+               userprefs.save();
+       }
+       
        if (typeof document.body.style.maxHeight == "undefined") {
                alert("Due to the tremendous amount of work needed to get everthing to " +
                "work properly, there is (for now) no support for Internet Explorer Versions below 7");
index d81f079..e5638a3 100644 (file)
@@ -6,9 +6,28 @@
                                                                        <table style="width: 100%;">
                                                                                <tr>
                                                                                        <td>
-                                                                                               <form><input type="checkbox" id="enableDebug" ${debug}/>Enable Debug</form>                                                                                             
-                                                                                       </td>                                                                                   
+                                                                                               Enable Debug                                                                                            
+                                                                                       </td>
+                                                                                       <td>
+                                                                                               <form><input type="checkbox" id="enableDebug" ${debug}/></form>
+                                                                                       </td>                                                                           
                                                                                </tr>
+                                                                               <tr>
+                                                                                       <td>
+                                                                                               Update-Interval for current service
+                                                                                       </td>
+                                                                                       <td>
+                                                                                               <form><input type="text" id="updateCurrentInterval" value="${updateCurrentInterval}">ms</form>
+                                                                                       </td>                                                                           
+                                                                               </tr>
+                                                                               <tr>
+                                                                                       <td>
+                                                                                               Update-Interval for current bouquets EPG
+                                                                                       </td>
+                                                                                       <td colspan="2">
+                                                                                               <form><input type="text" id="updateBouquetInterval" value="${updateBouquetInterval}" />ms</form>
+                                                                                       </td>                                                                           
+                                                                               </tr>                                                                                                                                                           
                                                                                <tr><td><button onClick="saveSettings()">Save</button></td></tr>
                                                                        </table>