79 Module function returning data as required by the configuration dialog. |
79 Module function returning data as required by the configuration dialog. |
80 |
80 |
81 @return dictionary containing the relevant data |
81 @return dictionary containing the relevant data |
82 """ |
82 """ |
83 return { |
83 return { |
84 "ropeAutoCompletionPage" : [ |
84 "ropeAutoCompletionPage": [ |
85 QCoreApplication.translate("RefactoringRopePlugin", "Rope"), |
85 QCoreApplication.translate("RefactoringRopePlugin", "Rope"), |
86 os.path.join("RefactoringRope", "ConfigurationPage", |
86 os.path.join("RefactoringRope", "ConfigurationPage", |
87 "preferences-refactoring.png"), |
87 "preferences-refactoring.png"), |
88 createAutoCompletionPage, "editorAutocompletionPage", None], |
88 createAutoCompletionPage, "editorAutocompletionPage", None], |
89 "ropeCallTipsPage" : \ |
89 "ropeCallTipsPage": [ |
90 [QCoreApplication.translate("RefactoringRopePlugin", "Rope"), |
90 QCoreApplication.translate("RefactoringRopePlugin", "Rope"), |
91 os.path.join("RefactoringRope", "ConfigurationPage", |
91 os.path.join("RefactoringRope", "ConfigurationPage", |
92 "preferences-refactoring.png"), |
92 "preferences-refactoring.png"), |
93 createCallTipsPage, "editorCalltipsPage", None], |
93 createCallTipsPage, "editorCalltipsPage", None], |
94 } |
94 } |
95 |
95 |
96 |
96 |
97 def prepareUninstall(): |
97 def prepareUninstall(): |
98 """ |
98 """ |
116 QObject.__init__(self, ui) |
116 QObject.__init__(self, ui) |
117 self.__ui = ui |
117 self.__ui = ui |
118 self.__initialize() |
118 self.__initialize() |
119 |
119 |
120 self.__defaults = { |
120 self.__defaults = { |
121 "CodeAssistEnabled" : False, |
121 "CodeAssistEnabled": False, |
122 "MaxFixes" : 10, |
122 "MaxFixes": 10, |
123 "CodeAssistTimeout" : 100, |
123 "CodeAssistTimeout": 100, |
124 "ShowQScintillaCompletions": True, |
124 "ShowQScintillaCompletions": True, |
125 |
125 |
126 "CodeAssistCalltipsEnabled" : False, |
126 "CodeAssistCalltipsEnabled": False, |
127 "CalltipsMaxFixes" : 10, |
127 "CalltipsMaxFixes": 10, |
128 } |
128 } |
129 |
129 |
130 self.__translator = None |
130 self.__translator = None |
131 self.__loadTranslator() |
131 self.__loadTranslator() |
132 |
132 |
294 def getPreferences(self, key): |
294 def getPreferences(self, key): |
295 """ |
295 """ |
296 Public method to retrieve the various refactoring settings. |
296 Public method to retrieve the various refactoring settings. |
297 |
297 |
298 @param key the key of the value to get |
298 @param key the key of the value to get |
299 @param prefClass preferences class used as the storage area |
|
300 @return the requested refactoring setting |
299 @return the requested refactoring setting |
301 """ |
300 """ |
302 if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled", |
301 if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled", |
303 "ShowQScintillaCompletions"]: |
302 "ShowQScintillaCompletions"]: |
304 return Preferences.toBool(Preferences.Prefs.settings.value( |
303 return Preferences.toBool(Preferences.Prefs.settings.value( |
305 self.PreferencesKey + "/" + key, self.__defaults[key])) |
304 self.PreferencesKey + "/" + key, self.__defaults[key])) |
306 else: |
305 else: |
307 return int(Preferences.Prefs.settings.value( |
306 return int(Preferences.Prefs.settings.value( |
311 """ |
310 """ |
312 Public method to store the various refactoring settings. |
311 Public method to store the various refactoring settings. |
313 |
312 |
314 @param key the key of the setting to be set (string) |
313 @param key the key of the setting to be set (string) |
315 @param value the value to be set |
314 @param value the value to be set |
316 @param prefClass preferences class used as the storage area |
|
317 """ |
315 """ |
318 Preferences.Prefs.settings.setValue( |
316 Preferences.Prefs.settings.setValue( |
319 self.PreferencesKey + "/" + key, value) |
317 self.PreferencesKey + "/" + key, value) |
320 |
318 |
321 if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled"]: |
319 if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled"]: |
482 @param editor reference to the editor (QScintilla.Editor) |
480 @param editor reference to the editor (QScintilla.Editor) |
483 """ |
481 """ |
484 editor.unsetAutoCompletionHook() |
482 editor.unsetAutoCompletionHook() |
485 editor.userListActivated.disconnect(self.__completionListSelected) |
483 editor.userListActivated.disconnect(self.__completionListSelected) |
486 |
484 |
487 def codeAssist(self, editor, context = False): |
485 def codeAssist(self, editor, context=False): |
488 """ |
486 """ |
489 Public method to determine the autocompletion proposals. |
487 Public method to determine the autocompletion proposals. |
490 |
488 |
491 @param editor reference to the editor object, that called this method |
489 @param editor reference to the editor object, that called this method |
492 QScintilla.Editor) |
490 QScintilla.Editor) |