8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 import os |
12 import os |
|
13 import json |
13 |
14 |
14 from PyQt5.QtCore import Qt, QObject, QTranslator, QCoreApplication |
15 from PyQt5.QtCore import Qt, QObject, QTranslator, QCoreApplication |
15 from PyQt5.QtGui import QKeySequence |
16 from PyQt5.QtGui import QKeySequence |
16 |
17 |
17 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Application import e5App |
206 Public method to retrieve the various settings. |
207 Public method to retrieve the various settings. |
207 |
208 |
208 @param key the key of the value to get |
209 @param key the key of the value to get |
209 @return the requested setting |
210 @return the requested setting |
210 """ |
211 """ |
211 if key in ["RecentBrokers"]: |
212 if key in ["RecentBrokersWithPort"]: |
212 return Preferences.toList(Preferences.Prefs.settings.value( |
213 return json.loads(Preferences.Prefs.settings.value( |
213 self.PreferencesKey + "/" + key, self.__defaults[key])) |
214 self.PreferencesKey + "/" + key, self.__defaults[key])) |
214 else: |
215 else: |
215 return Preferences.Prefs.settings.value( |
216 return Preferences.Prefs.settings.value( |
216 self.PreferencesKey + "/" + key, self.__defaults[key]) |
217 self.PreferencesKey + "/" + key, self.__defaults[key]) |
217 |
218 |
220 Public method to store the various settings. |
221 Public method to store the various settings. |
221 |
222 |
222 @param key the key of the setting to be set (string) |
223 @param key the key of the setting to be set (string) |
223 @param value the value to be set |
224 @param value the value to be set |
224 """ |
225 """ |
225 Preferences.Prefs.settings.setValue( |
226 if key in ["RecentBrokersWithPort"]: |
226 self.PreferencesKey + "/" + key, value) |
227 Preferences.Prefs.settings.setValue( |
|
228 self.PreferencesKey + "/" + key, json.dumps(value)) |
|
229 else: |
|
230 Preferences.Prefs.settings.setValue( |
|
231 self.PreferencesKey + "/" + key, value) |
227 |
232 |
228 # |
233 # |
229 # eflag: noqa = M801 |
234 # eflag: noqa = M801 |