Guest User

Ares Decrypt

a guest
Jan 28th, 2016
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 214.48 KB | None | 0 0
  1. import pyxbmct.addonwindow as pyxbmct
  2. import xbmc, xbmcaddon, xbmcgui, xbmcplugin, os, sys
  3. import urllib2,urllib, re, base64
  4. import shutil, glob, json, os.path
  5. from xbmc import translatePath as translate
  6. from resources import maintenance, update, manageaddon, user, strings, settings, speedtest
  7. import string, random
  8. import datetime
  9. import time
  10. import ssl
  11.  
  12.  
  13.  
  14. basephpfile = 'ares.php'
  15. aresagent = "wizard"
  16.  
  17. addonid= 'script.areswizard'
  18. addon = xbmcaddon.Addon(addonid)
  19. addon_path = addon.getAddonInfo('path')
  20.  
  21.  
  22.  
  23.  
  24. images_path = os.path.join(addon_path, 'resources/images')
  25. resourcesfolder = os.path.join(addon_path, 'resources')
  26. checkicon = os.path.join(addon_path, 'icon.png')
  27. button_default = os.path.join(images_path, 'button_default.png')
  28. button_focus = os.path.join(images_path, 'button_selected.png')
  29. star_image = os.path.join(images_path, 'star.png')
  30. userdatafolder = translate('special://home/userdata/')
  31. advancedxmlfile = os.path.join(userdatafolder, 'advancedsettings.xml')
  32. tempadvancedxmlfile = os.path.join(resourcesfolder, 'asettings.xml')
  33. datapath = xbmc.translatePath(addon.getAddonInfo('profile'))
  34. settingsfile = os.path.join(datapath, 'settings')
  35. listtexture = os.path.join(images_path, 'listtexture.png')
  36. slidertexture = os.path.join(images_path, 'slider_bg.png')
  37. splashfile = os.path.join(images_path, 'splash.png')
  38. maintenanceimagepng = os.path.join(images_path, 'maintenance.png')
  39.  
  40. trafficgreen = os.path.join(images_path, 'green.png')
  41. trafficamber = os.path.join(images_path, 'amber.png')
  42. trafficred = os.path.join(images_path, 'red.png')
  43. scrolldown = os.path.join(images_path, 'down.png')
  44. homefolder = translate('special://home/')
  45. cachePath = os.path.join(xbmc.translatePath('special://home'), 'cache')
  46. tempPath = os.path.join(xbmc.translatePath('special://home'), 'temp')
  47. packagespath = xbmc.translatePath(os.path.join('special://home/addons/packages', ''))
  48. thumbnailpath = xbmc.translatePath(os.path.join('special://home/userdata/Thumbnails', ''))
  49. buildinstallpng = os.path.join(images_path, 'buildinstall.png')
  50. datadir = translate('special://home/userdata/addon_data/script.areswizard')
  51.  
  52.  
  53. update.checkupdate('free', 'free', 'free') 
  54.  
  55.  
  56.  
  57.  
  58. try:
  59.     _create_unverified_https_context = ssl._create_unverified_context
  60. except AttributeError:
  61.     # Legacy Python that doesn't verify HTTPS certificates by default
  62.     pass
  63. else:
  64.     # Handle target environment that doesn't support HTTPS verification
  65.     ssl._create_default_https_context = _create_unverified_https_context
  66.    
  67.    
  68.  
  69.  
  70.  
  71. global username
  72. username = xbmcplugin.getSetting(int(sys.argv[1]), 'username')
  73. global password
  74. password = xbmcplugin.getSetting(int(sys.argv[1]), 'password')
  75. global email
  76. email = xbmcplugin.getSetting(int(sys.argv[1]), 'email')
  77. global accountstatus
  78. accountstatus = xbmcplugin.getSetting(int(sys.argv[1]), 'accountstatus')
  79. global debuglog
  80.  
  81. global wizardversion
  82. wizardversion = "0.0.26"
  83. global userlevel
  84. userlevel = ""
  85. global Subends
  86. Subends = ""
  87. global Banned
  88. Banned = ""
  89. global BanReason
  90. BanReason = ""
  91. global deviceid
  92. deviceid = ""
  93.  
  94.  
  95. try:
  96.     debuglog = xbmcplugin.getSetting(int(sys.argv[1]), 'debuglog')
  97. except:
  98.     debuglog = "0"
  99.  
  100. # dialog = xbmcgui.Dialog()
  101. # dialog.ok("FOR TESTING PURPOSES ONLY", "This is a pre-release test version of 0.0.26 - not meant to go public. Use at your own risk")
  102.  
  103.  
  104. def regex_from_to(text, from_string, to_string, excluding=True):
  105.     if excluding:
  106.        try: r = re.search("(?i)" + from_string + "([\S\s]+?)" + to_string, text).group(1)
  107.        except: r = ''
  108.     else:
  109.        try: r = re.search("(?i)(" + from_string + "[\S\s]+?" + to_string + ")", text).group(1)
  110.        except: r = ''
  111.     return r
  112.  
  113.  
  114. def getsysinfo():
  115.  
  116.     global gpu
  117.     global kernel
  118.     global mac
  119.     global cpufreq
  120.     global kodiver
  121.     global kodiplatform
  122.     global kodirelease
  123.     global kodirunningon
  124.     global kodihostcpu
  125.     global ip
  126.     global city
  127.     global country
  128.     global isp
  129.  
  130.    
  131.  
  132.     if debuglog == "true":
  133.         print ' '
  134.         print '@ares: sysinfo: '
  135.         print ' '
  136.         print '@ares: grabbing cpufreq'
  137.        
  138.     global cpufreq 
  139.     cpufreq = xbmc.getInfoLabel('System.CpuFrequency')
  140.        
  141.     while "MHz" not in cpufreq:
  142.         cpufreq = xbmc.getInfoLabel('System.CpuFrequency') 
  143.        
  144.     cpufreq = cpufreq.decode('utf-8')
  145.        
  146.        
  147.    
  148.     if debuglog == "true":
  149.         print '@ares: grabbing gpu'
  150.  
  151.        
  152.     global gpu 
  153.     gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
  154.    
  155.     while "GPU:" not in gpu:
  156.         gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
  157.        
  158.     gpu = gpu.strip("GPU: ")
  159.        
  160.     if debuglog == "true":
  161.         print '@ares: grabbing kernel' 
  162.        
  163.     gpu = gpu.decode('utf-8')
  164.    
  165.    
  166.     global kernel  
  167.     kernel = xbmc.getInfoLabel('System.KernelVersion')
  168.            
  169.     while "kernel" not in kernel:
  170.         kernel = xbmc.getInfoLabel('System.KernelVersion')
  171.        
  172.     kernel = kernel.decode('utf-8')
  173.        
  174.        
  175.     if debuglog == "true":
  176.         print '@ares: grabbing mac'    
  177.    
  178.    
  179.     global mac
  180.     mac = xbmc.getInfoLabel('Network.MacAddress')
  181.            
  182.     while mac.find(':') == -1:
  183.         mac = xbmc.getInfoLabel('Network.MacAddress')
  184.        
  185.        
  186.     mac = mac.decode('utf-8')
  187.    
  188.    
  189.    
  190.     kodilogfile = os.path.join(xbmc.translatePath('special://logpath'), 'kodi.log')
  191.     xbmclogfile = os.path.join(xbmc.translatePath('special://logpath'), 'xbmc.log')
  192.     spmclogfile = os.path.join(xbmc.translatePath('special://logpath'), 'spmc.log')
  193.     tvmclogfile = os.path.join(xbmc.translatePath('special://logpath'), 'tvmc.log')
  194.    
  195.     if os.path.isfile(tvmclogfile):
  196.         logfile = tvmclogfile
  197.     elif os.path.isfile(spmclogfile):
  198.         logfile = spmclogfile
  199.     elif os.path.isfile(kodilogfile):
  200.         logfile = kodilogfile
  201.     elif os.path.isfile(xbmclogfile):
  202.         logfile = xbmclogfile
  203.     else:
  204.         pass
  205.    
  206.     try:
  207.    
  208.         filehandle = open(logfile, 'r')
  209.         logfilecontents = filehandle.read()
  210.        
  211.         global kodiver
  212.         kodiver = regex_from_to(logfilecontents, 'NOTICE: Starting ', '\).')
  213.         kodiver = kodiver.decode('utf-8')
  214.        
  215.         global kodiplatform
  216.         kodiplatform = regex_from_to(logfilecontents, '. Platform: ', '\n')
  217.         kodiplatform = kodiplatform.decode('utf-8')
  218.        
  219.         global kodirelease
  220.         kodirelease = regex_from_to(logfilecontents, 'NOTICE: Using ', '\n')
  221.         kodirelease = kodirelease.decode('utf-8')
  222.        
  223.         global kodirunningon
  224.         kodirunningon = regex_from_to(logfilecontents, 'NOTICE: Running on ', ',')
  225.         kodirunningon = kodirunningon.decode('utf-8')
  226.        
  227.         global kodihostcpu
  228.         kodihostcpu = regex_from_to(logfilecontents, 'NOTICE: Host CPU: ', ',')
  229.         kodihostcpu = kodihostcpu.decode('utf-8')
  230.        
  231.     except:
  232.        
  233.         kodiver = "Unknown"
  234.         kodiplatform = "Unknown"
  235.         kodirelease = "Unknown"
  236.         kodirunningon = "Unknown"
  237.         kodihostcpu = "Unknown"
  238.        
  239.    
  240.    
  241.     if debuglog == "true":
  242.         print '@ares: https://www.privateinternetaccess.com/pages/whats-my-ip/'
  243.    
  244.     try:
  245.    
  246.        
  247.         url = 'https://www.privateinternetaccess.com/pages/whats-my-ip/'
  248.         req = urllib2.Request(url)
  249.         req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
  250.         response = urllib2.urlopen(req)
  251.         link=response.read()
  252.         response.close()
  253.        
  254.         #global ip
  255.         ip = regex_from_to(link, 'IP Address:<span style="font-weight:bold"> ', '</span>')
  256.         #global city
  257.         city = regex_from_to(link, 'City</span>:<span style="font-weight:bold"> ', '</span>')
  258.         #global country
  259.         country = regex_from_to(link, 'Country:<span style="font-weight:bold"> ', '</span>')
  260.         #global isp
  261.         isp = regex_from_to(link, 'Internet Service Provider:<span style="font-weight:bold"> ', '</span>')
  262.        
  263.     except:
  264.         ip = ""
  265.  
  266.    
  267.    
  268.     if ip == "":
  269.    
  270.         if debuglog == "true":
  271.             print '@ares: ip not detected, falling back to http://whatismyipaddress.com/'
  272.            
  273.         try:
  274.        
  275.             url = 'http://whatismyipaddress.com/'
  276.             req = urllib2.Request(url)
  277.             req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
  278.             response = urllib2.urlopen(req)
  279.             link=response.read()
  280.             response.close()
  281.            
  282.             #global ip
  283.             ip = regex_from_to(link, '26px;text-decoration:none;">', '</a>')
  284.             #global city
  285.             city = regex_from_to(link, 'City:</th><td style="font-size:14px;">', '</td>')
  286.             #global country
  287.             country = regex_from_to(link, 'Country:</th><td style="font-size:14px;">', '</td>')
  288.             #global isp
  289.             isp = regex_from_to(link, 'ISP:</th><td style="font-size:14px;">', '</td>')
  290.            
  291.         except:
  292.        
  293.             pass
  294.        
  295.        
  296.        
  297.        
  298.    
  299.  
  300.    
  301.     city = city.decode('utf-8')
  302.     country = country.decode('utf-8')
  303.     isp = isp.decode('utf-8')
  304.    
  305.    
  306.    
  307.    
  308.    
  309.    
  310.    
  311.    
  312.    
  313.    
  314.    
  315.    
  316.     if debuglog == "true":
  317.         print '@ares: ip: ' + ip
  318.         print '@ares: city: ' + city
  319.         print '@ares: country: ' + country
  320.         print '@ares: isp: ' + isp
  321.         print '@ares: deviceid: ' + deviceid
  322.         print '@ares: cpu freq: ' + cpufreq
  323.         print '@ares: gpu: ' + gpu
  324.         print '@ares: kernel: ' + kernel
  325.         print '@ares: mac: ' + mac
  326.         print '@ares: kodiver: ' + kodiver
  327.         print '@ares: kodiplatform: ' + kodiplatform
  328.         print '@ares: kodirelease: ' + kodirelease
  329.         print '@ares: kodirunningon: ' + kodirunningon
  330.         print '@ares: kodihostcpu: ' + kodihostcpu
  331.    
  332.    
  333.    
  334.    
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342. global showadult
  343. try:
  344.     showadult = xbmcplugin.getSetting(int(sys.argv[1]), 'showadult')
  345. except:
  346.     showadult = "0"
  347.  
  348.  
  349.  
  350.  
  351.    
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359. try:
  360.    
  361.     with open(settingsfile, 'r',0) as f:
  362.         config = json.load(f)
  363.  
  364.     deviceid = config['deviceid']
  365.    
  366.     if len(deviceid) <> 16:
  367.        
  368.         length=16
  369.         deviceid = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
  370.  
  371.        
  372.  
  373.         if not os.path.exists(datapath):
  374.             os.makedirs(datapath)
  375.        
  376.  
  377.     settings.write('deviceid', deviceid)
  378.    
  379.  
  380. except:
  381.  
  382.        
  383.     length=16
  384.     deviceid = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
  385.    
  386.     if not os.path.exists(datapath):
  387.         os.makedirs(datapath)
  388.    
  389.     config = {'deviceid': deviceid}
  390.    
  391.     with open(settingsfile, 'w') as f:
  392.             json.dump(config, f)
  393.             f.close
  394.  
  395.     settings.write('deviceid', deviceid)
  396.    
  397.  
  398. if debuglog == "true":
  399.     print '@ares: login start'
  400.  
  401.  
  402.  
  403. global mac
  404. try:
  405.     mac
  406. except:
  407.     getsysinfo()
  408.  
  409.  
  410. if username == "":
  411.     addon.setSetting("username", "free")
  412.     addon.setSetting("accountstatus", "free")
  413.     accountstatus = "free"
  414.     username = "free"
  415.     userlevel = "free"
  416.     addon.setSetting("activationsleft", '')
  417.     addon.setSetting("Subends", '')
  418.    
  419.    
  420.  
  421.  
  422.  
  423. url = username+'&pass='+password+'&deviceid='+deviceid+'&mac='+mac+'&kernel='+kernel+'&cpufreq='+cpufreq+'&gpu='+gpu+'&kodiver='+kodiver+'&kodiplatform='+kodiplatform+'&kodirelease='+kodirelease+'&ip='+ip+'&city='+city+'&country='+country+'&isp='+isp+'&kodirunningon='+kodirunningon+'&kodihostcpu='+kodihostcpu+'&time=' + datetime.datetime.now().strftime('%S')
  424.  
  425. nospaces = url.replace (" ", "%20")
  426.  
  427. url = 'http://107.150.47.139/~areswizard/'+ basephpfile+'?action=login&user=' + nospaces
  428.  
  429.  
  430. if debuglog == "true":
  431.     print '@ares: login url = ' + str(url)
  432.  
  433. # print 'URL>>>>>>'
  434. # print url
  435.  
  436. req = urllib2.Request(url)
  437. req.add_header('User-Agent', aresagent)
  438.  
  439. try:
  440.     response = urllib2.urlopen(req)
  441.     global configraw
  442.     configraw = response.read()
  443.  
  444.     if debuglog == "true":
  445.         print '@ares: configraw = ' + str(configraw)
  446. except:
  447.     loginstatus = 'loginerror'
  448.     configraw = 'error'
  449.    
  450.    
  451.    
  452. if configraw == "devicemac-mismatch":
  453.     print '@ares: devicemac-mismatch, resetting account'
  454.     loginstatus = 'devicemac-mismatch'
  455.    
  456.    
  457. if configraw == "mac0":
  458.     print '@ares: mac address not detected'
  459.     loginstatus = 'mac0'
  460.    
  461. if configraw == "inserted":
  462.     print '@ares: new free account created'
  463.     loginstatus = 'inserted'
  464.    
  465. if configraw == "user-not-found":
  466.     print '@ares: user not found'
  467.     loginstatus = 'user-not-found'
  468.  
  469.  
  470. try:
  471.    
  472.     data = json.loads(configraw)   
  473.  
  474.     #print(data)
  475.  
  476.     for entry in data:
  477.         userlevel = entry['userlevel']
  478.         Subends = entry['Subends']
  479.         Banned = entry['Banned']
  480.         BanReason = entry['BanReason']
  481.         regremain = entry['regremain']
  482.         serverdeviceip = entry['deviceid']
  483.                
  484. except:
  485.  
  486.     if username == "free":
  487.    
  488.  
  489.         try:
  490.        
  491.             data = json.loads(configraw)   
  492.  
  493.             #print(data)
  494.  
  495.             for entry in data:
  496.                 Banned = entry['Banned']
  497.                 BanReason = entry['BanReason']
  498.                 serverdeviceip = entry['deviceid']
  499.                
  500.                
  501.             if Banned <> "":
  502.                 addon.setSetting("accountstatus", "Banned")
  503.                 dialog = xbmcgui.Dialog()
  504.                 dialog.ok("Banned", BanReason)         
  505.                 sys.exit() 
  506.            
  507.            
  508.             settings.write('deviceid', serverdeviceip)
  509.             addon.setSetting("deviceid", serverdeviceip)               
  510.             loginstatus = 'inserted'
  511.            
  512.         except:
  513.             loginstatus = 'loginerror'
  514.            
  515.            
  516.        
  517.            
  518.         else:
  519.  
  520.             loginstatus = 'loginerror'
  521.                
  522.     else:          
  523.                
  524.         loginstatus = configraw
  525.  
  526.  
  527.  
  528.  
  529. if not username == "free":
  530.  
  531.     try:
  532.         addon.setSetting("Subends", Subends)
  533.         addon.setSetting("activationsleft", regremain)
  534.         addon.setSetting("accountstatus", userlevel)
  535.     except:
  536.         pass
  537.  
  538.  
  539.     if Banned <> "":
  540.         addon.setSetting("accountstatus", "Banned")
  541.         dialog = xbmcgui.Dialog()
  542.         dialog.ok("Banned", BanReason)         
  543.         sys.exit()
  544.        
  545.    
  546.     if userlevel == "admin":
  547.         addon.setSetting("accountstatus", "admin")
  548.         if debuglog == "true":
  549.             print '@ares: admin login confirmed'
  550.        
  551.    
  552.     if userlevel == "staff":
  553.         addon.setSetting("accountstatus", "staff")
  554.         if debuglog == "true":
  555.             print '@ares: staff login confirmed'
  556.        
  557.    
  558.     if userlevel == "Registered":
  559.         addon.setSetting("accountstatus", "Registered")
  560.         if debuglog == "true":
  561.             print '@ares: login confirmed'
  562.            
  563.            
  564.     if userlevel == "awaiting_activation":
  565.         addon.setSetting("accountstatus", "awaiting_activation")
  566.         if debuglog == "true":
  567.             print '@ares: login confirmed'
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577. if loginstatus == "loginerror":
  578.     addon.setSetting("accountstatus", "free")
  579.    
  580.    
  581.    
  582. elif loginstatus == "inserted":
  583.     addon.setSetting("username", "free")
  584.     addon.setSetting("accountstatus", "free")
  585.     accountstatus = "free"
  586.     username = "free"
  587.     userlevel = "free"
  588.     addon.setSetting("activationsleft", '')
  589.     addon.setSetting("Subends", '')
  590.    
  591.    
  592. elif loginstatus == "user-not-found":
  593.     addon.setSetting("username", "free")
  594.     addon.setSetting("accountstatus", "free")
  595.     accountstatus = "free"
  596.     username = "free"
  597.     userlevel = "free"
  598.     addon.setSetting("activationsleft", '')
  599.     addon.setSetting("Subends", '')
  600.    
  601.    
  602. else:
  603.     try:
  604.         data = json.loads(loginstatus) 
  605.  
  606.                 #print(data)
  607.  
  608.         for entry in data:
  609.             if username <> "free":
  610.                 Subends = entry['Subends']
  611.             userlevel = entry['userlevel']
  612.             Banned = entry['Banned']
  613.             BanReason = entry['BanReason']
  614.     except:
  615.         pass
  616.        
  617.        
  618.        
  619.    
  620.  
  621.  
  622.        
  623.     # dialog = xbmcgui.Dialog()
  624.     # dialog.ok("Result", "userlevel: " + userlevel + "\n" + "Subends: " + Subends + "\n" + "Banned: " + Banned + "\n" + "BanReason: " + BanReason, "", "")
  625.        
  626.  
  627.    
  628. def changelog():
  629.     try:
  630.         import xbmc,xbmcgui,xbmcaddon,xbmcvfs
  631.  
  632.         f = xbmcvfs.File(xbmcaddon.Addon().getAddonInfo('changelog'))
  633.         text = f.read() ; f.close()
  634.  
  635.         label = '%s - %s' % (xbmc.getLocalizedString(24054), xbmcaddon.Addon().getAddonInfo('name'))
  636.  
  637.         id = 10147
  638.  
  639.         xbmc.executebuiltin('ActivateWindow(%d)' % id)
  640.         xbmc.sleep(100)
  641.  
  642.         win = xbmcgui.Window(id)
  643.  
  644.         retry = 50
  645.         while (retry > 0):
  646.             try:
  647.                 xbmc.sleep(10)
  648.                 win.getControl(1).setLabel(label)
  649.                 win.getControl(5).setText(text)
  650.                 retry = 0
  651.             except:
  652.                 retry -= 1
  653.  
  654.         return id
  655.     except:
  656.         return id
  657.  
  658. firstrun=xbmcplugin.getSetting(int(sys.argv[1]), 'firstrun')
  659. if firstrun == 'true':
  660.     changelogwindow = changelog()
  661.     time.sleep(10)
  662.     addon.setSetting('firstrun','false')
  663.  
  664.  
  665.  
  666.  
  667. global freerambytes
  668. freerambytes = 1
  669. global currentcachesize
  670. currentcachesize = 0
  671. global freerambytesstring
  672. freerambytesstring = ""
  673.  
  674.  
  675.  
  676. global currentlist
  677. currentlist = ""
  678.  
  679. window = pyxbmct.AddonDialogWindow('')
  680. window.setGeometry(1240, 650, 300, 160)
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688. def hidecontrols():
  689.    
  690.     scrolldownimage.setVisible(False)
  691.     sizelabel.setVisible(False)
  692.     sizetextlabel.setVisible(False)
  693.     buildotherlist.setVisible(False)
  694.     buildmainlist.setVisible(False)
  695.     repairbuildbutton.setVisible(False)
  696.     freshstartbutton.setVisible(False)
  697.     installbuildbutton.setVisible(False)
  698.     maint_totallocalspacelabel.setVisible(False)
  699.     maint_totallocalfileslabel.setVisible(False)
  700.     speedtestimage.setVisible(False)
  701.     speedtestimage2.setVisible(False)
  702.     speedtestimage3.setVisible(False)
  703.     dospeedtestbutton.setVisible(False)
  704.     speedtestprevlabel.setVisible(False)
  705.  
  706.     maintenanceimage.setVisible(False)
  707.     maint_cache_amber.setVisible(False)
  708.     maint_cache_green.setVisible(False)
  709.     maint_cache_label.setVisible(False)
  710.     maint_cache_label2.setVisible(False)
  711.     maint_cache_label3.setVisible(False)
  712.     maint_cache_label4.setVisible(False)
  713.     maint_cache_label5.setVisible(False)
  714.     maint_cache_label6.setVisible(False)
  715.     maint_cache_label7.setVisible(False)
  716.     maint_cache_red.setVisible(False)
  717.     maint_packages_amber.setVisible(False)
  718.     maint_packages_green.setVisible(False)
  719.     maint_packages_label.setVisible(False)
  720.     maint_packages_label2.setVisible(False)
  721.     maint_packages_label3.setVisible(False)
  722.     maint_packages_label4.setVisible(False)
  723.     maint_packages_label5.setVisible(False)
  724.     maint_packages_red.setVisible(False)
  725.     maint_thumb_amber.setVisible(False)
  726.     maint_thumb_green.setVisible(False)
  727.     maint_thumb_label.setVisible(False)
  728.     maint_thumb_label2.setVisible(False)
  729.     maint_thumb_label3.setVisible(False)
  730.     maint_thumb_label4.setVisible(False)
  731.     maint_thumb_label5.setVisible(False)
  732.     maint_thumb_red.setVisible(False)
  733.     fullautomaintcacheradio.setVisible(False)
  734.     fullyautomaintenancelabel1.setVisible(False)
  735.     fullyautomaintenancelabel2.setVisible(False)
  736.     fullautomaintcacheradio.setVisible(False)
  737.     fullautomaintmonthradio.setVisible(False)
  738.     fullautomaintpackagesradio.setVisible(False)
  739.     fullautomaintquarterradio.setVisible(False)
  740.     fullautomaintthumbradio.setVisible(False)
  741.     fullautomaintweekradio.setVisible(False)
  742.     fullautomaintenanceradio.setVisible(False)
  743.    
  744.     cacheinclude_genesis.setVisible(False)
  745.     cacheinclude_navix.setVisible(False)
  746.     cacheinclude_ivue.setVisible(False)
  747.     cacheinclude_youtube.setVisible(False)
  748.     cacheinclude_pulsar.setVisible(False)
  749.     cacheinclude_salts.setVisible(False)
  750.    
  751.    
  752.     morelist.setVisible(False)
  753.     splashimage.setVisible(False)
  754.     unblocklabelbad.setVisible(False)
  755.     unblockurlbutton.setVisible(False)
  756.     unblocklabel5.setVisible(False)
  757.     unblocklabel4.setVisible(False)
  758.     unblocklabel3.setVisible(False)
  759.     unblocklabel2.setVisible(False)
  760.     unblocklabel.setVisible(False)
  761.     automaintenanceradio.setVisible(False)
  762.     automaintenancefreqmonthly.setVisible(False)
  763.     automaintenancefreqweekly.setVisible(False)
  764.     automaintenancefreqdaily.setVisible(False)
  765.     automaintenancefreqeverytime.setVisible(False)
  766.     automaintenancelabel1.setVisible(False)
  767.     automaintenanceradio.setVisible(False)
  768.     downloadslabel.setVisible(False)
  769.     downloadstextlabel.setVisible(False)
  770.    
  771.     votebuildbutton.setVisible(False)
  772.     voterepobutton.setVisible(False)
  773.     buffermodelabel.setVisible(False)
  774.     mode1radiobutton.setVisible(False)
  775.     mode2radiobutton.setVisible(False)
  776.     mode3radiobutton.setVisible(False)
  777.     mode4radiobutton.setVisible(False)
  778.    
  779.     slider3.setVisible(False)
  780.     readbufferfactorlabel.setVisible(False)
  781.     currentrbfsetting.setVisible(False)
  782.     slider3value.setVisible(False)
  783.     recommendedrbfsetting.setVisible(False)
  784.     slider2.setVisible(False)
  785.     curltimelabel.setVisible(False)
  786.     currentcurlsetting.setVisible(False)
  787.     slider2value.setVisible(False)
  788.     recommendedcurlsetting.setVisible(False)
  789.  
  790.     videcachesizelabel.setVisible(False)
  791.     recommendedramsetting.setVisible(False)
  792.  
  793.     slider1value.setVisible(False)
  794.     slider1.setVisible(False)
  795.     tweakcache_page2intro.setVisible(False)
  796.     currentramsetting.setVisible(False)
  797.     addaddonbyrepobutton.setVisible(False)
  798.     updateaddonbutton.setVisible(False)
  799.  
  800.     cachetweak_1stline.setVisible(False)
  801.     cachetweak_2ndline.setVisible(False)
  802.     tweakcachelabel1.setVisible(False)
  803.     tweakcachelabel2.setVisible(False)
  804.     tweakcachelabel3.setVisible(False)
  805.     tweakcache_page1button.setVisible(False)
  806.     tweakcache_page2button.setVisible(False)
  807.     applycachetweakbutton.setVisible(False)
  808.     tweakcache_page2button.setVisible(False)
  809.  
  810.    
  811.    
  812.     introlabel.setVisible(False)
  813.     buildlist.setVisible(False)
  814.     addonlist.setVisible(False)
  815.     windowimage2.setVisible(False)
  816.     windowimage3.setVisible(False)
  817.     addontypelist.setVisible(False)
  818.     repolist.setVisible(False)
  819.     windowimage.setVisible(False)
  820.     windowimage2.setVisible(False)
  821.     windowimage3.setVisible(False)
  822.     namelabel.setVisible(False)
  823.     authorlabel.setVisible(False)
  824.     statuslabel.setVisible(False)
  825.     statustextlabel.setVisible(False)
  826.     recversionlabel.setVisible(False)
  827.     recversiontextlabel.setVisible(False)
  828.     installedversionlabel.setVisible(False)
  829.     installedversiontextlabel.setVisible(False)
  830.     uninstalladdonbutton.setVisible(False)
  831.     installaddonbutton.setVisible(False)
  832.     voteaddonbutton.setVisible(False)
  833.     voteslabel.setVisible(False)
  834.     votestextlabel.setVisible(False)
  835.     ratingtextlabel.setVisible(False)
  836.     star1.setVisible(False)
  837.     star2.setVisible(False)
  838.     star3.setVisible(False)
  839.     star4.setVisible(False)
  840.     star5.setVisible(False)
  841.     deletecachebuttonv2.setVisible(False)
  842.     deletecachelabel.setVisible(False)
  843.     deletepackageslabel.setVisible(False)
  844.     deletepackagesbuttonv2.setVisible(False)
  845.     deletethumbnailsbuttonv2.setVisible(False)
  846.     deletethumbnailslabel.setVisible(False)
  847.    
  848.    
  849.    
  850.     kerneltextlabel.setVisible(False)
  851.     kernellabel.setVisible(False)
  852.     cpufreqtextlabel.setVisible(False)
  853.     cpufreqlabel.setVisible(False)
  854.     gputextlabel.setVisible(False)
  855.     gpulabel.setVisible(False)
  856.     kodiversiontextlabel.setVisible(False)
  857.     kodiversionlabel.setVisible(False)
  858.     kodibuildtextlabel.setVisible(False)
  859.     kodibuildlabel.setVisible(False)
  860.     screenmodetextlabel.setVisible(False)
  861.     screenmodelabel.setVisible(False)
  862.     networkstatetextlabel.setVisible(False)
  863.     networkstatelabel.setVisible(False)
  864.     internaliptextlabel.setVisible(False)
  865.     internaliplabel.setVisible(False)
  866.     macaddresstextlabel.setVisible(False)
  867.     macaddresslabel.setVisible(False)
  868.     gatewaytextlabel.setVisible(False)
  869.     gatewaylabel.setVisible(False)
  870.     dnstextlabel.setVisible(False)
  871.     dnslabel.setVisible(False)
  872.     interetstatetextlabel.setVisible(False)
  873.     internetstatelabel.setVisible(False)
  874.     cputemptextlabel.setVisible(False)
  875.     cputemplabel.setVisible(False)
  876.     cpuuseagetextlabel.setVisible(False)
  877.     cpuusagelabel.setVisible(False)
  878.     freestoragetextlabel.setVisible(False)
  879.     freestoragelabel.setVisible(False)
  880.     usedstoragetextlabel.setVisible(False)
  881.     usedstoragelabel.setVisible(False)
  882.     totalstoragetextlabel.setVisible(False)
  883.     totalstoragelabel.setVisible(False)
  884.     freeramtextlabel.setVisible(False)
  885.     freeramlabel.setVisible(False)
  886.     externaliptextlabel.setVisible(False)
  887.     externaliplabel.setVisible(False)
  888.     isptextlabel.setVisible(False)
  889.     isplabel.setVisible(False)
  890.     countrytextlabel.setVisible(False)
  891.     countrylabel.setVisible(False)
  892.     citytextlabel.setVisible(False)
  893.     citylabel.setVisible(False)
  894.    
  895.     maintenancelabel.setVisible(False)
  896.     tweakslist.setVisible(False)
  897.     tweakcachelabel1.setVisible(False)
  898.     tweakcache_page1button.setVisible(False)
  899.    
  900.  
  901.  
  902. def get_size(start_path):
  903.  
  904.     global total_files
  905.     global total_size
  906.  
  907.    
  908.     total_size = 0
  909.     total_files = 0
  910.     for dirpath, dirnames, filenames in os.walk(start_path):
  911.         for f in filenames:
  912.             fp = os.path.join(dirpath, f)
  913.             total_size += os.path.getsize(fp)
  914.             total_files = total_files + 1
  915.     return total_size
  916.    
  917.    
  918. def get_sizeroot():
  919.  
  920.     global total_files
  921.     global total_size
  922.  
  923.    
  924.     total_size = 0
  925.     total_files = 0
  926.    
  927.     total_files = len([f for f in os.listdir(homefolder)
  928.                 if os.path.isfile(os.path.join(homefolder, f))])
  929.                
  930.     total_size = os.path.getsize(homefolder)
  931.     for item in os.listdir(homefolder):
  932.         itempath = os.path.join(homefolder, item)
  933.         if os.path.isfile(itempath):
  934.             total_size += os.path.getsize(itempath)
  935.    
  936.    
  937.  
  938.     return total_size
  939.    
  940.    
  941.  
  942.    
  943. def gettempandcache():
  944.  
  945.     global tempandcachefiles
  946.     global tempandcachesize
  947.     global total_files
  948.     global total_size
  949.    
  950.     tempandcachefiles = 0
  951.     tempandcachesize = 0
  952.     total_files = 0
  953.     total_size = 0
  954.    
  955.     get_size(tempPath)
  956.     tempandcachefiles = tempandcachefiles + total_files
  957.     tempandcachesize = tempandcachesize + (total_size/1024/1024)
  958.    
  959.     total_files = 0
  960.     total_size = 0
  961.    
  962.     get_size(cachePath)
  963.     tempandcachefiles = tempandcachefiles + total_files
  964.     tempandcachesize = tempandcachesize + (total_size/1024/1024)
  965.    
  966.     total_files = 0
  967.     total_size = 0
  968.    
  969.     get_sizeroot()
  970.     tempandcachefiles = tempandcachefiles + total_files
  971.     tempandcachesize = tempandcachesize + (total_size/1024/1024)
  972.    
  973.    
  974.        
  975.        
  976.     try:
  977.  
  978.  
  979.         with open(settingsfile, 'r',0) as f:
  980.             config = json.load(f)
  981.  
  982.             cacheinclude_genesis_setting = config['cacheinclude_genesis']
  983.             cacheinclude_navix_setting = config['cacheinclude_navix']
  984.             cacheinclude_youtube_setting = config['cacheinclude_youtube']
  985.             cacheinclude_ivue_setting = config['cacheinclude_ivue']
  986.             cacheinclude_salts_setting = config['cacheinclude_salts']
  987.             cacheinclude_pulsar_setting = config['cacheinclude_pulsar']
  988.            
  989.            
  990.         if cacheinclude_genesis_setting == "yes":
  991.            
  992.             genesisdatafolder = translate('special://home/userdata/addon_data/plugin.video.genesis')
  993.            
  994.             total_files = 0
  995.             total_size = 0
  996.            
  997.             genesisfile_cache = os.path.join(xbmc.translatePath(genesisdatafolder), 'cache.db')
  998.             genesisfile_sources = os.path.join(xbmc.translatePath(genesisdatafolder), 'sources.db')
  999.             #genesisfile_movietv = os.path.join(xbmc.translatePath(genesisdatafolder), 'movietv.db')
  1000.             genesisfile_meta = os.path.join(xbmc.translatePath(genesisdatafolder), 'meta.db')
  1001.             genesisfile_moviefarsi = os.path.join(xbmc.translatePath(genesisdatafolder), 'moviefarsi.db')
  1002.             #genesisfile_filmikz = os.path.join(xbmc.translatePath(genesisdatafolder), 'filmikz.db')
  1003.  
  1004.  
  1005.             genesiscachesize = os.path.getsize(genesisfile_cache)
  1006.             genesissourcessize = os.path.getsize(genesisfile_sources)
  1007.             #genesisfile_movietv_size = os.path.getsize(genesisfile_movietv)
  1008.             genesisfile_meta_size = os.path.getsize(genesisfile_meta)
  1009.             genesisfile_moviefarsi_size = os.path.getsize(genesisfile_moviefarsi)
  1010.             #genesisfile_filmikz_size = os.path.getsize(genesisfile_filmikz)
  1011.            
  1012.             if genesiscachesize > 0:
  1013.                 tempandcachefiles = tempandcachefiles + 1
  1014.        
  1015.        
  1016.             if genesissourcessize > 0:
  1017.                 tempandcachefiles = tempandcachefiles + 1
  1018.                
  1019.            
  1020.             # if genesisfile_movietv_size > 0:
  1021.                 # tempandcachefiles = tempandcachefiles + 1
  1022.                
  1023.             if genesisfile_meta_size > 0:
  1024.                 tempandcachefiles = tempandcachefiles + 1
  1025.            
  1026.             if genesisfile_moviefarsi_size > 0:
  1027.                 tempandcachefiles = tempandcachefiles + 1
  1028.            
  1029.             # if genesisfile_filmikz_size > 0:
  1030.                 # tempandcachefiles = tempandcachefiles + 1
  1031.        
  1032.        
  1033.             tempandcachesize = tempandcachesize + (genesiscachesize/1024/1024) + (genesissourcessize/1024/1024) + (genesisfile_meta_size/1024/1024) + (genesisfile_moviefarsi_size/1024/1024)
  1034.            
  1035.            
  1036.            
  1037.            
  1038.         if cacheinclude_navix_setting == "yes":
  1039.        
  1040.        
  1041.             navixdatafolder = translate('special://home/userdata/addon_data/script.navi-x/cache')
  1042.            
  1043.             total_files = 0
  1044.             total_size = 0
  1045.            
  1046.             get_size(navixdatafolder)
  1047.             tempandcachefiles = tempandcachefiles + total_files
  1048.             tempandcachesize = tempandcachesize + (total_size/1024/1024)
  1049.        
  1050.        
  1051.         if cacheinclude_youtube_setting == "yes":
  1052.        
  1053.        
  1054.             youtubedatafolder = translate('special://home/userdata/addon_data/plugin.video.youtube/kodion')
  1055.            
  1056.             total_files = 0
  1057.             total_size = 0
  1058.            
  1059.             get_size(youtubedatafolder)
  1060.             tempandcachefiles = tempandcachefiles + total_files
  1061.             tempandcachesize = tempandcachesize + (total_size/1024/1024)
  1062.            
  1063.            
  1064.         if cacheinclude_ivue_setting == "yes":
  1065.        
  1066.             ivuedatafolder = translate('special://home/userdata/addon_data/script.tvguidetecbox')
  1067.            
  1068.             total_files = 0
  1069.             total_size = 0
  1070.            
  1071.             for dirpath, dirnames, filenames in os.walk(ivuedatafolder):
  1072.                 for f in filenames:
  1073.                     fp = os.path.join(dirpath, f)
  1074.                     if not f == "settings.xml":
  1075.                         total_size += os.path.getsize(fp)
  1076.                         total_files = total_files + 1
  1077.                
  1078.             tempandcachefiles = tempandcachefiles + total_files
  1079.             tempandcachesize = tempandcachesize + (total_size/1024/1024)
  1080.            
  1081.            
  1082.        
  1083.         if cacheinclude_salts_setting == "yes":
  1084.        
  1085.             saltsdatafolder = translate('special://home/userdata/addon_data/plugin.video.salts')
  1086.            
  1087.             total_files = 0
  1088.             total_size = 0
  1089.            
  1090.            
  1091.             for dirpath, dirnames, filenames in os.walk(saltsdatafolder):
  1092.                 for f in filenames:
  1093.                     fp = os.path.join(dirpath, f)
  1094.                     if not f == "settings.xml":
  1095.                         total_size += os.path.getsize(fp)
  1096.                         total_files = total_files + 1
  1097.                
  1098.             tempandcachefiles = tempandcachefiles + total_files
  1099.             tempandcachesize = tempandcachesize + (total_size/1024/1024)
  1100.            
  1101.            
  1102.            
  1103.         if cacheinclude_pulsar_setting == "yes":
  1104.  
  1105.             pulsardatafolder = translate('special://home/userdata/addon_data/plugin.video.pulsar/cache')
  1106.            
  1107.             total_files = 0
  1108.             total_size = 0
  1109.            
  1110.             get_size(pulsardatafolder)
  1111.             tempandcachefiles = tempandcachefiles + total_files
  1112.             tempandcachesize = tempandcachesize + (total_size/1024/1024)
  1113.        
  1114.            
  1115.            
  1116.            
  1117.        
  1118.     except:
  1119.        
  1120.         pass
  1121.        
  1122.    
  1123.  
  1124.     if tempandcachesize >= 500:
  1125.         maint_cache_red.setVisible(True)
  1126.         maint_cache_amber.setVisible(False)
  1127.         maint_cache_green.setVisible(False)
  1128.         recommendedaction = "Clear cache\\temp"
  1129.        
  1130.     if tempandcachesize >= 200 and tempandcachesize < 500:
  1131.         maint_cache_amber.setVisible(True)
  1132.         maint_cache_red.setVisible(False)
  1133.         maint_cache_green.setVisible(False)
  1134.        
  1135.     if tempandcachesize < 200:
  1136.         maint_cache_green.setVisible(True)
  1137.         maint_cache_red.setVisible(False)
  1138.         maint_cache_amber.setVisible(False)
  1139.        
  1140.     if tempandcachesize == 0 and tempandcachefiles > 0:
  1141.         tempandcachesize = "<1"
  1142.        
  1143.     if tempandcachesize == "<1":
  1144.         maint_cache_green.setVisible(True)
  1145.         maint_cache_red.setVisible(False)
  1146.         maint_cache_amber.setVisible(False)    
  1147.        
  1148.     maint_cache_label5.setLabel('[COLOR=lightgray]' + str(tempandcachefiles) + '[/COLOR]')
  1149.     maint_cache_label6.setLabel('[COLOR=lightgray]' + str(tempandcachesize) + ' MB[/COLOR]')   
  1150.        
  1151.  
  1152. def stripcolortags(string):
  1153.  
  1154.     colortag = "COLOR"
  1155.     if colortag in string:
  1156.         opentag = string.find(']')
  1157.         firstpart = string[opentag+1:]
  1158.         closetag = firstpart.find('[')
  1159.         string = firstpart[:closetag]
  1160.         return string
  1161.  
  1162.  
  1163.  
  1164.    
  1165.  
  1166.  
  1167.  
  1168. def buildinstallskipaddons_update():
  1169.        
  1170.     global buildinstallskipaddonssetting
  1171.        
  1172.     if buildinstallskipaddons.isSelected():
  1173.  
  1174.    
  1175.         #newbuffermode = 4
  1176.        
  1177.         pass
  1178.         #settings.write('automaintenance', 'monthly')
  1179.        
  1180.        
  1181.     else:
  1182.        
  1183.         pass
  1184.         #buildinstallskipaddons.setSelected(True)  
  1185.  
  1186.        
  1187. def buildinstallskipaddondata_update():
  1188.        
  1189.     global buildinstallskipaddondatasetting
  1190.        
  1191.     if buildinstallskipaddondata.isSelected():
  1192.  
  1193.    
  1194.         #newbuffermode = 4
  1195.        
  1196.         pass
  1197.         #settings.write('automaintenance', 'monthly')
  1198.        
  1199.        
  1200.     else:
  1201.        
  1202.         pass
  1203.  
  1204.        
  1205. def buildinstallskipvideos_update():
  1206.        
  1207.     global buildinstallskipvideosssetting
  1208.        
  1209.     if buildinstallskipvideos.isSelected():
  1210.  
  1211.    
  1212.         #newbuffermode = 4
  1213.        
  1214.         pass
  1215.         #settings.write('automaintenance', 'monthly')
  1216.        
  1217.        
  1218.     else:
  1219.        
  1220.         pass
  1221.    
  1222.    
  1223. def buildinstallskipfavourites_update():
  1224.        
  1225.     global buildinstallskipfavouritessetting
  1226.        
  1227.     if buildinstallskipfavourites.isSelected():
  1228.  
  1229.    
  1230.         #newbuffermode = 4
  1231.        
  1232.         pass
  1233.         #settings.write('automaintenance', 'monthly')
  1234.        
  1235.        
  1236.     else:
  1237.        
  1238.         pass   
  1239.    
  1240.    
  1241.    
  1242.    
  1243.    
  1244.    
  1245. def radio1_update():
  1246.  
  1247.     global newbuffermode
  1248.    
  1249.    
  1250.     if mode1radiobutton.isSelected():
  1251.         mode2radiobutton.setSelected(False)
  1252.         mode3radiobutton.setSelected(False)
  1253.         mode4radiobutton.setSelected(False)
  1254.         newbuffermode = 1
  1255.     else:
  1256.         mode1radiobutton.setSelected(True)
  1257.  
  1258. def radio2_update():   
  1259.  
  1260.     global newbuffermode
  1261.        
  1262.     if mode2radiobutton.isSelected():
  1263.         mode1radiobutton.setSelected(False)
  1264.         mode3radiobutton.setSelected(False)
  1265.         mode4radiobutton.setSelected(False)
  1266.         newbuffermode = 2
  1267.     else:
  1268.         mode2radiobutton.setSelected(True)
  1269.        
  1270. def radio3_update():
  1271.  
  1272.     global newbuffermode
  1273.    
  1274.     if mode3radiobutton.isSelected():
  1275.         mode1radiobutton.setSelected(False)
  1276.         mode2radiobutton.setSelected(False)
  1277.         mode4radiobutton.setSelected(False)
  1278.         newbuffermode = 3
  1279.     else:
  1280.         mode3radiobutton.setSelected(True)
  1281.        
  1282. def radio4_update():
  1283.  
  1284.     global newbuffermode
  1285.        
  1286.     if mode4radiobutton.isSelected():
  1287.         mode1radiobutton.setSelected(False)
  1288.         mode2radiobutton.setSelected(False)
  1289.         mode3radiobutton.setSelected(False)
  1290.         newbuffermode = 4
  1291.     else:
  1292.         mode4radiobutton.setSelected(True)
  1293.        
  1294.  
  1295.        
  1296.  
  1297. def automaintenancefreqmonthly_update():
  1298.  
  1299.     # global newbuffermode
  1300.        
  1301.     if automaintenancefreqmonthly.isSelected():
  1302.         automaintenancefreqweekly.setSelected(False)
  1303.         automaintenancefreqdaily.setSelected(False)
  1304.         automaintenancefreqeverytime.setSelected(False)
  1305.         #newbuffermode = 4
  1306.        
  1307.        
  1308.         settings.write('automaintenance', 'monthly')
  1309.        
  1310.        
  1311.     else:
  1312.        
  1313.         automaintenancefreqmonthly.setSelected(True)
  1314.  
  1315.        
  1316.  
  1317. def automaintenancefreqweekly_update():
  1318.  
  1319.     # global newbuffermode
  1320.        
  1321.     if automaintenancefreqweekly.isSelected():
  1322.         automaintenancefreqmonthly.setSelected(False)
  1323.         automaintenancefreqdaily.setSelected(False)
  1324.         automaintenancefreqeverytime.setSelected(False)
  1325.         #newbuffermode = 4
  1326.        
  1327.        
  1328.         settings.write('automaintenance', 'weekly')
  1329.        
  1330.        
  1331.        
  1332.     else:
  1333.         automaintenancefreqweekly.setSelected(True)    
  1334.        
  1335.  
  1336.  
  1337. def automaintenancefreqdaily_update():
  1338.  
  1339.     # global newbuffermode
  1340.        
  1341.     if automaintenancefreqdaily.isSelected():
  1342.         automaintenancefreqmonthly.setSelected(False)
  1343.         automaintenancefreqweekly.setSelected(False)
  1344.         automaintenancefreqeverytime.setSelected(False)
  1345.         #newbuffermode = 4
  1346.        
  1347.         settings.write('automaintenance', 'daily')
  1348.        
  1349.        
  1350.        
  1351.        
  1352.     else:
  1353.         automaintenancefreqdaily.setSelected(True) 
  1354.        
  1355.  
  1356.  
  1357.  
  1358. def automaintenancefreqeverytime_update():
  1359.  
  1360.     global newbuffermode
  1361.        
  1362.     if automaintenancefreqeverytime.isSelected():
  1363.         automaintenancefreqmonthly.setSelected(False)
  1364.         automaintenancefreqweekly.setSelected(False)
  1365.         automaintenancefreqdaily.setSelected(False)
  1366.         #newbuffermode = 4
  1367.        
  1368.         settings.write('automaintenance', 'everytime')
  1369.        
  1370.        
  1371.        
  1372.        
  1373.        
  1374.     else:
  1375.         automaintenancefreqeverytime.setSelected(True) 
  1376.        
  1377.        
  1378.        
  1379. def automaintenanceradio_update():
  1380.  
  1381.     #global automaintenance
  1382.  
  1383.     if automaintenanceradio.isSelected():
  1384.         automaintenancefreqmonthly.setEnabled(True)
  1385.         automaintenancefreqweekly.setEnabled(True)
  1386.         automaintenancefreqdaily.setEnabled(True)
  1387.         automaintenancefreqeverytime.setEnabled(True)
  1388.         automaintenancelabel1.setEnabled(True)
  1389.  
  1390.     else:
  1391.         automaintenancefreqmonthly.setEnabled(False)
  1392.         automaintenancefreqweekly.setEnabled(False)
  1393.         automaintenancefreqdaily.setEnabled(False)
  1394.         automaintenancefreqeverytime.setEnabled(False)
  1395.         automaintenancelabel1.setEnabled(False)
  1396.        
  1397.        
  1398.         settings.write('automaintenance', 'never')
  1399.  
  1400.            
  1401.    
  1402.  
  1403.  
  1404.  
  1405.    
  1406. def fullautomaintenanceradio_update():
  1407.  
  1408.     # global automaintenance
  1409.  
  1410.     if fullautomaintenanceradio.isSelected():
  1411.    
  1412.         #if userlevel == "admin" or userlevel == "staff" or userlevel == "donator" or userlevel == "uploader" or userlevel == "free":
  1413.         if userlevel == "admin" or userlevel == "staff" or userlevel == "donator" or userlevel == "uploader":
  1414.        
  1415.             fullautomaintcacheradio.setEnabled(True)
  1416.             fullautomaintmonthradio.setEnabled(True)
  1417.             fullautomaintpackagesradio.setEnabled(True)
  1418.             fullautomaintquarterradio.setEnabled(True)
  1419.             fullautomaintthumbradio.setEnabled(True)
  1420.             fullautomaintweekradio.setEnabled(True)
  1421.             fullyautomaintenancelabel1.setEnabled(True)
  1422.             fullyautomaintenancelabel2.setEnabled(True)
  1423.            
  1424.         else:
  1425.            
  1426.             fullautomaintenanceradio.setSelected(False)
  1427.             dialog = xbmcgui.Dialog()
  1428.             dialog.ok(strings.getstring("areswizard"), strings.getstring("donate"), "","")
  1429.        
  1430.  
  1431.        
  1432.  
  1433.     else:
  1434.         fullautomaintcacheradio.setEnabled(False)
  1435.         fullautomaintmonthradio.setEnabled(False)
  1436.         fullautomaintpackagesradio.setEnabled(False)
  1437.         fullautomaintquarterradio.setEnabled(False)
  1438.         fullautomaintthumbradio.setEnabled(False)
  1439.         fullautomaintweekradio.setEnabled(False)
  1440.         fullyautomaintenancelabel1.setEnabled(False)
  1441.         fullyautomaintenancelabel2.setEnabled(False)
  1442.         settings.write('fullautocache','0')
  1443.         settings.write('fullautopackages','0')
  1444.         settings.write('fullautothumb','0')
  1445.         settings.write('fullautothumb','0')
  1446.         settings.write('fullautofreq','never')
  1447.        
  1448.  
  1449.    
  1450. def fullautomaintcacheradio_update():
  1451.  
  1452.     if fullautomaintcacheradio.isSelected():
  1453.         settings.write('fullautocache','yes')
  1454.     else:
  1455.         settings.write('fullautocache','0')
  1456.    
  1457. def fullautomaintpackagesradio_update():
  1458.  
  1459.     if fullautomaintpackagesradio.isSelected():
  1460.         settings.write('fullautopackages','yes')
  1461.     else:
  1462.         settings.write('fullautopackages','0')
  1463.  
  1464. def fullautomaintthumbradio_update():
  1465.  
  1466.     if fullautomaintthumbradio.isSelected():
  1467.         settings.write('fullautothumb','yes')
  1468.     else:
  1469.         settings.write('fullautothumb','0')
  1470.    
  1471. def fullautomaintweekradio_update():
  1472.  
  1473.     if fullautomaintweekradio.isSelected():
  1474.         fullautomaintquarterradio.setSelected(False)
  1475.         fullautomaintmonthradio.setSelected(False)
  1476.        
  1477.         settings.write('fullautofreq','week')
  1478.        
  1479.     else:
  1480.         fullautomaintweekradio.setSelected(True)
  1481.    
  1482. def fullautomaintmonthradio_update():
  1483.  
  1484.     if fullautomaintmonthradio.isSelected():
  1485.         fullautomaintquarterradio.setSelected(False)
  1486.         fullautomaintweekradio.setSelected(False)
  1487.        
  1488.         settings.write('fullautofreq','month')
  1489.    
  1490.     else:
  1491.         fullautomaintmonthradio.setSelected(True)
  1492.    
  1493. def fullautomaintquarterradio_update():
  1494.  
  1495.     if fullautomaintquarterradio.isSelected():
  1496.         fullautomaintmonthradio.setSelected(False)
  1497.         fullautomaintweekradio.setSelected(False)
  1498.        
  1499.         settings.write('fullautofreq','quarter')
  1500.    
  1501.     else:
  1502.         fullautomaintquarterradio.setSelected(True)
  1503.  
  1504.  
  1505.        
  1506.        
  1507.        
  1508.        
  1509. def cacheinclude_genesis_update():
  1510.    
  1511.     if cacheinclude_genesis.isSelected():
  1512.        
  1513.         settings.write('cacheinclude_genesis','yes')
  1514.         gettempandcache()
  1515.    
  1516.     else:
  1517.    
  1518.         settings.write('cacheinclude_genesis','0')
  1519.         gettempandcache()
  1520.  
  1521.        
  1522.        
  1523.  
  1524. def cacheinclude_navix_update():
  1525.  
  1526.     if cacheinclude_navix.isSelected():
  1527.        
  1528.         settings.write('cacheinclude_navix','yes')
  1529.         gettempandcache()
  1530.    
  1531.     else:
  1532.    
  1533.         settings.write('cacheinclude_navix','0')
  1534.         gettempandcache()
  1535.  
  1536.    
  1537. def cacheinclude_youtube_update():
  1538.    
  1539.     if cacheinclude_youtube.isSelected():
  1540.        
  1541.         settings.write('cacheinclude_youtube','yes')
  1542.         gettempandcache()
  1543.    
  1544.     else:
  1545.    
  1546.         settings.write('cacheinclude_youtube','0')
  1547.         gettempandcache()
  1548.        
  1549.        
  1550. def cacheinclude_ivue_update():
  1551.    
  1552.     if cacheinclude_ivue.isSelected():
  1553.        
  1554.         settings.write('cacheinclude_ivue','yes')
  1555.         gettempandcache()
  1556.    
  1557.     else:
  1558.    
  1559.         settings.write('cacheinclude_ivue','0')
  1560.         gettempandcache()
  1561.  
  1562.  
  1563. def cacheinclude_salts_update():
  1564.  
  1565.     if cacheinclude_salts.isSelected():
  1566.        
  1567.         settings.write('cacheinclude_salts','yes')
  1568.         gettempandcache()
  1569.    
  1570.     else:
  1571.    
  1572.         settings.write('cacheinclude_salts','0')
  1573.         gettempandcache()
  1574.  
  1575.  
  1576. def cacheinclude_pulsar_update():
  1577.  
  1578.     if cacheinclude_pulsar.isSelected():
  1579.        
  1580.         settings.write('cacheinclude_pulsar','yes')
  1581.         gettempandcache()
  1582.    
  1583.     else:
  1584.    
  1585.         settings.write('cacheinclude_pulsar','0')
  1586.         gettempandcache()
  1587.    
  1588.    
  1589.    
  1590.  
  1591.    
  1592.    
  1593.    
  1594.    
  1595. def list_update():
  1596.  
  1597.  
  1598.  
  1599.     global name
  1600.     global rating
  1601.     global namelabel
  1602.     global authorlabel
  1603.     global freeramlabel2
  1604.     global newcache
  1605.     global newcurl
  1606.     global newrbf
  1607.     global currenturl
  1608.     global unblockurl
  1609.     global addonpath
  1610.     global selectname
  1611.     global windowimage
  1612.     global wizarddata
  1613.     global buildlistraw
  1614.     global buildlistotherraw
  1615.     global currentlist
  1616.     global blackboxdata
  1617.     global bslug
  1618.    
  1619.  
  1620.    
  1621.     try:
  1622.         if window.getFocus() == slider1:
  1623.        
  1624.  
  1625.  
  1626.             newcache = int(slider1.getPercent() * ((freeramlabel3/3.) / 100.))
  1627.            
  1628.            
  1629.  
  1630.             if newcache < 20:
  1631.                 twentymb = (100 * 21)/(freeramlabel3/3.)
  1632.                 slider1.setPercent(twentymb)
  1633.                 newcache = int(slider1.getPercent() * ((freeramlabel3/3.) / 100.))
  1634.  
  1635.  
  1636.             slider1value.setLabel('[COLOR=darkgray] ' + str(newcache) + 'MB[/COLOR]')
  1637.             # slider1value.setLabel('{:.1F}'.format(slider1.getPercent()))
  1638.     except:
  1639.         pass   
  1640.        
  1641.        
  1642.    
  1643.    
  1644.    
  1645.    
  1646.    
  1647.    
  1648.    
  1649.    
  1650.    
  1651.     try:
  1652.         if window.getFocus() == slider2:
  1653.        
  1654.        
  1655.             position = str(slider2.getPercent())
  1656.            
  1657.             position2 = position.find('.')
  1658.             percentstr = position[:position2]
  1659.                
  1660.             percentint = int(percentstr)
  1661.        
  1662.  
  1663.             position = str(slider2.getPercent())
  1664.            
  1665.             position2 = position.find('.')
  1666.             percentstr = position[:position2]
  1667.                
  1668.             percentint = int(percentstr)
  1669.    
  1670.             newcurl = int(percentint * 0.2)
  1671.            
  1672.  
  1673.                    
  1674.             slider2value.setLabel('[COLOR=darkgray] ' + str(newcurl) + 's[/COLOR]')
  1675.             # slider1value.setLabel('{:.1F}'.format(slider1.getPercent()))
  1676.     except:
  1677.         pass   
  1678.        
  1679.        
  1680.    
  1681.    
  1682.    
  1683.    
  1684.     try:
  1685.         if window.getFocus() == slider3:
  1686.        
  1687.        
  1688.        
  1689.             position = str(slider3.getPercent())
  1690.            
  1691.             position2 = position.find('.')
  1692.             percentstr = position[:position2]
  1693.                
  1694.             percentint = int(percentstr)
  1695.        
  1696.                
  1697.             position = str(slider3.getPercent())
  1698.            
  1699.             position2 = position.find('.')
  1700.             percentstr = position[:position2]
  1701.                
  1702.             percentint = int(percentstr)
  1703.    
  1704.             newrbf = int(percentint * 0.1)
  1705.                    
  1706.             slider3value.setLabel('[COLOR=darkgray] ' + str(newrbf) + '[/COLOR]')
  1707.             # slider1value.setLabel('{:.1F}'.format(slider1.getPercent()))
  1708.     except:
  1709.         pass   
  1710.    
  1711.    
  1712.    
  1713.  
  1714.     try:
  1715.         if window.getFocus() == buildotherlist:
  1716.        
  1717.             # if debuglog == "true":
  1718.                 # print ' '
  1719.                 # print '@ares: findowfocus: buildotherlist '
  1720.                 # print ' '
  1721.        
  1722.             voteslabel.setLabel(' ')
  1723.             downloadslabel.setLabel(' ')
  1724.             star1.setVisible(False)
  1725.             star2.setVisible(False)
  1726.             star3.setVisible(False)
  1727.             star4.setVisible(False)
  1728.             star5.setVisible(False)
  1729.            
  1730.             authorlabel.setVisible(False)
  1731.            
  1732.            
  1733.             global selectname
  1734.             selectname = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
  1735.            
  1736.             colortag = "COLOR"
  1737.             if colortag in selectname:
  1738.                 opentag = selectname.find(']')
  1739.                 firstpart = selectname[opentag+1:]
  1740.                 closetag = firstpart.find('[')
  1741.            
  1742.  
  1743.            
  1744.             sizelabel.setLabel('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
  1745.  
  1746.                
  1747.  
  1748.             selectname = firstpart[:closetag]
  1749.            
  1750.             if debuglog == "true":
  1751.                 print '@ares: Selected Build: ' + selectname
  1752.  
  1753.            
  1754.  
  1755.             if currentlist == "blackbox":
  1756.  
  1757.                 for build in blackboxdata:
  1758.                
  1759.                     if selectname == build['bfriendlyname']:
  1760.                         desticon = build['bicon']
  1761.                         destfanart = build['bicon']
  1762.                         destdescr = build['bfriendlyname']
  1763.                         bslug = build['bslug']
  1764.                         break
  1765.                
  1766.                    
  1767.                
  1768.             else:
  1769.            
  1770.                 match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
  1771.                
  1772.                 for name,url,iconimage,fanart,description in match:
  1773.                
  1774.                     if name == selectname:
  1775.                         desturl = url
  1776.                         desticon = iconimage
  1777.                         destfanart = fanart
  1778.                         destdescr = description
  1779.                         break
  1780.                
  1781.            
  1782.            
  1783.         try:
  1784.             buildlistotherraw
  1785.         except:
  1786.    
  1787.             url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsother&time=' + datetime.datetime.now().strftime('%S')
  1788.  
  1789.            
  1790.             if debuglog == "true":
  1791.                 print '@ares: buildlistotherurl...'
  1792.                 print url
  1793.  
  1794.        
  1795.        
  1796.             req = urllib2.Request(url)
  1797.             req.add_header('User-Agent', aresagent)
  1798.             response = urllib2.urlopen(req)
  1799.             buildlistotherraw = response.read()
  1800.            
  1801.            
  1802.            
  1803.             if debuglog == "true":
  1804.                 print ' '
  1805.                 print '@ares: buildlistotherraw...'
  1806.                 print ' '
  1807.                 print buildlistotherraw
  1808.            
  1809.            
  1810.            
  1811.            
  1812.         data = json.loads(buildlistotherraw)   
  1813.         for entry in data:
  1814.             if entry['name'] == selectname:
  1815.            
  1816.                 if debuglog == "true":
  1817.                     print '@ares1: build name found...'
  1818.                     # print '@ares1: buidinfo-rating: ' + entry['rating']
  1819.                     # print '@ares1: buidinfo-votes: ' + entry['votes']
  1820.                     # print '@ares1: buidinfo-downloads: ' + entry['downloads']
  1821.                
  1822.                 #global rating
  1823.                 rating = entry['rating']
  1824.                 votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  1825.                 votesint = entry['votes']
  1826.                 downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  1827.                 downloadsint = entry['downloads']
  1828.                 break
  1829.        
  1830.         global windowimage
  1831.         windowimage.setImage(destfanart)
  1832.         windowimage.setVisible(True)
  1833.                            
  1834.         global namelabel
  1835.         namelabel.setLabel(label='[COLOR=darkgray]' + selectname + '[/COLOR]')
  1836.         namelabel.setVisible(True)
  1837.        
  1838.         #global authorlabel
  1839.         #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]')
  1840.         #authorlabel.setVisible(True)
  1841.        
  1842.         # if debuglog == "true":
  1843.             # print '@ares: rating: ' + rating
  1844.             # print '@ares: votes: ' + votes
  1845.             # print '@ares: votesint' + str(votesint)
  1846.             # print '@ares: downloads: ' + downloads
  1847.             # print '@ares: downloadsint: ' + str(downloadsint)
  1848.        
  1849.        
  1850.        
  1851.        
  1852.         checkfile = os.path.join(datadir, selectname + '.zip')
  1853.         #print checkfile
  1854.         if os.path.isfile(checkfile):
  1855.             repairbuildbutton.setEnabled(True)
  1856.         else:
  1857.             repairbuildbutton.setEnabled(False)
  1858.        
  1859.         voteslabel.setLabel(label=votes)
  1860.         voteslabel.setVisible(True)
  1861.         votestextlabel.setVisible(True)
  1862.        
  1863.        
  1864.         downloadslabel.setLabel(label=downloads)
  1865.         downloadslabel.setVisible(True)
  1866.         downloadstextlabel.setVisible(True)
  1867.        
  1868.         showrating(rating, votesint)
  1869.         ratingtextlabel.setVisible(True)
  1870.        
  1871.        
  1872.  
  1873.         freshstartbutton.setVisible(True)
  1874.         installbuildbutton.setVisible(True)
  1875.         votebuildbutton.setVisible(True)
  1876.         repairbuildbutton.setVisible(True)
  1877.        
  1878.         if loginstatus == 'mac0':
  1879.             votebuildbutton.setEnabled(False)
  1880.         else:
  1881.             votebuildbutton.setEnabled(True)
  1882.    
  1883.        
  1884.        
  1885.         name = selectname  
  1886.            
  1887.            
  1888.    
  1889.    
  1890.     except:
  1891.    
  1892.         pass
  1893.    
  1894.    
  1895.  
  1896.     try:
  1897.         if window.getFocus() == buildlist:
  1898.                    
  1899.  
  1900.             name = buildlist.getListItem(buildlist.getSelectedPosition()).getLabel()
  1901.            
  1902.             authorlabel.setVisible(True)
  1903.            
  1904.             colortag = "COLOR"
  1905.             if colortag in name:
  1906.                 opentag = name.find(']')
  1907.                 firstpart = name[opentag+1:]
  1908.                 closetag = firstpart.find('[')
  1909.                
  1910.  
  1911.                 name = firstpart[:closetag]
  1912.            
  1913.  
  1914.            
  1915.             sizelabel.setLabel('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
  1916.        
  1917.             installbuildbutton.controlDown(repairbuildbutton)
  1918.            
  1919.  
  1920.             data = json.loads(buildlistraw)
  1921.             for entry in data:
  1922.                 if entry['name'] == name:
  1923.                     url = entry['url']
  1924.                     iconimage = 'http://' + entry['icon']
  1925.                     descr = entry['descr']
  1926.                     fanart = 'http://' + entry['icon']
  1927.                     author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  1928.                
  1929.                     rating = entry['rating']
  1930.                     votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  1931.                     votesint = entry['votes']
  1932.                    
  1933.                     downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  1934.                     downloadsint = entry['downloads']
  1935.                    
  1936.  
  1937.                     windowimage.setImage(fanart)
  1938.                     windowimage.setVisible(True)
  1939.                                        
  1940.  
  1941.                     namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  1942.                     namelabel.setVisible(True)
  1943.                    
  1944.  
  1945.                     authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  1946.                     authorlabel.setVisible(True)
  1947.                    
  1948.                     voteslabel.setVisible(True)
  1949.                     votestextlabel.setVisible(True)
  1950.                     voteslabel.setLabel(label=votes)
  1951.                    
  1952.                     checkfile = os.path.join(datadir, name + '.zip')
  1953.                     #print checkfile
  1954.                     if os.path.isfile(checkfile):
  1955.                         repairbuildbutton.setEnabled(True)
  1956.                     else:
  1957.                         repairbuildbutton.setEnabled(False)
  1958.                    
  1959.                    
  1960.                     downloadslabel.setVisible(True)
  1961.                     downloadstextlabel.setVisible(True)
  1962.                     downloadslabel.setLabel(label=downloads)
  1963.                    
  1964.                     ratingtextlabel.setVisible(True)
  1965.                    
  1966.                     showrating(rating, votesint)
  1967.  
  1968.                     installbuildbutton.setVisible(True)
  1969.                     votebuildbutton.setVisible(True)
  1970.                    
  1971.                     if loginstatus == 'mac0':
  1972.                         votebuildbutton.setEnabled(False)
  1973.                     else:
  1974.                         votebuildbutton.setEnabled(True)
  1975.                        
  1976.                     break
  1977.                        
  1978.            
  1979.                    
  1980.                    
  1981.         #################################################################################################################          
  1982.                    
  1983.        
  1984.         if window.getFocus() == addonlist:
  1985.        
  1986.             name = addonlist.getListItem(addonlist.getSelectedPosition()).getLabel()
  1987.            
  1988.             # installaddonbutton.controlDown(voteaddonbutton)
  1989.             uninstalladdonbutton.controlUp(browseaddonsbutton)
  1990.            
  1991.             colortag = "COLOR"
  1992.             if colortag in name:
  1993.                 opentag = name.find(']')
  1994.                 firstpart = name[opentag+1:]
  1995.                 closetag = firstpart.find('[')
  1996.                 #global name
  1997.                 name = firstpart[:closetag]
  1998.                
  1999.             data = json.loads(addonlistraw)
  2000.             for entry in data:
  2001.                 if entry['name'] == name:
  2002.                     url = entry['url']
  2003.                     iconimage = 'http://' + entry['icon']
  2004.                     descr = entry['descr']
  2005.                     fanart = 'http://' + entry['icon']
  2006.                     author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  2007.                    
  2008.                     rating = entry['rating']
  2009.                     votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  2010.                     votesint = entry['votes']
  2011.                     addonpath = entry['addonpath']
  2012.                     version_color = '[COLOR=darkgray]' + entry['version']  + '[/COLOR]'
  2013.                     version = entry['version']
  2014.                     downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  2015.                     downloadsint = entry['downloads']
  2016.                    
  2017.                     global windowimage2
  2018.                     windowimage2.setImage(fanart)  
  2019.                     windowimage2.setVisible(True)
  2020.                    
  2021.                     namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  2022.                     namelabel.setVisible(True)
  2023.                    
  2024.                     authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  2025.                     authorlabel.setVisible(True)
  2026.                    
  2027.                     checktargetxmlversion(addonpath)
  2028.                    
  2029.                     if installedversion == " ":
  2030.                         statuslabel.setLabel(label='[COLOR fuchsia]Not Installed[/COLOR]')
  2031.                         installedversionlabel.setLabel(label=installedversion_color)
  2032.                         installedversionlabel.setVisible(False)
  2033.                         installedversiontextlabel.setVisible(False)
  2034.  
  2035.                     elif installedversion <> version:
  2036.                         statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
  2037.                         installedversionlabel.setLabel(label=installedversion_color)
  2038.                         installedversionlabel.setVisible(True)
  2039.                         installedversiontextlabel.setVisible(True)
  2040.  
  2041.                     elif installedversion == version:
  2042.                         statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
  2043.                         installedversionlabel.setLabel(label=installedversion_color)
  2044.                         installedversionlabel.setVisible(True)
  2045.                         installedversiontextlabel.setVisible(True)
  2046.                    
  2047.                     else:
  2048.                         statuslabel.setLabel(label='Unknown')
  2049.                         installedversionlabel.setLabel(label=installedversion_color)
  2050.                         installedversionlabel.setVisible(True)
  2051.                         installedversiontextlabel.setVisible(True)
  2052.                        
  2053.                     statuslabel.setVisible(True)
  2054.                     statustextlabel.setVisible(True)
  2055.                    
  2056.                     recversionlabel.setLabel(label=version_color)
  2057.                     # recversionlabel.setVisible(True)
  2058.                     # recversiontextlabel.setVisible(True)
  2059.                    
  2060.                     uninstalladdonbutton.setVisible(True)
  2061.                     installaddonbutton.setVisible(True)
  2062.                     voteaddonbutton.setVisible(True)
  2063.                    
  2064.                     voteslabel.setLabel(label=votes)
  2065.                     voteslabel.setVisible(True)
  2066.                     votestextlabel.setVisible(True)
  2067.                    
  2068.                    
  2069.                     downloadslabel.setLabel(label=str(downloads))
  2070.                     downloadslabel.setVisible(True)
  2071.                     downloadstextlabel.setVisible(True)
  2072.                    
  2073.                    
  2074.                     ratingtextlabel.setVisible(True)
  2075.                    
  2076.                     showrating(rating, votesint)
  2077.                    
  2078.                    
  2079.                     if userlevel == "staff" or userlevel == "admin" or userlevel == "uploader":
  2080.                         addaddonbyrepobutton.setVisible(True)
  2081.                         uninstalladdonbutton.controlRight(addaddonbyrepobutton)
  2082.                         addaddonbyrepobutton.controlLeft(uninstalladdonbutton)
  2083.                         updateaddonbutton.setVisible(True)
  2084.                         addaddonbyrepobutton.controlRight(updateaddonbutton)
  2085.                         updateaddonbutton.controlLeft(addaddonbyrepobutton)
  2086.                
  2087.         ########################################################################################################
  2088.        
  2089.         if window.getFocus() == repolist:
  2090.        
  2091.  
  2092.             name = repolist.getListItem(repolist.getSelectedPosition()).getLabel()
  2093.            
  2094.            
  2095.             # installaddonbutton.controlDown(voterepobutton)
  2096.             uninstalladdonbutton.controlUp(browseaddonsbutton)
  2097.            
  2098.            
  2099.             colortag = "COLOR"
  2100.             if colortag in name:
  2101.                 opentag = name.find(']')
  2102.                 firstpart = name[opentag+1:]
  2103.                 closetag = firstpart.find('[')
  2104.                 #global name
  2105.                 name = firstpart[:closetag]
  2106.                
  2107.        
  2108.             data = json.loads(repolistraw) 
  2109.             for entry in data:
  2110.                 if entry['name'] == name:
  2111.                     url = entry['url']
  2112.                     iconimage = 'http://' + entry['icon']
  2113.                     descr = entry['descr']
  2114.                     fanart = 'http://' + entry['icon']
  2115.                     rating = entry['rating']
  2116.                     votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  2117.                     votesint = entry['votes']
  2118.                     author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  2119.                    
  2120.                     downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  2121.                     downloadsint = entry['downloads']
  2122.                    
  2123.                     global windowimage3
  2124.                     windowimage3.setImage(fanart)
  2125.                     windowimage3.setVisible(True)
  2126.            
  2127.            
  2128.                     voteslabel.setVisible(True)
  2129.                     votestextlabel.setVisible(True)
  2130.                     voteslabel.setLabel(label=votes)
  2131.                    
  2132.    
  2133.                     authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  2134.                     authorlabel.setVisible(True)
  2135.                    
  2136.                     downloadslabel.setVisible(True)
  2137.                     downloadstextlabel.setVisible(True)
  2138.                     downloadslabel.setLabel(label=downloads)
  2139.                    
  2140.                     ratingtextlabel.setVisible(True)
  2141.                    
  2142.                     showrating(rating, votesint)
  2143.                    
  2144.                    
  2145.                            
  2146.                     uninstalladdonbutton.setVisible(True)
  2147.                     installaddonbutton.setVisible(True)
  2148.                     voterepobutton.setVisible(True)
  2149.  
  2150.                    
  2151.                    
  2152.                    
  2153.         ##############################################################################################################         
  2154.                    
  2155.            
  2156.  
  2157.            
  2158.         if window.getFocus() == tweakslist:
  2159.        
  2160.             cachetweak_1stline.setVisible(False)
  2161.             cachetweak_2ndline.setVisible(False)
  2162.             tweakcachelabel1.setVisible(False)
  2163.             tweakcache_page1button.setVisible(False)
  2164.             applycachetweakbutton.setVisible(False)
  2165.             tweakcache_page2button.setVisible(False)
  2166.             slider1value.setVisible(False)
  2167.             slider1.setVisible(False)
  2168.             tweakcache_page2intro.setVisible(False)
  2169.             currentramsetting.setVisible(False)
  2170.             videcachesizelabel.setVisible(False)
  2171.             recommendedramsetting.setVisible(False)
  2172.             slider2.setVisible(False)
  2173.             curltimelabel.setVisible(False)
  2174.             currentcurlsetting.setVisible(False)
  2175.             slider2value.setVisible(False)
  2176.             recommendedcurlsetting.setVisible(False)
  2177.  
  2178.             slider3.setVisible(False)
  2179.             readbufferfactorlabel.setVisible(False)
  2180.             currentrbfsetting.setVisible(False)
  2181.             slider3value.setVisible(False)
  2182.             recommendedrbfsetting.setVisible(False)
  2183.             buffermodelabel.setVisible(False)
  2184.             mode1radiobutton.setVisible(False)
  2185.             mode2radiobutton.setVisible(False)
  2186.             mode3radiobutton.setVisible(False)
  2187.             mode4radiobutton.setVisible(False)
  2188.             slider1.setPercent(SLIDER1_INIT_VALUE)                   
  2189.             slider3.setPercent(SLIDER3_INIT_VALUE)
  2190.             slider2.setPercent(SLIDER2_INIT_VALUE)
  2191.             mode1radiobutton.setSelected(False)
  2192.             mode2radiobutton.setSelected(False)
  2193.             mode3radiobutton.setSelected(False)
  2194.             mode4radiobutton.setSelected(False)
  2195.             unblocklabel.setVisible(False)
  2196.             unblocklabel2.setVisible(False)
  2197.             unblocklabel3.setVisible(False)
  2198.             unblocklabel4.setVisible(False)
  2199.             unblocklabel5.setVisible(False)
  2200.             unblockurlbutton.setVisible(False)
  2201.             unblocklabelbad.setVisible(False)
  2202.        
  2203.             name = tweakslist.getListItem(tweakslist.getSelectedPosition()).getLabel() 
  2204.  
  2205.             colortag = "COLOR"
  2206.             if colortag in name:
  2207.                 opentag = name.find(']')
  2208.                 firstpart = name[opentag+1:]
  2209.                 closetag = firstpart.find('[')
  2210.                 #global name
  2211.                 name = firstpart[:closetag]
  2212.    
  2213.            
  2214.             if name == "Advanced Settings Wizard":
  2215.            
  2216.                 tweakcachelabel1.setVisible(True)
  2217.                 tweakcache_page1button.setVisible(True)
  2218.                 tweakcachelabel2.setVisible(False)
  2219.                 tweakcachelabel3.setVisible(False)
  2220.                 tweakcache_page2button.setVisible(False)
  2221.                 unblocklabel.setVisible(False)
  2222.                 unblocklabel2.setVisible(False)
  2223.                 unblocklabel3.setVisible(False)
  2224.                 unblocklabel4.setVisible(False)
  2225.                 unblocklabel5.setVisible(False)
  2226.                 unblockurlbutton.setVisible(False)
  2227.                 unblocklabelbad.setVisible(False)
  2228.                 unblockurlbutton.setVisible(False)
  2229.                
  2230.                
  2231.                 tweakslist.controlRight(tweakcache_page1button)
  2232.                 tweakcache_page1button.controlLeft(tweakslist)
  2233.                 tweakcache_page1button.controlUp(tweaksbutton)
  2234.                 applycachetweakbutton.controlLeft(tweakslist)
  2235.                 applycachetweakbutton.controlUp(tweaksbutton)
  2236.                 tweakcache_page2button.controlUp(tweaksbutton)
  2237.                 tweakcache_page2button.controlLeft(tweakslist)
  2238.                
  2239.             ##################################################################################################
  2240.                
  2241.             if name == "IceFilms: Blocked URL fix":
  2242.  
  2243.            
  2244.            
  2245.                 tweakcachelabel1.setVisible(False)
  2246.                 tweakcache_page1button.setVisible(False)
  2247.                 tweakcachelabel2.setVisible(False)
  2248.                 tweakcachelabel3.setVisible(False)
  2249.                 tweakcache_page2button.setVisible(False)
  2250.                 unblocklabel.setVisible(False)
  2251.                 unblocklabel2.setVisible(False)
  2252.                 unblocklabel3.setVisible(False)
  2253.                 unblocklabel4.setVisible(False)
  2254.                 unblocklabel5.setVisible(False)
  2255.                 unblockurlbutton.setVisible(False)
  2256.                 unblocklabelbad.setVisible(False)
  2257.                 unblockurlbutton.setVisible(False)
  2258.            
  2259.            
  2260.            
  2261.                 unblocklabel.setVisible(True)
  2262.                 name = "IceFilms"
  2263.                 icefilmspath = translate('special://home/userdata/addon_data/plugin.video.icefilms')
  2264.                 icefilmsxml = os.path.join(icefilmspath, 'settings.xml')
  2265.                
  2266.                 try:
  2267.                     targetxmlfile = open(icefilmsxml, 'r')
  2268.                     targetxmlcontents = targetxmlfile.read()
  2269.                    
  2270.                     currenturl = regex_from_to(targetxmlcontents, '<setting id="icefilms-url" value="', '" />')
  2271.                    
  2272.                 except:
  2273.                     icefilmspath2 = translate('special://home/addons/plugin.video.icefilms/resources')
  2274.                     icefilmsxml2 = os.path.join(icefilmspath2, 'settings.xml')
  2275.                    
  2276.                     targetxmlfile2 = open(icefilmsxml2, 'r')
  2277.                     targetxmlcontents = targetxmlfile2.read()
  2278.                    
  2279.                     currenturl = regex_from_to(targetxmlcontents, '<setting id="icefilms-url" type="text" label="30100" default="', '" />')
  2280.                    
  2281.                     string = '<settings>\n  <setting id="icefilms-url" value="'+ currenturl + '" />\n</settings>'
  2282.                    
  2283.                     try:
  2284.                         os.makedirs(icefilmspath)
  2285.                     except:
  2286.                         pass   
  2287.                    
  2288.                     f = open(icefilmsxml,'w')
  2289.                     f.write(string)
  2290.                     f.close()
  2291.                    
  2292.                    
  2293.                    
  2294.                    
  2295.                
  2296.                 if currenturl == "":
  2297.                     unblocklabelbad.setLabel('[COLOR=darkgray]' + name + strings.getstring("unblocklabelbad") + '[/COLOR]')
  2298.                
  2299.                 else:
  2300.  
  2301.                     unblocklabel2.setLabel('[COLOR=darkgray]' + strings.getstring("unblocklabel2") + name + ':[/COLOR]')
  2302.                     unblocklabel2.setVisible(True)
  2303.                    
  2304.                     unblocklabel3.setLabel('[COLOR=darkgray]' + currenturl + '[/COLOR]')
  2305.                     unblocklabel3.setVisible(True)
  2306.                    
  2307.                     unblocklabel4.setVisible(True)
  2308.  
  2309.                    
  2310.                     unblockurl = getunblockurl('plugin.video.icefilms')
  2311.                     unblocklabel5.setLabel('[COLOR=darkgray]' + unblockurl + '[/COLOR]')
  2312.                     unblocklabel5.setVisible(True)
  2313.                    
  2314.                     unblockurlbutton.setVisible(True)
  2315.                    
  2316.                     addonpath = "plugin.video.icefilms"
  2317.                    
  2318.                     tweakslist.controlRight(unblockurlbutton)
  2319.                     unblockurlbutton.controlLeft(tweakslist)
  2320.                     unblockurlbutton.controlUp(tweaksbutton)
  2321.                
  2322.  
  2323.             ##################################################################################################
  2324.                
  2325.             if name == "Primewire\\1Channel: Blocked URL fix":
  2326.  
  2327.            
  2328.            
  2329.                 tweakcachelabel1.setVisible(False)
  2330.                 tweakcache_page1button.setVisible(False)
  2331.                 tweakcachelabel2.setVisible(False)
  2332.                 tweakcachelabel3.setVisible(False)
  2333.                 tweakcache_page2button.setVisible(False)
  2334.                 unblocklabel.setVisible(False)
  2335.                 unblocklabel2.setVisible(False)
  2336.                 unblocklabel3.setVisible(False)
  2337.                 unblocklabel4.setVisible(False)
  2338.                 unblocklabel5.setVisible(False)
  2339.                 unblockurlbutton.setVisible(False)
  2340.                 unblocklabelbad.setVisible(False)
  2341.                 unblockurlbutton.setVisible(False)
  2342.                
  2343.                
  2344.            
  2345.                 unblocklabel.setVisible(True)
  2346.                 name = "1Channel"
  2347.                 icefilmspath = translate('special://home/userdata/addon_data/plugin.video.1channel')
  2348.                 icefilmsxml = os.path.join(icefilmspath, 'settings.xml')
  2349.                
  2350.  
  2351.                
  2352.                 try:
  2353.                     targetxmlfile = open(icefilmsxml, 'r')
  2354.                     targetxmlcontents = targetxmlfile.read()
  2355.                    
  2356.                     currenturl = regex_from_to(targetxmlcontents, '<setting id="customDomain" value="', '" />')
  2357.                    
  2358.                 except:
  2359.                     icefilmspath2 = translate('special://home/addons/plugin.video.1channel/resources')
  2360.                     icefilmsxml2 = os.path.join(icefilmspath2, 'settings.xml')
  2361.                    
  2362.  
  2363.                    
  2364.                     targetxmlfile2 = open(icefilmsxml2, 'r')
  2365.                     targetxmlcontents = targetxmlfile2.read()
  2366.                    
  2367.                     currenturl = regex_from_to(targetxmlcontents, ' default="', '"/>')
  2368.                    
  2369.                    
  2370.                    
  2371.                     string = '<settings>\n  <setting id="customDomain" value="'+ currenturl + '" />\n   <setting id="enableDomain" value="true" />\n</settings>'
  2372.                    
  2373.                    
  2374.  
  2375.                     try:
  2376.                         os.makedirs(icefilmspath)
  2377.                     except:
  2378.                         pass                   
  2379.                     f = open(icefilmsxml,'w')
  2380.                     f.write(string)
  2381.                     f.close()
  2382.                    
  2383.                 if debuglog == "true"
  2384.                     print currenturl   
  2385.                    
  2386.                
  2387.                 if currenturl == "":
  2388.                     unblocklabelbad.setLabel('[COLOR=darkgray]' + name + strings.getstring("unblocklabelbad") + '[/COLOR]')
  2389.                
  2390.                 else:
  2391.  
  2392.                     unblocklabel2.setLabel('[COLOR=darkgray]' + strings.getstring("unblocklabel2") + name + ':[/COLOR]')
  2393.                     unblocklabel2.setVisible(True)
  2394.                    
  2395.                     unblocklabel3.setLabel('[COLOR=darkgray]' + currenturl + '[/COLOR]')
  2396.                     unblocklabel3.setVisible(True)
  2397.                    
  2398.                     unblocklabel4.setVisible(True)
  2399.  
  2400.                    
  2401.                     unblockurl = getunblockurl('plugin.video.1channel')
  2402.                     unblocklabel5.setLabel('[COLOR=darkgray]' + unblockurl + '[/COLOR]')
  2403.                     unblocklabel5.setVisible(True)
  2404.                    
  2405.                     unblockurlbutton.setVisible(True)
  2406.                    
  2407.                     addonpath = "plugin.video.1channel"
  2408.                    
  2409.                     tweakslist.controlRight(unblockurlbutton)
  2410.                     unblockurlbutton.controlLeft(tweakslist)
  2411.                     unblockurlbutton.controlUp(tweaksbutton)   
  2412.                
  2413.             ################################################################################################################## 
  2414.        
  2415.  
  2416.         if window.getFocus() == morelist:          
  2417.                    
  2418.             name = morelist.getListItem(morelist.getSelectedPosition()).getLabel()
  2419.        
  2420.  
  2421.             colortag = "COLOR"
  2422.             if colortag in name:
  2423.                 opentag = name.find(']')
  2424.                 firstpart = name[opentag+1:]
  2425.                 closetag = firstpart.find('[')
  2426.                 name = firstpart[:closetag]
  2427.                
  2428.            
  2429.            
  2430.  
  2431.  
  2432.        
  2433.             if name == "System Information":
  2434.                 #systeminfo()
  2435.                 pass   
  2436.                
  2437.            
  2438.             if name == "Suggestions welcome..":
  2439.                 pass
  2440.                
  2441.                
  2442.            
  2443.  
  2444.             if name == "Internet Speed Test":
  2445.                
  2446.                 pass
  2447.                
  2448.                
  2449.                
  2450.                
  2451.                
  2452.                
  2453.                
  2454.         else:
  2455.             pass
  2456.     except:
  2457.         pass
  2458.  
  2459.            
  2460.  
  2461.    
  2462.        
  2463. def buildmainselect():
  2464.  
  2465.     global wizarddata
  2466.     global currentlist
  2467.     global buildmainraw
  2468.     global authorlabel
  2469.     global selectname
  2470.     downloadslabel.setLabel(' ')
  2471.     voteslabel.setLabel(' ')
  2472.     authorlabel.setLabel(' ')
  2473.     global buildlistotherraw
  2474.    
  2475.     global currentlist
  2476.     currentlist = "buildother"
  2477.    
  2478.     name = buildmainlist.getListItem(buildmainlist.getSelectedPosition()).getLabel()
  2479.  
  2480.     colortag = "COLOR"
  2481.     if colortag in name:
  2482.         opentag = name.find(']')
  2483.         firstpart = name[opentag+1:]
  2484.         closetag = firstpart.find('[')
  2485.        
  2486.         name = firstpart[:closetag]
  2487.        
  2488.        
  2489.     if name == "Featured Builds":
  2490.         hidecontrols()
  2491.         showfeaturedbuildslist()
  2492.     elif name == "The Black Box Builds":
  2493.         blackbox1()
  2494.     else:
  2495.         data = json.loads(buildmainraw)
  2496.         for entry in data:
  2497.             if name == entry['name']:
  2498.                 # dialog = xbmcgui.Dialog()
  2499.                 # dialog.ok("Result", entry['url'])
  2500.                
  2501.                 wizardurl = entry['url']
  2502.                
  2503.                 if debuglog == "true":
  2504.                     print '@ares: wizardurl...'
  2505.                     print wizardurl
  2506.  
  2507.            
  2508.            
  2509.                 req = urllib2.Request(wizardurl)
  2510.                 req.add_header('User-Agent', aresagent)
  2511.                 response = urllib2.urlopen(req)
  2512.                 wizarddata = response.read()
  2513.  
  2514.                 wizarddata = wizarddata.replace('\n','').replace('\r','')
  2515.                
  2516.  
  2517.                
  2518.                 if debuglog == "true":
  2519.                     print '@ares: wizarddata....'
  2520.                     print wizarddata
  2521.                
  2522.                 buildotherlist.reset()
  2523.                 count = 0
  2524.                
  2525.                 match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
  2526.                 for name,url,iconimage,fanart,description in match:
  2527.                
  2528.                     # addDir(name,url,1,iconimage,fanart,description)
  2529.                     buildotherlist.addItem('[COLOR=goldenrod]' + name + '[/COLOR]')
  2530.                     count = count + 1
  2531.                    
  2532.  
  2533.                    
  2534.                 hidecontrols()
  2535.                 buildotherlist.setVisible(True)
  2536.                
  2537.                 if count > 11:
  2538.                     scrolldownimage.setVisible(True)
  2539.                 else:
  2540.                     scrolldownimage.setVisible(False)
  2541.                    
  2542.                 if count > 0:
  2543.                
  2544.                     browsebuildsbutton.controlDown(buildotherlist)
  2545.                     buildotherlist.controlUp(browsebuildsbutton)
  2546.                    
  2547.                    
  2548.                     browseaddonsbutton.controlDown(buildotherlist)
  2549.                     browsebuildsbutton.controlDown(buildotherlist)
  2550.                     #browserepobutton.controlDown(buildotherlist)
  2551.                     maintenancebutton.controlDown(buildotherlist)
  2552.                     tweaksbutton.controlDown(buildotherlist)
  2553.                     morebutton.controlDown(buildotherlist)
  2554.                     settingsbutton.controlDown(buildotherlist)
  2555.                     buildotherlist.controlRight(installbuildbutton)
  2556.                     installbuildbutton.controlLeft(buildotherlist)
  2557.                     installbuildbutton.controlUp(freshstartbutton)
  2558.                     installbuildbutton.controlDown(repairbuildbutton)
  2559.                     # installbuildbutton.controlRight(votebuildbutton)
  2560.                    
  2561.                    
  2562.                     freshstartbutton.controlUp(browsebuildsbutton)
  2563.                     freshstartbutton.controlDown(installbuildbutton)
  2564.                     freshstartbutton.controlLeft(buildotherlist)
  2565.                    
  2566.                     repairbuildbutton.controlUp(installbuildbutton)
  2567.                     repairbuildbutton.controlDown(votebuildbutton)
  2568.                     repairbuildbutton.controlLeft(buildotherlist)
  2569.                    
  2570.                     votebuildbutton.controlUp(repairbuildbutton)
  2571.                     votebuildbutton.controlLeft(buildotherlist)
  2572.                    
  2573.                    
  2574.                    
  2575.                     global windowimage
  2576.                     #windowimage.setImage(fanart)
  2577.                     windowimage.setVisible(True)
  2578.                                        
  2579.                     global namelabel
  2580.                     #namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  2581.                     namelabel.setVisible(True)
  2582.                    
  2583.  
  2584.                     #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  2585.                     authorlabel.setVisible(True)
  2586.                    
  2587.                     voteslabel.setVisible(True)
  2588.                     votestextlabel.setVisible(True)
  2589.                     #voteslabel.setLabel(label=votes)
  2590.                    
  2591.                    
  2592.                     downloadslabel.setVisible(True)
  2593.                     downloadstextlabel.setVisible(True)
  2594.                     #downloadslabel.setLabel(label=downloads)
  2595.                    
  2596.                     ratingtextlabel.setVisible(True)
  2597.                    
  2598.                     #showrating(rating, votesint)
  2599.  
  2600.                     installbuildbutton.setVisible(True)
  2601.                     votebuildbutton.setVisible(True)   
  2602.                     freshstartbutton.setVisible(True)
  2603.                     repairbuildbutton.setVisible(True)
  2604.                    
  2605.                     sizelabel.setVisible(True)
  2606.                     sizetextlabel.setVisible(True)
  2607.                
  2608.                
  2609.                     if loginstatus == 'mac0':
  2610.                         votebuildbutton.setEnabled(False)
  2611.                     else:
  2612.                         votebuildbutton.setEnabled(True)
  2613.                        
  2614.                        
  2615.                        
  2616.                        
  2617.                    
  2618.                    
  2619.  
  2620.                    
  2621.                     name2 = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
  2622.                    
  2623.                     colortag = "COLOR"
  2624.                     if colortag in name2:
  2625.                         opentag = name2.find(']')
  2626.                         firstpart = name2[opentag+1:]
  2627.                         closetag = firstpart.find('[')
  2628.                        
  2629.                         name2 = firstpart[:closetag]
  2630.                        
  2631.                        
  2632.                     count = 0  
  2633.                        
  2634.                     for name,url,iconimage,fanart,description in match:
  2635.                    
  2636.                         if name2 == name:
  2637.                            
  2638.                             namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  2639.                             windowimage.setImage(fanart)
  2640.                             count = count + 1
  2641.                            
  2642.                            
  2643.                            
  2644.                            
  2645.                            
  2646.                            
  2647.                             try:
  2648.                                 buildlistotherraw
  2649.                             except:
  2650.                        
  2651.                                 url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsother&time=' + datetime.datetime.now().strftime('%S')
  2652.  
  2653.                                
  2654.                                 if debuglog == "true":
  2655.                                     print '@ares: buildlistotherurl...'
  2656.                                     print url
  2657.  
  2658.                            
  2659.                            
  2660.                                 req = urllib2.Request(url)
  2661.                                 req.add_header('User-Agent', aresagent)
  2662.                                 response = urllib2.urlopen(req)
  2663.                                 buildlistotherraw = response.read()
  2664.                                
  2665.                                
  2666.                                
  2667.                                 if debuglog == "true":
  2668.                                     print ' '
  2669.                                     print '@ares: buildlistotherraw...'
  2670.                                     print ' '
  2671.                                     print buildlistotherraw
  2672.                                
  2673.                                
  2674.                                
  2675.                                
  2676.                             data = json.loads(buildlistotherraw)   
  2677.                             for entry in data:
  2678.                                 if entry['name'] == name2:
  2679.                                
  2680.                                     if debuglog == "true":
  2681.                                         print '@ares: build name found...'
  2682.                                         # print '@ares: buidinfo-rating: ' + entry['rating']
  2683.                                         # print '@ares: buidinfo-votes: ' + entry['votes']
  2684.                                         # print '@ares: buidinfo-downloads: ' + entry['downloads']
  2685.                                    
  2686.                                     global rating
  2687.                                     rating = entry['rating']
  2688.                                     votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  2689.                                     votesint = entry['votes']
  2690.                                     downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  2691.                                     downloadsint = entry['downloads']
  2692.                                    
  2693.                                     voteslabel.setVisible(True)
  2694.                                     votestextlabel.setVisible(True)
  2695.                                     voteslabel.setLabel(label=votes)
  2696.                                    
  2697.                                    
  2698.                                     downloadslabel.setVisible(True)
  2699.                                     downloadstextlabel.setVisible(True)
  2700.                                     downloadslabel.setLabel(label=downloads)
  2701.                                    
  2702.                                     ratingtextlabel.setVisible(True)
  2703.                                    
  2704.                                     showrating(rating, votesint)
  2705.                                     break
  2706.                            
  2707.  
  2708.                            
  2709.                             #global authorlabel
  2710.                             #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]')
  2711.                             #authorlabel.setVisible(True)
  2712.                            
  2713.                             voteslabel.setVisible(True)
  2714.                            
  2715.                            
  2716.                             checkfile = os.path.join(datadir, name + '.zip')
  2717.                             #print checkfile
  2718.                             if os.path.isfile(checkfile):
  2719.                                 repairbuildbutton.setEnabled(True)
  2720.                             else:
  2721.                                 repairbuildbutton.setEnabled(False)
  2722.                            
  2723.                            
  2724.                             downloadslabel.setVisible(True)
  2725.                            
  2726.                            
  2727.                             ratingtextlabel.setVisible(True)
  2728.                            
  2729.                            
  2730.  
  2731.                             freshstartbutton.setVisible(True)
  2732.                             installbuildbutton.setVisible(True)
  2733.                             votebuildbutton.setVisible(True)
  2734.                             repairbuildbutton.setVisible(True)
  2735.                            
  2736.                             if loginstatus == 'mac0':
  2737.                                 votebuildbutton.setEnabled(False)
  2738.                             else:
  2739.                                 votebuildbutton.setEnabled(True)       
  2740.                            
  2741.                            
  2742.                            
  2743.                            
  2744.                            
  2745.                            
  2746.                            
  2747.                            
  2748.                            
  2749.                        
  2750.                
  2751.                 if count > 0:
  2752.                     window.setFocus(buildotherlist)
  2753.                     buildotherlist.selectItem(0)
  2754.                 else:
  2755.                     window.setFocus(browsebuildsbutton)
  2756.  
  2757. def buildfeaturedselect():
  2758.  
  2759.     global buildlistraw
  2760.     global name
  2761.    
  2762.     data = json.loads(buildlistraw)
  2763.     for entry in data:
  2764.         if entry['name'] == name:
  2765.             url = entry['url']
  2766.            
  2767.             f = urllib2.urlopen(url)
  2768.             size= f.headers["Content-Length"]
  2769.            
  2770.             size = float(size)
  2771.            
  2772.             size = size /1024/1024
  2773.            
  2774.             #size = round(size)
  2775.            
  2776.             sizelabel.setLabel('[COLOR=darkgray]' + "%.2f" % size + '[/COLOR]')
  2777.             break
  2778.    
  2779.  
  2780.    
  2781.     window.setFocus(installbuildbutton)
  2782.            
  2783.        
  2784. def buildtoherselect():
  2785.  
  2786.     global wizarddata
  2787.    
  2788.     if currentlist == "blackbox":
  2789.         window.setFocus(installbuildbutton)
  2790.         return()
  2791.        
  2792.  
  2793.  
  2794.     name2 = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
  2795.  
  2796.     colortag = "COLOR"
  2797.     if colortag in name2:
  2798.         opentag = name2.find(']')
  2799.         firstpart = name2[opentag+1:]
  2800.         closetag = firstpart.find('[')
  2801.        
  2802.         name2 = firstpart[:closetag]
  2803.        
  2804.     match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
  2805.     for name,url,iconimage,fanart,description in match:
  2806.        
  2807.         if name == name2:
  2808.        
  2809.             req = urllib2.Request(url)
  2810.             req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
  2811.             f = urllib2.urlopen(req)
  2812.  
  2813.             size= f.headers["Content-Length"]
  2814.            
  2815.             size = float(size)
  2816.            
  2817.             size = size /1024/1024
  2818.            
  2819.             #size = round(size)
  2820.            
  2821.             sizelabel.setLabel("%.2f" % size)
  2822.             break
  2823.            
  2824.     window.setFocus(installbuildbutton)
  2825.        
  2826.  
  2827.        
  2828.        
  2829. def blackbox1():
  2830.  
  2831.     global buildlistotherraw
  2832.     global currentlist
  2833.     global authorlabel
  2834.     global selectname
  2835.     global blackboxdata
  2836.    
  2837.     currentlist = "blackbox"
  2838.     downloadslabel.setLabel(' ')
  2839.     voteslabel.setLabel(' ')
  2840.     authorlabel.setLabel(' ')
  2841.    
  2842.     buildotherlist.reset()
  2843.     count = 0
  2844.  
  2845.     # dialog = xbmcgui.Dialog()
  2846.     # dialog.ok("Result", "Black Box aye aye")
  2847.    
  2848.     CHECKURL = "http://tbbwizard.co.uk"
  2849.    
  2850.     url = CHECKURL + "/pod/curr_builds.php"
  2851.    
  2852.    
  2853.     try:
  2854.         req = urllib2.Request(url)
  2855.         req.add_header('User-Agent', 'Kodi/Ares Wizard')
  2856.         response = urllib2.urlopen(req)
  2857.        
  2858.         data = response.read()
  2859.        
  2860.     except:
  2861.    
  2862.         dialog = xbmcgui.Dialog()
  2863.         dialog.ok('Ares Wizard', 'Failed to communicate with BlackBox server')
  2864.         return()
  2865.    
  2866.    
  2867.    
  2868.    
  2869.    
  2870.    
  2871.    
  2872.     blackboxdata = json.loads(data)
  2873.  
  2874.     for build in blackboxdata:
  2875.         buildotherlist.addItem('[COLOR=goldenrod]' + build['bfriendlyname'] + '[/COLOR]')
  2876.         #addDir(build['bfriendlyname'] + ' - ' + build['bversion'],build['bslug'],5,build['bicon'],FANART,'')
  2877.         count = count + 1
  2878.                    
  2879.  
  2880.                    
  2881.     hidecontrols()
  2882.     buildotherlist.setVisible(True)
  2883.    
  2884.     if count > 11:
  2885.         scrolldownimage.setVisible(True)
  2886.     else:
  2887.         scrolldownimage.setVisible(False)
  2888.        
  2889.     if count > 0:
  2890.    
  2891.         browsebuildsbutton.controlDown(buildotherlist)
  2892.         buildotherlist.controlUp(browsebuildsbutton)
  2893.        
  2894.        
  2895.         browseaddonsbutton.controlDown(buildotherlist)
  2896.         browsebuildsbutton.controlDown(buildotherlist)
  2897.         #browserepobutton.controlDown(buildotherlist)
  2898.         maintenancebutton.controlDown(buildotherlist)
  2899.         tweaksbutton.controlDown(buildotherlist)
  2900.         morebutton.controlDown(buildotherlist)
  2901.         settingsbutton.controlDown(buildotherlist)
  2902.         buildotherlist.controlRight(installbuildbutton)
  2903.         installbuildbutton.controlLeft(buildotherlist)
  2904.         installbuildbutton.controlUp(freshstartbutton)
  2905.         installbuildbutton.controlDown(repairbuildbutton)
  2906.         # installbuildbutton.controlRight(votebuildbutton)
  2907.        
  2908.        
  2909.         freshstartbutton.controlUp(browsebuildsbutton)
  2910.         freshstartbutton.controlDown(installbuildbutton)
  2911.         freshstartbutton.controlLeft(buildotherlist)
  2912.        
  2913.         repairbuildbutton.controlUp(installbuildbutton)
  2914.         repairbuildbutton.controlDown(votebuildbutton)
  2915.         repairbuildbutton.controlLeft(buildotherlist)
  2916.        
  2917.         votebuildbutton.controlUp(repairbuildbutton)
  2918.         votebuildbutton.controlLeft(buildotherlist)
  2919.        
  2920.        
  2921.        
  2922.         global windowimage
  2923.         #windowimage.setImage(fanart)
  2924.         windowimage.setVisible(True)
  2925.                            
  2926.         global namelabel
  2927.         #namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  2928.         namelabel.setVisible(True)
  2929.        
  2930.  
  2931.         #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  2932.         authorlabel.setVisible(True)
  2933.        
  2934.         voteslabel.setVisible(True)
  2935.         votestextlabel.setVisible(True)
  2936.         #voteslabel.setLabel(label=votes)
  2937.        
  2938.        
  2939.         downloadslabel.setVisible(True)
  2940.         downloadstextlabel.setVisible(True)
  2941.         #downloadslabel.setLabel(label=downloads)
  2942.        
  2943.         ratingtextlabel.setVisible(True)
  2944.        
  2945.         #showrating(rating, votesint)
  2946.  
  2947.         installbuildbutton.setVisible(True)
  2948.         votebuildbutton.setVisible(True)   
  2949.         freshstartbutton.setVisible(True)
  2950.         repairbuildbutton.setVisible(True)
  2951.        
  2952.         sizelabel.setVisible(False)
  2953.         sizetextlabel.setVisible(False)
  2954.    
  2955.    
  2956.         if loginstatus == 'mac0':
  2957.             votebuildbutton.setEnabled(False)
  2958.         else:
  2959.             votebuildbutton.setEnabled(True)
  2960.            
  2961.            
  2962.            
  2963.            
  2964.        
  2965.        
  2966.  
  2967.        
  2968.         name2 = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
  2969.        
  2970.         colortag = "COLOR"
  2971.         if colortag in name2:
  2972.             opentag = name2.find(']')
  2973.             firstpart = name2[opentag+1:]
  2974.             closetag = firstpart.find('[')
  2975.            
  2976.             name2 = firstpart[:closetag]
  2977.            
  2978.            
  2979.         # count = 0
  2980.        
  2981.    
  2982.         try:
  2983.             buildlistotherraw
  2984.         except:
  2985.  
  2986.             url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsother&time=' + datetime.datetime.now().strftime('%S')
  2987.  
  2988.            
  2989.             if debuglog == "true":
  2990.                 print '@ares: buildlistotherurl...'
  2991.                 print url
  2992.  
  2993.        
  2994.        
  2995.             req = urllib2.Request(url)
  2996.             req.add_header('User-Agent', aresagent)
  2997.             response = urllib2.urlopen(req)
  2998.             buildlistotherraw = response.read()
  2999.            
  3000.            
  3001.            
  3002.             if debuglog == "true":
  3003.                 print ' '
  3004.                 print '@ares: buildlistotherraw...'
  3005.                 print ' '
  3006.                 print buildlistotherraw
  3007.            
  3008.            
  3009.            
  3010.            
  3011.         data = json.loads(buildlistotherraw)   
  3012.         for entry in data:
  3013.             if entry['name'] == name2:
  3014.            
  3015.                 if debuglog == "true":
  3016.                     print ' '
  3017.                     print '@ares: build name found...'
  3018.                     # print '@ares: buidinfo-rating: ' + entry['rating']
  3019.                     # print '@ares: buidinfo-votes: ' + entry['votes']
  3020.                     # print '@ares: buidinfo-downloads: ' + entry['downloads']
  3021.                
  3022.                 global rating
  3023.                 rating = entry['rating']
  3024.                 votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  3025.                 votesint = entry['votes']
  3026.                 downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  3027.                 downloadsint = entry['downloads']
  3028.                
  3029.                 voteslabel.setVisible(True)
  3030.                 votestextlabel.setVisible(True)
  3031.                 voteslabel.setLabel(label=votes)
  3032.                
  3033.                
  3034.                 downloadslabel.setVisible(True)
  3035.                 downloadstextlabel.setVisible(True)
  3036.                 downloadslabel.setLabel(label=downloads)
  3037.                
  3038.                 ratingtextlabel.setVisible(True)
  3039.                
  3040.                 showrating(rating, votesint)
  3041.                 break
  3042.        
  3043.  
  3044.        
  3045.         #global authorlabel
  3046.         #authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]')
  3047.         #authorlabel.setVisible(True)
  3048.        
  3049.         voteslabel.setVisible(True)
  3050.        
  3051.        
  3052.         checkfile = os.path.join(datadir, name2 + '.zip')
  3053.         #print checkfile
  3054.         if os.path.isfile(checkfile):
  3055.             repairbuildbutton.setEnabled(True)
  3056.         else:
  3057.             repairbuildbutton.setEnabled(False)
  3058.        
  3059.        
  3060.         downloadslabel.setVisible(True)
  3061.        
  3062.        
  3063.         ratingtextlabel.setVisible(True)
  3064.        
  3065.        
  3066.  
  3067.         freshstartbutton.setVisible(True)
  3068.         installbuildbutton.setVisible(True)
  3069.         votebuildbutton.setVisible(True)
  3070.         repairbuildbutton.setVisible(True)
  3071.        
  3072.         if loginstatus == 'mac0':
  3073.             votebuildbutton.setEnabled(False)
  3074.         else:
  3075.             votebuildbutton.setEnabled(True)       
  3076.        
  3077.                
  3078.                
  3079.                
  3080.                
  3081.    
  3082.                
  3083.            
  3084.    
  3085.     if count > 0:
  3086.         window.setFocus(buildotherlist)
  3087.         buildotherlist.selectItem(0)
  3088.        
  3089.        
  3090.        
  3091.         selectname = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
  3092.        
  3093.         colortag = "COLOR"
  3094.         if colortag in selectname:
  3095.             opentag = selectname.find(']')
  3096.             firstpart = selectname[opentag+1:]
  3097.             closetag = firstpart.find('[')
  3098.        
  3099.  
  3100.        
  3101.         sizelabel.setLabel('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
  3102.  
  3103.            
  3104.  
  3105.         selectname = firstpart[:closetag]
  3106.        
  3107.        
  3108.        
  3109.         for build in blackboxdata:
  3110.            
  3111.             if selectname == build['bfriendlyname']:
  3112.                 desticon = build['bicon']
  3113.                 destfanart = build['bicon']
  3114.                 destdescr = build['bfriendlyname']
  3115.                 bslug = build['bslug']
  3116.                 break      
  3117.        
  3118.         windowimage.setImage(destfanart)   
  3119.        
  3120.        
  3121.     else:
  3122.         window.setFocus(browsebuildsbutton)
  3123.  
  3124.        
  3125.  
  3126. def blackbox2():
  3127.  
  3128.     global buildlistotherraw
  3129.     global currentlist
  3130.     global selectname
  3131.     global buildlistotherraw
  3132.     global blackboxdata
  3133.     global bslug
  3134.     global deviceid
  3135.     global mac
  3136.     global username
  3137.    
  3138.    
  3139.    
  3140.     CHECKURL = "http://tbbwizard.co.uk"
  3141.    
  3142.     url = CHECKURL + "/pod/build.php?" + "b=" + bslug
  3143.    
  3144.     req = urllib2.Request(url)
  3145.     req.add_header('User-Agent', 'Kodi/Ares Wizard')
  3146.     response = urllib2.urlopen(req)
  3147.    
  3148.     data = response.read()
  3149.    
  3150.    
  3151.     parsed = json.loads(data)
  3152.    
  3153.    
  3154.  
  3155.     if parsed.get('auth'):
  3156.    
  3157.         url = parsed.get('url')
  3158.         id = parsed.get('id')
  3159.        
  3160.         # dialog = xbmcgui.Dialog()
  3161.         # dialog.ok("Result", url)
  3162.        
  3163.        
  3164.         result = manageaddon.installbuild(selectname, url, deviceid, mac, username, 'blackbox', id)
  3165.        
  3166.         if result == "kodirunning":
  3167.        
  3168.                 if xbmc.getCondVisibility('system.platform.android'):
  3169.                
  3170.                     hidecontrols()
  3171.                     # buildinstallpng
  3172.                     backimage.setImage(buildinstallpng)
  3173.                     loginbutton.setEnabled(False)
  3174.                     browsebuildsbutton.setEnabled(False)
  3175.                     browseaddonsbutton.setEnabled(False)
  3176.                     backupbutton.setEnabled(False)
  3177.                     maintenancebutton.setEnabled(False)
  3178.                     tweaksbutton.setEnabled(False)
  3179.                     morebutton.setEnabled(False)
  3180.                     settingsbutton.setEnabled(False)
  3181.                     closebutton.setEnabled(False)
  3182.        
  3183.        
  3184.        
  3185.            
  3186.         if result == 'downloadfalse':
  3187.    
  3188.                 dialog = xbmcgui.Dialog()
  3189.                 dialog.ok(strings.getstring("areswizard"), strings.getstring("downloadfailed2"))
  3190.                
  3191.         elif result == 'notvalidzip':
  3192.        
  3193.             dialog = xbmcgui.Dialog()
  3194.             dialog.ok(strings.getstring("areswizard"), strings.getstring("notvalidzip"))
  3195.            
  3196.            
  3197.         elif result == 'unzipfail':
  3198.        
  3199.             dialog = xbmcgui.Dialog()
  3200.             dialog.ok(strings.getstring("areswizard"), strings.getstring("unzipfail"))
  3201.            
  3202.         else:
  3203.                
  3204.                 dialog = xbmcgui.Dialog()
  3205.                 dialog.ok(strings.getstring("areswizard"), strings.getstring("kodinotclosed"))
  3206.        
  3207.        
  3208.        
  3209.        
  3210.        
  3211.     else:
  3212.  
  3213.         dialog = xbmcgui.Dialog()
  3214.         dialog.ok("Message from The Black Box", parsed.get('etit'), parsed.get('emsg'))
  3215.        
  3216.        
  3217.        
  3218. def tweakslistselect():
  3219.  
  3220.     name = tweakslist.getListItem(tweakslist.getSelectedPosition()).getLabel()
  3221.        
  3222.  
  3223.     colortag = "COLOR"
  3224.     if colortag in name:
  3225.         opentag = name.find(']')
  3226.         firstpart = name[opentag+1:]
  3227.         closetag = firstpart.find('[')
  3228.         name = firstpart[:closetag]
  3229.        
  3230.    
  3231.  
  3232.            
  3233.     if name == "Primewire\\1Channel: Blocked URL fix":
  3234.    
  3235.         window.setFocus(unblockurlbutton)
  3236.        
  3237.        
  3238.     if name == "IceFilms: Blocked URL fix":
  3239.    
  3240.         window.setFocus(unblockurlbutton)
  3241.        
  3242.        
  3243.     if name == "Advanced Settings Wizard":
  3244.    
  3245.         window.setFocus(tweakcache_page1button)
  3246.        
  3247.    
  3248.  
  3249.  
  3250.  
  3251.    
  3252.        
  3253. def speedtestfunc():
  3254.  
  3255.     speedtestresult = speedtest.speedtest()
  3256.    
  3257.    
  3258.     if speedtestresult == "uploadfail":
  3259.        
  3260.         dialog = xbmcgui.Dialog()
  3261.         dialog.ok(strings.getstring("areswizard"), strings.getstring("speedtestuploadfailed"))
  3262.         return()
  3263.    
  3264.     # currentdl = speedtestresult[1]
  3265.     # currentdl = "%.2f" % currentdl
  3266.    
  3267.        
  3268.     # currentul = speedtestresult[3]
  3269.     # currentul = "%.2f" % currentul
  3270.    
  3271.        
  3272.     # currentping = speedtestresult[5]
  3273.    
  3274.     # currentserver = speedtestresult[6]
  3275.    
  3276.    
  3277.    
  3278.     # dialog = xbmcgui.Dialog()
  3279.     # dialog.ok("string", str(currentdl), str(currentul), str(currentping))
  3280.    
  3281.    
  3282.     # dialog = xbmcgui.Dialog()
  3283.     # dialog.ok("string", str(currentserver))
  3284.    
  3285.    
  3286.     randomnumber = random.randrange(10000)
  3287.     newfolder = os.path.join(datapath, 'speedtest-' + str(randomnumber))
  3288.     os.mkdir(newfolder)
  3289.    
  3290.    
  3291.    
  3292.     speedtest3 = os.path.join(datapath, 'speedtest3.png')
  3293.     speedtest2 = os.path.join(datapath, 'speedtest2.png')
  3294.     speedtest1 = os.path.join(datapath, 'speedtest1.png')
  3295.    
  3296.    
  3297.     speedtest3temp = os.path.join(newfolder, 'speedtest3.png')
  3298.     speedtest2temp = os.path.join(newfolder, 'speedtest2.png')
  3299.     speedtest1temp = os.path.join(newfolder, 'speedtest1.png')
  3300.                
  3301.     if os.path.isfile(speedtest3):
  3302.         os.remove(speedtest3)
  3303.    
  3304.     if os.path.isfile(speedtest2):
  3305.         os.rename(speedtest2, speedtest3)
  3306.         shutil.copyfile(speedtest3, speedtest3temp)
  3307.        
  3308.     if os.path.isfile(speedtest1):
  3309.         os.rename(speedtest1, speedtest2)
  3310.         shutil.copyfile(speedtest2, speedtest2temp)
  3311.    
  3312.    
  3313.    
  3314.     req = urllib2.Request(speedtestresult[0])
  3315.     req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
  3316.     response = urllib2.urlopen(req)
  3317.    
  3318.     reporaw = response.read()
  3319.     file = open(speedtest1, "wb")
  3320.     file.write(reporaw)
  3321.     file.close()
  3322.        
  3323.     shutil.copyfile(speedtest1, speedtest1temp)
  3324.  
  3325.    
  3326.     if os.path.isfile(speedtest3):
  3327.         speedtestimage3.setImage(speedtest3temp)
  3328.     else:
  3329.         speedtestimage3.setImage(os.path.join(images_path, 'nodata.png'))
  3330.        
  3331.        
  3332.     if os.path.isfile(speedtest2):
  3333.         speedtestimage2.setImage(speedtest2temp)
  3334.     else:
  3335.         speedtestimage2.setImage(os.path.join(images_path, 'nodata.png'))
  3336.        
  3337.        
  3338.     if os.path.isfile(speedtest1):
  3339.         speedtestimage.setImage(speedtest1temp)
  3340.     else:
  3341.         speedtestimage.setImage(os.path.join(images_path, 'nodata.png'))
  3342.        
  3343.     time.sleep(5)  
  3344.     shutil.rmtree(newfolder)
  3345.    
  3346.        
  3347.        
  3348.        
  3349. def morelistselect():
  3350.  
  3351.     name = morelist.getListItem(morelist.getSelectedPosition()).getLabel()
  3352.        
  3353.  
  3354.     colortag = "COLOR"
  3355.     if colortag in name:
  3356.         opentag = name.find(']')
  3357.         firstpart = name[opentag+1:]
  3358.         closetag = firstpart.find('[')
  3359.         name = firstpart[:closetag]
  3360.        
  3361.    
  3362.  
  3363.            
  3364.     if name == "System Information":
  3365.    
  3366.         systeminfo()
  3367.         window.setFocus(morebutton)
  3368.        
  3369.        
  3370.        
  3371.     if name == "Upload Kodi Log":
  3372.                 maintenance.uploadlog()
  3373.  
  3374.        
  3375.        
  3376.     if name == "Internet Speed Test":
  3377.    
  3378.                 speedtest1 = os.path.join(datapath, 'speedtest1.png')
  3379.                
  3380.                 if os.path.isfile(speedtest1):
  3381.                     speedtestimage.setImage(speedtest1)
  3382.                 else:
  3383.                     speedtestimage.setImage(os.path.join(images_path, 'nodata.png'))
  3384.                    
  3385.                 speedtestimage.setVisible(True)
  3386.                
  3387.  
  3388.                
  3389.                 speedtest2 = os.path.join(datapath, 'speedtest2.png')
  3390.                
  3391.                 if os.path.isfile(speedtest2):
  3392.                     speedtestimage2.setImage(speedtest2)
  3393.                 else:
  3394.                     speedtestimage2.setImage(os.path.join(images_path, 'nodata.png'))
  3395.                    
  3396.                 speedtestimage2.setVisible(True)
  3397.                
  3398.                
  3399.                
  3400.                 speedtest3 = os.path.join(datapath, 'speedtest3.png')
  3401.                
  3402.                 if os.path.isfile(speedtest3):
  3403.                     speedtestimage3.setImage(speedtest3)
  3404.                 else:
  3405.                     speedtestimage3.setImage(os.path.join(images_path, 'nodata.png'))
  3406.                    
  3407.                 speedtestimage3.setVisible(True)
  3408.                
  3409.                
  3410.                
  3411.                
  3412.                
  3413.                
  3414.                
  3415.                 dospeedtestbutton.setVisible(True)
  3416.                
  3417.                 speedtestprevlabel.setVisible(True)
  3418.    
  3419.                 window.setFocus(dospeedtestbutton)
  3420.                
  3421.                 dospeedtestbutton.controlLeft(morelist)
  3422.                 dospeedtestbutton.controlUp(morebutton)
  3423.                 morelist.controlRight(dospeedtestbutton)
  3424.    
  3425.                
  3426.                
  3427.     if name == "Erase all Data/Fresh Start":           
  3428.                
  3429.                 freshstartprompt = xbmcgui.Dialog().yesno(strings.getstring("areswizard"), strings.getstring("buildinstallfreshstart1"), '', strings.getstring("buildinstallfreshstart2"), yeslabel='Yes',nolabel='No')
  3430.    
  3431.                 if freshstartprompt == 1:
  3432.                     manageaddon.freshstart()
  3433.  
  3434.                     if debuglog == "true":
  3435.                         print '----------------------------------'
  3436.                         print '-->   kodi still running    <--'
  3437.                         print '-----------------------------------'
  3438.                
  3439.                     xbmc.executebuiltin("ReloadSkin()")
  3440.                        
  3441.                     hidecontrols()
  3442.                     # buildinstallpng
  3443.                     backimage.setImage(buildinstallpng)
  3444.                     loginbutton.setEnabled(False)
  3445.                     browsebuildsbutton.setEnabled(False)
  3446.                     browseaddonsbutton.setEnabled(False)
  3447.                     backupbutton.setEnabled(False)
  3448.                     maintenancebutton.setEnabled(False)
  3449.                     tweaksbutton.setEnabled(False)
  3450.                     morebutton.setEnabled(False)
  3451.                     settingsbutton.setEnabled(False)
  3452.                     closebutton.setEnabled(False)
  3453.                
  3454.                
  3455.     if name == "Force Close Kodi":             
  3456.                
  3457.                 manageaddon.killkodi()
  3458.            
  3459.        
  3460.            
  3461.            
  3462. def setAnimation(control):
  3463.     # Set fade animation for all add-on window controls
  3464.     control.setAnimations([('WindowOpen', 'effect=fade start=0 end=100 time=500',),
  3465.                             ('WindowClose', 'effect=fade start=100 end=0 time=500',)])
  3466.                
  3467.                    
  3468. def getbuilddetails():
  3469.  
  3470.     global wizarddata
  3471.     global currentlist
  3472.     global buildlistraw
  3473.     global selectname
  3474.  
  3475.  
  3476.     if currentlist == "buildother":
  3477.        
  3478.         selectname = buildotherlist.getListItem(buildotherlist.getSelectedPosition()).getLabel()
  3479.        
  3480.        
  3481.         colortag = "COLOR"
  3482.         if colortag in selectname:
  3483.             opentag = selectname.find(']')
  3484.             firstpart = selectname[opentag+1:]
  3485.             closetag = firstpart.find('[')
  3486.            
  3487.            
  3488.             selectname = firstpart[:closetag]
  3489.        
  3490.        
  3491.         match = re.compile('name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?escription="(.+?)"').findall(wizarddata)
  3492.        
  3493.         for name,url,iconimage,fanart,description in match:
  3494.        
  3495.             if selectname == name:
  3496.            
  3497.                 url = url
  3498.                 break
  3499.                
  3500.         result = manageaddon.installbuild(selectname, url, deviceid, mac, username, 'normal', '')
  3501.        
  3502.         if result == "kodirunning":
  3503.        
  3504.                 if xbmc.getCondVisibility('system.platform.android'):
  3505.                
  3506.                     hidecontrols()
  3507.                     # buildinstallpng
  3508.                     backimage.setImage(buildinstallpng)
  3509.                     loginbutton.setEnabled(False)
  3510.                     browsebuildsbutton.setEnabled(False)
  3511.                     browseaddonsbutton.setEnabled(False)
  3512.                     backupbutton.setEnabled(False)
  3513.                     maintenancebutton.setEnabled(False)
  3514.                     tweaksbutton.setEnabled(False)
  3515.                     morebutton.setEnabled(False)
  3516.                     settingsbutton.setEnabled(False)
  3517.                     closebutton.setEnabled(False)
  3518.        
  3519.        
  3520.        
  3521.            
  3522.         if result == 'downloadfalse':
  3523.    
  3524.                 dialog = xbmcgui.Dialog()
  3525.                 dialog.ok(strings.getstring("areswizard"), strings.getstring("downloadfailed2"))
  3526.                
  3527.         elif result == 'notvalidzip':
  3528.        
  3529.             dialog = xbmcgui.Dialog()
  3530.             dialog.ok(strings.getstring("areswizard"), strings.getstring("notvalidzip"))
  3531.            
  3532.            
  3533.         elif result == 'unzipfail':
  3534.        
  3535.             dialog = xbmcgui.Dialog()
  3536.             dialog.ok(strings.getstring("areswizard"), strings.getstring("unzipfail"))
  3537.            
  3538.         else:
  3539.                
  3540.                 dialog = xbmcgui.Dialog()
  3541.                 dialog.ok(strings.getstring("areswizard"), strings.getstring("kodinotclosed"))
  3542.                
  3543.     else:
  3544.    
  3545.         selectname = buildlist.getListItem(buildlist.getSelectedPosition()).getLabel()
  3546.        
  3547.         colortag = "COLOR"
  3548.         if colortag in selectname:
  3549.             opentag = selectname.find(']')
  3550.             firstpart = selectname[opentag+1:]
  3551.             closetag = firstpart.find('[')
  3552.            
  3553.  
  3554.             selectname = firstpart[:closetag]
  3555.    
  3556.         data = json.loads(buildlistraw)
  3557.         for entry in data:
  3558.             if entry['name'] == selectname:
  3559.                 url = entry['url']
  3560.                 iconimage = 'http://' + entry['icon']
  3561.                 descr = entry['descr']
  3562.                 fanart = 'http://' + entry['icon']
  3563.                 author = entry['author']
  3564.                 rating = entry['rating']
  3565.                 votes = entry['votes']
  3566.                 votesint = entry['votes']
  3567.                 global downloads
  3568.                 downloads = int(entry['downloads'])
  3569.  
  3570.     # dialog = xbmcgui.Dialog()
  3571.     # dialog.ok(name, "URL: " + url + "\n" + "Iconimage: " + iconimage + "\n" + "Descr: " + descr + "\n" + "Fanart: " + fanart, "", "")
  3572.    
  3573.         result = manageaddon.installbuild(selectname, url, deviceid, mac, username, 'normal', '')
  3574.        
  3575.         if result == "kodirunning":
  3576.        
  3577.             hidecontrols()
  3578.             # buildinstallpng
  3579.             backimage.setImage(buildinstallpng)
  3580.             loginbutton.setEnabled(False)
  3581.             browsebuildsbutton.setEnabled(False)
  3582.             browseaddonsbutton.setEnabled(False)
  3583.             backupbutton.setEnabled(False)
  3584.             maintenancebutton.setEnabled(False)
  3585.             tweaksbutton.setEnabled(False)
  3586.             morebutton.setEnabled(False)
  3587.             settingsbutton.setEnabled(False)
  3588.             closebutton.setEnabled(False)  
  3589.            
  3590.        
  3591.         if result == 'downloadfalse':
  3592.    
  3593.                 dialog = xbmcgui.Dialog()
  3594.                 dialog.ok(strings.getstring("areswizard"), strings.getstring("downloadfailed2"))
  3595.                
  3596.         elif result == 'notvalidzip':
  3597.        
  3598.             dialog = xbmcgui.Dialog()
  3599.             dialog.ok(strings.getstring("areswizard"), strings.getstring("notvalidzip"))
  3600.            
  3601.            
  3602.         elif result == 'unzipfail':
  3603.        
  3604.             dialog = xbmcgui.Dialog()
  3605.             dialog.ok(strings.getstring("areswizard"), strings.getstring("unzipfail"))
  3606.            
  3607.         else:
  3608.             pass
  3609.    
  3610.     return(result)
  3611.  
  3612.    
  3613.  
  3614. def getaddondetails():
  3615.  
  3616.    
  3617.     data = json.loads(addonlistraw)
  3618.     for entry in data:
  3619.         if entry['name'] == name:
  3620.             global url
  3621.             url = entry['url']
  3622.             global iconimage
  3623.             iconimage = 'http://' + entry['icon']
  3624.             global descr
  3625.             descr = entry['descr']
  3626.             global fanart
  3627.             fanart = 'http://' + entry['icon']
  3628.             global version
  3629.             version = entry['version']
  3630.             global addonname
  3631.             addonname = entry['name']
  3632.             global addonpath
  3633.             addonpath = entry['addonpath']
  3634.             global addontype
  3635.             addontype = entry['type']
  3636.             global downloads
  3637.             downloads = int(entry['downloads'])
  3638.             global repopath
  3639.             repopath = entry['devrepo']
  3640.  
  3641.  
  3642.        
  3643.        
  3644.  
  3645. def getrepodetails():
  3646.    
  3647.     global url
  3648.     global iconimage
  3649.     global descr
  3650.     global fanart
  3651.     global downloads
  3652.     global addonpath
  3653.     global addontype
  3654.  
  3655.    
  3656.  
  3657.     data = json.loads(repolistraw) 
  3658.     for entry in data:
  3659.         if entry['name'] == name:
  3660.             url = entry['url']
  3661.             iconimage = 'http://' + entry['icon']
  3662.             descr = entry['descr']
  3663.             fanart = 'http://' + entry['icon']
  3664.            
  3665.             downloads = int(entry['downloads'])
  3666.             addontype = "repo"
  3667.             addonpath = entry['repopath']
  3668.    
  3669.        
  3670. def getbuildmainraw():
  3671.  
  3672.     global buildmainraw
  3673.  
  3674.     url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildmain&time=' + datetime.datetime.now().strftime('%S')
  3675.  
  3676.  
  3677.    
  3678.     if debuglog == "true":
  3679.         print '@ares: buildmainurl...'
  3680.         print url
  3681.  
  3682.    
  3683.    
  3684.     req = urllib2.Request(url)
  3685.     req.add_header('User-Agent', aresagent)
  3686.     response = urllib2.urlopen(req)
  3687.     buildmainraw = response.read()     
  3688.        
  3689.        
  3690.        
  3691. def showbuildmenu():
  3692.  
  3693.     global currentlist
  3694.     global buildmainraw
  3695.     buildmainlist.reset()
  3696.     buildotherlist.reset()
  3697.     buildlist.reset()
  3698.  
  3699.     currentlist = "buildmain"
  3700.    
  3701.     hidecontrols()
  3702.    
  3703.     try:
  3704.         buildmainraw
  3705.     except:
  3706.  
  3707.         getbuildmainraw()
  3708.        
  3709.  
  3710.        
  3711.        
  3712.     count = 1
  3713.    
  3714.     if debuglog == "true":
  3715.         print '@ares: buildmainraw....'
  3716.         print buildmainraw
  3717.  
  3718.        
  3719.     buildmainlist.addItem('[COLOR=goldenrod]Featured Builds[/COLOR]')
  3720.     buildmainlist.addItem('[COLOR=goldenrod]The Black Box Builds[/COLOR]')
  3721.    
  3722.     times = 1
  3723.     working = 0
  3724.    
  3725.     while working == 0:
  3726.    
  3727.         try:
  3728.             data = json.loads(buildmainraw)
  3729.             working = 1
  3730.         except:
  3731.             dp = xbmcgui.DialogProgress()
  3732.             dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
  3733.             times = times + 1
  3734.             time.sleep(3)
  3735.             getbuildmainraw()
  3736.             dp.close
  3737.             if times > 3:
  3738.                 dialog = xbmcgui.Dialog()
  3739.                 dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
  3740.                 window.setFocus(browsebuildsbutton)
  3741.                 return()
  3742.    
  3743.     for entry in data:
  3744.         buildmainlist.addItem('[COLOR=goldenrod]' + entry['name'] + '[/COLOR]')
  3745.         count = count + 1
  3746.  
  3747.  
  3748.            
  3749.  
  3750.     buildmainlist.setVisible(True)
  3751.    
  3752.     browsebuildsbutton.controlDown(buildmainlist)
  3753.     buildmainlist.controlUp(browsebuildsbutton)
  3754.    
  3755.     window.setFocus(buildmainlist)
  3756.     #buildmainlist.selectItem(0)
  3757.    
  3758.     if count > 10:
  3759.         scrolldownimage.setVisible(True)
  3760.     else:
  3761.         scrolldownimage.setVisible(False)
  3762.        
  3763.    
  3764.    
  3765.    
  3766.    
  3767.    
  3768.    
  3769. def showotherbuilds():
  3770.        
  3771.     pass
  3772.    
  3773.    
  3774. def getfeaturedbuildlist():
  3775.    
  3776.     global buildlistraw
  3777.  
  3778.     if showadult == "true":
  3779.         url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuildsincadult&time=' + datetime.datetime.now().strftime('%S')
  3780.  
  3781.     else:  
  3782.         url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getbuilds&time=' + datetime.datetime.now().strftime('%S')
  3783.  
  3784.    
  3785.     if debuglog == "true":
  3786.         print '@ares: buildlisturl...'
  3787.         print url
  3788.  
  3789.    
  3790.    
  3791.     req = urllib2.Request(url)
  3792.     req.add_header('User-Agent', aresagent)
  3793.     response = urllib2.urlopen(req)
  3794.     buildlistraw = response.read()
  3795.  
  3796. def showfeaturedbuildslist():
  3797.  
  3798.  
  3799.     global buildlistraw
  3800.     global currentlist
  3801.    
  3802.    
  3803.  
  3804.  
  3805.     currentlist = "featuredbuild"
  3806.  
  3807.     hidecontrols()
  3808.  
  3809.     try:
  3810.         buildlistraw
  3811.     except:
  3812.        
  3813.         getfeaturedbuildlist()
  3814.        
  3815.  
  3816.     count = 0
  3817.        
  3818.     if debuglog == "true":
  3819.         print '@ares: Buildlistraw....'
  3820.         print buildlistraw
  3821.  
  3822.        
  3823.     times = 1
  3824.     working = 0
  3825.    
  3826.     while working == 0:
  3827.    
  3828.         try:
  3829.             data = json.loads(buildlistraw)
  3830.             working = 1
  3831.         except:
  3832.             dp = xbmcgui.DialogProgress()
  3833.             #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
  3834.             dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
  3835.             times = times + 1
  3836.             time.sleep(3)
  3837.             getfeaturedbuildlist()
  3838.             dp.close
  3839.             if times > 3:
  3840.                 dialog = xbmcgui.Dialog()
  3841.                 dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
  3842.                 window.setFocus(browsebuildsbutton)
  3843.                 return()
  3844.    
  3845.     for entry in data:
  3846.         buildlist.addItem('[COLOR=goldenrod]' + entry['name'] + '[/COLOR]')
  3847.         count = count + 1
  3848.  
  3849.  
  3850.  
  3851.     buildlist.setVisible(True)
  3852.    
  3853.     if count > 11:
  3854.         scrolldownimage.setVisible(True)
  3855.     else:
  3856.         scrolldownimage.setVisible(False)
  3857.    
  3858.    
  3859.     browseaddonsbutton.controlDown(buildlist)
  3860.     browsebuildsbutton.controlDown(buildlist)
  3861.     #browserepobutton.controlDown(buildlist)
  3862.     maintenancebutton.controlDown(buildlist)
  3863.     tweaksbutton.controlDown(buildlist)
  3864.     morebutton.controlDown(buildlist)
  3865.     settingsbutton.controlDown(buildlist)
  3866.     buildlist.controlRight(installbuildbutton)
  3867.     installbuildbutton.controlLeft(buildlist)
  3868.     installbuildbutton.controlUp(freshstartbutton)
  3869.     installbuildbutton.controlDown(repairbuildbutton)
  3870.     # installbuildbutton.controlRight(votebuildbutton)
  3871.    
  3872.    
  3873.     freshstartbutton.controlUp(browsebuildsbutton)
  3874.     freshstartbutton.controlDown(installbuildbutton)
  3875.     freshstartbutton.controlLeft(buildlist)
  3876.    
  3877.     repairbuildbutton.controlUp(installbuildbutton)
  3878.     repairbuildbutton.controlDown(votebuildbutton)
  3879.     repairbuildbutton.controlLeft(buildlist)
  3880.    
  3881.     votebuildbutton.controlUp(repairbuildbutton)
  3882.     votebuildbutton.controlLeft(buildlist)
  3883.    
  3884.     # if userlevel == "staff" or userlevel == "admin":
  3885.         # buildlist.controlUp(browsebuildsbutton)
  3886.  
  3887.  
  3888.  
  3889.     name = buildlist.getListItem(buildlist.getSelectedPosition()).getLabel()
  3890.            
  3891.     colortag = "COLOR"
  3892.     if colortag in name:
  3893.         opentag = name.find(']')
  3894.         firstpart = name[opentag+1:]
  3895.         closetag = firstpart.find('[')
  3896.        
  3897.         name = firstpart[:closetag]
  3898.        
  3899.  
  3900.     data = json.loads(buildlistraw)
  3901.     for entry in data:
  3902.         if entry['name'] == name:
  3903.             url = entry['url']
  3904.             iconimage = 'http://' + entry['icon']
  3905.             descr = entry['descr']
  3906.             fanart = 'http://' + entry['icon']
  3907.             author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  3908.             global rating
  3909.             rating = entry['rating']
  3910.             votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  3911.             votesint = entry['votes']
  3912.            
  3913.             downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  3914.             downloadsint = entry['downloads']
  3915.            
  3916.             global windowimage
  3917.             windowimage.setImage(fanart)
  3918.             windowimage.setVisible(True)
  3919.                                
  3920.             global namelabel
  3921.             namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  3922.             namelabel.setVisible(True)
  3923.            
  3924.             global authorlabel
  3925.             authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  3926.             authorlabel.setVisible(True)
  3927.            
  3928.             voteslabel.setVisible(True)
  3929.             votestextlabel.setVisible(True)
  3930.             voteslabel.setLabel(label=votes)
  3931.            
  3932.            
  3933.             downloadslabel.setVisible(True)
  3934.             downloadstextlabel.setVisible(True)
  3935.             downloadslabel.setLabel(label=downloads)
  3936.            
  3937.             ratingtextlabel.setVisible(True)
  3938.            
  3939.             showrating(rating, votesint)
  3940.  
  3941.             installbuildbutton.setVisible(True)
  3942.             votebuildbutton.setVisible(True)   
  3943.             freshstartbutton.setVisible(True)
  3944.             repairbuildbutton.setVisible(True)
  3945.            
  3946.             sizelabel.setVisible(True)
  3947.             sizetextlabel.setVisible(True)
  3948.        
  3949.        
  3950.             if loginstatus == 'mac0':
  3951.                 votebuildbutton.setEnabled(False)
  3952.             else:
  3953.                 votebuildbutton.setEnabled(True)
  3954.                
  3955.             window.setFocus(buildlist)
  3956.             # buildlist.selectItem(0)
  3957.        
  3958.  
  3959.  
  3960. def getaddonlistraw():
  3961.  
  3962.     global addonlistraw
  3963.    
  3964.    
  3965.     if showadult == "true":
  3966.             url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getaddonsincadult&time=' + datetime.datetime.now().strftime('%S')
  3967.    
  3968.     else:
  3969.  
  3970.             url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getaddons&time=' + datetime.datetime.now().strftime('%S')
  3971.  
  3972.    
  3973.     req = urllib2.Request(url)
  3974.     req.add_header('User-Agent', aresagent)
  3975.     response = urllib2.urlopen(req)
  3976.    
  3977.     addonlistraw = response.read()
  3978.  
  3979.        
  3980.    
  3981. def showaddontypelist():
  3982.  
  3983.     #xbmc.executebuiltin('Notification(show, addontypelist, time=50)')
  3984.  
  3985.  
  3986.     global addonlistraw
  3987.    
  3988.  
  3989.    
  3990.    
  3991.     hidecontrols()
  3992.    
  3993.  
  3994.    
  3995.  
  3996.    
  3997.  
  3998.     try:
  3999.         addonlistraw
  4000.     except:
  4001.         getaddonlistraw()
  4002.        
  4003.         addontypelist.addItem('[COLOR=goldenrod]Video Addons[/COLOR]')
  4004.         addontypelist.addItem('[COLOR=goldenrod]Program Addons[/COLOR]')
  4005.         addontypelist.addItem('[COLOR=goldenrod]Repositories[/COLOR]')
  4006.        
  4007.     addontypelist.setVisible(True)
  4008.     #window.setFocus(addontypelist)
  4009.    
  4010.    
  4011.     browseaddonsbutton.controlDown(addontypelist)
  4012.     browsebuildsbutton.controlDown(addontypelist)
  4013.     backupbutton.controlDown(addontypelist)
  4014.     maintenancebutton.controlDown(addontypelist)
  4015.     tweaksbutton.controlDown(addontypelist)
  4016.     morebutton.controlDown(addontypelist)
  4017.     settingsbutton.controlDown(addontypelist)
  4018.  
  4019.    
  4020.     # if userlevel == "staff" or userlevel == "admin":
  4021.         # addontypelist.controlUp(browseaddonsbutton)
  4022.  
  4023.  
  4024.  
  4025. def getrepolistraw():
  4026.  
  4027.         global repolistraw
  4028.        
  4029.         if showadult == "true":
  4030.             url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getreposincadult&time=' + datetime.datetime.now().strftime('%S')
  4031.    
  4032.         else:
  4033.             url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getrepos&time=' + datetime.datetime.now().strftime('%S')
  4034.        
  4035.        
  4036.        
  4037.         req = urllib2.Request(url)
  4038.         req.add_header('User-Agent', aresagent)
  4039.         response = urllib2.urlopen(req)
  4040.        
  4041.         repolistraw = response.read()      
  4042.  
  4043. def showrepolist():
  4044.  
  4045.  
  4046.     global repolistraw
  4047.     global currentlist
  4048.     currentlist = "repo"
  4049.     repolist.reset()
  4050.    
  4051.    
  4052.  
  4053.     hidecontrols()
  4054.  
  4055.     try:
  4056.         repolistraw
  4057.     except:
  4058.  
  4059.         getrepolistraw()
  4060.  
  4061.    
  4062.    
  4063.    
  4064.  
  4065.     times = 1
  4066.     working = 0
  4067.    
  4068.     while working == 0:
  4069.    
  4070.         try:
  4071.             data = json.loads(repolistraw) 
  4072.             working = 1
  4073.         except:
  4074.             dp = xbmcgui.DialogProgress()
  4075.             #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
  4076.             dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
  4077.             times = times + 1
  4078.             time.sleep(3)
  4079.             getrepolistraw()
  4080.             dp.close
  4081.             if times > 3:
  4082.                 dialog = xbmcgui.Dialog()
  4083.                 dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
  4084.                 window.setFocus(browseaddonsbutton)
  4085.                 return()
  4086.    
  4087.    
  4088.    
  4089.    
  4090.     for entry in data:
  4091.         repopath = entry['repopath']
  4092.        
  4093.         destfolder = translate('special://home/addons/' + repopath + '/addon.xml')
  4094.        
  4095.         if os.path.isfile(destfolder):
  4096.        
  4097.             repolist.addItem('[COLOR=lime]' + entry['name'] + '[/COLOR]')
  4098.            
  4099.         else:
  4100.        
  4101.             repolist.addItem('[COLOR=fuchsia]' + entry['name'] + '[/COLOR]')
  4102.  
  4103.         #window.connect(repolist, lambda: getaddondetails())
  4104.        
  4105.     # window.connect(buildlist, lambda: xbmc.executebuiltin('Notification(Note!,{0} selected.)'.format(
  4106.         # buildlist.getListItem(buildlist.getSelectedPosition()).getLabel())))
  4107.        
  4108.    
  4109.  
  4110.  
  4111.        
  4112.  
  4113.        
  4114.  
  4115.        
  4116.  
  4117.     repolist.setVisible(True)
  4118.     scrolldownimage.setVisible(True)
  4119.  
  4120.    
  4121.     browseaddonsbutton.controlDown(repolist)
  4122.     browsebuildsbutton.controlDown(repolist)
  4123.     backupbutton.controlDown(repolist)
  4124.     maintenancebutton.controlDown(repolist)
  4125.     tweaksbutton.controlDown(repolist)
  4126.     morebutton.controlDown(repolist)
  4127.     settingsbutton.controlDown(repolist)
  4128.     repolist.controlRight(installaddonbutton)
  4129.    
  4130.     installaddonbutton.controlLeft(repolist)
  4131.     installaddonbutton.controlRight(voterepobutton)
  4132.     installaddonbutton.controlUp(browseaddonsbutton)
  4133.    
  4134.     voterepobutton.controlLeft(installaddonbutton)
  4135.     voterepobutton.controlRight(uninstalladdonbutton)
  4136.     voterepobutton.controlUp(browseaddonsbutton)
  4137.    
  4138.    
  4139.     uninstalladdonbutton.controlLeft(voterepobutton)
  4140.     uninstalladdonbutton.controlUp(browseaddonsbutton)
  4141.    
  4142.    
  4143.  
  4144.    
  4145.    
  4146.     # if userlevel == "staff" or userlevel == "admin":
  4147.         # repolist.controlUp(browserepobutton)
  4148.  
  4149.    
  4150.     #repolist.selectItem(0)
  4151.    
  4152.    
  4153.     name = repolist.getListItem(repolist.getSelectedPosition()).getLabel()
  4154.            
  4155.     colortag = "COLOR"
  4156.     if colortag in name:
  4157.         opentag = name.find(']')
  4158.         firstpart = name[opentag+1:]
  4159.         closetag = firstpart.find('[')
  4160.         #global name
  4161.         name = firstpart[:closetag]
  4162.        
  4163.  
  4164.     data = json.loads(repolistraw) 
  4165.     for entry in data:
  4166.         if entry['name'] == name:
  4167.             url = entry['url']
  4168.             iconimage = 'http://' + entry['icon']
  4169.             descr = entry['descr']
  4170.             fanart = 'http://' + entry['icon']
  4171.             rating = entry['rating']
  4172.             votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  4173.             votesint = entry['votes']
  4174.             author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  4175.             repopath = entry['repopath']
  4176.            
  4177.             downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  4178.             downloadsint = entry['downloads']
  4179.            
  4180.             global windowimage3
  4181.             windowimage3.setImage(fanart)
  4182.             windowimage3.setVisible(True)
  4183.    
  4184.    
  4185.             voteslabel.setVisible(True)
  4186.             votestextlabel.setVisible(True)
  4187.             voteslabel.setLabel(label=votes)
  4188.            
  4189.             global authorlabel
  4190.             authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  4191.             authorlabel.setVisible(True)
  4192.            
  4193.             downloadslabel.setVisible(True)
  4194.             downloadstextlabel.setVisible(True)
  4195.             downloadslabel.setLabel(label=downloads)
  4196.            
  4197.             ratingtextlabel.setVisible(True)
  4198.            
  4199.             showrating(rating, votesint)
  4200.            
  4201.            
  4202.                    
  4203.             uninstalladdonbutton.setVisible(True)
  4204.             installaddonbutton.setVisible(True)
  4205.             voterepobutton.setVisible(True)
  4206.  
  4207.     window.setFocus(repolist)
  4208.        
  4209. def getaddons():
  4210.  
  4211.  
  4212.     global name
  4213.  
  4214.  
  4215.     #xbmc.executebuiltin('Notification(get, addons, time=50)')
  4216.  
  4217.     name = addontypelist.getListItem(addontypelist.getSelectedPosition()).getLabel()
  4218.    
  4219.     colortag = "COLOR"
  4220.     if colortag in name:
  4221.         opentag = name.find(']')
  4222.         firstpart = name[opentag+1:]
  4223.         closetag = firstpart.find('[')
  4224.        
  4225.         name = firstpart[:closetag]
  4226.    
  4227.     if name == "Video Addons":
  4228.        
  4229.        
  4230.         showvideoaddonslist()
  4231.  
  4232.        
  4233.    
  4234.     if name == "Program Addons":
  4235.        
  4236.    
  4237.         showprogramaddonslist()
  4238.        
  4239.    
  4240.    
  4241.     if name == "Repositories":
  4242.        
  4243.    
  4244.         showrepolist()
  4245.        
  4246.        
  4247.  
  4248.  
  4249.    
  4250. def showvideoaddonslist():
  4251.  
  4252.     #xbmc.executebuiltin('Notification(video, addon, time=50)')
  4253.     global currentlist
  4254.     currentlist = "videoaddon"
  4255.     addontypelist.setVisible(False)
  4256.     addonlist.reset()
  4257.    
  4258.    
  4259.     #addonlist.addItem('..')
  4260.  
  4261.  
  4262.     times = 1
  4263.     working = 0
  4264.    
  4265.     while working == 0:
  4266.    
  4267.         try:
  4268.             data = json.loads(addonlistraw)    
  4269.             working = 1
  4270.         except:
  4271.             dp = xbmcgui.DialogProgress()
  4272.             #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
  4273.             dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
  4274.             times = times + 1
  4275.             time.sleep(3)
  4276.             getaddonlistraw()
  4277.             dp.close
  4278.             if times > 3:
  4279.                 dialog = xbmcgui.Dialog()
  4280.                 dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
  4281.                 window.setFocus(browseaddonsbutton)
  4282.                 return()
  4283.    
  4284.    
  4285.    
  4286.     for entry in data:
  4287.         if entry['type'] == "Video":
  4288.             url = entry['url']
  4289.             iconimage = 'http://' + entry['icon']
  4290.             descr = entry['descr']
  4291.             fanart = 'http://' + entry['icon']
  4292.             author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  4293.             global rating
  4294.             rating = entry['rating']
  4295.             votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  4296.             votesint = entry['votes']
  4297.             version = entry['version']
  4298.             addonpath = entry['addonpath']
  4299.            
  4300.            
  4301.             checktargetxmlversion(entry['addonpath'])
  4302.            
  4303.            
  4304.  
  4305.        
  4306.  
  4307.  
  4308.            
  4309.             if installedversion == " ":
  4310.                 addonlist.addItem('[COLOR fuchsia]'+entry['name']+'[/COLOR]')
  4311.                
  4312.             else:
  4313.                 if installedversion <> version:
  4314.                     addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
  4315.                
  4316.                 else:
  4317.                     addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
  4318.  
  4319.                    
  4320.  
  4321.    
  4322.                    
  4323.  
  4324.  
  4325.     addonlist.setVisible(True)
  4326.     #addonlist.selectItem(0)
  4327.     window.setFocus(addonlist)
  4328.  
  4329.     scrolldownimage.setVisible(True)
  4330.  
  4331.     #window.connect(installaddonbutton, lambda: installbutton('addon'))
  4332.     #window.connect(addonlist, lambda: window.setFocus(installaddonbutton))
  4333.    
  4334.    
  4335.    
  4336.     browseaddonsbutton.controlDown(addonlist)
  4337.     browsebuildsbutton.controlDown(addonlist)
  4338.     backupbutton.controlDown(addonlist)
  4339.     maintenancebutton.controlDown(addonlist)
  4340.     tweaksbutton.controlDown(addonlist)
  4341.     morebutton.controlDown(addonlist)
  4342.     settingsbutton.controlDown(addonlist)
  4343.     addonlist.controlRight(installaddonbutton)
  4344.    
  4345.     installaddonbutton.controlLeft(addonlist)
  4346.     installaddonbutton.controlRight(voteaddonbutton)
  4347.     installaddonbutton.controlUp(browseaddonsbutton)
  4348.    
  4349.    
  4350.     voteaddonbutton.controlLeft(installaddonbutton)
  4351.     voteaddonbutton.controlRight(uninstalladdonbutton)
  4352.     voteaddonbutton.controlUp(browseaddonsbutton)
  4353.    
  4354.    
  4355.    
  4356.     uninstalladdonbutton.controlLeft(voteaddonbutton)
  4357.     uninstalladdonbutton.controlRight(addaddonbyrepobutton)
  4358.     uninstalladdonbutton.controlUp(browseaddonsbutton)
  4359.    
  4360.    
  4361.     addaddonbyrepobutton.controlLeft(uninstalladdonbutton)
  4362.     addaddonbyrepobutton.controlRight(updateaddonbutton)
  4363.     addaddonbyrepobutton.controlUp(browseaddonsbutton)
  4364.    
  4365.    
  4366.     updateaddonbutton.controlLeft(addaddonbyrepobutton)
  4367.     updateaddonbutton.controlUp(browseaddonsbutton)
  4368.    
  4369.    
  4370.  
  4371.    
  4372.    
  4373.     name = addonlist.getListItem(addonlist.getSelectedPosition()).getLabel()
  4374.            
  4375.     colortag = "COLOR"
  4376.     if colortag in name:
  4377.         opentag = name.find(']')
  4378.         firstpart = name[opentag+1:]
  4379.         closetag = firstpart.find('[')
  4380.         #global name
  4381.         name = firstpart[:closetag]
  4382.        
  4383.     data = json.loads(addonlistraw)
  4384.     for entry in data:
  4385.         if entry['name'] == name:
  4386.             url = entry['url']
  4387.             iconimage = 'http://' + entry['icon']
  4388.             descr = entry['descr']
  4389.             fanart = 'http://' + entry['icon']
  4390.             author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  4391.            
  4392.             rating = entry['rating']
  4393.             votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  4394.             votesint = entry['votes']
  4395.             addonpath = entry['addonpath']
  4396.             version_color = '[COLOR=darkgray]' + entry['version']  + '[/COLOR]'
  4397.             version = entry['version']
  4398.             downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  4399.             downloadsint = entry['downloads']
  4400.            
  4401.             global windowimage2
  4402.             windowimage2.setImage(fanart)  
  4403.             windowimage2.setVisible(True)
  4404.            
  4405.             namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  4406.             namelabel.setVisible(True)
  4407.            
  4408.             authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  4409.             authorlabel.setVisible(True)
  4410.            
  4411.             checktargetxmlversion(addonpath)
  4412.            
  4413.             if installedversion == " ":
  4414.                 statuslabel.setLabel(label='[COLOR fuchsia]Not Installed[/COLOR]')
  4415.                 installedversionlabel.setLabel(label=installedversion_color)
  4416.                 installedversionlabel.setVisible(False)
  4417.                 installedversiontextlabel.setVisible(False)
  4418.  
  4419.             elif installedversion <> version:
  4420.                 statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
  4421.                 installedversionlabel.setLabel(label=installedversion_color)
  4422.                 installedversionlabel.setVisible(True)
  4423.                 installedversiontextlabel.setVisible(True)
  4424.  
  4425.             elif installedversion == version:
  4426.                 statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
  4427.                 installedversionlabel.setLabel(label=installedversion_color)
  4428.                 installedversionlabel.setVisible(True)
  4429.                 installedversiontextlabel.setVisible(True)
  4430.            
  4431.             else:
  4432.                 statuslabel.setLabel(label='Unknown')
  4433.                 installedversionlabel.setLabel(label=installedversion_color)
  4434.                 installedversionlabel.setVisible(True)
  4435.                 installedversiontextlabel.setVisible(True)
  4436.                
  4437.             statuslabel.setVisible(True)
  4438.             statustextlabel.setVisible(True)
  4439.            
  4440.             # recversionlabel.setLabel(label=version_color)
  4441.             # recversionlabel.setVisible(True)
  4442.             # recversiontextlabel.setVisible(True)
  4443.            
  4444.             uninstalladdonbutton.setVisible(True)
  4445.             installaddonbutton.setVisible(True)
  4446.             voteaddonbutton.setVisible(True)
  4447.            
  4448.             voteslabel.setLabel(label=votes)
  4449.             voteslabel.setVisible(True)
  4450.             votestextlabel.setVisible(True)
  4451.            
  4452.            
  4453.             downloadslabel.setLabel(label=str(downloads))
  4454.             downloadslabel.setVisible(True)
  4455.             downloadstextlabel.setVisible(True)
  4456.            
  4457.            
  4458.             ratingtextlabel.setVisible(True)
  4459.            
  4460.             showrating(rating, votesint)
  4461.            
  4462.            
  4463.             if userlevel == "staff" or userlevel == "admin":
  4464.                 addaddonbyrepobutton.setVisible(True)
  4465.                 # uninstalladdonbutton.controlDown(addaddonbyrepobutton)
  4466.                 addaddonbyrepobutton.controlUp(browseaddonsbutton)
  4467.                 uninstalladdonbutton.controlUp(browseaddonsbutton)
  4468.                 updateaddonbutton.setVisible(True)
  4469.                 # addaddonbyrepobutton.controlDown(updateaddonbutton)
  4470.                 updateaddonbutton.controlUp(browseaddonsbutton)
  4471.    
  4472.    
  4473.  
  4474.    
  4475.  
  4476.  
  4477.  
  4478. def showprogramaddonslist():
  4479.  
  4480.     #xbmc.executebuiltin('Notification(video, addon, time=50)')
  4481.  
  4482.     global currentlist
  4483.     currentlist = "programaddon"
  4484.     addontypelist.setVisible(False)
  4485.     addonlist.reset()
  4486.    
  4487.     #addonlist.addItem('..')
  4488.  
  4489.  
  4490.     times = 1
  4491.     working = 0
  4492.    
  4493.     while working == 0:
  4494.    
  4495.         try:
  4496.             data = json.loads(addonlistraw)    
  4497.             working = 1
  4498.         except:
  4499.             dp = xbmcgui.DialogProgress()
  4500.             #dp.create(strings.getstring("areswizard"), 'Getting data...', 'Attempt: ' + str(times), ' ')
  4501.             dp.create(strings.getstring("areswizard"), 'Getting data...', ' ', ' ')
  4502.             times = times + 1
  4503.             time.sleep(3)
  4504.             getaddonlistraw()
  4505.             dp.close
  4506.             if times > 3:
  4507.                 dialog = xbmcgui.Dialog()
  4508.                 dialog.ok(strings.getstring("areswizard"), "Failed to get data from server. This may just be temporary, please try again.")
  4509.                 window.setFocus(browseaddonsbutton)
  4510.                 return()
  4511.                
  4512.                
  4513.     for entry in data:
  4514.         if entry['type'] == "Program":
  4515.             url = entry['url']
  4516.             iconimage = 'http://' + entry['icon']
  4517.             descr = entry['descr']
  4518.             fanart = 'http://' + entry['icon']
  4519.             author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  4520.             global rating
  4521.             rating = entry['rating']
  4522.             votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  4523.             votesint = entry['votes']
  4524.             version = entry['version']
  4525.        
  4526.        
  4527.             checktargetxmlversion(entry['addonpath'])
  4528.            
  4529.             global installedversion2
  4530.             installedversion2 = stripcolortags(installedversion)
  4531.            
  4532.             global version2
  4533.             version2 = stripcolortags(version)
  4534.            
  4535.            
  4536.            
  4537.             if installedversion2 == " ":
  4538.                 addonlist.addItem('[COLOR fuchsia]'+entry['name']+'[/COLOR]')
  4539.                
  4540.             else:
  4541.                 if installedversion2 <> version2:
  4542.                     addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
  4543.                
  4544.                 else:
  4545.                     addonlist.addItem('[COLOR lime]'+entry['name']+'[/COLOR]')
  4546.  
  4547.  
  4548.    
  4549.     addonlist.setVisible(True)
  4550.     #addonlist.selectItem(0)
  4551.     window.setFocus(addonlist)
  4552.  
  4553.    
  4554.  
  4555.    
  4556.    
  4557.     browseaddonsbutton.controlDown(addonlist)
  4558.     browsebuildsbutton.controlDown(addonlist)
  4559.     backupbutton.controlDown(addonlist)
  4560.     maintenancebutton.controlDown(addonlist)
  4561.     tweaksbutton.controlDown(addonlist)
  4562.     morebutton.controlDown(addonlist)
  4563.     settingsbutton.controlDown(addonlist)
  4564.     installaddonbutton.controlUp(browseaddonsbutton)
  4565.     addaddonbyrepobutton.controlLeft(addonlist)
  4566.     updateaddonbutton.controlLeft(addonlist)
  4567.  
  4568.        
  4569.        
  4570.     # if userlevel == "staff" or userlevel == "admin":
  4571.         # addontypelist.controlUp(browseaddonsbutton)
  4572.        
  4573.        
  4574.        
  4575.     name = addonlist.getListItem(addonlist.getSelectedPosition()).getLabel()
  4576.            
  4577.     colortag = "COLOR"
  4578.     if colortag in name:
  4579.         opentag = name.find(']')
  4580.         firstpart = name[opentag+1:]
  4581.         closetag = firstpart.find('[')
  4582.         #global name
  4583.         name = firstpart[:closetag]
  4584.        
  4585.     data = json.loads(addonlistraw)
  4586.     for entry in data:
  4587.         if entry['name'] == name:
  4588.             url = entry['url']
  4589.             iconimage = 'http://' + entry['icon']
  4590.             descr = entry['descr']
  4591.             fanart = 'http://' + entry['icon']
  4592.             author = '[COLOR=darkgray]' + entry['author'] + '[/COLOR]'
  4593.            
  4594.             rating = entry['rating']
  4595.             votes = '[COLOR=darkgray]' + entry['votes'] + '[/COLOR]'
  4596.             votesint = entry['votes']
  4597.             addonpath = entry['addonpath']
  4598.             version_color = '[COLOR=darkgray]' + entry['version']  + '[/COLOR]'
  4599.             version = entry['version']
  4600.             downloads = '[COLOR=darkgray]' + entry['downloads'] + '[/COLOR]'
  4601.             downloadsint = entry['downloads']
  4602.            
  4603.             global windowimage2
  4604.             windowimage2.setImage(fanart)  
  4605.             windowimage2.setVisible(True)
  4606.            
  4607.             namelabel.setLabel(label='[COLOR=darkgray]' + name + '[/COLOR]')
  4608.             namelabel.setVisible(True)
  4609.            
  4610.             authorlabel.setLabel(label='[COLOR=darkgray]Created by: [/COLOR]'+author)
  4611.             authorlabel.setVisible(True)
  4612.            
  4613.             checktargetxmlversion(addonpath)
  4614.            
  4615.             if installedversion == " ":
  4616.                 statuslabel.setLabel(label='[COLOR fuchsia]Not Installed[/COLOR]')
  4617.                 installedversionlabel.setLabel(label=installedversion_color)
  4618.                 installedversionlabel.setVisible(False)
  4619.                 installedversiontextlabel.setVisible(False)
  4620.  
  4621.             elif installedversion <> version:
  4622.                 statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
  4623.                 installedversionlabel.setLabel(label=installedversion_color)
  4624.                 installedversionlabel.setVisible(True)
  4625.                 installedversiontextlabel.setVisible(True)
  4626.  
  4627.             elif installedversion == version:
  4628.                 statuslabel.setLabel(label='[COLOR=lime]Installed[/COLOR]')
  4629.                 installedversionlabel.setLabel(label=installedversion_color)
  4630.                 installedversionlabel.setVisible(True)
  4631.                 installedversiontextlabel.setVisible(True)
  4632.            
  4633.             else:
  4634.                 statuslabel.setLabel(label='Unknown')
  4635.                 installedversionlabel.setLabel(label=installedversion_color)
  4636.                 installedversionlabel.setVisible(True)
  4637.                 installedversiontextlabel.setVisible(True)
  4638.                
  4639.             statuslabel.setVisible(True)
  4640.             statustextlabel.setVisible(True)
  4641.            
  4642.             # recversionlabel.setLabel(label=version_color)
  4643.             # recversionlabel.setVisible(True)
  4644.             # recversiontextlabel.setVisible(True)
  4645.            
  4646.             uninstalladdonbutton.setVisible(True)
  4647.             installaddonbutton.setVisible(True)
  4648.             voteaddonbutton.setVisible(True)
  4649.            
  4650.             voteslabel.setLabel(label=votes)
  4651.             voteslabel.setVisible(True)
  4652.             votestextlabel.setVisible(True)
  4653.            
  4654.            
  4655.             downloadslabel.setLabel(label=str(downloads))
  4656.             downloadslabel.setVisible(True)
  4657.             downloadstextlabel.setVisible(True)
  4658.            
  4659.            
  4660.             ratingtextlabel.setVisible(True)
  4661.            
  4662.             showrating(rating, votesint)
  4663.            
  4664.            
  4665.             if userlevel == "staff" or userlevel == "admin":
  4666.                 addaddonbyrepobutton.setVisible(True)
  4667.                 uninstalladdonbutton.controlDown(addaddonbyrepobutton)
  4668.                 addaddonbyrepobutton.controlUp(uninstalladdonbutton)
  4669.                 updateaddonbutton.setVisible(True)
  4670.                 addaddonbyrepobutton.controlDown(updateaddonbutton)
  4671.                 updateaddonbutton.controlUp(addaddonbyrepobutton)
  4672.  
  4673.    
  4674.        
  4675. def checktargetxmlversion(addonpath):
  4676.  
  4677.    
  4678.     global installedversion
  4679.     global installedversion_color
  4680.    
  4681.     #xbmc.executebuiltin('Notification(check, targetxml, time=50)')
  4682.    
  4683.     targetxmlpath = translate('special://home/addons' + '/' + addonpath)
  4684.     targetxml = os.path.join(targetxmlpath, 'addon.xml')
  4685.    
  4686.     # print 'targetxml>>>'
  4687.     # print targetxml
  4688.    
  4689.    
  4690.    
  4691.     try:
  4692.         targetxmlfile = open(targetxml, 'r')
  4693.         targetxmlcontents = targetxmlfile.read()
  4694.        
  4695.        
  4696.         str1 = targetxmlcontents.find('version=',20)
  4697.  
  4698.         str2 = str1 + 9
  4699.  
  4700.         str3 = targetxmlcontents[str2:]
  4701.  
  4702.         str4 = str3.find('"')
  4703.  
  4704.         global installedversion_color
  4705.         installedversion_color = '[COLOR=darkgray]' + str3[:str4] + '[/COLOR]'
  4706.        
  4707.        
  4708.         installedversion = str3[:str4]
  4709.     except:
  4710.        
  4711.         installedversion = " "
  4712.        
  4713.        
  4714.         installedversion_color = " "
  4715.        
  4716.    
  4717.  
  4718.  
  4719.    
  4720.  
  4721. def maintenance2():
  4722.  
  4723.  
  4724.     hidecontrols()
  4725.     maintenanceimage.setVisible(True)
  4726.     maint_cache_label.setVisible(True)
  4727.     maint_cache_label2.setVisible(True)
  4728.     maint_packages_label.setVisible(True)
  4729.     maint_packages_label2.setVisible(True)
  4730.     maint_packages_label3.setVisible(True)
  4731.     maint_packages_label4.setVisible(True)
  4732.     maint_packages_label5.setVisible(True)
  4733.     maint_thumb_label.setVisible(True)
  4734.     maint_thumb_label2.setVisible(True)
  4735.     maint_thumb_label3.setVisible(True)
  4736.     maint_thumb_label4.setVisible(True)
  4737.     maint_thumb_label5.setVisible(True)
  4738.     maint_cache_label3.setVisible(True)
  4739.     maint_cache_label4.setVisible(True)
  4740.     maint_cache_label5.setVisible(True)
  4741.     maint_cache_label6.setVisible(True)
  4742.     maint_cache_label7.setVisible(True)
  4743.     maint_cache_green.setVisible(True)
  4744.     deletecachebuttonv2.setVisible(True)
  4745.     maint_packages_green.setVisible(True)
  4746.     maint_thumb_green.setVisible(True)
  4747.     deletethumbnailsbuttonv2.setVisible(True)
  4748.     deletepackagesbuttonv2.setVisible(True)
  4749.    
  4750.    
  4751.     automaintenanceradio.setVisible(True)
  4752.     automaintenancefreqeverytime.setVisible(True)
  4753.     automaintenancefreqmonthly.setVisible(True)
  4754.     automaintenancefreqweekly.setVisible(True)
  4755.     automaintenancefreqdaily.setVisible(True)
  4756.     automaintenancelabel1.setVisible(True)
  4757.    
  4758.    
  4759.    
  4760.        
  4761.     fullautomaintenanceradio.setVisible(True)
  4762.     fullyautomaintenancelabel1.setVisible(True)
  4763.     fullautomaintcacheradio.setVisible(True)
  4764.     fullautomaintpackagesradio.setVisible(True)
  4765.     fullautomaintthumbradio.setVisible(True)
  4766.     fullyautomaintenancelabel2.setVisible(True)
  4767.     fullautomaintweekradio.setVisible(True)
  4768.     fullautomaintmonthradio.setVisible(True)
  4769.     fullautomaintquarterradio.setVisible(True)
  4770.    
  4771.     cacheinclude_genesis.setVisible(True)
  4772.     cacheinclude_navix.setVisible(True)
  4773.  
  4774.     cacheinclude_ivue.setVisible(True)
  4775.     cacheinclude_youtube.setVisible(True)
  4776.     cacheinclude_pulsar.setVisible(True)
  4777.     cacheinclude_salts.setVisible(True)
  4778.    
  4779.     maint_totallocalspacelabel.setVisible(True)
  4780.     maint_totallocalfileslabel.setVisible(True)
  4781.    
  4782.    
  4783.    
  4784.    
  4785.    
  4786.    
  4787.    
  4788.    
  4789.    
  4790.    
  4791.    
  4792.     browsebuildsbutton.controlDown(deletethumbnailsbuttonv2)
  4793.     browseaddonsbutton.controlDown(deletethumbnailsbuttonv2)
  4794.     backupbutton.controlDown(deletepackagesbuttonv2)
  4795.     maintenancebutton.controlDown(deletepackagesbuttonv2)
  4796.     tweaksbutton.controlDown(deletecachebuttonv2)
  4797.     morebutton.controlDown(cacheinclude_genesis)
  4798.     settingsbutton.controlDown(cacheinclude_navix)
  4799.    
  4800.    
  4801.    
  4802.     deletecachebuttonv2.controlUp(maintenancebutton)
  4803.     deletethumbnailsbuttonv2.controlUp(maintenancebutton)
  4804.     deletepackagesbuttonv2.controlUp(maintenancebutton)
  4805.    
  4806.     deletecachebuttonv2.controlLeft(deletepackagesbuttonv2)
  4807.     deletethumbnailsbuttonv2.controlRight(deletepackagesbuttonv2)
  4808.     deletepackagesbuttonv2.controlRight(deletecachebuttonv2)
  4809.     deletepackagesbuttonv2.controlLeft(deletethumbnailsbuttonv2)
  4810.     deletepackagesbuttonv2.controlDown(automaintenanceradio)
  4811.    
  4812.     deletecachebuttonv2.controlRight(cacheinclude_salts)
  4813.     cacheinclude_genesis.controlUp(morebutton)
  4814.     cacheinclude_genesis.controlRight(cacheinclude_navix)
  4815.     cacheinclude_genesis.controlDown(cacheinclude_youtube)
  4816.     cacheinclude_genesis.controlLeft(deletecachebuttonv2)
  4817.     cacheinclude_navix.controlUp(settingsbutton)
  4818.     cacheinclude_navix.controlLeft(cacheinclude_genesis)
  4819.     cacheinclude_navix.controlDown(cacheinclude_ivue)
  4820.     cacheinclude_youtube.controlUp(cacheinclude_genesis)
  4821.     cacheinclude_youtube.controlDown(cacheinclude_salts)
  4822.     cacheinclude_youtube.controlLeft(deletecachebuttonv2)
  4823.     cacheinclude_youtube.controlRight(cacheinclude_ivue)
  4824.     cacheinclude_ivue.controlUp(cacheinclude_navix)
  4825.     cacheinclude_ivue.controlLeft(cacheinclude_youtube)
  4826.     cacheinclude_ivue.controlDown(cacheinclude_pulsar)
  4827.     cacheinclude_salts.controlUp(cacheinclude_youtube)
  4828.     cacheinclude_salts.controlDown(deletecachebuttonv2)
  4829.     cacheinclude_salts.controlLeft(deletecachebuttonv2)
  4830.     cacheinclude_salts.controlRight(cacheinclude_pulsar)
  4831.     cacheinclude_pulsar.controlUp(cacheinclude_ivue)
  4832.     cacheinclude_pulsar.controlDown(deletecachebuttonv2)
  4833.     cacheinclude_pulsar.controlLeft(cacheinclude_salts)
  4834.    
  4835.    
  4836.     deletecachebuttonv2.controlDown(fullautomaintenanceradio)
  4837.  
  4838.     automaintenanceradio.controlUp(deletethumbnailsbuttonv2)
  4839.     automaintenanceradio.controlDown(automaintenancefreqweekly)
  4840.    
  4841.     automaintenancefreqeverytime.controlRight(automaintenancefreqdaily)
  4842.     automaintenancefreqeverytime.controlUp(automaintenanceradio)
  4843.    
  4844.     automaintenancefreqdaily.controlRight(automaintenancefreqweekly)
  4845.     automaintenancefreqdaily.controlUp(automaintenanceradio)
  4846.     automaintenancefreqdaily.controlLeft(automaintenancefreqeverytime)
  4847.    
  4848.     automaintenancefreqweekly.controlRight(automaintenancefreqmonthly)
  4849.     automaintenancefreqweekly.controlUp(automaintenanceradio)
  4850.     automaintenancefreqweekly.controlLeft(automaintenancefreqdaily)
  4851.  
  4852.     automaintenancefreqmonthly.controlUp(automaintenanceradio)
  4853.     automaintenancefreqmonthly.controlLeft(automaintenancefreqweekly)
  4854.    
  4855.     deletethumbnailsbuttonv2.controlDown(automaintenanceradio)
  4856.    
  4857.     fullautomaintenanceradio.controlUp(deletecachebuttonv2)
  4858.     fullautomaintenanceradio.controlDown(fullautomaintpackagesradio)
  4859.    
  4860.     fullautomaintpackagesradio.controlUp(fullautomaintenanceradio)
  4861.     fullautomaintpackagesradio.controlLeft(fullautomaintcacheradio)
  4862.     fullautomaintpackagesradio.controlRight(fullautomaintthumbradio)
  4863.     fullautomaintpackagesradio.controlDown(fullautomaintmonthradio)
  4864.    
  4865.    
  4866.     fullautomaintcacheradio.controlUp(fullautomaintenanceradio)
  4867.     fullautomaintcacheradio.controlRight(fullautomaintpackagesradio)
  4868.     fullautomaintcacheradio.controlDown(fullautomaintweekradio)
  4869.    
  4870.     fullautomaintthumbradio.controlUp(fullautomaintenanceradio)
  4871.     fullautomaintthumbradio.controlLeft(fullautomaintpackagesradio)
  4872.     fullautomaintthumbradio.controlDown(fullautomaintquarterradio)
  4873.    
  4874.     fullautomaintweekradio.controlUp(fullautomaintcacheradio)
  4875.     fullautomaintweekradio.controlRight(fullautomaintmonthradio)
  4876.    
  4877.     fullautomaintmonthradio.controlUp(fullautomaintpackagesradio)
  4878.     fullautomaintmonthradio.controlLeft(fullautomaintweekradio)
  4879.     fullautomaintmonthradio.controlRight(fullautomaintquarterradio)
  4880.    
  4881.     fullautomaintquarterradio.controlUp(fullautomaintthumbradio)
  4882.     fullautomaintquarterradio.controlLeft(fullautomaintmonthradio)
  4883.  
  4884.    
  4885.  
  4886.    
  4887.    
  4888.    
  4889.    
  4890.    
  4891.    
  4892.    
  4893.     try:
  4894.  
  4895.         with open(settingsfile, 'r',0) as f:
  4896.             config = json.load(f)
  4897.            
  4898.            
  4899.         maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
  4900.         totalfilesdeleted = config['totaltempfiles']
  4901.         oldlabel = maint_totallocalfileslabel.getLabel()
  4902.         maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
  4903.        
  4904.        
  4905.         maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
  4906.         totalspacegained = config['totalspacegained']
  4907.         totalspacegained2 = int(round(float(totalspacegained)))
  4908.         oldlabel = maint_totallocalspacelabel.getLabel()
  4909.         maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
  4910.            
  4911.            
  4912.            
  4913.  
  4914.         automaintenancemode = config['automaintenance']
  4915.        
  4916.        
  4917.        
  4918.         if automaintenancemode == "daily":
  4919.             automaintenancefreqdaily.setSelected(True)
  4920.             automaintenanceradio.setSelected(True)
  4921.             automaintenancelabel1.setVisible(True)
  4922.             automaintenanceradio.setEnabled(True)
  4923.             automaintenancefreqeverytime.setEnabled(True)
  4924.             automaintenancefreqmonthly.setEnabled(True)
  4925.             automaintenancefreqweekly.setEnabled(True)
  4926.             automaintenancefreqdaily.setEnabled(True)
  4927.             automaintenancelabel1.setEnabled(True)
  4928.            
  4929.         if automaintenancemode == "weekly":
  4930.             automaintenancefreqweekly.setSelected(True)
  4931.             automaintenanceradio.setSelected(True)
  4932.             automaintenanceradio.setEnabled(True)
  4933.             automaintenancefreqeverytime.setEnabled(True)
  4934.             automaintenancefreqmonthly.setEnabled(True)
  4935.             automaintenancefreqweekly.setEnabled(True)
  4936.             automaintenancefreqdaily.setEnabled(True)
  4937.             automaintenancelabel1.setEnabled(True)
  4938.            
  4939.         if automaintenancemode == "montly":
  4940.             automaintenancefreqmonthly.setSelected(True)
  4941.             automaintenanceradio.setSelected(True)
  4942.             automaintenanceradio.setEnabled(True)
  4943.             automaintenancefreqeverytime.setEnabled(True)
  4944.             automaintenancefreqmonthly.setEnabled(True)
  4945.             automaintenancefreqweekly.setEnabled(True)
  4946.             automaintenancefreqdaily.setEnabled(True)
  4947.             automaintenancelabel1.setEnabled(True)
  4948.            
  4949.         if automaintenancemode == "everytime":
  4950.             automaintenancefreqeverytime.setSelected(True)
  4951.             automaintenanceradio.setSelected(True)
  4952.             automaintenanceradio.setEnabled(True)
  4953.             automaintenancefreqeverytime.setEnabled(True)
  4954.             automaintenancefreqmonthly.setEnabled(True)
  4955.             automaintenancefreqweekly.setEnabled(True)
  4956.             automaintenancefreqdaily.setEnabled(True)
  4957.             automaintenancelabel1.setEnabled(True)
  4958.            
  4959.            
  4960.         fullautofreq = config['fullautofreq']
  4961.        
  4962.         if fullautofreq == "week":
  4963.        
  4964.             fullautomaintcacheradio.setEnabled(True)
  4965.             fullautomaintenanceradio.setSelected(True)
  4966.             fullautomaintmonthradio.setEnabled(True)
  4967.             fullautomaintpackagesradio.setEnabled(True)
  4968.             fullautomaintquarterradio.setEnabled(True)
  4969.             fullautomaintthumbradio.setEnabled(True)
  4970.             fullautomaintweekradio.setEnabled(True)
  4971.             fullautomaintweekradio.setSelected(True)
  4972.             fullyautomaintenancelabel1.setEnabled(True)
  4973.             fullyautomaintenancelabel2.setEnabled(True)
  4974.        
  4975.        
  4976.         if fullautofreq == "month":
  4977.        
  4978.             fullautomaintcacheradio.setEnabled(True)
  4979.             fullautomaintenanceradio.setSelected(True)
  4980.             fullautomaintmonthradio.setEnabled(True)
  4981.             fullautomaintpackagesradio.setEnabled(True)
  4982.             fullautomaintquarterradio.setEnabled(True)
  4983.             fullautomaintthumbradio.setEnabled(True)
  4984.             fullautomaintweekradio.setEnabled(True)
  4985.             fullautomaintmonthradio.setSelected(True)
  4986.             fullyautomaintenancelabel1.setEnabled(True)
  4987.             fullyautomaintenancelabel2.setEnabled(True)
  4988.        
  4989.        
  4990.         if fullautofreq == "quarter":
  4991.        
  4992.             fullautomaintcacheradio.setEnabled(True)
  4993.             fullautomaintenanceradio.setSelected(True)
  4994.             fullautomaintmonthradio.setEnabled(True)
  4995.             fullautomaintpackagesradio.setEnabled(True)
  4996.             fullautomaintquarterradio.setEnabled(True)
  4997.             fullautomaintthumbradio.setEnabled(True)
  4998.             fullautomaintweekradio.setEnabled(True)
  4999.             fullautomaintquarterradio.setSelected(True)
  5000.             fullyautomaintenancelabel1.setEnabled(True)
  5001.             fullyautomaintenancelabel2.setEnabled(True)
  5002.        
  5003.        
  5004.        
  5005.        
  5006.         fullautothumb = config['fullautothumb']
  5007.        
  5008.         if fullautothumb == "yes":
  5009.             fullautomaintthumbradio.setSelected(True)
  5010.            
  5011.            
  5012.         fullautocache = config['fullautocache']
  5013.        
  5014.         if fullautocache == "yes":
  5015.             fullautomaintcacheradio.setSelected(True)
  5016.            
  5017.            
  5018.         fullautopackages = config['fullautopackages']
  5019.        
  5020.         if fullautopackages == "yes":
  5021.             fullautomaintpackagesradio.setSelected(True)
  5022.            
  5023.            
  5024.            
  5025.            
  5026.            
  5027.         cacheinclude_genesis_setting = config['cacheinclude_genesis']
  5028.        
  5029.         if cacheinclude_genesis_setting == "yes":
  5030.             cacheinclude_genesis.setSelected(True)
  5031.            
  5032.         cacheinclude_navix_setting = config['cacheinclude_navix']
  5033.        
  5034.         if cacheinclude_navix_setting == "yes":
  5035.             cacheinclude_navix.setSelected(True)
  5036.            
  5037.         cacheinclude_youtube_setting = config['cacheinclude_youtube']
  5038.        
  5039.         if cacheinclude_youtube_setting == "yes":
  5040.             cacheinclude_youtube.setSelected(True)
  5041.            
  5042.            
  5043.         cacheinclude_ivue_setting = config['cacheinclude_ivue']
  5044.        
  5045.         if cacheinclude_ivue_setting == "yes":
  5046.             cacheinclude_ivue.setSelected(True)
  5047.            
  5048.  
  5049.         cacheinclude_salts_setting = config['cacheinclude_salts']
  5050.        
  5051.         if cacheinclude_salts_setting == "yes":
  5052.             cacheinclude_salts.setSelected(True)
  5053.            
  5054.         cacheinclude_pulsar_setting = config['cacheinclude_pulsar']
  5055.        
  5056.         if cacheinclude_pulsar_setting == "yes":
  5057.             cacheinclude_pulsar.setSelected(True)
  5058.        
  5059.        
  5060.     except:
  5061.         pass
  5062.    
  5063.    
  5064.    
  5065.    
  5066.    
  5067.    
  5068.    
  5069.    
  5070.    
  5071.    
  5072.     get_size(thumbnailpath)
  5073.     thumbnailfiles = total_files
  5074.     thumbnailsize = total_size/1024/1024
  5075.     gettempandcache()
  5076.     get_size(packagespath)
  5077.     packagesfiles = total_files
  5078.     packagessize = total_size/1024/1024
  5079.     packagessize = int(packagessize)
  5080.    
  5081.     if packagessize == 0 and packagesfiles > 0:
  5082.         packagessize = "<1"
  5083.        
  5084.        
  5085.     if thumbnailsize == 0 and thumbnailfiles > 0:
  5086.         thumbnailsize = "<1"
  5087.    
  5088.     maint_cache_label5.setLabel('[COLOR=lightgray]' + str(tempandcachefiles) + '[/COLOR]')
  5089.     maint_cache_label6.setLabel('[COLOR=lightgray]' + str(tempandcachesize) + ' MB[/COLOR]')
  5090.     maint_packages_label4.setLabel('[COLOR=lightgray]' + str(packagesfiles) + '[/COLOR]')
  5091.     maint_packages_label5.setLabel('[COLOR=lightgray]' + str(packagessize) + ' MB[/COLOR]')
  5092.     maint_thumb_label4.setLabel('[COLOR=lightgray]' + str(thumbnailfiles) + '[/COLOR]')
  5093.     maint_thumb_label5.setLabel('[COLOR=lightgray]' + str(thumbnailsize) + ' MB[/COLOR]')
  5094.    
  5095.    
  5096.    
  5097.     if packagessize >= 180:
  5098.         maint_packages_red.setVisible(True)
  5099.         recommendedaction = "Clear packages"
  5100.        
  5101.     if packagessize >= 70 and packagessize < 180:
  5102.         maint_packages_amber.setVisible(True)
  5103.        
  5104.     if packagessize < 70:
  5105.         maint_packages_green.setVisible(True)
  5106.        
  5107.     if packagessize == "<1":
  5108.         maint_packages_red.setVisible(False)
  5109.         maint_packages_green.setVisible(True)
  5110.        
  5111.        
  5112.        
  5113.  
  5114.        
  5115.     if thumbnailsize >= 2000:
  5116.         maint_thumb_red.setVisible(True)
  5117.         recommendedaction = "Clear thumbnails"
  5118.        
  5119.     if thumbnailsize >= 1000 and thumbnailsize < 2000:
  5120.         maint_thumb_amber.setVisible(True)
  5121.        
  5122.     if thumbnailsize < 1000:
  5123.         maint_thumb_green.setVisible(True)
  5124.        
  5125.     if thumbnailsize == "<1":
  5126.         maint_thumb_red.setVisible(False)
  5127.         maint_thumb_green.setVisible(True)
  5128.  
  5129.        
  5130.        
  5131.    
  5132.        
  5133.     if tempandcachesize >= 500:
  5134.         maint_cache_red.setVisible(True)
  5135.         recommendedaction = "Clear cache\\temp"
  5136.        
  5137.     if tempandcachesize >= 200 and tempandcachesize < 500:
  5138.         maint_cache_amber.setVisible(True)
  5139.        
  5140.     if tempandcachesize < 200:
  5141.         maint_cache_green.setVisible(True)
  5142.        
  5143.     if tempandcachesize == "<1":
  5144.         maint_cache_green.setVisible(True)
  5145.         maint_cache_red.setVisible(False)
  5146.        
  5147.  
  5148.    
  5149.     # if userlevel == "staff" or userlevel == "admin":
  5150.         # maintenancelist.controlUp(maintenancebutton)
  5151.  
  5152.  
  5153.    
  5154.  
  5155.    
  5156. def tweaks():
  5157.    
  5158.     hidecontrols()
  5159.  
  5160.    
  5161.     tweakslist.reset()
  5162.     tweakslist.addItem('[COLOR=goldenrod]Advanced Settings Wizard[/COLOR]')
  5163.     #tweakslist.addItem('[COLOR=darkturquoise]Genesis (v4): Show 100 items per page[/COLOR]')
  5164.     tweakslist.addItem('[COLOR=goldenrod]IceFilms: Blocked URL fix[/COLOR]')
  5165.     tweakslist.addItem('[COLOR=goldenrod]Primewire\\1Channel: Blocked URL fix[/COLOR]')
  5166.  
  5167.    
  5168.     tweakslist.setVisible(True)
  5169.  
  5170.    
  5171.  
  5172.     maintenancebutton.controlDown(tweakslist)
  5173.     tweakslist.controlUp(tweaksbutton)
  5174.     browseaddonsbutton.controlDown(tweakslist)
  5175.     browsebuildsbutton.controlDown(tweakslist)
  5176.     backupbutton.controlDown(tweakslist)
  5177.     #maintenancebutton.controlDown(deletepackagesbutton)
  5178.     tweaksbutton.controlDown(tweakslist)
  5179.     morebutton.controlDown(tweakslist)
  5180.     settingsbutton.controlDown(tweakslist)
  5181.    
  5182.    
  5183.     # if userlevel == "staff" or userlevel == "admin":
  5184.         # tweakslist.controlUp(maintenancebutton)
  5185.  
  5186.  
  5187.  
  5188.    
  5189. def more():
  5190.    
  5191.     hidecontrols()
  5192.  
  5193.    
  5194.     morelist.reset()
  5195.     morelist.addItem('[COLOR=goldenrod]System Information[/COLOR]')
  5196.     morelist.addItem('[COLOR=goldenrod]Upload Kodi Log[/COLOR]')
  5197.     morelist.addItem('[COLOR=goldenrod]Internet Speed Test[/COLOR]')
  5198.     morelist.addItem('[COLOR=goldenrod]Erase all Data/Fresh Start[/COLOR]')
  5199.     morelist.addItem('[COLOR=goldenrod]Force Close Kodi[/COLOR]')
  5200.     # morelist.addItem('[COLOR=goldenrod]Install PVR \ M3U \'Wizard\'?[/COLOR]')
  5201.     morelist.addItem('[COLOR=goldenrod]Suggestions welcome..[/COLOR]')
  5202.  
  5203.    
  5204.     morelist.setVisible(True)
  5205.  
  5206.    
  5207.  
  5208.     maintenancebutton.controlDown(morelist)
  5209.     morelist.controlUp(morebutton)
  5210.     browseaddonsbutton.controlDown(morelist)
  5211.     browsebuildsbutton.controlDown(morelist)
  5212.     backupbutton.controlDown(morelist)
  5213.     #maintenancebutton.controlDown(deletepackagesbutton)
  5214.     tweaksbutton.controlDown(morelist)
  5215.     morebutton.controlDown(morelist)
  5216.     settingsbutton.controlDown(morelist)
  5217.            
  5218.    
  5219.    
  5220.  
  5221. def systeminfo():
  5222.  
  5223.  
  5224.  
  5225.  
  5226.  
  5227.     xbmc.executebuiltin( "ActivateWindow(busydialog)" )
  5228.  
  5229.  
  5230.     global ip
  5231.     global isp
  5232.     global country
  5233.     global city
  5234.  
  5235.  
  5236.  
  5237.     hidecontrols()
  5238.    
  5239.     global cpufreq
  5240.     cpufreq = xbmc.getInfoLabel('System.CpuFrequency')
  5241.        
  5242.     while cpufreq == "Busy":
  5243.         cpufreq = xbmc.getInfoLabel('System.CpuFrequency')
  5244.        
  5245.     global gpu
  5246.     gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
  5247.    
  5248.     while gpu == "Busy":
  5249.         gpu = xbmc.getInfoLabel('System.VideoEncoderInfo')
  5250.        
  5251.     global kernel
  5252.     kernel = xbmc.getInfoLabel('System.KernelVersion')
  5253.            
  5254.     while kernel == "Busy":
  5255.         kernel = xbmc.getInfoLabel('System.KernelVersion')
  5256.  
  5257.  
  5258.     global mac
  5259.     mac = xbmc.getInfoLabel('Network.MacAddress')
  5260.            
  5261.     while mac == "Busy":
  5262.         mac = xbmc.getInfoLabel('Network.MacAddress')
  5263.        
  5264.    
  5265.     internetstate = xbmc.getInfoLabel('System.InternetState')
  5266.    
  5267.     while internetstate == "Busy":
  5268.         internetstate = xbmc.getInfoLabel('System.InternetState')
  5269.  
  5270.    
  5271.    
  5272.    
  5273.    
  5274.     try:
  5275.         url = 'http://whatismyipaddress.com/'
  5276.         req = urllib2.Request(url)
  5277.         req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
  5278.        
  5279.         try:
  5280.             response = urllib2.urlopen(req)
  5281.        
  5282.         except urllib2.URLError, e:
  5283.             pass
  5284.             # print '@ares: URL Timeout: whatismyipaddress.com'
  5285.        
  5286.         link=response.read()
  5287.         response.close()
  5288.        
  5289.         global ip
  5290.         ip = regex_from_to(link, '26px;text-decoration:none;">', '</a>')
  5291.         global city
  5292.         city = regex_from_to(link, 'City:</th><td style="font-size:14px;">', '</td>')
  5293.         global country
  5294.         country = regex_from_to(link, 'Country:</th><td style="font-size:14px;">', '</td>')
  5295.         global isp
  5296.         isp = regex_from_to(link, 'ISP:</th><td style="font-size:14px;">', '</td>')
  5297.        
  5298.        
  5299.        
  5300.         if debuglog == "true":
  5301.             print '@ares: using http://whatismyipaddress.com to collect info'
  5302.             print ' '
  5303.             print '@ares: ip = ' + ip
  5304.             print '@ares: city = ' + city
  5305.             print '@ares: country = ' + country
  5306.             print '@ares: isp = ' + isp
  5307.        
  5308.        
  5309.        
  5310.        
  5311.        
  5312.     except:
  5313.         pass
  5314.  
  5315.    
  5316.    
  5317.     if ip == "":
  5318.    
  5319.         if debuglog == "true":
  5320.             print ' '
  5321.             print '@ares: ip mismatch - using backup site to collect data...'
  5322.             print ' '
  5323.        
  5324.         url = 'https://www.privateinternetaccess.com/pages/whats-my-ip/'
  5325.         req = urllib2.Request(url)
  5326.         req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
  5327.        
  5328.         try:
  5329.             response = urllib2.urlopen(req)
  5330.        
  5331.         except urllib2.URLError, e:
  5332.             pass
  5333.             # print '@ares: URL Timeout: privateinternetaccess.com'
  5334.        
  5335.         link=response.read()
  5336.         response.close()
  5337.        
  5338.         #global ip
  5339.         ip = regex_from_to(link, 'IP Address:<span style="font-weight:bold"> ', '</span>')
  5340.         #global city
  5341.         city = regex_from_to(link, 'City</span>:<span style="font-weight:bold"> ', '</span>')
  5342.        
  5343.         if city.find('span') <> -1:
  5344.             city = " "
  5345.        
  5346.        
  5347.         #global country
  5348.         country = regex_from_to(link, 'Country:<span style="font-weight:bold"> ', '</span>')
  5349.        
  5350.         if country.find('span') <> -1:
  5351.             country = " "
  5352.        
  5353.         #global isp
  5354.         isp = regex_from_to(link, 'Internet Service Provider:<span style="font-weight:bold"> ', '</span>')
  5355.        
  5356.         if isp.find('span') <> -1:
  5357.             isp = " "
  5358.        
  5359.        
  5360.         if debuglog == "true":
  5361.             print '@ares: using https://www.privateinternetaccess.com/pages/whats-my-ip/ to collect info'
  5362.             print ' '
  5363.             print '@ares: ip = ' + ip
  5364.             print '@ares: city = ' + city
  5365.             print '@ares: country = ' + country
  5366.             print '@ares: isp = ' + isp
  5367.        
  5368.        
  5369.        
  5370.    
  5371.    
  5372.     cpufreqlabel.setLabel('[COLOR=lightgray]' + cpufreq + '[/COLOR]')
  5373.     gpulabel.setLabel('[COLOR=lightgray]' + gpu + '[/COLOR]')
  5374.     externaliplabel.setLabel('[COLOR=lightgray]' + ip + '[/COLOR]')
  5375.     isplabel.setLabel('[COLOR=lightgray]' + isp + '[/COLOR]')
  5376.     countrylabel.setLabel('[COLOR=lightgray]' + country + '[/COLOR]')
  5377.     citylabel.setLabel('[COLOR=lightgray]' + city + '[/COLOR]')
  5378.     kernellabel.setLabel('[COLOR=lightgray]' + kernel + '[/COLOR]')
  5379.     macaddresslabel.setLabel('[COLOR=lightgray]' + mac + '[/COLOR]')
  5380.     internetstatelabel.setLabel('[COLOR=lightgray]' + internetstate + '[/COLOR]')
  5381.  
  5382.    
  5383.    
  5384.    
  5385.  
  5386.     kerneltextlabel.setVisible(True)
  5387.     kernellabel.setVisible(True)
  5388.     cpufreqtextlabel.setVisible(True)
  5389.     cpufreqlabel.setVisible(True)
  5390.     gputextlabel.setVisible(True)
  5391.     gpulabel.setVisible(True)
  5392.     kodiversiontextlabel.setVisible(True)
  5393.     kodiversionlabel.setVisible(True)
  5394.     kodibuildtextlabel.setVisible(True)
  5395.     kodibuildlabel.setVisible(True)
  5396.     screenmodetextlabel.setVisible(True)
  5397.     screenmodelabel.setVisible(True)
  5398.     networkstatetextlabel.setVisible(True)
  5399.     networkstatelabel.setVisible(True)
  5400.     internaliptextlabel.setVisible(True)
  5401.     internaliplabel.setVisible(True)
  5402.     macaddresstextlabel.setVisible(True)
  5403.     macaddresslabel.setVisible(True)
  5404.     gatewaytextlabel.setVisible(True)
  5405.     gatewaylabel.setVisible(True)
  5406.     dnstextlabel.setVisible(True)
  5407.     dnslabel.setVisible(True)
  5408.     interetstatetextlabel.setVisible(True)
  5409.     internetstatelabel.setVisible(True)
  5410.     cputemptextlabel.setVisible(True)
  5411.     cputemplabel.setVisible(True)
  5412.     cpuuseagetextlabel.setVisible(True)
  5413.     cpuusagelabel.setVisible(True)
  5414.     freestoragetextlabel.setVisible(True)
  5415.     freestoragelabel.setVisible(True)
  5416.     usedstoragetextlabel.setVisible(True)
  5417.     usedstoragelabel.setVisible(True)
  5418.     totalstoragetextlabel.setVisible(True)
  5419.     totalstoragelabel.setVisible(True)
  5420.     freeramtextlabel.setVisible(True)
  5421.     freeramlabel.setVisible(True)
  5422.     externaliptextlabel.setVisible(True)
  5423.     externaliplabel.setVisible(True)
  5424.     isptextlabel.setVisible(True)
  5425.     isplabel.setVisible(True)
  5426.     countrytextlabel.setVisible(True)
  5427.     countrylabel.setVisible(True)
  5428.     citytextlabel.setVisible(True)
  5429.     citylabel.setVisible(True)
  5430.  
  5431.    
  5432.     # if userlevel == "staff" or userlevel == "admin":
  5433.         # browsebuildsbutton.controlDown(managebuildsbutton)
  5434.         # browseaddonsbutton.controlDown(manageaddonsbutton)
  5435.         # browserepobutton.controlDown(managereposbutton)
  5436.         # maintenancebutton.controlDown(manageusersbutton)
  5437.         # tweaksbutton.controlDown(blankbutton1)
  5438.         # morebutton.controlDown(blankbutton2)
  5439.         # settingsbutton.controlDown(blankbutton2)
  5440.        
  5441.     xbmc.executebuiltin( "Dialog.Close(busydialog)" )
  5442.  
  5443. def installbuild():
  5444.    
  5445.     global url
  5446.     global addonpath
  5447.     global addontype
  5448.     global addonname
  5449.     global name
  5450.     global username
  5451.     global currentlist
  5452.    
  5453.    
  5454.     if currentlist == "blackbox":
  5455.        
  5456.         blackbox2()
  5457.        
  5458.     else:
  5459.    
  5460.         buildresult = getbuilddetails()
  5461.        
  5462.  
  5463.        
  5464.        
  5465.  
  5466.  
  5467. def installbutton():
  5468.  
  5469.     global url
  5470.     global addonpath
  5471.     global addontype
  5472.     global addonname
  5473.     global name
  5474.     global username
  5475.     global repolistraw
  5476.  
  5477.     #print 'currentlist>> ' + currentlist
  5478.    
  5479.        
  5480.    
  5481.     if currentlist == 'videoaddon':
  5482.         getaddondetails()
  5483.         manageaddon.installaddon(addonname,url,addonpath, addontype, deviceid, mac, username)
  5484.         showvideoaddonslist()
  5485.        
  5486.         if repopath == "":
  5487.             pass
  5488.         else:
  5489.        
  5490.             desinationrepofolder = translate(os.path.join('special://home/addons', repopath))
  5491.             desinationrepoxml = os.path.join(desinationrepofolder, 'addon.xml')
  5492.            
  5493.             if not os.path.isfile(desinationrepoxml):
  5494.                 dialog = xbmcgui.Dialog()
  5495.                
  5496.                 if dialog.yesno(strings.getstring("installrepo"), strings.getstring("installrepo2")):
  5497.                    
  5498.                     try:
  5499.                         repolistraw
  5500.                     except:
  5501.                         url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getreposincadult&time=' + datetime.datetime.now().strftime('%S')
  5502.                         req = urllib2.Request(url)
  5503.                         req.add_header('User-Agent', aresagent)
  5504.                         response = urllib2.urlopen(req)
  5505.                        
  5506.                         repolistraw = response.read()
  5507.                        
  5508.                     url2 = ""
  5509.  
  5510.                     data = json.loads(repolistraw) 
  5511.                     for entry in data:
  5512.                         if entry['repopath'] == repopath:
  5513.                             url2 = entry['url']
  5514.                             addonname = entry['name']
  5515.                                
  5516.                     addontype = "repo"
  5517.                    
  5518.                    
  5519.                    
  5520.                     if debuglog == "true":
  5521.                         print addonname
  5522.                         print repopath
  5523.                         print addontype
  5524.                         print '--> URL: '+ url2
  5525.                    
  5526.                    
  5527.                     if url2 == "":
  5528.                         dialog = xbmcgui.Dialog()
  5529.                         dialog.ok(strings.getstring("areswizard"), strings.getstring("repounavailable"), "","")
  5530.                     else:
  5531.                         manageaddon.installaddon(addonname,url2,repopath, addontype, deviceid, mac, username)          
  5532.                    
  5533.    
  5534.        
  5535.        
  5536.     if currentlist == 'programaddon':
  5537.         getaddondetails()
  5538.         manageaddon.installaddon(addonname,url,addonpath, addontype, deviceid, mac, username)
  5539.         showprogramaddonslist()
  5540.        
  5541.     if currentlist == 'repo':
  5542.         getrepodetails()
  5543.         manageaddon.installaddon(name, url, addonpath, addontype, deviceid, mac, username)
  5544.         showrepolist()
  5545.    
  5546.    
  5547.     # dialog = xbmcgui.Dialog()
  5548.     # dialog.ok(name, "URL: " + url + "\n" + "Iconimage: " + iconimage + "\n" + "Descr: " + descr + "\n" + "Fanart: " + fanart, "", "")
  5549.    
  5550.  
  5551.    
  5552. def uninstallbutton():
  5553.  
  5554.     #print 'currentlist>> ' + currentlist
  5555.  
  5556.     if currentlist == 'build':
  5557.         getbuilddetails()
  5558.    
  5559.     if currentlist == 'videoaddon':
  5560.         getaddondetails()
  5561.         manageaddon.uninstalladdon(addonname,addonpath, addontype)
  5562.         showvideoaddonslist()
  5563.        
  5564.        
  5565.        
  5566.     if currentlist == 'repo':
  5567.         getrepodetails()   
  5568.    
  5569.    
  5570.    
  5571.  
  5572.  
  5573.    
  5574. def tweakcache_page1():
  5575.  
  5576.     tweakcachelabel1.setVisible(False)
  5577.     tweakcache_page1button.setVisible(False)
  5578.    
  5579.     tweakcachelabel2.setVisible(True)
  5580.     tweakcachelabel3.setVisible(True)
  5581.  
  5582.     global freeramlabel3
  5583.     global freeramdev3
  5584.     global freeramdev3min10pc
  5585.    
  5586.  
  5587.  
  5588.    
  5589.     tweakcache_page2button.setVisible(True)
  5590.    
  5591.  
  5592.    
  5593.     freeramlabel = xbmc.getInfoLabel('System.FreeMemory')
  5594.     global freeramlabel3
  5595.     freeramlabel2 = freeramlabel[:-2]
  5596.     freeramlabel3 = int(freeramlabel2)
  5597.    
  5598.     global freeramdev3
  5599.     freeramdev3 = int((freeramlabel3/3))
  5600.     freeramstring = str(freeramdev3)
  5601.     freeramdev3min10pc = int((freeramdev3 * .90))  
  5602.     freeramdev3float = float(freeramlabel3/3)
  5603.    
  5604.     if freeramdev3min10pc > 500:
  5605.         freeramdev3min10pc = 500
  5606.         percentage = float(freeramdev3min10pc/freeramdev3float * 100)
  5607.         slider1.setPercent(percentage)
  5608.    
  5609.    
  5610.     global freerambytes
  5611.     freerambytes = freeramdev3*1024*1024
  5612.     global freerambytesstring
  5613.     freerambytesstring = str(freerambytes)
  5614.    
  5615.     cachetweak_1stline.setLabel('[COLOR=darkgray]' + strings.getstring("cachetweak1") + freeramlabel + strings.getstring("cachetweak2") +'[/COLOR]')
  5616.     cachetweak_1stline.setVisible(True)
  5617.    
  5618.     cachetweak_2ndline.setLabel('[COLOR=lightgray]' + strings.getstring("cachetweak3") + freeramstring + strings.getstring("cachetweak4") + '[/COLOR]')
  5619.     cachetweak_2ndline.setVisible(True)
  5620.    
  5621.     tweakcachelabel2.setLabel('[COLOR=darkgray]' + strings.getstring("tweakcachelabel2") + str(freeramdev3min10pc) + 'MB [/COLOR]')
  5622.    
  5623.    
  5624.    
  5625.     tweakslist.controlRight(tweakcache_page2button)
  5626.     tweakcache_page2button.controlLeft(tweakslist)
  5627.     tweakcache_page2button.controlUp(tweaksbutton)
  5628.     tweakcache_page2button.setVisible(True)
  5629.     window.setFocus(tweakcache_page2button)
  5630.        
  5631.    
  5632. def tweakcache_page2():
  5633.  
  5634.     global newbuffermode
  5635.     global newcache
  5636.     global newrbf
  5637.     global newcurl
  5638.  
  5639.     tweakcache_page2button.setVisible(False)
  5640.     cachetweak_1stline.setVisible(False)
  5641.     cachetweak_2ndline.setVisible(False)
  5642.     tweakcachelabel2.setVisible(False)
  5643.     tweakcachelabel3.setVisible(False)
  5644.    
  5645.     slider1value.setVisible(True)
  5646.     slider1.setVisible(True)
  5647.    
  5648.    
  5649.     slider1value.setLabel('[COLOR=darkgray] ' + str(freeramdev3min10pc) + 'MB[/COLOR]')
  5650.     slider2value.setLabel('[COLOR=darkgray] 10s[/COLOR]')
  5651.     slider3value.setLabel('[COLOR=darkgray] 5[/COLOR]')
  5652.    
  5653.     recommendedramsetting.setLabel('[COLOR=darkgray]' + strings.getstring("recommendedsetting") + str(freeramdev3min10pc) + 'MB[/COLOR]')
  5654.    
  5655.    
  5656.    
  5657.     tweakcache_page2intro.setVisible(True)
  5658.     currentramsetting.setVisible(True)
  5659.     recommendedramsetting.setVisible(True)
  5660.     videcachesizelabel.setVisible(True)
  5661.    
  5662.     applycachetweakbutton.setVisible(True)
  5663.    
  5664.    
  5665.    
  5666.     slider2.setVisible(True)
  5667.     curltimelabel.setVisible(True)
  5668.     currentcurlsetting.setVisible(True)
  5669.     slider2value.setVisible(True)
  5670.     recommendedcurlsetting.setVisible(True)
  5671.    
  5672.     slider3.setVisible(True)
  5673.     readbufferfactorlabel.setVisible(True)
  5674.     currentrbfsetting.setVisible(True)
  5675.     slider3value.setVisible(True)
  5676.     recommendedrbfsetting.setVisible(True)
  5677.    
  5678.     applycachetweakbutton.controlUp(mode2radiobutton)
  5679.     slider3.controlUp(slider2)
  5680.     slider3.controlDown(mode2radiobutton)
  5681.     slider2.controlUp(slider1)
  5682.     slider2.controlDown(slider3)
  5683.     slider1.controlUp(tweaksbutton)
  5684.     slider1.controlDown(slider2)
  5685.     tweaksbutton.controlDown(slider1)
  5686.    
  5687.     buffermodelabel.setVisible(True)
  5688.     mode1radiobutton.setVisible(True)
  5689.     mode2radiobutton.setVisible(True)
  5690.     mode3radiobutton.setVisible(True)
  5691.     mode4radiobutton.setVisible(True)
  5692.    
  5693.    
  5694.     mode2radiobutton.setSelected(True)
  5695.     newbuffermode = 2
  5696.     #newcache = freeramdev3
  5697.     newcurl = 10
  5698.     newrbf = 5
  5699.    
  5700.     if freeramdev3 < 500:
  5701.         newcache = freeramdev3
  5702.     else:
  5703.         newcache = freeramdev3min10pc
  5704.    
  5705.     mode1radiobutton.controlUp(slider3)
  5706.     mode2radiobutton.controlUp(slider3)
  5707.     mode3radiobutton.controlUp(slider3)
  5708.     mode4radiobutton.controlUp(slider3)
  5709.    
  5710.     mode1radiobutton.controlDown(applycachetweakbutton)
  5711.     mode2radiobutton.controlDown(applycachetweakbutton)
  5712.     mode3radiobutton.controlDown(applycachetweakbutton)
  5713.     mode4radiobutton.controlDown(applycachetweakbutton)
  5714.    
  5715.     mode1radiobutton.controlRight(mode2radiobutton)
  5716.     mode2radiobutton.controlLeft(mode1radiobutton)
  5717.     mode2radiobutton.controlRight(mode3radiobutton)
  5718.     mode3radiobutton.controlLeft(mode2radiobutton)
  5719.     mode3radiobutton.controlRight(mode4radiobutton)
  5720.     mode4radiobutton.controlLeft(mode3radiobutton)
  5721.  
  5722.     window.setFocus(applycachetweakbutton)
  5723.  
  5724.    
  5725.      
  5726.    
  5727. def replace_words(text, word_dic):
  5728.     """
  5729.     take a text and replace words that match a key in a dictionary with
  5730.     the associated value, return the changed text
  5731.     """
  5732.     rc = re.compile('|'.join(map(re.escape, word_dic)))
  5733.     def translate(match):
  5734.         return word_dic[match.group(0)]
  5735.     return rc.sub(translate, text)
  5736.  
  5737.  
  5738. def applycachetweak(newcache, newcurl, newrbf, newbuffermode):
  5739.  
  5740.     # try:
  5741.    
  5742.  
  5743.     #print newcache
  5744.    
  5745.     cacheout = str(newcache*1024*1024)
  5746.    
  5747.     str3 = '<advancedsettings>\n    <network>\n     <buffermode>' + str(newbuffermode) + '</buffermode>\n       <cachemembuffersize>' + str(cacheout) + '</cachemembuffersize>\n        <readbufferfactor>' + str(newrbf) + '</readbufferfactor>\n      <curlclienttimeout>' + str(newcurl) + '</curlclienttimeout>\n       <curllowspeedtime>' + str(newcurl) + '</curllowspeedtime>\n </network>\n</advancedsettings>'
  5748.    
  5749.    
  5750.    
  5751.     fout = open(advancedxmlfile, "w")
  5752.     fout.write(str3)
  5753.     fout.close()
  5754.    
  5755.     # except:
  5756.         # dialog = xbmcgui.Dialog()
  5757.         # dialog.ok("Error", "Could not write to xml file", "","")
  5758.         # return()
  5759.        
  5760.     dialog = xbmcgui.Dialog()
  5761.     dialog.ok("Completed",  strings.getstring('advancedsettings'), "","")
  5762.  
  5763.  
  5764.  
  5765. def deletepackages():
  5766.    
  5767.     maintenance.deletepackages()
  5768.    
  5769.  
  5770.     get_size(packagespath)
  5771.     packagesfiles = total_files
  5772.     packagessize = total_size/1024/1024
  5773.     maint_packages_label4.setLabel('[COLOR=lightgray]' + str(packagesfiles) + '[/COLOR]')
  5774.     maint_packages_label5.setLabel('[COLOR=lightgray]' + str(packagessize) + ' MB[/COLOR]')
  5775.    
  5776.     try:
  5777.  
  5778.         with open(settingsfile, 'r',0) as f:
  5779.             config = json.load(f)
  5780.            
  5781.         maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
  5782.         totalfilesdeleted = config['totaltempfiles']
  5783.         oldlabel = maint_totallocalfileslabel.getLabel()
  5784.         maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
  5785.        
  5786.        
  5787.         maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
  5788.         totalspacegained = config['totalspacegained']
  5789.         totalspacegained2 = int(round(float(totalspacegained)))
  5790.         oldlabel = maint_totallocalspacelabel.getLabel()
  5791.         maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
  5792.            
  5793.     except:
  5794.         pass
  5795.  
  5796.    
  5797.    
  5798. def deletecache():
  5799.  
  5800.     maintenance.deletecache()
  5801.    
  5802.     gettempandcache()
  5803.     maint_cache_label5.setLabel('[COLOR=lightgray]' + str(tempandcachefiles) + '[/COLOR]')
  5804.     maint_cache_label6.setLabel('[COLOR=lightgray]' + str(tempandcachesize) + ' MB[/COLOR]')
  5805.    
  5806.    
  5807.    
  5808.     try:
  5809.  
  5810.         with open(settingsfile, 'r',0) as f:
  5811.             config = json.load(f)
  5812.            
  5813.            
  5814.         maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
  5815.         totalfilesdeleted = config['totaltempfiles']
  5816.         oldlabel = maint_totallocalfileslabel.getLabel()
  5817.         maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
  5818.        
  5819.        
  5820.         maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
  5821.         totalspacegained = config['totalspacegained']
  5822.         totalspacegained2 = int(round(float(totalspacegained)))
  5823.         oldlabel = maint_totallocalspacelabel.getLabel()
  5824.         maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
  5825.            
  5826.            
  5827.     except:
  5828.         pass
  5829.    
  5830.    
  5831.    
  5832. def deletethumbnails():
  5833.  
  5834.     maintenance.deletethumbnails()
  5835.    
  5836.     get_size(thumbnailpath)
  5837.     thumbnailfiles = total_files
  5838.     thumbnailsize = total_size/1024/1024
  5839.     maint_thumb_label4.setLabel('[COLOR=lightgray]' + str(thumbnailfiles) + '[/COLOR]')
  5840.     maint_thumb_label5.setLabel('[COLOR=lightgray]' + str(thumbnailsize) + ' MB[/COLOR]')
  5841.    
  5842.    
  5843.     try:
  5844.  
  5845.         with open(settingsfile, 'r',0) as f:
  5846.             config = json.load(f)
  5847.            
  5848.            
  5849.         maint_totallocalfileslabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]')
  5850.         totalfilesdeleted = config['totaltempfiles']
  5851.         oldlabel = maint_totallocalfileslabel.getLabel()
  5852.         maint_totallocalfileslabel.setLabel(oldlabel + '[COLOR=darkgray]' + totalfilesdeleted + '[/COLOR]')
  5853.        
  5854.        
  5855.         maint_totallocalspacelabel.setLabel('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]')
  5856.         totalspacegained = config['totalspacegained']
  5857.         totalspacegained2 = int(round(float(totalspacegained)))
  5858.         oldlabel = maint_totallocalspacelabel.getLabel()
  5859.         maint_totallocalspacelabel.setLabel(oldlabel + '[COLOR=darkgray]' + str(totalspacegained2) + ' MB[/COLOR]')
  5860.            
  5861.     except:
  5862.         pass       
  5863.  
  5864.    
  5865.  
  5866. def logout():
  5867.  
  5868.     addon.setSetting("username", "")
  5869.     # addon.setSetting("email", "")
  5870.     addon.setSetting("accountstatus", "")
  5871.     addon.setSetting("Subends", "")
  5872.     addon.setSetting("activationsleft", "")
  5873.    
  5874.     logoutbutton.setVisible(False)
  5875.     loginbutton.setVisible(True)
  5876.    
  5877.     dialog = xbmcgui.Dialog()
  5878.     dialog.ok(strings.getstring('areswizard'), strings.getstring('restarneeded'), "","")
  5879.    
  5880.    
  5881. def login():
  5882.  
  5883.  
  5884.     global password
  5885.     global username
  5886.     global email
  5887.     global userinfo
  5888.     global userlevel
  5889.  
  5890.  
  5891.     try:
  5892.         with open(settingsfile, 'r',0) as f:
  5893.             config = json.load(f)
  5894.  
  5895.         deviceid = config['deviceid']
  5896.        
  5897.  
  5898.     except:
  5899.         deviceid = "Error"
  5900.  
  5901.    
  5902.    
  5903.     dialog = xbmcgui.Dialog()
  5904.     if dialog.yesno(strings.getstring('areswizard'), strings.getstring('alreadyhaveaccount')):
  5905.    
  5906.         # YES  
  5907.    
  5908.         keyboard = xbmc.Keyboard("", strings.getstring('enteremail'))
  5909.         keyboard.doModal()
  5910.         emailinput = keyboard.getText()
  5911.        
  5912.         keyboard = xbmc.Keyboard("", strings.getstring('entername'))
  5913.         keyboard.doModal()
  5914.         nameinput = keyboard.getText()
  5915.        
  5916.         keyboard = xbmc.Keyboard("", strings.getstring('enterpass'))
  5917.         keyboard.setHiddenInput(True)
  5918.         keyboard.doModal()
  5919.         passwordinput = keyboard.getText()
  5920.        
  5921.        
  5922.         addon.setSetting("deviceid", deviceid)
  5923.         addon.setSetting("username", nameinput)
  5924.         # addon.setSetting("email", emailinput)
  5925.        
  5926.         configraw = update.loginbutton(nameinput, passwordinput, emailinput, deviceid, mac)
  5927.        
  5928.         if configraw == "registered":
  5929.        
  5930.            
  5931.             loginstatus = update.login(nameinput, mac, deviceid)
  5932.    
  5933.    
  5934.  
  5935.    
  5936.            
  5937.             if loginstatus == "loginerror":
  5938.                 addon.setSetting("accountstatus", "free")
  5939.                
  5940.                
  5941.             elif loginstatus == "devicemac-mismatch":
  5942.                 length=10
  5943.                 deviceid = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))
  5944.                
  5945.                 config = {'deviceid': deviceid}
  5946.            
  5947.  
  5948.                 if not os.path.exists(datapath):
  5949.                     os.makedirs(datapath)
  5950.                
  5951.                        
  5952.                 with open(settingsfile, 'w') as f:
  5953.                     json.dump(config, f)
  5954.                     f.close
  5955.                    
  5956.                 addon.setSetting("deviceid", deviceid)
  5957.                 addon.setSetting("activationsleft", '')
  5958.                 addon.setSetting("Subends", '')
  5959.                 addon.setSetting("username", "free")
  5960.                 addon.setSetting("accountstatus", "free")
  5961.                
  5962.                 loginstatus = update.login('free' , mac, deviceid)
  5963.            
  5964.                
  5965.             elif loginstatus == "inserted":
  5966.                 addon.setSetting("username", "free")
  5967.                 addon.setSetting("accountstatus", "free")
  5968.                 accountstatus = "free"
  5969.                 username = "free"
  5970.                 userlevel = "free"
  5971.                 addon.setSetting("activationsleft", '')
  5972.                 addon.setSetting("Subends", '')
  5973.                
  5974.                
  5975.             elif loginstatus == "user-not-found":
  5976.                 addon.setSetting("username", "free")
  5977.                 addon.setSetting("accountstatus", "free")
  5978.                 accountstatus = "free"
  5979.                 username = "free"
  5980.                 userlevel = "free"
  5981.                 addon.setSetting("activationsleft", '')
  5982.                 addon.setSetting("Subends", '')
  5983.                
  5984.                
  5985.             else:
  5986.                 data = json.loads(loginstatus) 
  5987.  
  5988.                         #print(data)
  5989.  
  5990.                 for entry in data:
  5991.                     if username <> "free":
  5992.                         Subends = entry['Subends']
  5993.                     userlevel = entry['userlevel']
  5994.                     Banned = entry['Banned']
  5995.                     BanReason = entry['BanReason']
  5996.            
  5997.            
  5998.            
  5999.            
  6000.            
  6001.            
  6002.            
  6003.            
  6004.            
  6005.            
  6006.            
  6007.            
  6008.            
  6009.             loginbutton.setVisible(False)
  6010.             logoutbutton.setVisible(True)
  6011.             browsebuildsbutton.controlUp(logoutbutton)
  6012.             logoutbutton.controlDown(browsebuildsbutton)
  6013.             window.setFocus(browsebuildsbutton)
  6014.            
  6015.        
  6016.         if configraw == "user-or-pass-not-found":
  6017.        
  6018.             dialog = xbmcgui.Dialog()
  6019.             dialog.ok("Ares Wizard", "Username or Password Incorrect", "","")
  6020.             addon.setSetting("username", "free")
  6021.             addon.setSetting("accountstatus", "free")
  6022.             accountstatus = "free"
  6023.             username = "free"
  6024.             userlevel = "free"
  6025.             addon.setSetting("activationsleft", '')
  6026.             addon.setSetting("Subends", '')
  6027.  
  6028.        
  6029.        
  6030.         if configraw == "maximumnumberofregistrationsmet":
  6031.        
  6032.             dialog = xbmcgui.Dialog()
  6033.             dialog.ok("Ares Wizard", "You cannot register anymore devices using this email", "","")
  6034.             addon.setSetting("username", "free")
  6035.             addon.setSetting("accountstatus", "free")
  6036.             accountstatus = "free"
  6037.             username = "free"
  6038.             userlevel = "free"
  6039.             addon.setSetting("activationsleft", '')
  6040.             addon.setSetting("Subends", '')
  6041.    
  6042.    
  6043.    
  6044.     else:
  6045.    
  6046.         # NO
  6047.    
  6048.         # registrationprocess = user.register(mac, deviceid)
  6049.  
  6050.         dialog = xbmcgui.Dialog()
  6051.         dialog.ok("Ares Wizard", "This is currently for staff use only", "","")
  6052.        
  6053.  
  6054.  
  6055.    
  6056.    
  6057. def activate():
  6058.  
  6059.     global mac
  6060.  
  6061.     try:
  6062.         mac
  6063.     except:
  6064.         getsysinfo()
  6065.  
  6066.     try:
  6067.         username = xbmcplugin.getSetting(int(sys.argv[1]), 'username')
  6068.  
  6069.     except:
  6070.         pass
  6071.        
  6072.        
  6073.  
  6074.    
  6075.     registrationprocess = user.activate(username, mac, deviceid)
  6076.  
  6077.     if registrationprocess == "activated":
  6078.        
  6079.         browsebuildsbutton.setEnabled(True)
  6080.         browseaddonsbutton.setEnabled(True)
  6081.         backupbutton.setEnabled(True)
  6082.         maintenancebutton.setEnabled(True)
  6083.         tweaksbutton.setEnabled(True)
  6084.         morebutton.setEnabled(True)
  6085.         activatebutton.setVisible(False)
  6086.         logoutbutton.setVisible(True)
  6087.         window.setFocus(browsebuildsbutton)
  6088.         addon.setSetting("accountstatus", "Registered")
  6089.  
  6090.        
  6091.         introlabel.setLabel('[COLOR=darkgray]' + strings.getstring('introlabel_loggedin') + '[/COLOR]')
  6092.        
  6093.         update.login(username, mac, deviceid)
  6094.    
  6095.  
  6096.  
  6097.  
  6098. def showrating(rating, votesint):
  6099.  
  6100.    
  6101.    
  6102.     star1.setVisible(False)
  6103.     star2.setVisible(False)
  6104.     star3.setVisible(False)
  6105.     star4.setVisible(False)
  6106.     star5.setVisible(False)
  6107.    
  6108.     # print 'rating = ' + str(rating)
  6109.     # print 'votes = ' + str(votesint)
  6110.    
  6111.     ratingint = int(rating)
  6112.     votes = int(votesint)
  6113.    
  6114.     if ratingint == 0 or votes == 0:
  6115.         return
  6116.        
  6117.     averageratingraw = (ratingint/votes)
  6118.     averagerating2 = int(averageratingraw)
  6119.     averagerating = str(averagerating2)
  6120.    
  6121.     # print 'averagerating = ' + str(averagerating)
  6122.        
  6123.     if averagerating == "5":
  6124.         star1.setVisible(True)
  6125.         star2.setVisible(True)
  6126.         star3.setVisible(True)
  6127.         star4.setVisible(True)
  6128.         star5.setVisible(True)
  6129.     elif averagerating == "4":
  6130.         star1.setVisible(True)
  6131.         star2.setVisible(True)
  6132.         star3.setVisible(True)
  6133.         star4.setVisible(True)
  6134.     elif averagerating == "3":
  6135.         star1.setVisible(True)
  6136.         star2.setVisible(True)
  6137.         star3.setVisible(True)
  6138.     elif averagerating == "2":
  6139.         star1.setVisible(True)
  6140.         star2.setVisible(True)
  6141.     elif averagerating == "1":
  6142.         star1.setVisible(True)
  6143.     else:
  6144.         pass
  6145.  
  6146.    
  6147.  
  6148. def getunblockurl(name):
  6149.  
  6150.     global unblockurls
  6151.    
  6152.     try:
  6153.         unblockurls
  6154.     except:
  6155.         url = 'http://107.150.47.139/~areswizard/'+basephpfile+'?action=getunblockurls&time=' + datetime.datetime.now().strftime('%S')
  6156.         url = url.replace (" ", "%20")
  6157.         req = urllib2.Request(url)
  6158.         req.add_header('User-Agent', aresagent)
  6159.         response = urllib2.urlopen(req)
  6160.         unblockurls=response.read()
  6161.         response.close()
  6162.    
  6163.     data = json.loads(unblockurls)
  6164.    
  6165.     for entry in data:
  6166.             if name == entry['name']:
  6167.                 link = entry['url']
  6168.    
  6169.     return(link)
  6170.  
  6171.  
  6172.    
  6173. def changeurl():
  6174.  
  6175.     destaddonpath = os.path.join(xbmc.translatePath('special://home/userdata/addon_data/'), addonpath)
  6176.     destxmlfile = os.path.join(destaddonpath, 'settings.xml')
  6177.  
  6178.  
  6179.     s=open(destxmlfile).read()
  6180.     if currenturl in s:
  6181.             s=s.replace(currenturl, unblockurl)
  6182.             f=open(destxmlfile, 'w')
  6183.             f.write(s)
  6184.             f.flush()
  6185.             f.close()
  6186.    
  6187.     if unblockurl in open(destxmlfile).read():
  6188.         dialog = xbmcgui.Dialog()
  6189.         dialog.ok("Success", name + strings.getstring("urlchanged"), "","")
  6190.     else:
  6191.         dialog = xbmcgui.Dialog()
  6192.         dialog.ok("Error",  name + strings.getstring("urlnotchanged"), "","")
  6193.    
  6194.    
  6195.    
  6196. def librmtp():
  6197.  
  6198.  
  6199.     if xbmc.getCondVisibility('system.platform.osx'):
  6200.         try: os.system('killall -9 XBMC')
  6201.         except: pass
  6202.         try: os.system('killall -9 Kodi')
  6203.         except: pass
  6204.  
  6205.     elif xbmc.getCondVisibility('system.platform.linux'):
  6206.         try: os.system('killall XBMC')
  6207.         except: pass
  6208.         try: os.system('killall Kodi')
  6209.         except: pass
  6210.         try: os.system('killall -9 xbmc.bin')
  6211.         except: pass
  6212.         try: os.system('killall -9 kodi.bin')
  6213.         except: pass
  6214.  
  6215.     elif xbmc.getCondVisibility('system.platform.android'):
  6216.         try: os.system('adb shell am force-stop org.xbmc.kodi')
  6217.         except: pass
  6218.         try: os.system('adb shell am force-stop org.kodi')
  6219.         except: pass
  6220.         try: os.system('adb shell am force-stop org.xbmc.xbmc')
  6221.         except: pass
  6222.         try: os.system('adb shell am force-stop org.xbmc')
  6223.         except: pass       
  6224.  
  6225.     elif xbmc.getCondVisibility('system.platform.windows'):
  6226.    
  6227.         print ' '
  6228.         print 'windows detected'
  6229.         print ' '
  6230.        
  6231.        
  6232.         #default = 383609
  6233.        
  6234.         libfile = translate(os.path.join('special://xbmc/system/players/dvdplayer/','librtmp.dll'))
  6235.  
  6236.        
  6237.         print 'libfile: ' + libfile
  6238.        
  6239.         filesize = os.path.getsize(libfile)
  6240.        
  6241.         print ' '
  6242.         print 'filesize: ' + str(filesize)
  6243.        
  6244.         if filesize == 383609:
  6245.             dialog = xbmcgui.Dialog()
  6246.  
  6247.             if dialog.yesno("Backup ?", "You have the default librmtp, do you want to back it up?"):
  6248.                
  6249.                 try:
  6250.                     os.system('copy "C:\Program Files (x86)\Kodi\system\players\dvdplayer\librtmp.dll" "C:\Program Files (x86)\Kodi\system\players\dvdplayer\librtmp_backup.dll"')
  6251.                 except:
  6252.                     pass
  6253.            
  6254.        
  6255.        
  6256.        
  6257.  
  6258.     else: #ATV
  6259.         try: os.system('killall AppleTV') # appletv
  6260.         except: pass
  6261.         try: os.system('sudo initctl stop kodi') #osmc/raspxbmc
  6262.         except: pass
  6263.         try: os.system('sudo initctl stop xbmc')
  6264.         except: pass
  6265.  
  6266.  
  6267.        
  6268. def freshstart():
  6269.  
  6270.  
  6271.     freshstartprompt = xbmcgui.Dialog().yesno(strings.getstring("areswizard"), strings.getstring("buildinstallfreshstart1"), '', strings.getstring("buildinstallfreshstart2"), yeslabel='Yes',nolabel='No')
  6272.    
  6273.     if freshstartprompt == 1:
  6274.         manageaddon.freshstart()
  6275.  
  6276.         if debuglog == "true":
  6277.             print '----------------------------------'
  6278.             print '-->   kodi still running    <--'
  6279.             print '-----------------------------------'
  6280.    
  6281.         xbmc.executebuiltin("ReloadSkin()")
  6282.  
  6283.  
  6284.  
  6285.        
  6286. def repairbuild():
  6287.  
  6288.     global name
  6289.    
  6290.     result = manageaddon.restorebuild(name)
  6291.    
  6292.     if result == "kodirunning":
  6293.  
  6294.         if xbmc.getCondVisibility('system.platform.android'):
  6295.        
  6296.             hidecontrols()
  6297.             # buildinstallpng
  6298.             backimage.setImage(buildinstallpng)
  6299.             loginbutton.setEnabled(False)
  6300.             browsebuildsbutton.setEnabled(False)
  6301.             browseaddonsbutton.setEnabled(False)
  6302.             backupbutton.setEnabled(False)
  6303.             maintenancebutton.setEnabled(False)
  6304.             tweaksbutton.setEnabled(False)
  6305.             morebutton.setEnabled(False)
  6306.             settingsbutton.setEnabled(False)
  6307.             closebutton.setEnabled(False)
  6308.            
  6309.         else:
  6310.            
  6311.             dialog = xbmcgui.Dialog()
  6312.             dialog.ok(strings.getstring("areswizard"), strings.getstring("kodinotclosed"))
  6313.  
  6314.  
  6315.  
  6316. def close():
  6317.  
  6318.     window.close() 
  6319.  
  6320.    
  6321. def bakcupbuttonpush():
  6322.        
  6323.         hidecontrols()
  6324.        
  6325.         dialog = xbmcgui.Dialog()
  6326.         dialog.ok("Ares Wizard", "Sorry, backup feature isn't ready yet", "","")
  6327.  
  6328.  
  6329.    
  6330.  
  6331. backimage = pyxbmct.Image(os.path.join(images_path, 'back.png'))
  6332. window.placeControl(backimage, -50, -2, 655, 178)
  6333.  
  6334.  
  6335. #################### S L I d e R S ########################################################################################################################
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  # Slider value label
  6341. SLIDER1_INIT_VALUE = 90
  6342.  
  6343.  
  6344. # Slider
  6345. global slider1
  6346. slider1 = pyxbmct.Slider(textureback=slidertexture)
  6347. window.placeControl(slider1, 180, 90, 25, 60)
  6348. slider1.setPercent(SLIDER1_INIT_VALUE)
  6349. slider1.setVisible(False)
  6350. #Connect key and mouse events for slider update feedback.
  6351. window.connectEventList([pyxbmct.ACTION_MOVE_LEFT,
  6352.                        pyxbmct.ACTION_MOVE_RIGHT,
  6353.                        pyxbmct.ACTION_MOUSE_DRAG,
  6354.                        pyxbmct.ACTION_MOUSE_LEFT_CLICK],
  6355.                       list_update)
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362. tweakcache_page2intro = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("cachetweakfloowingsettings") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  6363. window.placeControl(tweakcache_page2intro, 80, 70, 60, 100)
  6364. tweakcache_page2intro.setVisible(False)
  6365.  
  6366.  
  6367. videcachesizelabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("videocachesize") + '[/COLOR]', 'font14')
  6368. window.placeControl(videcachesizelabel, 148, 106, 10, 30)
  6369. videcachesizelabel.setVisible(False)
  6370.  
  6371.  
  6372. currentramsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("currentsetting") + '[/COLOR]')
  6373. window.placeControl(currentramsetting, 195, 87, 10, 30)
  6374. currentramsetting.setVisible(False)
  6375.  
  6376. global slider1value
  6377. slider1value = pyxbmct.Label(str(SLIDER1_INIT_VALUE), alignment=pyxbmct.ALIGN_CENTER)
  6378. window.placeControl(slider1value, 214, 107)
  6379. slider1value.setVisible(False)
  6380.  
  6381. recommendedramsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recommendedsetting") + '[/COLOR]')
  6382. window.placeControl(recommendedramsetting, 195, 123, 10, 35)
  6383. recommendedramsetting.setVisible(False)
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392. ##### slider 2
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  # Slider value label
  6400. SLIDER2_INIT_VALUE = 50
  6401.  
  6402.  
  6403. # Slider
  6404. global slider2
  6405. slider2 = pyxbmct.Slider(textureback=slidertexture)
  6406. window.placeControl(slider2, 270, 90, 25, 60)
  6407. slider2.setPercent(SLIDER2_INIT_VALUE)
  6408. slider2.setVisible(False)
  6409. #Connect key and mouse events for slider update feedback.
  6410. window.connectEventList([pyxbmct.ACTION_MOVE_LEFT,
  6411.                        pyxbmct.ACTION_MOVE_RIGHT,
  6412.                        pyxbmct.ACTION_MOUSE_DRAG,
  6413.                        pyxbmct.ACTION_MOUSE_LEFT_CLICK],
  6414.                       list_update)
  6415.  
  6416.  
  6417.  
  6418.  
  6419.  
  6420.  
  6421. curltimelabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("curltimelabeltext") + '[/COLOR]', 'font14')
  6422. window.placeControl(curltimelabel, 238, 109, 10, 30)
  6423. curltimelabel.setVisible(False)
  6424.  
  6425.  
  6426. currentcurlsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("currentsetting") + '[/COLOR]')
  6427. window.placeControl(currentcurlsetting, 285, 87, 10, 30)
  6428. currentcurlsetting.setVisible(False)
  6429.  
  6430. global slider2value
  6431. slider2value = pyxbmct.Label('[COLOR=darkgray]' + str(SLIDER2_INIT_VALUE)+ '[/COLOR]', alignment=pyxbmct.ALIGN_CENTER)
  6432. window.placeControl(slider2value, 304, 107)
  6433. slider2value.setVisible(False)
  6434.  
  6435. recommendedcurlsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recommendedsettingcurl") + '[/COLOR]')
  6436. window.placeControl(recommendedcurlsetting, 285, 123, 10, 35)
  6437. recommendedcurlsetting.setVisible(False)
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443. #### slider 3
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  # Slider value label
  6452. SLIDER3_INIT_VALUE = 50
  6453.  
  6454.  
  6455. # Slider
  6456. global slider3
  6457. slider3 = pyxbmct.Slider(textureback=slidertexture)
  6458. window.placeControl(slider3, 360, 90, 25, 60)
  6459. slider3.setPercent(SLIDER3_INIT_VALUE)
  6460. slider3.setVisible(False)
  6461. #Connect key and mouse events for slider update feedback.
  6462. window.connectEventList([pyxbmct.ACTION_MOVE_LEFT,
  6463.                        pyxbmct.ACTION_MOVE_RIGHT,
  6464.                        pyxbmct.ACTION_MOUSE_DRAG,
  6465.                        pyxbmct.ACTION_MOUSE_LEFT_CLICK],
  6466.                       list_update)
  6467.  
  6468.  
  6469.  
  6470. # +90
  6471.  
  6472.  
  6473.  
  6474. readbufferfactorlabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("readbufferfactorlabel") + '[/COLOR]', 'font14')
  6475. window.placeControl(readbufferfactorlabel, 328, 105, 10, 30)
  6476. readbufferfactorlabel.setVisible(False)
  6477.  
  6478.  
  6479. currentrbfsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("currentsetting") + '[/COLOR]')
  6480. window.placeControl(currentrbfsetting, 375, 87, 10, 30)
  6481. currentrbfsetting.setVisible(False)
  6482.  
  6483. global slider3value
  6484. slider3value = pyxbmct.Label('[COLOR=darkgray]' + str(SLIDER3_INIT_VALUE) + '[/COLOR]', alignment=pyxbmct.ALIGN_CENTER)
  6485. window.placeControl(slider3value, 394, 107)
  6486. slider3value.setVisible(False)
  6487.  
  6488. recommendedrbfsetting = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recommendedrbfsetting") + '[/COLOR]')
  6489. window.placeControl(recommendedrbfsetting, 375, 123, 10, 35)
  6490. recommendedrbfsetting.setVisible(False)
  6491.  
  6492.  
  6493. slider3.setVisible(False)
  6494. readbufferfactorlabel.setVisible(False)
  6495. currentrbfsetting.setVisible(False)
  6496. slider3value.setVisible(False)
  6497. recommendedrbfsetting.setVisible(False)
  6498.  
  6499.  
  6500.  
  6501. global speedtestprevlabel
  6502. speedtestprevlabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("speedtestprevlabel") + '[/COLOR]')
  6503. window.placeControl(speedtestprevlabel, 360, 108, 10, 34)
  6504. speedtestprevlabel.setVisible(False)
  6505.  
  6506.  
  6507.  
  6508. ################### R A d I O   b U T T O N S ##########################################################################################
  6509.  
  6510.  
  6511. buffermodelabel = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("buffermodelabel") + '[/COLOR]', 'font14')
  6512. window.placeControl(buffermodelabel, 418, 108, columnspan=25, rowspan=30)
  6513. buffermodelabel.setVisible(False)
  6514.  
  6515.  
  6516. mode1radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]1[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6517. window.placeControl(mode1radiobutton, 458, 83, columnspan=13, rowspan=40)
  6518. window.connect(mode1radiobutton, radio1_update)
  6519. mode1radiobutton.setVisible(False)
  6520.  
  6521.  
  6522. mode2radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]2->(Recommended)[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6523. window.placeControl(mode2radiobutton, 458, 95, columnspan=35, rowspan=40)
  6524. window.connect(mode2radiobutton, radio2_update)
  6525. mode2radiobutton.setVisible(False)
  6526.  
  6527. mode3radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]3[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6528. window.placeControl(mode3radiobutton, 458, 129, columnspan=13, rowspan=40)
  6529. window.connect(mode3radiobutton, radio3_update)
  6530. mode3radiobutton.setVisible(False)
  6531.  
  6532. mode4radiobutton = pyxbmct.RadioButton('[COLOR=goldenrod]4[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6533. window.placeControl(mode4radiobutton, 458, 141, columnspan=13, rowspan=40)
  6534. window.connect(mode4radiobutton, radio4_update)
  6535. mode4radiobutton.setVisible(False)
  6536.  
  6537.  
  6538.  
  6539.  
  6540. automaintenanceradio = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("automaintenanceradio") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6541. window.placeControl(automaintenanceradio, 410, 6, columnspan=78, rowspan=43)
  6542. window.connect(automaintenanceradio, automaintenanceradio_update)
  6543. automaintenanceradio.setVisible(False)
  6544.  
  6545.  
  6546. automaintenancefreqeverytime = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("automaintenancefreqeverytime") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6547. window.placeControl(automaintenancefreqeverytime, 505, 6, columnspan=22, rowspan=43)
  6548. window.connect(automaintenancefreqeverytime, automaintenancefreqeverytime_update)
  6549. automaintenancefreqeverytime.setVisible(False)
  6550. automaintenancefreqeverytime.setEnabled(False)
  6551.  
  6552.  
  6553. automaintenancefreqdaily = pyxbmct.RadioButton('[COLOR=goldenrod]Daily[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6554. window.placeControl(automaintenancefreqdaily, 505, 27, columnspan=18, rowspan=43)
  6555. window.connect(automaintenancefreqdaily, automaintenancefreqdaily_update)
  6556. automaintenancefreqdaily.setVisible(False)
  6557. automaintenancefreqdaily.setEnabled(False)
  6558.  
  6559.  
  6560. automaintenancefreqweekly = pyxbmct.RadioButton('[COLOR=goldenrod]Weekly[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6561. window.placeControl(automaintenancefreqweekly, 505, 45, columnspan=19, rowspan=43)
  6562. window.connect(automaintenancefreqweekly, automaintenancefreqweekly_update)
  6563. automaintenancefreqweekly.setVisible(False)
  6564. automaintenancefreqweekly.setEnabled(False)
  6565.  
  6566.  
  6567. automaintenancefreqmonthly = pyxbmct.RadioButton('[COLOR=goldenrod]Monthly[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6568. window.placeControl(automaintenancefreqmonthly, 505, 64, columnspan=18, rowspan=43)
  6569. window.connect(automaintenancefreqmonthly, automaintenancefreqmonthly_update)
  6570. automaintenancefreqmonthly.setVisible(False)
  6571. automaintenancefreqmonthly.setEnabled(False)
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580. fullautomaintenanceradio = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("fullautomaintenanceradio") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6581. window.placeControl(fullautomaintenanceradio, 410, 90, columnspan=78, rowspan=43)
  6582. window.connect(fullautomaintenanceradio, fullautomaintenanceradio_update)
  6583. fullautomaintenanceradio.setVisible(False)
  6584.  
  6585.  
  6586.  
  6587. fullautomaintcacheradio = pyxbmct.RadioButton('[COLOR=goldenrod]Cache[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6588. window.placeControl(fullautomaintcacheradio, 475, 90, columnspan=26, rowspan=43)
  6589. window.connect(fullautomaintcacheradio, fullautomaintcacheradio_update)
  6590. fullautomaintcacheradio.setVisible(False)
  6591. fullautomaintcacheradio.setEnabled(False)
  6592.  
  6593. fullautomaintpackagesradio = pyxbmct.RadioButton('[COLOR=goldenrod]Packages[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6594. window.placeControl(fullautomaintpackagesradio, 475, 115, columnspan=27, rowspan=43)
  6595. window.connect(fullautomaintpackagesradio, fullautomaintpackagesradio_update)
  6596. fullautomaintpackagesradio.setVisible(False)
  6597. fullautomaintpackagesradio.setEnabled(False)
  6598.  
  6599. fullautomaintthumbradio = pyxbmct.RadioButton('[COLOR=goldenrod]Thumbnails[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6600. window.placeControl(fullautomaintthumbradio, 475, 141, columnspan=26, rowspan=43)
  6601. window.connect(fullautomaintthumbradio, fullautomaintthumbradio_update)
  6602. fullautomaintthumbradio.setVisible(False)
  6603. fullautomaintthumbradio.setEnabled(False)
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611. fullautomaintweekradio = pyxbmct.RadioButton('[COLOR=goldenrod]Week[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6612. window.placeControl(fullautomaintweekradio, 537, 90, columnspan=26, rowspan=43)
  6613. window.connect(fullautomaintweekradio, fullautomaintweekradio_update)
  6614. fullautomaintweekradio.setVisible(False)
  6615. fullautomaintweekradio.setEnabled(False)
  6616.  
  6617. fullautomaintmonthradio = pyxbmct.RadioButton('[COLOR=goldenrod]Month[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6618. window.placeControl(fullautomaintmonthradio, 537, 115, columnspan=27, rowspan=43)
  6619. window.connect(fullautomaintmonthradio, fullautomaintmonthradio_update)
  6620. fullautomaintmonthradio.setVisible(False)
  6621. fullautomaintmonthradio.setEnabled(False)
  6622.  
  6623. fullautomaintquarterradio = pyxbmct.RadioButton('[COLOR=goldenrod]Quarter[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6624. window.placeControl(fullautomaintquarterradio, 537, 141, columnspan=26, rowspan=43)
  6625. window.connect(fullautomaintquarterradio, fullautomaintquarterradio_update)
  6626. fullautomaintquarterradio.setVisible(False)
  6627. fullautomaintquarterradio.setEnabled(False)
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633. cacheinclude_genesis = pyxbmct.RadioButton('[COLOR=goldenrod]Genesis[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6634. window.placeControl(cacheinclude_genesis, 215, 122, columnspan=23, rowspan=40)
  6635. window.connect(cacheinclude_genesis, cacheinclude_genesis_update)
  6636. cacheinclude_genesis.setVisible(False)
  6637.  
  6638. cacheinclude_navix = pyxbmct.RadioButton('[COLOR=goldenrod]Navi-X[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6639. window.placeControl(cacheinclude_navix, 215, 144, columnspan=23, rowspan=40)
  6640. window.connect(cacheinclude_navix, cacheinclude_navix_update)
  6641. cacheinclude_navix.setVisible(False)
  6642.  
  6643. # cacheinclude_metahandler = pyxbmct.RadioButton('[COLOR=goldenrod]Metadata[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6644. # window.placeControl(cacheinclude_metahandler, 251, 122, columnspan=23, rowspan=40)
  6645. # window.connect(cacheinclude_metahandler, fullautomaintquarterradio_update)
  6646. # cacheinclude_metahandler.setVisible(False)
  6647.  
  6648. cacheinclude_youtube = pyxbmct.RadioButton('[COLOR=goldenrod]Youtube[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6649. window.placeControl(cacheinclude_youtube, 251, 122, columnspan=23, rowspan=40)
  6650. window.connect(cacheinclude_youtube, cacheinclude_youtube_update)
  6651. cacheinclude_youtube.setVisible(False)
  6652.  
  6653. cacheinclude_ivue = pyxbmct.RadioButton('[COLOR=goldenrod]iVue[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6654. window.placeControl(cacheinclude_ivue, 251, 144, columnspan=23, rowspan=40)
  6655. window.connect(cacheinclude_ivue, cacheinclude_ivue_update)
  6656. cacheinclude_ivue.setVisible(False)
  6657.  
  6658.  
  6659. cacheinclude_salts = pyxbmct.RadioButton('[COLOR=goldenrod]' + strings.getstring("salts") + '[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6660. window.placeControl(cacheinclude_salts, 287, 122, columnspan=23, rowspan=40)
  6661. window.connect(cacheinclude_salts, cacheinclude_salts_update)
  6662. cacheinclude_salts.setVisible(False)
  6663.  
  6664.  
  6665. cacheinclude_pulsar = pyxbmct.RadioButton('[COLOR=goldenrod]Pulsar[/COLOR]', noFocusTexture=listtexture, _alignment=6)
  6666. window.placeControl(cacheinclude_pulsar, 287, 144, columnspan=23, rowspan=40)
  6667. window.connect(cacheinclude_pulsar, cacheinclude_pulsar_update)
  6668. cacheinclude_pulsar.setVisible(False)
  6669.  
  6670.  
  6671.  
  6672.  
  6673.  
  6674.  
  6675. #################### b U T T O N S ########################################################################################################################
  6676.  
  6677.  
  6678. browsebuildsbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("browsebuildsbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6679. window.placeControl(browsebuildsbutton, 30, 2, columnspan=25, rowspan=50)
  6680. window.connect(browsebuildsbutton, lambda:
  6681.     showbuildmenu())
  6682.    
  6683.  
  6684.    
  6685.    
  6686.  
  6687.  
  6688. browseaddonsbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("browseaddonsbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6689. window.placeControl(browseaddonsbutton, 30, 26, columnspan=25, rowspan=50)
  6690. window.connect(browseaddonsbutton, lambda:
  6691.     showaddontypelist())
  6692.  
  6693.  
  6694.  
  6695. maintenancebutton = pyxbmct.Button('[COLOR=goldenrod]Maintenance[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6696. window.placeControl(maintenancebutton, 30, 50, columnspan=25, rowspan=50)
  6697. window.connect(maintenancebutton, lambda:
  6698.     maintenance2())
  6699.    
  6700.  
  6701. backupbutton = pyxbmct.Button('[COLOR=goldenrod]Backup[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6702. window.placeControl(backupbutton, 30, 74, columnspan=25, rowspan=50)
  6703. window.connect(backupbutton, lambda:
  6704.     bakcupbuttonpush())
  6705.    
  6706.  
  6707.  
  6708. tweaksbutton = pyxbmct.Button('[COLOR=goldenrod]Tweaks[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6709. window.placeControl(tweaksbutton, 30, 98, columnspan=25, rowspan=50)
  6710. window.connect(tweaksbutton, lambda:
  6711.     tweaks())
  6712.  
  6713. morebutton = pyxbmct.Button('[COLOR=goldenrod]More[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6714. window.placeControl(morebutton, 30, 122, columnspan=25, rowspan=50)
  6715. window.connect(morebutton, lambda:
  6716.     more())
  6717.  
  6718. settingsbutton = pyxbmct.Button('[COLOR=goldenrod]Settings[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6719. window.placeControl(settingsbutton, 30, 146, columnspan=25, rowspan=50)
  6720. window.connect(settingsbutton, lambda:
  6721.     xbmcaddon.Addon().openSettings())
  6722.  
  6723.  
  6724.    
  6725.    
  6726.    
  6727.    
  6728.    
  6729.    
  6730.    
  6731.    
  6732.    
  6733.    
  6734.    
  6735.    
  6736. freshstartbutton = pyxbmct.Button('[COLOR=goldenrod]Fresh Start[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6737. window.placeControl(freshstartbutton, 120, 71, columnspan=24, rowspan=50)
  6738. freshstartbutton.setVisible(False)
  6739. window.connect(freshstartbutton, lambda: freshstart())     
  6740.    
  6741.    
  6742.    
  6743.    
  6744.    
  6745.  
  6746. installbuildbutton = pyxbmct.Button('[COLOR=goldenrod]Install[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6747. window.placeControl(installbuildbutton, 180, 71, columnspan=24, rowspan=50)
  6748. installbuildbutton.setVisible(False)
  6749. window.connect(installbuildbutton, lambda: installbuild()) 
  6750.  
  6751.  
  6752.  
  6753. repairbuildbutton = pyxbmct.Button('[COLOR=goldenrod]Repair[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6754. window.placeControl(repairbuildbutton, 240, 71, columnspan=24, rowspan=50)
  6755. repairbuildbutton.setVisible(False)
  6756. window.connect(repairbuildbutton, lambda: repairbuild())
  6757.    
  6758.    
  6759.  
  6760.  
  6761. installaddonbutton = pyxbmct.Button('[COLOR=goldenrod]Install[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6762. window.placeControl(installaddonbutton, 120, 71, columnspan=24, rowspan=50)
  6763. installaddonbutton.setVisible(False)
  6764. window.connect(installaddonbutton, lambda: installbutton())
  6765.  
  6766.  
  6767.  
  6768.  
  6769. voteaddonbutton = pyxbmct.Button('[COLOR=goldenrod]Rate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6770. window.placeControl(voteaddonbutton, 180, 71, columnspan=24, rowspan=50)
  6771. voteaddonbutton.setVisible(False)
  6772. window.connect(voteaddonbutton, lambda: user.rateaddon(username, name, mac, deviceid))
  6773.  
  6774.  
  6775.  
  6776.  
  6777. voterepobutton = pyxbmct.Button('[COLOR=goldenrod]Rate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6778. window.placeControl(voterepobutton, 180, 71, columnspan=24, rowspan=50)
  6779. voterepobutton.setVisible(False)
  6780. window.connect(voterepobutton, lambda: user.raterepo(username, name, mac, deviceid))
  6781.  
  6782. votebuildbutton = pyxbmct.Button('[COLOR=goldenrod]Rate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6783. window.placeControl(votebuildbutton, 300, 71, columnspan=24, rowspan=50)
  6784. votebuildbutton.setVisible(False)
  6785. window.connect(votebuildbutton, lambda: user.ratebuild(username, selectname, mac, deviceid))
  6786.  
  6787.  
  6788.  
  6789.  
  6790. uninstalladdonbutton = pyxbmct.Button('[COLOR=goldenrod]Uninstall[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6791. window.placeControl(uninstalladdonbutton, 240, 71, columnspan=24, rowspan=50)
  6792. uninstalladdonbutton.setVisible(False)
  6793. window.connect(uninstalladdonbutton, lambda: uninstallbutton())
  6794.  
  6795.  
  6796.  
  6797.  
  6798. global addaddonbyrepobutton
  6799. addaddonbyrepobutton = pyxbmct.Button('[COLOR=goldenrod]Add[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6800. window.placeControl(addaddonbyrepobutton, 300, 71, columnspan=24, rowspan=50)  
  6801. addaddonbyrepobutton.setVisible(False)
  6802. window.connect(addaddonbyrepobutton, lambda:
  6803.     manageaddon.findaddoninrepo('add', username, deviceid, mac))
  6804.    
  6805.  
  6806. global updateaddonbutton   
  6807. updateaddonbutton = pyxbmct.Button('[COLOR=goldenrod]Update[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6808. window.placeControl(updateaddonbutton, 360, 71, columnspan=24, rowspan=50) 
  6809. updateaddonbutton.setVisible(False)
  6810. window.connect(updateaddonbutton, lambda:
  6811.     manageaddon.findaddoninrepo('update', username, deviceid, mac))
  6812.  
  6813.  
  6814.  
  6815.    
  6816.    
  6817.    
  6818.    
  6819.    
  6820.    
  6821.    
  6822.    
  6823.  
  6824.  
  6825. global deletethumbnailsbuttonv2
  6826. deletethumbnailsbuttonv2 = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("deletethumbnailsbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6827. window.placeControl(deletethumbnailsbuttonv2, 335, 10, columnspan=30, rowspan=50)
  6828. deletethumbnailsbuttonv2.setVisible(False)
  6829. window.connect(deletethumbnailsbuttonv2, lambda: deletethumbnails())
  6830.  
  6831.  
  6832. global deletepackagesbuttonv2
  6833. deletepackagesbuttonv2 = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("deletepackagesbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6834. window.placeControl(deletepackagesbuttonv2, 335, 51, columnspan=30, rowspan=50)
  6835. deletepackagesbuttonv2.setVisible(False)
  6836. window.connect(deletepackagesbuttonv2, lambda: deletepackages())
  6837.  
  6838.  
  6839. global deletecachebuttonv2
  6840. deletecachebuttonv2 = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("deletecachebutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6841. window.placeControl(deletecachebuttonv2, 335, 92, columnspan=30, rowspan=50)
  6842. deletecachebuttonv2.setVisible(False)
  6843. window.connect(deletecachebuttonv2, lambda: deletecache())
  6844.  
  6845.  
  6846.  
  6847. global tweakcache_page1button
  6848. tweakcache_page1button = pyxbmct.Button('[COLOR=goldenrod]Next[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6849. window.placeControl(tweakcache_page1button, 510, 108, columnspan=30, rowspan=50)
  6850. tweakcache_page1button.setVisible(False)
  6851. window.connect(tweakcache_page1button, lambda:
  6852.     tweakcache_page1())
  6853.    
  6854.    
  6855.  
  6856. global tweakcache_page2button
  6857. tweakcache_page2button = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("tweakcache_page2button") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6858. window.placeControl(tweakcache_page2button, 510, 105, columnspan=35, rowspan=50)
  6859. tweakcache_page2button.setVisible(False)
  6860. window.connect(tweakcache_page2button, lambda:
  6861.     tweakcache_page2())
  6862.  
  6863.  
  6864. global applycachetweakbutton
  6865. applycachetweakbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("applycachetweakbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6866. window.placeControl(applycachetweakbutton, 510, 103, columnspan=35, rowspan=50)
  6867. applycachetweakbutton.setVisible(False)
  6868. window.connect(applycachetweakbutton, lambda:
  6869.     applycachetweak(newcache, newcurl, newrbf, newbuffermode))
  6870.    
  6871.  
  6872.  
  6873.  
  6874.    
  6875. global loginbutton
  6876. loginbutton = pyxbmct.Button('[COLOR=goldenrod]Login[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6877. window.placeControl(loginbutton, -30, 2, columnspan=25, rowspan=50)
  6878. loginbutton.setVisible(False)
  6879. window.connect(loginbutton, lambda: login())
  6880. loginbutton.setVisible(False)
  6881.  
  6882.  
  6883. global activatebutton
  6884. activatebutton = pyxbmct.Button('[COLOR=goldenrod]Activate[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6885. window.placeControl(activatebutton, -30, 2, columnspan=25, rowspan=50)
  6886. activatebutton.setVisible(False)
  6887. window.connect(activatebutton, lambda: activate())
  6888. activatebutton.setVisible(False)
  6889.  
  6890.  
  6891.  
  6892. global logoutbutton
  6893. logoutbutton = pyxbmct.Button('[COLOR=goldenrod]Logout[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6894. window.placeControl(logoutbutton, -30, 2, columnspan=25, rowspan=50)
  6895. logoutbutton.setVisible(False)
  6896. window.connect(logoutbutton, lambda: logout())
  6897. logoutbutton.setVisible(False)
  6898.  
  6899.  
  6900. global closebutton
  6901. closebutton = pyxbmct.Button('[COLOR=goldenrod]Close[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6902. window.placeControl(closebutton, -30, 146, columnspan=25, rowspan=50)
  6903. closebutton.setVisible(True)
  6904. window.connect(closebutton, lambda: close())
  6905. closebutton.setVisible(True)
  6906.  
  6907.    
  6908.    
  6909.  
  6910. global unblockurlbutton
  6911. unblockurlbutton = pyxbmct.Button('[COLOR=goldenrod]' + strings.getstring("unblockurlbutton") + '[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6912. window.placeControl(unblockurlbutton, 390, 108, columnspan=30, rowspan=50)
  6913. unblockurlbutton.setVisible(False)
  6914. window.connect(unblockurlbutton, lambda: changeurl())  
  6915.  
  6916.  
  6917.  
  6918.  
  6919. global dospeedtestbutton
  6920. dospeedtestbutton = pyxbmct.Button('[COLOR=goldenrod]Start Test[/COLOR]', focusTexture=button_focus, noFocusTexture=button_default)
  6921. window.placeControl(dospeedtestbutton, 302, 108, columnspan=24, rowspan=50)
  6922. dospeedtestbutton.setVisible(False)
  6923. window.connect(dospeedtestbutton, lambda: speedtestfunc())
  6924.  
  6925. #######################################################################################################################################################
  6926.  
  6927.  
  6928. ################### L I S T S   ###################################################################################################################
  6929.    
  6930.    
  6931.    
  6932. buildlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6933. window.placeControl(buildlist, 110, 3, 500, 65)
  6934. buildlist.setVisible(False)
  6935. window.connect(buildlist, lambda: buildfeaturedselect())
  6936.  
  6937.  
  6938.  
  6939. buildmainlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6940. window.placeControl(buildmainlist, 110, 3, 500, 65)
  6941. buildmainlist.setVisible(False)
  6942. window.connect(buildmainlist, lambda: buildmainselect())
  6943.  
  6944.  
  6945.  
  6946. buildotherlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6947. window.placeControl(buildotherlist, 110, 3, 500, 65)
  6948. buildotherlist.setVisible(False)
  6949. window.connect(buildotherlist, lambda: buildtoherselect())
  6950.  
  6951.  
  6952. addonlist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6953. window.placeControl(addonlist, 110, 3, 500, 65)
  6954. addonlist.setVisible(False)
  6955. window.connect(addonlist, lambda: window.setFocus(installaddonbutton))
  6956.  
  6957.  
  6958. addontypelist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6959. window.placeControl(addontypelist, 110, 3, 500, 65)
  6960. addontypelist.setVisible(False)
  6961. window.connect(addontypelist, lambda: getaddons())
  6962.  
  6963.  
  6964. repolist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6965. window.placeControl(repolist, 110, 3, 500, 65)
  6966. repolist.setVisible(False)
  6967. window.connect(repolist, lambda: window.setFocus(installaddonbutton))
  6968.  
  6969.  
  6970.  
  6971.  
  6972. tweakslist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6973. window.placeControl(tweakslist, 110, 3, 500, 65)
  6974. tweakslist.setVisible(False)
  6975. window.connect(tweakslist, lambda: tweakslistselect())
  6976.  
  6977.  
  6978. morelist = pyxbmct.List('font14', '', buttonTexture=listtexture, _space=5, _itemHeight=35, _alignmentY=6)
  6979. window.placeControl(morelist, 110, 3, 500, 65)
  6980. morelist.setVisible(False)
  6981. window.connect(morelist, lambda: morelistselect())
  6982.  
  6983.  
  6984.  
  6985.  
  6986. ##########################################################################################################################################################
  6987.  
  6988.  
  6989. ############   I M A G e S ###############################################################################################################################
  6990.  
  6991.  
  6992.  
  6993.  
  6994. global windowimage
  6995. windowimage = pyxbmct.Image('')
  6996. window.placeControl(windowimage, 110, 98, 265, 70)
  6997.  
  6998. global windowimage2
  6999. windowimage2 = pyxbmct.Image('')
  7000. window.placeControl(windowimage2, 110, 98, 265, 70)
  7001.  
  7002. global windowimage3
  7003. windowimage3 = pyxbmct.Image('')
  7004. window.placeControl(windowimage3, 110, 98, 265, 70)
  7005.  
  7006.  
  7007. global star1
  7008. star1 = pyxbmct.Image(star_image)
  7009. window.placeControl(star1, 439, 125, 10, 8)
  7010. star1.setVisible(False)
  7011.  
  7012. global star2
  7013. star2 = pyxbmct.Image(star_image)
  7014. window.placeControl(star2, 439, 131, 10, 8)
  7015. star2.setVisible(False)
  7016.  
  7017. global star3
  7018. star3 = pyxbmct.Image(star_image)
  7019. window.placeControl(star3, 439, 137, 10, 8)
  7020. star3.setVisible(False)
  7021.  
  7022. global star4
  7023. star4 = pyxbmct.Image(star_image)
  7024. window.placeControl(star4, 439, 143, 10, 8)
  7025. star4.setVisible(False)
  7026.  
  7027. global star5
  7028. star5 = pyxbmct.Image(star_image)
  7029. window.placeControl(star5, 439, 149, 10, 8)
  7030. star5.setVisible(False)
  7031.  
  7032. global splashimage
  7033. splashimage = pyxbmct.Image(splashfile)
  7034. window.placeControl(splashimage, 180, 40, 350, 100)
  7035. splashimage.setVisible(False)
  7036.  
  7037.  
  7038.  
  7039. global maintenanceimage
  7040. maintenanceimage = pyxbmct.Image(maintenanceimagepng)
  7041. window.placeControl(maintenanceimage, 100, 0, 500, 175)
  7042. maintenanceimage.setVisible(False)
  7043.  
  7044.  
  7045.  
  7046. global maint_thumb_green
  7047. maint_thumb_green = pyxbmct.Image(trafficgreen)
  7048. window.placeControl(maint_thumb_green, 120, 38, 70, 5)
  7049. maint_thumb_green.setVisible(False)
  7050.  
  7051. global maint_thumb_amber
  7052. maint_thumb_amber = pyxbmct.Image(trafficamber)
  7053. window.placeControl(maint_thumb_amber, 120, 38, 70, 5)
  7054. maint_thumb_amber.setVisible(False)
  7055.  
  7056. global maint_thumb_red
  7057. maint_thumb_red = pyxbmct.Image(trafficred)
  7058. window.placeControl(maint_thumb_red, 120, 38, 70, 5)
  7059. maint_thumb_red.setVisible(False)
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065. global maint_packages_green
  7066. maint_packages_green = pyxbmct.Image(trafficgreen)
  7067. window.placeControl(maint_packages_green, 120, 80, 70, 5)
  7068. maint_packages_green.setVisible(False)
  7069.  
  7070.  
  7071. global maint_packages_amber
  7072. maint_packages_amber = pyxbmct.Image(trafficamber)
  7073. window.placeControl(maint_packages_amber, 120, 80, 70, 5)
  7074. maint_packages_amber.setVisible(False)
  7075.  
  7076.  
  7077.  
  7078. global maint_packages_red
  7079. maint_packages_red = pyxbmct.Image(trafficred)
  7080. window.placeControl(maint_packages_red, 120, 80, 70, 5)
  7081. maint_packages_red.setVisible(False)
  7082.  
  7083.  
  7084.  
  7085.  
  7086. global maint_cache_green
  7087. maint_cache_green = pyxbmct.Image(trafficgreen)
  7088. window.placeControl(maint_cache_green, 120, 163, 70, 5)
  7089. maint_cache_green.setVisible(False)
  7090.  
  7091. global maint_cache_amber
  7092. maint_cache_amber = pyxbmct.Image(trafficamber)
  7093. window.placeControl(maint_cache_amber, 120, 163, 70, 5)
  7094. maint_cache_amber.setVisible(False)
  7095.  
  7096. global maint_cache_red
  7097. maint_cache_red = pyxbmct.Image(trafficred)
  7098. window.placeControl(maint_cache_red, 120, 163, 70, 5)
  7099. maint_cache_red.setVisible(False)
  7100.  
  7101.  
  7102.  
  7103.  
  7104. global speedtestimage
  7105. speedtestimage = pyxbmct.Image('')
  7106. window.placeControl(speedtestimage, 80, 85, 230, 70)
  7107. speedtestimage.setVisible(False)
  7108.  
  7109.  
  7110. global speedtestimage2
  7111. speedtestimage2 = pyxbmct.Image('')
  7112. window.placeControl(speedtestimage2, 400, 71, 172, 50)
  7113. speedtestimage2.setVisible(False)
  7114.  
  7115.  
  7116. global speedtestimage3
  7117. speedtestimage3 = pyxbmct.Image('')
  7118. window.placeControl(speedtestimage3, 400, 120, 172, 50)
  7119. speedtestimage3.setVisible(False)
  7120.  
  7121.  
  7122. global scrolldownimage
  7123. scrolldownimage = pyxbmct.Image(scrolldown)
  7124. window.placeControl(scrolldownimage, 555, 29, 30, 15)
  7125. scrolldownimage.setVisible(False)
  7126.  
  7127.  
  7128. ###########################################################################################################################################################
  7129.  
  7130.  
  7131.  
  7132. ##############   L A b e L S    #########################################################################################################################
  7133.  
  7134.  
  7135.  
  7136. global maint_totallocalfileslabel
  7137. maint_totallocalfileslabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("totalfilesdeleted") + '[/COLOR]', 'font14')
  7138. window.placeControl(maint_totallocalfileslabel, 75, 14, 190, 75)
  7139. maint_totallocalfileslabel.setVisible(False)
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146. global maint_totallocalspacelabel
  7147. maint_totallocalspacelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("totalspacegained") + '[/COLOR]', 'font14')
  7148. window.placeControl(maint_totallocalspacelabel, 75, 95, 190, 75)
  7149. maint_totallocalspacelabel.setVisible(False)
  7150.  
  7151.  
  7152.  
  7153.  
  7154. global cachetweak_1stline
  7155. cachetweak_1stline = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7156. window.placeControl(cachetweak_1stline, 20, 85, 190, 75)
  7157. cachetweak_1stline.setVisible(False)
  7158.  
  7159.  
  7160. global cachetweak_2ndline
  7161. cachetweak_2ndline = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7162. window.placeControl(cachetweak_2ndline, 55, 75, 260, 100)
  7163. cachetweak_2ndline.setVisible(False)
  7164.  
  7165.  
  7166.  
  7167.  
  7168.  
  7169.  
  7170.  
  7171. global introlabel
  7172. introlabel = pyxbmct.Label('', 'font16', alignment=pyxbmct.ALIGN_CENTER)
  7173. window.placeControl(introlabel, 120, 20, 10, 135)
  7174.  
  7175.  
  7176. global namelabel
  7177. namelabel = pyxbmct.Label(' ', alignment=pyxbmct.ALIGN_CENTER)
  7178. window.placeControl(namelabel, 385, 98, 10, 70)
  7179. namelabel.setVisible(False)
  7180.  
  7181. global authorlabel
  7182. authorlabel = pyxbmct.Label(' ', alignment=pyxbmct.ALIGN_CENTER)
  7183. window.placeControl(authorlabel, 410, 98, 10, 70)
  7184. authorlabel.setVisible(False)
  7185.  
  7186.  
  7187. global ratingtextlabel
  7188. ratingtextlabel = pyxbmct.Label('[COLOR=darkgray]Rating:[/COLOR]')
  7189. window.placeControl(ratingtextlabel, 435, 115, 10, 13)
  7190. ratingtextlabel.setVisible(False)
  7191.  
  7192.  
  7193.  
  7194.  
  7195. global downloadstextlabel
  7196. downloadstextlabel = pyxbmct.Label('[COLOR=darkgray]Downloads:[/COLOR]')
  7197. window.placeControl(downloadstextlabel, 466, 115, 10, 20)
  7198. downloadstextlabel.setVisible(False)
  7199.  
  7200.  
  7201. global downloadslabel
  7202. downloadslabel = pyxbmct.Label(' ')
  7203. window.placeControl(downloadslabel, 466, 131, 10, 13)
  7204. downloadslabel.setVisible(False)
  7205.  
  7206.  
  7207.  
  7208.  
  7209. global votestextlabel
  7210. votestextlabel = pyxbmct.Label('[COLOR=darkgray]Votes:[/COLOR]')
  7211. window.placeControl(votestextlabel, 466, 143, 10, 13)
  7212. votestextlabel.setVisible(False)
  7213.  
  7214.  
  7215. global voteslabel
  7216. voteslabel = pyxbmct.Label(' ')
  7217. window.placeControl(voteslabel, 466, 153, 10, 13)
  7218. voteslabel.setVisible(False)
  7219.  
  7220.  
  7221. global sizetextlabel
  7222. sizetextlabel = pyxbmct.Label('[COLOR=darkgray]Size(MB):[/COLOR]')
  7223. window.placeControl(sizetextlabel, 495, 117, 10, 18)
  7224. sizetextlabel.setVisible(False)
  7225.  
  7226.  
  7227. global sizelabel
  7228. sizelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("pressonbuild") + '[/COLOR]')
  7229. window.placeControl(sizelabel, 495, 131, 10, 40)
  7230. sizelabel.setVisible(False)
  7231.  
  7232.  
  7233.  
  7234. global statustextlabel
  7235. statustextlabel = pyxbmct.Label('[COLOR=darkgray]Status:[/COLOR]')
  7236. window.placeControl(statustextlabel, 495, 118, 10, 13)
  7237. statustextlabel.setVisible(False)
  7238.  
  7239. global statuslabel
  7240. statuslabel = pyxbmct.Label(' ')
  7241. window.placeControl(statuslabel, 495, 128, 10, 40)
  7242. statuslabel.setVisible(False)
  7243.  
  7244. ##### NOT USED #########################################################################################################   
  7245. global recversiontextlabel
  7246. recversiontextlabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("recversiontextlabel") + '[/COLOR]')
  7247. window.placeControl(recversiontextlabel, 520, 113, 10, 34)
  7248. recversiontextlabel.setVisible(False)
  7249.  
  7250. global recversionlabel
  7251. recversionlabel = pyxbmct.Label('')
  7252. window.placeControl(recversionlabel, 520, 144, 10, 34)
  7253. recversionlabel.setVisible(False)
  7254. ####################################################################################################################################                   
  7255.  
  7256. global installedversiontextlabel
  7257. installedversiontextlabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("installedversiontextlabel") + '[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7258. window.placeControl(installedversiontextlabel, 520, 110, 10, 34)
  7259. installedversiontextlabel.setVisible(False)
  7260.  
  7261. global installedversionlabel
  7262. installedversionlabel = pyxbmct.Label('')
  7263. window.placeControl(installedversionlabel, 520, 144, 10, 34)
  7264. installedversionlabel.setVisible(False)
  7265.  
  7266.  
  7267. global deletepackageslabel
  7268. deletepackageslabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("deletepackageslabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7269. window.placeControl(deletepackageslabel, 80, 72, 250, 102)
  7270. deletepackageslabel.setVisible(False)
  7271.  
  7272.  
  7273. global deletethumbnailslabel
  7274. deletethumbnailslabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("deletethumbnailslabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7275. window.placeControl(deletethumbnailslabel, 80, 72, 310, 102)
  7276. deletethumbnailslabel.setVisible(False)
  7277.  
  7278.  
  7279. global deletecachelabel
  7280. deletecachelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("deletecachelabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7281. window.placeControl(deletecachelabel, 80, 72, 430, 102)
  7282. deletecachelabel.setVisible(False)
  7283.  
  7284.  
  7285. global maintenancelabel
  7286. maintenancelabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("maintenancelabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7287. window.placeControl(maintenancelabel, 80, 64, 460, 115)
  7288. maintenancelabel.setVisible(False)
  7289.  
  7290.  
  7291. global tweakcachelabel1
  7292. tweakcachelabel1 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("tweakcachelabel1") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7293. window.placeControl(tweakcachelabel1, 80, 64, 450, 115)
  7294. tweakcachelabel1.setVisible(False)
  7295.  
  7296.  
  7297. global tweakcachelabel2
  7298. tweakcachelabel2 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7299. window.placeControl(tweakcachelabel2, 90, 75, 440, 100)
  7300. tweakcachelabel2.setVisible(False)
  7301.  
  7302. global tweakcachelabel3
  7303. tweakcachelabel3 = pyxbmct.Label('[COLOR=lightgray]' + strings.getstring("tweakcachelabel3") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7304. window.placeControl(tweakcachelabel3, 200, 75, 440, 100)
  7305. tweakcachelabel3.setVisible(False)
  7306.  
  7307.  
  7308.  
  7309. global automaintenancelabel1
  7310. automaintenancelabel1 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("automaintenancelabel1") + '[/COLOR]', 'font14')
  7311. window.placeControl(automaintenancelabel1, 460, 7, 10, 105)
  7312. automaintenancelabel1.setVisible(False)
  7313. automaintenancelabel1.setEnabled(False)
  7314.  
  7315.  
  7316. global fullyautomaintenancelabel1
  7317. fullyautomaintenancelabel1 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("fullautomaintenancelabel1") + '[/COLOR]', 'font14')
  7318. window.placeControl(fullyautomaintenancelabel1, 443, 110, 10, 105)
  7319. fullyautomaintenancelabel1.setVisible(False)
  7320. fullyautomaintenancelabel1.setEnabled(False)
  7321.  
  7322. global fullyautomaintenancelabel2
  7323. fullyautomaintenancelabel2 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("fullyautomaintenancelabel2") + '[/COLOR]', 'font14')
  7324. window.placeControl(fullyautomaintenancelabel2, 505, 123, 10, 105)
  7325. fullyautomaintenancelabel2.setVisible(False)
  7326. fullyautomaintenancelabel2.setEnabled(False)
  7327.  
  7328.  
  7329. # global automaintenancelabel2
  7330. # automaintenancelabel2 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("automaintenancelabel2") + '[/COLOR]', 'font14')
  7331. # window.placeControl(automaintenancelabel2, 95, 70, 10, 80)
  7332. # automaintenancelabel2.setVisible(False)
  7333.  
  7334.  
  7335. global unblocklabel
  7336. unblocklabel = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("unblocklabel") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7337. window.placeControl(unblocklabel, 95, 70, 100, 105)
  7338. unblocklabel.setVisible(False)
  7339.  
  7340. global unblocklabel2
  7341. unblocklabel2 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7342. window.placeControl(unblocklabel2, 170, 70, 100, 105)
  7343. unblocklabel2.setVisible(False)
  7344.  
  7345.  
  7346. global unblocklabel3
  7347. unblocklabel3 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7348. window.placeControl(unblocklabel3, 200, 70, 100, 105)
  7349. unblocklabel3.setVisible(False)
  7350.  
  7351.  
  7352. global unblocklabel4
  7353. unblocklabel4 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("unblocklabel4") + '[/COLOR]', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7354. window.placeControl(unblocklabel4, 270, 70, 100, 105)
  7355. unblocklabel4.setVisible(False)
  7356.  
  7357.  
  7358. global unblocklabel5
  7359. unblocklabel5 = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7360. window.placeControl(unblocklabel5, 300, 70, 100, 105)
  7361. unblocklabel5.setVisible(False)
  7362.  
  7363.  
  7364. global unblocklabelbad
  7365. unblocklabelbad = pyxbmct.Label('', 'font14', alignment=pyxbmct.ALIGN_CENTER)
  7366. window.placeControl(unblocklabelbad, 170, 70, 100, 105)
  7367. unblocklabelbad.setVisible(False)
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376. global maint_thumb_label
  7377. maint_thumb_label = pyxbmct.Label('[COLOR=darkgray]Thumbnails[/COLOR]', 'font14')
  7378. window.placeControl(maint_thumb_label, 138, 18, 30, 40)
  7379. maint_thumb_label.setVisible(False)
  7380.  
  7381.  
  7382. global maint_thumb_label2
  7383. maint_thumb_label2 = pyxbmct.Label('[COLOR=darkgray]Files:[/COLOR]', 'font14')
  7384. window.placeControl(maint_thumb_label2, 205, 17, 30, 40)
  7385. maint_thumb_label2.setVisible(False)
  7386.  
  7387.  
  7388. global maint_thumb_label3
  7389. maint_thumb_label3 = pyxbmct.Label('[COLOR=darkgray]Size:[/COLOR]', 'font14')
  7390. window.placeControl(maint_thumb_label3, 235, 17, 30, 40)
  7391. maint_thumb_label3.setVisible(False)
  7392.  
  7393.  
  7394. global maint_thumb_label4
  7395. maint_thumb_label4 = pyxbmct.Label('', 'font14')
  7396. window.placeControl(maint_thumb_label4, 205, 25, 30, 40)
  7397. maint_thumb_label4.setVisible(False)
  7398.  
  7399.  
  7400. global maint_thumb_label5
  7401. maint_thumb_label5 = pyxbmct.Label('', 'font14')
  7402. window.placeControl(maint_thumb_label5, 235, 25, 30, 40)
  7403. maint_thumb_label5.setVisible(False)
  7404.  
  7405.  
  7406.  
  7407.  
  7408.  
  7409. global maint_packages_label
  7410. maint_packages_label = pyxbmct.Label('[COLOR=darkgray]Packages[/COLOR]', 'font14')
  7411. window.placeControl(maint_packages_label, 138, 61, 30, 40)
  7412. maint_packages_label.setVisible(False)
  7413.  
  7414.  
  7415. global maint_packages_label2
  7416. maint_packages_label2 = pyxbmct.Label('[COLOR=darkgray]Files:[/COLOR]', 'font14')
  7417. window.placeControl(maint_packages_label2, 205, 58, 30, 40)
  7418. maint_packages_label2.setVisible(False)
  7419.  
  7420.  
  7421. global maint_packages_label3
  7422. maint_packages_label3 = pyxbmct.Label('[COLOR=darkgray]Size:[/COLOR]', 'font14')
  7423. window.placeControl(maint_packages_label3, 235, 58, 30, 40)
  7424. maint_packages_label3.setVisible(False)
  7425.  
  7426.  
  7427. global maint_packages_label4
  7428. maint_packages_label4 = pyxbmct.Label('', 'font14')
  7429. window.placeControl(maint_packages_label4, 205, 66, 30, 40)
  7430. maint_packages_label4.setVisible(False)
  7431.  
  7432.  
  7433. global maint_packages_label5
  7434. maint_packages_label5 = pyxbmct.Label('', 'font14')
  7435. window.placeControl(maint_packages_label5, 235, 66, 30, 40)
  7436. maint_packages_label5.setVisible(False)
  7437.  
  7438.  
  7439.  
  7440.  
  7441.  
  7442.  
  7443. global maint_cache_label
  7444. maint_cache_label = pyxbmct.Label('[COLOR=darkgray]Cache[/COLOR]', 'font14')
  7445. window.placeControl(maint_cache_label, 125, 123, 30, 40)
  7446. maint_cache_label.setVisible(False)
  7447.  
  7448.  
  7449. global maint_cache_label2
  7450. maint_cache_label2 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("cachelabeltemp") + '[/COLOR]', 'font14')
  7451. window.placeControl(maint_cache_label2, 145, 116, 30, 40)
  7452. maint_cache_label2.setVisible(False)
  7453.  
  7454.  
  7455. global maint_cache_label3
  7456. maint_cache_label3 = pyxbmct.Label('[COLOR=darkgray]Files:[/COLOR]', 'font14')
  7457. window.placeControl(maint_cache_label3, 205, 98, 30, 40)
  7458. maint_cache_label3.setVisible(False)
  7459.  
  7460.  
  7461. global maint_cache_label4
  7462. maint_cache_label4 = pyxbmct.Label('[COLOR=darkgray]Size:[/COLOR]', 'font14')
  7463. window.placeControl(maint_cache_label4, 235, 98, 30, 40)
  7464. maint_cache_label4.setVisible(False)
  7465.  
  7466.  
  7467. global maint_cache_label5
  7468. maint_cache_label5 = pyxbmct.Label('', 'font14')
  7469. window.placeControl(maint_cache_label5, 205, 106, 30, 40)
  7470. maint_cache_label5.setVisible(False)
  7471.  
  7472.  
  7473. global maint_cache_label6
  7474. maint_cache_label6 = pyxbmct.Label('', 'font14')
  7475. window.placeControl(maint_cache_label6, 235, 106, 30, 40)
  7476. maint_cache_label6.setVisible(False)
  7477.  
  7478. global maint_cache_label7
  7479. maint_cache_label7 = pyxbmct.Label('[COLOR=darkgray]' + strings.getstring("cachelabelinclude") + '[/COLOR]', 'font14')
  7480. window.placeControl(maint_cache_label7, 184, 131, 30, 40)
  7481. maint_cache_label7.setVisible(False)
  7482.  
  7483.  
  7484.  
  7485.  
  7486.  
  7487.  
  7488.  
  7489.  
  7490.  
  7491.  
  7492.  
  7493.  
  7494.  
  7495.  
  7496. kerneltextlabel = pyxbmct.Label('[COLOR=lightgray]Kernel:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7497. window.placeControl(kerneltextlabel, 90, 20, columnspan=1)
  7498. kerneltextlabel.setVisible(False)
  7499.  
  7500. kernellabel = pyxbmct.Label('[COLOR=lightgray]' + kernel + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7501. window.placeControl(kernellabel, 90, 31, columnspan=1)
  7502. kernellabel.setVisible(False)
  7503.  
  7504. cpufreqtextlabel = pyxbmct.Label('[COLOR=lightgray]CPU Frequency:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7505. window.placeControl(cpufreqtextlabel, 120, 8, columnspan=1)
  7506. cpufreqtextlabel.setVisible(False)
  7507.  
  7508. cpufreqlabel = pyxbmct.Label('[COLOR=lightgray]' + cpufreq + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7509. window.placeControl(cpufreqlabel, 120, 31, columnspan=1)
  7510. cpufreqlabel.setVisible(False)
  7511.  
  7512. gputextlabel = pyxbmct.Label('[COLOR=lightgray]GPU:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7513. window.placeControl(gputextlabel, 150, 22, columnspan=1)
  7514. gputextlabel.setVisible(False)
  7515.  
  7516. gpulabel = pyxbmct.Label('[COLOR=lightgray]' + gpu + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7517. window.placeControl(gpulabel, 150, 31, columnspan=1)
  7518. gpulabel.setVisible(False)
  7519.  
  7520. kodiversiontextlabel = pyxbmct.Label('[COLOR=lightgray] Kodi Version:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7521. window.placeControl(kodiversiontextlabel, 200, 11, columnspan=1)
  7522. kodiversiontextlabel.setVisible(False)
  7523.  
  7524. kodiversionlabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.BuildVersion') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7525. window.placeControl(kodiversionlabel, 200, 31, columnspan=1)
  7526. kodiversionlabel.setVisible(False)
  7527.  
  7528. kodibuildtextlabel = pyxbmct.Label('[COLOR=lightgray]Kodi Build Date:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7529. window.placeControl(kodibuildtextlabel, 230, 8, columnspan=1)
  7530. kodibuildtextlabel.setVisible(False)
  7531.  
  7532. kodibuildlabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.BuildDate') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7533. window.placeControl(kodibuildlabel, 230, 31, columnspan=1)
  7534. kodibuildlabel.setVisible(False)
  7535.  
  7536. screenmodetextlabel = pyxbmct.Label('[COLOR=lightgray]Screen Mode:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7537. window.placeControl(screenmodetextlabel, 280, 11, columnspan=1)
  7538. screenmodetextlabel.setVisible(False)
  7539.  
  7540. screenmodelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.ScreenMode') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7541. window.placeControl(screenmodelabel, 280, 31, columnspan=1)
  7542. screenmodelabel.setVisible(False)
  7543.  
  7544. networkstatetextlabel = pyxbmct.Label('[COLOR=lightgray]Network State:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7545. window.placeControl(networkstatetextlabel, 330, 10, columnspan=1)
  7546. networkstatetextlabel.setVisible(False)
  7547.  
  7548. networkstatelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.LinkState') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7549. window.placeControl(networkstatelabel, 330, 31, columnspan=1)
  7550. networkstatelabel.setVisible(False)
  7551.  
  7552. internaliptextlabel = pyxbmct.Label('[COLOR=lightgray] Internal IP Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7553. window.placeControl(internaliptextlabel, 360, 3, columnspan=1)
  7554. internaliptextlabel.setVisible(False)
  7555.  
  7556. internaliplabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.IPAddress') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7557. window.placeControl(internaliplabel, 360, 31, columnspan=1)
  7558. internaliplabel.setVisible(False)
  7559.  
  7560. macaddresstextlabel = pyxbmct.Label('[COLOR=lightgray]Mac Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7561. window.placeControl(macaddresstextlabel, 410, 11, columnspan=1)
  7562. macaddresstextlabel.setVisible(False)
  7563.  
  7564. macaddresslabel = pyxbmct.Label('[COLOR=lightgray]' + mac + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7565. window.placeControl(macaddresslabel, 410, 31, columnspan=1)
  7566. macaddresslabel.setVisible(False)
  7567.  
  7568. gatewaytextlabel = pyxbmct.Label('[COLOR=lightgray]Gateway IP Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7569. window.placeControl(gatewaytextlabel, 440, 2, columnspan=1)
  7570. gatewaytextlabel.setVisible(False)
  7571.  
  7572. gatewaylabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.GatewayAddress') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7573. window.placeControl(gatewaylabel, 440, 31, columnspan=1)
  7574. gatewaylabel.setVisible(False)
  7575.  
  7576. dnstextlabel = pyxbmct.Label('[COLOR=lightgray]Network DNS Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7577. window.placeControl(dnstextlabel, 470, 0, columnspan=1)
  7578. dnstextlabel.setVisible(False)
  7579.  
  7580. dnslabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('Network.DNS1Address') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7581. window.placeControl(dnslabel, 470, 31, columnspan=1)
  7582. dnslabel.setVisible(False)
  7583.  
  7584. interetstatetextlabel = pyxbmct.Label('[COLOR=lightgray]Internet State:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7585. window.placeControl(interetstatetextlabel, 520, 11, columnspan=1)
  7586. interetstatetextlabel.setVisible(False)
  7587.  
  7588. internetstatelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.InternetState') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7589. # Place the label on the window grid.
  7590. window.placeControl(internetstatelabel, 520, 31, columnspan=1)
  7591. internetstatelabel.setVisible(False)
  7592.  
  7593.  
  7594. cputemptextlabel = pyxbmct.Label('[COLOR=lightgray]CPU Temp:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7595. window.placeControl(cputemptextlabel, 90, 110, columnspan=1)
  7596. cputemptextlabel.setVisible(False)
  7597.  
  7598. cputemplabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.CPUTemperature') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7599. window.placeControl(cputemplabel, 90, 127, columnspan=1)
  7600. cputemplabel.setVisible(False)
  7601.  
  7602. cpuuseagetextlabel = pyxbmct.Label('[COLOR=lightgray]CPU Useage:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7603. window.placeControl(cpuuseagetextlabel, 120, 108, columnspan=1)
  7604. cpuuseagetextlabel.setVisible(False)
  7605.  
  7606. cpuusagelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.CpuUsage') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7607. window.placeControl(cpuusagelabel, 120, 127, columnspan=40, rowspan=1)
  7608. cpuusagelabel.setVisible(False)
  7609.  
  7610. freestoragetextlabel = pyxbmct.Label('[COLOR=lightgray]Free Storage Space:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7611. window.placeControl(freestoragetextlabel, 170, 99, columnspan=1)
  7612. freestoragetextlabel.setVisible(False)
  7613.  
  7614. freestoragelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.FreeSpace') + ' (' + xbmc.getInfoLabel('System.FreeSpacePercent') + ')' + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7615. window.placeControl(freestoragelabel, 170, 127, columnspan=1)
  7616. freestoragelabel.setVisible(False)
  7617.  
  7618. usedstoragetextlabel = pyxbmct.Label('[COLOR=lightgray]Used Storage Space:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7619. window.placeControl(usedstoragetextlabel, 200, 98, columnspan=1)
  7620. usedstoragetextlabel.setVisible(False)
  7621.  
  7622. usedstoragelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.UsedSpace') + ' (' + xbmc.getInfoLabel('System.UsedSpacePercent') + ')' + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7623. window.placeControl(usedstoragelabel, 200, 127, columnspan=1)
  7624. usedstoragelabel.setVisible(False)
  7625.  
  7626. totalstoragetextlabel = pyxbmct.Label('[COLOR=lightgray]Total Storage Space:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7627. window.placeControl(totalstoragetextlabel, 230, 98, columnspan=1)
  7628. totalstoragetextlabel.setVisible(False)
  7629.  
  7630. totalstoragelabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.TotalSpace') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7631. window.placeControl(totalstoragelabel, 230, 127, columnspan=1)
  7632. totalstoragelabel.setVisible(False)
  7633.  
  7634. freeramtextlabel = pyxbmct.Label('[COLOR=lightgray] Free RAM Memory:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7635. window.placeControl(freeramtextlabel, 280, 100, columnspan=1)
  7636. freeramtextlabel.setVisible(False)
  7637.  
  7638. freeramlabel = pyxbmct.Label('[COLOR=lightgray]' + xbmc.getInfoLabel('System.FreeMemory') + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7639. window.placeControl(freeramlabel, 280, 127, columnspan=1)
  7640. freeramlabel.setVisible(False)
  7641.  
  7642. externaliptextlabel = pyxbmct.Label('[COLOR=lightgray]External IP Address:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7643. window.placeControl(externaliptextlabel, 330, 99, columnspan=1)
  7644. externaliptextlabel.setVisible(False)
  7645.  
  7646. #externaliplabel = pyxbmct.Label('[COLOR=lightgray]' + ip + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7647. externaliplabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7648. window.placeControl(externaliplabel, 330, 127, columnspan=1)
  7649. externaliplabel.setVisible(False)
  7650.  
  7651. isptextlabel = pyxbmct.Label('[COLOR=lightgray] ISP : [/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7652. window.placeControl(isptextlabel, 360, 119, columnspan=1)
  7653. isptextlabel.setVisible(False)
  7654.  
  7655. #isplabel = pyxbmct.Label('[COLOR=lightgray]' + isp + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7656. isplabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7657. window.placeControl(isplabel, 360, 127, columnspan=1)
  7658. isplabel.setVisible(False)
  7659.  
  7660. countrytextlabel = pyxbmct.Label('[COLOR=lightgray]Country:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7661. window.placeControl(countrytextlabel, 390, 114, columnspan=1)
  7662. countrytextlabel.setVisible(False)
  7663.  
  7664. #countrylabel = pyxbmct.Label('[COLOR=lightgray]' + country + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7665. countrylabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7666. window.placeControl(countrylabel, 390, 127, columnspan=1)
  7667. countrylabel.setVisible(False)
  7668.  
  7669. citytextlabel = pyxbmct.Label('[COLOR=lightgray]City:[/COLOR]', alignment=pyxbmct.ALIGN_RIGHT)
  7670. window.placeControl(citytextlabel, 420, 119, columnspan=1)
  7671. citytextlabel.setVisible(False)
  7672.  
  7673. #citylabel = pyxbmct.Label('[COLOR=lightgray]' + city + '[/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7674. citylabel = pyxbmct.Label('[COLOR=lightgray][/COLOR]', alignment=pyxbmct.ALIGN_LEFT)
  7675. window.placeControl(citylabel, 420, 127, columnspan=1)
  7676. citylabel.setVisible(False)
  7677.  
  7678.  
  7679.  
  7680.  
  7681.  
  7682. #############################################################################################################################################################
  7683.  
  7684.  
  7685.  
  7686.  
  7687.  
  7688.  
  7689.  
  7690.  
  7691.  
  7692.  
  7693.  
  7694.  
  7695.  
  7696.  
  7697.  
  7698.  
  7699. window.connectEventList(
  7700.     [pyxbmct.ACTION_MOVE_DOWN,
  7701.     pyxbmct.ACTION_MOVE_UP,
  7702.     pyxbmct.ACTION_MOUSE_WHEEL_DOWN,
  7703.     pyxbmct.ACTION_MOUSE_WHEEL_UP,
  7704.     pyxbmct.ACTION_MOUSE_MOVE],
  7705.     list_update)
  7706.  
  7707.  
  7708.  
  7709.  
  7710. # Set navigation between controls
  7711. browsebuildsbutton.controlLeft(settingsbutton)
  7712. browsebuildsbutton.controlRight(browseaddonsbutton)
  7713. browsebuildsbutton.controlDown(buildlist)
  7714. browseaddonsbutton.controlLeft(browsebuildsbutton)
  7715. browseaddonsbutton.controlRight(maintenancebutton)
  7716. browseaddonsbutton.controlDown(addontypelist)
  7717. backupbutton.controlLeft(maintenancebutton)
  7718. backupbutton.controlRight(tweaksbutton)
  7719. backupbutton.controlDown(repolist)
  7720. maintenancebutton.controlLeft(browseaddonsbutton)
  7721. maintenancebutton.controlRight(backupbutton)
  7722. tweaksbutton.controlLeft(backupbutton)
  7723. tweaksbutton.controlRight(morebutton)
  7724. morebutton.controlLeft(tweaksbutton)
  7725. morebutton.controlRight(settingsbutton)
  7726. settingsbutton.controlLeft(morebutton)
  7727. settingsbutton.controlRight(browsebuildsbutton)
  7728. buildlist.controlUp(browsebuildsbutton)
  7729. addontypelist.controlUp(browseaddonsbutton)
  7730. addonlist.controlUp(browseaddonsbutton)
  7731. repolist.controlUp(browseaddonsbutton)
  7732. addonlist.controlRight(installaddonbutton)
  7733. installaddonbutton.controlLeft(addonlist)
  7734. installaddonbutton.controlUp(browseaddonsbutton)
  7735. installaddonbutton.controlDown(voteaddonbutton)
  7736. voteaddonbutton.controlUp(installaddonbutton)
  7737. voteaddonbutton.controlDown(uninstalladdonbutton)
  7738. voteaddonbutton.controlLeft(addonlist)
  7739. uninstalladdonbutton.controlUp(voteaddonbutton)
  7740. uninstalladdonbutton.controlDown(installaddonbutton)
  7741. uninstalladdonbutton.controlLeft(addonlist)
  7742. settingsbutton.controlUp(closebutton)
  7743. closebutton.controlDown(settingsbutton)
  7744. votebuildbutton.controlUp(installaddonbutton)
  7745. votebuildbutton.controlLeft(buildlist)
  7746. voterepobutton.controlLeft(repolist)
  7747. voterepobutton.controlUp(installaddonbutton)
  7748. voterepobutton.controlDown(uninstalladdonbutton)
  7749.  
  7750.  
  7751.  
  7752. # if userlevel == "staff" or userlevel == "admin":
  7753.     # blankbutton2.setVisible(True)
  7754.     # blankbutton1.setVisible(True)
  7755.  
  7756.  
  7757.  
  7758.  
  7759.    
  7760. if accountstatus == "staff" or accountstatus == "admin" or accountstatus =="Registered" or accountstatus == "donator" or accountstatus == "free" or accountstatus == "updater":
  7761.  
  7762.     introlabel.setLabel('[COLOR=darkgray]' + strings.getstring("introlabel_loggedin") + '[/COLOR]')
  7763.     window.setFocus(browsebuildsbutton)
  7764.     splashimage.setVisible(True)
  7765.     logoutbutton.setVisible(True)
  7766.     closebutton.setVisible(True)
  7767.     logoutbutton.controlDown(browsebuildsbutton)
  7768.     browsebuildsbutton.controlUp(logoutbutton)
  7769.    
  7770.     if accountstatus == "free":
  7771.         loginbutton.setVisible(True)
  7772.         loginbutton.controlDown(browsebuildsbutton)
  7773.         closebutton.controlDown(settingsbutton)
  7774.         browsebuildsbutton.controlUp(loginbutton)
  7775.         settingsbutton.controlUp(closebutton)
  7776.         logoutbutton.setVisible(False)
  7777.  
  7778.  
  7779.    
  7780. elif accountstatus == "awaiting_activation":
  7781.  
  7782.     introlabel.setLabel('[COLOR=darkgray]' + strings.getstring("introlabel_awating_activation") + '[/COLOR]')
  7783.     # browsebuildsbutton.setEnabled(False)
  7784.     # browseaddonsbutton.setEnabled(False)
  7785.     # browserepobutton.setEnabled(False)
  7786.     # maintenancebutton.setEnabled(False)
  7787.     # tweaksbutton.setEnabled(False)
  7788.     # morebutton.setEnabled(False)
  7789.     activatebutton.setVisible(True)
  7790.     window.setFocus(activatebutton)
  7791.     activatebutton.controlDown(browsebuildsbutton)
  7792.     browsebuildsbutton.controlUp(activatebutton)
  7793.     splashimage.setVisible(True)
  7794.     closebutton.setVisible(True)
  7795.  
  7796.    
  7797.    
  7798.  
  7799.  
  7800.    
  7801.    
  7802. else:
  7803.     introlabel.setLabel('[COLOR=darkgray]' + strings.getstring("introlabel_register") + '[/COLOR]')
  7804.     browsebuildsbutton.setEnabled(False)
  7805.     browseaddonsbutton.setEnabled(False)
  7806.     backupbutton.setEnabled(False)
  7807.     maintenancebutton.setEnabled(False)
  7808.     tweaksbutton.setEnabled(False)
  7809.     morebutton.setEnabled(False)
  7810.     loginbutton.setVisible(True)
  7811.     window.setFocus(loginbutton)
  7812.     loginbutton.controlDown(browsebuildsbutton)
  7813.     browsebuildsbutton.controlUp(loginbutton)
  7814.    
  7815.  
  7816. introlabel.setVisible(True)
  7817.  
  7818.  
  7819.  
  7820.  
  7821.  
  7822. window.connect(pyxbmct.ACTION_NAV_BACK, window.close)
  7823. # Show the created window.
  7824. window.doModal()
  7825. # Delete the window instance when it is no longer used.
  7826. del window
Add Comment
Please, Sign In to add comment