/[projects]/misc/xbmc/plugin.video.todic/default.py
ViewVC logotype

Diff of /misc/xbmc/plugin.video.todic/default.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1630 by torben, Sun Nov 27 11:05:43 2011 UTC revision 1631 by torben, Sun Nov 27 12:37:43 2011 UTC
# Line 32  def rootMenu(): Line 32  def rootMenu():
32                  listitem = xbmcgui.ListItem(label = name, iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png')                  listitem = xbmcgui.ListItem(label = name, iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png')
33                  u = sys.argv[0] + "?mode=1&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url)                  u = sys.argv[0] + "?mode=1&name=" + urllib.quote_plus(name) + "&url=" + urllib.quote_plus(url)
34                  ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l)                  ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l)
35    
36            listitem = xbmcgui.ListItem(label = "Søg ...", iconImage = 'DefaultFolder.png', thumbnailImage = 'DefaultFolder.png')
37            u = sys.argv[0] + "?mode=10&name=" + urllib.quote_plus(name)
38            ok = xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = listitem, isFolder = True, totalItems = l)
39    
40          xbmcplugin.endOfDirectory(int(sys.argv[1]))          xbmcplugin.endOfDirectory(int(sys.argv[1]))
41    
42    
# Line 80  def play_video(url, name): Line 85  def play_video(url, name):
85          xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(str(url), listitem)          xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(str(url), listitem)
86          xbmc.sleep(200)          xbmc.sleep(200)
87    
88    def search():
89            search = getUserInput("Todic Søgning")
90    
91            url = __backend__ + "&action=search&search=" + urllib.quote_plus(search)
92    
93            print "[TODIC] Search start: " + search
94            print "[TODIC] Search url: " + url
95    
96            buildSubList(url, "søgning")
97    
98            
99    
100    
101                    
102    #=================================== Tool Box =======================================
103    # shows a more userfriendly notification
104    def showMessage(heading, message):
105            duration = 15*1000
106            xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' % ( heading, message, duration) )
107    
108    
109    # raise a keyboard for user input
110    def getUserInput(title = "Input", default="", hidden=False):
111            result = None
112    
113            # Fix for when this functions is called with default=None
114            if not default:
115                    default = ""
116                            
117            keyboard = xbmc.Keyboard(default, title)
118            keyboard.setHiddenInput(hidden)
119            keyboard.doModal()
120                    
121            if keyboard.isConfirmed():
122                    result = keyboard.getText()
123                    
124            return result
125    
126    
127  def get_params():  def get_params():
128          param=[]          param=[]
# Line 134  elif mode == 2: Line 177  elif mode == 2:
177          #build list of series                  #build list of series        
178          buildSubList(url, name)          buildSubList(url, name)
179    
180    elif mode == 10:
181            search()
182            
183    
184  elif mode == 50:  elif mode == 50:
185          play_video(url, name)          play_video(url, name)
186    

Legend:
Removed from v.1630  
changed lines
  Added in v.1631

  ViewVC Help
Powered by ViewVC 1.1.20