Plugins/VcsPlugins/vcsPySvn/ProjectBrowserHelper.py

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

eric ide

mercurial