Plugins/VcsPlugins/vcsMercurial/ProjectBrowserHelper.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3305
cf4f22a19dc6
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
180 @param mainMenu reference to the menu to be amended 180 @param mainMenu reference to the menu to be amended
181 """ 181 """
182 self.vcsMenuActions = [] 182 self.vcsMenuActions = []
183 self.vcsAddMenuActions = [] 183 self.vcsAddMenuActions = []
184 184
185 menu = QMenu(self.trUtf8("Version Control")) 185 menu = QMenu(self.tr("Version Control"))
186 186
187 act = menu.addAction( 187 act = menu.addAction(
188 UI.PixmapCache.getIcon( 188 UI.PixmapCache.getIcon(
189 os.path.join("VcsPlugins", "vcsMercurial", "icons", 189 os.path.join("VcsPlugins", "vcsMercurial", "icons",
190 "mercurial.png")), 190 "mercurial.png")),
194 act.setFont(font) 194 act.setFont(font)
195 menu.addSeparator() 195 menu.addSeparator()
196 196
197 act = menu.addAction( 197 act = menu.addAction(
198 UI.PixmapCache.getIcon("vcsCommit.png"), 198 UI.PixmapCache.getIcon("vcsCommit.png"),
199 self.trUtf8('Commit changes to repository...'), 199 self.tr('Commit changes to repository...'),
200 self._VCSCommit) 200 self._VCSCommit)
201 self.vcsMenuActions.append(act) 201 self.vcsMenuActions.append(act)
202 menu.addSeparator() 202 menu.addSeparator()
203 act = menu.addAction( 203 act = menu.addAction(
204 UI.PixmapCache.getIcon("vcsAdd.png"), 204 UI.PixmapCache.getIcon("vcsAdd.png"),
205 self.trUtf8('Add to repository'), 205 self.tr('Add to repository'),
206 self._VCSAdd) 206 self._VCSAdd)
207 self.vcsAddMenuActions.append(act) 207 self.vcsAddMenuActions.append(act)
208 act = menu.addAction( 208 act = menu.addAction(
209 UI.PixmapCache.getIcon("vcsRemove.png"), 209 UI.PixmapCache.getIcon("vcsRemove.png"),
210 self.trUtf8('Remove from repository (and disk)'), 210 self.tr('Remove from repository (and disk)'),
211 self._VCSRemove) 211 self._VCSRemove)
212 self.vcsMenuActions.append(act) 212 self.vcsMenuActions.append(act)
213 act = menu.addAction( 213 act = menu.addAction(
214 UI.PixmapCache.getIcon("vcsRemove.png"), 214 UI.PixmapCache.getIcon("vcsRemove.png"),
215 self.trUtf8('Remove from repository only'), 215 self.tr('Remove from repository only'),
216 self.__HgForget) 216 self.__HgForget)
217 self.vcsMenuActions.append(act) 217 self.vcsMenuActions.append(act)
218 menu.addSeparator() 218 menu.addSeparator()
219 act = menu.addAction(self.trUtf8('Copy'), self.__HgCopy) 219 act = menu.addAction(self.tr('Copy'), self.__HgCopy)
220 self.vcsMenuActions.append(act) 220 self.vcsMenuActions.append(act)
221 act = menu.addAction(self.trUtf8('Move'), self.__HgMove) 221 act = menu.addAction(self.tr('Move'), self.__HgMove)
222 self.vcsMenuActions.append(act) 222 self.vcsMenuActions.append(act)
223 menu.addSeparator() 223 menu.addSeparator()
224 act = menu.addAction( 224 act = menu.addAction(
225 UI.PixmapCache.getIcon("vcsLog.png"), 225 UI.PixmapCache.getIcon("vcsLog.png"),
226 self.trUtf8('Show log'), self._VCSLog) 226 self.tr('Show log'), self._VCSLog)
227 self.vcsMenuActions.append(act) 227 self.vcsMenuActions.append(act)
228 act = menu.addAction( 228 act = menu.addAction(
229 UI.PixmapCache.getIcon("vcsLog.png"), 229 UI.PixmapCache.getIcon("vcsLog.png"),
230 self.trUtf8('Show log browser'), self.__HgLogBrowser) 230 self.tr('Show log browser'), self.__HgLogBrowser)
231 self.vcsMenuActions.append(act) 231 self.vcsMenuActions.append(act)
232 menu.addSeparator() 232 menu.addSeparator()
233 act = menu.addAction( 233 act = menu.addAction(
234 UI.PixmapCache.getIcon("vcsStatus.png"), 234 UI.PixmapCache.getIcon("vcsStatus.png"),
235 self.trUtf8('Show status'), self._VCSStatus) 235 self.tr('Show status'), self._VCSStatus)
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 UI.PixmapCache.getIcon("vcsDiff.png"), 239 UI.PixmapCache.getIcon("vcsDiff.png"),
240 self.trUtf8('Show difference'), self._VCSDiff) 240 self.tr('Show difference'), self._VCSDiff)
241 self.vcsMenuActions.append(act) 241 self.vcsMenuActions.append(act)
242 act = menu.addAction( 242 act = menu.addAction(
243 UI.PixmapCache.getIcon("vcsSbsDiff.png"), 243 UI.PixmapCache.getIcon("vcsSbsDiff.png"),
244 self.trUtf8('Show difference side-by-side'), self.__HgSbsDiff) 244 self.tr('Show difference side-by-side'), self.__HgSbsDiff)
245 self.vcsMenuActions.append(act) 245 self.vcsMenuActions.append(act)
246 act = menu.addAction( 246 act = menu.addAction(
247 UI.PixmapCache.getIcon("vcsDiff.png"), 247 UI.PixmapCache.getIcon("vcsDiff.png"),
248 self.trUtf8('Show difference (extended)'), 248 self.tr('Show difference (extended)'),
249 self.__HgExtendedDiff) 249 self.__HgExtendedDiff)
250 self.vcsMenuActions.append(act) 250 self.vcsMenuActions.append(act)
251 act = menu.addAction( 251 act = menu.addAction(
252 UI.PixmapCache.getIcon("vcsSbsDiff.png"), 252 UI.PixmapCache.getIcon("vcsSbsDiff.png"),
253 self.trUtf8('Show difference side-by-side (extended)'), 253 self.tr('Show difference side-by-side (extended)'),
254 self.__HgSbsExtendedDiff) 254 self.__HgSbsExtendedDiff)
255 self.vcsMenuActions.append(act) 255 self.vcsMenuActions.append(act)
256 self.annotateAct = menu.addAction( 256 self.annotateAct = menu.addAction(
257 self.trUtf8('Show annotated file'), 257 self.tr('Show annotated file'),
258 self.__HgAnnotate) 258 self.__HgAnnotate)
259 self.vcsMenuActions.append(self.annotateAct) 259 self.vcsMenuActions.append(self.annotateAct)
260 menu.addSeparator() 260 menu.addSeparator()
261 act = menu.addAction( 261 act = menu.addAction(
262 UI.PixmapCache.getIcon("vcsRevert.png"), 262 UI.PixmapCache.getIcon("vcsRevert.png"),
263 self.trUtf8('Revert changes'), self.__HgRevert) 263 self.tr('Revert changes'), self.__HgRevert)
264 self.vcsMenuActions.append(act) 264 self.vcsMenuActions.append(act)
265 act = menu.addAction( 265 act = menu.addAction(
266 self.trUtf8('Conflict resolved'), self.__HgResolve) 266 self.tr('Conflict resolved'), self.__HgResolve)
267 self.vcsMenuActions.append(act) 267 self.vcsMenuActions.append(act)
268 menu.addSeparator() 268 menu.addSeparator()
269 menu.addAction(self.trUtf8('Select all local file entries'), 269 menu.addAction(self.tr('Select all local file entries'),
270 self.browser.selectLocalEntries) 270 self.browser.selectLocalEntries)
271 menu.addAction(self.trUtf8('Select all versioned file entries'), 271 menu.addAction(self.tr('Select all versioned file entries'),
272 self.browser.selectVCSEntries) 272 self.browser.selectVCSEntries)
273 menu.addAction(self.trUtf8('Select all local directory entries'), 273 menu.addAction(self.tr('Select all local directory entries'),
274 self.browser.selectLocalDirEntries) 274 self.browser.selectLocalDirEntries)
275 menu.addAction(self.trUtf8('Select all versioned directory entries'), 275 menu.addAction(self.tr('Select all versioned directory entries'),
276 self.browser.selectVCSDirEntries) 276 self.browser.selectVCSDirEntries)
277 menu.addSeparator() 277 menu.addSeparator()
278 278
279 mainMenu.addSeparator() 279 mainMenu.addSeparator()
280 mainMenu.addMenu(menu) 280 mainMenu.addMenu(menu)
288 @param mainMenu reference to the menu to be amended 288 @param mainMenu reference to the menu to be amended
289 """ 289 """
290 self.vcsMultiMenuActions = [] 290 self.vcsMultiMenuActions = []
291 self.vcsAddMultiMenuActions = [] 291 self.vcsAddMultiMenuActions = []
292 292
293 menu = QMenu(self.trUtf8("Version Control")) 293 menu = QMenu(self.tr("Version Control"))
294 294
295 act = menu.addAction( 295 act = menu.addAction(
296 UI.PixmapCache.getIcon( 296 UI.PixmapCache.getIcon(
297 os.path.join("VcsPlugins", "vcsMercurial", "icons", 297 os.path.join("VcsPlugins", "vcsMercurial", "icons",
298 "mercurial.png")), 298 "mercurial.png")),
302 act.setFont(font) 302 act.setFont(font)
303 menu.addSeparator() 303 menu.addSeparator()
304 304
305 act = menu.addAction( 305 act = menu.addAction(
306 UI.PixmapCache.getIcon("vcsCommit.png"), 306 UI.PixmapCache.getIcon("vcsCommit.png"),
307 self.trUtf8('Commit changes to repository...'), 307 self.tr('Commit changes to repository...'),
308 self._VCSCommit) 308 self._VCSCommit)
309 self.vcsMultiMenuActions.append(act) 309 self.vcsMultiMenuActions.append(act)
310 menu.addSeparator() 310 menu.addSeparator()
311 act = menu.addAction( 311 act = menu.addAction(
312 UI.PixmapCache.getIcon("vcsAdd.png"), 312 UI.PixmapCache.getIcon("vcsAdd.png"),
313 self.trUtf8('Add to repository'), self._VCSAdd) 313 self.tr('Add to repository'), self._VCSAdd)
314 self.vcsAddMultiMenuActions.append(act) 314 self.vcsAddMultiMenuActions.append(act)
315 act = menu.addAction( 315 act = menu.addAction(
316 UI.PixmapCache.getIcon("vcsRemove.png"), 316 UI.PixmapCache.getIcon("vcsRemove.png"),
317 self.trUtf8('Remove from repository (and disk)'), 317 self.tr('Remove from repository (and disk)'),
318 self._VCSRemove) 318 self._VCSRemove)
319 self.vcsMultiMenuActions.append(act) 319 self.vcsMultiMenuActions.append(act)
320 act = menu.addAction( 320 act = menu.addAction(
321 UI.PixmapCache.getIcon("vcsRemove.png"), 321 UI.PixmapCache.getIcon("vcsRemove.png"),
322 self.trUtf8('Remove from repository only'), 322 self.tr('Remove from repository only'),
323 self.__HgForget) 323 self.__HgForget)
324 self.vcsMultiMenuActions.append(act) 324 self.vcsMultiMenuActions.append(act)
325 menu.addSeparator() 325 menu.addSeparator()
326 act = menu.addAction( 326 act = menu.addAction(
327 UI.PixmapCache.getIcon("vcsStatus.png"), 327 UI.PixmapCache.getIcon("vcsStatus.png"),
328 self.trUtf8('Show status'), self._VCSStatus) 328 self.tr('Show status'), self._VCSStatus)
329 self.vcsMultiMenuActions.append(act) 329 self.vcsMultiMenuActions.append(act)
330 menu.addSeparator() 330 menu.addSeparator()
331 act = menu.addAction( 331 act = menu.addAction(
332 UI.PixmapCache.getIcon("vcsDiff.png"), 332 UI.PixmapCache.getIcon("vcsDiff.png"),
333 self.trUtf8('Show difference'), self._VCSDiff) 333 self.tr('Show difference'), self._VCSDiff)
334 self.vcsMultiMenuActions.append(act) 334 self.vcsMultiMenuActions.append(act)
335 act = menu.addAction( 335 act = menu.addAction(
336 UI.PixmapCache.getIcon("vcsDiff.png"), 336 UI.PixmapCache.getIcon("vcsDiff.png"),
337 self.trUtf8('Show difference (extended)'), 337 self.tr('Show difference (extended)'),
338 self.__HgExtendedDiff) 338 self.__HgExtendedDiff)
339 self.vcsMultiMenuActions.append(act) 339 self.vcsMultiMenuActions.append(act)
340 menu.addSeparator() 340 menu.addSeparator()
341 act = menu.addAction( 341 act = menu.addAction(
342 UI.PixmapCache.getIcon("vcsRevert.png"), 342 UI.PixmapCache.getIcon("vcsRevert.png"),
343 self.trUtf8('Revert changes'), self.__HgRevert) 343 self.tr('Revert changes'), self.__HgRevert)
344 self.vcsMultiMenuActions.append(act) 344 self.vcsMultiMenuActions.append(act)
345 act = menu.addAction( 345 act = menu.addAction(
346 self.trUtf8('Conflict resolved'), self.__HgResolve) 346 self.tr('Conflict resolved'), self.__HgResolve)
347 self.vcsMultiMenuActions.append(act) 347 self.vcsMultiMenuActions.append(act)
348 menu.addSeparator() 348 menu.addSeparator()
349 menu.addAction(self.trUtf8('Select all local file entries'), 349 menu.addAction(self.tr('Select all local file entries'),
350 self.browser.selectLocalEntries) 350 self.browser.selectLocalEntries)
351 menu.addAction(self.trUtf8('Select all versioned file entries'), 351 menu.addAction(self.tr('Select all versioned file entries'),
352 self.browser.selectVCSEntries) 352 self.browser.selectVCSEntries)
353 menu.addAction(self.trUtf8('Select all local directory entries'), 353 menu.addAction(self.tr('Select all local directory entries'),
354 self.browser.selectLocalDirEntries) 354 self.browser.selectLocalDirEntries)
355 menu.addAction(self.trUtf8('Select all versioned directory entries'), 355 menu.addAction(self.tr('Select all versioned directory entries'),
356 self.browser.selectVCSDirEntries) 356 self.browser.selectVCSDirEntries)
357 menu.addSeparator() 357 menu.addSeparator()
358 358
359 mainMenu.addSeparator() 359 mainMenu.addSeparator()
360 mainMenu.addMenu(menu) 360 mainMenu.addMenu(menu)
364 """ 364 """
365 Protected method used to add the VCS menu to all project browsers. 365 Protected method used to add the VCS menu to all project browsers.
366 366
367 @param mainMenu reference to the menu to be amended 367 @param mainMenu reference to the menu to be amended
368 """ 368 """
369 menu = QMenu(self.trUtf8("Version Control")) 369 menu = QMenu(self.tr("Version Control"))
370 370
371 act = menu.addAction( 371 act = menu.addAction(
372 UI.PixmapCache.getIcon( 372 UI.PixmapCache.getIcon(
373 os.path.join("VcsPlugins", "vcsMercurial", "icons", 373 os.path.join("VcsPlugins", "vcsMercurial", "icons",
374 "mercurial.png")), 374 "mercurial.png")),
376 font = act.font() 376 font = act.font()
377 font.setBold(True) 377 font.setBold(True)
378 act.setFont(font) 378 act.setFont(font)
379 menu.addSeparator() 379 menu.addSeparator()
380 380
381 menu.addAction(self.trUtf8('Select all local file entries'), 381 menu.addAction(self.tr('Select all local file entries'),
382 self.browser.selectLocalEntries) 382 self.browser.selectLocalEntries)
383 menu.addAction(self.trUtf8('Select all versioned file entries'), 383 menu.addAction(self.tr('Select all versioned file entries'),
384 self.browser.selectVCSEntries) 384 self.browser.selectVCSEntries)
385 menu.addAction(self.trUtf8('Select all local directory entries'), 385 menu.addAction(self.tr('Select all local directory entries'),
386 self.browser.selectLocalDirEntries) 386 self.browser.selectLocalDirEntries)
387 menu.addAction(self.trUtf8('Select all versioned directory entries'), 387 menu.addAction(self.tr('Select all versioned directory entries'),
388 self.browser.selectVCSDirEntries) 388 self.browser.selectVCSDirEntries)
389 menu.addSeparator() 389 menu.addSeparator()
390 390
391 mainMenu.addSeparator() 391 mainMenu.addSeparator()
392 mainMenu.addMenu(menu) 392 mainMenu.addMenu(menu)
402 return 402 return
403 403
404 self.vcsDirMenuActions = [] 404 self.vcsDirMenuActions = []
405 self.vcsAddDirMenuActions = [] 405 self.vcsAddDirMenuActions = []
406 406
407 menu = QMenu(self.trUtf8("Version Control")) 407 menu = QMenu(self.tr("Version Control"))
408 408
409 act = menu.addAction( 409 act = menu.addAction(
410 UI.PixmapCache.getIcon( 410 UI.PixmapCache.getIcon(
411 os.path.join("VcsPlugins", "vcsMercurial", "icons", 411 os.path.join("VcsPlugins", "vcsMercurial", "icons",
412 "mercurial.png")), 412 "mercurial.png")),
416 act.setFont(font) 416 act.setFont(font)
417 menu.addSeparator() 417 menu.addSeparator()
418 418
419 act = menu.addAction( 419 act = menu.addAction(
420 UI.PixmapCache.getIcon("vcsCommit.png"), 420 UI.PixmapCache.getIcon("vcsCommit.png"),
421 self.trUtf8('Commit changes to repository...'), 421 self.tr('Commit changes to repository...'),
422 self._VCSCommit) 422 self._VCSCommit)
423 self.vcsDirMenuActions.append(act) 423 self.vcsDirMenuActions.append(act)
424 menu.addSeparator() 424 menu.addSeparator()
425 act = menu.addAction( 425 act = menu.addAction(
426 UI.PixmapCache.getIcon("vcsAdd.png"), 426 UI.PixmapCache.getIcon("vcsAdd.png"),
427 self.trUtf8('Add to repository'), self._VCSAdd) 427 self.tr('Add to repository'), self._VCSAdd)
428 self.vcsAddDirMenuActions.append(act) 428 self.vcsAddDirMenuActions.append(act)
429 act = menu.addAction( 429 act = menu.addAction(
430 UI.PixmapCache.getIcon("vcsRemove.png"), 430 UI.PixmapCache.getIcon("vcsRemove.png"),
431 self.trUtf8('Remove from repository (and disk)'), 431 self.tr('Remove from repository (and disk)'),
432 self._VCSRemove) 432 self._VCSRemove)
433 self.vcsDirMenuActions.append(act) 433 self.vcsDirMenuActions.append(act)
434 menu.addSeparator() 434 menu.addSeparator()
435 act = menu.addAction(self.trUtf8('Copy'), self.__HgCopy) 435 act = menu.addAction(self.tr('Copy'), self.__HgCopy)
436 self.vcsDirMenuActions.append(act) 436 self.vcsDirMenuActions.append(act)
437 act = menu.addAction(self.trUtf8('Move'), self.__HgMove) 437 act = menu.addAction(self.tr('Move'), self.__HgMove)
438 self.vcsDirMenuActions.append(act) 438 self.vcsDirMenuActions.append(act)
439 menu.addSeparator() 439 menu.addSeparator()
440 act = menu.addAction( 440 act = menu.addAction(
441 UI.PixmapCache.getIcon("vcsLog.png"), 441 UI.PixmapCache.getIcon("vcsLog.png"),
442 self.trUtf8('Show log'), self._VCSLog) 442 self.tr('Show log'), self._VCSLog)
443 self.vcsDirMenuActions.append(act) 443 self.vcsDirMenuActions.append(act)
444 act = menu.addAction( 444 act = menu.addAction(
445 UI.PixmapCache.getIcon("vcsLog.png"), 445 UI.PixmapCache.getIcon("vcsLog.png"),
446 self.trUtf8('Show log browser'), self.__HgLogBrowser) 446 self.tr('Show log browser'), self.__HgLogBrowser)
447 self.vcsDirMenuActions.append(act) 447 self.vcsDirMenuActions.append(act)
448 menu.addSeparator() 448 menu.addSeparator()
449 act = menu.addAction( 449 act = menu.addAction(
450 UI.PixmapCache.getIcon("vcsStatus.png"), 450 UI.PixmapCache.getIcon("vcsStatus.png"),
451 self.trUtf8('Show status'), self._VCSStatus) 451 self.tr('Show status'), self._VCSStatus)
452 self.vcsDirMenuActions.append(act) 452 self.vcsDirMenuActions.append(act)
453 menu.addSeparator() 453 menu.addSeparator()
454 act = menu.addAction( 454 act = menu.addAction(
455 UI.PixmapCache.getIcon("vcsDiff.png"), 455 UI.PixmapCache.getIcon("vcsDiff.png"),
456 self.trUtf8('Show difference'), self._VCSDiff) 456 self.tr('Show difference'), self._VCSDiff)
457 self.vcsDirMenuActions.append(act) 457 self.vcsDirMenuActions.append(act)
458 act = menu.addAction( 458 act = menu.addAction(
459 UI.PixmapCache.getIcon("vcsDiff.png"), 459 UI.PixmapCache.getIcon("vcsDiff.png"),
460 self.trUtf8('Show difference (extended)'), 460 self.tr('Show difference (extended)'),
461 self.__HgExtendedDiff) 461 self.__HgExtendedDiff)
462 self.vcsDirMenuActions.append(act) 462 self.vcsDirMenuActions.append(act)
463 menu.addSeparator() 463 menu.addSeparator()
464 act = menu.addAction( 464 act = menu.addAction(
465 UI.PixmapCache.getIcon("vcsRevert.png"), 465 UI.PixmapCache.getIcon("vcsRevert.png"),
466 self.trUtf8('Revert changes'), self.__HgRevert) 466 self.tr('Revert changes'), self.__HgRevert)
467 self.vcsDirMenuActions.append(act) 467 self.vcsDirMenuActions.append(act)
468 act = menu.addAction( 468 act = menu.addAction(
469 self.trUtf8('Conflict resolved'), self.__HgResolve) 469 self.tr('Conflict resolved'), self.__HgResolve)
470 self.vcsDirMenuActions.append(act) 470 self.vcsDirMenuActions.append(act)
471 menu.addSeparator() 471 menu.addSeparator()
472 menu.addAction(self.trUtf8('Select all local file entries'), 472 menu.addAction(self.tr('Select all local file entries'),
473 self.browser.selectLocalEntries) 473 self.browser.selectLocalEntries)
474 menu.addAction(self.trUtf8('Select all versioned file entries'), 474 menu.addAction(self.tr('Select all versioned file entries'),
475 self.browser.selectVCSEntries) 475 self.browser.selectVCSEntries)
476 menu.addAction(self.trUtf8('Select all local directory entries'), 476 menu.addAction(self.tr('Select all local directory entries'),
477 self.browser.selectLocalDirEntries) 477 self.browser.selectLocalDirEntries)
478 menu.addAction(self.trUtf8('Select all versioned directory entries'), 478 menu.addAction(self.tr('Select all versioned directory entries'),
479 self.browser.selectVCSDirEntries) 479 self.browser.selectVCSDirEntries)
480 menu.addSeparator() 480 menu.addSeparator()
481 481
482 mainMenu.addSeparator() 482 mainMenu.addSeparator()
483 mainMenu.addMenu(menu) 483 mainMenu.addMenu(menu)
493 return 493 return
494 494
495 self.vcsDirMultiMenuActions = [] 495 self.vcsDirMultiMenuActions = []
496 self.vcsAddDirMultiMenuActions = [] 496 self.vcsAddDirMultiMenuActions = []
497 497
498 menu = QMenu(self.trUtf8("Version Control")) 498 menu = QMenu(self.tr("Version Control"))
499 499
500 act = menu.addAction( 500 act = menu.addAction(
501 UI.PixmapCache.getIcon( 501 UI.PixmapCache.getIcon(
502 os.path.join("VcsPlugins", "vcsMercurial", "icons", 502 os.path.join("VcsPlugins", "vcsMercurial", "icons",
503 "mercurial.png")), 503 "mercurial.png")),
507 act.setFont(font) 507 act.setFont(font)
508 menu.addSeparator() 508 menu.addSeparator()
509 509
510 act = menu.addAction( 510 act = menu.addAction(
511 UI.PixmapCache.getIcon("vcsCommit.png"), 511 UI.PixmapCache.getIcon("vcsCommit.png"),
512 self.trUtf8('Commit changes to repository...'), 512 self.tr('Commit changes to repository...'),
513 self._VCSCommit) 513 self._VCSCommit)
514 self.vcsDirMultiMenuActions.append(act) 514 self.vcsDirMultiMenuActions.append(act)
515 menu.addSeparator() 515 menu.addSeparator()
516 act = menu.addAction( 516 act = menu.addAction(
517 UI.PixmapCache.getIcon("vcsAdd.png"), 517 UI.PixmapCache.getIcon("vcsAdd.png"),
518 self.trUtf8('Add to repository'), self._VCSAdd) 518 self.tr('Add to repository'), self._VCSAdd)
519 self.vcsAddDirMultiMenuActions.append(act) 519 self.vcsAddDirMultiMenuActions.append(act)
520 act = menu.addAction( 520 act = menu.addAction(
521 UI.PixmapCache.getIcon("vcsRemove.png"), 521 UI.PixmapCache.getIcon("vcsRemove.png"),
522 self.trUtf8('Remove from repository (and disk)'), 522 self.tr('Remove from repository (and disk)'),
523 self._VCSRemove) 523 self._VCSRemove)
524 self.vcsDirMultiMenuActions.append(act) 524 self.vcsDirMultiMenuActions.append(act)
525 menu.addSeparator() 525 menu.addSeparator()
526 act = menu.addAction( 526 act = menu.addAction(
527 UI.PixmapCache.getIcon("vcsStatus.png"), 527 UI.PixmapCache.getIcon("vcsStatus.png"),
528 self.trUtf8('Show status'), self._VCSStatus) 528 self.tr('Show status'), self._VCSStatus)
529 self.vcsDirMultiMenuActions.append(act) 529 self.vcsDirMultiMenuActions.append(act)
530 menu.addSeparator() 530 menu.addSeparator()
531 act = menu.addAction( 531 act = menu.addAction(
532 UI.PixmapCache.getIcon("vcsDiff.png"), 532 UI.PixmapCache.getIcon("vcsDiff.png"),
533 self.trUtf8('Show difference'), self._VCSDiff) 533 self.tr('Show difference'), self._VCSDiff)
534 self.vcsDirMultiMenuActions.append(act) 534 self.vcsDirMultiMenuActions.append(act)
535 act = menu.addAction( 535 act = menu.addAction(
536 UI.PixmapCache.getIcon("vcsDiff.png"), 536 UI.PixmapCache.getIcon("vcsDiff.png"),
537 self.trUtf8('Show difference (extended)'), 537 self.tr('Show difference (extended)'),
538 self.__HgExtendedDiff) 538 self.__HgExtendedDiff)
539 self.vcsDirMultiMenuActions.append(act) 539 self.vcsDirMultiMenuActions.append(act)
540 menu.addSeparator() 540 menu.addSeparator()
541 act = menu.addAction( 541 act = menu.addAction(
542 UI.PixmapCache.getIcon("vcsRevert.png"), 542 UI.PixmapCache.getIcon("vcsRevert.png"),
543 self.trUtf8('Revert changes'), self.__HgRevert) 543 self.tr('Revert changes'), self.__HgRevert)
544 self.vcsDirMultiMenuActions.append(act) 544 self.vcsDirMultiMenuActions.append(act)
545 act = menu.addAction( 545 act = menu.addAction(
546 self.trUtf8('Conflict resolved'), self.__HgResolve) 546 self.tr('Conflict resolved'), self.__HgResolve)
547 self.vcsDirMultiMenuActions.append(act) 547 self.vcsDirMultiMenuActions.append(act)
548 menu.addSeparator() 548 menu.addSeparator()
549 menu.addAction(self.trUtf8('Select all local file entries'), 549 menu.addAction(self.tr('Select all local file entries'),
550 self.browser.selectLocalEntries) 550 self.browser.selectLocalEntries)
551 menu.addAction(self.trUtf8('Select all versioned file entries'), 551 menu.addAction(self.tr('Select all versioned file entries'),
552 self.browser.selectVCSEntries) 552 self.browser.selectVCSEntries)
553 menu.addAction(self.trUtf8('Select all local directory entries'), 553 menu.addAction(self.tr('Select all local directory entries'),
554 self.browser.selectLocalDirEntries) 554 self.browser.selectLocalDirEntries)
555 menu.addAction(self.trUtf8('Select all versioned directory entries'), 555 menu.addAction(self.tr('Select all versioned directory entries'),
556 self.browser.selectVCSDirEntries) 556 self.browser.selectVCSDirEntries)
557 menu.addSeparator() 557 menu.addSeparator()
558 558
559 mainMenu.addSeparator() 559 mainMenu.addSeparator()
560 mainMenu.addMenu(menu) 560 mainMenu.addMenu(menu)
687 items = self.browser.getSelectedItems([ProjectBrowserFileItem]) 687 items = self.browser.getSelectedItems([ProjectBrowserFileItem])
688 names = [itm.fileName() for itm in items] 688 names = [itm.fileName() for itm in items]
689 689
690 dlg = DeleteFilesConfirmationDialog( 690 dlg = DeleteFilesConfirmationDialog(
691 self.parent(), 691 self.parent(),
692 self.trUtf8("Remove from repository only"), 692 self.tr("Remove from repository only"),
693 self.trUtf8( 693 self.tr(
694 "Do you really want to remove these files" 694 "Do you really want to remove these files"
695 " from the repository?"), 695 " from the repository?"),
696 names) 696 names)
697 else: 697 else:
698 items = self.browser.getSelectedItems() 698 items = self.browser.getSelectedItems()
700 files = [self.browser.project.getRelativePath(name) 700 files = [self.browser.project.getRelativePath(name)
701 for name in names] 701 for name in names]
702 702
703 dlg = DeleteFilesConfirmationDialog( 703 dlg = DeleteFilesConfirmationDialog(
704 self.parent(), 704 self.parent(),
705 self.trUtf8("Remove from repository only"), 705 self.tr("Remove from repository only"),
706 self.trUtf8( 706 self.tr(
707 "Do you really want to remove these files" 707 "Do you really want to remove these files"
708 " from the repository?"), 708 " from the repository?"),
709 files) 709 files)
710 710
711 if dlg.exec_() == QDialog.Accepted: 711 if dlg.exec_() == QDialog.Accepted:

eric ide

mercurial