136 |
136 |
137 def __resort(self): |
137 def __resort(self): |
138 """ |
138 """ |
139 Private method to resort the tree. |
139 Private method to resort the tree. |
140 """ |
140 """ |
141 self.statusList.sortItems(self.statusList.sortColumn(), |
141 self.statusList.sortItems( |
|
142 self.statusList.sortColumn(), |
142 self.statusList.header().sortIndicatorOrder()) |
143 self.statusList.header().sortIndicatorOrder()) |
143 |
144 |
144 def __resizeColumns(self): |
145 def __resizeColumns(self): |
145 """ |
146 """ |
146 Private method to resize the list columns. |
147 Private method to resize the list columns. |
279 self.process.start('hg', args) |
280 self.process.start('hg', args) |
280 procStarted = self.process.waitForStarted(5000) |
281 procStarted = self.process.waitForStarted(5000) |
281 if not procStarted: |
282 if not procStarted: |
282 self.inputGroup.setEnabled(False) |
283 self.inputGroup.setEnabled(False) |
283 self.inputGroup.hide() |
284 self.inputGroup.hide() |
284 E5MessageBox.critical(self, |
285 E5MessageBox.critical( |
|
286 self, |
285 self.trUtf8('Process Generation Error'), |
287 self.trUtf8('Process Generation Error'), |
286 self.trUtf8( |
288 self.trUtf8( |
287 'The process {0} could not be started. ' |
289 'The process {0} could not be started. ' |
288 'Ensure, that it is in the search path.' |
290 'Ensure, that it is in the search path.' |
289 ).format('hg')) |
291 ).format('hg')) |
361 """ |
363 """ |
362 if self.process is not None: |
364 if self.process is not None: |
363 self.process.setReadChannel(QProcess.StandardOutput) |
365 self.process.setReadChannel(QProcess.StandardOutput) |
364 |
366 |
365 while self.process.canReadLine(): |
367 while self.process.canReadLine(): |
366 line = str(self.process.readLine(), |
368 line = str( |
367 Preferences.getSystem("IOEncoding"), |
369 self.process.readLine(), |
368 'replace') |
370 Preferences.getSystem("IOEncoding"), |
|
371 'replace') |
369 self.__processOutputLine(line) |
372 self.__processOutputLine(line) |
370 |
373 |
371 def __processOutputLine(self, line): |
374 def __processOutputLine(self, line): |
372 """ |
375 """ |
373 Private method to process the lines of output. |
376 Private method to process the lines of output. |
593 self.vcs.vcsCommit(self.dname, "", mq=True) |
596 self.vcs.vcsCommit(self.dname, "", mq=True) |
594 else: |
597 else: |
595 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
598 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
596 for itm in self.__getCommitableItems()] |
599 for itm in self.__getCommitableItems()] |
597 if not names: |
600 if not names: |
598 E5MessageBox.information(self, |
601 E5MessageBox.information( |
|
602 self, |
599 self.trUtf8("Commit"), |
603 self.trUtf8("Commit"), |
600 self.trUtf8("""There are no entries selected to be""" |
604 self.trUtf8("""There are no entries selected to be""" |
601 """ committed.""")) |
605 """ committed.""")) |
602 return |
606 return |
603 |
607 |
632 Private slot to handle the Add context menu entry. |
636 Private slot to handle the Add context menu entry. |
633 """ |
637 """ |
634 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
638 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
635 for itm in self.__getUnversionedItems()] |
639 for itm in self.__getUnversionedItems()] |
636 if not names: |
640 if not names: |
637 E5MessageBox.information(self, |
641 E5MessageBox.information( |
|
642 self, |
638 self.trUtf8("Add"), |
643 self.trUtf8("Add"), |
639 self.trUtf8("""There are no unversioned entries""" |
644 self.trUtf8("""There are no unversioned entries""" |
640 """ available/selected.""")) |
645 """ available/selected.""")) |
641 return |
646 return |
642 |
647 |
653 Private slot to handle the Remove context menu entry. |
658 Private slot to handle the Remove context menu entry. |
654 """ |
659 """ |
655 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
660 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
656 for itm in self.__getMissingItems()] |
661 for itm in self.__getMissingItems()] |
657 if not names: |
662 if not names: |
658 E5MessageBox.information(self, |
663 E5MessageBox.information( |
|
664 self, |
659 self.trUtf8("Remove"), |
665 self.trUtf8("Remove"), |
660 self.trUtf8("""There are no missing entries""" |
666 self.trUtf8("""There are no missing entries""" |
661 """ available/selected.""")) |
667 """ available/selected.""")) |
662 return |
668 return |
663 |
669 |
669 Private slot to handle the Revert context menu entry. |
675 Private slot to handle the Revert context menu entry. |
670 """ |
676 """ |
671 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
677 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) \ |
672 for itm in self.__getModifiedItems()] |
678 for itm in self.__getModifiedItems()] |
673 if not names: |
679 if not names: |
674 E5MessageBox.information(self, |
680 E5MessageBox.information( |
|
681 self, |
675 self.trUtf8("Revert"), |
682 self.trUtf8("Revert"), |
676 self.trUtf8("""There are no uncommitted changes""" |
683 self.trUtf8("""There are no uncommitted changes""" |
677 """ available/selected.""")) |
684 """ available/selected.""")) |
678 return |
685 return |
679 |
686 |
692 Private slot to handle the Restore Missing context menu entry. |
699 Private slot to handle the Restore Missing context menu entry. |
693 """ |
700 """ |
694 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
701 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
695 for itm in self.__getMissingItems()] |
702 for itm in self.__getMissingItems()] |
696 if not names: |
703 if not names: |
697 E5MessageBox.information(self, |
704 E5MessageBox.information( |
|
705 self, |
698 self.trUtf8("Revert"), |
706 self.trUtf8("Revert"), |
699 self.trUtf8("""There are no missing entries""" |
707 self.trUtf8("""There are no missing entries""" |
700 """ available/selected.""")) |
708 """ available/selected.""")) |
701 return |
709 return |
702 |
710 |
709 Private slot to handle the Diff context menu entry. |
717 Private slot to handle the Diff context menu entry. |
710 """ |
718 """ |
711 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
719 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
712 for itm in self.__getModifiedItems()] |
720 for itm in self.__getModifiedItems()] |
713 if not names: |
721 if not names: |
714 E5MessageBox.information(self, |
722 E5MessageBox.information( |
|
723 self, |
715 self.trUtf8("Differences"), |
724 self.trUtf8("Differences"), |
716 self.trUtf8("""There are no uncommitted changes""" |
725 self.trUtf8("""There are no uncommitted changes""" |
717 """ available/selected.""")) |
726 """ available/selected.""")) |
718 return |
727 return |
719 |
728 |
728 Private slot to handle the Diff context menu entry. |
737 Private slot to handle the Diff context menu entry. |
729 """ |
738 """ |
730 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
739 names = [os.path.join(self.dname, itm.text(self.__pathColumn)) |
731 for itm in self.__getModifiedItems()] |
740 for itm in self.__getModifiedItems()] |
732 if not names: |
741 if not names: |
733 E5MessageBox.information(self, |
742 E5MessageBox.information( |
|
743 self, |
734 self.trUtf8("Side-by-Side Diff"), |
744 self.trUtf8("Side-by-Side Diff"), |
735 self.trUtf8("""There are no uncommitted changes""" |
745 self.trUtf8("""There are no uncommitted changes""" |
736 """ available/selected.""")) |
746 """ available/selected.""")) |
737 return |
747 return |
738 elif len(names) > 1: |
748 elif len(names) > 1: |
739 E5MessageBox.information(self, |
749 E5MessageBox.information( |
|
750 self, |
740 self.trUtf8("Side-by-Side Diff"), |
751 self.trUtf8("Side-by-Side Diff"), |
741 self.trUtf8("""Only one file with uncommitted changes""" |
752 self.trUtf8("""Only one file with uncommitted changes""" |
742 """ must be selected.""")) |
753 """ must be selected.""")) |
743 return |
754 return |
744 |
755 |