diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-10-18 09:34:47 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-10-18 09:34:47 -0300 |
commit | a06b5719f028e619a4b3800fb346ed3c984e4d25 (patch) | |
tree | b177a28201d647731797efb25c19fd9b3a311c9a /src/leap/bitmask/config/leapsettings.py | |
parent | 932dcf596177b93c0b0f9e876be74be314fb6037 (diff) | |
parent | f673b84a9a9b0fea3f6bbfefbb38cbd3d311cf3c (diff) |
Merge branch 'release-0.3.5'
Diffstat (limited to 'src/leap/bitmask/config/leapsettings.py')
-rw-r--r-- | src/leap/bitmask/config/leapsettings.py | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py index 4660535a..c524425e 100644 --- a/src/leap/bitmask/config/leapsettings.py +++ b/src/leap/bitmask/config/leapsettings.py @@ -62,13 +62,14 @@ class LeapSettings(object): GEOMETRY_KEY = "Geometry" WINDOWSTATE_KEY = "WindowState" USER_KEY = "User" - PROPERPROVIDER_KEY = "ProperProvider" + PROVIDER_KEY = "Provider" REMEMBER_KEY = "RememberUserAndPass" DEFAULTPROVIDER_KEY = "DefaultProvider" AUTOSTARTEIP_KEY = "AutoStartEIP" ALERTMISSING_KEY = "AlertMissingScripts" GATEWAY_KEY = "Gateway" PINNED_KEY = "Pinned" + SKIPFIRSTRUN_KEY = "SkipFirstRun" # values GATEWAY_AUTOMATIC = "Automatic" @@ -241,6 +242,24 @@ class LeapSettings(object): leap_assert(len(user) > 0, "We cannot save an empty user") self._settings.setValue(self.USER_KEY, user) + def get_provider(self): + """ + Returns the configured provider to remember, None if there isn't one + + :rtype: str or None + """ + return self._settings.value(self.PROVIDER_KEY, None) + + def set_provider(self, provider): + """ + Saves the provider to remember + + :param provider: provider name to remember + :type provider: str + """ + leap_assert(len(provider) > 0, "We cannot save an empty provider") + self._settings.setValue(self.PROVIDER_KEY, provider) + def get_remember(self): """ Returns the value of the remember selection. @@ -260,29 +279,6 @@ class LeapSettings(object): leap_assert_type(remember, bool) self._settings.setValue(self.REMEMBER_KEY, remember) - # TODO: make this scale with multiple providers, we are assuming - # just one for now - def get_properprovider(self): - """ - Returns True if there is a properly configured provider. - - .. note:: this assumes only one provider for now. - - :rtype: bool - """ - return to_bool(self._settings.value(self.PROPERPROVIDER_KEY, False)) - - def set_properprovider(self, properprovider): - """ - Sets whether the app should automatically login. - - :param properprovider: True if the provider is properly configured, - False otherwise. - :type properprovider: bool - """ - 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 @@ -338,3 +334,22 @@ class LeapSettings(object): """ leap_assert_type(value, bool) self._settings.setValue(self.ALERTMISSING_KEY, value) + + def get_skip_first_run(self): + """ + Gets the setting for skip running the first run wizard. + + :returns: if the first run wizard should be skipped or not + :rtype: bool + """ + return to_bool(self._settings.value(self.SKIPFIRSTRUN_KEY, False)) + + def set_skip_first_run(self, skip): + """ + Gets the setting for skip the first run wizard. + + :param skip: if the first run wizard should be skipped or not + :type skip: bool + """ + leap_assert_type(skip, bool) + self._settings.setValue(self.SKIPFIRSTRUN_KEY, skip) |