diff options
Diffstat (limited to 'plugin.video.montreal.greek-tv/resources/lib/control.py')
-rw-r--r-- | plugin.video.montreal.greek-tv/resources/lib/control.py | 49 |
1 files changed, 16 insertions, 33 deletions
diff --git a/plugin.video.montreal.greek-tv/resources/lib/control.py b/plugin.video.montreal.greek-tv/resources/lib/control.py index 3e6a8d7..8a48197 100644 --- a/plugin.video.montreal.greek-tv/resources/lib/control.py +++ b/plugin.video.montreal.greek-tv/resources/lib/control.py @@ -18,9 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ''' - -import os, xbmc, xbmcaddon, xbmcplugin, xbmcgui, xbmcvfs - +import xbmc, xbmcaddon, xbmcplugin, xbmcgui, xbmcvfs +import os integer = 1000 lang = xbmcaddon.Addon().getLocalizedString @@ -35,6 +34,7 @@ directory = xbmcplugin.endOfDirectory content = xbmcplugin.setContent property = xbmcplugin.setProperty resolve = xbmcplugin.setResolvedUrl +sortmethod = xbmcplugin.addSortMethod infoLabel = xbmc.getInfoLabel condVisibility = xbmc.getCondVisibility @@ -45,6 +45,9 @@ execute = xbmc.executebuiltin skin = xbmc.getSkinDir() player = xbmc.Player() playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) +monitor = xbmc.Monitor() +wait = monitor.waitForAbort +aborted = monitor.abortRequested transPath = xbmc.translatePath skinPath = xbmc.translatePath('special://skin/') @@ -60,6 +63,7 @@ image = xbmcgui.ControlImage alphanum_input = xbmcgui.INPUT_ALPHANUM password_input = xbmcgui.INPUT_PASSWORD hide_input = xbmcgui.ALPHANUM_HIDE_INPUT +verify = xbmcgui.PASSWORD_VERIFY item = xbmcgui.ListItem openFile = xbmcvfs.File @@ -79,9 +83,13 @@ cacheFile = os.path.join(dataPath, 'cache.db') def infoDialog(message, heading=addonInfo('name'), icon='', time=3000): if icon == '': icon = addonInfo('icon') + try: + dialog.notification(heading, message, icon, time, sound=False) + except: + execute("Notification(%s, %s, %s, %s)" % (heading, message, time, icon)) @@ -89,11 +97,7 @@ def okDialog(heading, line1): return dialog.ok(heading, line1) -def inputDialog(heading): - return dialog.input(heading) - - -def yesnoDialog(line1, line2, line3, heading=addonInfo('name'), nolabel='', yeslabel=''): +def yesnoDialog(line1, line2='', line3='', heading=addonInfo('name'), nolabel=None, yeslabel=None): return dialog.yesno(heading, line1, line2, line3, nolabel, yeslabel) @@ -102,28 +106,20 @@ def selectDialog(list, heading=addonInfo('name')): def openSettings(query=None, id=addonInfo('id')): + try: + idle() - execute('Addon.OpenSettings(%s)' % id) + execute('Addon.OpenSettings({0})'.format(id)) if query is None: raise Exception() c, f = query.split('.') execute('SetFocus(%i)' % (int(c) + 100)) execute('SetFocus(%i)' % (int(f) + 200)) - except: - return - -def openSettings_alt(): - try: - idle() - xbmcaddon.Addon().openSettings() except: - return - -def openPlaylist(): - return execute('ActivateWindow(VideoPlaylist)') + return def refresh(): @@ -132,16 +128,3 @@ def refresh(): def idle(): return execute('Dialog.Close(busydialog)') - - -def wait4abort(secs=None): - return xbmc.Monitor().waitForAbort(secs) - - -def set_view_mode(vmid): - return execute('Container.SetViewMode({0})'.format(vmid)) - - -# for compartmentalized theme addons -def addonmedia(icon): - return join(addonPath, 'resources', 'media', icon) |