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

eric ide

mercurial