示例#1
0
def addCitiesForCountry(countryName):
    try:
        cities = VPNServerManager.getInstance().getCities(countryName)
        for city in cities:
            label = '%s (%d)' % (city[0], city[2])
            gui.addDir(arguments, label, _VPN, thumbnail=city[1], server=city[3], isFolder=False, countryName = countryName)
    except NoConnectionError:
        gui.DialogOK("It is not possible to connect to the remote server", "Check your network connection", "and try again")
示例#2
0
def addCitiesForCountry(countryName):
    try:
        cities = VPNServerManager.getInstance().getCities(countryName)
        for city in cities:
            label = '%s (%d)' % (city[0], city[2])
            gui.addDir(arguments, label, _VPN, thumbnail=city[1], server=city[3], isFolder=False, countryName = countryName)
    except NoConnectionError:
        gui.DialogOK(__language__(30003), __language__(30004), __language__(30005))
示例#3
0
def addCitiesForCountry(countryName):
    try:
        cities = VPNServerManager.getInstance().getCities(countryName)
        for city in cities:
            label = '%s (%d)' % (city[0], city[2])
            gui.addDir(arguments,
                       label,
                       _VPN,
                       thumbnail=city[1],
                       server=city[3],
                       isFolder=False,
                       countryName=countryName)
    except NoConnectionError:
        gui.DialogOK(__language__(30003), __language__(30004),
                     __language__(30005))
示例#4
0
def Main():
    common.CheckVersion()
    common.CheckUsername()

    gui.addDir(arguments, 'Configure VPN', _SETTINGS,  isFolder=False)
    gui.addDir(arguments, 'Disable VPN',   _KILL,      isFolder=False)
    gui.addDir(arguments, ' ',             _SEPARATOR, isFolder=False)

    try:
        for country in VPNServerManager.getInstance().getCountries():
            gui.addDir(arguments, country[0], _COUNTRY, abrv=country[1], thumbnail=country[2])
    except NoConnectionError:
        gui.DialogOK("It is not possible to connect to the remote server", "Check your network connection", "and try again")
示例#5
0
def connectToCustomServer():
    server = config.getConfiguredServerAddress()
    if not server:
        gui.addDir(arguments, __language__(30001), _SETTINGS,  isFolder=False)
    else:
        gui.addDir(arguments, __language__(30053), _CUSTOM_CONNECT,  isFolder=False)
        gui.addDir(arguments, __language__(30002),   _KILL,      isFolder=False)
示例#6
0
def Main():
    common.CheckVersion()
    common.CheckUsername()

    if config.isVPNCustom():
        connectToCustomServer()
        return

    gui.addDir(arguments, __language__(30001), _SETTINGS,  isFolder=False)
    gui.addDir(arguments, __language__(30002),   _KILL,      isFolder=False)
    gui.addDir(arguments, ' ',             _SEPARATOR, isFolder=False)

    try:
        for country in VPNServerManager.getInstance().getCountries():
            gui.addDir(arguments, country[0], _COUNTRY, abrv=country[1], thumbnail=country[2])
    except NoConnectionError:
        gui.DialogOK( __language__(30003),  __language__(30004), __language__(30005))
示例#7
0
def connectToCustomServer():
    server = config.getConfiguredServerAddress()
    if not server:
        gui.addDir(arguments, __language__(30001), _SETTINGS, isFolder=False)
    else:
        gui.addDir(arguments,
                   __language__(30053),
                   _CUSTOM_CONNECT,
                   isFolder=False)
        gui.addDir(arguments, __language__(30002), _KILL, isFolder=False)
示例#8
0
def Main():
    common.CheckVersion()
    common.CheckUsername()

    if config.isVPNCustom():
        connectToCustomServer()
        return

    gui.addDir(arguments, __language__(30001), _SETTINGS, isFolder=False)
    gui.addDir(arguments, __language__(30002), _KILL, isFolder=False)
    gui.addDir(arguments, ' ', _SEPARATOR, isFolder=False)

    try:
        for country in VPNServerManager.getInstance().getCountries():
            gui.addDir(arguments,
                       country[0],
                       _COUNTRY,
                       abrv=country[1],
                       thumbnail=country[2])
    except NoConnectionError:
        gui.DialogOK(__language__(30003), __language__(30004),
                     __language__(30005))