Plugins/VcsPlugins/vcsPySvn/ProjectBrowserHelper.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3349
2a034a7f1f54
child 3515
1b8381afe38f
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
195 @param mainMenu reference to the menu to be amended 195 @param mainMenu reference to the menu to be amended
196 """ 196 """
197 self.vcsMenuActions = [] 197 self.vcsMenuActions = []
198 self.vcsAddMenuActions = [] 198 self.vcsAddMenuActions = []
199 199
200 menu = QMenu(self.trUtf8("Version Control")) 200 menu = QMenu(self.tr("Version Control"))
201 201
202 act = menu.addAction( 202 act = menu.addAction(
203 UI.PixmapCache.getIcon( 203 UI.PixmapCache.getIcon(
204 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")), 204 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")),
205 self.vcs.vcsName(), self._VCSInfoDisplay) 205 self.vcs.vcsName(), self._VCSInfoDisplay)
208 act.setFont(font) 208 act.setFont(font)
209 menu.addSeparator() 209 menu.addSeparator()
210 210
211 act = menu.addAction( 211 act = menu.addAction(
212 UI.PixmapCache.getIcon("vcsUpdate.png"), 212 UI.PixmapCache.getIcon("vcsUpdate.png"),
213 self.trUtf8('Update from repository'), self._VCSUpdate) 213 self.tr('Update from repository'), self._VCSUpdate)
214 self.vcsMenuActions.append(act) 214 self.vcsMenuActions.append(act)
215 act = menu.addAction( 215 act = menu.addAction(
216 UI.PixmapCache.getIcon("vcsCommit.png"), 216 UI.PixmapCache.getIcon("vcsCommit.png"),
217 self.trUtf8('Commit changes to repository...'), 217 self.tr('Commit changes to repository...'),
218 self._VCSCommit) 218 self._VCSCommit)
219 self.vcsMenuActions.append(act) 219 self.vcsMenuActions.append(act)
220 menu.addSeparator() 220 menu.addSeparator()
221 act = menu.addAction( 221 act = menu.addAction(
222 UI.PixmapCache.getIcon("vcsAdd.png"), 222 UI.PixmapCache.getIcon("vcsAdd.png"),
223 self.trUtf8('Add to repository'), 223 self.tr('Add to repository'),
224 self._VCSAdd) 224 self._VCSAdd)
225 self.vcsAddMenuActions.append(act) 225 self.vcsAddMenuActions.append(act)
226 if 1 in self.browser.specialMenuEntries: 226 if 1 in self.browser.specialMenuEntries:
227 self.vcsMenuAddTree = menu.addAction( 227 self.vcsMenuAddTree = menu.addAction(
228 UI.PixmapCache.getIcon("vcsAdd.png"), 228 UI.PixmapCache.getIcon("vcsAdd.png"),
229 self.trUtf8('Add tree to repository'), 229 self.tr('Add tree to repository'),
230 self._VCSAddTree) 230 self._VCSAddTree)
231 self.vcsAddMenuActions.append(self.vcsMenuAddTree) 231 self.vcsAddMenuActions.append(self.vcsMenuAddTree)
232 act = menu.addAction( 232 act = menu.addAction(
233 UI.PixmapCache.getIcon("vcsRemove.png"), 233 UI.PixmapCache.getIcon("vcsRemove.png"),
234 self.trUtf8('Remove from repository (and disk)'), 234 self.tr('Remove from repository (and disk)'),
235 self._VCSRemove) 235 self._VCSRemove)
236 self.vcsMenuActions.append(act) 236 self.vcsMenuActions.append(act)
237 menu.addSeparator() 237 menu.addSeparator()
238 act = menu.addAction( 238 act = menu.addAction(
239 self.trUtf8('Copy'), self.__SVNCopy) 239 self.tr('Copy'), self.__SVNCopy)
240 self.vcsMenuActions.append(act) 240 self.vcsMenuActions.append(act)
241 act = menu.addAction(self.trUtf8('Move'), self.__SVNMove) 241 act = menu.addAction(self.tr('Move'), self.__SVNMove)
242 self.vcsMenuActions.append(act) 242 self.vcsMenuActions.append(act)
243 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0): 243 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0):
244 menu.addSeparator() 244 menu.addSeparator()
245 act = menu.addAction( 245 act = menu.addAction(
246 self.trUtf8("Add to Changelist"), 246 self.tr("Add to Changelist"),
247 self.__SVNAddToChangelist) 247 self.__SVNAddToChangelist)
248 self.vcsMenuActions.append(act) 248 self.vcsMenuActions.append(act)
249 act = menu.addAction( 249 act = menu.addAction(
250 self.trUtf8("Remove from Changelist"), 250 self.tr("Remove from Changelist"),
251 self.__SVNRemoveFromChangelist) 251 self.__SVNRemoveFromChangelist)
252 self.vcsMenuActions.append(act) 252 self.vcsMenuActions.append(act)
253 menu.addSeparator() 253 menu.addSeparator()
254 act = menu.addAction( 254 act = menu.addAction(
255 UI.PixmapCache.getIcon("vcsLog.png"), 255 UI.PixmapCache.getIcon("vcsLog.png"),
256 self.trUtf8('Show log'), self._VCSLog) 256 self.tr('Show log'), self._VCSLog)
257 self.vcsMenuActions.append(act) 257 self.vcsMenuActions.append(act)
258 act = menu.addAction( 258 act = menu.addAction(
259 UI.PixmapCache.getIcon("vcsLog.png"), 259 UI.PixmapCache.getIcon("vcsLog.png"),
260 self.trUtf8('Show log browser'), self.__SVNLogBrowser) 260 self.tr('Show log browser'), self._VCSLogBrowser)
261 self.vcsMenuActions.append(act) 261 self.vcsMenuActions.append(act)
262 menu.addSeparator() 262 menu.addSeparator()
263 act = menu.addAction( 263 act = menu.addAction(
264 UI.PixmapCache.getIcon("vcsStatus.png"), 264 UI.PixmapCache.getIcon("vcsStatus.png"),
265 self.trUtf8('Show status'), self._VCSStatus) 265 self.tr('Show status'), self._VCSStatus)
266 self.vcsMenuActions.append(act) 266 self.vcsMenuActions.append(act)
267 act = menu.addAction( 267 act = menu.addAction(
268 UI.PixmapCache.getIcon("vcsRepo.png"), 268 UI.PixmapCache.getIcon("vcsRepo.png"),
269 self.trUtf8('Show repository info'), self.__SVNInfo) 269 self.tr('Show repository info'), self.__SVNInfo)
270 self.vcsMenuActions.append(act) 270 self.vcsMenuActions.append(act)
271 menu.addSeparator() 271 menu.addSeparator()
272 act = menu.addAction( 272 act = menu.addAction(
273 UI.PixmapCache.getIcon("vcsDiff.png"), 273 UI.PixmapCache.getIcon("vcsDiff.png"),
274 self.trUtf8('Show difference'), self._VCSDiff) 274 self.tr('Show difference'), self._VCSDiff)
275 self.vcsMenuActions.append(act) 275 self.vcsMenuActions.append(act)
276 act = menu.addAction( 276 act = menu.addAction(
277 UI.PixmapCache.getIcon("vcsSbsDiff.png"), 277 UI.PixmapCache.getIcon("vcsSbsDiff.png"),
278 self.trUtf8('Show difference side-by-side'), self.__SVNSbsDiff) 278 self.tr('Show difference side-by-side'), self.__SVNSbsDiff)
279 self.vcsMenuActions.append(act) 279 self.vcsMenuActions.append(act)
280 act = menu.addAction( 280 act = menu.addAction(
281 UI.PixmapCache.getIcon("vcsDiff.png"), 281 UI.PixmapCache.getIcon("vcsDiff.png"),
282 self.trUtf8('Show difference (extended)'), 282 self.tr('Show difference (extended)'),
283 self.__SVNExtendedDiff) 283 self.__SVNExtendedDiff)
284 self.vcsMenuActions.append(act) 284 self.vcsMenuActions.append(act)
285 act = menu.addAction( 285 act = menu.addAction(
286 UI.PixmapCache.getIcon("vcsSbsDiff.png"), 286 UI.PixmapCache.getIcon("vcsSbsDiff.png"),
287 self.trUtf8('Show difference side-by-side (extended)'), 287 self.tr('Show difference side-by-side (extended)'),
288 self.__SVNSbsExtendedDiff) 288 self.__SVNSbsExtendedDiff)
289 self.vcsMenuActions.append(act) 289 self.vcsMenuActions.append(act)
290 act = menu.addAction( 290 act = menu.addAction(
291 UI.PixmapCache.getIcon("vcsDiff.png"), 291 UI.PixmapCache.getIcon("vcsDiff.png"),
292 self.trUtf8('Show difference (URLs)'), 292 self.tr('Show difference (URLs)'),
293 self.__SVNUrlDiff) 293 self.__SVNUrlDiff)
294 self.vcsMenuActions.append(act) 294 self.vcsMenuActions.append(act)
295 self.blameAct = menu.addAction( 295 self.blameAct = menu.addAction(
296 self.trUtf8('Show annotated file'), 296 self.tr('Show annotated file'),
297 self.__SVNBlame) 297 self.__SVNBlame)
298 self.vcsMenuActions.append(self.blameAct) 298 self.vcsMenuActions.append(self.blameAct)
299 menu.addSeparator() 299 menu.addSeparator()
300 act = menu.addAction( 300 act = menu.addAction(
301 UI.PixmapCache.getIcon("vcsRevert.png"), 301 UI.PixmapCache.getIcon("vcsRevert.png"),
302 self.trUtf8('Revert changes'), self._VCSRevert) 302 self.tr('Revert changes'), self._VCSRevert)
303 self.vcsMenuActions.append(act) 303 self.vcsMenuActions.append(act)
304 act = menu.addAction( 304 act = menu.addAction(
305 UI.PixmapCache.getIcon("vcsMerge.png"), 305 UI.PixmapCache.getIcon("vcsMerge.png"),
306 self.trUtf8('Merge changes'), self._VCSMerge) 306 self.tr('Merge changes'), self._VCSMerge)
307 self.vcsMenuActions.append(act) 307 self.vcsMenuActions.append(act)
308 act = menu.addAction( 308 act = menu.addAction(
309 self.trUtf8('Conflict resolved'), self.__SVNResolve) 309 self.tr('Conflict resolved'), self.__SVNResolve)
310 self.vcsMenuActions.append(act) 310 self.vcsMenuActions.append(act)
311 menu.addSeparator() 311 menu.addSeparator()
312 act = menu.addAction( 312 act = menu.addAction(
313 UI.PixmapCache.getIcon("vcsLock.png"), 313 UI.PixmapCache.getIcon("vcsLock.png"),
314 self.trUtf8('Lock'), self.__SVNLock) 314 self.tr('Lock'), self.__SVNLock)
315 self.vcsMenuActions.append(act) 315 self.vcsMenuActions.append(act)
316 act = menu.addAction( 316 act = menu.addAction(
317 UI.PixmapCache.getIcon("vcsUnlock.png"), 317 UI.PixmapCache.getIcon("vcsUnlock.png"),
318 self.trUtf8('Unlock'), self.__SVNUnlock) 318 self.tr('Unlock'), self.__SVNUnlock)
319 self.vcsMenuActions.append(act) 319 self.vcsMenuActions.append(act)
320 act = menu.addAction( 320 act = menu.addAction(
321 UI.PixmapCache.getIcon("vcsUnlock.png"), 321 UI.PixmapCache.getIcon("vcsUnlock.png"),
322 self.trUtf8('Break Lock'), self.__SVNBreakLock) 322 self.tr('Break Lock'), self.__SVNBreakLock)
323 self.vcsMenuActions.append(act) 323 self.vcsMenuActions.append(act)
324 act = menu.addAction( 324 act = menu.addAction(
325 UI.PixmapCache.getIcon("vcsUnlock.png"), 325 UI.PixmapCache.getIcon("vcsUnlock.png"),
326 self.trUtf8('Steal Lock'), self.__SVNStealLock) 326 self.tr('Steal Lock'), self.__SVNStealLock)
327 self.vcsMenuActions.append(act) 327 self.vcsMenuActions.append(act)
328 menu.addSeparator() 328 menu.addSeparator()
329 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 329 act = menu.addAction(self.tr('Set Property'), self.__SVNSetProp)
330 self.vcsMenuActions.append(act) 330 self.vcsMenuActions.append(act)
331 act = menu.addAction( 331 act = menu.addAction(
332 self.trUtf8('List Properties'), self.__SVNListProps) 332 self.tr('List Properties'), self.__SVNListProps)
333 self.vcsMenuActions.append(act) 333 self.vcsMenuActions.append(act)
334 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 334 act = menu.addAction(self.tr('Delete Property'), self.__SVNDelProp)
335 self.vcsMenuActions.append(act) 335 self.vcsMenuActions.append(act)
336 menu.addSeparator() 336 menu.addSeparator()
337 menu.addAction(self.trUtf8('Select all local file entries'), 337 menu.addAction(self.tr('Select all local file entries'),
338 self.browser.selectLocalEntries) 338 self.browser.selectLocalEntries)
339 menu.addAction(self.trUtf8('Select all versioned file entries'), 339 menu.addAction(self.tr('Select all versioned file entries'),
340 self.browser.selectVCSEntries) 340 self.browser.selectVCSEntries)
341 menu.addAction(self.trUtf8('Select all local directory entries'), 341 menu.addAction(self.tr('Select all local directory entries'),
342 self.browser.selectLocalDirEntries) 342 self.browser.selectLocalDirEntries)
343 menu.addAction(self.trUtf8('Select all versioned directory entries'), 343 menu.addAction(self.tr('Select all versioned directory entries'),
344 self.browser.selectVCSDirEntries) 344 self.browser.selectVCSDirEntries)
345 menu.addSeparator() 345 menu.addSeparator()
346 menu.addAction(self.trUtf8("Configure..."), self.__SVNConfigure) 346 menu.addAction(self.tr("Configure..."), self.__SVNConfigure)
347 347
348 mainMenu.addSeparator() 348 mainMenu.addSeparator()
349 mainMenu.addMenu(menu) 349 mainMenu.addMenu(menu)
350 self.menu = menu 350 self.menu = menu
351 351
357 @param mainMenu reference to the menu to be amended 357 @param mainMenu reference to the menu to be amended
358 """ 358 """
359 self.vcsMultiMenuActions = [] 359 self.vcsMultiMenuActions = []
360 self.vcsAddMultiMenuActions = [] 360 self.vcsAddMultiMenuActions = []
361 361
362 menu = QMenu(self.trUtf8("Version Control")) 362 menu = QMenu(self.tr("Version Control"))
363 363
364 act = menu.addAction( 364 act = menu.addAction(
365 UI.PixmapCache.getIcon( 365 UI.PixmapCache.getIcon(
366 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")), 366 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")),
367 self.vcs.vcsName(), self._VCSInfoDisplay) 367 self.vcs.vcsName(), self._VCSInfoDisplay)
370 act.setFont(font) 370 act.setFont(font)
371 menu.addSeparator() 371 menu.addSeparator()
372 372
373 act = menu.addAction( 373 act = menu.addAction(
374 UI.PixmapCache.getIcon("vcsUpdate.png"), 374 UI.PixmapCache.getIcon("vcsUpdate.png"),
375 self.trUtf8('Update from repository'), self._VCSUpdate) 375 self.tr('Update from repository'), self._VCSUpdate)
376 self.vcsMultiMenuActions.append(act) 376 self.vcsMultiMenuActions.append(act)
377 act = menu.addAction( 377 act = menu.addAction(
378 UI.PixmapCache.getIcon("vcsCommit.png"), 378 UI.PixmapCache.getIcon("vcsCommit.png"),
379 self.trUtf8('Commit changes to repository...'), 379 self.tr('Commit changes to repository...'),
380 self._VCSCommit) 380 self._VCSCommit)
381 self.vcsMultiMenuActions.append(act) 381 self.vcsMultiMenuActions.append(act)
382 menu.addSeparator() 382 menu.addSeparator()
383 act = menu.addAction( 383 act = menu.addAction(
384 UI.PixmapCache.getIcon("vcsAdd.png"), 384 UI.PixmapCache.getIcon("vcsAdd.png"),
385 self.trUtf8('Add to repository'), self._VCSAdd) 385 self.tr('Add to repository'), self._VCSAdd)
386 self.vcsAddMultiMenuActions.append(act) 386 self.vcsAddMultiMenuActions.append(act)
387 if 1 in self.browser.specialMenuEntries: 387 if 1 in self.browser.specialMenuEntries:
388 self.vcsMultiMenuAddTree = menu.addAction( 388 self.vcsMultiMenuAddTree = menu.addAction(
389 UI.PixmapCache.getIcon("vcsAdd.png"), 389 UI.PixmapCache.getIcon("vcsAdd.png"),
390 self.trUtf8('Add tree to repository'), self._VCSAddTree) 390 self.tr('Add tree to repository'), self._VCSAddTree)
391 self.vcsAddMultiMenuActions.append(self.vcsMultiMenuAddTree) 391 self.vcsAddMultiMenuActions.append(self.vcsMultiMenuAddTree)
392 act = menu.addAction( 392 act = menu.addAction(
393 UI.PixmapCache.getIcon("vcsRemove.png"), 393 UI.PixmapCache.getIcon("vcsRemove.png"),
394 self.trUtf8('Remove from repository (and disk)'), 394 self.tr('Remove from repository (and disk)'),
395 self._VCSRemove) 395 self._VCSRemove)
396 self.vcsMultiMenuActions.append(act) 396 self.vcsMultiMenuActions.append(act)
397 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0): 397 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0):
398 menu.addSeparator() 398 menu.addSeparator()
399 act = menu.addAction( 399 act = menu.addAction(
400 self.trUtf8("Add to Changelist"), 400 self.tr("Add to Changelist"),
401 self.__SVNAddToChangelist) 401 self.__SVNAddToChangelist)
402 self.vcsMenuActions.append(act) 402 self.vcsMenuActions.append(act)
403 act = menu.addAction( 403 act = menu.addAction(
404 self.trUtf8("Remove from Changelist"), 404 self.tr("Remove from Changelist"),
405 self.__SVNRemoveFromChangelist) 405 self.__SVNRemoveFromChangelist)
406 self.vcsMenuActions.append(act) 406 self.vcsMenuActions.append(act)
407 menu.addSeparator() 407 menu.addSeparator()
408 act = menu.addAction( 408 act = menu.addAction(
409 UI.PixmapCache.getIcon("vcsStatus.png"), 409 UI.PixmapCache.getIcon("vcsStatus.png"),
410 self.trUtf8('Show status'), self._VCSStatus) 410 self.tr('Show status'), self._VCSStatus)
411 self.vcsMultiMenuActions.append(act) 411 self.vcsMultiMenuActions.append(act)
412 menu.addSeparator() 412 menu.addSeparator()
413 act = menu.addAction( 413 act = menu.addAction(
414 UI.PixmapCache.getIcon("vcsDiff.png"), 414 UI.PixmapCache.getIcon("vcsDiff.png"),
415 self.trUtf8('Show difference'), self._VCSDiff) 415 self.tr('Show difference'), self._VCSDiff)
416 self.vcsMultiMenuActions.append(act) 416 self.vcsMultiMenuActions.append(act)
417 act = menu.addAction( 417 act = menu.addAction(
418 UI.PixmapCache.getIcon("vcsDiff.png"), 418 UI.PixmapCache.getIcon("vcsDiff.png"),
419 self.trUtf8('Show difference (extended)'), 419 self.tr('Show difference (extended)'),
420 self.__SVNExtendedDiff) 420 self.__SVNExtendedDiff)
421 self.vcsMultiMenuActions.append(act) 421 self.vcsMultiMenuActions.append(act)
422 act = menu.addAction( 422 act = menu.addAction(
423 UI.PixmapCache.getIcon("vcsDiff.png"), 423 UI.PixmapCache.getIcon("vcsDiff.png"),
424 self.trUtf8('Show difference (URLs)'), 424 self.tr('Show difference (URLs)'),
425 self.__SVNUrlDiff) 425 self.__SVNUrlDiff)
426 self.vcsMultiMenuActions.append(act) 426 self.vcsMultiMenuActions.append(act)
427 menu.addSeparator() 427 menu.addSeparator()
428 act = menu.addAction( 428 act = menu.addAction(
429 UI.PixmapCache.getIcon("vcsRevert.png"), 429 UI.PixmapCache.getIcon("vcsRevert.png"),
430 self.trUtf8('Revert changes'), self._VCSRevert) 430 self.tr('Revert changes'), self._VCSRevert)
431 self.vcsMultiMenuActions.append(act) 431 self.vcsMultiMenuActions.append(act)
432 act = menu.addAction( 432 act = menu.addAction(
433 self.trUtf8('Conflict resolved'), self.__SVNResolve) 433 self.tr('Conflict resolved'), self.__SVNResolve)
434 self.vcsMultiMenuActions.append(act) 434 self.vcsMultiMenuActions.append(act)
435 menu.addSeparator() 435 menu.addSeparator()
436 act = menu.addAction( 436 act = menu.addAction(
437 UI.PixmapCache.getIcon("vcsLock.png"), 437 UI.PixmapCache.getIcon("vcsLock.png"),
438 self.trUtf8('Lock'), self.__SVNLock) 438 self.tr('Lock'), self.__SVNLock)
439 self.vcsMultiMenuActions.append(act) 439 self.vcsMultiMenuActions.append(act)
440 act = menu.addAction( 440 act = menu.addAction(
441 UI.PixmapCache.getIcon("vcsUnlock.png"), 441 UI.PixmapCache.getIcon("vcsUnlock.png"),
442 self.trUtf8('Unlock'), self.__SVNUnlock) 442 self.tr('Unlock'), self.__SVNUnlock)
443 self.vcsMultiMenuActions.append(act) 443 self.vcsMultiMenuActions.append(act)
444 act = menu.addAction( 444 act = menu.addAction(
445 UI.PixmapCache.getIcon("vcsUnlock.png"), 445 UI.PixmapCache.getIcon("vcsUnlock.png"),
446 self.trUtf8('Break Lock'), self.__SVNBreakLock) 446 self.tr('Break Lock'), self.__SVNBreakLock)
447 self.vcsMultiMenuActions.append(act) 447 self.vcsMultiMenuActions.append(act)
448 act = menu.addAction( 448 act = menu.addAction(
449 UI.PixmapCache.getIcon("vcsUnlock.png"), 449 UI.PixmapCache.getIcon("vcsUnlock.png"),
450 self.trUtf8('Steal Lock'), self.__SVNStealLock) 450 self.tr('Steal Lock'), self.__SVNStealLock)
451 self.vcsMultiMenuActions.append(act) 451 self.vcsMultiMenuActions.append(act)
452 menu.addSeparator() 452 menu.addSeparator()
453 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 453 act = menu.addAction(self.tr('Set Property'), self.__SVNSetProp)
454 self.vcsMultiMenuActions.append(act) 454 self.vcsMultiMenuActions.append(act)
455 act = menu.addAction( 455 act = menu.addAction(
456 self.trUtf8('List Properties'), self.__SVNListProps) 456 self.tr('List Properties'), self.__SVNListProps)
457 self.vcsMultiMenuActions.append(act) 457 self.vcsMultiMenuActions.append(act)
458 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 458 act = menu.addAction(self.tr('Delete Property'), self.__SVNDelProp)
459 self.vcsMultiMenuActions.append(act) 459 self.vcsMultiMenuActions.append(act)
460 menu.addSeparator() 460 menu.addSeparator()
461 menu.addAction(self.trUtf8('Select all local file entries'), 461 menu.addAction(self.tr('Select all local file entries'),
462 self.browser.selectLocalEntries) 462 self.browser.selectLocalEntries)
463 menu.addAction(self.trUtf8('Select all versioned file entries'), 463 menu.addAction(self.tr('Select all versioned file entries'),
464 self.browser.selectVCSEntries) 464 self.browser.selectVCSEntries)
465 menu.addAction(self.trUtf8('Select all local directory entries'), 465 menu.addAction(self.tr('Select all local directory entries'),
466 self.browser.selectLocalDirEntries) 466 self.browser.selectLocalDirEntries)
467 menu.addAction(self.trUtf8('Select all versioned directory entries'), 467 menu.addAction(self.tr('Select all versioned directory entries'),
468 self.browser.selectVCSDirEntries) 468 self.browser.selectVCSDirEntries)
469 menu.addSeparator() 469 menu.addSeparator()
470 menu.addAction(self.trUtf8("Configure..."), self.__SVNConfigure) 470 menu.addAction(self.tr("Configure..."), self.__SVNConfigure)
471 471
472 mainMenu.addSeparator() 472 mainMenu.addSeparator()
473 mainMenu.addMenu(menu) 473 mainMenu.addMenu(menu)
474 self.menuMulti = menu 474 self.menuMulti = menu
475 475
477 """ 477 """
478 Protected method used to add the VCS menu to all project browsers. 478 Protected method used to add the VCS menu to all project browsers.
479 479
480 @param mainMenu reference to the menu to be amended 480 @param mainMenu reference to the menu to be amended
481 """ 481 """
482 menu = QMenu(self.trUtf8("Version Control")) 482 menu = QMenu(self.tr("Version Control"))
483 483
484 act = menu.addAction( 484 act = menu.addAction(
485 UI.PixmapCache.getIcon( 485 UI.PixmapCache.getIcon(
486 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")), 486 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")),
487 self.vcs.vcsName(), self._VCSInfoDisplay) 487 self.vcs.vcsName(), self._VCSInfoDisplay)
488 font = act.font() 488 font = act.font()
489 font.setBold(True) 489 font.setBold(True)
490 act.setFont(font) 490 act.setFont(font)
491 menu.addSeparator() 491 menu.addSeparator()
492 492
493 menu.addAction(self.trUtf8('Select all local file entries'), 493 menu.addAction(self.tr('Select all local file entries'),
494 self.browser.selectLocalEntries) 494 self.browser.selectLocalEntries)
495 menu.addAction(self.trUtf8('Select all versioned file entries'), 495 menu.addAction(self.tr('Select all versioned file entries'),
496 self.browser.selectVCSEntries) 496 self.browser.selectVCSEntries)
497 menu.addAction(self.trUtf8('Select all local directory entries'), 497 menu.addAction(self.tr('Select all local directory entries'),
498 self.browser.selectLocalDirEntries) 498 self.browser.selectLocalDirEntries)
499 menu.addAction(self.trUtf8('Select all versioned directory entries'), 499 menu.addAction(self.tr('Select all versioned directory entries'),
500 self.browser.selectVCSDirEntries) 500 self.browser.selectVCSDirEntries)
501 menu.addSeparator() 501 menu.addSeparator()
502 menu.addAction(self.trUtf8("Configure..."), self.__SVNConfigure) 502 menu.addAction(self.tr("Configure..."), self.__SVNConfigure)
503 503
504 mainMenu.addSeparator() 504 mainMenu.addSeparator()
505 mainMenu.addMenu(menu) 505 mainMenu.addMenu(menu)
506 self.menuBack = menu 506 self.menuBack = menu
507 507
515 return 515 return
516 516
517 self.vcsDirMenuActions = [] 517 self.vcsDirMenuActions = []
518 self.vcsAddDirMenuActions = [] 518 self.vcsAddDirMenuActions = []
519 519
520 menu = QMenu(self.trUtf8("Version Control")) 520 menu = QMenu(self.tr("Version Control"))
521 521
522 act = menu.addAction( 522 act = menu.addAction(
523 UI.PixmapCache.getIcon( 523 UI.PixmapCache.getIcon(
524 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")), 524 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")),
525 self.vcs.vcsName(), self._VCSInfoDisplay) 525 self.vcs.vcsName(), self._VCSInfoDisplay)
528 act.setFont(font) 528 act.setFont(font)
529 menu.addSeparator() 529 menu.addSeparator()
530 530
531 act = menu.addAction( 531 act = menu.addAction(
532 UI.PixmapCache.getIcon("vcsUpdate.png"), 532 UI.PixmapCache.getIcon("vcsUpdate.png"),
533 self.trUtf8('Update from repository'), self._VCSUpdate) 533 self.tr('Update from repository'), self._VCSUpdate)
534 self.vcsDirMenuActions.append(act) 534 self.vcsDirMenuActions.append(act)
535 act = menu.addAction( 535 act = menu.addAction(
536 UI.PixmapCache.getIcon("vcsCommit.png"), 536 UI.PixmapCache.getIcon("vcsCommit.png"),
537 self.trUtf8('Commit changes to repository...'), 537 self.tr('Commit changes to repository...'),
538 self._VCSCommit) 538 self._VCSCommit)
539 self.vcsDirMenuActions.append(act) 539 self.vcsDirMenuActions.append(act)
540 menu.addSeparator() 540 menu.addSeparator()
541 act = menu.addAction( 541 act = menu.addAction(
542 UI.PixmapCache.getIcon("vcsAdd.png"), 542 UI.PixmapCache.getIcon("vcsAdd.png"),
543 self.trUtf8('Add to repository'), self._VCSAdd) 543 self.tr('Add to repository'), self._VCSAdd)
544 self.vcsAddDirMenuActions.append(act) 544 self.vcsAddDirMenuActions.append(act)
545 act = menu.addAction( 545 act = menu.addAction(
546 UI.PixmapCache.getIcon("vcsRemove.png"), 546 UI.PixmapCache.getIcon("vcsRemove.png"),
547 self.trUtf8('Remove from repository (and disk)'), 547 self.tr('Remove from repository (and disk)'),
548 self._VCSRemove) 548 self._VCSRemove)
549 self.vcsDirMenuActions.append(act) 549 self.vcsDirMenuActions.append(act)
550 menu.addSeparator() 550 menu.addSeparator()
551 act = menu.addAction(self.trUtf8('Copy'), self.__SVNCopy) 551 act = menu.addAction(self.tr('Copy'), self.__SVNCopy)
552 self.vcsDirMenuActions.append(act) 552 self.vcsDirMenuActions.append(act)
553 act = menu.addAction(self.trUtf8('Move'), self.__SVNMove) 553 act = menu.addAction(self.tr('Move'), self.__SVNMove)
554 self.vcsDirMenuActions.append(act) 554 self.vcsDirMenuActions.append(act)
555 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0): 555 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0):
556 menu.addSeparator() 556 menu.addSeparator()
557 act = menu.addAction( 557 act = menu.addAction(
558 self.trUtf8("Add to Changelist"), 558 self.tr("Add to Changelist"),
559 self.__SVNAddToChangelist) 559 self.__SVNAddToChangelist)
560 self.vcsMenuActions.append(act) 560 self.vcsMenuActions.append(act)
561 act = menu.addAction( 561 act = menu.addAction(
562 self.trUtf8("Remove from Changelist"), 562 self.tr("Remove from Changelist"),
563 self.__SVNRemoveFromChangelist) 563 self.__SVNRemoveFromChangelist)
564 self.vcsMenuActions.append(act) 564 self.vcsMenuActions.append(act)
565 menu.addSeparator() 565 menu.addSeparator()
566 act = menu.addAction( 566 act = menu.addAction(
567 UI.PixmapCache.getIcon("vcsLog.png"), 567 UI.PixmapCache.getIcon("vcsLog.png"),
568 self.trUtf8('Show log'), self._VCSLog) 568 self.tr('Show log'), self._VCSLog)
569 self.vcsDirMenuActions.append(act) 569 self.vcsDirMenuActions.append(act)
570 act = menu.addAction( 570 act = menu.addAction(
571 UI.PixmapCache.getIcon("vcsLog.png"), 571 UI.PixmapCache.getIcon("vcsLog.png"),
572 self.trUtf8('Show log browser'), self.__SVNLogBrowser) 572 self.tr('Show log browser'), self._VCSLogBrowser)
573 self.vcsDirMenuActions.append(act) 573 self.vcsDirMenuActions.append(act)
574 menu.addSeparator() 574 menu.addSeparator()
575 act = menu.addAction( 575 act = menu.addAction(
576 UI.PixmapCache.getIcon("vcsStatus.png"), 576 UI.PixmapCache.getIcon("vcsStatus.png"),
577 self.trUtf8('Show status'), self._VCSStatus) 577 self.tr('Show status'), self._VCSStatus)
578 self.vcsDirMenuActions.append(act) 578 self.vcsDirMenuActions.append(act)
579 act = menu.addAction( 579 act = menu.addAction(
580 UI.PixmapCache.getIcon("vcsRepo.png"), 580 UI.PixmapCache.getIcon("vcsRepo.png"),
581 self.trUtf8('Show repository info'), self.__SVNInfo) 581 self.tr('Show repository info'), self.__SVNInfo)
582 self.vcsDirMenuActions.append(act) 582 self.vcsDirMenuActions.append(act)
583 menu.addSeparator() 583 menu.addSeparator()
584 act = menu.addAction( 584 act = menu.addAction(
585 UI.PixmapCache.getIcon("vcsDiff.png"), 585 UI.PixmapCache.getIcon("vcsDiff.png"),
586 self.trUtf8('Show difference'), self._VCSDiff) 586 self.tr('Show difference'), self._VCSDiff)
587 self.vcsDirMenuActions.append(act) 587 self.vcsDirMenuActions.append(act)
588 act = menu.addAction( 588 act = menu.addAction(
589 UI.PixmapCache.getIcon("vcsDiff.png"), 589 UI.PixmapCache.getIcon("vcsDiff.png"),
590 self.trUtf8('Show difference (extended)'), 590 self.tr('Show difference (extended)'),
591 self.__SVNExtendedDiff) 591 self.__SVNExtendedDiff)
592 self.vcsDirMenuActions.append(act) 592 self.vcsDirMenuActions.append(act)
593 act = menu.addAction( 593 act = menu.addAction(
594 UI.PixmapCache.getIcon("vcsDiff.png"), 594 UI.PixmapCache.getIcon("vcsDiff.png"),
595 self.trUtf8('Show difference (URLs)'), 595 self.tr('Show difference (URLs)'),
596 self.__SVNUrlDiff) 596 self.__SVNUrlDiff)
597 self.vcsDirMenuActions.append(act) 597 self.vcsDirMenuActions.append(act)
598 menu.addSeparator() 598 menu.addSeparator()
599 act = menu.addAction( 599 act = menu.addAction(
600 UI.PixmapCache.getIcon("vcsRevert.png"), 600 UI.PixmapCache.getIcon("vcsRevert.png"),
601 self.trUtf8('Revert changes'), self._VCSRevert) 601 self.tr('Revert changes'), self._VCSRevert)
602 self.vcsDirMenuActions.append(act) 602 self.vcsDirMenuActions.append(act)
603 act = menu.addAction( 603 act = menu.addAction(
604 UI.PixmapCache.getIcon("vcsMerge.png"), 604 UI.PixmapCache.getIcon("vcsMerge.png"),
605 self.trUtf8('Merge changes'), self._VCSMerge) 605 self.tr('Merge changes'), self._VCSMerge)
606 self.vcsDirMenuActions.append(act) 606 self.vcsDirMenuActions.append(act)
607 act = menu.addAction( 607 act = menu.addAction(
608 self.trUtf8('Conflict resolved'), self.__SVNResolve) 608 self.tr('Conflict resolved'), self.__SVNResolve)
609 self.vcsDirMenuActions.append(act) 609 self.vcsDirMenuActions.append(act)
610 menu.addSeparator() 610 menu.addSeparator()
611 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 611 act = menu.addAction(self.tr('Set Property'), self.__SVNSetProp)
612 self.vcsDirMenuActions.append(act) 612 self.vcsDirMenuActions.append(act)
613 act = menu.addAction( 613 act = menu.addAction(
614 self.trUtf8('List Properties'), self.__SVNListProps) 614 self.tr('List Properties'), self.__SVNListProps)
615 self.vcsDirMenuActions.append(act) 615 self.vcsDirMenuActions.append(act)
616 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 616 act = menu.addAction(self.tr('Delete Property'), self.__SVNDelProp)
617 self.vcsDirMenuActions.append(act) 617 self.vcsDirMenuActions.append(act)
618 menu.addSeparator() 618 menu.addSeparator()
619 menu.addAction(self.trUtf8('Select all local file entries'), 619 menu.addAction(self.tr('Select all local file entries'),
620 self.browser.selectLocalEntries) 620 self.browser.selectLocalEntries)
621 menu.addAction(self.trUtf8('Select all versioned file entries'), 621 menu.addAction(self.tr('Select all versioned file entries'),
622 self.browser.selectVCSEntries) 622 self.browser.selectVCSEntries)
623 menu.addAction(self.trUtf8('Select all local directory entries'), 623 menu.addAction(self.tr('Select all local directory entries'),
624 self.browser.selectLocalDirEntries) 624 self.browser.selectLocalDirEntries)
625 menu.addAction(self.trUtf8('Select all versioned directory entries'), 625 menu.addAction(self.tr('Select all versioned directory entries'),
626 self.browser.selectVCSDirEntries) 626 self.browser.selectVCSDirEntries)
627 menu.addSeparator() 627 menu.addSeparator()
628 menu.addAction(self.trUtf8("Configure..."), self.__SVNConfigure) 628 menu.addAction(self.tr("Configure..."), self.__SVNConfigure)
629 629
630 mainMenu.addSeparator() 630 mainMenu.addSeparator()
631 mainMenu.addMenu(menu) 631 mainMenu.addMenu(menu)
632 self.menuDir = menu 632 self.menuDir = menu
633 633
641 return 641 return
642 642
643 self.vcsDirMultiMenuActions = [] 643 self.vcsDirMultiMenuActions = []
644 self.vcsAddDirMultiMenuActions = [] 644 self.vcsAddDirMultiMenuActions = []
645 645
646 menu = QMenu(self.trUtf8("Version Control")) 646 menu = QMenu(self.tr("Version Control"))
647 647
648 act = menu.addAction( 648 act = menu.addAction(
649 UI.PixmapCache.getIcon( 649 UI.PixmapCache.getIcon(
650 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")), 650 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.png")),
651 self.vcs.vcsName(), self._VCSInfoDisplay) 651 self.vcs.vcsName(), self._VCSInfoDisplay)
654 act.setFont(font) 654 act.setFont(font)
655 menu.addSeparator() 655 menu.addSeparator()
656 656
657 act = menu.addAction( 657 act = menu.addAction(
658 UI.PixmapCache.getIcon("vcsUpdate.png"), 658 UI.PixmapCache.getIcon("vcsUpdate.png"),
659 self.trUtf8('Update from repository'), self._VCSUpdate) 659 self.tr('Update from repository'), self._VCSUpdate)
660 self.vcsDirMultiMenuActions.append(act) 660 self.vcsDirMultiMenuActions.append(act)
661 act = menu.addAction( 661 act = menu.addAction(
662 UI.PixmapCache.getIcon("vcsCommit.png"), 662 UI.PixmapCache.getIcon("vcsCommit.png"),
663 self.trUtf8('Commit changes to repository...'), 663 self.tr('Commit changes to repository...'),
664 self._VCSCommit) 664 self._VCSCommit)
665 self.vcsDirMultiMenuActions.append(act) 665 self.vcsDirMultiMenuActions.append(act)
666 menu.addSeparator() 666 menu.addSeparator()
667 act = menu.addAction( 667 act = menu.addAction(
668 UI.PixmapCache.getIcon("vcsAdd.png"), 668 UI.PixmapCache.getIcon("vcsAdd.png"),
669 self.trUtf8('Add to repository'), self._VCSAdd) 669 self.tr('Add to repository'), self._VCSAdd)
670 self.vcsAddDirMultiMenuActions.append(act) 670 self.vcsAddDirMultiMenuActions.append(act)
671 act = menu.addAction( 671 act = menu.addAction(
672 UI.PixmapCache.getIcon("vcsRemove.png"), 672 UI.PixmapCache.getIcon("vcsRemove.png"),
673 self.trUtf8('Remove from repository (and disk)'), 673 self.tr('Remove from repository (and disk)'),
674 self._VCSRemove) 674 self._VCSRemove)
675 self.vcsDirMultiMenuActions.append(act) 675 self.vcsDirMultiMenuActions.append(act)
676 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0): 676 if pysvn.svn_version >= (1, 5, 0) and pysvn.version >= (1, 6, 0):
677 menu.addSeparator() 677 menu.addSeparator()
678 act = menu.addAction( 678 act = menu.addAction(
679 self.trUtf8("Add to Changelist"), 679 self.tr("Add to Changelist"),
680 self.__SVNAddToChangelist) 680 self.__SVNAddToChangelist)
681 self.vcsMenuActions.append(act) 681 self.vcsMenuActions.append(act)
682 act = menu.addAction( 682 act = menu.addAction(
683 self.trUtf8("Remove from Changelist"), 683 self.tr("Remove from Changelist"),
684 self.__SVNRemoveFromChangelist) 684 self.__SVNRemoveFromChangelist)
685 self.vcsMenuActions.append(act) 685 self.vcsMenuActions.append(act)
686 menu.addSeparator() 686 menu.addSeparator()
687 act = menu.addAction( 687 act = menu.addAction(
688 UI.PixmapCache.getIcon("vcsStatus.png"), 688 UI.PixmapCache.getIcon("vcsStatus.png"),
689 self.trUtf8('Show status'), self._VCSStatus) 689 self.tr('Show status'), self._VCSStatus)
690 self.vcsDirMultiMenuActions.append(act) 690 self.vcsDirMultiMenuActions.append(act)
691 menu.addSeparator() 691 menu.addSeparator()
692 act = menu.addAction( 692 act = menu.addAction(
693 UI.PixmapCache.getIcon("vcsDiff.png"), 693 UI.PixmapCache.getIcon("vcsDiff.png"),
694 self.trUtf8('Show difference'), self._VCSDiff) 694 self.tr('Show difference'), self._VCSDiff)
695 self.vcsDirMultiMenuActions.append(act) 695 self.vcsDirMultiMenuActions.append(act)
696 act = menu.addAction( 696 act = menu.addAction(
697 UI.PixmapCache.getIcon("vcsDiff.png"), 697 UI.PixmapCache.getIcon("vcsDiff.png"),
698 self.trUtf8('Show difference (extended)'), 698 self.tr('Show difference (extended)'),
699 self.__SVNExtendedDiff) 699 self.__SVNExtendedDiff)
700 self.vcsDirMultiMenuActions.append(act) 700 self.vcsDirMultiMenuActions.append(act)
701 act = menu.addAction( 701 act = menu.addAction(
702 UI.PixmapCache.getIcon("vcsDiff.png"), 702 UI.PixmapCache.getIcon("vcsDiff.png"),
703 self.trUtf8('Show difference (URLs)'), 703 self.tr('Show difference (URLs)'),
704 self.__SVNUrlDiff) 704 self.__SVNUrlDiff)
705 self.vcsDirMultiMenuActions.append(act) 705 self.vcsDirMultiMenuActions.append(act)
706 menu.addSeparator() 706 menu.addSeparator()
707 act = menu.addAction( 707 act = menu.addAction(
708 UI.PixmapCache.getIcon("vcsRevert.png"), 708 UI.PixmapCache.getIcon("vcsRevert.png"),
709 self.trUtf8('Revert changes'), self._VCSRevert) 709 self.tr('Revert changes'), self._VCSRevert)
710 self.vcsDirMultiMenuActions.append(act) 710 self.vcsDirMultiMenuActions.append(act)
711 act = menu.addAction( 711 act = menu.addAction(
712 UI.PixmapCache.getIcon("vcsMerge.png"), 712 UI.PixmapCache.getIcon("vcsMerge.png"),
713 self.trUtf8('Merge changes'), self._VCSMerge) 713 self.tr('Merge changes'), self._VCSMerge)
714 self.vcsDirMultiMenuActions.append(act) 714 self.vcsDirMultiMenuActions.append(act)
715 act = menu.addAction( 715 act = menu.addAction(
716 self.trUtf8('Conflict resolved'), self.__SVNResolve) 716 self.tr('Conflict resolved'), self.__SVNResolve)
717 self.vcsDirMultiMenuActions.append(act) 717 self.vcsDirMultiMenuActions.append(act)
718 menu.addSeparator() 718 menu.addSeparator()
719 act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp) 719 act = menu.addAction(self.tr('Set Property'), self.__SVNSetProp)
720 self.vcsDirMultiMenuActions.append(act) 720 self.vcsDirMultiMenuActions.append(act)
721 act = menu.addAction( 721 act = menu.addAction(
722 self.trUtf8('List Properties'), self.__SVNListProps) 722 self.tr('List Properties'), self.__SVNListProps)
723 self.vcsDirMultiMenuActions.append(act) 723 self.vcsDirMultiMenuActions.append(act)
724 act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp) 724 act = menu.addAction(self.tr('Delete Property'), self.__SVNDelProp)
725 self.vcsDirMultiMenuActions.append(act) 725 self.vcsDirMultiMenuActions.append(act)
726 menu.addSeparator() 726 menu.addSeparator()
727 menu.addAction(self.trUtf8('Select all local file entries'), 727 menu.addAction(self.tr('Select all local file entries'),
728 self.browser.selectLocalEntries) 728 self.browser.selectLocalEntries)
729 menu.addAction(self.trUtf8('Select all versioned file entries'), 729 menu.addAction(self.tr('Select all versioned file entries'),
730 self.browser.selectVCSEntries) 730 self.browser.selectVCSEntries)
731 menu.addAction(self.trUtf8('Select all local directory entries'), 731 menu.addAction(self.tr('Select all local directory entries'),
732 self.browser.selectLocalDirEntries) 732 self.browser.selectLocalDirEntries)
733 menu.addAction(self.trUtf8('Select all versioned directory entries'), 733 menu.addAction(self.tr('Select all versioned directory entries'),
734 self.browser.selectVCSDirEntries) 734 self.browser.selectVCSDirEntries)
735 menu.addSeparator() 735 menu.addSeparator()
736 menu.addAction(self.trUtf8("Configure..."), self.__SVNConfigure) 736 menu.addAction(self.tr("Configure..."), self.__SVNConfigure)
737 737
738 mainMenu.addSeparator() 738 mainMenu.addSeparator()
739 mainMenu.addMenu(menu) 739 mainMenu.addMenu(menu)
740 self.menuDirMulti = menu 740 self.menuDirMulti = menu
741 741
871 """ 871 """
872 itm = self.browser.currentItem() 872 itm = self.browser.currentItem()
873 fn = itm.fileName() 873 fn = itm.fileName()
874 self.vcs.svnSbsDiff(fn, extended=True) 874 self.vcs.svnSbsDiff(fn, extended=True)
875 875
876 def __SVNLogBrowser(self):
877 """
878 Private slot called by the context menu to show the log browser for a
879 file.
880 """
881 itm = self.browser.currentItem()
882 try:
883 fn = itm.fileName()
884 isFile = True
885 except AttributeError:
886 fn = itm.dirName()
887 isFile = False
888 self.vcs.svnLogBrowser(fn, isFile=isFile)
889
890 def __SVNBlame(self): 876 def __SVNBlame(self):
891 """ 877 """
892 Private slot called by the context menu to show the blame of a file. 878 Private slot called by the context menu to show the blame of a file.
893 """ 879 """
894 itm = self.browser.currentItem() 880 itm = self.browser.currentItem()

eric ide

mercurial