# 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" ) # Generate the VPN provider files if action == "generate": # Only used during development to create location files generateAll() xbmcgui.Dialog().ok( addon_name, "Regenerated some or all of the VPN location files.\n") # Delete all of the downloaded VPN files if action == "downloads": debugTrace("Deleting all downloaded VPN files")
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() xbmcgui.Dialog().ok(addon_name, "Regenerated some or all of the VPN location files.") # Delete all of the downloaded VPN files if action == "downloads": debugTrace("Deleting all downloaded VPN files")