diff options
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Plugins/Extensions/DVDPlayer/plugin.py | 4 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 4 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaPlayer/settings.py | 2 | ||||
| -rw-r--r-- | lib/python/Screens/PluginBrowser.py | 22 | ||||
| -rwxr-xr-x | lib/python/Screens/VirtualKeyBoard.py | 16 |
5 files changed, 34 insertions, 14 deletions
diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index ebcf4f81..e77b8940 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -14,7 +14,6 @@ from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase from Components.config import config from Tools.Directories import pathExists, fileExists from Components.Harddisk import harddiskmanager -from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier import servicedvd # load c++ part of dvd player plugin @@ -346,6 +345,8 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP }) self.onClose.append(self.__onClose) + + from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) if dvd_device: @@ -627,6 +628,7 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP def __onClose(self): self.restore_infobar_seek_config() self.session.nav.playService(self.oldService) + from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.remove(self.hotplugCB) def playLastCB(self, answer): # overwrite infobar cuesheet function diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index b0aa6274..0f46c996 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -21,7 +21,6 @@ from Components.Harddisk import harddiskmanager from Components.config import config from Tools.Directories import fileExists, pathExists, resolveFilename, SCOPE_CONFIG, SCOPE_PLAYLIST, SCOPE_SKIN_IMAGE from settings import MediaPlayerSettings -from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier import random class MyPlayList(PlayList): @@ -137,6 +136,8 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB self["repeat"] = MultiPixmap() self.seek_target = None + + from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.append(self.hotplugCB) class MoviePlayerActionMap(NumberActionMap): @@ -244,6 +245,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB if config.mediaplayer.saveDirOnExit.getValue(): config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory()) config.mediaplayer.defaultDir.save() + from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier hotplugNotifier.remove(self.hotplugCB) del self["coverArt"].picload self.close() diff --git a/lib/python/Plugins/Extensions/MediaPlayer/settings.py b/lib/python/Plugins/Extensions/MediaPlayer/settings.py index 416ab2ee..8a032d16 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/settings.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/settings.py @@ -46,7 +46,7 @@ class DirectoryBrowser(Screen, HelpableScreen): self.filelist.descent() def use(self): - if self.filelist.canDescent() and len(self["filelist"].getFilename()) > len(self["filelist"].getCurrentDirectory()): + if self.filelist.canDescent() and self["filelist"].getFilename() and len(self["filelist"].getFilename()) > len(self["filelist"].getCurrentDirectory()): self.filelist.descent() self.close(self["filelist"].getCurrentDirectory()) diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py index cd17e2e0..5ba7043d 100644 --- a/lib/python/Screens/PluginBrowser.py +++ b/lib/python/Screens/PluginBrowser.py @@ -12,6 +12,7 @@ from Plugins.Plugin import PluginDescriptor from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE from Tools.LoadPixmap import LoadPixmap +from time import time class PluginBrowser(Screen): def __init__(self, session): @@ -65,7 +66,8 @@ class PluginBrowser(Screen): class PluginDownloadBrowser(Screen): DOWNLOAD = 0 REMOVE = 1 - + lastDownloadDate = None + def __init__(self, session, type): Screen.__init__(self, session) @@ -130,14 +132,22 @@ class PluginDownloadBrowser(Screen): elif self.type == self.REMOVE: self.setTitle(_("Remove plugins")) + def startIpkgListInstalled(self): + self.container.execute("ipkg list_installed enigma2-plugin-*") + def startRun(self): self["list"].instance.hide() if self.type == self.DOWNLOAD: - self.container.execute("ipkg update") + if not PluginDownloadBrowser.lastDownloadDate or (time() - PluginDownloadBrowser.lastDownloadDate) > 3600: + # Only update from internet once per hour + self.container.execute("ipkg update") + PluginDownloadBrowser.lastDownloadDate = time() + else: + self.startIpkgListInstalled() elif self.type == self.REMOVE: self.run = 1 - self.container.execute("ipkg list_installed enigma2-plugin-*") - + self.startIpkgListInstalled() + def installFinished(self): plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) self.container.appClosed.remove(self.runFinished) @@ -149,7 +159,7 @@ class PluginDownloadBrowser(Screen): if self.run == 0: self.run = 1 if self.type == self.DOWNLOAD: - self.container.execute("ipkg list_installed enigma2-plugin-*") + self.startIpkgListInstalled() elif self.run == 1 and self.type == self.DOWNLOAD: self.run = 2 self.container.execute("ipkg list enigma2-plugin-*") @@ -192,7 +202,7 @@ class PluginDownloadBrowser(Screen): self.plugins = {} for x in self.pluginlist: - split = x[3].split('-') + split = x[3].split('-', 1) if len(split) < 2: continue if not self.plugins.has_key(split[0]): diff --git a/lib/python/Screens/VirtualKeyBoard.py b/lib/python/Screens/VirtualKeyBoard.py index 9b676a5f..bde6f75d 100755 --- a/lib/python/Screens/VirtualKeyBoard.py +++ b/lib/python/Screens/VirtualKeyBoard.py @@ -157,6 +157,8 @@ class VirtualKeyBoard(Screen): }, -2) self.onLayoutFinish.append(self.buildVirtualKeyBoard) + + self.max_key=47+len(self.keys_list[4]) def buildVirtualKeyBoard(self, selectedKey=0): list = [] @@ -251,7 +253,7 @@ class VirtualKeyBoard(Screen): elif self.selectedKey == 35: self.selectedKey = 47 elif self.selectedKey == 47: - self.selectedKey = 59 + self.selectedKey = self.max_key self.showActiveKey() @@ -266,7 +268,7 @@ class VirtualKeyBoard(Screen): self.selectedKey = 24 elif self.selectedKey == 48: self.selectedKey = 36 - elif self.selectedKey == 60: + elif self.selectedKey > self.max_key: self.selectedKey = 48 self.showActiveKey() @@ -274,16 +276,20 @@ class VirtualKeyBoard(Screen): def up(self): self.selectedKey -= 12 - if self.selectedKey < 0: - self.selectedKey += 60 + if (self.selectedKey < 0) and (self.selectedKey > (self.max_key-60)): + self.selectedKey += 48 + elif self.selectedKey < 0: + self.selectedKey += 60 self.showActiveKey() def down(self): self.selectedKey += 12 - if self.selectedKey > 59: + if (self.selectedKey > self.max_key) and (self.selectedKey > 59): self.selectedKey -= 60 + elif self.selectedKey > self.max_key: + self.selectedKey -= 48 self.showActiveKey() |
