86 |
86 |
87 def prepareUninstall(): |
87 def prepareUninstall(): |
88 """ |
88 """ |
89 Module function to prepare for an uninstallation. |
89 Module function to prepare for an uninstallation. |
90 """ |
90 """ |
91 assistant = AssistantEricPlugin(None) |
91 Preferences.Prefs.settings.remove(AssistantEricPlugin.PreferencesKey) |
92 assistant.prepareUninstall() |
|
93 |
92 |
94 |
93 |
95 class AssistantEricPlugin(QObject): |
94 class AssistantEricPlugin(QObject): |
96 """ |
95 """ |
97 Class implementing the Eric assistant plugin. |
96 Class implementing the Eric assistant plugin. |
98 """ |
97 """ |
|
98 PreferencesKey = "AssistantEric" |
|
99 |
99 def __init__(self, ui): |
100 def __init__(self, ui): |
100 """ |
101 """ |
101 Constructor |
102 Constructor |
102 |
103 |
103 @param ui reference to the user interface object (UI.UserInterface) |
104 @param ui reference to the user interface object (UI.UserInterface) |
223 """ |
224 """ |
224 if key in ["AutoCompletionEnabled", "AutoCompletionFollowHierarchy", |
225 if key in ["AutoCompletionEnabled", "AutoCompletionFollowHierarchy", |
225 "CalltipsEnabled", "CallTipsContextShown", |
226 "CalltipsEnabled", "CallTipsContextShown", |
226 "CallTipsFollowHierarchy"]: |
227 "CallTipsFollowHierarchy"]: |
227 return Preferences.toBool(Preferences.Prefs.settings.value( |
228 return Preferences.toBool(Preferences.Prefs.settings.value( |
228 "AssistantEric/" + key, self.__defaults[key])) |
229 self.PreferencesKey + "/" + key, self.__defaults[key])) |
229 else: |
230 else: |
230 return int(Preferences.Prefs.settings.value("AssistantEric/" + key, |
231 return int(Preferences.Prefs.settings.value( |
231 self.__defaults[key])) |
232 self.PreferencesKey + "/" + key, self.__defaults[key])) |
232 |
233 |
233 def setPreferences(self, key, value): |
234 def setPreferences(self, key, value): |
234 """ |
235 """ |
235 Public method to store the various refactoring settings. |
236 Public method to store the various refactoring settings. |
236 |
237 |
237 @param key the key of the setting to be set (string) |
238 @param key the key of the setting to be set (string) |
238 @param value the value to be set |
239 @param value the value to be set |
239 @param prefClass preferences class used as the storage area |
240 @param prefClass preferences class used as the storage area |
240 """ |
241 """ |
241 Preferences.Prefs.settings.setValue("AssistantEric/" + key, value) |
242 Preferences.Prefs.settings.setValue(self.PreferencesKey + "/" + key, value) |
242 |
243 |
243 if key in ["AutoCompletionEnabled", "CalltipsEnabled"]: |
244 if key in ["AutoCompletionEnabled", "CalltipsEnabled"]: |
244 self.__object.setEnabled(key, value) |
245 self.__object.setEnabled(key, value) |
245 |
|
246 def prepareUninstall(self): |
|
247 """ |
|
248 Public method to prepare for an uninstallation. |
|
249 """ |
|
250 Preferences.Prefs.settings.remove("AssistantEric") |
|