13 |
13 |
14 from PyQt4.QtCore import * |
14 from PyQt4.QtCore import * |
15 from PyQt4.QtGui import * |
15 from PyQt4.QtGui import * |
16 |
16 |
17 from E5Gui.E5Application import e5App |
17 from E5Gui.E5Application import e5App |
|
18 from E5Gui import E5MessageBox |
18 |
19 |
19 from .SvnConst import svnStatusMap |
20 from .SvnConst import svnStatusMap |
20 from .SvnDialogMixin import SvnDialogMixin |
21 from .SvnDialogMixin import SvnDialogMixin |
21 from .Ui_SvnStatusDialog import Ui_SvnStatusDialog |
22 from .Ui_SvnStatusDialog import Ui_SvnStatusDialog |
22 |
23 |
385 Private slot to handle the Commit context menu entry. |
386 Private slot to handle the Commit context menu entry. |
386 """ |
387 """ |
387 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
388 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
388 for itm in self.__getModifiedItems()] |
389 for itm in self.__getModifiedItems()] |
389 if not names: |
390 if not names: |
390 QMessageBox.information(self, |
391 E5MessageBox.information(self, |
391 self.trUtf8("Commit"), |
392 self.trUtf8("Commit"), |
392 self.trUtf8("""There are no uncommitted changes available/selected.""")) |
393 self.trUtf8("""There are no uncommitted changes available/selected.""")) |
393 return |
394 return |
394 |
395 |
395 if Preferences.getVCS("AutoSaveFiles"): |
396 if Preferences.getVCS("AutoSaveFiles"): |
411 Private slot to handle the Add context menu entry. |
412 Private slot to handle the Add context menu entry. |
412 """ |
413 """ |
413 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
414 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
414 for itm in self.__getUnversionedItems()] |
415 for itm in self.__getUnversionedItems()] |
415 if not names: |
416 if not names: |
416 QMessageBox.information(self, |
417 E5MessageBox.information(self, |
417 self.trUtf8("Add"), |
418 self.trUtf8("Add"), |
418 self.trUtf8("""There are no unversioned entries available/selected.""")) |
419 self.trUtf8("""There are no unversioned entries available/selected.""")) |
419 return |
420 return |
420 |
421 |
421 self.vcs.vcsAdd(names) |
422 self.vcs.vcsAdd(names) |
431 Private slot to handle the Revert context menu entry. |
432 Private slot to handle the Revert context menu entry. |
432 """ |
433 """ |
433 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
434 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
434 for itm in self.__getModifiedItems()] |
435 for itm in self.__getModifiedItems()] |
435 if not names: |
436 if not names: |
436 QMessageBox.information(self, |
437 E5MessageBox.information(self, |
437 self.trUtf8("Revert"), |
438 self.trUtf8("Revert"), |
438 self.trUtf8("""There are no uncommitted changes available/selected.""")) |
439 self.trUtf8("""There are no uncommitted changes available/selected.""")) |
439 return |
440 return |
440 |
441 |
441 self.vcs.vcsRevert(names) |
442 self.vcs.vcsRevert(names) |
451 Private slot to handle the Lock context menu entry. |
452 Private slot to handle the Lock context menu entry. |
452 """ |
453 """ |
453 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
454 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
454 for itm in self.__getLockActionItems(self.unlockedIndicators)] |
455 for itm in self.__getLockActionItems(self.unlockedIndicators)] |
455 if not names: |
456 if not names: |
456 QMessageBox.information(self, |
457 E5MessageBox.information(self, |
457 self.trUtf8("Lock"), |
458 self.trUtf8("Lock"), |
458 self.trUtf8("""There are no unlocked files available/selected.""")) |
459 self.trUtf8("""There are no unlocked files available/selected.""")) |
459 return |
460 return |
460 |
461 |
461 self.vcs.svnLock(names, parent = self) |
462 self.vcs.svnLock(names, parent = self) |
466 Private slot to handle the Unlock context menu entry. |
467 Private slot to handle the Unlock context menu entry. |
467 """ |
468 """ |
468 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
469 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
469 for itm in self.__getLockActionItems(self.lockedIndicators)] |
470 for itm in self.__getLockActionItems(self.lockedIndicators)] |
470 if not names: |
471 if not names: |
471 QMessageBox.information(self, |
472 E5MessageBox.information(self, |
472 self.trUtf8("Unlock"), |
473 self.trUtf8("Unlock"), |
473 self.trUtf8("""There are no locked files available/selected.""")) |
474 self.trUtf8("""There are no locked files available/selected.""")) |
474 return |
475 return |
475 |
476 |
476 self.vcs.svnUnlock(names, parent = self) |
477 self.vcs.svnUnlock(names, parent = self) |
481 Private slot to handle the Break Lock context menu entry. |
482 Private slot to handle the Break Lock context menu entry. |
482 """ |
483 """ |
483 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
484 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
484 for itm in self.__getLockActionItems(self.stealBreakLockIndicators)] |
485 for itm in self.__getLockActionItems(self.stealBreakLockIndicators)] |
485 if not names: |
486 if not names: |
486 QMessageBox.information(self, |
487 E5MessageBox.information(self, |
487 self.trUtf8("Break Lock"), |
488 self.trUtf8("Break Lock"), |
488 self.trUtf8("""There are no locked files available/selected.""")) |
489 self.trUtf8("""There are no locked files available/selected.""")) |
489 return |
490 return |
490 |
491 |
491 self.vcs.svnUnlock(names, parent = self, breakIt = True) |
492 self.vcs.svnUnlock(names, parent = self, breakIt = True) |
496 Private slot to handle the Break Lock context menu entry. |
497 Private slot to handle the Break Lock context menu entry. |
497 """ |
498 """ |
498 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
499 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
499 for itm in self.__getLockActionItems(self.stealBreakLockIndicators)] |
500 for itm in self.__getLockActionItems(self.stealBreakLockIndicators)] |
500 if not names: |
501 if not names: |
501 QMessageBox.information(self, |
502 E5MessageBox.information(self, |
502 self.trUtf8("Steal Lock"), |
503 self.trUtf8("Steal Lock"), |
503 self.trUtf8("""There are no locked files available/selected.""")) |
504 self.trUtf8("""There are no locked files available/selected.""")) |
504 return |
505 return |
505 |
506 |
506 self.vcs.svnLock(names, parent=self, stealIt=True) |
507 self.vcs.svnLock(names, parent=self, stealIt=True) |
511 Private slot to add entries to a changelist. |
512 Private slot to add entries to a changelist. |
512 """ |
513 """ |
513 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
514 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
514 for itm in self.__getNonChangelistItems()] |
515 for itm in self.__getNonChangelistItems()] |
515 if not names: |
516 if not names: |
516 QMessageBox.information(self, |
517 E5MessageBox.information(self, |
517 self.trUtf8("Remove from Changelist"), |
518 self.trUtf8("Remove from Changelist"), |
518 self.trUtf8( |
519 self.trUtf8( |
519 """There are no files available/selected not """ |
520 """There are no files available/selected not """ |
520 """belonging to a changelist.""" |
521 """belonging to a changelist.""" |
521 ) |
522 ) |
529 Private slot to remove entries from their changelists. |
530 Private slot to remove entries from their changelists. |
530 """ |
531 """ |
531 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
532 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
532 for itm in self.__getChangelistItems()] |
533 for itm in self.__getChangelistItems()] |
533 if not names: |
534 if not names: |
534 QMessageBox.information(self, |
535 E5MessageBox.information(self, |
535 self.trUtf8("Remove from Changelist"), |
536 self.trUtf8("Remove from Changelist"), |
536 self.trUtf8( |
537 self.trUtf8( |
537 """There are no files available/selected belonging to a changelist.""" |
538 """There are no files available/selected belonging to a changelist.""" |
538 ) |
539 ) |
539 ) |
540 ) |