Exemplo n.º 1
0
    xbmc.executebuiltin('Container.Refresh')
    return


if action == "display":
    # Display the network status
    displayStatus()
elif action == "system":
    listSystem(addon)
elif action == "back":
    back()
    #listSystem()
elif not connectionValidated(addon) and action != "":
    # Haven't got a valid connection so force user into the wizard or the settings dialog
    if not addon.getSetting("vpn_wizard_run") == "true":
        wizard()
    else:
        if not action == "settings":
            xbmcgui.Dialog().ok(
                addon_name,
                "Please validate a primary VPN connection first.  You can do this using the VPN Configuration and VPN Connections tabs within the Settings dialog."
            )
    xbmc.executebuiltin("Addon.OpenSettings(service.vpn.manager)")
else:
    # User wants to see settings, list connections or they've selected to change something.
    # If it's none of these things, we're at the top level and just need to show the menu
    if action == "settings":
        debugTrace("Opening settings")
        xbmc.executebuiltin("Addon.OpenSettings(service.vpn.manager)")
    elif action == "list":
        listConnections()
Exemplo n.º 2
0
    xbmc.executebuiltin('Container.Refresh')
    return


if action == "display": 
    # Display the network status
    displayStatus()
elif action == "system":
    listSystem(addon)
elif action == "back" : 
    back()
    #listSystem()
elif not connectionValidated(addon) and action != "":
    # Haven't got a valid connection so force user into the wizard or the settings dialog
    if not addon.getSetting("vpn_wizard_run") == "true" : 
        wizard()
    else:
        if not action =="settings": xbmcgui.Dialog().ok(addon_name, "Please validate a primary VPN connection first.  You can do this using the VPN Configuration tab within the Settings dialog.")
    xbmc.executebuiltin("Addon.OpenSettings(service.vpn.manager)")
else:
    # User wants to see settings, list connections or they've selected to change something.  
    # If it's none of these things, we're at the top level and just need to show the menu
    if action == "settings" :
        debugTrace("Opening settings")
        xbmc.executebuiltin("Addon.OpenSettings(service.vpn.manager)")    
    elif action == "list" : listConnections()
    elif action == "disconnect" : disconnect()
    elif action == "change" : changeConnection()
    elif action == "cycle" : cycleConnection()
    elif action == "switch" : switchService()