def disconnect(): # Disconnect or display status if already disconnected debugTrace("Disconnect selected from connections menu") if isVPNConnected(): disconnectVPN(True) setVPNState("off") else: displayStatus() return
def disconnect(): # Disconnect or display status if already disconnected debugTrace("Disconnect selected from connections menu") if isVPNConnected(): disconnectVPN() setVPNState("off") else: displayStatus() return
def disconnect(): xbmc.executebuiltin("ActivateWindow(busydialog)") # Disconnect or display status if already disconnected debugTrace("Disconnect selected from connections menu") if isVPNConnected(): disconnectVPN() setVPNState("off") #else: # displayStatus() xbmc.executebuiltin("Dialog.Close(busydialog)") return
# so it'll come back empty. Use this to determine if we should connect on boot if getVPNState() == "": # Just booted/started service. If we're not connected at boot, then we're # deliberately disconnected until the user uses one of the connect options if connect_at_boot == "true": debugTrace( "Connecting to primary VPN at boot time") setVPNRequestedProfile(primary_vpns[0]) setVPNRequestedProfileFriendly( primary_vpns_friendly[0]) setVPNLastConnectedProfile("") setVPNLastConnectedProfileFriendly("") reconnect_vpn = True else: # Not connecting at boot or not set up yet setVPNState("off") else: # Unknown state, so try and reconnect debugTrace( "Unknown VPN state so forcing reconnect") reconnect_vpn = True # This forces a connection validation after something stops playing if player.isPlaying(): playing = True if playing and not player.isPlaying(): playing = False timer = connection_retry_time + 1 # This just checks the connection is still good every hour, providing the player is not busy if vpn_setup and reconnect_on_drop == "true" and timer > connection_retry_time and not player.isPlaying(
debugTrace("VPN not started, state is " + getVPNState()) # If we've just booted, then we won't have set the vpn_state property on the window # so it'll come back empty. Use this to determine if we should connect on boot if getVPNState() == "": # Just booted/started service. If we're not connected at boot, then we're # deliberately disconnected until the user uses one of the connect options if addon.getSetting("vpn_connect_at_boot") == "true": debugTrace("Connecting to primary VPN at boot time") setVPNRequestedProfile(primary_vpns[0]) setVPNRequestedProfileFriendly(primary_vpns_friendly[0]) setVPNLastConnectedProfile("") setVPNLastConnectedProfileFriendly("") reconnect_vpn = True else: # Not connecting at boot or not set up yet setVPNState("off") else: # Unknown state, so try and reconnect debugTrace("Unknown VPN state so forcing reconnect") reconnect_vpn = True # This forces a connection validation after something stops playing if player.isPlaying(): playing = True if playing and not player.isPlaying(): playing = False timer = connection_retry_time + 1 # This just checks the connection is still good every hour, providing the player is not busy if vpn_setup and not player.isPlaying() and timer > connection_retry_time: