def iiNT3LiiFLAG():
class flagDialog(xbmcgui.WindowXMLDialog):
def onInit(self):
pass
def onAction(self, action):
KEY_BUTTON_BACK = 275
KEY_KEYBOARD_ESC = 61467
ACTION_PREVIOUS_MENU = 10
ACTION_SELECT_ITEM = 7
ACTION_BACKSPACE = 92
buttonCode = action.getButtonCode()
actionID = action.getId()
if action == ACTION_PREVIOUS_MENU: self.close()
elif action == ACTION_BACKSPACE: self.close()
redFlag = flagDialog('down.xml', addonPath,'default')
redFlag.doModal()
del redFlag
python类WindowXMLDialog()的实例源码
dialogselect.py 文件源码
项目:script.skin.helper.skinbackup
作者: marcelveldt
项目源码
文件源码
阅读 20
收藏 0
点赞 0
评论 0
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self)
self.listing = kwargs.get("listing")
self.windowtitle = kwargs.get("windowtitle")
self.extrabutton = kwargs.get("extrabutton", "")
self.autofocus = kwargs.get("autofocus", "")
self.result = None
def __init__(self, *args, **kwargs):
self.metadatautils = MetadataUtils()
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self)
self.listing = kwargs.get("listing")
self.windowtitle = kwargs.get("windowtitle")
self.multiselect = kwargs.get("multiselect")
self.richlayout = kwargs.get("richlayout", False)
self.getmorebutton = kwargs.get("getmorebutton", "")
self.autofocus_id = kwargs.get("autofocusid", 0)
self.autofocus_label = kwargs.get("autofocuslabel", "")
self.totalitems = 0
self.result = None
def __init__(self, *args, **kwargs):
if OS_MACHINE[0:5] == 'armv7':
xbmcgui.WindowXMLDialog.__init__(self)
else:
try:
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
except:
try:
xbmcgui.WindowXMLDialog.__init__(self)
except:
pass
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self)
self.listing = kwargs.get("listing")
self.window_title = kwargs.get("window_title", "")
self.result = -1
def __init__(self, *args, **kwargs):
self.totalpage = 1
self.nowpage = 0
self.words = ''
self.inputString = kwargs.get("default") or ""
self.heading = kwargs.get("heading") or ""
self.captcha = kwargs.get("captcha") or ""
if self.captcha == "":
self.captcha = DEFAULT_CAPTCHA
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
self.listing = kwargs.get("listing")
#log( str(args) )
#log(sys.argv[1])
def __init__(self, *args, **kwargs):
xbmcgui.WindowXML.__init__(self, *args, **kwargs)
#xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) #<--- what's the difference? WindowXMLDialog animations are more system-demanding but can have transparent background.
self.subreddits_file = kwargs.get("subreddits_file")
self.listing = kwargs.get("listing")
self.main_control_id = kwargs.get("id")
self.title_bar_text = kwargs.get("title")
#log( str(args) )
#log(sys.argv[1])
def setProperty(self, key, value):
if self._closing:
return
if not self._winID:
self._winID = xbmcgui.getCurrentWindowId()
try:
xbmcgui.Window(self._winID).setProperty(key, value)
xbmcgui.WindowXMLDialog.setProperty(self, key, value)
except RuntimeError:
xbmc.log('kodigui.BaseDialog.setProperty: Missing window', xbmc.LOGDEBUG)
def show(self):
self._closing = False
xbmcgui.WindowXMLDialog.show(self)
def __init__(self, *args, **kwargs):
self.caption = kwargs.get("caption", "")
self.text_left = kwargs.get("text_left", "")
self.text_right = kwargs.get("text_right", "")
xbmcgui.WindowXMLDialog.__init__(self)
def __init__(self, *args, **kwargs):
self.caption = kwargs.get("caption", "")
self.text = kwargs.get("text", "")
xbmcgui.WindowXMLDialog.__init__(self)
def __init__(self, *args, **kwargs):
xbmcgui.WindowXML.__init__(self, *args, **kwargs)
#xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) #<--- what's the difference?
self.subreddits_file = kwargs.get("subreddits_file")
self.listing = kwargs.get("listing")
self.main_control_id = kwargs.get("id")
#self.gui_listbox.addItems(self.listing)
listing_generator=generator(self.listing)
tlc_id=0 #create id's for top-level-comments
self.child_lists[:] = [] #a collection of child comments (non-tlc) tlc_children
tlc_children=[]
#for listing in self.listing:
for listing in listing_generator:
depth=int(listing.getProperty('comment_depth'))
#add root comments and links on the listbox
if not listing.getProperty('link_url'):
if depth==0:
tlc_id+=1
listing.setProperty('tlc_id',str(tlc_id)) #assign an id to this top-level-comment
self.items_for_listbox.append(listing) #this post will be on the listbox
#log('tlc: '+listing.getProperty('plot'))
#save the set of comments from previous top level comment
self.child_lists.append(tlc_children)
#begin a new list of child comments(this does not clear the old refernces)
tlc_children=[]
tlc_children.append( self.get_post_text_tuple(listing) ) #save the post_text of the top level comment
else:
#collect the child comments. when depth=0 again, this list is reset.
child_comment=listing
#log(' : '+child_comment.getProperty('plot'))
tlc_children.append( self.get_post_text_tuple(child_comment) )
else: #link in tlc
if depth>0:
listing.setProperty('tlc_id',str(tlc_id))
listing.setProperty('non_tlc_link','true')
listing.setProperty('tlc_id',str(tlc_id))
self.items_for_listbox.append(listing)
#don't forget to add the children of the last tlc
self.child_lists.append(tlc_children)
#log(pprint.pformat(self.child_lists))
self.exit_monitor = ExitMonitor(self.close_gui)#monitors for abortRequested and calls close on the gui
#can't dynamically create an auto-height textbox inside a grouplist
# so we make x of them in the xml and hope they're enough
# these are their id's
self.x_controls=[x for x in range(1000, 1071)]