Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
17 from VCS.ProjectBrowserHelper import VcsProjectBrowserHelper 17 from VCS.ProjectBrowserHelper import VcsProjectBrowserHelper
18 18
19 from Project.ProjectBrowserModel import ProjectBrowserFileItem 19 from Project.ProjectBrowserModel import ProjectBrowserFileItem
20 20
21 import UI.PixmapCache 21 import UI.PixmapCache
22
22 23
23 class SvnProjectBrowserHelper(VcsProjectBrowserHelper): 24 class SvnProjectBrowserHelper(VcsProjectBrowserHelper):
24 """ 25 """
25 Class implementing the VCS project browser helper for subversion. 26 Class implementing the VCS project browser helper for subversion.
26 """ 27 """
27 def __init__(self, vcsObject, browserObject, projectObject, isTranslationsBrowser, 28 def __init__(self, vcsObject, browserObject, projectObject, isTranslationsBrowser,
28 parent = None, name = None): 29 parent=None, name=None):
29 """ 30 """
30 Constructor 31 Constructor
31 32
32 @param vcsObject reference to the vcs object 33 @param vcsObject reference to the vcs object
33 @param browserObject reference to the project browser object 34 @param browserObject reference to the project browser object
40 VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject, projectObject, 41 VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject, projectObject,
41 isTranslationsBrowser, parent, name) 42 isTranslationsBrowser, parent, name)
42 43
43 def showContextMenu(self, menu, standardItems): 44 def showContextMenu(self, menu, standardItems):
44 """ 45 """
45 Slot called before the context menu is shown. 46 Slot called before the context menu is shown.
46 47
47 It enables/disables the VCS menu entries depending on the overall 48 It enables/disables the VCS menu entries depending on the overall
48 VCS status and the file status. 49 VCS status and the file status.
49 50
50 @param menu reference to the menu to be shown 51 @param menu reference to the menu to be shown
51 @param standardItems array of standard items that need activation/deactivation 52 @param standardItems array of standard items that need activation/deactivation
52 depending on the overall VCS status 53 depending on the overall VCS status
75 for act in standardItems: 76 for act in standardItems:
76 act.setEnabled(True) 77 act.setEnabled(True)
77 78
78 def showContextMenuMulti(self, menu, standardItems): 79 def showContextMenuMulti(self, menu, standardItems):
79 """ 80 """
80 Slot called before the context menu (multiple selections) is shown. 81 Slot called before the context menu (multiple selections) is shown.
81 82
82 It enables/disables the VCS menu entries depending on the overall 83 It enables/disables the VCS menu entries depending on the overall
83 VCS status and the files status. 84 VCS status and the files status.
84 85
85 @param menu reference to the menu to be shown 86 @param menu reference to the menu to be shown
86 @param standardItems array of standard items that need activation/deactivation 87 @param standardItems array of standard items that need activation/deactivation
87 depending on the overall VCS status 88 depending on the overall VCS status
116 for act in standardItems: 117 for act in standardItems:
117 act.setEnabled(True) 118 act.setEnabled(True)
118 119
119 def showContextMenuDir(self, menu, standardItems): 120 def showContextMenuDir(self, menu, standardItems):
120 """ 121 """
121 Slot called before the context menu is shown. 122 Slot called before the context menu is shown.
122 123
123 It enables/disables the VCS menu entries depending on the overall 124 It enables/disables the VCS menu entries depending on the overall
124 VCS status and the directory status. 125 VCS status and the directory status.
125 126
126 @param menu reference to the menu to be shown 127 @param menu reference to the menu to be shown
127 @param standardItems array of standard items that need activation/deactivation 128 @param standardItems array of standard items that need activation/deactivation
128 depending on the overall VCS status 129 depending on the overall VCS status
142 for act in standardItems: 143 for act in standardItems:
143 act.setEnabled(True) 144 act.setEnabled(True)
144 145
145 def showContextMenuDirMulti(self, menu, standardItems): 146 def showContextMenuDirMulti(self, menu, standardItems):
146 """ 147 """
147 Slot called before the context menu is shown. 148 Slot called before the context menu is shown.
148 149
149 It enables/disables the VCS menu entries depending on the overall 150 It enables/disables the VCS menu entries depending on the overall
150 VCS status and the directory status. 151 VCS status and the directory status.
151 152
152 @param menu reference to the menu to be shown 153 @param menu reference to the menu to be shown
153 @param standardItems array of standard items that need activation/deactivation 154 @param standardItems array of standard items that need activation/deactivation
154 depending on the overall VCS status 155 depending on the overall VCS status
195 196
196 menu = QMenu(self.trUtf8("Version Control")) 197 menu = QMenu(self.trUtf8("Version Control"))
197 198
198 act = menu.addAction( 199 act = menu.addAction(
199 UI.PixmapCache.getIcon( 200 UI.PixmapCache.getIcon(
200 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 201 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
201 self.vcs.vcsName(), self._VCSInfoDisplay) 202 self.vcs.vcsName(), self._VCSInfoDisplay)
202 font = act.font() 203 font = act.font()
203 font.setBold(True) 204 font.setBold(True)
204 act.setFont(font) 205 act.setFont(font)
205 menu.addSeparator() 206 menu.addSeparator()
206 207
207 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"), 208 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"),
208 self.trUtf8('Update from repository'), self._VCSUpdate) 209 self.trUtf8('Update from repository'), self._VCSUpdate)
209 self.vcsMenuActions.append(act) 210 self.vcsMenuActions.append(act)
210 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"), 211 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"),
211 self.trUtf8('Commit changes to repository...'), 212 self.trUtf8('Commit changes to repository...'),
212 self._VCSCommit) 213 self._VCSCommit)
213 self.vcsMenuActions.append(act) 214 self.vcsMenuActions.append(act)
214 menu.addSeparator() 215 menu.addSeparator()
215 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 216 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
216 self.trUtf8('Add to repository'), 217 self.trUtf8('Add to repository'),
217 self._VCSAdd) 218 self._VCSAdd)
218 self.vcsAddMenuActions.append(act) 219 self.vcsAddMenuActions.append(act)
219 if 1 in self.browser.specialMenuEntries: 220 if 1 in self.browser.specialMenuEntries:
220 self.vcsMenuAddTree = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 221 self.vcsMenuAddTree = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
221 self.trUtf8('Add tree to repository'), 222 self.trUtf8('Add tree to repository'),
222 self._VCSAddTree) 223 self._VCSAddTree)
223 self.vcsAddMenuActions.append(self.vcsMenuAddTree) 224 self.vcsAddMenuActions.append(self.vcsMenuAddTree)
224 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), 225 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"),
225 self.trUtf8('Remove from repository (and disk)'), 226 self.trUtf8('Remove from repository (and disk)'),
226 self._VCSRemove) 227 self._VCSRemove)
227 self.vcsMenuActions.append(act) 228 self.vcsMenuActions.append(act)
228 menu.addSeparator() 229 menu.addSeparator()
229 act = menu.addAction(self.trUtf8('Copy in repository'), self.__SVNCopy) 230 act = menu.addAction(self.trUtf8('Copy in repository'), self.__SVNCopy)
230 self.vcsMenuActions.append(act) 231 self.vcsMenuActions.append(act)
231 act = menu.addAction(self.trUtf8('Move in repository'), self.__SVNMove) 232 act = menu.addAction(self.trUtf8('Move in repository'), self.__SVNMove)
232 self.vcsMenuActions.append(act) 233 self.vcsMenuActions.append(act)
233 if self.vcs.versionStr >= '1.5.0': 234 if self.vcs.versionStr >= '1.5.0':
234 menu.addSeparator() 235 menu.addSeparator()
235 act = menu.addAction(self.trUtf8("Add to Changelist"), 236 act = menu.addAction(self.trUtf8("Add to Changelist"),
236 self.__SVNAddToChangelist) 237 self.__SVNAddToChangelist)
237 self.vcsMenuActions.append(act) 238 self.vcsMenuActions.append(act)
238 act = menu.addAction(self.trUtf8("Remove from Changelist"), 239 act = menu.addAction(self.trUtf8("Remove from Changelist"),
239 self.__SVNRemoveFromChangelist) 240 self.__SVNRemoveFromChangelist)
240 self.vcsMenuActions.append(act) 241 self.vcsMenuActions.append(act)
241 menu.addSeparator() 242 menu.addSeparator()
242 act = menu.addAction(UI.PixmapCache.getIcon("vcsLog.png"), 243 act = menu.addAction(UI.PixmapCache.getIcon("vcsLog.png"),
243 self.trUtf8('Show log'), self._VCSLog) 244 self.trUtf8('Show log'), self._VCSLog)
256 menu.addSeparator() 257 menu.addSeparator()
257 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 258 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
258 self.trUtf8('Show difference'), self._VCSDiff) 259 self.trUtf8('Show difference'), self._VCSDiff)
259 self.vcsMenuActions.append(act) 260 self.vcsMenuActions.append(act)
260 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 261 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
261 self.trUtf8('Show difference (extended)'), 262 self.trUtf8('Show difference (extended)'),
262 self.__SVNExtendedDiff) 263 self.__SVNExtendedDiff)
263 self.vcsMenuActions.append(act) 264 self.vcsMenuActions.append(act)
264 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 265 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
265 self.trUtf8('Show difference (URLs)'), 266 self.trUtf8('Show difference (URLs)'),
266 self.__SVNUrlDiff) 267 self.__SVNUrlDiff)
267 self.vcsMenuActions.append(act) 268 self.vcsMenuActions.append(act)
268 self.blameAct = menu.addAction(self.trUtf8('Show annotated file'), 269 self.blameAct = menu.addAction(self.trUtf8('Show annotated file'),
269 self.__SVNBlame) 270 self.__SVNBlame)
270 self.vcsMenuActions.append(self.blameAct) 271 self.vcsMenuActions.append(self.blameAct)
271 menu.addSeparator() 272 menu.addSeparator()
272 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), 273 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"),
273 self.trUtf8('Revert changes'), self._VCSRevert) 274 self.trUtf8('Revert changes'), self._VCSRevert)
314 mainMenu.addMenu(menu) 315 mainMenu.addMenu(menu)
315 self.menu = menu 316 self.menu = menu
316 317
317 def _addVCSMenuMulti(self, mainMenu): 318 def _addVCSMenuMulti(self, mainMenu):
318 """ 319 """
319 Protected method used to add the VCS menu for multi selection to all 320 Protected method used to add the VCS menu for multi selection to all
320 project browsers. 321 project browsers.
321 322
322 @param mainMenu reference to the menu to be amended 323 @param mainMenu reference to the menu to be amended
323 """ 324 """
324 self.vcsMultiMenuActions = [] 325 self.vcsMultiMenuActions = []
326 327
327 menu = QMenu(self.trUtf8("Version Control")) 328 menu = QMenu(self.trUtf8("Version Control"))
328 329
329 act = menu.addAction( 330 act = menu.addAction(
330 UI.PixmapCache.getIcon( 331 UI.PixmapCache.getIcon(
331 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 332 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
332 self.vcs.vcsName(), self._VCSInfoDisplay) 333 self.vcs.vcsName(), self._VCSInfoDisplay)
333 font = act.font() 334 font = act.font()
334 font.setBold(True) 335 font.setBold(True)
335 act.setFont(font) 336 act.setFont(font)
336 menu.addSeparator() 337 menu.addSeparator()
337 338
338 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"), 339 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"),
339 self.trUtf8('Update from repository'), self._VCSUpdate) 340 self.trUtf8('Update from repository'), self._VCSUpdate)
340 self.vcsMultiMenuActions.append(act) 341 self.vcsMultiMenuActions.append(act)
341 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"), 342 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"),
342 self.trUtf8('Commit changes to repository...'), 343 self.trUtf8('Commit changes to repository...'),
343 self._VCSCommit) 344 self._VCSCommit)
344 self.vcsMultiMenuActions.append(act) 345 self.vcsMultiMenuActions.append(act)
345 menu.addSeparator() 346 menu.addSeparator()
346 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 347 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
347 self.trUtf8('Add to repository'), self._VCSAdd) 348 self.trUtf8('Add to repository'), self._VCSAdd)
350 self.vcsMultiMenuAddTree = \ 351 self.vcsMultiMenuAddTree = \
351 menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 352 menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
352 self.trUtf8('Add tree to repository'), self._VCSAddTree) 353 self.trUtf8('Add tree to repository'), self._VCSAddTree)
353 self.vcsAddMultiMenuActions.append(self.vcsMultiMenuAddTree) 354 self.vcsAddMultiMenuActions.append(self.vcsMultiMenuAddTree)
354 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), 355 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"),
355 self.trUtf8('Remove from repository (and disk)'), 356 self.trUtf8('Remove from repository (and disk)'),
356 self._VCSRemove) 357 self._VCSRemove)
357 self.vcsMultiMenuActions.append(act) 358 self.vcsMultiMenuActions.append(act)
358 if self.vcs.versionStr >= '1.5.0': 359 if self.vcs.versionStr >= '1.5.0':
359 menu.addSeparator() 360 menu.addSeparator()
360 act = menu.addAction(self.trUtf8("Add to Changelist"), 361 act = menu.addAction(self.trUtf8("Add to Changelist"),
361 self.__SVNAddToChangelist) 362 self.__SVNAddToChangelist)
362 self.vcsMenuActions.append(act) 363 self.vcsMenuActions.append(act)
363 act = menu.addAction(self.trUtf8("Remove from Changelist"), 364 act = menu.addAction(self.trUtf8("Remove from Changelist"),
364 self.__SVNRemoveFromChangelist) 365 self.__SVNRemoveFromChangelist)
365 self.vcsMenuActions.append(act) 366 self.vcsMenuActions.append(act)
366 menu.addSeparator() 367 menu.addSeparator()
367 act = menu.addAction(UI.PixmapCache.getIcon("vcsStatus.png"), 368 act = menu.addAction(UI.PixmapCache.getIcon("vcsStatus.png"),
368 self.trUtf8('Show status'), self._VCSStatus) 369 self.trUtf8('Show status'), self._VCSStatus)
370 menu.addSeparator() 371 menu.addSeparator()
371 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 372 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
372 self.trUtf8('Show difference'), self._VCSDiff) 373 self.trUtf8('Show difference'), self._VCSDiff)
373 self.vcsMultiMenuActions.append(act) 374 self.vcsMultiMenuActions.append(act)
374 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 375 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
375 self.trUtf8('Show difference (extended)'), 376 self.trUtf8('Show difference (extended)'),
376 self.__SVNExtendedDiff) 377 self.__SVNExtendedDiff)
377 self.vcsMultiMenuActions.append(act) 378 self.vcsMultiMenuActions.append(act)
378 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 379 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
379 self.trUtf8('Show difference (URLs)'), 380 self.trUtf8('Show difference (URLs)'),
380 self.__SVNUrlDiff) 381 self.__SVNUrlDiff)
381 self.vcsMultiMenuActions.append(act) 382 self.vcsMultiMenuActions.append(act)
382 menu.addSeparator() 383 menu.addSeparator()
383 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), 384 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"),
384 self.trUtf8('Revert changes'), self._VCSRevert) 385 self.trUtf8('Revert changes'), self._VCSRevert)
430 """ 431 """
431 menu = QMenu(self.trUtf8("Version Control")) 432 menu = QMenu(self.trUtf8("Version Control"))
432 433
433 act = menu.addAction( 434 act = menu.addAction(
434 UI.PixmapCache.getIcon( 435 UI.PixmapCache.getIcon(
435 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 436 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
436 self.vcs.vcsName(), self._VCSInfoDisplay) 437 self.vcs.vcsName(), self._VCSInfoDisplay)
437 font = act.font() 438 font = act.font()
438 font.setBold(True) 439 font.setBold(True)
439 act.setFont(font) 440 act.setFont(font)
440 menu.addSeparator() 441 menu.addSeparator()
468 469
469 menu = QMenu(self.trUtf8("Version Control")) 470 menu = QMenu(self.trUtf8("Version Control"))
470 471
471 act = menu.addAction( 472 act = menu.addAction(
472 UI.PixmapCache.getIcon( 473 UI.PixmapCache.getIcon(
473 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 474 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
474 self.vcs.vcsName(), self._VCSInfoDisplay) 475 self.vcs.vcsName(), self._VCSInfoDisplay)
475 font = act.font() 476 font = act.font()
476 font.setBold(True) 477 font.setBold(True)
477 act.setFont(font) 478 act.setFont(font)
478 menu.addSeparator() 479 menu.addSeparator()
479 480
480 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"), 481 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"),
481 self.trUtf8('Update from repository'), self._VCSUpdate) 482 self.trUtf8('Update from repository'), self._VCSUpdate)
482 self.vcsDirMenuActions.append(act) 483 self.vcsDirMenuActions.append(act)
483 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"), 484 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"),
484 self.trUtf8('Commit changes to repository...'), 485 self.trUtf8('Commit changes to repository...'),
485 self._VCSCommit) 486 self._VCSCommit)
486 self.vcsDirMenuActions.append(act) 487 self.vcsDirMenuActions.append(act)
487 menu.addSeparator() 488 menu.addSeparator()
488 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 489 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
489 self.trUtf8('Add to repository'), self._VCSAdd) 490 self.trUtf8('Add to repository'), self._VCSAdd)
490 self.vcsAddDirMenuActions.append(act) 491 self.vcsAddDirMenuActions.append(act)
491 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), 492 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"),
492 self.trUtf8('Remove from repository (and disk)'), 493 self.trUtf8('Remove from repository (and disk)'),
493 self._VCSRemove) 494 self._VCSRemove)
494 self.vcsDirMenuActions.append(act) 495 self.vcsDirMenuActions.append(act)
495 menu.addSeparator() 496 menu.addSeparator()
496 act = menu.addAction(self.trUtf8('Copy in repository'), self.__SVNCopy) 497 act = menu.addAction(self.trUtf8('Copy in repository'), self.__SVNCopy)
497 self.vcsDirMenuActions.append(act) 498 self.vcsDirMenuActions.append(act)
498 act = menu.addAction(self.trUtf8('Move in repository'), self.__SVNMove) 499 act = menu.addAction(self.trUtf8('Move in repository'), self.__SVNMove)
499 self.vcsDirMenuActions.append(act) 500 self.vcsDirMenuActions.append(act)
500 if self.vcs.versionStr >= '1.5.0': 501 if self.vcs.versionStr >= '1.5.0':
501 menu.addSeparator() 502 menu.addSeparator()
502 act = menu.addAction(self.trUtf8("Add to Changelist"), 503 act = menu.addAction(self.trUtf8("Add to Changelist"),
503 self.__SVNAddToChangelist) 504 self.__SVNAddToChangelist)
504 self.vcsMenuActions.append(act) 505 self.vcsMenuActions.append(act)
505 act = menu.addAction(self.trUtf8("Remove from Changelist"), 506 act = menu.addAction(self.trUtf8("Remove from Changelist"),
506 self.__SVNRemoveFromChangelist) 507 self.__SVNRemoveFromChangelist)
507 self.vcsMenuActions.append(act) 508 self.vcsMenuActions.append(act)
508 menu.addSeparator() 509 menu.addSeparator()
509 act = menu.addAction(UI.PixmapCache.getIcon("vcsLog.png"), 510 act = menu.addAction(UI.PixmapCache.getIcon("vcsLog.png"),
510 self.trUtf8('Show log'), self._VCSLog) 511 self.trUtf8('Show log'), self._VCSLog)
523 menu.addSeparator() 524 menu.addSeparator()
524 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 525 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
525 self.trUtf8('Show difference'), self._VCSDiff) 526 self.trUtf8('Show difference'), self._VCSDiff)
526 self.vcsDirMenuActions.append(act) 527 self.vcsDirMenuActions.append(act)
527 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 528 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
528 self.trUtf8('Show difference (extended)'), 529 self.trUtf8('Show difference (extended)'),
529 self.__SVNExtendedDiff) 530 self.__SVNExtendedDiff)
530 self.vcsDirMenuActions.append(act) 531 self.vcsDirMenuActions.append(act)
531 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 532 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
532 self.trUtf8('Show difference (URLs)'), 533 self.trUtf8('Show difference (URLs)'),
533 self.__SVNUrlDiff) 534 self.__SVNUrlDiff)
534 self.vcsDirMenuActions.append(act) 535 self.vcsDirMenuActions.append(act)
535 menu.addSeparator() 536 menu.addSeparator()
536 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), 537 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"),
537 self.trUtf8('Revert changes'), self._VCSRevert) 538 self.trUtf8('Revert changes'), self._VCSRevert)
578 579
579 menu = QMenu(self.trUtf8("Version Control")) 580 menu = QMenu(self.trUtf8("Version Control"))
580 581
581 act = menu.addAction( 582 act = menu.addAction(
582 UI.PixmapCache.getIcon( 583 UI.PixmapCache.getIcon(
583 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")), 584 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
584 self.vcs.vcsName(), self._VCSInfoDisplay) 585 self.vcs.vcsName(), self._VCSInfoDisplay)
585 font = act.font() 586 font = act.font()
586 font.setBold(True) 587 font.setBold(True)
587 act.setFont(font) 588 act.setFont(font)
588 menu.addSeparator() 589 menu.addSeparator()
589 590
590 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"), 591 act = menu.addAction(UI.PixmapCache.getIcon("vcsUpdate.png"),
591 self.trUtf8('Update from repository'), self._VCSUpdate) 592 self.trUtf8('Update from repository'), self._VCSUpdate)
592 self.vcsDirMultiMenuActions.append(act) 593 self.vcsDirMultiMenuActions.append(act)
593 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"), 594 act = menu.addAction(UI.PixmapCache.getIcon("vcsCommit.png"),
594 self.trUtf8('Commit changes to repository...'), 595 self.trUtf8('Commit changes to repository...'),
595 self._VCSCommit) 596 self._VCSCommit)
596 self.vcsDirMultiMenuActions.append(act) 597 self.vcsDirMultiMenuActions.append(act)
597 menu.addSeparator() 598 menu.addSeparator()
598 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), 599 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
599 self.trUtf8('Add to repository'), self._VCSAdd) 600 self.trUtf8('Add to repository'), self._VCSAdd)
600 self.vcsAddDirMultiMenuActions.append(act) 601 self.vcsAddDirMultiMenuActions.append(act)
601 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), 602 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"),
602 self.trUtf8('Remove from repository (and disk)'), 603 self.trUtf8('Remove from repository (and disk)'),
603 self._VCSRemove) 604 self._VCSRemove)
604 self.vcsDirMultiMenuActions.append(act) 605 self.vcsDirMultiMenuActions.append(act)
605 if self.vcs.versionStr >= '1.5.0': 606 if self.vcs.versionStr >= '1.5.0':
606 menu.addSeparator() 607 menu.addSeparator()
607 act = menu.addAction(self.trUtf8("Add to Changelist"), 608 act = menu.addAction(self.trUtf8("Add to Changelist"),
608 self.__SVNAddToChangelist) 609 self.__SVNAddToChangelist)
609 self.vcsMenuActions.append(act) 610 self.vcsMenuActions.append(act)
610 act = menu.addAction(self.trUtf8("Remove from Changelist"), 611 act = menu.addAction(self.trUtf8("Remove from Changelist"),
611 self.__SVNRemoveFromChangelist) 612 self.__SVNRemoveFromChangelist)
612 self.vcsMenuActions.append(act) 613 self.vcsMenuActions.append(act)
613 menu.addSeparator() 614 menu.addSeparator()
614 act = menu.addAction(UI.PixmapCache.getIcon("vcsStatus.png"), 615 act = menu.addAction(UI.PixmapCache.getIcon("vcsStatus.png"),
615 self.trUtf8('Show status'), self._VCSStatus) 616 self.trUtf8('Show status'), self._VCSStatus)
617 menu.addSeparator() 618 menu.addSeparator()
618 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 619 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
619 self.trUtf8('Show difference'), self._VCSDiff) 620 self.trUtf8('Show difference'), self._VCSDiff)
620 self.vcsDirMultiMenuActions.append(act) 621 self.vcsDirMultiMenuActions.append(act)
621 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 622 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
622 self.trUtf8('Show difference (extended)'), 623 self.trUtf8('Show difference (extended)'),
623 self.__SVNExtendedDiff) 624 self.__SVNExtendedDiff)
624 self.vcsDirMultiMenuActions.append(act) 625 self.vcsDirMultiMenuActions.append(act)
625 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"), 626 act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
626 self.trUtf8('Show difference (URLs)'), 627 self.trUtf8('Show difference (URLs)'),
627 self.__SVNUrlDiff) 628 self.__SVNUrlDiff)
628 self.vcsDirMultiMenuActions.append(act) 629 self.vcsDirMultiMenuActions.append(act)
629 menu.addSeparator() 630 menu.addSeparator()
630 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"), 631 act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"),
631 self.trUtf8('Revert changes'), self._VCSRevert) 632 self.trUtf8('Revert changes'), self._VCSRevert)
832 for itm in self.browser.getSelectedItems(): 833 for itm in self.browser.getSelectedItems():
833 try: 834 try:
834 names.append(itm.fileName()) 835 names.append(itm.fileName())
835 except AttributeError: 836 except AttributeError:
836 names.append(itm.dirName()) 837 names.append(itm.dirName())
837 self.vcs.svnUnlock(names, breakIt = True) 838 self.vcs.svnUnlock(names, breakIt=True)
838 839
839 def __SVNStealLock(self): 840 def __SVNStealLock(self):
840 """ 841 """
841 Private slot called by the context menu to steal lock files in the repository. 842 Private slot called by the context menu to steal lock files in the repository.
842 """ 843 """
844 for itm in self.browser.getSelectedItems(): 845 for itm in self.browser.getSelectedItems():
845 try: 846 try:
846 names.append(itm.fileName()) 847 names.append(itm.fileName())
847 except AttributeError: 848 except AttributeError:
848 names.append(itm.dirName()) 849 names.append(itm.dirName())
849 self.vcs.svnLock(names, stealIt = True) 850 self.vcs.svnLock(names, stealIt=True)
850 851
851 def __SVNConfigure(self): 852 def __SVNConfigure(self):
852 """ 853 """
853 Private method to open the configuration dialog. 854 Private method to open the configuration dialog.
854 """ 855 """

eric ide

mercurial