Esempio n. 1
0
		def __init__(self,L=0,T=0,W=1280,H=720,TxtColor='0xFFFFFFFF',Font='font14',BorderWidth=10):
			if BUILDNAME == "" or not wiz.checkBuild(BUILDNAME, 'version'):
				bgArt   = ICON
				icon    = ICON
				build   = "Test Window"
				version = '1.0'
				latest  = '1.0'
			else:
				bgArt   = wiz.checkBuild(BUILDNAME, 'fanart')
				icon    = wiz.checkBuild(BUILDNAME, 'icon')
				build   = BUILDNAME
				version = BUILDVERSION
				latest  = wiz.checkBuild(BUILDNAME, 'version')
			wiz.log(bgArt)
			image_path = os.path.join(ART, 'ContentPanel.png')
			self.border = xbmcgui.ControlImage(L,T,W,H, image_path)
			self.addControl(self.border); 
			self.BG=xbmcgui.ControlImage(L+BorderWidth, T+BorderWidth, W-(BorderWidth*2), H-(BorderWidth*2), bgArt, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.BG)
			#title
			times = int(float(Font[-2:]))
			title = ADDONTITLE
			temp = title.replace('[', '<').replace(']', '>')
			temp = re.sub('<[^<]+?>', '', temp)
			title_width = len(str(temp))*(times - 1)
			title   = THEME2 % title
			self.title=xbmcgui.ControlTextBox(L+(W-title_width)/2,T+BorderWidth,title_width,30,font='font14',textColor='0xFF1E90FF')
			self.addControl(self.title)
			self.title.setText(title)
			#update
			if version < latest: msg = "Update avaliable for installed build:\n[COLOR %s]%s[/COLOR]\n\nCurrent Version: v[COLOR %s]%s[/COLOR]\nLatest Version: v[COLOR %s]%s[/COLOR]\n\n[COLOR %s]*Recommened: Fresh install[/COLOR]" % (COLOR1, build, COLOR1, version, COLOR1, latest, COLOR1)
			else: msg = "Running latest version of installed build:\n[COLOR %s]%s[/COLOR]\n\nCurrent Version: v[COLOR %s]%s[/COLOR]\nLatest Version: v[COLOR %s]%s[/COLOR]\n\n[COLOR %s]*Recommened: Fresh install[/COLOR]" % (COLOR1, build, COLOR1, version, COLOR1, latest, COLOR1)
			msg = THEME2 % msg
			self.update=xbmcgui.ControlTextBox(L+(BorderWidth*2),T+BorderWidth+30,W-150-(BorderWidth*3),H-(BorderWidth*2)-30,font=Font,textColor=TxtColor)
			self.addControl(self.update)
			self.update.setText(msg)
			#icon
			self.Icon=xbmcgui.ControlImage(L+W-(BorderWidth*2)-150, T+BorderWidth+35, 150, 150, icon, aspectRatio=0, colorDiffuse='0xAFFFFFFF')
			self.addControl(self.Icon)
			#buttons
			focus=os.path.join(ART, 'button-focus_lightblue.png'); nofocus=os.path.join(ART, 'button-focus_grey.png')
			w1      = int((W-(BorderWidth*5))/3); h1 = 35
			t       = int(T+H-h1-(BorderWidth*1.5))
			fresh   = int(L+(BorderWidth*1.5))
			normal  = int(fresh+w1+BorderWidth)
			ignore  = int(normal+w1+BorderWidth)
			
			self.buttonFRESH=xbmcgui.ControlButton(fresh,t, w1,h1,"Fresh Install",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.buttonNORMAL=xbmcgui.ControlButton(normal,t,w1,h1,"Normal Install",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.buttonIGNORE=xbmcgui.ControlButton(ignore,t,w1,h1,"Ignore 3 days",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.addControl(self.buttonFRESH); self.addControl(self.buttonNORMAL); self.addControl(self.buttonIGNORE)
			self.buttonIGNORE.controlLeft(self.buttonNORMAL); self.buttonIGNORE.controlRight(self.buttonFRESH)
			self.buttonNORMAL.controlLeft(self.buttonFRESH); self.buttonNORMAL.controlRight(self.buttonIGNORE)
			self.buttonFRESH.controlLeft(self.buttonIGNORE); self.buttonFRESH.controlRight(self.buttonNORMAL)
			self.setFocus(self.buttonFRESH)
Esempio n. 2
0
			elif int(id) > NOTEID:
				xbmc.log("Notifications id: %s" % str(int(id)))
				wiz.setS('noteid', str(int(id)))
				wiz.setS('notedismiss', 'false')
				openit=notify.Notification(msg=msg, title=HEADERMESSAGE, BorderWidth=10)			
				wiz.log("Notifications: Complete")
		else: wiz.log("Notifications URL(%s): %s" % (NOTIFICATION, url))
	else: wiz.log("Notifications: Turned Off")
else: wiz.log("Notifications: Not Enabled")

if INSTALLED == 'true':
	if not EXTRACT == '100':
		yes=DIALOG.yesno(ADDONTITLE, '%s was not installed correctly!' % BUILDNAME, 'Installed: %s / Error Count:%s' % (EXTRACT, EXTERROR), 'Would you like to try again?', nolabel='No Thanks!', yeslabel='Yes Please!')
		if yes: xbmc.executebuiltin("PlayMedia(plugin://%s/?mode=install&name=%s&url=fresh)" % (ADDON_ID, urllib.quote_plus(BUILDNAME)))
	elif SKIN in ['skin.confluence']:
		gui = wiz.checkBuild(BUILDNAME, 'gui')
		if gui == 'http://':
			DIALOG.ok(ADDONTITLE, "It looks like the skin settings was not applied to the build.", "Sadly no gui fix was attatched to the build", "You will need to reinstall the build and make sure to do a force close")
			wiz.log('Gui set to: http://')
		elif wiz.workingURL(gui):
			yes=DIALOG.yesno(ADDONTITLE, '%s was not installed correctly!' % BUILDNAME, 'It looks like the skin settings was not applied to the build.', 'Would you like to apply the guiFix?', nolabel='No Thanks!', yeslabel='Yes Please!')
			if yes: xbmc.executebuiltin("PlayMedia(plugin://%s/?mode=install&name=%s&url=gui)" % (ADDON_ID, urllib.quote_plus(BUILDNAME)))
			else: wiz.log('Gui url working but cancelled: %s' % gui)
		else:
			DIALOG.ok(ADDONTITLE, "It looks like the skin settings was not applied to the build.", "Sadly no gui fix was attatched to the build", "You will need to reinstall the build and make sure to do a force close")
			wiz.log('Gui url not working: %s' % gui)
	if KEEPTRAKT == 'true': traktit.traktIt('restore', 'all')
	if KEEPREAL  == 'true': debridit.debridIt('restore', 'all')
	wiz.clearS('install')

if not WORKING:
Esempio n. 3
0
        defaults = wiz.getS('defaultskin')
        if not defaults == '':
            if os.path.exists(os.path.join(ADDONS, defaults)):
                skinSwitch.swapSkins(defaults)
                x = 0
                xbmc.sleep(1000)
                while not xbmc.getCondVisibility(
                        "Window.isVisible(yesnodialog)") and x < 150:
                    x += 1
                    xbmc.sleep(200)

                if xbmc.getCondVisibility("Window.isVisible(yesnodialog)"):
                    wiz.ebi('SendClick(11)')
                    wiz.lookandFeelData('restore')
        if not wiz.currSkin() == defaults and not BUILDNAME == "":
            gui = wiz.checkBuild(BUILDNAME, 'gui')
            FAILED = True
            if gui == 'http://':
                wiz.log("[Installed Check] Guifix was set to http://",
                        xbmc.LOGNOTICE)
                DIALOG.ok(
                    ADDONTITLE,
                    "[COLOR %s]It looks like the skin settings was not applied to the build."
                    % COLOR2, "Sadly no gui fix was attatched to the build",
                    "You will need to reinstall the build and make sure to do a force close[/COLOR]"
                )
            elif wiz.workingURL(gui):
                yes = DIALOG.yesno(
                    ADDONTITLE,
                    '%s was not installed correctly!' % BUILDNAME,
                    'It looks like the skin settings was not applied to the build.',
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')
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
FONTSETTINGS   = uservar.FONTSETTINGS if not uservar.FONTSETTINGS == '' else "Font14"
BACKGROUND     = uservar.BACKGROUND if not uservar.BACKGROUND == '' or not wiz.workingURL(uservar.BACKGROUND) else FANART
HEADERTYPE     = uservar.HEADERTYPE if uservar.HEADERTYPE == 'Image' else 'Text'
HEADERMESSAGE  = uservar.HEADERMESSAGE
FONTHEADER     = uservar.FONTHEADER if not uservar.FONTHEADER == '' else "Font16"
HEADERIMAGE    = uservar.HEADERIMAGE
THEME1         = uservar.THEME1
Esempio n. 5
0
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    = 0
NEXTCHECK      = TODAY + timedelta(days=UPDATECHECK)
NOTIFICATION   = 'http://'
ENABLE         = 'No'
HEADERTYPE     = 'Text'
HEADERMESSAGE  = 'SalonDigital.....'
HEADERIMAGE    = ''
BACKGROUND     = ''
COLOR1         = 'red'
COLOR2         = 'white'
THEME1         = '[B][COLOR '+COLOR1+'][/COLOR][/B] [COLOR '+COLOR2+']%s[/COLOR]'