Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py

Mon, 13 Feb 2017 19:06:24 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 13 Feb 2017 19:06:24 +0100
changeset 5520
2a97a4d58bc6
parent 5507
b940eafe6984
child 5522
e07d1df4c64a
permissions
-rw-r--r--

Added code to the Mercurial status dialog to remember the window geometry and the splitter state.

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
5389
9b1c800daff3 Updated copyright for 2017.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5104
diff changeset
3 # Copyright (c) 2010 - 2017 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
3145
a9de05d4a22f # __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3060
diff changeset
11 from __future__ import unicode_literals
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2405
diff changeset
12 try:
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3178 3406
diff changeset
13 str = unicode
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3178 3406
diff changeset
14 except NameError:
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2405
diff changeset
15 pass
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2405
diff changeset
16
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import os
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
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
19 from PyQt5.QtCore import pyqtSlot, Qt, QProcess, QTimer, QSize
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
20 from PyQt5.QtGui import QTextCursor
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
21 from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QMenu, QHeaderView, \
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
22 QTreeWidgetItem, QLineEdit
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 from E5Gui.E5Application import e5App
536
6d8d39753c82 Started replaceing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 495
diff changeset
25 from E5Gui import E5MessageBox
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 from .Ui_HgStatusDialog import Ui_HgStatusDialog
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
29 from .HgDiffHighlighter import HgDiffHighlighter
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
30 from .HgDiffGenerator import HgDiffGenerator
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
31
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 import Preferences
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 917
diff changeset
34
5507
b940eafe6984 Fixed an issue with the layout of the Mercurial status dialog and added some TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5495
diff changeset
35 # TODO: convert action buttons to a tool button with menu and delete status
b940eafe6984 Fixed an issue with the layout of the Mercurial status dialog and added some TODOs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5495
diff changeset
36 # list context menu (i.e. make it the action menu)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 class HgStatusDialog(QWidget, Ui_HgStatusDialog):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
39 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
40 process.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 """
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
42 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
43 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 Constructor
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 @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
47 @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
48 @param parent parent widget (QWidget)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2405
diff changeset
50 super(HgStatusDialog, self).__init__(parent)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.setupUi(self)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
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
53 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
54 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
55 self.__pathColumn = 2
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 self.__lastColumn = self.statusList.columnCount()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
58 self.refreshButton = self.buttonBox.addButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
59 self.tr("Refresh"), QDialogButtonBox.ActionRole)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
60 self.refreshButton.setToolTip(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
61 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
62 self.refreshButton.setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65
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
66 self.diff = None
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 self.vcs = vcs
495
b31b0bffa5b0 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
68 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
69 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
70 self.__mq = mq
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
71 if self.__hgClient:
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
72 self.process = None
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
73 else:
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
74 self.process = QProcess()
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
75 self.process.finished.connect(self.__procFinished)
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
76 self.process.readyReadStandardOutput.connect(self.__readStdout)
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
77 self.process.readyReadStandardError.connect(self.__readStderr)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78
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
79 self.diffSplitter.setSizes([300, 300])
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
80
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 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
82 self.statusList.header().setSortIndicator(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
83 self.__pathColumn, Qt.AscendingOrder)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
85 font = Preferences.getEditorOtherFonts("MonospacedFont")
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
86 self.diffEdit.setFontFamily(font.family())
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
87 self.diffEdit.setFontPointSize(font.pointSize())
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
88
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
89 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
90 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
91 self.__diffGenerator.finished.connect(self.__generatorFinished)
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
92
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
93 self.__selectedName = ""
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
94
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
95 if mq:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
96 self.buttonsLine.setVisible(False)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
97 self.addButton.setVisible(False)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
98 self.diffButton.setVisible(False)
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
99 self.sbsDiffButton.setVisible(False)
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
100 self.revertButton.setVisible(False)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
101 self.forgetButton.setVisible(False)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
102 self.restoreButton.setVisible(False)
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
103
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
104 self.diffEdit.setVisible(False)
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
105
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 self.menuactions = []
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
107 self.lfActions = []
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 self.menu = QMenu()
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
109 if not mq:
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
110 self.__commitAct = self.menu.addAction(
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
111 self.tr("Commit changes to repository..."), self.__commit)
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
112 self.menuactions.append(self.__commitAct)
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
113 self.menuactions.append(self.menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
114 self.tr("Select all for commit"), self.__commitSelectAll))
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
115 self.menuactions.append(self.menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
116 self.tr("Deselect all from commit"),
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
117 self.__commitDeselectAll))
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
118 self.menu.addSeparator()
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
119 self.__addAct = self.menu.addAction(
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
120 self.tr("Add to repository"), self.__add)
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
121 self.menuactions.append(self.__addAct)
5104
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4981
diff changeset
122 self.lfActions.append(self.menu.addAction(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4981
diff changeset
123 self.tr("Add as Large File"),
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4981
diff changeset
124 lambda: self.__lfAdd("large")))
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4981
diff changeset
125 self.lfActions.append(self.menu.addAction(
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4981
diff changeset
126 self.tr("Add as Normal File"),
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4981
diff changeset
127 lambda: self.__lfAdd("normal")))
4981
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
128 self.menu.addSeparator()
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
129 self.__diffAct = self.menu.addAction(
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
130 self.tr("Show differences"), self.__diff)
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
131 self.menuactions.append(self.__diffAct)
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
132 self.__sbsDiffAct = self.menu.addAction(
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
133 self.tr("Show differences side-by-side"), self.__sbsDiff)
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
134 self.menuactions.append(self.__sbsDiffAct)
4981
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
135 self.menu.addSeparator()
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
136 self.__revertAct = self.menu.addAction(
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
137 self.tr("Revert changes"), self.__revert)
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
138 self.menuactions.append(self.__revertAct)
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
139 self.__forgetAct = self.menu.addAction(
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
140 self.tr("Forget missing"), self.__forget)
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
141 self.menuactions.append(self.__forgetAct)
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
142 self.__restoreAct = self.menu.addAction(
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
143 self.tr("Restore missing"), self.__restoreMissing)
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
144 self.menuactions.append(self.__restoreAct)
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
145 self.menu.addSeparator()
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
146 self.menuactions.append(self.menu.addAction(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
147 self.tr("Adjust column sizes"), self.__resizeColumns))
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
148 for act in self.menuactions:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
149 act.setEnabled(False)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
150 for act in self.lfActions:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
151 act.setEnabled(False)
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
152
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
153 self.statusList.setContextMenuPolicy(Qt.CustomContextMenu)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
154 self.statusList.customContextMenuRequested.connect(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
155 self.__showContextMenu)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
5104
0b9420dc1093 Removed the support for the obsolete transplant Mercuril extension and made v3.0 the minimum Mercurial version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4981
diff changeset
157 if not mq:
3342
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
158 self.__lfAddActions = []
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
159 self.__addButtonMenu = QMenu()
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
160 self.__addButtonMenu.addAction(self.tr("Add"), self.__add)
3342
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
161 self.__lfAddActions.append(
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
162 self.__addButtonMenu.addAction(self.tr("Add as Large File"),
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
163 lambda: self.__lfAdd("large")))
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
164 self.__lfAddActions.append(
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
165 self.__addButtonMenu.addAction(self.tr("Add as Normal File"),
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
166 lambda: self.__lfAdd("normal")))
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
167 self.__addButtonMenu.aboutToShow.connect(self.__showAddMenu)
4981
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
168 if self.vcs.isExtensionActive("largefiles"):
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
169 self.addButton.setMenu(self.__addButtonMenu)
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
170
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
171 if not mq:
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
172 self.vcs.activeExtensionsChanged.connect(
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
173 self.__activeExtensionsChanged)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
174
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 self.modifiedIndicators = [
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
176 self.tr('added'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
177 self.tr('modified'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
178 self.tr('removed'),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 ]
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 self.unversionedIndicators = [
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
182 self.tr('not tracked'),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 ]
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184
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
185 self.missingIndicators = [
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
186 self.tr('missing')
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
187 ]
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
188
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 self.status = {
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
190 'A': self.tr('added'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
191 'C': self.tr('normal'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
192 'I': self.tr('ignored'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
193 'M': self.tr('modified'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
194 'R': self.tr('removed'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
195 '?': self.tr('not tracked'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
196 '!': self.tr('missing'),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 }
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198
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
199 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
200 """
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
201 Protected slot implementing a close event handler.
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
202
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
203 @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
204 """
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
205 if self.__hgClient:
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
206 if self.__hgClient.isExecuting():
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
207 self.__hgClient.cancel()
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
208 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
209 if self.process is not None and \
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
210 self.process.state() != QProcess.NotRunning:
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
211 self.process.terminate()
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
212 QTimer.singleShot(2000, self.process.kill)
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
213 self.process.waitForFinished(3000)
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
214
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
215 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
216 self.vcs.getPlugin().setPreferences(
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
217 "MqStatusDialogGeometry", self.saveGeometry())
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
218 self.vcs.getPlugin().setPreferences(
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 "MqStatusDialogSplitterState", self.diffSplitter.saveState())
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 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
221 self.vcs.getPlugin().setPreferences(
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
222 "StatusDialogGeometry", self.saveGeometry())
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 self.vcs.getPlugin().setPreferences(
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 "StatusDialogSplitterState", self.diffSplitter.saveState())
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
225
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
226 e.accept()
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
227
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 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
229 """
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
230 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
231 """
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 super(HgStatusDialog, self).show()
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
233
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
234 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
235 geom = self.vcs.getPlugin().getPreferences(
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 "MqStatusDialogGeometry")
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
237 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
238 geom = self.vcs.getPlugin().getPreferences(
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 "StatusDialogGeometry")
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
240 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
241 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
242 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
243 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
244 self.restoreGeometry(geom)
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
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 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
247 diffSplitterState = self.vcs.getPlugin().getPreferences(
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 "MqStatusDialogSplitterState")
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
249 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
250 diffSplitterState = self.vcs.getPlugin().getPreferences(
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
251 "StatusDialogSplitterState")
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
252 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
253 self.diffSplitter.restoreState(diffSplitterState)
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
254
4981
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
255 def __activeExtensionsChanged(self):
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
256 """
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
257 Private slot handling a change in the activated extensions.
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
258 """
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
259 if self.vcs.isExtensionActive("largefiles"):
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
260 if self.addButton.menu() is None:
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
261 self.addButton.setMenu(self.__addButtonMenu)
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
262 else:
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
263 if self.addButton.menu() is not None:
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
264 self.addButton.setMenu(None)
f3b3a7cdc514 Made the 'Add' button menu of the Mercurial status dialog dependent of the activativation of the Large Files extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
265
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 def __resort(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 Private method to resort the tree.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 """
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
270 self.statusList.sortItems(
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
271 self.statusList.sortColumn(),
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 self.statusList.header().sortIndicatorOrder())
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 def __resizeColumns(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 Private method to resize the list columns.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 self.statusList.header().resizeSections(QHeaderView.ResizeToContents)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 self.statusList.header().setStretchLastSection(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 def __generateItem(self, status, path):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 Private method to generate a status item in the status list.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 @param status status indicator (string)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 @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
287 """
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
288 statusText = self.status[status]
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 itm = QTreeWidgetItem(self.statusList, [
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 917
diff changeset
290 "",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 917
diff changeset
291 statusText,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 917
diff changeset
292 path,
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 ])
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294
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
295 itm.setTextAlignment(1, Qt.AlignHCenter)
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
296 itm.setTextAlignment(2, Qt.AlignLeft)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297
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
298 if status in "AMR":
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
299 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable)
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
300 itm.setCheckState(self.__toBeCommittedColumn, Qt.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
301 else:
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
302 itm.setFlags(itm.flags() & ~Qt.ItemIsUserCheckable)
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
303
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
304 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
305 self.__statusFilters.append(statusText)
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
306
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 def start(self, fn):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 """
198
7ab8e126f404 Fixed a few issues with the Mercurial plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
309 Public slot to start the hg status command.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 @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
312 (string or list of strings)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 self.errorGroup.hide()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 self.intercept = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 self.args = fn
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317
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
318 for act in self.menuactions:
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
319 act.setEnabled(False)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
320 for act in self.lfActions:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
321 act.setEnabled(False)
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
322
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
323 self.addButton.setEnabled(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
324 self.commitButton.setEnabled(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
325 self.diffButton.setEnabled(False)
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
326 self.sbsDiffButton.setEnabled(False)
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.revertButton.setEnabled(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
328 self.forgetButton.setEnabled(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
329 self.restoreButton.setEnabled(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
330
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
331 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
332 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
333 self.statusList.clear()
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
334
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
335 if self.__mq:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
336 self.setWindowTitle(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
337 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
338 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
339 self.setWindowTitle(self.tr('Mercurial Status'))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340
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
341 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
342 if self.__mq:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
343 args.append('--mq')
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
344 if isinstance(fn, list):
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
345 self.dname, fnames = self.vcs.splitPathList(fn)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
346 else:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
347 self.dname, fname = self.vcs.splitPath(fn)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 else:
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
349 if self.vcs.hasSubrepositories():
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
350 args.append("--subrepos")
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
351
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
352 if isinstance(fn, list):
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
353 self.dname, fnames = self.vcs.splitPathList(fn)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
354 self.vcs.addArguments(args, fn)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
355 else:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
356 self.dname, fname = self.vcs.splitPath(fn)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
357 args.append(fn)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 # find the root of the repo
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 repodir = self.dname
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 repodir = os.path.dirname(repodir)
1318
6fa303bd65d6 Fixed issues in various Mercurial files that could cause infinite loops on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1311
diff changeset
363 if os.path.splitdrive(repodir)[1] == os.sep:
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 return
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
366 if self.__hgClient:
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 self.inputGroup.setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 self.inputGroup.hide()
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
369 self.refreshButton.setEnabled(False)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
370
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
371 out, err = self.__hgClient.runcommand(args)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
372 if err:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
373 self.__showError(err)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
374 if out:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
375 for line in out.splitlines():
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
376 self.__processOutputLine(line)
1256
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
377 if self.__hgClient.wasCanceled():
885706dbb69f Refined the Mercurial command server interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1250
diff changeset
378 break
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
379 self.__finish()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 else:
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
381 if self.process:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
382 self.process.kill()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
383
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
384 self.process.setWorkingDirectory(repodir)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
385
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
386 self.process.start('hg', args)
2771
281c9b30dd91 Changed all QProcess.waitForStarted() calls to use a 5s timeout (except the debugger interfaces, which have a 10s timeout).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2616
diff changeset
387 procStarted = self.process.waitForStarted(5000)
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
388 if not procStarted:
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
389 self.inputGroup.setEnabled(False)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
390 self.inputGroup.hide()
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
391 E5MessageBox.critical(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
392 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
393 self.tr('Process Generation Error'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
394 self.tr(
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
395 'The process {0} could not be started. '
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
396 'Ensure, that it is in the search path.'
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
397 ).format('hg'))
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
398 else:
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
399 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
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
400 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True)
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
401 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
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
402
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
403 self.refreshButton.setEnabled(False)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405 def __finish(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
407 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
408 the button.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 if self.process is not None and \
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 self.process.state() != QProcess.NotRunning:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412 self.process.terminate()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 QTimer.singleShot(2000, self.process.kill)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 self.process.waitForFinished(3000)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415
221
38689444e922 Corrected the button handling of some Mercurial dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
416 self.inputGroup.setEnabled(False)
38689444e922 Corrected the button handling of some Mercurial dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
417 self.inputGroup.hide()
38689444e922 Corrected the button handling of some Mercurial dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
418 self.refreshButton.setEnabled(True)
38689444e922 Corrected the button handling of some Mercurial dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
419
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
423 self.buttonBox.button(QDialogButtonBox.Close).setFocus(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
424 Qt.OtherFocusReason)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425
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
426 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
427 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
428 self.statusFilterCombo.addItems(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
429
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 for act in self.menuactions:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 act.setEnabled(True)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 self.__resort()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 self.__resizeColumns()
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
435
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 self.__updateButtons()
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 self.__updateCommitButton()
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
438
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
439 self.__refreshDiff()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 def on_buttonBox_clicked(self, button):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 Private slot called by a button of the button box clicked.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 @param button button that was clicked (QAbstractButton)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 if button == self.buttonBox.button(QDialogButtonBox.Close):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 self.close()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 elif button == self.buttonBox.button(QDialogButtonBox.Cancel):
1242
dfb9609caf51 Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1241
diff changeset
450 if self.__hgClient:
dfb9609caf51 Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1241
diff changeset
451 self.__hgClient.cancel()
dfb9609caf51 Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1241
diff changeset
452 else:
dfb9609caf51 Continued implementing an interface to the Mercurial command server. Modified client all all dialogs done so far to provide a cancel capability..
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1241
diff changeset
453 self.__finish()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 elif button == self.refreshButton:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 self.on_refreshButton_clicked()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 def __procFinished(self, exitCode, exitStatus):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 Private slot connected to the finished signal.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 @param exitCode exit code of the process (integer)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 @param exitStatus exit status of the process (QProcess.ExitStatus)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 self.__finish()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 def __readStdout(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 Private slot to handle the readyReadStandardOutput signal.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 It reads the output of the process, formats it and inserts it into
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 the contents pane.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473 if self.process is not None:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474 self.process.setReadChannel(QProcess.StandardOutput)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
475
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 while self.process.canReadLine():
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
477 line = str(self.process.readLine(), self.vcs.getEncoding(),
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
478 'replace')
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
479 self.__processOutputLine(line)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
480
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
481 def __processOutputLine(self, line):
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
482 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
483 Private method to process the lines of output.
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
484
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
485 @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
486 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
487 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
488 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
489 self.__generateItem(status, path)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 def __readStderr(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493 Private slot to handle the readyReadStandardError signal.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495 It reads the error output of the process and inserts it into the
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496 error pane.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 if self.process is not None:
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 917
diff changeset
499 s = str(self.process.readAllStandardError(),
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
500 self.vcs.getEncoding(), 'replace')
1241
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
501 self.__showError(s)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
502
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
503 def __showError(self, out):
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
504 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
505 Private slot to show some error.
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
506
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
507 @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
508 """
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
509 self.errorGroup.show()
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
510 self.errors.insertPlainText(out)
09c6155ee612 Continued implementing an interface to the Mercurial command server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
511 self.errors.ensureCursorVisible()
5463
d84b854d59c0 Changed the status and log browser dialogs to show the input widgets only when something was written to stderr in order to get less flicker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
512
d84b854d59c0 Changed the status and log browser dialogs to show the input widgets only when something was written to stderr in order to get less flicker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
513 if not self.__hgClient:
d84b854d59c0 Changed the status and log browser dialogs to show the input widgets only when something was written to stderr in order to get less flicker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
514 # show input in case the process asked for some input
d84b854d59c0 Changed the status and log browser dialogs to show the input widgets only when something was written to stderr in order to get less flicker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
515 self.inputGroup.setEnabled(True)
d84b854d59c0 Changed the status and log browser dialogs to show the input widgets only when something was written to stderr in order to get less flicker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
516 self.inputGroup.show()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 def on_passwordCheckBox_toggled(self, isOn):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 Private slot to handle the password checkbox toggled.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 @param isOn flag indicating the status of the check box (boolean)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
523 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
524 if isOn:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
525 self.input.setEchoMode(QLineEdit.Password)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
526 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 self.input.setEchoMode(QLineEdit.Normal)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 @pyqtSlot()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530 def on_sendButton_clicked(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 Private slot to send the input to the subversion process.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 input = self.input.text()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 input += os.linesep
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 if self.passwordCheckBox.isChecked():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 self.errors.insertPlainText(os.linesep)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 self.errors.ensureCursorVisible()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 else:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 self.errors.insertPlainText(input)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 self.errors.ensureCursorVisible()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 self.process.write(input)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 self.passwordCheckBox.setChecked(False)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 self.input.clear()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549 def on_input_returnPressed(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
550 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
551 Private slot to handle the press of the return key in the input field.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
553 self.intercept = True
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
554 self.on_sendButton_clicked()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
555
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
556 def keyPressEvent(self, evt):
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 Protected slot to handle a key press event.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560 @param evt the key press event (QKeyEvent)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
561 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 if self.intercept:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
563 self.intercept = False
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
564 evt.accept()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 return
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2405
diff changeset
566 super(HgStatusDialog, self).keyPressEvent(evt)
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 @pyqtSlot()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
569 def on_refreshButton_clicked(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571 Private slot to refresh the status display.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572 """
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
573 selectedItems = self.statusList.selectedItems()
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
574 if len(selectedItems) == 1:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
575 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
576 else:
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
577 self.__selectedName = ""
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
578
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
579 self.start(self.args)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
580
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
581 def __updateButtons(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
582 """
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
583 Private method to update the VCS buttons status.
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
584 """
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
585 modified = len(self.__getModifiedItems())
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
586 unversioned = len(self.__getUnversionedItems())
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
587 missing = len(self.__getMissingItems())
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
588
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
589 self.addButton.setEnabled(unversioned)
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
590 self.diffButton.setEnabled(modified)
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
591 self.sbsDiffButton.setEnabled(modified == 1)
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
592 self.revertButton.setEnabled(modified)
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
593 self.forgetButton.setEnabled(missing)
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
594 self.restoreButton.setEnabled(missing)
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
595
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
596 def __updateCommitButton(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
597 """
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
598 Private method to update the Commit button status.
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
599 """
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
600 commitable = len(self.__getCommitableItems())
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
601 self.commitButton.setEnabled(commitable)
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
602
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
603 @pyqtSlot(str)
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
604 def on_statusFilterCombo_activated(self, txt):
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
605 """
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
606 Private slot to react to the selection of a status filter.
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
607
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
608 @param txt selected status filter (string)
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
609 """
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
610 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
611 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
612 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
613 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
614 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
615 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
616 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
617 topItem.setHidden(topItem.text(self.__statusColumn) != txt)
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
618
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
619 @pyqtSlot(QTreeWidgetItem, int)
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
620 def on_statusList_itemChanged(self, item, column):
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
621 """
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
622 Private slot to act upon item changes.
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
623
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
624 @param item reference to the changed item (QTreeWidgetItem)
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
625 @param column index of column that changed (integer)
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
626 """
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
627 if column == self.__toBeCommittedColumn:
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
628 self.__updateCommitButton()
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
629
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
630 @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
631 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
632 """
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
633 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
634 """
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
635 self.__updateButtons()
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
636 self.__generateDiffs()
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
637
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
638 @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
639 def on_commitButton_clicked(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
640 """
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
641 Private slot to handle the press of the Commit button.
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
642 """
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
643 self.__commit()
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
644
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
645 @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
646 def on_addButton_clicked(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
647 """
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
648 Private slot to handle the press of the Add button.
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
649 """
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
650 self.__add()
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
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 @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
653 def on_diffButton_clicked(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
654 """
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
655 Private slot to handle the press of the Differences button.
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
656 """
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
657 self.__diff()
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
658
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 @pyqtSlot()
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
660 def on_sbsDiffButton_clicked(self):
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
661 """
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
662 Private slot to handle the press of the Side-by-Side Diff button.
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
663 """
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
664 self.__sbsDiff()
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
665
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
666 @pyqtSlot()
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
667 def on_revertButton_clicked(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
668 """
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 Private slot to handle the press of the Revert button.
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
670 """
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 self.__revert()
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 @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
674 def on_forgetButton_clicked(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
675 """
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
676 Private slot to handle the press of the Forget button.
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
677 """
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
678 self.__forget()
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
679
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
680 @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
681 def on_restoreButton_clicked(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
682 """
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
683 Private slot to handle the press of the Restore button.
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
684 """
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
685 self.__restoreMissing()
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
686
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
687 ###########################################################################
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
688 ## Context 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
689 ###########################################################################
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
691 def __showContextMenu(self, coord):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
692 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
693 Private slot to show the context menu of the status list.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
695 @param coord the position of the mouse pointer (QPoint)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
696 """
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
697 modified = len(self.__getModifiedItems())
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
698 unversioned = len(self.__getUnversionedItems())
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
699 missing = len(self.__getMissingItems())
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
700 commitable = len(self.__getCommitableItems())
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
701
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
702 self.__addAct.setEnabled(unversioned)
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
703 self.__diffAct.setEnabled(modified)
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
704 self.__sbsDiffAct.setEnabled(modified == 1)
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
705 self.__revertAct.setEnabled(modified)
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
706 self.__forgetAct.setEnabled(missing)
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
707 self.__restoreAct.setEnabled(missing)
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
708 self.__commitAct.setEnabled(commitable)
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
709
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
710 if self.vcs.isExtensionActive("largefiles"):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
711 enable = len(self.__getUnversionedItems()) > 0
3326
b4868bd56338 Fixed a bug in the Mercurial status dialog introduced with the largefiles support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
712 else:
b4868bd56338 Fixed a bug in the Mercurial status dialog introduced with the largefiles support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
713 enable = False
b4868bd56338 Fixed a bug in the Mercurial status dialog introduced with the largefiles support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
714 for act in self.lfActions:
b4868bd56338 Fixed a bug in the Mercurial status dialog introduced with the largefiles support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
715 act.setEnabled(enable)
3895
05a919adc36b Fixed a annoyance in the various VCS status dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
716 self.menu.popup(self.statusList.mapToGlobal(coord))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
717
3342
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
718 def __showAddMenu(self):
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
719 """
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
720 Private slot to prepare the Add button menu before it is shown.
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
721 """
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
722 enable = self.vcs.isExtensionActive("largefiles")
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
723 for act in self.__lfAddActions:
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
724 act.setEnabled(enable)
f8cd11fa94ed Fixed an issue in the Mercurial status dialog causing the Add button menu to have largefiles entries enabled even when the extension is not active.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3326
diff changeset
725
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726 def __commit(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 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
729 """
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
730 if self.__mq:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
731 self.vcs.vcsCommit(self.dname, "", mq=True)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
732 else:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
733 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
734 for itm in self.__getCommitableItems()]
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
735 if not names:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
736 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
737 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
738 self.tr("Commit"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
739 self.tr("""There are no entries selected to be"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
740 """ committed."""))
2815
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
741 return
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
742
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
743 if Preferences.getVCS("AutoSaveFiles"):
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
744 vm = e5App().getObject("ViewManager")
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
745 for name in names:
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
746 vm.saveEditor(name)
53c1d1f9ec86 Started to implement support for Mercurial queue repositories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2771
diff changeset
747 self.vcs.vcsCommit(names, '')
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
748
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
749 def __committed(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
750 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
751 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
752 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
753 if self.isVisible():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
754 self.on_refreshButton_clicked()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
755 self.vcs.checkVCSStatus()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
756
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
757 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
758 """
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
759 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
760 """
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
761 self.__commitSelect(True)
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
762
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
763 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
764 """
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
765 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
766 """
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
767 self.__commitSelect(False)
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
768
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
769 def __add(self):
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 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
772 """
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
773 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
774 for itm in self.__getUnversionedItems()]
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
775 if not names:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
776 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
777 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
778 self.tr("Add"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
779 self.tr("""There are no unversioned entries"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
780 """ available/selected."""))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781 return
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
783 self.vcs.vcsAdd(names)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
784 self.on_refreshButton_clicked()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
785
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
786 project = e5App().getObject("Project")
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
787 for name in names:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
788 project.getModel().updateVCSStatus(name)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
789 self.vcs.checkVCSStatus()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
790
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
791 def __lfAdd(self, mode):
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
792 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
793 Private slot to add a file to the repository.
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
794
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
795 @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
796 """
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
797 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
798 for itm in self.__getUnversionedItems()]
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
799 if not names:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
800 E5MessageBox.information(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
801 self,
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
802 self.tr("Add"),
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
803 self.tr("""There are no unversioned entries"""
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
804 """ available/selected."""))
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
805 return
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
806
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
807 self.vcs.getExtensionObject("largefiles").hgAdd(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
808 names, mode)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
809 self.on_refreshButton_clicked()
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
810
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
811 project = e5App().getObject("Project")
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
812 for name in names:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
813 project.getModel().updateVCSStatus(name)
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
814 self.vcs.checkVCSStatus()
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
815
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
816 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
817 """
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
818 Private slot to handle the Remove context menu entry.
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
819 """
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
820 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
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
821 for itm in self.__getMissingItems()]
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
822 if not names:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
823 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
824 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
825 self.tr("Remove"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
826 self.tr("""There are no missing entries"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
827 """ available/selected."""))
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
828 return
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
829
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
830 self.vcs.hgForget(names)
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
831 self.on_refreshButton_clicked()
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
832
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
833 def __revert(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 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
836 """
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
837 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
838 for itm in self.__getModifiedItems()]
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
839 if not names:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
840 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
841 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
842 self.tr("Revert"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
843 self.tr("""There are no uncommitted changes"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
844 """ available/selected."""))
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
845 return
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
846
1311
95685f9ad9f8 Added support for importing patches to the Mercurial interface and made it's revert action check, if the project should be reread.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1294
diff changeset
847 self.vcs.hgRevert(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
848 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
849 self.activateWindow()
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
850 self.on_refreshButton_clicked()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
851
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
852 project = e5App().getObject("Project")
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
853 for name in names:
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
854 project.getModel().updateVCSStatus(name)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
855 self.vcs.checkVCSStatus()
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
856
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
857 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
858 """
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
859 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
860 """
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
861 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
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
862 for itm in self.__getMissingItems()]
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
863 if not names:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
864 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
865 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
866 self.tr("Revert"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
867 self.tr("""There are no missing entries"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
868 """ available/selected."""))
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
869 return
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
870
1311
95685f9ad9f8 Added support for importing patches to the Mercurial interface and made it's revert action check, if the project should be reread.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1294
diff changeset
871 self.vcs.hgRevert(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
872 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
873 self.vcs.checkVCSStatus()
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
874
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
875 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
876 """
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
877 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
878 """
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
879 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
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
880 for itm in self.__getModifiedItems()]
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
881 if not names:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
882 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
883 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
884 self.tr("Differences"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
885 self.tr("""There are no uncommitted changes"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
886 """ available/selected."""))
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
887 return
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
888
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
889 if self.diff is None:
2405
d4b5f3bd4720 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
890 from .HgDiffDialog import HgDiffDialog
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
891 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
892 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
893 self.diff.start(names, refreshable=True)
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
894
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
895 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
896 """
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
897 Private slot to handle the Diff context menu entry.
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
898 """
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
899 names = [os.path.join(self.dname, itm.text(self.__pathColumn))
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
900 for itm in self.__getModifiedItems()]
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
901 if not names:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
902 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
903 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
904 self.tr("Side-by-Side Diff"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
905 self.tr("""There are no uncommitted changes"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
906 """ available/selected."""))
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
907 return
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
908 elif len(names) > 1:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
909 E5MessageBox.information(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
910 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
911 self.tr("Side-by-Side Diff"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
912 self.tr("""Only one file with uncommitted changes"""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
913 """ must be selected."""))
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
914 return
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
915
2840
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
916 self.vcs.hgSbsDiff(names[0])
10a133f3a5e8 Added side-by-side diff support to the Mercurial status dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2838
diff changeset
917
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
918 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
919 """
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
920 Private method to retrieve all entries the user wants to commit.
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
921
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
922 @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
923 """
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
924 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
925 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
926 itm = self.statusList.topLevelItem(index)
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
927 if itm.checkState(self.__toBeCommittedColumn) == Qt.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
928 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
929 return 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
930
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
931 def __getModifiedItems(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
932 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
933 Private method to retrieve all entries, that have a modified status.
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
934
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
935 @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
936 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
937 modifiedItems = []
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
938 for itm in self.statusList.selectedItems():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
939 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
940 modifiedItems.append(itm)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
941 return modifiedItems
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
942
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
943 def __getUnversionedItems(self):
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
944 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2840
diff changeset
945 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
946 status.
178
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
947
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
948 @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
949 """
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
950 unversionedItems = []
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
951 for itm in self.statusList.selectedItems():
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
952 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
953 unversionedItems.append(itm)
dd9f0bca5e2f Added plugin for Mercurial version control system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
954 return unversionedItems
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
955
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
956 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
957 """
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
958 Private method to retrieve all entries, that have 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
959
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
960 @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
961 """
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
962 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
963 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
964 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
965 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
966 return missingItems
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
967
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
968 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
969 """
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
970 Private slot to select or deselect all entries.
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
971
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
972 @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
973 """
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
974 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
975 itm = self.statusList.topLevelItem(index)
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
976 if itm.flags() & Qt.ItemIsUserCheckable:
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
977 if 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
978 itm.setCheckState(self.__toBeCommittedColumn, Qt.Checked)
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
979 else:
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
980 itm.setCheckState(self.__toBeCommittedColumn, Qt.Unchecked)
4132
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
981
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
982 ###########################################################################
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
983 ## Diff handling methods below
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
984 ###########################################################################
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
985
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
986 def __generateDiffs(self):
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4126
diff changeset
987 """
04f395eef728 Enhanced the status dialog functionality by a diff view.
Detlev&#