当前位置: 首页>>代码示例>>Python>>正文


Python xbmcgui.getCurrentWindowDialogId函数代码示例

本文整理汇总了Python中xbmcgui.getCurrentWindowDialogId函数的典型用法代码示例。如果您正苦于以下问题:Python getCurrentWindowDialogId函数的具体用法?Python getCurrentWindowDialogId怎么用?Python getCurrentWindowDialogId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getCurrentWindowDialogId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onClick

    def onClick(self, controlID):
        try:
            kill = None
            if controlID == 199:
                self._close_dialog()
            elif controlID == 99:
                try:
                    import shutil

                    try:
                        shutil.rmtree(DL_INFO_PATH, True)
                    except:
                        pass
                    if not os.path.exists(DL_INFO_PATH):
                        os.makedirs(DL_INFO_PATH)
                except:
                    print_exc()
                xbmc.executebuiltin("Container.Refresh")
                self._close_dialog()
            elif 1401 <= controlID <= 1412:
                kill = str(controlID)[2:]
            if kill is not None:
                win = xbmcgui.Window(xbmcgui.getCurrentWindowDialogId())
                win.setProperty("progress.%s.isAlive" % kill, "kill")
                # print xbmcgui.getCurrentWindowDialogId()
        except:
            print_exc()
开发者ID:Quihico,项目名称:passion-xbmc,代码行数:27,代码来源:DialogDLProgress.py

示例2: Scan

    def Scan(self, rate = False):
        if ((rate) and (time.time() < self.wait['scan'])) or (xbmcgui.getCurrentWindowDialogId() == 10135): return
        self.wait['scan'] = time.time() + 15

        songs = dict()
        for pos in range(0, self.playlist.size()):
            tk = self.playlist[pos].getProperty("%s.token" % _id)
            rt = xbmc.getInfoLabel("MusicPlayer.Position(%d).Rating" % pos)
            if (rt == ''): rt = '0'

            if tk in self.songs:
                song = self.songs[tk]
                del self.songs[tk]
                songs[tk] = song

                if (rate) and (song.get('rating', rt) != rt):
                    self.Rated(song, rt)
                elif not song.get('rating'):
                    song['rating'] = rt

        for s in self.songs:
            if (not self.songs[s].get('keep', False)) and xbmcvfs.exists(self.songs[s].get('path_cch')):
                xbmcvfs.delete(self.songs[s]['path_cch'])
                Log('Scan  RM', self.songs[s])

        self.songs = songs
开发者ID:Hundak,项目名称:gominoa-xbmc-addons,代码行数:26,代码来源:pandoki.py

示例3: run

 def run(self):
     self.omdb_thread.join()
     if not xbmcgui.getCurrentWindowDialogId() == self.window_id:
         return None
     pass_dict_to_skin(data=self.omdb_thread.listitems,
                       prefix="movie.omdb.",
                       window_id=self.window_id)
开发者ID:Inter95,项目名称:tutvguia,代码行数:7,代码来源:DialogVideoInfo.py

示例4: _get_vars

 def _get_vars(self):
     # get the screensaver window id
     self.winid   = xbmcgui.Window(xbmcgui.getCurrentWindowDialogId())
     # init the monitor class to catch onscreensaverdeactivated calls
     self.Monitor = MyMonitor(action = self._exit)
     self.stop    = False
     self.startup = True
开发者ID:Karnarel,项目名称:screensaver.picture.slideshow,代码行数:7,代码来源:gui.py

示例5: onInit

 def onInit(self):
     if not self.tvshow:
         self.close()
         return
     homewindow.setProperty("movie.ImageColor", self.tvshow["general"]["ImageColor"])
     self.windowid = xbmcgui.getCurrentWindowDialogId()
     self.window = xbmcgui.Window(self.windowid)
     passDictToSkin(self.tvshow["general"], "movie.", False, False, self.windowid)
     self.window.setProperty("tmdb_logged_in", checkLogin())
     self.window.setProperty("type", "tvshow")
     self.getControl(1000).addItems(create_listitems(self.tvshow["actors"], 0))
     xbmc.sleep(200)
     prettyprint(self.tvshow["certifications"])
     self.getControl(150).addItems(create_listitems(self.tvshow["similar"], 0))
     self.getControl(250).addItems(create_listitems(self.tvshow["seasons"], 0))
     self.getControl(550).addItems(create_listitems(self.tvshow["studios"], 0))
     self.getControl(1450).addItems(create_listitems(self.tvshow["networks"], 0))
     self.getControl(650).addItems(create_listitems(self.tvshow["certifications"], 0))
     self.getControl(750).addItems(create_listitems(self.tvshow["crew"], 0))
     self.getControl(850).addItems(create_listitems(self.tvshow["genres"], 0))
     self.getControl(950).addItems(create_listitems(self.tvshow["keywords"], 0))
     self.getControl(1150).addItems(create_listitems(self.tvshow["videos"], 0))
     self.getControl(350).addItems(create_listitems(self.youtube_vids, 0))
     self.getControl(1250).addItems(create_listitems(self.tvshow["images"], 0))
     self.getControl(1350).addItems(create_listitems(self.tvshow["backdrops"], 0))
     self.UpdateStates(False)
开发者ID:eztv,项目名称:script.extendedinfo,代码行数:26,代码来源:DialogTVShowInfo.py

示例6: index

def index():
    """
    Main add-on popup
    :return:
    """
    api = API()

    # check if current window is arwork or intro:
    window_id = getCurrentWindowDialogId()
    window = WindowDialog(window_id)

    if isinstance(window, IntroWindow) or isinstance(window, ArtworkWindow):
        log('Either IntroWindow or ArtworkWindow are already open')
    else:
        intro_window = IntroWindow(api)
        intro_window.doModal()
        section_id = intro_window.getProperty('section')
        if section_id:
            section_id = int(section_id)
            category_id = int(intro_window.getProperty('category'))
            del intro_window

            if section_id == 1:  # channels
                show_channels(section_id, category_id) if section_id != 99 else show_favorites()
            elif section_id == 3:  # atmospheres
                show_categories(section_id)
            else:
                show_favorites()  # favorites
        else:
            del intro_window
开发者ID:gedisony,项目名称:repo-plugins,代码行数:30,代码来源:addon.py

示例7: setWindowProperties

    def setWindowProperties( self, nokill=False ):
        win = None
        if self.dlInBackground and self.baseProperty:
            try:
                winID = self.winID or xbmcgui.getCurrentWindowDialogId()
                win = xbmcgui.Window( winID )
                #print "win = xbmcgui.Window(%s)" % str( winID )
            except: pass
        if win is not None:
            if not nokill and win.getProperty( self.baseProperty + "isAlive" ) == "kill":
                return True

            [ win.setProperty( self.baseProperty + k, v ) for k, v in ( ( "isAlive", "true" ),
                ( "heading", self.heading ),
                ( "url", self.url ),
                ( "filename", self.base_name ),
                ( "destination", self.destination ),
                ( "kbps", self.kbps ),
                ( "percent", "%i" % self.percent ),
                ( "currentSize", self.currentSize ),
                ( "totalSize", self.totalSize ),
                ( "elapsedTime", self.elapsedTime ),
                ( "estimatedTimeLeft", self.estimatedTimeLeft ),
                ( "estimatedTotalTime", self.estimatedTotalTime ) )
                ]
            try: win.getControl( self.winControlID ).setPercent( int( self.percent ) )
            except: pass
开发者ID:Quihico,项目名称:passion-xbmc,代码行数:27,代码来源:downloader.py

示例8: grab_random_fanart

def grab_random_fanart(controlNum, special):
    global fanart
    
    get_fanart_list(True)
    if len(fanart) == 0:
        return
    
    # sometimes the list control isn't available yet onload
    # so add some checking to make sure
    control = common.get_list(controlNum, special)
    count = 10
    while control == "" and count > 0:
        time.sleep(0.25)
        control = common.get_list(controlNum, special)
        count = count - 1
    
    window = common.get_window_id(special)
    if control == "":
        pass
    else:
        item = control.GetItem(0)
        while 1:
            if xbmcgui.getCurrentWindowDialogId() == 9999:
                art = fanart[fanart.keys()[randint(0, len(fanart) - 1)]].encode("utf-8")
                
                item.SetProperty("fanart", str(art))

            count = 5
            while count > 0:
                if window != common.get_window_id(special):
                    return
                time.sleep(2)
                count = count - 1
开发者ID:Doxsey,项目名称:boxeehack,代码行数:33,代码来源:boxeehack_grab_fanart.py

示例9: onInit

    def onInit(self):
        self.window = xbmcgui.Window(xbmcgui.getCurrentWindowDialogId())
        self.season_list = self.window.getControl(210)
        self.weeks_list = self.window.getControl(220)
        self.games_list = self.window.getControl(230)
        self.live_list = self.window.getControl(240)

        if gpr.subscription == 'gamepass':
            self.window.setProperty('gamepass', 'true')

        if self.list_refill:
            self.season_list.reset()
            self.season_list.addItems(self.season_items)
            self.weeks_list.reset()
            self.weeks_list.addItems(self.weeks_items)
            self.games_list.reset()
            self.games_list.addItems(self.games_items)
            self.live_list.reset()
            self.live_list.addItems(self.live_items)
        else:
            self.window.setProperty('NW_clicked', 'false')
            self.window.setProperty('GP_clicked', 'false')

        try:
            self.setFocus(self.window.getControl(self.focusId))
        except:
            addon_log('Focus not possible: %s' %self.focusId)
开发者ID:CraigMack69,项目名称:xbmc-gamepass,代码行数:27,代码来源:default.py

示例10: onInit

	def onInit(self):		
		win = xbmcgui.Window(xbmcgui.getCurrentWindowDialogId())
		
		self.listControl = self.getControl(LIST_ITEM_CONTROL_ID)
		self.listControl.reset()

		# asynchronous initialization
		if self.__dict__.get('_async_init'):
			result = {}
			kwargs = self._async_init.get('kwargs', {})
			kwargs['result'] = result
			try:
				self._async_init['method'](**kwargs)	# method(result=result, +kwargs)
			except (AuthenticationError, ListEmptyException) as e:
				self.close()
				return
				
			self.data.update(result['result'])

		# exception of incoming data format
		if self.data.has_key('episodes'):
			self.data['items'] = self.data['episodes']
			first_episode = self.data['items'][0]
			self.data['tvshow_name'] = first_episode['tvshow_name']
			self.data['_categoryName'] = self.data['tvshow_name'] + ' - Season ' + first_episode['season_number']
			
		win.setProperty('ContainerCategory', self.data.get('_categoryName', ''))
		
		self.updateItems()
开发者ID:menn0,项目名称:XBMC,代码行数:29,代码来源:dialog.py

示例11: Scan

    def Scan(self, rate=True):
        if ((rate) and (time.time() < self.wait["scan"])) or (xbmcgui.getCurrentWindowDialogId() == 10135):
            return
        self.wait["scan"] = time.time() + 15

        songs = dict()
        for pos in range(0, self.playlist.size()):
            tk = self.playlist[pos].getProperty("%s.token" % _id)
            rt = xbmc.getInfoLabel("MusicPlayer.Position(%d).Rating" % pos)

            if tk in self.songs:
                song = self.songs[tk]
                del self.songs[tk]
                songs[tk] = song

                if (rate) and (song.get("rating", rt) != rt):
                    self.Rated(song, rt)
                elif not song.get("rating"):
                    song["rating"] = rt

        for s in self.songs:
            if (not self.songs[s].get("keep", False)) and xbmcvfs.exists(self.songs[s].get("path_cch")):
                xbmcvfs.delete(self.songs[s]["path_cch"])
                Log("Scan  RM", self.songs[s])

        self.songs = songs
开发者ID:ClashTheBunny,项目名称:gominoa-xbmc-addons,代码行数:26,代码来源:pandoki.py

示例12: grab_random_fanart

def grab_random_fanart(controlNum, special):
    global fanart
    
    get_fanart_list()
    if len(fanart) == 0:
        return
    
    # sometimes the list control isn't available yet onload
    # so add some checking to make sure
    control = common.get_control(controlNum, special)
    count = 10
    while control == "" and count > 0:
        time.sleep(0.25)
        control = common.get_control(controlNum, special)
        count = count - 1
    
    window = common.get_window_id(special)
    if control == "":
        pass
    else:
        while 1:
            if xbmcgui.getCurrentWindowDialogId() == 9999:
                art = fanart[fanart.keys()[randint(0, len(fanart) - 1)]]
                if art != "":
                    art = "$COMMA".join(art.split(","))
            
                xbmc.executebuiltin("Skin.SetString(random-fanart,%s)" % art)

            count = 4
            while count > 0:
                if window != common.get_window_id(special):
                    return
                time.sleep(2)
                count = count - 1
开发者ID:Baek87,项目名称:boxeehack,代码行数:34,代码来源:boxeehack_grab_fanart.py

示例13: run

    def run(self):
        self.window = xbmcgui.Window(xbmcgui.getCurrentWindowDialogId())
        client_do = 'client_wait'
        self.window.setProperty('clientIsRunning', 'True')
        while not client_do == 'client_stop':
            if self.window.getProperty('clientIsRunning') == "True":
                client_run = self.check_queue()
                if client_run:
                    client_do = client_run

                if client_do == 'client_stop':
                    addon_log('Got Notification: client_stop')
                    self.window.setProperty('clientIsRunning', '')
                elif client_do == 'client_wait':
                    addon_log('ChatSuperMiltonIsRunning: clientIsWaiting')
                    time.sleep(0.5)
                else:
                    msg = self.get_message()
                    if msg:
                        # adjust the chatmessage delay here
                        time.sleep(1.0)
                    else:
                        time.sleep(0.2)
            else:
                break
        return
开发者ID:listamilton,项目名称:supermilton.repository,代码行数:26,代码来源:default.py

示例14: __init__

    def __init__(self):
        params = self.get_params()
        if params:
            color_picker = cp.ColorPicker("script-skin_helper_service-ColorPicker.xml", ADDON_PATH, "Default", "1080i")
            color_picker.skinstring = params.get("SKINSTRING","")
            color_picker.win_property = params.get("WINPROPERTY","")
            color_picker.active_palette = params.get("PALETTE","")
            color_picker.header_label = params.get("HEADER","")
            propname = params.get("SHORTCUTPROPERTY","")
            color_picker.shortcut_property = propname
            color_picker.doModal()

            #special action when we want to set our chosen color into a skinshortcuts property
            if propname and not isinstance(color_picker.result, int):
                wait_for_skinshortcuts_window()
                xbmc.sleep(400)
                current_window = xbmcgui.Window( xbmcgui.getCurrentWindowDialogId() )
                current_window.setProperty("customProperty", propname)
                current_window.setProperty("customValue",color_picker.result[0])
                xbmc.executebuiltin("SendClick(404)")
                xbmc.sleep(250)
                current_window.setProperty("customProperty", "%s.name" %propname)
                current_window.setProperty("customValue",color_picker.result[1])
                xbmc.executebuiltin("SendClick(404)")
            del color_picker
开发者ID:kodibrasil,项目名称:KodiBrasil,代码行数:25,代码来源:default.py

示例15: checkWindowID

    def checkWindowID(self):
        current_dialog_id = getCurrentWindowDialogId()
        current_window_id = getCurrentWindowId()

        for window_id in self._preview_disabled_window_id:
            if current_window_id == window_id or current_dialog_id == window_id:
                return True
        return False
开发者ID:AllanMar,项目名称:plugin.video.surveillanceroom,代码行数:8,代码来源:monitor.py


注:本文中的xbmcgui.getCurrentWindowDialogId函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。