73 ##################################################### |
73 ##################################################### |
74 ## Rename refactoring actions |
74 ## Rename refactoring actions |
75 ##################################################### |
75 ##################################################### |
76 |
76 |
77 self.refactoringRenameAct = E5Action( |
77 self.refactoringRenameAct = E5Action( |
78 self.trUtf8('Rename'), |
78 self.tr('Rename'), |
79 self.trUtf8('&Rename'), |
79 self.tr('&Rename'), |
80 0, 0, |
80 0, 0, |
81 self, 'refactoring_rename') |
81 self, 'refactoring_rename') |
82 self.refactoringRenameAct.setStatusTip(self.trUtf8( |
82 self.refactoringRenameAct.setStatusTip(self.tr( |
83 'Rename the highlighted object')) |
83 'Rename the highlighted object')) |
84 self.refactoringRenameAct.setWhatsThis(self.trUtf8( |
84 self.refactoringRenameAct.setWhatsThis(self.tr( |
85 """<b>Rename</b>""" |
85 """<b>Rename</b>""" |
86 """<p>Rename the highlighted Python object.</p>""" |
86 """<p>Rename the highlighted Python object.</p>""" |
87 )) |
87 )) |
88 self.refactoringRenameAct.triggered[()].connect( |
88 self.refactoringRenameAct.triggered.connect( |
89 self.__rename) |
89 self.__rename) |
90 self.actions.append(self.refactoringRenameAct) |
90 self.actions.append(self.refactoringRenameAct) |
91 |
91 |
92 self.refactoringRenameLocalAct = E5Action( |
92 self.refactoringRenameLocalAct = E5Action( |
93 self.trUtf8('Local Rename'), |
93 self.tr('Local Rename'), |
94 self.trUtf8('&Local Rename'), |
94 self.tr('&Local Rename'), |
95 0, 0, |
95 0, 0, |
96 self, 'refactoring_rename_local') |
96 self, 'refactoring_rename_local') |
97 self.refactoringRenameLocalAct.setStatusTip(self.trUtf8( |
97 self.refactoringRenameLocalAct.setStatusTip(self.tr( |
98 'Rename the highlighted object in the current module only')) |
98 'Rename the highlighted object in the current module only')) |
99 self.refactoringRenameLocalAct.setWhatsThis(self.trUtf8( |
99 self.refactoringRenameLocalAct.setWhatsThis(self.tr( |
100 """<b>Local Rename</b>""" |
100 """<b>Local Rename</b>""" |
101 """<p>Rename the highlighted Python object in the current""" |
101 """<p>Rename the highlighted Python object in the current""" |
102 """ module only.</p>""" |
102 """ module only.</p>""" |
103 )) |
103 )) |
104 self.refactoringRenameLocalAct.triggered[()].connect( |
104 self.refactoringRenameLocalAct.triggered.connect( |
105 self.__renameLocal) |
105 self.__renameLocal) |
106 self.actions.append(self.refactoringRenameLocalAct) |
106 self.actions.append(self.refactoringRenameLocalAct) |
107 |
107 |
108 self.refactoringRenameModuleAct = E5Action( |
108 self.refactoringRenameModuleAct = E5Action( |
109 self.trUtf8('Rename Current Module'), |
109 self.tr('Rename Current Module'), |
110 self.trUtf8('Rename Current Module'), |
110 self.tr('Rename Current Module'), |
111 0, 0, |
111 0, 0, |
112 self, 'refactoring_rename_module') |
112 self, 'refactoring_rename_module') |
113 self.refactoringRenameModuleAct.setStatusTip(self.trUtf8( |
113 self.refactoringRenameModuleAct.setStatusTip(self.tr( |
114 'Rename the current module')) |
114 'Rename the current module')) |
115 self.refactoringRenameModuleAct.setWhatsThis(self.trUtf8( |
115 self.refactoringRenameModuleAct.setWhatsThis(self.tr( |
116 """<b>Rename Current Module</b>""" |
116 """<b>Rename Current Module</b>""" |
117 """<p>Rename the current module.</p>""" |
117 """<p>Rename the current module.</p>""" |
118 )) |
118 )) |
119 self.refactoringRenameModuleAct.triggered[()].connect( |
119 self.refactoringRenameModuleAct.triggered.connect( |
120 self.__renameModule) |
120 self.__renameModule) |
121 self.actions.append(self.refactoringRenameModuleAct) |
121 self.actions.append(self.refactoringRenameModuleAct) |
122 |
122 |
123 self.refactoringChangeOccurrencesAct = E5Action( |
123 self.refactoringChangeOccurrencesAct = E5Action( |
124 self.trUtf8('Change Occurrences'), |
124 self.tr('Change Occurrences'), |
125 self.trUtf8('Change &Occurrences'), |
125 self.tr('Change &Occurrences'), |
126 0, 0, |
126 0, 0, |
127 self, 'refactoring_change_occurrences') |
127 self, 'refactoring_change_occurrences') |
128 self.refactoringChangeOccurrencesAct.setStatusTip(self.trUtf8( |
128 self.refactoringChangeOccurrencesAct.setStatusTip(self.tr( |
129 'Change all occurrences in the local scope')) |
129 'Change all occurrences in the local scope')) |
130 self.refactoringChangeOccurrencesAct.setWhatsThis(self.trUtf8( |
130 self.refactoringChangeOccurrencesAct.setWhatsThis(self.tr( |
131 """<b>Change Occurrences</b>""" |
131 """<b>Change Occurrences</b>""" |
132 """<p>Change all occurrences in the local scope.</p>""" |
132 """<p>Change all occurrences in the local scope.</p>""" |
133 )) |
133 )) |
134 self.refactoringChangeOccurrencesAct.triggered[()].connect( |
134 self.refactoringChangeOccurrencesAct.triggered.connect( |
135 self.__changeOccurrences) |
135 self.__changeOccurrences) |
136 self.actions.append(self.refactoringChangeOccurrencesAct) |
136 self.actions.append(self.refactoringChangeOccurrencesAct) |
137 |
137 |
138 ##################################################### |
138 ##################################################### |
139 ## Extract refactoring actions |
139 ## Extract refactoring actions |
140 ##################################################### |
140 ##################################################### |
141 |
141 |
142 self.refactoringExtractMethodAct = E5Action( |
142 self.refactoringExtractMethodAct = E5Action( |
143 self.trUtf8('Extract method'), |
143 self.tr('Extract method'), |
144 self.trUtf8('Extract &Method'), |
144 self.tr('Extract &Method'), |
145 0, 0, |
145 0, 0, |
146 self, 'refactoring_extract_method') |
146 self, 'refactoring_extract_method') |
147 self.refactoringExtractMethodAct.setStatusTip(self.trUtf8( |
147 self.refactoringExtractMethodAct.setStatusTip(self.tr( |
148 'Extract the highlighted area as a method')) |
148 'Extract the highlighted area as a method')) |
149 self.refactoringExtractMethodAct.setWhatsThis(self.trUtf8( |
149 self.refactoringExtractMethodAct.setWhatsThis(self.tr( |
150 """<b>Extract method</b>""" |
150 """<b>Extract method</b>""" |
151 """<p>Extract the highlighted area as a method or function.</p>""" |
151 """<p>Extract the highlighted area as a method or function.</p>""" |
152 )) |
152 )) |
153 self.refactoringExtractMethodAct.triggered[()].connect( |
153 self.refactoringExtractMethodAct.triggered.connect( |
154 self.__extractMethod) |
154 self.__extractMethod) |
155 self.actions.append(self.refactoringExtractMethodAct) |
155 self.actions.append(self.refactoringExtractMethodAct) |
156 |
156 |
157 self.refactoringExtractLocalVariableAct = E5Action( |
157 self.refactoringExtractLocalVariableAct = E5Action( |
158 self.trUtf8('Extract local variable'), |
158 self.tr('Extract local variable'), |
159 self.trUtf8('&Extract Local Variable'), |
159 self.tr('&Extract Local Variable'), |
160 0, 0, |
160 0, 0, |
161 self, 'refactoring_extract_variable') |
161 self, 'refactoring_extract_variable') |
162 self.refactoringExtractLocalVariableAct.setStatusTip(self.trUtf8( |
162 self.refactoringExtractLocalVariableAct.setStatusTip(self.tr( |
163 'Extract the highlighted area as a local variable')) |
163 'Extract the highlighted area as a local variable')) |
164 self.refactoringExtractLocalVariableAct.setWhatsThis(self.trUtf8( |
164 self.refactoringExtractLocalVariableAct.setWhatsThis(self.tr( |
165 """<b>Extract local variable</b>""" |
165 """<b>Extract local variable</b>""" |
166 """<p>Extract the highlighted area as a local variable.</p>""" |
166 """<p>Extract the highlighted area as a local variable.</p>""" |
167 )) |
167 )) |
168 self.refactoringExtractLocalVariableAct.triggered[()].connect( |
168 self.refactoringExtractLocalVariableAct.triggered.connect( |
169 self.__extractLocalVariable) |
169 self.__extractLocalVariable) |
170 self.actions.append(self.refactoringExtractLocalVariableAct) |
170 self.actions.append(self.refactoringExtractLocalVariableAct) |
171 |
171 |
172 ##################################################### |
172 ##################################################### |
173 ## Inline refactoring actions |
173 ## Inline refactoring actions |
174 ##################################################### |
174 ##################################################### |
175 |
175 |
176 self.refactoringInlineAct = E5Action( |
176 self.refactoringInlineAct = E5Action( |
177 self.trUtf8('Inline'), |
177 self.tr('Inline'), |
178 self.trUtf8('&Inline'), |
178 self.tr('&Inline'), |
179 0, 0, |
179 0, 0, |
180 self, 'refactoring_inline') |
180 self, 'refactoring_inline') |
181 self.refactoringInlineAct.setStatusTip(self.trUtf8( |
181 self.refactoringInlineAct.setStatusTip(self.tr( |
182 'Inlines the selected local variable or method')) |
182 'Inlines the selected local variable or method')) |
183 self.refactoringInlineAct.setWhatsThis(self.trUtf8( |
183 self.refactoringInlineAct.setWhatsThis(self.tr( |
184 """<b>Inline</b>""" |
184 """<b>Inline</b>""" |
185 """<p>Inlines the selected local variable or method.</p>""" |
185 """<p>Inlines the selected local variable or method.</p>""" |
186 )) |
186 )) |
187 self.refactoringInlineAct.triggered[()].connect( |
187 self.refactoringInlineAct.triggered.connect( |
188 self.__inline) |
188 self.__inline) |
189 self.actions.append(self.refactoringInlineAct) |
189 self.actions.append(self.refactoringInlineAct) |
190 |
190 |
191 ##################################################### |
191 ##################################################### |
192 ## Move refactoring actions |
192 ## Move refactoring actions |
193 ##################################################### |
193 ##################################################### |
194 |
194 |
195 self.refactoringMoveMethodAct = E5Action( |
195 self.refactoringMoveMethodAct = E5Action( |
196 self.trUtf8('Move method'), |
196 self.tr('Move method'), |
197 self.trUtf8('Mo&ve Method'), |
197 self.tr('Mo&ve Method'), |
198 0, 0, |
198 0, 0, |
199 self, 'refactoring_move_method') |
199 self, 'refactoring_move_method') |
200 self.refactoringMoveMethodAct.setStatusTip(self.trUtf8( |
200 self.refactoringMoveMethodAct.setStatusTip(self.tr( |
201 'Move the highlighted method to another class')) |
201 'Move the highlighted method to another class')) |
202 self.refactoringMoveMethodAct.setWhatsThis(self.trUtf8( |
202 self.refactoringMoveMethodAct.setWhatsThis(self.tr( |
203 """<b>Move method</b>""" |
203 """<b>Move method</b>""" |
204 """<p>Move the highlighted method to another class.</p>""" |
204 """<p>Move the highlighted method to another class.</p>""" |
205 )) |
205 )) |
206 self.refactoringMoveMethodAct.triggered[()].connect( |
206 self.refactoringMoveMethodAct.triggered.connect( |
207 self.__moveMethod) |
207 self.__moveMethod) |
208 self.actions.append(self.refactoringMoveMethodAct) |
208 self.actions.append(self.refactoringMoveMethodAct) |
209 |
209 |
210 self.refactoringMoveModuleAct = E5Action( |
210 self.refactoringMoveModuleAct = E5Action( |
211 self.trUtf8('Move current module'), |
211 self.tr('Move current module'), |
212 self.trUtf8('Move Current Module'), |
212 self.tr('Move Current Module'), |
213 0, 0, |
213 0, 0, |
214 self, 'refactoring_move_module') |
214 self, 'refactoring_move_module') |
215 self.refactoringMoveModuleAct.setStatusTip(self.trUtf8( |
215 self.refactoringMoveModuleAct.setStatusTip(self.tr( |
216 'Move the current module to another package')) |
216 'Move the current module to another package')) |
217 self.refactoringMoveModuleAct.setWhatsThis(self.trUtf8( |
217 self.refactoringMoveModuleAct.setWhatsThis(self.tr( |
218 """<b>Move current module</b>""" |
218 """<b>Move current module</b>""" |
219 """<p>Move the current module to another package.</p>""" |
219 """<p>Move the current module to another package.</p>""" |
220 )) |
220 )) |
221 self.refactoringMoveModuleAct.triggered[()].connect( |
221 self.refactoringMoveModuleAct.triggered.connect( |
222 self.__moveModule) |
222 self.__moveModule) |
223 self.actions.append(self.refactoringMoveModuleAct) |
223 self.actions.append(self.refactoringMoveModuleAct) |
224 |
224 |
225 ##################################################### |
225 ##################################################### |
226 ## Use function refactoring action |
226 ## Use function refactoring action |
227 ##################################################### |
227 ##################################################### |
228 |
228 |
229 self.refactoringUseFunctionAct = E5Action( |
229 self.refactoringUseFunctionAct = E5Action( |
230 self.trUtf8('Use Function'), |
230 self.tr('Use Function'), |
231 self.trUtf8('Use Function'), |
231 self.tr('Use Function'), |
232 0, 0, |
232 0, 0, |
233 self, 'refactoring_use_function') |
233 self, 'refactoring_use_function') |
234 self.refactoringUseFunctionAct.setStatusTip(self.trUtf8( |
234 self.refactoringUseFunctionAct.setStatusTip(self.tr( |
235 'Use a function wherever possible.')) |
235 'Use a function wherever possible.')) |
236 self.refactoringUseFunctionAct.setWhatsThis(self.trUtf8( |
236 self.refactoringUseFunctionAct.setWhatsThis(self.tr( |
237 """<b>Use function</b>""" |
237 """<b>Use function</b>""" |
238 """<p>Tries to use a function wherever possible.</p>""" |
238 """<p>Tries to use a function wherever possible.</p>""" |
239 )) |
239 )) |
240 self.refactoringUseFunctionAct.triggered[()].connect( |
240 self.refactoringUseFunctionAct.triggered.connect( |
241 self.__useFunction) |
241 self.__useFunction) |
242 self.actions.append(self.refactoringUseFunctionAct) |
242 self.actions.append(self.refactoringUseFunctionAct) |
243 |
243 |
244 ##################################################### |
244 ##################################################### |
245 ## Introduce refactorings actions |
245 ## Introduce refactorings actions |
246 ##################################################### |
246 ##################################################### |
247 |
247 |
248 self.refactoringIntroduceFactoryAct = E5Action( |
248 self.refactoringIntroduceFactoryAct = E5Action( |
249 self.trUtf8('Introduce Factory Method'), |
249 self.tr('Introduce Factory Method'), |
250 self.trUtf8('Introduce &Factory Method'), |
250 self.tr('Introduce &Factory Method'), |
251 0, 0, |
251 0, 0, |
252 self, 'refactoring_introduce_factory_method') |
252 self, 'refactoring_introduce_factory_method') |
253 self.refactoringIntroduceFactoryAct.setStatusTip(self.trUtf8( |
253 self.refactoringIntroduceFactoryAct.setStatusTip(self.tr( |
254 'Introduce a factory method or function')) |
254 'Introduce a factory method or function')) |
255 self.refactoringIntroduceFactoryAct.setWhatsThis(self.trUtf8( |
255 self.refactoringIntroduceFactoryAct.setWhatsThis(self.tr( |
256 """<b>Introduce Factory Method</b>""" |
256 """<b>Introduce Factory Method</b>""" |
257 """<p>Introduce a factory method or function.</p>""" |
257 """<p>Introduce a factory method or function.</p>""" |
258 )) |
258 )) |
259 self.refactoringIntroduceFactoryAct.triggered[()].connect( |
259 self.refactoringIntroduceFactoryAct.triggered.connect( |
260 self.__introduceFactoryMethod) |
260 self.__introduceFactoryMethod) |
261 self.actions.append(self.refactoringIntroduceFactoryAct) |
261 self.actions.append(self.refactoringIntroduceFactoryAct) |
262 |
262 |
263 self.refactoringIntroduceParameterAct = E5Action( |
263 self.refactoringIntroduceParameterAct = E5Action( |
264 self.trUtf8('Introduce Parameter'), |
264 self.tr('Introduce Parameter'), |
265 self.trUtf8('Introduce &Parameter'), |
265 self.tr('Introduce &Parameter'), |
266 0, 0, |
266 0, 0, |
267 self, 'refactoring_introduce_parameter_method') |
267 self, 'refactoring_introduce_parameter_method') |
268 self.refactoringIntroduceParameterAct.setStatusTip(self.trUtf8( |
268 self.refactoringIntroduceParameterAct.setStatusTip(self.tr( |
269 'Introduce a parameter in a function')) |
269 'Introduce a parameter in a function')) |
270 self.refactoringIntroduceParameterAct.setWhatsThis(self.trUtf8( |
270 self.refactoringIntroduceParameterAct.setWhatsThis(self.tr( |
271 """<b>Introduce Parameter</b>""" |
271 """<b>Introduce Parameter</b>""" |
272 """<p>Introduce a parameter in a function.</p>""" |
272 """<p>Introduce a parameter in a function.</p>""" |
273 )) |
273 )) |
274 self.refactoringIntroduceParameterAct.triggered[()].connect( |
274 self.refactoringIntroduceParameterAct.triggered.connect( |
275 self.__introduceParameter) |
275 self.__introduceParameter) |
276 self.actions.append(self.refactoringIntroduceParameterAct) |
276 self.actions.append(self.refactoringIntroduceParameterAct) |
277 |
277 |
278 ##################################################### |
278 ##################################################### |
279 ## Import refactorings actions |
279 ## Import refactorings actions |
280 ##################################################### |
280 ##################################################### |
281 |
281 |
282 self.refactoringImportsOrganizeAct = E5Action( |
282 self.refactoringImportsOrganizeAct = E5Action( |
283 self.trUtf8('Organize Imports'), |
283 self.tr('Organize Imports'), |
284 self.trUtf8('&Organize Imports'), |
284 self.tr('&Organize Imports'), |
285 0, 0, |
285 0, 0, |
286 self, 'refactoring_organize_imports') |
286 self, 'refactoring_organize_imports') |
287 self.refactoringImportsOrganizeAct.setStatusTip(self.trUtf8( |
287 self.refactoringImportsOrganizeAct.setStatusTip(self.tr( |
288 'Sort imports according to PEP-8')) |
288 'Sort imports according to PEP-8')) |
289 self.refactoringImportsOrganizeAct.setWhatsThis(self.trUtf8( |
289 self.refactoringImportsOrganizeAct.setWhatsThis(self.tr( |
290 """<b>Organize Imports</b>""" |
290 """<b>Organize Imports</b>""" |
291 """<p>Sort imports according to PEP-8.</p>""" |
291 """<p>Sort imports according to PEP-8.</p>""" |
292 )) |
292 )) |
293 self.refactoringImportsOrganizeAct.triggered[()].connect( |
293 self.refactoringImportsOrganizeAct.triggered.connect( |
294 self.__importsOrganize) |
294 self.__importsOrganize) |
295 self.actions.append(self.refactoringImportsOrganizeAct) |
295 self.actions.append(self.refactoringImportsOrganizeAct) |
296 |
296 |
297 self.refactoringImportsStarExpandAct = E5Action( |
297 self.refactoringImportsStarExpandAct = E5Action( |
298 self.trUtf8('Expand Star Imports'), |
298 self.tr('Expand Star Imports'), |
299 self.trUtf8('E&xpand Star Imports'), |
299 self.tr('E&xpand Star Imports'), |
300 0, 0, |
300 0, 0, |
301 self, 'refactoring_expand_star_imports') |
301 self, 'refactoring_expand_star_imports') |
302 self.refactoringImportsStarExpandAct.setStatusTip(self.trUtf8( |
302 self.refactoringImportsStarExpandAct.setStatusTip(self.tr( |
303 'Expand imports like "from xxx import *"')) |
303 'Expand imports like "from xxx import *"')) |
304 self.refactoringImportsStarExpandAct.setWhatsThis(self.trUtf8( |
304 self.refactoringImportsStarExpandAct.setWhatsThis(self.tr( |
305 """<b>Expand Star Imports</b>""" |
305 """<b>Expand Star Imports</b>""" |
306 """<p>Expand imports like "from xxx import *".</p>""" |
306 """<p>Expand imports like "from xxx import *".</p>""" |
307 """<p>Select the import to act on or none to do all.""" |
307 """<p>Select the import to act on or none to do all.""" |
308 """ Unused imports are deleted.</p>""" |
308 """ Unused imports are deleted.</p>""" |
309 )) |
309 )) |
310 self.refactoringImportsStarExpandAct.triggered[()].connect( |
310 self.refactoringImportsStarExpandAct.triggered.connect( |
311 self.__importsExpandStar) |
311 self.__importsExpandStar) |
312 self.actions.append(self.refactoringImportsStarExpandAct) |
312 self.actions.append(self.refactoringImportsStarExpandAct) |
313 |
313 |
314 self.refactoringImportsRelativeToAbsoluteAct = E5Action( |
314 self.refactoringImportsRelativeToAbsoluteAct = E5Action( |
315 self.trUtf8('Relative to Absolute'), |
315 self.tr('Relative to Absolute'), |
316 self.trUtf8('Relative to &Absolute'), |
316 self.tr('Relative to &Absolute'), |
317 0, 0, |
317 0, 0, |
318 self, 'refactoring_relative_to_absolute_imports') |
318 self, 'refactoring_relative_to_absolute_imports') |
319 self.refactoringImportsRelativeToAbsoluteAct.setStatusTip(self.trUtf8( |
319 self.refactoringImportsRelativeToAbsoluteAct.setStatusTip(self.tr( |
320 'Transform relative imports to absolute ones')) |
320 'Transform relative imports to absolute ones')) |
321 self.refactoringImportsRelativeToAbsoluteAct.setWhatsThis(self.trUtf8( |
321 self.refactoringImportsRelativeToAbsoluteAct.setWhatsThis(self.tr( |
322 """<b>Relative to Absolute</b>""" |
322 """<b>Relative to Absolute</b>""" |
323 """<p>Transform relative imports to absolute ones.</p>""" |
323 """<p>Transform relative imports to absolute ones.</p>""" |
324 """<p>Select the import to act on or none to do all.""" |
324 """<p>Select the import to act on or none to do all.""" |
325 """ Unused imports are deleted.</p>""" |
325 """ Unused imports are deleted.</p>""" |
326 )) |
326 )) |
327 self.refactoringImportsRelativeToAbsoluteAct.triggered[()].connect( |
327 self.refactoringImportsRelativeToAbsoluteAct.triggered.connect( |
328 self.__importsRelativeToAbsolute) |
328 self.__importsRelativeToAbsolute) |
329 self.actions.append(self.refactoringImportsRelativeToAbsoluteAct) |
329 self.actions.append(self.refactoringImportsRelativeToAbsoluteAct) |
330 |
330 |
331 self.refactoringImportsFromsToImportsAct = E5Action( |
331 self.refactoringImportsFromsToImportsAct = E5Action( |
332 self.trUtf8('Froms to Imports'), |
332 self.tr('Froms to Imports'), |
333 self.trUtf8('Froms to &Imports'), |
333 self.tr('Froms to &Imports'), |
334 0, 0, |
334 0, 0, |
335 self, 'refactoring_froms_to_imports') |
335 self, 'refactoring_froms_to_imports') |
336 self.refactoringImportsFromsToImportsAct.setStatusTip(self.trUtf8( |
336 self.refactoringImportsFromsToImportsAct.setStatusTip(self.tr( |
337 'Transform From imports to plain imports')) |
337 'Transform From imports to plain imports')) |
338 self.refactoringImportsFromsToImportsAct.setWhatsThis(self.trUtf8( |
338 self.refactoringImportsFromsToImportsAct.setWhatsThis(self.tr( |
339 """<b>Froms to Imports</b>""" |
339 """<b>Froms to Imports</b>""" |
340 """<p>Transform From imports to plain imports.</p>""" |
340 """<p>Transform From imports to plain imports.</p>""" |
341 """<p>Select the import to act on or none to do all.""" |
341 """<p>Select the import to act on or none to do all.""" |
342 """ Unused imports are deleted.</p>""" |
342 """ Unused imports are deleted.</p>""" |
343 )) |
343 )) |
344 self.refactoringImportsFromsToImportsAct.triggered[()].connect( |
344 self.refactoringImportsFromsToImportsAct.triggered.connect( |
345 self.__importsFromToImport) |
345 self.__importsFromToImport) |
346 self.actions.append(self.refactoringImportsFromsToImportsAct) |
346 self.actions.append(self.refactoringImportsFromsToImportsAct) |
347 |
347 |
348 self.refactoringImportsHandleLongAct = E5Action( |
348 self.refactoringImportsHandleLongAct = E5Action( |
349 self.trUtf8('Handle Long Imports'), |
349 self.tr('Handle Long Imports'), |
350 self.trUtf8('Handle &Long Imports'), |
350 self.tr('Handle &Long Imports'), |
351 0, 0, |
351 0, 0, |
352 self, 'refactoring_organize_imports') |
352 self, 'refactoring_organize_imports') |
353 self.refactoringImportsHandleLongAct.setStatusTip(self.trUtf8( |
353 self.refactoringImportsHandleLongAct.setStatusTip(self.tr( |
354 'Transform long import statements to look better')) |
354 'Transform long import statements to look better')) |
355 self.refactoringImportsHandleLongAct.setWhatsThis(self.trUtf8( |
355 self.refactoringImportsHandleLongAct.setWhatsThis(self.tr( |
356 """<b>Handle Long Imports</b>""" |
356 """<b>Handle Long Imports</b>""" |
357 """<p>Transform long import statements to look better.</p>""" |
357 """<p>Transform long import statements to look better.</p>""" |
358 """<p>Select the import to act on or none to do all.""" |
358 """<p>Select the import to act on or none to do all.""" |
359 """ Unused imports are deleted.</p>""" |
359 """ Unused imports are deleted.</p>""" |
360 )) |
360 )) |
361 self.refactoringImportsHandleLongAct.triggered[()].connect( |
361 self.refactoringImportsHandleLongAct.triggered.connect( |
362 self.__importsHandleLong) |
362 self.__importsHandleLong) |
363 self.actions.append(self.refactoringImportsHandleLongAct) |
363 self.actions.append(self.refactoringImportsHandleLongAct) |
364 |
364 |
365 ##################################################### |
365 ##################################################### |
366 ## Various refactorings actions |
366 ## Various refactorings actions |
367 ##################################################### |
367 ##################################################### |
368 |
368 |
369 self.refactoringRestructureAct = E5Action( |
369 self.refactoringRestructureAct = E5Action( |
370 self.trUtf8('Restructure'), |
370 self.tr('Restructure'), |
371 self.trUtf8('Res&tructure'), |
371 self.tr('Res&tructure'), |
372 0, 0, |
372 0, 0, |
373 self, 'refactoring_restructure') |
373 self, 'refactoring_restructure') |
374 self.refactoringRestructureAct.setStatusTip(self.trUtf8( |
374 self.refactoringRestructureAct.setStatusTip(self.tr( |
375 'Restructure code')) |
375 'Restructure code')) |
376 self.refactoringRestructureAct.setWhatsThis(self.trUtf8( |
376 self.refactoringRestructureAct.setWhatsThis(self.tr( |
377 """<b>Restructure</b>""" |
377 """<b>Restructure</b>""" |
378 """<p>Restructure code. See "Rope Help" for examples.</p>""" |
378 """<p>Restructure code. See "Rope Help" for examples.</p>""" |
379 )) |
379 )) |
380 self.refactoringRestructureAct.triggered[()].connect( |
380 self.refactoringRestructureAct.triggered.connect( |
381 self.__restructure) |
381 self.__restructure) |
382 self.actions.append(self.refactoringRestructureAct) |
382 self.actions.append(self.refactoringRestructureAct) |
383 |
383 |
384 self.refactoringChangeSignatureAct = E5Action( |
384 self.refactoringChangeSignatureAct = E5Action( |
385 self.trUtf8('Change Method Signature'), |
385 self.tr('Change Method Signature'), |
386 self.trUtf8('&Change Method Signature'), |
386 self.tr('&Change Method Signature'), |
387 0, 0, |
387 0, 0, |
388 self, 'refactoring_change_method_signature') |
388 self, 'refactoring_change_method_signature') |
389 self.refactoringChangeSignatureAct.setStatusTip(self.trUtf8( |
389 self.refactoringChangeSignatureAct.setStatusTip(self.tr( |
390 'Change the signature of the selected method or function')) |
390 'Change the signature of the selected method or function')) |
391 self.refactoringChangeSignatureAct.setWhatsThis(self.trUtf8( |
391 self.refactoringChangeSignatureAct.setWhatsThis(self.tr( |
392 """<b>Change Method Signature</b>""" |
392 """<b>Change Method Signature</b>""" |
393 """<p>Change the signature of the selected method""" |
393 """<p>Change the signature of the selected method""" |
394 """ or function.</p>""" |
394 """ or function.</p>""" |
395 )) |
395 )) |
396 self.refactoringChangeSignatureAct.triggered[()].connect( |
396 self.refactoringChangeSignatureAct.triggered.connect( |
397 self.__changeSignature) |
397 self.__changeSignature) |
398 self.actions.append(self.refactoringChangeSignatureAct) |
398 self.actions.append(self.refactoringChangeSignatureAct) |
399 |
399 |
400 self.refactoringInlineArgumentDefaultAct = E5Action( |
400 self.refactoringInlineArgumentDefaultAct = E5Action( |
401 self.trUtf8('Inline Argument Default'), |
401 self.tr('Inline Argument Default'), |
402 self.trUtf8('Inline &Argument Default'), |
402 self.tr('Inline &Argument Default'), |
403 0, 0, |
403 0, 0, |
404 self, 'refactoring_inline_argument_default') |
404 self, 'refactoring_inline_argument_default') |
405 self.refactoringInlineArgumentDefaultAct.setStatusTip(self.trUtf8( |
405 self.refactoringInlineArgumentDefaultAct.setStatusTip(self.tr( |
406 'Inline a parameters default value')) |
406 'Inline a parameters default value')) |
407 self.refactoringInlineArgumentDefaultAct.setWhatsThis(self.trUtf8( |
407 self.refactoringInlineArgumentDefaultAct.setWhatsThis(self.tr( |
408 """<b>Inline Argument Default</b>""" |
408 """<b>Inline Argument Default</b>""" |
409 """<p>Inline a parameters default value.</p>""" |
409 """<p>Inline a parameters default value.</p>""" |
410 )) |
410 )) |
411 self.refactoringInlineArgumentDefaultAct.triggered[()].connect( |
411 self.refactoringInlineArgumentDefaultAct.triggered.connect( |
412 self.__inlineArgumentDefault) |
412 self.__inlineArgumentDefault) |
413 self.actions.append(self.refactoringInlineArgumentDefaultAct) |
413 self.actions.append(self.refactoringInlineArgumentDefaultAct) |
414 |
414 |
415 self.refactoringTransformModuleAct = E5Action( |
415 self.refactoringTransformModuleAct = E5Action( |
416 self.trUtf8('Transform Module to Package'), |
416 self.tr('Transform Module to Package'), |
417 self.trUtf8('Transform Module to Package'), |
417 self.tr('Transform Module to Package'), |
418 0, 0, |
418 0, 0, |
419 self, 'refactoring_transform_module_to_package') |
419 self, 'refactoring_transform_module_to_package') |
420 self.refactoringTransformModuleAct.setStatusTip(self.trUtf8( |
420 self.refactoringTransformModuleAct.setStatusTip(self.tr( |
421 'Transform the current module to a package')) |
421 'Transform the current module to a package')) |
422 self.refactoringTransformModuleAct.setWhatsThis(self.trUtf8( |
422 self.refactoringTransformModuleAct.setWhatsThis(self.tr( |
423 """<b>Transform Module to Package</b>""" |
423 """<b>Transform Module to Package</b>""" |
424 """<p>Transform the current module to a package.</p>""" |
424 """<p>Transform the current module to a package.</p>""" |
425 )) |
425 )) |
426 self.refactoringTransformModuleAct.triggered[()].connect( |
426 self.refactoringTransformModuleAct.triggered.connect( |
427 self.__transformModuleToPackage) |
427 self.__transformModuleToPackage) |
428 self.actions.append(self.refactoringTransformModuleAct) |
428 self.actions.append(self.refactoringTransformModuleAct) |
429 |
429 |
430 self.refactoringEncapsulateAttributeAct = E5Action( |
430 self.refactoringEncapsulateAttributeAct = E5Action( |
431 self.trUtf8('Encapsulate Attribute'), |
431 self.tr('Encapsulate Attribute'), |
432 self.trUtf8('Encap&sulate Attribute'), |
432 self.tr('Encap&sulate Attribute'), |
433 0, 0, |
433 0, 0, |
434 self, 'refactoring_encapsulate_attribute') |
434 self, 'refactoring_encapsulate_attribute') |
435 self.refactoringEncapsulateAttributeAct.setStatusTip(self.trUtf8( |
435 self.refactoringEncapsulateAttributeAct.setStatusTip(self.tr( |
436 'Generate a getter/setter for an attribute')) |
436 'Generate a getter/setter for an attribute')) |
437 self.refactoringEncapsulateAttributeAct.setWhatsThis(self.trUtf8( |
437 self.refactoringEncapsulateAttributeAct.setWhatsThis(self.tr( |
438 """<b>Encapsulate Attribute</b>""" |
438 """<b>Encapsulate Attribute</b>""" |
439 """<p>Generate a getter/setter for an attribute and changes""" |
439 """<p>Generate a getter/setter for an attribute and changes""" |
440 """ its occurrences to use them.</p>""" |
440 """ its occurrences to use them.</p>""" |
441 )) |
441 )) |
442 self.refactoringEncapsulateAttributeAct.triggered[()].connect( |
442 self.refactoringEncapsulateAttributeAct.triggered.connect( |
443 self.__encapsulateAttribute) |
443 self.__encapsulateAttribute) |
444 self.actions.append(self.refactoringEncapsulateAttributeAct) |
444 self.actions.append(self.refactoringEncapsulateAttributeAct) |
445 |
445 |
446 self.refactoringLocalVariableToAttributeAct = E5Action( |
446 self.refactoringLocalVariableToAttributeAct = E5Action( |
447 self.trUtf8('Local Variable to Attribute'), |
447 self.tr('Local Variable to Attribute'), |
448 self.trUtf8('Local Varia&ble to Attribute'), |
448 self.tr('Local Varia&ble to Attribute'), |
449 0, 0, |
449 0, 0, |
450 self, 'refactoring_local_variable_to_attribute') |
450 self, 'refactoring_local_variable_to_attribute') |
451 self.refactoringLocalVariableToAttributeAct.setStatusTip(self.trUtf8( |
451 self.refactoringLocalVariableToAttributeAct.setStatusTip(self.tr( |
452 'Change a local variable to an attribute')) |
452 'Change a local variable to an attribute')) |
453 self.refactoringLocalVariableToAttributeAct.setWhatsThis(self.trUtf8( |
453 self.refactoringLocalVariableToAttributeAct.setWhatsThis(self.tr( |
454 """<b>Local Variable to Attribute</b>""" |
454 """<b>Local Variable to Attribute</b>""" |
455 """<p>Change a local variable to an attribute.</p>""" |
455 """<p>Change a local variable to an attribute.</p>""" |
456 )) |
456 )) |
457 self.refactoringLocalVariableToAttributeAct.triggered[()].connect( |
457 self.refactoringLocalVariableToAttributeAct.triggered.connect( |
458 self.__convertLocalToAttribute) |
458 self.__convertLocalToAttribute) |
459 self.actions.append(self.refactoringLocalVariableToAttributeAct) |
459 self.actions.append(self.refactoringLocalVariableToAttributeAct) |
460 |
460 |
461 self.refactoringMethodToMethodObjectAct = E5Action( |
461 self.refactoringMethodToMethodObjectAct = E5Action( |
462 self.trUtf8('Method To Method Object'), |
462 self.tr('Method To Method Object'), |
463 self.trUtf8('Method To Method Ob&ject'), |
463 self.tr('Method To Method Ob&ject'), |
464 0, 0, |
464 0, 0, |
465 self, 'refactoring_method_to_methodobject') |
465 self, 'refactoring_method_to_methodobject') |
466 self.refactoringMethodToMethodObjectAct.setStatusTip(self.trUtf8( |
466 self.refactoringMethodToMethodObjectAct.setStatusTip(self.tr( |
467 'Transform a function or a method to a method object')) |
467 'Transform a function or a method to a method object')) |
468 self.refactoringMethodToMethodObjectAct.setWhatsThis(self.trUtf8( |
468 self.refactoringMethodToMethodObjectAct.setWhatsThis(self.tr( |
469 """<b>Method To Method Object</b>""" |
469 """<b>Method To Method Object</b>""" |
470 """<p>Transform a function or a method to a method object.</p>""" |
470 """<p>Transform a function or a method to a method object.</p>""" |
471 )) |
471 )) |
472 self.refactoringMethodToMethodObjectAct.triggered[()].connect( |
472 self.refactoringMethodToMethodObjectAct.triggered.connect( |
473 self.__methodToMethodObject) |
473 self.__methodToMethodObject) |
474 self.actions.append(self.refactoringMethodToMethodObjectAct) |
474 self.actions.append(self.refactoringMethodToMethodObjectAct) |
475 |
475 |
476 ##################################################### |
476 ##################################################### |
477 ## Undo/Redo actions |
477 ## Undo/Redo actions |
478 ##################################################### |
478 ##################################################### |
479 |
479 |
480 self.refactoringUndoAct = E5Action( |
480 self.refactoringUndoAct = E5Action( |
481 self.trUtf8('Undo'), |
481 self.tr('Undo'), |
482 self.trUtf8('&Undo'), |
482 self.tr('&Undo'), |
483 0, 0, |
483 0, 0, |
484 self, 'refactoring_undo') |
484 self, 'refactoring_undo') |
485 self.refactoringUndoAct.setStatusTip(self.trUtf8( |
485 self.refactoringUndoAct.setStatusTip(self.tr( |
486 'Undo the last refactoring')) |
486 'Undo the last refactoring')) |
487 self.refactoringUndoAct.setWhatsThis(self.trUtf8( |
487 self.refactoringUndoAct.setWhatsThis(self.tr( |
488 """<b>Undo</b>""" |
488 """<b>Undo</b>""" |
489 """<p>Undo the last refactoring.</p>""" |
489 """<p>Undo the last refactoring.</p>""" |
490 )) |
490 )) |
491 self.refactoringUndoAct.triggered[()].connect( |
491 self.refactoringUndoAct.triggered.connect( |
492 self.__undo) |
492 self.__undo) |
493 self.actions.append(self.refactoringUndoAct) |
493 self.actions.append(self.refactoringUndoAct) |
494 |
494 |
495 self.refactoringRedoAct = E5Action( |
495 self.refactoringRedoAct = E5Action( |
496 self.trUtf8('Redo'), |
496 self.tr('Redo'), |
497 self.trUtf8('Re&do'), |
497 self.tr('Re&do'), |
498 0, 0, |
498 0, 0, |
499 self, 'refactoring_redo') |
499 self, 'refactoring_redo') |
500 self.refactoringRedoAct.setStatusTip(self.trUtf8( |
500 self.refactoringRedoAct.setStatusTip(self.tr( |
501 'Redo the last refactoring')) |
501 'Redo the last refactoring')) |
502 self.refactoringRedoAct.setWhatsThis(self.trUtf8( |
502 self.refactoringRedoAct.setWhatsThis(self.tr( |
503 """<b>Redo</b>""" |
503 """<b>Redo</b>""" |
504 """<p>Redo the last refactoring.</p>""" |
504 """<p>Redo the last refactoring.</p>""" |
505 )) |
505 )) |
506 self.refactoringRedoAct.triggered[()].connect( |
506 self.refactoringRedoAct.triggered.connect( |
507 self.__redo) |
507 self.__redo) |
508 self.actions.append(self.refactoringRedoAct) |
508 self.actions.append(self.refactoringRedoAct) |
509 |
509 |
510 self.refactoringUndoHistoryAct = E5Action( |
510 self.refactoringUndoHistoryAct = E5Action( |
511 self.trUtf8('Show Project Undo History'), |
511 self.tr('Show Project Undo History'), |
512 self.trUtf8('Show Project Undo History'), |
512 self.tr('Show Project Undo History'), |
513 0, 0, |
513 0, 0, |
514 self, 'refactoring_show_project_undo_history') |
514 self, 'refactoring_show_project_undo_history') |
515 self.refactoringUndoHistoryAct.setStatusTip(self.trUtf8( |
515 self.refactoringUndoHistoryAct.setStatusTip(self.tr( |
516 'Show the undo history of the project')) |
516 'Show the undo history of the project')) |
517 self.refactoringUndoHistoryAct.setWhatsThis(self.trUtf8( |
517 self.refactoringUndoHistoryAct.setWhatsThis(self.tr( |
518 """<b>Show Project Undo History</b>""" |
518 """<b>Show Project Undo History</b>""" |
519 """<p>Opens a dialog to show the undo history list of""" |
519 """<p>Opens a dialog to show the undo history list of""" |
520 """ the project.</p>""" |
520 """ the project.</p>""" |
521 )) |
521 )) |
522 self.refactoringUndoHistoryAct.triggered[()].connect( |
522 self.refactoringUndoHistoryAct.triggered.connect( |
523 self.__showProjectUndoHistory) |
523 self.__showProjectUndoHistory) |
524 self.actions.append(self.refactoringUndoHistoryAct) |
524 self.actions.append(self.refactoringUndoHistoryAct) |
525 |
525 |
526 self.refactoringRedoHistoryAct = E5Action( |
526 self.refactoringRedoHistoryAct = E5Action( |
527 self.trUtf8('Show Project Redo History'), |
527 self.tr('Show Project Redo History'), |
528 self.trUtf8('Show Project Redo History'), |
528 self.tr('Show Project Redo History'), |
529 0, 0, |
529 0, 0, |
530 self, 'refactoring_show_project_redo_history') |
530 self, 'refactoring_show_project_redo_history') |
531 self.refactoringRedoHistoryAct.setStatusTip(self.trUtf8( |
531 self.refactoringRedoHistoryAct.setStatusTip(self.tr( |
532 'Show the redo history of the project')) |
532 'Show the redo history of the project')) |
533 self.refactoringRedoHistoryAct.setWhatsThis(self.trUtf8( |
533 self.refactoringRedoHistoryAct.setWhatsThis(self.tr( |
534 """<b>Show Project Redo History</b>""" |
534 """<b>Show Project Redo History</b>""" |
535 """<p>Opens a dialog to show the redo history list of""" |
535 """<p>Opens a dialog to show the redo history list of""" |
536 """ the project.</p>""" |
536 """ the project.</p>""" |
537 )) |
537 )) |
538 self.refactoringRedoHistoryAct.triggered[()].connect( |
538 self.refactoringRedoHistoryAct.triggered.connect( |
539 self.__showProjectRedoHistory) |
539 self.__showProjectRedoHistory) |
540 self.actions.append(self.refactoringRedoHistoryAct) |
540 self.actions.append(self.refactoringRedoHistoryAct) |
541 |
541 |
542 self.refactoringUndoFileHistoryAct = E5Action( |
542 self.refactoringUndoFileHistoryAct = E5Action( |
543 self.trUtf8('Show Current File Undo History'), |
543 self.tr('Show Current File Undo History'), |
544 self.trUtf8('Show Current File Undo History'), |
544 self.tr('Show Current File Undo History'), |
545 0, 0, |
545 0, 0, |
546 self, 'refactoring_show_file_undo_history') |
546 self, 'refactoring_show_file_undo_history') |
547 self.refactoringUndoFileHistoryAct.setStatusTip(self.trUtf8( |
547 self.refactoringUndoFileHistoryAct.setStatusTip(self.tr( |
548 'Show the undo history of the current file')) |
548 'Show the undo history of the current file')) |
549 self.refactoringUndoFileHistoryAct.setWhatsThis(self.trUtf8( |
549 self.refactoringUndoFileHistoryAct.setWhatsThis(self.tr( |
550 """<b>Show Current File Undo History</b>""" |
550 """<b>Show Current File Undo History</b>""" |
551 """<p>Opens a dialog to show the undo history list of""" |
551 """<p>Opens a dialog to show the undo history list of""" |
552 """ the current file.</p>""" |
552 """ the current file.</p>""" |
553 )) |
553 )) |
554 self.refactoringUndoFileHistoryAct.triggered[()].connect( |
554 self.refactoringUndoFileHistoryAct.triggered.connect( |
555 self.__showFileUndoHistory) |
555 self.__showFileUndoHistory) |
556 self.actions.append(self.refactoringUndoFileHistoryAct) |
556 self.actions.append(self.refactoringUndoFileHistoryAct) |
557 |
557 |
558 self.refactoringRedoFileHistoryAct = E5Action( |
558 self.refactoringRedoFileHistoryAct = E5Action( |
559 self.trUtf8('Show Current File Redo History'), |
559 self.tr('Show Current File Redo History'), |
560 self.trUtf8('Show Current File Redo History'), |
560 self.tr('Show Current File Redo History'), |
561 0, 0, |
561 0, 0, |
562 self, 'refactoring_show_file_redo_history') |
562 self, 'refactoring_show_file_redo_history') |
563 self.refactoringRedoFileHistoryAct.setStatusTip(self.trUtf8( |
563 self.refactoringRedoFileHistoryAct.setStatusTip(self.tr( |
564 'Show the redo history of the current file')) |
564 'Show the redo history of the current file')) |
565 self.refactoringRedoFileHistoryAct.setWhatsThis(self.trUtf8( |
565 self.refactoringRedoFileHistoryAct.setWhatsThis(self.tr( |
566 """<b>Show Current File Redo History</b>""" |
566 """<b>Show Current File Redo History</b>""" |
567 """<p>Opens a dialog to show the redo history list of""" |
567 """<p>Opens a dialog to show the redo history list of""" |
568 """ the current file.</p>""" |
568 """ the current file.</p>""" |
569 )) |
569 )) |
570 self.refactoringRedoFileHistoryAct.triggered[()].connect( |
570 self.refactoringRedoFileHistoryAct.triggered.connect( |
571 self.__showFileRedoHistory) |
571 self.__showFileRedoHistory) |
572 self.actions.append(self.refactoringRedoFileHistoryAct) |
572 self.actions.append(self.refactoringRedoFileHistoryAct) |
573 |
573 |
574 self.refactoringClearHistoryAct = E5Action( |
574 self.refactoringClearHistoryAct = E5Action( |
575 self.trUtf8('Clear History'), |
575 self.tr('Clear History'), |
576 self.trUtf8('Clear History'), |
576 self.tr('Clear History'), |
577 0, 0, |
577 0, 0, |
578 self, 'refactoring_clear_history') |
578 self, 'refactoring_clear_history') |
579 self.refactoringClearHistoryAct.setStatusTip(self.trUtf8( |
579 self.refactoringClearHistoryAct.setStatusTip(self.tr( |
580 'Clear the refactoring history')) |
580 'Clear the refactoring history')) |
581 self.refactoringClearHistoryAct.setWhatsThis(self.trUtf8( |
581 self.refactoringClearHistoryAct.setWhatsThis(self.tr( |
582 """<b>Clear History</b>""" |
582 """<b>Clear History</b>""" |
583 """<p>Clears the refactoring history.</p>""" |
583 """<p>Clears the refactoring history.</p>""" |
584 )) |
584 )) |
585 self.refactoringClearHistoryAct.triggered[()].connect( |
585 self.refactoringClearHistoryAct.triggered.connect( |
586 self.__clearHistory) |
586 self.__clearHistory) |
587 self.actions.append(self.refactoringClearHistoryAct) |
587 self.actions.append(self.refactoringClearHistoryAct) |
588 |
588 |
589 ##################################################### |
589 ##################################################### |
590 ## Query actions |
590 ## Query actions |
591 ##################################################### |
591 ##################################################### |
592 |
592 |
593 self.queryReferencesAct = E5Action( |
593 self.queryReferencesAct = E5Action( |
594 self.trUtf8('Find occurrences'), |
594 self.tr('Find occurrences'), |
595 self.trUtf8('Find &Occurrences'), |
595 self.tr('Find &Occurrences'), |
596 0, 0, |
596 0, 0, |
597 self, 'refactoring_find_occurrences') |
597 self, 'refactoring_find_occurrences') |
598 self.queryReferencesAct.setStatusTip(self.trUtf8( |
598 self.queryReferencesAct.setStatusTip(self.tr( |
599 'Find occurrences of the highlighted object')) |
599 'Find occurrences of the highlighted object')) |
600 self.queryReferencesAct.setWhatsThis(self.trUtf8( |
600 self.queryReferencesAct.setWhatsThis(self.tr( |
601 """<b>Find occurrences</b>""" |
601 """<b>Find occurrences</b>""" |
602 """<p>Find occurrences of the highlighted class, method,""" |
602 """<p>Find occurrences of the highlighted class, method,""" |
603 """ function or variable.</p>""" |
603 """ function or variable.</p>""" |
604 )) |
604 )) |
605 self.queryReferencesAct.triggered[()].connect( |
605 self.queryReferencesAct.triggered.connect( |
606 self.__queryReferences) |
606 self.__queryReferences) |
607 self.actions.append(self.queryReferencesAct) |
607 self.actions.append(self.queryReferencesAct) |
608 |
608 |
609 self.queryDefinitionAct = E5Action( |
609 self.queryDefinitionAct = E5Action( |
610 self.trUtf8('Find definition'), |
610 self.tr('Find definition'), |
611 self.trUtf8('Find &Definition'), |
611 self.tr('Find &Definition'), |
612 0, 0, |
612 0, 0, |
613 self, 'refactoring_find_definition') |
613 self, 'refactoring_find_definition') |
614 self.queryDefinitionAct.setStatusTip(self.trUtf8( |
614 self.queryDefinitionAct.setStatusTip(self.tr( |
615 'Find definition of the highlighted item')) |
615 'Find definition of the highlighted item')) |
616 self.queryDefinitionAct.setWhatsThis(self.trUtf8( |
616 self.queryDefinitionAct.setWhatsThis(self.tr( |
617 """<b>Find definition</b>""" |
617 """<b>Find definition</b>""" |
618 """<p>Find the definition of the highlighted class, method,""" |
618 """<p>Find the definition of the highlighted class, method,""" |
619 """ function or variable.</p>""" |
619 """ function or variable.</p>""" |
620 )) |
620 )) |
621 self.queryDefinitionAct.triggered[()].connect( |
621 self.queryDefinitionAct.triggered.connect( |
622 self.__queryDefinition) |
622 self.__queryDefinition) |
623 self.actions.append(self.queryDefinitionAct) |
623 self.actions.append(self.queryDefinitionAct) |
624 |
624 |
625 self.queryImplementationsAct = E5Action( |
625 self.queryImplementationsAct = E5Action( |
626 self.trUtf8('Find implementations'), |
626 self.tr('Find implementations'), |
627 self.trUtf8('Find &Implementations'), |
627 self.tr('Find &Implementations'), |
628 0, 0, |
628 0, 0, |
629 self, 'refactoring_find_implementations') |
629 self, 'refactoring_find_implementations') |
630 self.queryImplementationsAct.setStatusTip(self.trUtf8( |
630 self.queryImplementationsAct.setStatusTip(self.tr( |
631 'Find places where the selected method is overridden')) |
631 'Find places where the selected method is overridden')) |
632 self.queryImplementationsAct.setWhatsThis(self.trUtf8( |
632 self.queryImplementationsAct.setWhatsThis(self.tr( |
633 """<b>Find implementations</b>""" |
633 """<b>Find implementations</b>""" |
634 """<p>Find places where the selected method is overridden.</p>""" |
634 """<p>Find places where the selected method is overridden.</p>""" |
635 )) |
635 )) |
636 self.queryImplementationsAct.triggered[()].connect( |
636 self.queryImplementationsAct.triggered.connect( |
637 self.__queryImplementations) |
637 self.__queryImplementations) |
638 self.actions.append(self.queryImplementationsAct) |
638 self.actions.append(self.queryImplementationsAct) |
639 |
639 |
640 ##################################################### |
640 ##################################################### |
641 ## Various actions |
641 ## Various actions |
642 ##################################################### |
642 ##################################################### |
643 |
643 |
644 self.refactoringEditConfigAct = E5Action( |
644 self.refactoringEditConfigAct = E5Action( |
645 self.trUtf8('Configure Rope'), |
645 self.tr('Configure Rope'), |
646 self.trUtf8('&Configure Rope'), |
646 self.tr('&Configure Rope'), |
647 0, 0, |
647 0, 0, |
648 self, 'refactoring_edit_config') |
648 self, 'refactoring_edit_config') |
649 self.refactoringEditConfigAct.setStatusTip(self.trUtf8( |
649 self.refactoringEditConfigAct.setStatusTip(self.tr( |
650 'Open the rope configuration file')) |
650 'Open the rope configuration file')) |
651 self.refactoringEditConfigAct.setWhatsThis(self.trUtf8( |
651 self.refactoringEditConfigAct.setWhatsThis(self.tr( |
652 """<b>Configure Rope</b>""" |
652 """<b>Configure Rope</b>""" |
653 """<p>Opens the rope configuration file in an editor.</p>""" |
653 """<p>Opens the rope configuration file in an editor.</p>""" |
654 )) |
654 )) |
655 self.refactoringEditConfigAct.triggered[()].connect( |
655 self.refactoringEditConfigAct.triggered.connect( |
656 self.__editConfig) |
656 self.__editConfig) |
657 self.refactoringEditConfigAct.setMenuRole(QAction.NoRole) |
657 self.refactoringEditConfigAct.setMenuRole(QAction.NoRole) |
658 self.actions.append(self.refactoringEditConfigAct) |
658 self.actions.append(self.refactoringEditConfigAct) |
659 |
659 |
660 self.refactoringHelpAct = E5Action( |
660 self.refactoringHelpAct = E5Action( |
661 self.trUtf8('Rope help'), |
661 self.tr('Rope help'), |
662 self.trUtf8('Rope &Help'), |
662 self.tr('Rope &Help'), |
663 0, 0, |
663 0, 0, |
664 self, 'refactoring_help') |
664 self, 'refactoring_help') |
665 self.refactoringHelpAct.setStatusTip(self.trUtf8( |
665 self.refactoringHelpAct.setStatusTip(self.tr( |
666 'Show help about the rope refactorings')) |
666 'Show help about the rope refactorings')) |
667 self.refactoringHelpAct.setWhatsThis(self.trUtf8( |
667 self.refactoringHelpAct.setWhatsThis(self.tr( |
668 """<b>Rope help</b>""" |
668 """<b>Rope help</b>""" |
669 """<p>Show some help text about the rope refactorings.</p>""" |
669 """<p>Show some help text about the rope refactorings.</p>""" |
670 )) |
670 )) |
671 self.refactoringHelpAct.triggered[()].connect( |
671 self.refactoringHelpAct.triggered.connect( |
672 self.__showRopeHelp) |
672 self.__showRopeHelp) |
673 self.actions.append(self.refactoringHelpAct) |
673 self.actions.append(self.refactoringHelpAct) |
674 |
674 |
675 self.refactoringAllSoaAct = E5Action( |
675 self.refactoringAllSoaAct = E5Action( |
676 self.trUtf8('Analyse all modules'), |
676 self.tr('Analyse all modules'), |
677 self.trUtf8('&Analyse all modules'), |
677 self.tr('&Analyse all modules'), |
678 0, 0, |
678 0, 0, |
679 self, 'refactoring_analyze_all') |
679 self, 'refactoring_analyze_all') |
680 self.refactoringAllSoaAct.setStatusTip(self.trUtf8( |
680 self.refactoringAllSoaAct.setStatusTip(self.tr( |
681 'Perform static object analysis on all modules')) |
681 'Perform static object analysis on all modules')) |
682 self.refactoringAllSoaAct.setWhatsThis(self.trUtf8( |
682 self.refactoringAllSoaAct.setWhatsThis(self.tr( |
683 """<b>Analyse all modules</b>""" |
683 """<b>Analyse all modules</b>""" |
684 """<p>Perform static object analysis (SOA) on all modules. """ |
684 """<p>Perform static object analysis (SOA) on all modules. """ |
685 """This might be time consuming. Analysis of all modules """ |
685 """This might be time consuming. Analysis of all modules """ |
686 """should only be neccessary, if the project was created """ |
686 """should only be neccessary, if the project was created """ |
687 """with the rope plugin disabled or if files were added.</p>""" |
687 """with the rope plugin disabled or if files were added.</p>""" |
688 )) |
688 )) |
689 self.refactoringAllSoaAct.triggered[()].connect( |
689 self.refactoringAllSoaAct.triggered.connect( |
690 self.__performSOA) |
690 self.__performSOA) |
691 self.actions.append(self.refactoringAllSoaAct) |
691 self.actions.append(self.refactoringAllSoaAct) |
692 |
692 |
693 self.updateConfigAct = E5Action( |
693 self.updateConfigAct = E5Action( |
694 self.trUtf8('Update Configuration'), |
694 self.tr('Update Configuration'), |
695 self.trUtf8('&Update Configuration'), |
695 self.tr('&Update Configuration'), |
696 0, 0, |
696 0, 0, |
697 self, 'refactoring_update_configuration') |
697 self, 'refactoring_update_configuration') |
698 self.updateConfigAct.setStatusTip(self.trUtf8( |
698 self.updateConfigAct.setStatusTip(self.tr( |
699 'Generates a new configuration file overwriting the current one.')) |
699 'Generates a new configuration file overwriting the current one.')) |
700 self.updateConfigAct.setWhatsThis(self.trUtf8( |
700 self.updateConfigAct.setWhatsThis(self.tr( |
701 """<b>Update Configuration</b>""" |
701 """<b>Update Configuration</b>""" |
702 """<p>Generates a new configuration file overwriting""" |
702 """<p>Generates a new configuration file overwriting""" |
703 """ the current one.</p>""" |
703 """ the current one.</p>""" |
704 )) |
704 )) |
705 self.updateConfigAct.triggered[()].connect( |
705 self.updateConfigAct.triggered.connect( |
706 self.__updateConfig) |
706 self.__updateConfig) |
707 self.actions.append(self.updateConfigAct) |
707 self.actions.append(self.updateConfigAct) |
708 |
708 |
709 for act in self.actions: |
709 for act in self.actions: |
710 act.setEnabled(False) |
710 act.setEnabled(False) |