Exemple #1
0
        "service.py", "Starting VPN monitor service, platform is " +
        str(getPlatform()) + ", version is " + addon.getAddonInfo("version"))
    infoTrace("service.py",
              "Kodi build is " + xbmc.getInfoLabel('System.BuildVersion'))

    while not monitor.abortRequested():

        if stopRequested() or stop:
            if not stop:
                # Acknowledge that we've stopped so that the config can do things
                # Also shorten the delay so that we can be more responsive and kill any cycle attempt
                debugTrace("Service received a stop request")
                ackStop()
                stop = True
                delay = 2
                clearVPNCycle()
            elif startRequested():
                debugTrace("Service received a start request")
                # When we're told we can start again, acknowledge that and reset the delay back up.
                ackStart()
                stop = False
                delay = 5
        else:
            # See if there's been an update	requested from the main add-on
            if updateServiceRequested():
                # Need to get the addon again to ensure the updated settings are picked up
                addon = xbmcaddon.Addon()
                infoTrace(
                    "service.py",
                    "VPN monitor service was requested to run an update")
                # Acknowledge update needs to happen
Exemple #2
0
    # Get info about the addon that this script is pretending to be attached to
    addon = xbmcaddon.Addon(getID())
    addon_name = getName()

    cancel_text = "[I][COLOR grey]Cancel[/COLOR][/I]"
    disconnect_text = "[COLOR ffff0000]Disconnect[/COLOR]"
    disconnected_text = "[COLOR ffff0000](Disconnected)[/COLOR]"

    # Don't display the table if there's nothing been set up
    if connectionValidated(addon):
        if getCycleLock():
        
            vpn_provider = addon.getSetting("vpn_provider_validated")
        
            # Want to stop cycling whilst this menu is displayed, and clear any active cycle
            clearVPNCycle()
            if addon.getSetting("table_display_type") == "All connections":
                # Build a list of all ovpn files using the current active filter
                if not isAlternative(vpn_provider):
                    all_connections = getAddonList(addon.getSetting("vpn_provider_validated"), "*.ovpn")
                    location_connections = getFilteredProfileList(all_connections, addon.getSetting("vpn_protocol"), None)
                    location_connections.sort()
                else:
                    location_connections = getAlternativeLocations(vpn_provider, False)
                    connections = getAlternativeFriendlyLocations(vpn_provider, False)
            else:
                # Build a list of all validated connections
                location_connections = getValidatedList(addon, "")
            # Build the friendly list, displaying any active connection in blue
            if isAlternative(vpn_provider) and addon.getSetting("table_display_type") == "All connections":
                connections = getAlternativeFriendlyProfileList(connections, getVPNProfileFriendly(), "ff00ff00")