# Reset the ovpn files if action == "ovpn": if addon.getSetting("1_vpn_validated") == "" or xbmcgui.Dialog().yesno( addon_name, "Resetting the VPN provider will disconnect and reset all VPN connections, and then remove any files that have been created. Continue?" ): suspendConfigUpdate() # Disconnect so that live files are not being modified if isVPNConnected(): resetVPNConnections(addon) debugTrace("Deleting all generated files") # Delete the generated files, and reset the locations so it can be selected again removeGeneratedFiles() # Delete any values that have previously been validated vpn_provider = getVPNLocation(addon.getSetting("vpn_provider")) if isAlternative(vpn_provider): resetAlternative(vpn_provider) # Reset the IP service error counts, etc resetIPServices() addon = xbmcaddon.Addon(getID()) # Reset values that would have been stored as part of validation addon.setSetting("vpn_provider_validated", "") addon.setSetting("vpn_locations_list", "") addon.setSetting("vpn_username_validated", "") addon.setSetting("vpn_password_validated", "") # Re-enble the wizard addon.setSetting("vpn_wizard_enabled", "true") resumeConfigUpdate() xbmcgui.Dialog().ok( addon_name, "Reset the VPN provider. Validate a connection to start using a VPN again.\n" )
addon_name = getName() # Reset the ovpn files if action == "ovpn": if getVPNRequestedProfile() == "": if xbmcgui.Dialog().yesno(addon_name, "Resetting the VPN provider will disconnect and reset all VPN connections, and then remove any files that have been created. Continue?"): suspendConfigUpdate() # Disconnect so that live files are not being modified resetVPNConnections(addon) infoTrace("managefiles.py", "Resetting the VPN provider") # Delete the generated files, and reset the locations so it can be selected again removeGeneratedFiles() # Delete any values that have previously been validated vpn_provider = getVPNLocation(addon.getSetting("vpn_provider")) if isAlternative(vpn_provider): resetAlternative(vpn_provider) # Reset the IP service error counts, etc resetIPServices() addon = xbmcaddon.Addon(getID()) resetVPNProvider(addon) addon = xbmcaddon.Addon(getID()) resumeConfigUpdate() xbmcgui.Dialog().ok(addon_name, "Reset the VPN provider. Validate a connection to start using a VPN again.") else: xbmcgui.Dialog().ok(addon_name, "Connection to VPN being attempted and has been aborted. Try again in a few seconds.") setAPICommand("Disconnect") # Generate the VPN provider files if action == "generate": # Only used during development to create location files generateAll()