summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/bug-3595_fix-gateway-selection-problem1
-rw-r--r--changes/bug-3657_display-correct-service-name-in-wiard1
-rw-r--r--src/leap/bitmask/config/providerconfig.py10
-rw-r--r--src/leap/bitmask/services/__init__.py10
-rw-r--r--src/leap/bitmask/services/eip/eipconfig.py2
5 files changed, 17 insertions, 7 deletions
diff --git a/changes/bug-3595_fix-gateway-selection-problem b/changes/bug-3595_fix-gateway-selection-problem
new file mode 100644
index 00000000..7225eed0
--- /dev/null
+++ b/changes/bug-3595_fix-gateway-selection-problem
@@ -0,0 +1 @@
+ o Fix gateway selection problem. Closes 3595.
diff --git a/changes/bug-3657_display-correct-service-name-in-wiard b/changes/bug-3657_display-correct-service-name-in-wiard
new file mode 100644
index 00000000..4fe3d0b1
--- /dev/null
+++ b/changes/bug-3657_display-correct-service-name-in-wiard
@@ -0,0 +1 @@
+ o Display Encrypted Mail instead of mx in wizard. Closes #3657.
diff --git a/src/leap/bitmask/config/providerconfig.py b/src/leap/bitmask/config/providerconfig.py
index c65932be..a7808399 100644
--- a/src/leap/bitmask/config/providerconfig.py
+++ b/src/leap/bitmask/config/providerconfig.py
@@ -24,6 +24,7 @@ import os
from leap.bitmask.config.provider_spec import leap_provider_spec
from leap.common.check import leap_check
from leap.common.config.baseconfig import BaseConfig, LocalizedKey
+from leap.bitmask.services import get_service_display_name
logger = logging.getLogger(__name__)
@@ -130,9 +131,11 @@ class ProviderConfig(BaseConfig):
Returns a string with the available services in the current
provider, ready to be shown to the user.
"""
- services_str = ", ".join(self.get_services())
- services_str = services_str.replace(
- "openvpn", "Encrypted Internet")
+ services = []
+ for service in self.get_services():
+ services.append(get_service_display_name(service))
+
+ services_str = ", ".join(services)
return services_str
def get_ca_cert_path(self, about_to_download=False):
@@ -216,3 +219,4 @@ if __name__ == "__main__":
print provider.get_languages()
print provider.get_name()
print provider.get_services()
+ print provider.get_services_string()
diff --git a/src/leap/bitmask/services/__init__.py b/src/leap/bitmask/services/__init__.py
index 924ca547..339f9cc6 100644
--- a/src/leap/bitmask/services/__init__.py
+++ b/src/leap/bitmask/services/__init__.py
@@ -26,6 +26,8 @@ DEPLOYED = ["openvpn", "mx"]
def get_service_display_name(service, standalone=False):
"""
Returns the name to display of the given service.
+ If there is no configured name for that service, then returns the same
+ parameter
:param service: the 'machine' service name
:type service: str
@@ -42,8 +44,10 @@ def get_service_display_name(service, standalone=False):
EIP_LABEL = _tr("Encrypted Internet")
MX_LABEL = _tr("Encrypted Mail")
- service_display = [EIP_LABEL, MX_LABEL]
- service_config = ["openvpn", "mx"]
+ service_display = {
+ "openvpn": EIP_LABEL,
+ "mx": MX_LABEL
+ }
# If we need to add a warning about eip needing
# administrative permissions to start. That can be either
@@ -52,7 +56,7 @@ def get_service_display_name(service, standalone=False):
if standalone or is_missing_policy_permissions():
EIP_LABEL += " " + _tr("(will need admin password to start)")
- return service_display[service_config.index(service)]
+ return service_display.get(service, service)
def get_supported(services):
diff --git a/src/leap/bitmask/services/eip/eipconfig.py b/src/leap/bitmask/services/eip/eipconfig.py
index 1f49f9cd..1cb7419e 100644
--- a/src/leap/bitmask/services/eip/eipconfig.py
+++ b/src/leap/bitmask/services/eip/eipconfig.py
@@ -141,7 +141,7 @@ class VPNGatewaySelector(object):
if time.daylight:
local_offset = time.altzone
- return local_offset / 3600
+ return -local_offset / 3600
class EIPConfig(BaseConfig):