src/eric7/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py

Tue, 06 Dec 2022 17:35:41 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 06 Dec 2022 17:35:41 +0100
branch
eric7
changeset 9576
be9f8e7e42e0
parent 9573
9960d19d66b5
child 9653
e67609152c5e
permissions
-rw-r--r--

Corrected some 'wrong' string quotes caused by the Black line merging.

178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
8881
54e42bc2437a Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8651
diff changeset
3 # Copyright (c) 2010 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
7 Module implementing a dialog to show the output of the hg status command
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
8 process.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import os
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
13 from PyQt6.QtCore import QSize, Qt, pyqtSlot
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
14 from PyQt6.QtGui import QTextCursor
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
15 from PyQt6.QtWidgets import (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
16 QDialogButtonBox,
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
17 QHeaderView,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
18 QMenu,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
19 QTreeWidgetItem,
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
20 QWidget,
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
21 )
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
23 from eric7 import Preferences
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
24 from eric7.EricGui import EricPixmapCache
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
25 from eric7.EricWidgets import EricMessageBox
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
26 from eric7.EricWidgets.EricApplication import ericApp
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
27
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
28 from .HgDiffGenerator import HgDiffGenerator
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
29 from .HgDiffHighlighter import HgDiffHighlighter
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
30 from .Ui_HgStatusDialog import Ui_HgStatusDialog
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 917
diff changeset
32
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 class HgStatusDialog(QWidget, Ui_HgStatusDialog):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
35 Class implementing a dialog to show the output of the hg status command
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
36 process.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
38
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
39 def __init__(self, vcs, mq=False, parent=None):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
42
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @param vcs reference to the vcs object
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
44 @param mq flag indicating to show a queue repo status (boolean)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 @param parent parent widget (QWidget)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8151
diff changeset
47 super().__init__(parent)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.setupUi(self)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
49
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
50 self.__toBeCommittedColumn = 0
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
51 self.__statusColumn = 1
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
52 self.__pathColumn = 2
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.__lastColumn = self.statusList.columnCount()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
54
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
55 self.refreshButton = self.buttonBox.addButton(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
56 self.tr("Refresh"), QDialogButtonBox.ButtonRole.ActionRole
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
57 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
58 self.refreshButton.setToolTip(self.tr("Press to refresh the status display"))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 self.refreshButton.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
60 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
61 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
62
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
63 self.diff = None
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 self.vcs = vcs
495
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
65 self.vcs.committed.connect(self.__committed)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
66 self.__hgClient = self.vcs.getClient()
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
67 self.__mq = mq
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
68
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 self.statusList.headerItem().setText(self.__lastColumn, "")
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
70 self.statusList.header().setSortIndicator(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
71 self.__pathColumn, Qt.SortOrder.AscendingOrder
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
72 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
73
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
74 font = Preferences.getEditorOtherFonts("MonospacedFont")
7779
757334671130 Optimized the various diff panes by using QPlainTextEdit.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
75 self.diffEdit.document().setDefaultFont(font)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
76
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
77 self.diffHighlighter = HgDiffHighlighter(self.diffEdit.document())
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
78 self.__diffGenerator = HgDiffGenerator(vcs, self)
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
79 self.__diffGenerator.finished.connect(self.__generatorFinished)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
80
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
81 self.__selectedName = ""
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
82
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.modifiedIndicators = [
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
84 self.tr("added"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
85 self.tr("modified"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
86 self.tr("removed"),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
88
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 self.unversionedIndicators = [
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
90 self.tr("not tracked"),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
92
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
93 self.missingIndicators = [self.tr("missing")]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
94
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.status = {
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
96 "A": self.tr("added"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
97 "C": self.tr("normal"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
98 "I": self.tr("ignored"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
99 "M": self.tr("modified"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
100 "R": self.tr("removed"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
101 "?": self.tr("not tracked"),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
102 "!": self.tr("missing"),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 }
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
104
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
105 self.__initActionsMenu()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
106
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
107 if mq:
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
108 self.diffLabel.setVisible(False)
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
109 self.diffEdit.setVisible(False)
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
110 self.actionsButton.setEnabled(False)
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
111 self.diffSplitter.setSizes([600, 0])
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
112 else:
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
113 self.diffSplitter.setSizes([300, 300])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
114
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
115 def __initActionsMenu(self):
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
116 """
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
117 Private method to initialize the actions menu.
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
118 """
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
119 self.__actionsMenu = QMenu()
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
120 self.__actionsMenu.setTearOffEnabled(True)
7201
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
121 self.__actionsMenu.setToolTipsVisible(True)
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
122 self.__actionsMenu.aboutToShow.connect(self.__showActionsMenu)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
123
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
124 self.__commitAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
125 self.tr("Commit"), self.__commit
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
126 )
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
127 self.__commitAct.setToolTip(self.tr("Commit the selected changes"))
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
128 self.__commitSelectAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
129 self.tr("Select all for commit"), self.__commitSelectAll
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
130 )
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
131 self.__commitDeselectAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
132 self.tr("Unselect all from commit"), self.__commitDeselectAll
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
133 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
134
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
135 self.__actionsMenu.addSeparator()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
136
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
137 self.__addAct = self.__actionsMenu.addAction(self.tr("Add"), self.__add)
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
138 self.__addAct.setToolTip(self.tr("Add the selected files"))
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
139 self.__lfAddLargeAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
140 self.tr("Add as Large Files"), lambda: self.__lfAdd("large")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
141 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
142 self.__lfAddLargeAct.setToolTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
143 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
144 "Add the selected files as a large files using the 'Large Files'"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
145 " extension"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
146 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
147 )
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
148 self.__lfAddNormalAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
149 self.tr("Add as Normal Files"), lambda: self.__lfAdd("normal")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
150 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
151 self.__lfAddNormalAct.setToolTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
152 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
153 "Add the selected files as a normal files using the 'Large Files'"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
154 " extension"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
155 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
156 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
157
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
158 self.__actionsMenu.addSeparator()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
159
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
160 self.__diffAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
161 self.tr("Differences"), self.__diff
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
162 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
163 self.__diffAct.setToolTip(
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
164 self.tr("Shows the differences of the selected entry in a separate dialog")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
165 )
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
166 self.__sbsDiffAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
167 self.tr("Differences Side-By-Side"), self.__sbsDiff
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
168 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
169 self.__sbsDiffAct.setToolTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
170 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
171 "Shows the differences of the selected entry side-by-side in"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
172 " a separate dialog"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
173 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
174 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
175
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
176 self.__actionsMenu.addSeparator()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
177
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
178 self.__revertAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
179 self.tr("Revert"), self.__revert
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
180 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
181 self.__revertAct.setToolTip(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
182 self.tr("Reverts the changes of the selected files")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
183 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
184
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
185 self.__actionsMenu.addSeparator()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
186
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
187 self.__forgetAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
188 self.tr("Forget Missing"), self.__forget
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
189 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
190 self.__forgetAct.setToolTip(self.tr("Forgets about the selected missing files"))
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
191 self.__restoreAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
192 self.tr("Restore Missing"), self.__restoreMissing
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
193 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
194 self.__restoreAct.setToolTip(self.tr("Restores the selected missing files"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
195
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
196 self.__actionsMenu.addSeparator()
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
197
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
198 self.__commitMergeAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
199 self.tr("Commit Merge"), self.__commitMerge
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
200 )
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
201 self.__commitMergeAct.setToolTip(self.tr("Commit all the merged changes."))
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
202 self.__abortMergeAct = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
203 self.tr("Abort Merge"), self.__abortMerge
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
204 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
205 self.__commitMergeAct.setToolTip(
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
206 self.tr("Abort an uncommitted merge and lose all changes")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
207 )
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
208
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
209 self.__actionsMenu.addSeparator()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
210
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
211 act = self.__actionsMenu.addAction(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
212 self.tr("Adjust column sizes"), self.__resizeColumns
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
213 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
214 act.setToolTip(self.tr("Adjusts the width of all columns to their contents"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
215
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
216 self.actionsButton.setIcon(EricPixmapCache.getIcon("actionsToolButton"))
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
217 self.actionsButton.setMenu(self.__actionsMenu)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
218
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
219 def closeEvent(self, e):
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
220 """
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
221 Protected slot implementing a close event handler.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
222
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
223 @param e close event (QCloseEvent)
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
224 """
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
225 if self.__hgClient.isExecuting():
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
226 self.__hgClient.cancel()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
227
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
228 if self.__mq:
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
229 self.vcs.getPlugin().setPreferences(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
230 "MqStatusDialogGeometry", self.saveGeometry()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
231 )
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
232 self.vcs.getPlugin().setPreferences(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
233 "MqStatusDialogSplitterState", self.diffSplitter.saveState()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
234 )
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
235 else:
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
236 self.vcs.getPlugin().setPreferences(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
237 "StatusDialogGeometry", self.saveGeometry()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
238 )
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
239 self.vcs.getPlugin().setPreferences(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
240 "StatusDialogSplitterState", self.diffSplitter.saveState()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
241 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
242
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
243 e.accept()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
244
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
245 def show(self):
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
246 """
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
247 Public slot to show the dialog.
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
248 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8151
diff changeset
249 super().show()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
250
8259
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
251 geom = (
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
252 self.vcs.getPlugin().getPreferences("MqStatusDialogGeometry")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
253 if self.__mq
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
254 else self.vcs.getPlugin().getPreferences("StatusDialogGeometry")
8259
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
255 )
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
256 if geom.isEmpty():
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
257 s = QSize(800, 600)
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
258 self.resize(s)
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
259 else:
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
260 self.restoreGeometry(geom)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
261
8259
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
262 diffSplitterState = (
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
263 self.vcs.getPlugin().getPreferences("MqStatusDialogSplitterState")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
264 if self.__mq
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
265 else self.vcs.getPlugin().getPreferences("StatusDialogSplitterState")
8259
2bbec88047dd Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
266 )
5520
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
267 if diffSplitterState is not None:
2a97a4d58bc6 Added code to the Mercurial status dialog to remember the window geometry and the splitter state.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5507
diff changeset
268 self.diffSplitter.restoreState(diffSplitterState)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
269
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 def __resort(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 Private method to resort the tree.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 """
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
274 self.statusList.sortItems(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
275 self.statusList.sortColumn(), self.statusList.header().sortIndicatorOrder()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
276 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
277
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 def __resizeColumns(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 Private method to resize the list columns.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
282 self.statusList.header().resizeSections(QHeaderView.ResizeMode.ResizeToContents)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.statusList.header().setStretchLastSection(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
284
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 def __generateItem(self, status, path):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 Private method to generate a status item in the status list.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
288
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 @param status status indicator (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 @param path path of the file or directory (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 """
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
292 statusText = self.status[status]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
293 itm = QTreeWidgetItem(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
294 self.statusList,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
295 [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
296 "",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
297 statusText,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
298 path,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
299 ],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
300 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
301
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7979
diff changeset
302 itm.setTextAlignment(1, Qt.AlignmentFlag.AlignHCenter)
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7979
diff changeset
303 itm.setTextAlignment(2, Qt.AlignmentFlag.AlignLeft)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
304
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
305 if status in "AMR":
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7979
diff changeset
306 itm.setFlags(itm.flags() | Qt.ItemFlag.ItemIsUserCheckable)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
307 itm.setCheckState(self.__toBeCommittedColumn, Qt.CheckState.Checked)
1294
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
308 else:
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7979
diff changeset
309 itm.setFlags(itm.flags() & ~Qt.ItemFlag.ItemIsUserCheckable)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
310
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
311 if statusText not in self.__statusFilters:
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
312 self.__statusFilters.append(statusText)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
313
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 def start(self, fn):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 """
198
7ab8e126f404 Fixed a few issues with the Mercurial plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
316 Public slot to start the hg status command.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
317
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 @param fn filename(s)/directoryname(s) to show the status of
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 (string or list of strings)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 self.errorGroup.hide()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 self.intercept = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 self.args = fn
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
324
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
325 self.actionsButton.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
326
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
327 self.statusFilterCombo.clear()
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
328 self.__statusFilters = []
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4072
diff changeset
329 self.statusList.clear()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
330
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
331 if self.__mq:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
332 self.setWindowTitle(self.tr("Mercurial Queue Repository Status"))
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
333 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
334 self.setWindowTitle(self.tr("Mercurial Status"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
335
3302
e92f0dd51979 Removed the Mercurial support for a command options dialog and added useable global options to the Mercurial config page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
336 args = self.vcs.initCommand("status")
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
337 if self.__mq:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
338 args.append("--mq")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 else:
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
340 if self.vcs.hasSubrepositories():
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
341 args.append("--subrepos")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
342
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
343 if isinstance(fn, list):
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
344 self.vcs.addArguments(args, fn)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
345 else:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
346 args.append(fn)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
347
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
348 self.refreshButton.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
349
7979
54b73174ab61 Mercurial: fixed a few issues introduced during the recent code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
350 self.__repoPath = self.__hgClient.getRepository()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
351
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
352 out, err = self.__hgClient.runcommand(args)
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
353 if err:
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
354 self.__showError(err)
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
355 if out:
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
356 for line in out.splitlines():
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
357 self.__processOutputLine(line)
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
358 if self.__hgClient.wasCanceled():
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
359 break
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
360 self.__finish()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
361
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 def __finish(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
364 Private slot called when the process finished or the user pressed
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
365 the button.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 """
221
38689444e922 Corrected the button handling of some Mercurial dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
367 self.refreshButton.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
368
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
369 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(True)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
370 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
371 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setDefault(True)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
372 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setFocus(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
373 Qt.FocusReason.OtherFocusReason
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
374 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
375
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
376 self.__statusFilters.sort()
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
377 self.__statusFilters.insert(0, "<{0}>".format(self.tr("all")))
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
378 self.statusFilterCombo.addItems(self.__statusFilters)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
379
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
380 if not self.__mq:
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
381 self.actionsButton.setEnabled(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
382
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 self.__resort()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 self.__resizeColumns()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
385
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
386 self.__refreshDiff()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
387
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 def on_buttonBox_clicked(self, button):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 Private slot called by a button of the button box clicked.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
391
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 @param button button that was clicked (QAbstractButton)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
394 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 self.close()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
396 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
7370
5fb53279f2df Mercurial: removed some old code dealing with using the hg commandline executable instead of the command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
397 self.__hgClient.cancel()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 elif button == self.refreshButton:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 self.on_refreshButton_clicked()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
400
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
401 def __processOutputLine(self, line):
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
402 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
403 Private method to process the lines of output.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
404
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
405 @param line output line to be processed (string)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
406 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
407 if line[0] in "ACIMR?!" and line[1] == " ":
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
408 status, path = line.strip().split(" ", 1)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
409 self.__generateItem(status, path)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
410
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
411 def __showError(self, out):
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
412 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
413 Private slot to show some error.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
414
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
415 @param out error to be shown (string)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
416 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
417 self.errorGroup.show()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
418 self.errors.insertPlainText(out)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
419 self.errors.ensureCursorVisible()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
420
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 @pyqtSlot()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 def on_refreshButton_clicked(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 Private slot to refresh the status display.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 """
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
426 selectedItems = self.statusList.selectedItems()
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
427 if len(selectedItems) == 1:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
428 self.__selectedName = selectedItems[0].text(self.__pathColumn)
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
429 else:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
430 self.__selectedName = ""
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
431
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 self.start(self.args)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
433
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
434 @pyqtSlot(int)
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
435 def on_statusFilterCombo_activated(self, index):
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
436 """
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
437 Private slot to react to the selection of a status filter.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
438
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
439 @param index index of the selected entry
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
440 @type int
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
441 """
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
442 txt = self.statusFilterCombo.itemText(index)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
443 if txt == "<{0}>".format(self.tr("all")):
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
444 for topIndex in range(self.statusList.topLevelItemCount()):
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
445 topItem = self.statusList.topLevelItem(topIndex)
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
446 topItem.setHidden(False)
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
447 else:
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
448 for topIndex in range(self.statusList.topLevelItemCount()):
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
449 topItem = self.statusList.topLevelItem(topIndex)
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
450 topItem.setHidden(topItem.text(self.__statusColumn) != txt)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
451
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
452 @pyqtSlot()
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
453 def on_statusList_itemSelectionChanged(self):
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
454 """
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
455 Private slot to act upon changes of selected items.
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
456 """
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
457 self.__generateDiffs()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
458
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
459 ###########################################################################
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
460 ## Menu handling methods
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
461 ###########################################################################
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
462
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
463 def __showActionsMenu(self):
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 """
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
465 Private slot to prepare the actions button menu before it is shown.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 """
7970
c4ee8a81584c Mercurial: started more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
467 if self.vcs.canCommitMerge():
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
468 self.__commitMergeAct.setEnabled(True)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
469 self.__abortMergeAct.setEnabled(True)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
470
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
471 self.__addAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
472 self.__diffAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
473 self.__sbsDiffAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
474 self.__revertAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
475 self.__forgetAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
476 self.__restoreAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
477 self.__commitAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
478 self.__commitSelectAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
479 self.__commitDeselectAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
480
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
481 self.__lfAddLargeAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
482 self.__lfAddNormalAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
483
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
484 else:
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
485 self.__commitMergeAct.setEnabled(False)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
486 self.__abortMergeAct.setEnabled(False)
3406
b3612f0fbf55 Changed the context menu of the Mercurial status dialog to only enable items available in the current situation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3342
diff changeset
487
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
488 modified = len(self.__getModifiedItems())
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
489 unversioned = len(self.__getUnversionedItems())
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
490 missing = len(self.__getMissingItems())
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
491 commitable = len(self.__getCommitableItems())
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
492 commitableUnselected = len(self.__getCommitableUnselectedItems())
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
493
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
494 self.__addAct.setEnabled(unversioned)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
495 self.__diffAct.setEnabled(modified)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
496 self.__sbsDiffAct.setEnabled(modified == 1)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
497 self.__revertAct.setEnabled(modified)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
498 self.__forgetAct.setEnabled(missing)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
499 self.__restoreAct.setEnabled(missing)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
500 self.__commitAct.setEnabled(commitable)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
501 self.__commitSelectAct.setEnabled(commitableUnselected)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
502 self.__commitDeselectAct.setEnabled(commitable)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
503
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
504 if self.vcs.isExtensionActive("largefiles"):
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
505 enable = bool(unversioned)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
506 else:
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
507 enable = False
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
508 self.__lfAddLargeAct.setEnabled(enable)
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
509 self.__lfAddNormalAct.setEnabled(enable)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
510
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 def __commit(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513 Private slot to handle the Commit context menu entry.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
514 """
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
515 if self.__mq:
7979
54b73174ab61 Mercurial: fixed a few issues introduced during the recent code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7970
diff changeset
516 self.vcs.vcsCommit(self.__repoPath, "", mq=True)
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
517 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
518 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
519 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
520 for itm in self.__getCommitableItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
521 ]
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
522 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
523 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
524 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
525 self.tr("Commit"),
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
526 self.tr("""There are no entries selected to be committed."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
527 )
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
528 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
529
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
530 if Preferences.getVCS("AutoSaveFiles"):
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
531 vm = ericApp().getObject("ViewManager")
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
532 for name in names:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
533 vm.saveEditor(name)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
534 self.vcs.vcsCommit(names, "")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
535
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 def __committed(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 Private slot called after the commit has finished.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 if self.isVisible():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 self.on_refreshButton_clicked()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 self.vcs.checkVCSStatus()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
543
1294
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
544 def __commitSelectAll(self):
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
545 """
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
546 Private slot to select all entries for commit.
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
547 """
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
548 self.__commitSelect(True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
549
1294
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
550 def __commitDeselectAll(self):
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
551 """
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
552 Private slot to deselect all entries from commit.
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
553 """
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
554 self.__commitSelect(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
555
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
556 def __add(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558 Private slot to handle the Add context menu entry.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
560 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
561 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
562 for itm in self.__getUnversionedItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
563 ]
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
564 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
565 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
566 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
567 self.tr("Add"),
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
568 self.tr("""There are no unversioned entries available/selected."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
569 )
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
571
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 self.vcs.vcsAdd(names)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 self.on_refreshButton_clicked()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
574
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
575 project = ericApp().getObject("Project")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576 for name in names:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 project.getModel().updateVCSStatus(name)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 self.vcs.checkVCSStatus()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
579
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
580 def __lfAdd(self, mode):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
581 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
582 Private slot to add a file to the repository.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
583
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
584 @param mode add mode (string one of 'normal' or 'large')
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
585 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
586 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
587 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
588 for itm in self.__getUnversionedItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
589 ]
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
590 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
591 EricMessageBox.information(
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
592 self,
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
593 self.tr("Add"),
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
594 self.tr("""There are no unversioned entries available/selected."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
595 )
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
596 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
597
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
598 self.vcs.getExtensionObject("largefiles").hgAdd(names, mode)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
599 self.on_refreshButton_clicked()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
600
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
601 project = ericApp().getObject("Project")
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
602 for name in names:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
603 project.getModel().updateVCSStatus(name)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
604 self.vcs.checkVCSStatus()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
605
216
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
606 def __forget(self):
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
607 """
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
608 Private slot to handle the Forget Missing context menu entry.
216
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
609 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
610 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
611 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
612 for itm in self.__getMissingItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
613 ]
216
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
614 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
615 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
616 self,
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
617 self.tr("Forget Missing"),
9573
9960d19d66b5 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
618 self.tr("""There are no missing entries available/selected."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
619 )
216
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
620 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
621
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
622 self.vcs.vcsForget(names)
216
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
623 self.on_refreshButton_clicked()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
624
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 def __revert(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627 Private slot to handle the Revert context menu entry.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
628 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
629 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
630 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
631 for itm in self.__getModifiedItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
632 ]
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
633 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
634 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
635 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
636 self.tr("Revert"),
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
637 self.tr("""There are no uncommitted changes available/selected."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
638 )
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
639 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
640
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
641 self.vcs.vcsRevert(names)
2616
954b4069325b Fixed a little issue in the various VCS status dialogs __revert function causing the status dialog to get hidden behind the main window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2405
diff changeset
642 self.raise_()
954b4069325b Fixed a little issue in the various VCS status dialogs __revert function causing the status dialog to get hidden behind the main window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2405
diff changeset
643 self.activateWindow()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
644 self.on_refreshButton_clicked()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
645
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
646 project = ericApp().getObject("Project")
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 for name in names:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648 project.getModel().updateVCSStatus(name)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
649 self.vcs.checkVCSStatus()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
650
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
651 def __restoreMissing(self):
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
652 """
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
653 Private slot to handle the Restore Missing context menu entry.
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
654 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
655 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
656 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
657 for itm in self.__getMissingItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
658 ]
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
659 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
660 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
661 self,
8651
ce4c3c401482 Updated translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
662 self.tr("Restore Missing"),
9573
9960d19d66b5 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
663 self.tr("""There are no missing entries available/selected."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
664 )
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
665 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
666
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
667 self.vcs.vcsRevert(names)
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
668 self.on_refreshButton_clicked()
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
669 self.vcs.checkVCSStatus()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
670
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
671 def __diff(self):
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
672 """
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
673 Private slot to handle the Diff context menu entry.
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
674 """
9482
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
675 from .HgDiffDialog import HgDiffDialog
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
676
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
677 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
678 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
679 for itm in self.__getModifiedItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
680 ]
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
681 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
682 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
683 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
684 self.tr("Differences"),
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
685 self.tr("""There are no uncommitted changes available/selected."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
686 )
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
687 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
688
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
689 if self.diff is None:
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
690 self.diff = HgDiffDialog(self.vcs)
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
691 self.diff.show()
4072
46fb585f60f2 Extended the diff dialogs of the various VCS interfaces to allow a refresh in certain situations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
692 self.diff.start(names, refreshable=True)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
693
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
694 def __sbsDiff(self):
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
695 """
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
696 Private slot to handle the Side-By-Side Diff context menu entry.
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
697 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
698 names = [
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
699 os.path.join(self.__repoPath, itm.text(self.__pathColumn))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
700 for itm in self.__getModifiedItems()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
701 ]
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
702 if not names:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
703 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
704 self,
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
705 self.tr("Differences Side-By-Side"),
9576
be9f8e7e42e0 Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9573
diff changeset
706 self.tr("""There are no uncommitted changes available/selected."""),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
707 )
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
708 return
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
709 elif len(names) > 1:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
710 EricMessageBox.information(
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
711 self,
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
712 self.tr("Differences Side-By-Side"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
713 self.tr(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
714 """Only one file with uncommitted changes"""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
715 """ must be selected."""
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
716 ),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
717 )
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
718 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
719
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8412
diff changeset
720 self.vcs.vcsSbsDiff(names[0])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
721
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
722 def __getCommitableItems(self):
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
723 """
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
724 Private method to retrieve all entries the user wants to commit.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
725
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
726 @return list of all items, the user has checked
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
727 """
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
728 commitableItems = []
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
729 for index in range(self.statusList.topLevelItemCount()):
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
730 itm = self.statusList.topLevelItem(index)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
731 if itm.checkState(self.__toBeCommittedColumn) == Qt.CheckState.Checked:
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
732 commitableItems.append(itm)
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
733 return commitableItems
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
734
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
735 def __getCommitableUnselectedItems(self):
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
736 """
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
737 Private method to retrieve all entries the user may commit but hasn't
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
738 selected.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
739
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
740 @return list of all items, the user has checked
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
741 """
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
742 items = []
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
743 for index in range(self.statusList.topLevelItemCount()):
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
744 itm = self.statusList.topLevelItem(index)
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
745 if (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
746 itm.flags() & Qt.ItemFlag.ItemIsUserCheckable
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
747 == Qt.ItemFlag.ItemIsUserCheckable
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
748 ) and itm.checkState(self.__toBeCommittedColumn) == Qt.CheckState.Unchecked:
5522
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
749 items.append(itm)
e07d1df4c64a Improved the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5520
diff changeset
750 return items
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
751
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
752 def __getModifiedItems(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
753 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
754 Private method to retrieve all entries, that have a modified status.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
755
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
756 @return list of all items with a modified status
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
757 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
758 modifiedItems = []
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
759 for itm in self.statusList.selectedItems():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760 if itm.text(self.__statusColumn) in self.modifiedIndicators:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
761 modifiedItems.append(itm)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
762 return modifiedItems
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
763
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 def __getUnversionedItems(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
766 Private method to retrieve all entries, that have an unversioned
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
767 status.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
768
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
769 @return list of all items with an unversioned status
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
770 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
771 unversionedItems = []
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
772 for itm in self.statusList.selectedItems():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
773 if itm.text(self.__statusColumn) in self.unversionedIndicators:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
774 unversionedItems.append(itm)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
775 return unversionedItems
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
776
216
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
777 def __getMissingItems(self):
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
778 """
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
779 Private method to retrieve all entries, that have a missing status.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
780
216
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
781 @return list of all items with a missing status
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
782 """
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
783 missingItems = []
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
784 for itm in self.statusList.selectedItems():
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
785 if itm.text(self.__statusColumn) in self.missingIndicators:
6f9713e8d570 Added actions to identify the repo, to forget about files and added an additional status to be reported by the status monitor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
786 missingItems.append(itm)
917
746c54b643eb Added functionality to the VCS status dialogs to make them more general commit dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
787 return missingItems
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
788
1294
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
789 def __commitSelect(self, selected):
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
790 """
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
791 Private slot to select or deselect all entries.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
792
1294
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
793 @param selected commit selection state to be set (boolean)
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
794 """
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
795 for index in range(self.statusList.topLevelItemCount()):
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
796 itm = self.statusList.topLevelItem(index)
8412
16e8c2896469 Fixed a few issue using the Qt.ItemFlag enum.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
797 if (
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
798 itm.flags() & Qt.ItemFlag.ItemIsUserCheckable
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
799 == Qt.ItemFlag.ItemIsUserCheckable
8412
16e8c2896469 Fixed a few issue using the Qt.ItemFlag enum.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
800 ):
1294
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
801 if selected:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
802 itm.setCheckState(self.__toBeCommittedColumn, Qt.CheckState.Checked)
1294
d051b9d1426d Added context menu actions to select/deselect all commitable items of the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1256
diff changeset
803 else:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
804 itm.setCheckState(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
805 self.__toBeCommittedColumn, Qt.CheckState.Unchecked
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
806 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
807
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
808 def __commitMerge(self):
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
809 """
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
810 Private slot to handle the Commit Merge context menu entry.
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
811 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
812 self.vcs.vcsCommit(self.__repoPath, self.tr("Merge"), merge=True)
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
813 self.__committed()
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
814
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
815 def __abortMerge(self):
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
816 """
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
817 Private slot used to abort an uncommitted merge.
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
818 """
7970
c4ee8a81584c Mercurial: started more code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
819 self.vcs.hgAbortMerge()
7183
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
820 self.__committed()
4ac1c9daa90b HgStatusDialog: commitMerge and abortMerge actions added
Christos Sevastiadis <csevast@gmail.com>
parents: 6942
diff changeset
821
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
822 ###########################################################################
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
823 ## Diff handling methods below
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
824 ###########################################################################
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
825
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
826 def __generateDiffs(self):
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
827 """
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
828 Private slot to generate diff outputs for the selected item.
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
829 """
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
830 self.diffEdit.clear()
5765
39d8b26ff557 Made the colors of the diff dialogs configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5736
diff changeset
831 self.diffHighlighter.regenerateRules()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
832
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
833 if not self.__mq:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
834 selectedItems = self.statusList.selectedItems()
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
835 if len(selectedItems) == 1:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
836 fn = os.path.join(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
837 self.__repoPath, selectedItems[0].text(self.__pathColumn)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
838 )
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
839 self.__diffGenerator.start(fn)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
840
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
841 def __generatorFinished(self):
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
842 """
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
843 Private slot connected to the finished signal of the diff generator.
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
844 """
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
845 diff = self.__diffGenerator.getResult()[0]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
846
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
847 if diff:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
848 for line in diff[:]:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
849 if line.startswith("@@ "):
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
850 break
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
851 else:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
852 diff.pop(0)
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
853 self.diffEdit.setPlainText("".join(diff))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
854
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
855 tc = self.diffEdit.textCursor()
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7979
diff changeset
856 tc.movePosition(QTextCursor.MoveOperation.Start)
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
857 self.diffEdit.setTextCursor(tc)
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
858 self.diffEdit.ensureCursorVisible()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
859
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
860 def __refreshDiff(self):
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
861 """
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
862 Private method to refresh the diff output after a refresh.
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
863 """
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
864 if self.__selectedName and not self.__mq:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
865 for index in range(self.statusList.topLevelItemCount()):
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
866 itm = self.statusList.topLevelItem(index)
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
867 if itm.text(self.__pathColumn) == self.__selectedName:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
868 itm.setSelected(True)
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
869 break
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
870
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
871 self.__selectedName = ""

eric ide

mercurial