7 Module implementing the queues extension project helper. |
7 Module implementing the queues extension project helper. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtWidgets import QMenu |
10 from PyQt6.QtWidgets import QMenu |
11 |
11 |
12 from E5Gui.E5Action import E5Action |
12 from E5Gui.EricAction import EricAction |
13 from E5Gui import E5MessageBox |
13 from E5Gui import EricMessageBox |
14 |
14 |
15 from ..HgExtensionProjectHelper import HgExtensionProjectHelper |
15 from ..HgExtensionProjectHelper import HgExtensionProjectHelper |
16 |
16 |
17 from .queues import Queues |
17 from .queues import Queues |
18 |
18 |
29 |
29 |
30 def initActions(self): |
30 def initActions(self): |
31 """ |
31 """ |
32 Public method to generate the action objects. |
32 Public method to generate the action objects. |
33 """ |
33 """ |
34 self.hgQueueInitAct = E5Action( |
34 self.hgQueueInitAct = EricAction( |
35 self.tr('Init Queue Repository'), |
35 self.tr('Init Queue Repository'), |
36 self.tr('Init Queue Repository'), |
36 self.tr('Init Queue Repository'), |
37 0, 0, self, 'mercurial_queues_init') |
37 0, 0, self, 'mercurial_queues_init') |
38 self.hgQueueInitAct.setStatusTip(self.tr( |
38 self.hgQueueInitAct.setStatusTip(self.tr( |
39 'Initialize a new versioned queue repository' |
39 'Initialize a new versioned queue repository' |
44 """ the current repository.</p>""" |
44 """ the current repository.</p>""" |
45 )) |
45 )) |
46 self.hgQueueInitAct.triggered.connect(self.__hgQueueInit) |
46 self.hgQueueInitAct.triggered.connect(self.__hgQueueInit) |
47 self.actions.append(self.hgQueueInitAct) |
47 self.actions.append(self.hgQueueInitAct) |
48 |
48 |
49 self.hgQueueCommitAct = E5Action( |
49 self.hgQueueCommitAct = EricAction( |
50 self.tr('Commit changes'), |
50 self.tr('Commit changes'), |
51 self.tr('Commit changes...'), |
51 self.tr('Commit changes...'), |
52 0, 0, self, 'mercurial_queues_commit') |
52 0, 0, self, 'mercurial_queues_commit') |
53 self.hgQueueCommitAct.setStatusTip(self.tr( |
53 self.hgQueueCommitAct.setStatusTip(self.tr( |
54 'Commit changes in the queue repository' |
54 'Commit changes in the queue repository' |
58 """<p>This commits changes in the queue repository.</p>""" |
58 """<p>This commits changes in the queue repository.</p>""" |
59 )) |
59 )) |
60 self.hgQueueCommitAct.triggered.connect(self.__hgQueueCommit) |
60 self.hgQueueCommitAct.triggered.connect(self.__hgQueueCommit) |
61 self.actions.append(self.hgQueueCommitAct) |
61 self.actions.append(self.hgQueueCommitAct) |
62 |
62 |
63 self.hgQueueNewAct = E5Action( |
63 self.hgQueueNewAct = EricAction( |
64 self.tr('New Patch'), |
64 self.tr('New Patch'), |
65 self.tr('New Patch...'), |
65 self.tr('New Patch...'), |
66 0, 0, self, 'mercurial_queues_new') |
66 0, 0, self, 'mercurial_queues_new') |
67 self.hgQueueNewAct.setStatusTip(self.tr( |
67 self.hgQueueNewAct.setStatusTip(self.tr( |
68 'Create a new patch' |
68 'Create a new patch' |
72 """<p>This creates a new named patch.</p>""" |
72 """<p>This creates a new named patch.</p>""" |
73 )) |
73 )) |
74 self.hgQueueNewAct.triggered.connect(self.__hgQueueNewPatch) |
74 self.hgQueueNewAct.triggered.connect(self.__hgQueueNewPatch) |
75 self.actions.append(self.hgQueueNewAct) |
75 self.actions.append(self.hgQueueNewAct) |
76 |
76 |
77 self.hgQueueRefreshAct = E5Action( |
77 self.hgQueueRefreshAct = EricAction( |
78 self.tr('Update Current Patch'), |
78 self.tr('Update Current Patch'), |
79 self.tr('Update Current Patch'), |
79 self.tr('Update Current Patch'), |
80 0, 0, self, 'mercurial_queues_refresh') |
80 0, 0, self, 'mercurial_queues_refresh') |
81 self.hgQueueRefreshAct.setStatusTip(self.tr( |
81 self.hgQueueRefreshAct.setStatusTip(self.tr( |
82 'Update the current patch' |
82 'Update the current patch' |
87 )) |
87 )) |
88 self.hgQueueRefreshAct.triggered.connect( |
88 self.hgQueueRefreshAct.triggered.connect( |
89 self.__hgQueueRefreshPatch) |
89 self.__hgQueueRefreshPatch) |
90 self.actions.append(self.hgQueueRefreshAct) |
90 self.actions.append(self.hgQueueRefreshAct) |
91 |
91 |
92 self.hgQueueRefreshMessageAct = E5Action( |
92 self.hgQueueRefreshMessageAct = EricAction( |
93 self.tr('Update Current Patch (with Message)'), |
93 self.tr('Update Current Patch (with Message)'), |
94 self.tr('Update Current Patch (with Message)'), |
94 self.tr('Update Current Patch (with Message)'), |
95 0, 0, self, 'mercurial_queues_refresh_message') |
95 0, 0, self, 'mercurial_queues_refresh_message') |
96 self.hgQueueRefreshMessageAct.setStatusTip(self.tr( |
96 self.hgQueueRefreshMessageAct.setStatusTip(self.tr( |
97 'Update the current patch and edit commit message' |
97 'Update the current patch and edit commit message' |
103 )) |
103 )) |
104 self.hgQueueRefreshMessageAct.triggered.connect( |
104 self.hgQueueRefreshMessageAct.triggered.connect( |
105 self.__hgQueueRefreshPatchMessage) |
105 self.__hgQueueRefreshPatchMessage) |
106 self.actions.append(self.hgQueueRefreshMessageAct) |
106 self.actions.append(self.hgQueueRefreshMessageAct) |
107 |
107 |
108 self.hgQueueDiffAct = E5Action( |
108 self.hgQueueDiffAct = EricAction( |
109 self.tr('Show Current Patch'), |
109 self.tr('Show Current Patch'), |
110 self.tr('Show Current Patch...'), |
110 self.tr('Show Current Patch...'), |
111 0, 0, self, 'mercurial_queues_show') |
111 0, 0, self, 'mercurial_queues_show') |
112 self.hgQueueDiffAct.setStatusTip(self.tr( |
112 self.hgQueueDiffAct.setStatusTip(self.tr( |
113 'Show the contents the current patch' |
113 'Show the contents the current patch' |
119 """ since the last refresh.</p>""" |
119 """ since the last refresh.</p>""" |
120 )) |
120 )) |
121 self.hgQueueDiffAct.triggered.connect(self.__hgQueueShowPatch) |
121 self.hgQueueDiffAct.triggered.connect(self.__hgQueueShowPatch) |
122 self.actions.append(self.hgQueueDiffAct) |
122 self.actions.append(self.hgQueueDiffAct) |
123 |
123 |
124 self.hgQueueHeaderAct = E5Action( |
124 self.hgQueueHeaderAct = EricAction( |
125 self.tr('Show Current Message'), |
125 self.tr('Show Current Message'), |
126 self.tr('Show Current Message...'), |
126 self.tr('Show Current Message...'), |
127 0, 0, self, 'mercurial_queues_show_message') |
127 0, 0, self, 'mercurial_queues_show_message') |
128 self.hgQueueHeaderAct.setStatusTip(self.tr( |
128 self.hgQueueHeaderAct.setStatusTip(self.tr( |
129 'Show the commit message of the current patch' |
129 'Show the commit message of the current patch' |
133 """<p>This shows the commit message of the current patch.</p>""" |
133 """<p>This shows the commit message of the current patch.</p>""" |
134 )) |
134 )) |
135 self.hgQueueHeaderAct.triggered.connect(self.__hgQueueShowHeader) |
135 self.hgQueueHeaderAct.triggered.connect(self.__hgQueueShowHeader) |
136 self.actions.append(self.hgQueueHeaderAct) |
136 self.actions.append(self.hgQueueHeaderAct) |
137 |
137 |
138 self.hgQueueListAct = E5Action( |
138 self.hgQueueListAct = EricAction( |
139 self.tr('List Patches'), |
139 self.tr('List Patches'), |
140 self.tr('List Patches...'), |
140 self.tr('List Patches...'), |
141 0, 0, self, 'mercurial_queues_list') |
141 0, 0, self, 'mercurial_queues_list') |
142 self.hgQueueListAct.setStatusTip(self.tr( |
142 self.hgQueueListAct.setStatusTip(self.tr( |
143 'List applied and unapplied patches' |
143 'List applied and unapplied patches' |
147 """<p>This lists all applied and unapplied patches.</p>""" |
147 """<p>This lists all applied and unapplied patches.</p>""" |
148 )) |
148 )) |
149 self.hgQueueListAct.triggered.connect(self.__hgQueueListPatches) |
149 self.hgQueueListAct.triggered.connect(self.__hgQueueListPatches) |
150 self.actions.append(self.hgQueueListAct) |
150 self.actions.append(self.hgQueueListAct) |
151 |
151 |
152 self.hgQueueFinishAct = E5Action( |
152 self.hgQueueFinishAct = EricAction( |
153 self.tr('Finish Applied Patches'), |
153 self.tr('Finish Applied Patches'), |
154 self.tr('Finish Applied Patches'), |
154 self.tr('Finish Applied Patches'), |
155 0, 0, self, 'mercurial_queues_finish_applied') |
155 0, 0, self, 'mercurial_queues_finish_applied') |
156 self.hgQueueFinishAct.setStatusTip(self.tr( |
156 self.hgQueueFinishAct.setStatusTip(self.tr( |
157 'Finish applied patches' |
157 'Finish applied patches' |
163 )) |
163 )) |
164 self.hgQueueFinishAct.triggered.connect( |
164 self.hgQueueFinishAct.triggered.connect( |
165 self.__hgQueueFinishAppliedPatches) |
165 self.__hgQueueFinishAppliedPatches) |
166 self.actions.append(self.hgQueueFinishAct) |
166 self.actions.append(self.hgQueueFinishAct) |
167 |
167 |
168 self.hgQueueRenameAct = E5Action( |
168 self.hgQueueRenameAct = EricAction( |
169 self.tr('Rename Patch'), |
169 self.tr('Rename Patch'), |
170 self.tr('Rename Patch'), |
170 self.tr('Rename Patch'), |
171 0, 0, self, 'mercurial_queues_rename') |
171 0, 0, self, 'mercurial_queues_rename') |
172 self.hgQueueRenameAct.setStatusTip(self.tr( |
172 self.hgQueueRenameAct.setStatusTip(self.tr( |
173 'Rename a patch' |
173 'Rename a patch' |
177 """<p>This renames the current or a named patch.</p>""" |
177 """<p>This renames the current or a named patch.</p>""" |
178 )) |
178 )) |
179 self.hgQueueRenameAct.triggered.connect(self.__hgQueueRenamePatch) |
179 self.hgQueueRenameAct.triggered.connect(self.__hgQueueRenamePatch) |
180 self.actions.append(self.hgQueueRenameAct) |
180 self.actions.append(self.hgQueueRenameAct) |
181 |
181 |
182 self.hgQueueDeleteAct = E5Action( |
182 self.hgQueueDeleteAct = EricAction( |
183 self.tr('Delete Patch'), |
183 self.tr('Delete Patch'), |
184 self.tr('Delete Patch'), |
184 self.tr('Delete Patch'), |
185 0, 0, self, 'mercurial_queues_delete') |
185 0, 0, self, 'mercurial_queues_delete') |
186 self.hgQueueDeleteAct.setStatusTip(self.tr( |
186 self.hgQueueDeleteAct.setStatusTip(self.tr( |
187 'Delete unapplied patch' |
187 'Delete unapplied patch' |
191 """<p>This deletes an unapplied patch.</p>""" |
191 """<p>This deletes an unapplied patch.</p>""" |
192 )) |
192 )) |
193 self.hgQueueDeleteAct.triggered.connect(self.__hgQueueDeletePatch) |
193 self.hgQueueDeleteAct.triggered.connect(self.__hgQueueDeletePatch) |
194 self.actions.append(self.hgQueueDeleteAct) |
194 self.actions.append(self.hgQueueDeleteAct) |
195 |
195 |
196 self.hgQueueFoldAct = E5Action( |
196 self.hgQueueFoldAct = EricAction( |
197 self.tr('Fold Patches'), |
197 self.tr('Fold Patches'), |
198 self.tr('Fold Patches'), |
198 self.tr('Fold Patches'), |
199 0, 0, self, 'mercurial_queues_fold') |
199 0, 0, self, 'mercurial_queues_fold') |
200 self.hgQueueFoldAct.setStatusTip(self.tr( |
200 self.hgQueueFoldAct.setStatusTip(self.tr( |
201 'Fold unapplied patches into the current patch' |
201 'Fold unapplied patches into the current patch' |
206 )) |
206 )) |
207 self.hgQueueFoldAct.triggered.connect( |
207 self.hgQueueFoldAct.triggered.connect( |
208 self.__hgQueueFoldUnappliedPatches) |
208 self.__hgQueueFoldUnappliedPatches) |
209 self.actions.append(self.hgQueueFoldAct) |
209 self.actions.append(self.hgQueueFoldAct) |
210 |
210 |
211 self.hgQueueStatusAct = E5Action( |
211 self.hgQueueStatusAct = EricAction( |
212 self.tr('Show Status'), |
212 self.tr('Show Status'), |
213 self.tr('Show &Status...'), |
213 self.tr('Show &Status...'), |
214 0, 0, self, 'mercurial_queues_status') |
214 0, 0, self, 'mercurial_queues_status') |
215 self.hgQueueStatusAct.setStatusTip(self.tr( |
215 self.hgQueueStatusAct.setStatusTip(self.tr( |
216 'Show the status of the queue repository' |
216 'Show the status of the queue repository' |
220 """<p>This shows the status of the queue repository.</p>""" |
220 """<p>This shows the status of the queue repository.</p>""" |
221 )) |
221 )) |
222 self.hgQueueStatusAct.triggered.connect(self.__hgQueueStatus) |
222 self.hgQueueStatusAct.triggered.connect(self.__hgQueueStatus) |
223 self.actions.append(self.hgQueueStatusAct) |
223 self.actions.append(self.hgQueueStatusAct) |
224 |
224 |
225 self.hgQueueSummaryAct = E5Action( |
225 self.hgQueueSummaryAct = EricAction( |
226 self.tr('Show Summary'), |
226 self.tr('Show Summary'), |
227 self.tr('Show summary...'), |
227 self.tr('Show summary...'), |
228 0, 0, self, 'mercurial_queues_summary') |
228 0, 0, self, 'mercurial_queues_summary') |
229 self.hgQueueSummaryAct.setStatusTip(self.tr( |
229 self.hgQueueSummaryAct.setStatusTip(self.tr( |
230 'Show summary information of the queue repository' |
230 'Show summary information of the queue repository' |
244 |
244 |
245 def __initPushPopActions(self): |
245 def __initPushPopActions(self): |
246 """ |
246 """ |
247 Private method to generate the push and pop action objects. |
247 Private method to generate the push and pop action objects. |
248 """ |
248 """ |
249 self.hgQueuePushAct = E5Action( |
249 self.hgQueuePushAct = EricAction( |
250 self.tr('Push Next Patch'), |
250 self.tr('Push Next Patch'), |
251 self.tr('Push Next Patch'), |
251 self.tr('Push Next Patch'), |
252 0, 0, self, 'mercurial_queues_push_next') |
252 0, 0, self, 'mercurial_queues_push_next') |
253 self.hgQueuePushAct.setStatusTip(self.tr( |
253 self.hgQueuePushAct.setStatusTip(self.tr( |
254 'Push the next patch onto the stack' |
254 'Push the next patch onto the stack' |
259 """ patches.</p>""" |
259 """ patches.</p>""" |
260 )) |
260 )) |
261 self.hgQueuePushAct.triggered.connect(self.__hgQueuePushPatch) |
261 self.hgQueuePushAct.triggered.connect(self.__hgQueuePushPatch) |
262 self.actions.append(self.hgQueuePushAct) |
262 self.actions.append(self.hgQueuePushAct) |
263 |
263 |
264 self.hgQueuePushAllAct = E5Action( |
264 self.hgQueuePushAllAct = EricAction( |
265 self.tr('Push All Patches'), |
265 self.tr('Push All Patches'), |
266 self.tr('Push All Patches'), |
266 self.tr('Push All Patches'), |
267 0, 0, self, 'mercurial_queues_push_all') |
267 0, 0, self, 'mercurial_queues_push_all') |
268 self.hgQueuePushAllAct.setStatusTip(self.tr( |
268 self.hgQueuePushAllAct.setStatusTip(self.tr( |
269 'Push all patches onto the stack' |
269 'Push all patches onto the stack' |
275 )) |
275 )) |
276 self.hgQueuePushAllAct.triggered.connect( |
276 self.hgQueuePushAllAct.triggered.connect( |
277 self.__hgQueuePushAllPatches) |
277 self.__hgQueuePushAllPatches) |
278 self.actions.append(self.hgQueuePushAllAct) |
278 self.actions.append(self.hgQueuePushAllAct) |
279 |
279 |
280 self.hgQueuePushUntilAct = E5Action( |
280 self.hgQueuePushUntilAct = EricAction( |
281 self.tr('Push Patches'), |
281 self.tr('Push Patches'), |
282 self.tr('Push Patches'), |
282 self.tr('Push Patches'), |
283 0, 0, self, 'mercurial_queues_push_until') |
283 0, 0, self, 'mercurial_queues_push_until') |
284 self.hgQueuePushUntilAct.setStatusTip(self.tr( |
284 self.hgQueuePushUntilAct.setStatusTip(self.tr( |
285 'Push patches onto the stack' |
285 'Push patches onto the stack' |
291 )) |
291 )) |
292 self.hgQueuePushUntilAct.triggered.connect( |
292 self.hgQueuePushUntilAct.triggered.connect( |
293 self.__hgQueuePushPatches) |
293 self.__hgQueuePushPatches) |
294 self.actions.append(self.hgQueuePushUntilAct) |
294 self.actions.append(self.hgQueuePushUntilAct) |
295 |
295 |
296 self.hgQueuePopAct = E5Action( |
296 self.hgQueuePopAct = EricAction( |
297 self.tr('Pop Current Patch'), |
297 self.tr('Pop Current Patch'), |
298 self.tr('Pop Current Patch'), |
298 self.tr('Pop Current Patch'), |
299 0, 0, self, 'mercurial_queues_pop_current') |
299 0, 0, self, 'mercurial_queues_pop_current') |
300 self.hgQueuePopAct.setStatusTip(self.tr( |
300 self.hgQueuePopAct.setStatusTip(self.tr( |
301 'Pop the current patch off the stack' |
301 'Pop the current patch off the stack' |
306 """ patches.</p>""" |
306 """ patches.</p>""" |
307 )) |
307 )) |
308 self.hgQueuePopAct.triggered.connect(self.__hgQueuePopPatch) |
308 self.hgQueuePopAct.triggered.connect(self.__hgQueuePopPatch) |
309 self.actions.append(self.hgQueuePopAct) |
309 self.actions.append(self.hgQueuePopAct) |
310 |
310 |
311 self.hgQueuePopAllAct = E5Action( |
311 self.hgQueuePopAllAct = EricAction( |
312 self.tr('Pop All Patches'), |
312 self.tr('Pop All Patches'), |
313 self.tr('Pop All Patches'), |
313 self.tr('Pop All Patches'), |
314 0, 0, self, 'mercurial_queues_pop_all') |
314 0, 0, self, 'mercurial_queues_pop_all') |
315 self.hgQueuePopAllAct.setStatusTip(self.tr( |
315 self.hgQueuePopAllAct.setStatusTip(self.tr( |
316 'Pop all patches off the stack' |
316 'Pop all patches off the stack' |
322 )) |
322 )) |
323 self.hgQueuePopAllAct.triggered.connect( |
323 self.hgQueuePopAllAct.triggered.connect( |
324 self.__hgQueuePopAllPatches) |
324 self.__hgQueuePopAllPatches) |
325 self.actions.append(self.hgQueuePopAllAct) |
325 self.actions.append(self.hgQueuePopAllAct) |
326 |
326 |
327 self.hgQueuePopUntilAct = E5Action( |
327 self.hgQueuePopUntilAct = EricAction( |
328 self.tr('Pop Patches'), |
328 self.tr('Pop Patches'), |
329 self.tr('Pop Patches'), |
329 self.tr('Pop Patches'), |
330 0, 0, self, 'mercurial_queues_pop_until') |
330 0, 0, self, 'mercurial_queues_pop_until') |
331 self.hgQueuePopUntilAct.setStatusTip(self.tr( |
331 self.hgQueuePopUntilAct.setStatusTip(self.tr( |
332 'Pop patches off the stack' |
332 'Pop patches off the stack' |
337 """ until a named patch is at the top of the stack.</p>""" |
337 """ until a named patch is at the top of the stack.</p>""" |
338 )) |
338 )) |
339 self.hgQueuePopUntilAct.triggered.connect(self.__hgQueuePopPatches) |
339 self.hgQueuePopUntilAct.triggered.connect(self.__hgQueuePopPatches) |
340 self.actions.append(self.hgQueuePopUntilAct) |
340 self.actions.append(self.hgQueuePopUntilAct) |
341 |
341 |
342 self.hgQueueGotoAct = E5Action( |
342 self.hgQueueGotoAct = EricAction( |
343 self.tr('Go to Patch'), |
343 self.tr('Go to Patch'), |
344 self.tr('Go to Patch'), |
344 self.tr('Go to Patch'), |
345 0, 0, self, 'mercurial_queues_goto') |
345 0, 0, self, 'mercurial_queues_goto') |
346 self.hgQueueGotoAct.setStatusTip(self.tr( |
346 self.hgQueueGotoAct.setStatusTip(self.tr( |
347 'Push or pop patches until named patch is at top of stack' |
347 'Push or pop patches until named patch is at top of stack' |
356 |
356 |
357 def __initPushPopForceActions(self): |
357 def __initPushPopForceActions(self): |
358 """ |
358 """ |
359 Private method to generate the push and pop (force) action objects. |
359 Private method to generate the push and pop (force) action objects. |
360 """ |
360 """ |
361 self.hgQueuePushForceAct = E5Action( |
361 self.hgQueuePushForceAct = EricAction( |
362 self.tr('Push Next Patch'), |
362 self.tr('Push Next Patch'), |
363 self.tr('Push Next Patch'), |
363 self.tr('Push Next Patch'), |
364 0, 0, self, 'mercurial_queues_push_next_force') |
364 0, 0, self, 'mercurial_queues_push_next_force') |
365 self.hgQueuePushForceAct.setStatusTip(self.tr( |
365 self.hgQueuePushForceAct.setStatusTip(self.tr( |
366 'Push the next patch onto the stack on top of local changes' |
366 'Push the next patch onto the stack on top of local changes' |
372 )) |
372 )) |
373 self.hgQueuePushForceAct.triggered.connect( |
373 self.hgQueuePushForceAct.triggered.connect( |
374 self.__hgQueuePushPatchForced) |
374 self.__hgQueuePushPatchForced) |
375 self.actions.append(self.hgQueuePushForceAct) |
375 self.actions.append(self.hgQueuePushForceAct) |
376 |
376 |
377 self.hgQueuePushAllForceAct = E5Action( |
377 self.hgQueuePushAllForceAct = EricAction( |
378 self.tr('Push All Patches'), |
378 self.tr('Push All Patches'), |
379 self.tr('Push All Patches'), |
379 self.tr('Push All Patches'), |
380 0, 0, self, 'mercurial_queues_push_all_force') |
380 0, 0, self, 'mercurial_queues_push_all_force') |
381 self.hgQueuePushAllForceAct.setStatusTip(self.tr( |
381 self.hgQueuePushAllForceAct.setStatusTip(self.tr( |
382 'Push all patches onto the stack on top of local changes' |
382 'Push all patches onto the stack on top of local changes' |
388 )) |
388 )) |
389 self.hgQueuePushAllForceAct.triggered.connect( |
389 self.hgQueuePushAllForceAct.triggered.connect( |
390 self.__hgQueuePushAllPatchesForced) |
390 self.__hgQueuePushAllPatchesForced) |
391 self.actions.append(self.hgQueuePushAllForceAct) |
391 self.actions.append(self.hgQueuePushAllForceAct) |
392 |
392 |
393 self.hgQueuePushUntilForceAct = E5Action( |
393 self.hgQueuePushUntilForceAct = EricAction( |
394 self.tr('Push Patches'), |
394 self.tr('Push Patches'), |
395 self.tr('Push Patches'), |
395 self.tr('Push Patches'), |
396 0, 0, self, 'mercurial_queues_push_until_force') |
396 0, 0, self, 'mercurial_queues_push_until_force') |
397 self.hgQueuePushUntilForceAct.setStatusTip(self.tr( |
397 self.hgQueuePushUntilForceAct.setStatusTip(self.tr( |
398 'Push patches onto the stack on top of local changes' |
398 'Push patches onto the stack on top of local changes' |
405 )) |
405 )) |
406 self.hgQueuePushUntilForceAct.triggered.connect( |
406 self.hgQueuePushUntilForceAct.triggered.connect( |
407 self.__hgQueuePushPatchesForced) |
407 self.__hgQueuePushPatchesForced) |
408 self.actions.append(self.hgQueuePushUntilForceAct) |
408 self.actions.append(self.hgQueuePushUntilForceAct) |
409 |
409 |
410 self.hgQueuePopForceAct = E5Action( |
410 self.hgQueuePopForceAct = EricAction( |
411 self.tr('Pop Current Patch'), |
411 self.tr('Pop Current Patch'), |
412 self.tr('Pop Current Patch'), |
412 self.tr('Pop Current Patch'), |
413 0, 0, self, 'mercurial_queues_pop_current_force') |
413 0, 0, self, 'mercurial_queues_pop_current_force') |
414 self.hgQueuePopForceAct.setStatusTip(self.tr( |
414 self.hgQueuePopForceAct.setStatusTip(self.tr( |
415 'Pop the current patch off the stack forgetting local changes' |
415 'Pop the current patch off the stack forgetting local changes' |
422 )) |
422 )) |
423 self.hgQueuePopForceAct.triggered.connect( |
423 self.hgQueuePopForceAct.triggered.connect( |
424 self.__hgQueuePopPatchForced) |
424 self.__hgQueuePopPatchForced) |
425 self.actions.append(self.hgQueuePopForceAct) |
425 self.actions.append(self.hgQueuePopForceAct) |
426 |
426 |
427 self.hgQueuePopAllForceAct = E5Action( |
427 self.hgQueuePopAllForceAct = EricAction( |
428 self.tr('Pop All Patches'), |
428 self.tr('Pop All Patches'), |
429 self.tr('Pop All Patches'), |
429 self.tr('Pop All Patches'), |
430 0, 0, self, 'mercurial_queues_pop_all_force') |
430 0, 0, self, 'mercurial_queues_pop_all_force') |
431 self.hgQueuePopAllForceAct.setStatusTip(self.tr( |
431 self.hgQueuePopAllForceAct.setStatusTip(self.tr( |
432 'Pop all patches off the stack forgetting local changes' |
432 'Pop all patches off the stack forgetting local changes' |
438 )) |
438 )) |
439 self.hgQueuePopAllForceAct.triggered.connect( |
439 self.hgQueuePopAllForceAct.triggered.connect( |
440 self.__hgQueuePopAllPatchesForced) |
440 self.__hgQueuePopAllPatchesForced) |
441 self.actions.append(self.hgQueuePopAllForceAct) |
441 self.actions.append(self.hgQueuePopAllForceAct) |
442 |
442 |
443 self.hgQueuePopUntilForceAct = E5Action( |
443 self.hgQueuePopUntilForceAct = EricAction( |
444 self.tr('Pop Patches'), |
444 self.tr('Pop Patches'), |
445 self.tr('Pop Patches'), |
445 self.tr('Pop Patches'), |
446 0, 0, self, 'mercurial_queues_pop_until_force') |
446 0, 0, self, 'mercurial_queues_pop_until_force') |
447 self.hgQueuePopUntilForceAct.setStatusTip(self.tr( |
447 self.hgQueuePopUntilForceAct.setStatusTip(self.tr( |
448 'Pop patches off the stack forgetting local changes' |
448 'Pop patches off the stack forgetting local changes' |
455 )) |
455 )) |
456 self.hgQueuePopUntilForceAct.triggered.connect( |
456 self.hgQueuePopUntilForceAct.triggered.connect( |
457 self.__hgQueuePopPatchesForced) |
457 self.__hgQueuePopPatchesForced) |
458 self.actions.append(self.hgQueuePopUntilForceAct) |
458 self.actions.append(self.hgQueuePopUntilForceAct) |
459 |
459 |
460 self.hgQueueGotoForceAct = E5Action( |
460 self.hgQueueGotoForceAct = EricAction( |
461 self.tr('Go to Patch'), |
461 self.tr('Go to Patch'), |
462 self.tr('Go to Patch'), |
462 self.tr('Go to Patch'), |
463 0, 0, self, 'mercurial_queues_goto_force') |
463 0, 0, self, 'mercurial_queues_goto_force') |
464 self.hgQueueGotoForceAct.setStatusTip(self.tr( |
464 self.hgQueueGotoForceAct.setStatusTip(self.tr( |
465 'Push or pop patches until named patch is at top of stack' |
465 'Push or pop patches until named patch is at top of stack' |
476 |
476 |
477 def __initGuardsActions(self): |
477 def __initGuardsActions(self): |
478 """ |
478 """ |
479 Private method to generate the guards action objects. |
479 Private method to generate the guards action objects. |
480 """ |
480 """ |
481 self.hgQueueDefineGuardsAct = E5Action( |
481 self.hgQueueDefineGuardsAct = EricAction( |
482 self.tr('Define Guards'), |
482 self.tr('Define Guards'), |
483 self.tr('Define Guards...'), |
483 self.tr('Define Guards...'), |
484 0, 0, self, 'mercurial_queues_guards_define') |
484 0, 0, self, 'mercurial_queues_guards_define') |
485 self.hgQueueDefineGuardsAct.setStatusTip(self.tr( |
485 self.hgQueueDefineGuardsAct.setStatusTip(self.tr( |
486 'Define guards for the current or a named patch' |
486 'Define guards for the current or a named patch' |
492 )) |
492 )) |
493 self.hgQueueDefineGuardsAct.triggered.connect( |
493 self.hgQueueDefineGuardsAct.triggered.connect( |
494 self.__hgQueueGuardsDefine) |
494 self.__hgQueueGuardsDefine) |
495 self.actions.append(self.hgQueueDefineGuardsAct) |
495 self.actions.append(self.hgQueueDefineGuardsAct) |
496 |
496 |
497 self.hgQueueDropAllGuardsAct = E5Action( |
497 self.hgQueueDropAllGuardsAct = EricAction( |
498 self.tr('Drop All Guards'), |
498 self.tr('Drop All Guards'), |
499 self.tr('Drop All Guards...'), |
499 self.tr('Drop All Guards...'), |
500 0, 0, self, 'mercurial_queues_guards_drop_all') |
500 0, 0, self, 'mercurial_queues_guards_drop_all') |
501 self.hgQueueDropAllGuardsAct.setStatusTip(self.tr( |
501 self.hgQueueDropAllGuardsAct.setStatusTip(self.tr( |
502 'Drop all guards of the current or a named patch' |
502 'Drop all guards of the current or a named patch' |
507 )) |
507 )) |
508 self.hgQueueDropAllGuardsAct.triggered.connect( |
508 self.hgQueueDropAllGuardsAct.triggered.connect( |
509 self.__hgQueueGuardsDropAll) |
509 self.__hgQueueGuardsDropAll) |
510 self.actions.append(self.hgQueueDropAllGuardsAct) |
510 self.actions.append(self.hgQueueDropAllGuardsAct) |
511 |
511 |
512 self.hgQueueListGuardsAct = E5Action( |
512 self.hgQueueListGuardsAct = EricAction( |
513 self.tr('List Guards'), |
513 self.tr('List Guards'), |
514 self.tr('List Guards...'), |
514 self.tr('List Guards...'), |
515 0, 0, self, 'mercurial_queues_guards_list') |
515 0, 0, self, 'mercurial_queues_guards_list') |
516 self.hgQueueListGuardsAct.setStatusTip(self.tr( |
516 self.hgQueueListGuardsAct.setStatusTip(self.tr( |
517 'List guards of the current or a named patch' |
517 'List guards of the current or a named patch' |
522 )) |
522 )) |
523 self.hgQueueListGuardsAct.triggered.connect( |
523 self.hgQueueListGuardsAct.triggered.connect( |
524 self.__hgQueueGuardsList) |
524 self.__hgQueueGuardsList) |
525 self.actions.append(self.hgQueueListGuardsAct) |
525 self.actions.append(self.hgQueueListGuardsAct) |
526 |
526 |
527 self.hgQueueListAllGuardsAct = E5Action( |
527 self.hgQueueListAllGuardsAct = EricAction( |
528 self.tr('List All Guards'), |
528 self.tr('List All Guards'), |
529 self.tr('List All Guards...'), |
529 self.tr('List All Guards...'), |
530 0, 0, self, 'mercurial_queues_guards_list_all') |
530 0, 0, self, 'mercurial_queues_guards_list_all') |
531 self.hgQueueListAllGuardsAct.setStatusTip(self.tr( |
531 self.hgQueueListAllGuardsAct.setStatusTip(self.tr( |
532 'List all guards of all patches' |
532 'List all guards of all patches' |
537 )) |
537 )) |
538 self.hgQueueListAllGuardsAct.triggered.connect( |
538 self.hgQueueListAllGuardsAct.triggered.connect( |
539 self.__hgQueueGuardsListAll) |
539 self.__hgQueueGuardsListAll) |
540 self.actions.append(self.hgQueueListAllGuardsAct) |
540 self.actions.append(self.hgQueueListAllGuardsAct) |
541 |
541 |
542 self.hgQueueActivateGuardsAct = E5Action( |
542 self.hgQueueActivateGuardsAct = EricAction( |
543 self.tr('Set Active Guards'), |
543 self.tr('Set Active Guards'), |
544 self.tr('Set Active Guards...'), |
544 self.tr('Set Active Guards...'), |
545 0, 0, self, 'mercurial_queues_guards_set_active') |
545 0, 0, self, 'mercurial_queues_guards_set_active') |
546 self.hgQueueActivateGuardsAct.setStatusTip(self.tr( |
546 self.hgQueueActivateGuardsAct.setStatusTip(self.tr( |
547 'Set the list of active guards' |
547 'Set the list of active guards' |
552 )) |
552 )) |
553 self.hgQueueActivateGuardsAct.triggered.connect( |
553 self.hgQueueActivateGuardsAct.triggered.connect( |
554 self.__hgQueueGuardsSetActive) |
554 self.__hgQueueGuardsSetActive) |
555 self.actions.append(self.hgQueueActivateGuardsAct) |
555 self.actions.append(self.hgQueueActivateGuardsAct) |
556 |
556 |
557 self.hgQueueDeactivateGuardsAct = E5Action( |
557 self.hgQueueDeactivateGuardsAct = EricAction( |
558 self.tr('Deactivate Guards'), |
558 self.tr('Deactivate Guards'), |
559 self.tr('Deactivate Guards...'), |
559 self.tr('Deactivate Guards...'), |
560 0, 0, self, 'mercurial_queues_guards_deactivate') |
560 0, 0, self, 'mercurial_queues_guards_deactivate') |
561 self.hgQueueDeactivateGuardsAct.setStatusTip(self.tr( |
561 self.hgQueueDeactivateGuardsAct.setStatusTip(self.tr( |
562 'Deactivate all active guards' |
562 'Deactivate all active guards' |
567 )) |
567 )) |
568 self.hgQueueDeactivateGuardsAct.triggered.connect( |
568 self.hgQueueDeactivateGuardsAct.triggered.connect( |
569 self.__hgQueueGuardsDeactivate) |
569 self.__hgQueueGuardsDeactivate) |
570 self.actions.append(self.hgQueueDeactivateGuardsAct) |
570 self.actions.append(self.hgQueueDeactivateGuardsAct) |
571 |
571 |
572 self.hgQueueIdentifyActiveGuardsAct = E5Action( |
572 self.hgQueueIdentifyActiveGuardsAct = EricAction( |
573 self.tr('Identify Active Guards'), |
573 self.tr('Identify Active Guards'), |
574 self.tr('Identify Active Guards...'), |
574 self.tr('Identify Active Guards...'), |
575 0, 0, self, 'mercurial_queues_guards_identify_active') |
575 0, 0, self, 'mercurial_queues_guards_identify_active') |
576 self.hgQueueIdentifyActiveGuardsAct.setStatusTip(self.tr( |
576 self.hgQueueIdentifyActiveGuardsAct.setStatusTip(self.tr( |
577 'Show a list of active guards' |
577 'Show a list of active guards' |
586 |
586 |
587 def __initQueuesMgmtActions(self): |
587 def __initQueuesMgmtActions(self): |
588 """ |
588 """ |
589 Private method to generate the queues management action objects. |
589 Private method to generate the queues management action objects. |
590 """ |
590 """ |
591 self.hgQueueCreateQueueAct = E5Action( |
591 self.hgQueueCreateQueueAct = EricAction( |
592 self.tr('Create Queue'), |
592 self.tr('Create Queue'), |
593 self.tr('Create Queue'), |
593 self.tr('Create Queue'), |
594 0, 0, self, 'mercurial_queues_create_queue') |
594 0, 0, self, 'mercurial_queues_create_queue') |
595 self.hgQueueCreateQueueAct.setStatusTip(self.tr( |
595 self.hgQueueCreateQueueAct.setStatusTip(self.tr( |
596 'Create a new patch queue' |
596 'Create a new patch queue' |
601 )) |
601 )) |
602 self.hgQueueCreateQueueAct.triggered.connect( |
602 self.hgQueueCreateQueueAct.triggered.connect( |
603 self.__hgQueueCreateQueue) |
603 self.__hgQueueCreateQueue) |
604 self.actions.append(self.hgQueueCreateQueueAct) |
604 self.actions.append(self.hgQueueCreateQueueAct) |
605 |
605 |
606 self.hgQueueRenameQueueAct = E5Action( |
606 self.hgQueueRenameQueueAct = EricAction( |
607 self.tr('Rename Queue'), |
607 self.tr('Rename Queue'), |
608 self.tr('Rename Queue'), |
608 self.tr('Rename Queue'), |
609 0, 0, self, 'mercurial_queues_rename_queue') |
609 0, 0, self, 'mercurial_queues_rename_queue') |
610 self.hgQueueRenameQueueAct.setStatusTip(self.tr( |
610 self.hgQueueRenameQueueAct.setStatusTip(self.tr( |
611 'Rename the active patch queue' |
611 'Rename the active patch queue' |
616 )) |
616 )) |
617 self.hgQueueRenameQueueAct.triggered.connect( |
617 self.hgQueueRenameQueueAct.triggered.connect( |
618 self.__hgQueueRenameQueue) |
618 self.__hgQueueRenameQueue) |
619 self.actions.append(self.hgQueueRenameQueueAct) |
619 self.actions.append(self.hgQueueRenameQueueAct) |
620 |
620 |
621 self.hgQueueDeleteQueueAct = E5Action( |
621 self.hgQueueDeleteQueueAct = EricAction( |
622 self.tr('Delete Queue'), |
622 self.tr('Delete Queue'), |
623 self.tr('Delete Queue'), |
623 self.tr('Delete Queue'), |
624 0, 0, self, 'mercurial_queues_delete_queue') |
624 0, 0, self, 'mercurial_queues_delete_queue') |
625 self.hgQueueDeleteQueueAct.setStatusTip(self.tr( |
625 self.hgQueueDeleteQueueAct.setStatusTip(self.tr( |
626 'Delete the reference to a patch queue' |
626 'Delete the reference to a patch queue' |
631 )) |
631 )) |
632 self.hgQueueDeleteQueueAct.triggered.connect( |
632 self.hgQueueDeleteQueueAct.triggered.connect( |
633 self.__hgQueueDeleteQueue) |
633 self.__hgQueueDeleteQueue) |
634 self.actions.append(self.hgQueueDeleteQueueAct) |
634 self.actions.append(self.hgQueueDeleteQueueAct) |
635 |
635 |
636 self.hgQueuePurgeQueueAct = E5Action( |
636 self.hgQueuePurgeQueueAct = EricAction( |
637 self.tr('Purge Queue'), |
637 self.tr('Purge Queue'), |
638 self.tr('Purge Queue'), |
638 self.tr('Purge Queue'), |
639 0, 0, self, 'mercurial_queues_purge_queue') |
639 0, 0, self, 'mercurial_queues_purge_queue') |
640 self.hgQueuePurgeQueueAct.setStatusTip(self.tr( |
640 self.hgQueuePurgeQueueAct.setStatusTip(self.tr( |
641 'Delete the reference to a patch queue and remove the patch' |
641 'Delete the reference to a patch queue and remove the patch' |
648 )) |
648 )) |
649 self.hgQueuePurgeQueueAct.triggered.connect( |
649 self.hgQueuePurgeQueueAct.triggered.connect( |
650 self.__hgQueuePurgeQueue) |
650 self.__hgQueuePurgeQueue) |
651 self.actions.append(self.hgQueuePurgeQueueAct) |
651 self.actions.append(self.hgQueuePurgeQueueAct) |
652 |
652 |
653 self.hgQueueActivateQueueAct = E5Action( |
653 self.hgQueueActivateQueueAct = EricAction( |
654 self.tr('Activate Queue'), |
654 self.tr('Activate Queue'), |
655 self.tr('Activate Queue'), |
655 self.tr('Activate Queue'), |
656 0, 0, self, 'mercurial_queues_activate_queue') |
656 0, 0, self, 'mercurial_queues_activate_queue') |
657 self.hgQueueActivateQueueAct.setStatusTip(self.tr( |
657 self.hgQueueActivateQueueAct.setStatusTip(self.tr( |
658 'Set the active queue' |
658 'Set the active queue' |
663 )) |
663 )) |
664 self.hgQueueActivateQueueAct.triggered.connect( |
664 self.hgQueueActivateQueueAct.triggered.connect( |
665 self.__hgQueueActivateQueue) |
665 self.__hgQueueActivateQueue) |
666 self.actions.append(self.hgQueueActivateQueueAct) |
666 self.actions.append(self.hgQueueActivateQueueAct) |
667 |
667 |
668 self.hgQueueListQueuesAct = E5Action( |
668 self.hgQueueListQueuesAct = EricAction( |
669 self.tr('List Queues'), |
669 self.tr('List Queues'), |
670 self.tr('List Queues...'), |
670 self.tr('List Queues...'), |
671 0, 0, self, 'mercurial_queues_list_queues') |
671 0, 0, self, 'mercurial_queues_list_queues') |
672 self.hgQueueListQueuesAct.setStatusTip(self.tr( |
672 self.hgQueueListQueuesAct.setStatusTip(self.tr( |
673 'List the available queues' |
673 'List the available queues' |
821 @param force flag indicating a forceful pop (boolean) |
821 @param force flag indicating a forceful pop (boolean) |
822 """ |
822 """ |
823 shouldReopen = self.vcs.getExtensionObject("mq").hgQueuePushPopPatches( |
823 shouldReopen = self.vcs.getExtensionObject("mq").hgQueuePushPopPatches( |
824 operation=operation, doAll=doAll, named=named, force=force) |
824 operation=operation, doAll=doAll, named=named, force=force) |
825 if shouldReopen: |
825 if shouldReopen: |
826 res = E5MessageBox.yesNo( |
826 res = EricMessageBox.yesNo( |
827 None, |
827 None, |
828 self.tr("Changing Applied Patches"), |
828 self.tr("Changing Applied Patches"), |
829 self.tr("""The project should be reread. Do this now?"""), |
829 self.tr("""The project should be reread. Do this now?"""), |
830 yesDefault=True) |
830 yesDefault=True) |
831 if res: |
831 if res: |