"service.py", "Cycle requested connection to " + cycle_requested) setVPNRequestedProfile(cycle_requested) if cycle_requested == "Disconnect": setVPNRequestedProfileFriendly("Disconnect") else: setVPNRequestedProfileFriendly( getFriendlyProfileName(vpn_provider, cycle_requested)) setVPNLastConnectedProfile("") setVPNLastConnectedProfileFriendly("") reconnect_vpn = True clearVPNCycle() cycle_timer = 0 freeCycleLock() # Somewhere above we've requested we mess with the connection... if vpn_setup and reconnect_vpn: debugTrace("Running VPN (dis)connect request " + getVPNRequestedProfile() + ", current is " + getVPNProfile()) # Wait a short period, and then just grab the lock anyway. forceCycleLock() debugTrace( "Got forced cycle lock in connection part of service") # Stop the VPN and reset the connection timer # Surpress a reconnection to the same unless it's become disconnected
title = "Connected - " + getVPNProfileFriendly() connections.insert(0, disconnect_text) else: title = "Disconnected" connections.insert(0, disconnected_text) connections.append(cancel_text) i = xbmcgui.Dialog().select(title, connections) if connections[i] == disconnect_text or connections[i] == disconnected_text: setAPICommand("Disconnect") elif not connections[i] == cancel_text: if getVPNProfile() == location_connections[i-1] and (allowReconnection(vpn_provider) or addon.getSetting("allow_cycle_reconnect") == "true"): setAPICommand("Reconnect") else: if isAlternative(vpn_provider) and addon.getSetting("table_display_type") == "All connections": _, connection, user_text, ignore = getAlternativeLocation(vpn_provider, connections[i], 0, True) if not ignore and not user_text == "": xbmcgui.Dialog().ok(addon_name, user_text) else: connection = location_connections[i-1] if not connection == "": setAPICommand(connection) freeCycleLock() else: xbmcgui.Dialog().notification(addon_name, "VPN is not set up and authenticated.", xbmcgui.NOTIFICATION_ERROR, 10000, True) else: errorTrace("table.py", "VPN service is not ready") debugTrace("-- Exit table.py --")