def onInit(self): self.title = 101 self.okbutton = 201 self.trakt = 301 self.debrid = 302 self.login = 303 self.sources = 304 self.profiles = 305 self.advanced = 306 self.favourites = 307 self.superfav = 308 self.repo = 309 self.whitelist = 310 self.cache = 311 self.packages = 312 self.thumbs = 313 self.showdialog() self.controllist = [self.trakt, self.debrid, self.login, self.sources, self.profiles, self.advanced, self.favourites, self.superfav, self.repo, self.whitelist, self.cache, self.packages, self.thumbs] self.controlsettings = ['keeptrakt', 'keepdebrid', 'keeplogin', 'keepsources', 'keepprofiles', 'keepadvanced', 'keepfavourites', 'keeprepos', 'keepsuper', 'keepwhitelist', 'clearcache', 'clearpackages', 'clearthumbs'] for item in self.controllist: if wiz.getS(self.controlsettings[self.controllist.index(item)]) == 'true': self.getControl(item).setSelected(True)
def doDismiss(self): if not test == True: wiz.setS("notedismiss", "true") wiz.log( "[Notification] NotifyID %s Dismissed" % wiz.getS('noteid'), xbmc.LOGNOTICE) self.close()
def doRemindMeLater(self): if not test == True: wiz.setS("notedismiss", "false") wiz.log( "[Notification] NotifyID %s Remind Me Later" % wiz.getS('noteid'), xbmc.LOGNOTICE) self.close()
def onInit(self): self.title = 101 self.okbutton = 201 self.trakt = 301 self.debrid = 302 self.login = 303 self.sources = 304 self.profiles = 305 self.advanced = 306 self.favourites = 307 self.superfav = 308 self.repo = 309 self.whitelist = 310 self.cache = 311 self.packages = 312 self.thumbs = 313 self.showdialog() self.controllist = [ self.trakt, self.debrid, self.login, self.sources, self.profiles, self.advanced, self.favourites, self.superfav, self.repo, self.whitelist, self.cache, self.packages, self.thumbs ] self.controlsettings = [ 'keeptrakt', 'keepdebrid', 'keeplogin', 'keepsources', 'keepprofiles', 'keepadvanced', 'keepfavourites', 'keeprepos', 'keepsuper', 'keepwhitelist', 'clearcache', 'clearpackages', 'clearthumbs' ] for item in self.controllist: if wiz.getS(self.controlsettings[self.controllist.index( item)]) == 'true': self.getControl(item).setSelected(True)
def doDismiss(self): if not test == True: wiz.setS("notedismiss","true") wiz.log("[Notification] NotifyID %s Dismissed" % wiz.getS('noteid'), xbmc.LOGNOTICE) self.close()
def doRemindMeLater(self): if not test == True: wiz.setS("notedismiss","false") wiz.log("[Notification] NotifyID %s Remind Me Later" % wiz.getS('noteid'), xbmc.LOGNOTICE) self.close()
def firstRunSettings(): class firstRun(xbmcgui.WindowXMLDialog): def __init__(self,*args,**kwargs): self.whitelistcurrent = kwargs['current'] def onInit(self): self.title = 101 self.okbutton = 201 self.trakt = 301 self.debrid = 302 self.login = 303 self.sources = 304 self.profiles = 305 self.advanced = 306 self.favourites = 307 self.superfav = 308 self.repo = 309 self.whitelist = 310 self.cache = 311 self.packages = 312 self.thumbs = 313 self.showdialog() self.controllist = [self.trakt, self.debrid, self.login, self.sources, self.profiles, self.advanced, self.favourites, self.superfav, self.repo, self.whitelist, self.cache, self.packages, self.thumbs] self.controlsettings = ['keeptrakt', 'keepdebrid', 'keeplogin', 'keepsources', 'keepprofiles', 'keepadvanced', 'keepfavourites', 'keeprepos', 'keepsuper', 'keepwhitelist', 'clearcache', 'clearpackages', 'clearthumbs'] for item in self.controllist: if wiz.getS(self.controlsettings[self.controllist.index(item)]) == 'true': self.getControl(item).setSelected(True) def showdialog(self): self.getControl(self.title).setLabel(ADDONTITLE) self.setFocus(self.getControl(self.okbutton)) def onClick(self, controlId): if controlId == self.okbutton: self.close() for item in self.controllist: at = self.controllist.index(item) if self.getControl(item).isSelected(): wiz.setS(self.controlsettings[at], 'true') else: wiz.setS(self.controlsettings[at], 'false') if self.getControl(self.whitelist).isSelected() and not self.whitelistcurrent == 'true': wiz.whiteList('edit') fr = firstRun( "FirstRunSaveData.xml" , ADDON.getAddonInfo('path'), 'DefaultSkin', current=wiz.getS('keepwhitelist')) fr.doModal() del fr
ADDONPATH = wiz.addonInfo(ADDON_ID,'path') ADDONTITLE = uservar.ADDONTITLE DIALOG = xbmcgui.Dialog() DP = xbmcgui.DialogProgress() HOME = xbmc.translatePath('special://home/') ADDONS = os.path.join(HOME, 'addons') USERDATA = os.path.join(HOME, 'userdata') PLUGIN = os.path.join(ADDONS, ADDON_ID) PACKAGES = os.path.join(ADDONS, 'packages') ADDONDATA = os.path.join(USERDATA, 'addon_data', ADDON_ID) FANART = os.path.join(ADDONPATH, 'fanart.jpg') ICON = os.path.join(ADDONPATH, 'icon.png') ART = os.path.join(ADDONPATH, 'resources', 'art') SKINFOLD = os.path.join(ADDONPATH, 'resources', 'skins', 'DefaultSkin', 'media') ADVANCED = os.path.join(USERDATA, 'advancedsettings.xml') NOTIFY = wiz.getS('notify') NOTEID = wiz.getS('noteid') NOTEDISMISS = wiz.getS('notedismiss') BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') LATESTVERSION = wiz.checkBuild(BUILDNAME, 'version') TODAY = date.today() KODIV = float(xbmc.getInfoLabel("System.BuildVersion")[:4]) TOMORROW = TODAY + timedelta(days=1) THREEDAYS = TODAY + timedelta(days=3) UPDATECHECK = uservar.UPDATECHECK if str(uservar.UPDATECHECK).isdigit() else 1 NEXTCHECK = TODAY + timedelta(days=UPDATECHECK) NOTIFICATION = uservar.NOTIFICATION ENABLE = uservar.ENABLE HEADERTYPE = uservar.HEADERTYPE if uservar.HEADERTYPE == 'Image' else 'Text' HEADERMESSAGE = uservar.HEADERMESSAGE
def firstRunSettings(): class firstRun(xbmcgui.WindowXMLDialog): def __init__(self, *args, **kwargs): self.whitelistcurrent = kwargs['current'] def onInit(self): self.title = 101 self.okbutton = 201 self.trakt = 301 self.debrid = 302 self.login = 303 self.sources = 304 self.profiles = 305 self.advanced = 306 self.favourites = 307 self.superfav = 308 self.repo = 309 self.whitelist = 310 self.cache = 311 self.packages = 312 self.thumbs = 313 self.showdialog() self.controllist = [ self.trakt, self.debrid, self.login, self.sources, self.profiles, self.advanced, self.favourites, self.superfav, self.repo, self.whitelist, self.cache, self.packages, self.thumbs ] self.controlsettings = [ 'keeptrakt', 'keepdebrid', 'keeplogin', 'keepsources', 'keepprofiles', 'keepadvanced', 'keepfavourites', 'keeprepos', 'keepsuper', 'keepwhitelist', 'clearcache', 'clearpackages', 'clearthumbs' ] for item in self.controllist: if wiz.getS(self.controlsettings[self.controllist.index( item)]) == 'true': self.getControl(item).setSelected(True) def showdialog(self): self.getControl(self.title).setLabel(ADDONTITLE) self.setFocus(self.getControl(self.okbutton)) def onClick(self, controlId): if controlId == self.okbutton: self.close() for item in self.controllist: at = self.controllist.index(item) if self.getControl(item).isSelected(): wiz.setS(self.controlsettings[at], 'true') else: wiz.setS(self.controlsettings[at], 'false') if self.getControl(self.whitelist).isSelected( ) and not self.whitelistcurrent == 'true': wiz.whiteList('edit') fr = firstRun("FirstRunSaveData.xml", ADDON.getAddonInfo('path'), 'DefaultSkin', current=wiz.getS('keepwhitelist')) fr.doModal() del fr
ADDONTITLE = uservar.ADDONTITLE DIALOG = xbmcgui.Dialog() DP = xbmcgui.DialogProgress() HOME = xbmc.translatePath('special://home/') ADDONS = os.path.join(HOME, 'addons') USERDATA = os.path.join(HOME, 'userdata') PLUGIN = os.path.join(ADDONS, ADDON_ID) PACKAGES = os.path.join(ADDONS, 'packages') ADDONDATA = os.path.join(USERDATA, 'addon_data', ADDON_ID) FANART = os.path.join(ADDONPATH, 'fanart.jpg') ICON = os.path.join(ADDONPATH, 'icon.png') ART = os.path.join(ADDONPATH, 'resources', 'art') SKINFOLD = os.path.join(ADDONPATH, 'resources', 'skins', 'DefaultSkin', 'media') ADVANCED = os.path.join(USERDATA, 'advancedsettings.xml') NOTIFY = wiz.getS('notify') NOTEID = wiz.getS('noteid') NOTEDISMISS = wiz.getS('notedismiss') BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') LATESTVERSION = wiz.checkBuild(BUILDNAME, 'version') TODAY = date.today() KODIV = float(xbmc.getInfoLabel("System.BuildVersion")[:4]) TOMORROW = TODAY + timedelta(days=1) THREEDAYS = TODAY + timedelta(days=3) UPDATECHECK = uservar.UPDATECHECK if str(uservar.UPDATECHECK).isdigit() else 1 NEXTCHECK = TODAY + timedelta(days=UPDATECHECK) NOTIFICATION = uservar.NOTIFICATION ENABLE = uservar.ENABLE HEADERTYPE = uservar.HEADERTYPE if uservar.HEADERTYPE == 'Image' else 'Text' HEADERMESSAGE = uservar.HEADERMESSAGE