207 Public method to retrieve the various settings. |
208 Public method to retrieve the various settings. |
208 |
209 |
209 @param key the key of the value to get |
210 @param key the key of the value to get |
210 @return the requested setting |
211 @return the requested setting |
211 """ |
212 """ |
212 if key in ["RecentBrokersWithPort"]: |
213 if key in ["RecentBrokersWithPort", "BrokerProfiles"]: |
213 return json.loads(Preferences.Prefs.settings.value( |
214 return json.loads(Preferences.Prefs.settings.value( |
214 self.PreferencesKey + "/" + key, self.__defaults[key])) |
215 self.PreferencesKey + "/" + key, self.__defaults[key])) |
215 else: |
216 else: |
216 return Preferences.Prefs.settings.value( |
217 return Preferences.Prefs.settings.value( |
217 self.PreferencesKey + "/" + key, self.__defaults[key]) |
218 self.PreferencesKey + "/" + key, self.__defaults[key]) |
221 Public method to store the various settings. |
222 Public method to store the various settings. |
222 |
223 |
223 @param key the key of the setting to be set (string) |
224 @param key the key of the setting to be set (string) |
224 @param value the value to be set |
225 @param value the value to be set |
225 """ |
226 """ |
226 if key in ["RecentBrokersWithPort"]: |
227 if key in ["RecentBrokersWithPort", "BrokerProfiles"]: |
227 Preferences.Prefs.settings.setValue( |
228 Preferences.Prefs.settings.setValue( |
228 self.PreferencesKey + "/" + key, json.dumps(value)) |
229 self.PreferencesKey + "/" + key, json.dumps(value)) |
229 else: |
230 else: |
230 Preferences.Prefs.settings.setValue( |
231 Preferences.Prefs.settings.setValue( |
231 self.PreferencesKey + "/" + key, value) |
232 self.PreferencesKey + "/" + key, value) |