diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-06-11 12:37:29 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-06-11 12:37:29 -0300 |
commit | 56f90d03b40e2a138a8b653de408f207ad562a09 (patch) | |
tree | fa1c5b021dec566f0c32d524e9e92dd8255e67bc /src/leap/config | |
parent | 3d91da9b320d2dd267b0c1799c25a3e140077666 (diff) |
Save the provider used for EIP as the default provider.
Diffstat (limited to 'src/leap/config')
-rw-r--r-- | src/leap/config/leapsettings.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/leap/config/leapsettings.py b/src/leap/config/leapsettings.py index 59a0a16d..006be851 100644 --- a/src/leap/config/leapsettings.py +++ b/src/leap/config/leapsettings.py @@ -65,6 +65,7 @@ class LeapSettings(object): AUTOLOGIN_KEY = "AutoLogin" PROPERPROVIDER_KEY = "ProperProvider" REMEMBER_KEY = "RememberUserAndPass" + DEFAULTPROVIDER_KEY = "DefaultProvider" def __init__(self, standalone=False): """ @@ -230,3 +231,21 @@ class LeapSettings(object): """ leap_assert_type(properprovider, bool) self._settings.setValue(self.PROPERPROVIDER_KEY, properprovider) + + def get_defaultprovider(self): + """ + Returns the default provider to be used for autostarting EIP + + :rtype: str or None + """ + return self._settings.value(self.DEFAULTPROVIDER_KEY, None) + + def set_defaultprovider(self, provider): + """ + Sets the default provider to be used for autostarting EIP + + :param provider: provider to use + :type provider: str + """ + leap_assert(len(provider) > 0, "We cannot save an empty provider") + self._settings.setValue(self.DEFAULTPROVIDER_KEY, provider) |