summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/config')
-rw-r--r--src/leap/bitmask/config/leapsettings.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py
index dc1af899..4660535a 100644
--- a/src/leap/bitmask/config/leapsettings.py
+++ b/src/leap/bitmask/config/leapsettings.py
@@ -68,6 +68,7 @@ class LeapSettings(object):
AUTOSTARTEIP_KEY = "AutoStartEIP"
ALERTMISSING_KEY = "AlertMissingScripts"
GATEWAY_KEY = "Gateway"
+ PINNED_KEY = "Pinned"
# values
GATEWAY_AUTOMATIC = "Automatic"
@@ -135,6 +136,22 @@ class LeapSettings(object):
return providers
+ def is_pinned_provider(self, domain):
+ """
+ Returns True if the domain 'domain' is pinned with the application.
+ False otherwise.
+
+ :param provider: provider domain
+ :type provider: str
+
+ :rtype: bool
+ """
+ leap_assert(len(domain) > 0, "We need a nonempty domain.")
+ pinned_key = "{0}/{1}".format(domain, self.PINNED_KEY)
+ result = to_bool(self._settings.value(pinned_key, False))
+
+ return result
+
def get_selected_gateway(self, provider):
"""
Returns the configured gateway for the given provider.