/[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 1640 by torben, Mon Nov 28 19:02:04 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 film ...", 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            if (search != None and search != ""):
92                    url = __backend__ + "&action=search&search=" + urllib.quote_plus(search)
93    
94                    #print "[TODIC] Search start: " + search
95                    #print "[TODIC] Search url: " + url
96    
97                    buildSubList(url, "søgning")
98    
99            
100    
101    
102                    
103    #=================================== Tool Box =======================================
104    # shows a more userfriendly notification
105    def showMessage(heading, message):
106            duration = 15*1000
107            xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' % ( heading, message, duration) )
108    
109    
110    # raise a keyboard for user input
111    def getUserInput(title = "Input", default="", hidden=False):
112            result = None
113    
114            # Fix for when this functions is called with default=None
115            if not default:
116                    default = ""
117                            
118            keyboard = xbmc.Keyboard(default, title)
119            keyboard.setHiddenInput(hidden)
120            keyboard.doModal()
121                    
122            if keyboard.isConfirmed():
123                    result = keyboard.getText()
124                    
125            return result
126    
127    
128  def get_params():  def get_params():
129          param=[]          param=[]
# Line 134  elif mode == 2: Line 178  elif mode == 2:
178          #build list of series                  #build list of series        
179          buildSubList(url, name)          buildSubList(url, name)
180    
181    elif mode == 10:
182            search()
183            
184    
185  elif mode == 50:  elif mode == 50:
186          play_video(url, name)          play_video(url, name)
187    
188    
189    
190  xbmcplugin.endOfDirectory(int(sys.argv[1]))  # xbmcplugin.endOfDirectory(int(sys.argv[1]))
191    

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

  ViewVC Help
Powered by ViewVC 1.1.20