eric7/VCS/StatusWidget.py

Thu, 23 Sep 2021 19:49:56 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 23 Sep 2021 19:49:56 +0200
branch
eric7
changeset 8626
fa4ec5a82698
parent 8624
5192a2592324
child 8627
ca3114b95866
permissions
-rw-r--r--

Fixed some issues introduced by the recent addition.

8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2021 Detlev Offenbach <detlev@die-offenbachs.de>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a VCS Status widget for the sidebar/toolbar.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
10 import contextlib
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
11 import os
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
12
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from PyQt6.QtCore import pyqtSlot, Qt
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from PyQt6.QtWidgets import (
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 QWidget, QVBoxLayout, QHBoxLayout, QLabel, QSizePolicy, QListView,
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
16 QListWidget, QListWidgetItem, QToolButton, QAbstractItemView, QMenu,
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
17 QGroupBox, QDialog
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 )
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
20 from EricWidgets.EricApplication import ericApp
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
21 from EricWidgets import EricMessageBox
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
22 from EricWidgets.EricSpellCheckedTextEdit import EricSpellCheckedTextEdit
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
23 from EricWidgets.EricListSelectionDialog import EricListSelectionDialog
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
24
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
25 import Preferences
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 import UI.PixmapCache
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
27 import Utilities
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 class StatusWidget(QWidget):
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 Class implementing a VCS Status widget for the sidebar/toolbox.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 """
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
34 StatusDataRole = Qt.ItemDataRole.UserRole + 1
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
35
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
36 def __init__(self, project, viewmanager, parent=None):
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 Constructor
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 @param project reference to the project object
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 @type Project
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
42 @param viewmanager reference to the viewmanager object
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
43 @type ViewManager
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 @param parent reference to the parent widget (defaults to None)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 @type QWidget (optional)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 super().__init__(parent)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.setObjectName("VcsStatusWidget")
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.__project = project
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
51 self.__vm = viewmanager
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.__layout = QVBoxLayout()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.__layout.setObjectName("MainLayout")
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 self.__layout.setContentsMargins(0, 3, 0, 0)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 self.__topLayout = QHBoxLayout()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.__topLayout.setObjectName("topLayout")
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
59 # Create the top area
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 self.__infoLabel = QLabel(self)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 self.__infoLabel.setSizePolicy(
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.__topLayout.addWidget(self.__infoLabel)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
65 self.__commitToggleButton = QToolButton(self)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
66 self.__commitToggleButton.setIcon(UI.PixmapCache.getIcon("check"))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
67 self.__commitToggleButton.setToolTip(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
68 self.tr("Press to toggle the commit markers"))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
69 self.__commitToggleButton.clicked.connect(self.__toggleCheckMark)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
70 self.__topLayout.addWidget(self.__commitToggleButton)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
71
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
72 self.__commitButton = QToolButton(self)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
73 self.__commitButton.setIcon(UI.PixmapCache.getIcon("vcsCommit"))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
74 self.__commitButton.setToolTip(
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
75 self.tr("Press to commit the marked entries with options"))
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
76 self.__commitButton.clicked.connect(self.__commit)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
77 self.__topLayout.addWidget(self.__commitButton)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
78
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
79 self.__addButton = QToolButton(self)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
80 self.__addButton.setIcon(UI.PixmapCache.getIcon("vcsAdd"))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
81 self.__addButton.setToolTip(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
82 self.tr("Press to add the selected, untracked entries"))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
83 self.__addButton.clicked.connect(self.__addUntracked)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
84 self.__topLayout.addWidget(self.__addButton)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
85
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.__reloadButton = QToolButton(self)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.__reloadButton.setIcon(UI.PixmapCache.getIcon("reload"))
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
88 self.__reloadButton.setToolTip(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
89 self.tr("Press to reload the status list"))
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.__reloadButton.clicked.connect(self.__reload)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.__topLayout.addWidget(self.__reloadButton)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
93 self.__actionsButton = QToolButton(self)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
94 self.__actionsButton.setIcon(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
95 UI.PixmapCache.getIcon("actionsToolButton"))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
96 self.__actionsButton.setToolTip(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
97 self.tr("Select action from menu"))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
98 self.__actionsButton.setPopupMode(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
99 QToolButton.ToolButtonPopupMode.InstantPopup)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
100 self.__topLayout.addWidget(self.__actionsButton)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
101
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 self.__layout.addLayout(self.__topLayout)
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
103 ###################################################################
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
105 # Create the middle part
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 self.__statusList = QListWidget(self)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.__statusList.setAlternatingRowColors(True)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 self.__statusList.setSortingEnabled(True)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.__statusList.setViewMode(QListView.ViewMode.ListMode)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self.__statusList.setTextElideMode(Qt.TextElideMode.ElideLeft)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
111 self.__statusList.setSelectionMode(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
112 QAbstractItemView.SelectionMode.ExtendedSelection)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
113 self.__statusList.itemSelectionChanged.connect(
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
114 self.__updateEnabledStates)
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
115 self.__statusList.itemDoubleClicked.connect(self.__itemDoubleClicked)
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
116 self.__statusList.itemChanged.connect(self.__updateEnabledStates)
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 self.__layout.addWidget(self.__statusList)
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
118 ###################################################################
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
119
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
120 # create the Quick Commit area
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
121 self.__quickCommitGroup = QGroupBox(self.tr("Quick Commit"), self)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
122 self.__quickCommitLayout = QVBoxLayout()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
123 self.__quickCommitEdit = EricSpellCheckedTextEdit(self)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
124 self.__quickCommitEdit.setSizePolicy(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
125 QSizePolicy.Policy.Expanding,
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
126 QSizePolicy.Policy.Preferred)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
127 self.__quickCommitEdit.setMaximumHeight(100)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
128 self.__quickCommitEdit.textChanged.connect(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
129 self.__quickCommitEditTextChanged)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
130 self.__quickCommitLayout.addWidget(self.__quickCommitEdit)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
131
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
132 self.__quickCommitLayout2 = QHBoxLayout()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
133 self.__quickCommitLayout2.addStretch()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
134
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
135 self.__quickCommitHistoryButton = QToolButton(self)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
136 self.__quickCommitHistoryButton.setIcon(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
137 UI.PixmapCache.getIcon("history"))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
138 self.__quickCommitHistoryButton.setToolTip(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
139 self.tr("Select commit message from previous commits"))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
140 self.__quickCommitHistoryButton.clicked.connect(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
141 self.__selectQuickCommitMessage)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
142 self.__quickCommitLayout2.addWidget(self.__quickCommitHistoryButton)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
143
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
144 self.__quickCommitHistoryClearButton = QToolButton(self)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
145 self.__quickCommitHistoryClearButton.setIcon(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
146 UI.PixmapCache.getIcon("historyClear"))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
147 self.__quickCommitHistoryClearButton.setToolTip(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
148 self.tr("Clear the list of saved commit messages"))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
149 self.__quickCommitHistoryClearButton.clicked.connect(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
150 self.__clearCommitMessages)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
151 self.__quickCommitLayout2.addWidget(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
152 self.__quickCommitHistoryClearButton)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
153
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
154 self.__quickCommitButton = QToolButton(self)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
155 self.__quickCommitButton.setIcon(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
156 UI.PixmapCache.getIcon("vcsCommit"))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
157 self.__quickCommitButton.setToolTip(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
158 self.tr("Press to commit the marked entries"))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
159 self.__quickCommitButton.clicked.connect(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
160 self.__quickCommit)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
161 self.__quickCommitLayout2.addWidget(self.__quickCommitButton)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
162
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
163 self.__quickCommitLayout.addLayout(self.__quickCommitLayout2)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
164 self.__quickCommitGroup.setLayout(self.__quickCommitLayout)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
165 self.__layout.addWidget(self.__quickCommitGroup)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
166 ###################################################################
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 self.setLayout(self.__layout)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
170 self.__statusIcons = {
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
171 "A": "vcs-added", # added
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
172 "M": "vcs-modified", # modified
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
173 "O": "vcs-removed", # removed
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
174 "R": "vcs-renamed", # renamed
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
175 "U": "vcs-update-required", # update needed
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
176 "Z": "vcs-conflicting", # conflict
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
177 "?": "vcs-untracked", # not tracked
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
178 "!": "vcs-missing", # missing
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
179 }
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
180 self.__statusTexts = {
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
181 "A": self.tr("added"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
182 "M": self.tr("modified"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
183 "O": self.tr("removed"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
184 "R": self.tr("renamed"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
185 "U": self.tr("needs update"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
186 "Z": self.tr("conflict"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
187 "?": self.tr("not tracked"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
188 "!": self.tr("missing"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
189 }
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
190
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
191 self.__initActionsMenu()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
192
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
193 self.__reset()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
194
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 if self.__project.isOpen():
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 self.__projectOpened()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 else:
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 self.__projectClosed()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 self.__project.projectOpened.connect(self.__projectOpened)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 self.__project.projectClosed.connect(self.__projectClosed)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
202 self.__project.vcsCommitted.connect(self.__committed)
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 self.__project.vcsStatusMonitorInfo.connect(self.__setInfoText)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
204 self.__project.vcsStatusMonitorAllData.connect(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
205 self.__processStatusData)
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
207 def __initActionsMenu(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
208 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
209 Private method to initialize the actions menu.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
210 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
211 self.__actionsMenu = QMenu()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
212 self.__actionsMenu.setToolTipsVisible(True)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
213 self.__actionsMenu.aboutToShow.connect(self.__showActionsMenu)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
214
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
215 self.__commitAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
216 UI.PixmapCache.getIcon("vcsCommit"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
217 self.tr("Commit"), self.__commit)
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
218 self.__commitAct.setToolTip(self.tr(
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
219 "Commit the marked entries with options"))
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
220 self.__commitSelectAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
221 self.tr("Select all for commit"), self.__commitSelectAll)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
222 self.__commitDeselectAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
223 self.tr("Unselect all from commit"), self.__commitDeselectAll)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
224
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
225 self.__actionsMenu.addSeparator()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
226
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
227 self.__addAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
228 UI.PixmapCache.getIcon("vcsAdd"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
229 self.tr("Add"), self.__addUntracked)
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
230 self.__addAct.setToolTip(self.tr(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
231 "Add the selected, untracked entries"))
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
232 self.__addAllAct = self.__actionsMenu.addAction(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
233 self.tr("Add All"), self.__addAllUntracked)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
234 self.__addAllAct.setToolTip(self.tr(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
235 "Add all untracked entries"))
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
236
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
237 self.__actionsMenu.addSeparator()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
238
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
239 self.__diffAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
240 UI.PixmapCache.getIcon("vcsDiff"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
241 self.tr("Differences"), self.__diff)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
242 self.__diffAct.setToolTip(self.tr(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
243 "Shows the differences of the selected entry in a"
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
244 " separate dialog"))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
245 self.__sbsDiffAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
246 UI.PixmapCache.getIcon("vcsSbsDiff"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
247 self.tr("Differences Side-By-Side"), self.__sbsDiff)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
248 self.__sbsDiffAct.setToolTip(self.tr(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
249 "Shows the differences of the selected entry side-by-side in"
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
250 " a separate dialog"))
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
251 self.__diffAllAct = self.__actionsMenu.addAction(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
252 self.tr("All Differences"), self.__diffAll)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
253 self.__diffAllAct.setToolTip(self.tr(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
254 "Shows the differences of all entries in a separate dialog"))
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
255
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
256 self.__actionsMenu.addSeparator()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
257
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
258 self.__revertAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
259 UI.PixmapCache.getIcon("vcsRevert"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
260 self.tr("Revert"), self.__revert)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
261 self.__revertAct.setToolTip(self.tr(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
262 "Reverts the changes of the selected files"))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
263
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
264 self.__actionsMenu.addSeparator()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
265
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
266 self.__forgetAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
267 self.tr("Forget Missing"), self.__forgetMissing)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
268 self.__forgetAct.setToolTip(self.tr(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
269 "Forgets about the selected missing files"))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
270 self.__restoreAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
271 self.tr("Restore Missing"), self.__restoreMissing)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
272 self.__restoreAct.setToolTip(self.tr(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
273 "Restores the selected missing files"))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
274 self.__actionsMenu.addSeparator()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
275
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
276 self.__editAct = self.__actionsMenu.addAction(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
277 UI.PixmapCache.getIcon("open"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
278 self.tr("Edit Conflict"), self.__editConflict)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
279 self.__editAct.setToolTip(self.tr(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
280 "Edit the selected conflicting file"))
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
281 self.__resolvedAct = self.__actionsMenu.addAction(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
282 UI.PixmapCache.getIcon("vcsResolved"),
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
283 self.tr("Conflict Resolved"), self.__conflictResolved)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
284 self.__resolvedAct.setToolTip(self.tr(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
285 "Mark the selected conflicting file as resolved"))
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
286
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
287 self.__actionsButton.setMenu(self.__actionsMenu)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
288
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 @pyqtSlot()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 def __projectOpened(self):
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 Private slot to handle the opening of a project.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 self.__reloadButton.setEnabled(True)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 @pyqtSlot()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 def __projectClosed(self):
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 Private slot to handle the closing of a project.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 self.__infoLabel.setText(self.tr("No project open."))
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 self.__reloadButton.setEnabled(False)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
305 self.__reset()
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 @pyqtSlot(str)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 def __setInfoText(self, info):
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 Private slot to set the info label text.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 @param info text to be shown
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 @type str
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 self.__infoLabel.setText(info)
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 @pyqtSlot()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 def __reload(self):
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 Private slot to reload the status list.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 self.__project.checkVCSStatus()
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
324 def __reset(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
325 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
326 Private method to reset the widget to default.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
327 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
328 self.__statusList.clear()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
329
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
330 self.__commitToggleButton.setEnabled(False)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
331 self.__commitButton.setEnabled(False)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
332 self.__addButton.setEnabled(False)
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
333
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
334 self.__quickCommitEdit.clear()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
335 self.__quickCommitGroup.setEnabled(False)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
336
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
337 def __updateEnabledStates(self):
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
338 """
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
339 Private method to set the enabled states depending on the list state.
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
340 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
341 modified = len(self.__getModifiedItems())
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
342 unversioned = len(self.__getSelectedUnversionedItems())
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
343 commitable = len(self.__getCommitableItems())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
344
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
345 self.__commitToggleButton.setEnabled(modified)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
346 self.__commitButton.setEnabled(commitable)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
347 self.__addButton.setEnabled(unversioned)
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
348
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
349 self.__quickCommitGroup.setEnabled(commitable)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
350
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
351 @pyqtSlot(dict)
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 def __processStatusData(self, data):
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 """
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 Private slot to process the status data emitted by the project.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 Each entry of the status data consists of a status flag and and the
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 path relative to the project directory starting with the third column.
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 The known status flags are:
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 <ul>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 <li>"A" path was added but not yet committed</li>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 <li>"M" path has local changes</li>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 <li>"O" path was removed</li>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 <li>"R" path was deleted and then re-added</li>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 <li>"U" path needs an update</li>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 <li>"Z" path contains a conflict</li>
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
366 <li>"?" path is not tracked</li>
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
367 <li>"!" path is missing</li>
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 <li>" " path is back at normal</li>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 </ul>
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
371 @param data dictionary containing the status data
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
372 @type dict
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 """
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
374 # step 1: remember all currently checked entries
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
375 wasUnpopulated = self.__statusList.count() == 0
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
376 checkedEntries = [itm.text() for itm in self.__getCommitableItems()]
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
377 selectedEntries = [itm.text()
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
378 for itm in self.__statusList.selectedItems()]
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
380 # step 2: clear the list and re-populate it with new data
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
381 self.__statusList.clear()
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
382
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
383 block = self.__statusList.blockSignals(True)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
384 for name, status in data.items():
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
385 if status:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
386 itm = QListWidgetItem(name, self.__statusList)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
387 with contextlib.suppress(KeyError):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
388 itm.setToolTip(self.__statusTexts[status])
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
389 itm.setIcon(UI.PixmapCache.getIcon(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
390 self.__statusIcons[status]))
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
391 itm.setData(self.StatusDataRole, status)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
392 if status in "AMOR":
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
393 itm.setFlags(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
394 itm.flags() | Qt.ItemFlag.ItemIsUserCheckable)
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
395 if wasUnpopulated or name in checkedEntries:
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
396 itm.setCheckState(Qt.CheckState.Checked)
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
397 else:
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
398 itm.setCheckState(Qt.CheckState.Unchecked)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
399 else:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
400 itm.setFlags(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
401 itm.flags() & ~Qt.ItemFlag.ItemIsUserCheckable)
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
402 itm.setSelected(name in selectedEntries)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
403
8619
2dc55ddafc68 Added the forgotten VCS status widget source.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 self.__statusList.sortItems(Qt.SortOrder.AscendingOrder)
8626
fa4ec5a82698 Fixed some issues introduced by the recent addition.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8624
diff changeset
405 self.__statusList.blockSignals(block)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
406
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
407 self.__updateEnabledStates()
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
408
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
409 @pyqtSlot()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
410 def __toggleCheckMark(self):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
411 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
412 Private slot to toggle the check marks.
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
413 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
414 for row in range(self.__statusList.count()):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
415 itm = self.__statusList.item(row)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
416 if (
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
417 itm.flags() & Qt.ItemFlag.ItemIsUserCheckable ==
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
418 Qt.ItemFlag.ItemIsUserCheckable
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
419 ):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
420 if itm.checkState() == Qt.CheckState.Unchecked:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
421 itm.setCheckState(Qt.CheckState.Checked)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
422 else:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
423 itm.setCheckState(Qt.CheckState.Unchecked)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
424
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
425 def __setCheckMark(self, checked):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
426 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
427 Private method to set or unset all check marks.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
428
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
429 @param checked check mark state to be set
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
430 @type bool
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
431 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
432 for row in range(self.__statusList.count()):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
433 itm = self.__statusList.item(row)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
434 if (
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
435 itm.flags() & Qt.ItemFlag.ItemIsUserCheckable ==
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
436 Qt.ItemFlag.ItemIsUserCheckable
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
437 ):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
438 if checked:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
439 itm.setCheckState(Qt.CheckState.Checked)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
440 else:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
441 itm.setCheckState(Qt.CheckState.Unchecked)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
442
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
443 @pyqtSlot()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
444 def __commit(self):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
445 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
446 Private slot to handle the commit button.
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
447 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
448 projectPath = self.__project.getProjectPath()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
449 names = []
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
450
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
451 for row in range(self.__statusList.count()):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
452 itm = self.__statusList.item(row)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
453 if itm.checkState() == Qt.CheckState.Checked:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
454 names.append(os.path.join(projectPath, itm.text()))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
455
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
456 if not names:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
457 EricMessageBox.information(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
458 self,
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
459 self.tr("Commit"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
460 self.tr("""There are no entries selected to be"""
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
461 """ committed."""))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
462 return
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
463
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
464 if Preferences.getVCS("AutoSaveFiles"):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
465 vm = ericApp().getObject("ViewManager")
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
466 for name in names:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
467 vm.saveEditor(name)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
468 vcs = self.__project.getVcs()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
469 vcs and vcs.vcsCommit(names, '')
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
470
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
471 @pyqtSlot()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
472 def __committed(self):
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
473 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
474 Private slot called after the commit has been completed.
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
475 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
476 self.__reload()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
477
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
478 @pyqtSlot()
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
479 def __commitSelectAll(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
480 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
481 Private slot to select all entries for commit.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
482 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
483 self.__setCheckMark(True)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
484
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
485 @pyqtSlot()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
486 def __commitDeselectAll(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
487 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
488 Private slot to deselect all entries from commit.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
489 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
490 self.__setCheckMark(False)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
491
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
492 @pyqtSlot()
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
493 def __addUntracked(self, allItems=False):
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
494 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
495 Private slot to add the selected untracked entries.
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
496
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
497 @param allItems flag indicating to show the differences of all files
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
498 (defaults to False)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
499 @type bool (optional)
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
500 """
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
501 projectPath = self.__project.getProjectPath()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
502
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
503 names = [
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
504 os.path.join(projectPath, itm.text())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
505 for itm in self.__getUnversionedItems()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
506 ] if allItems else [
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
507 os.path.join(projectPath, itm.text())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
508 for itm in self.__getSelectedUnversionedItems()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
509 ]
8620
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
510
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
511 if not names:
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
512 EricMessageBox.information(
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
513 self,
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
514 self.tr("Add"),
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
515 self.tr("""There are no unversioned entries"""
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
516 """ available/selected."""))
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
517 return
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
518
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
519 vcs = self.__project.getVcs()
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
520 vcs and vcs.vcsAdd(names)
84f7f7867b5f Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8619
diff changeset
521 self.__reload()
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
522
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
523 @pyqtSlot(QListWidgetItem)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
524 def __itemDoubleClicked(self, itm):
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
525 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
526 Private slot to handle double clicking an item.
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
527
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
528 @param itm reference to the double clicked item
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
529 @type QListWidgetItem
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
530 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
531 projectPath = self.__project.getProjectPath()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
532
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
533 if itm.data(self.StatusDataRole) in "MZ":
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
534 # modified and conflicting items
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
535 name = os.path.join(projectPath, itm.text())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
536 vcs = self.__project.getVcs()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
537 vcs and vcs.vcsDiff(name)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
538
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
539 ###########################################################################
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
540 ## Menu handling methods
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
541 ###########################################################################
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
542
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
543 def __showActionsMenu(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
544 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
545 Private slot to prepare the actions button menu before it is shown.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
546 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
547 modified = len(self.__getSelectedModifiedItems())
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
548 allModified = len(self.__getModifiedItems())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
549 unversioned = len(self.__getSelectedUnversionedItems())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
550 allUnversioned = len(self.__getUnversionedItems())
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
551 missing = len(self.__getMissingItems())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
552 commitable = len(self.__getCommitableItems())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
553 commitableUnselected = len(self.__getCommitableUnselectedItems())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
554 conflicting = len(self.__getSelectedConflictingItems())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
555
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
556 self.__addAct.setEnabled(unversioned)
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
557 self.__addAllAct.setEnabled(allUnversioned)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
558 self.__diffAct.setEnabled(modified)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
559 self.__sbsDiffAct.setEnabled(modified == 1)
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
560 self.__diffAllAct.setEnabled(allModified)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
561 self.__revertAct.setEnabled(modified)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
562 self.__forgetAct.setEnabled(missing)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
563 self.__restoreAct.setEnabled(missing)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
564 self.__commitAct.setEnabled(commitable)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
565 self.__commitSelectAct.setEnabled(commitableUnselected)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
566 self.__commitDeselectAct.setEnabled(commitable)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
567 self.__editAct.setEnabled(conflicting == 1)
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
568 self.__resolvedAct.setEnabled(conflicting)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
569
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
570 def __getCommitableItems(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
571 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
572 Private method to retrieve all entries the user wants to commit.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
573
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
574 @return list of all items, the user has checked
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
575 @rtype list of QListWidgetItem
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
576 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
577 commitableItems = []
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
578 for row in range(self.__statusList.count()):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
579 itm = self.__statusList.item(row)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
580 if (
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
581 itm.checkState() == Qt.CheckState.Checked
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
582 ):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
583 commitableItems.append(itm)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
584 return commitableItems
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
585
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
586 def __getCommitableUnselectedItems(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
587 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
588 Private method to retrieve all entries the user may commit but hasn't
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
589 selected.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
590
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
591 @return list of all items, the user has checked
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
592 @rtype list of QListWidgetItem
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
593 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
594 items = []
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
595 for row in range(self.__statusList.count()):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
596 itm = self.__statusList.item(row)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
597 if (
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
598 (itm.flags() & Qt.ItemFlag.ItemIsUserCheckable ==
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
599 Qt.ItemFlag.ItemIsUserCheckable) and
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
600 itm.checkState() == Qt.CheckState.Unchecked
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
601 ):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
602 items.append(itm)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
603 return items
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
604
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
605 def __getModifiedItems(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
606 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
607 Private method to retrieve all entries, that have a modified status.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
608
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
609 @return list of all items with a modified status
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
610 @rtype list of QListWidgetItem
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
611 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
612 items = []
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
613 for row in range(self.__statusList.count()):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
614 itm = self.__statusList.item(row)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
615 if itm.data(self.StatusDataRole) in "AMOR":
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
616 items.append(itm)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
617 return items
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
618
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
619 def __getSelectedModifiedItems(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
620 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
621 Private method to retrieve all selected entries, that have a modified
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
622 status.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
623
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
624 @return list of all selected entries with a modified status
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
625 @rtype list of QListWidgetItem
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
626 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
627 return [itm for itm in self.__statusList.selectedItems()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
628 if itm.data(self.StatusDataRole) in "AMOR"]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
629
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
630 def __getUnversionedItems(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
631 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
632 Private method to retrieve all entries, that have an unversioned
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
633 status.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
634
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
635 @return list of all items with an unversioned status
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
636 @rtype list of QListWidgetItem
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
637 """
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
638 items = []
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
639 for row in range(self.__statusList.count()):
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
640 itm = self.__statusList.item(row)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
641 if itm.data(self.StatusDataRole) == "?":
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
642 items.append(itm)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
643 return items
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
644
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
645 def __getSelectedUnversionedItems(self):
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
646 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
647 Private method to retrieve all selected entries, that have an
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
648 unversioned status.
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
649
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
650 @return list of all items with an unversioned status
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
651 @rtype list of QListWidgetItem
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
652 """
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
653 return [itm for itm in self.__statusList.selectedItems()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
654 if itm.data(self.StatusDataRole) == "?"]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
655
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
656 def __getMissingItems(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
657 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
658 Private method to retrieve all entries, that have a missing status.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
659
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
660 @return list of all items with a missing status
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
661 @rtype list of QListWidgetItem
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
662 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
663 return [itm for itm in self.__statusList.selectedItems()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
664 if itm.data(self.StatusDataRole) == "!"]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
665
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
666 def __getSelectedConflictingItems(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
667 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
668 Private method to retrieve all selected entries, that have a conflict
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
669 status.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
670
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
671 @return list of all selected entries with a conflict status
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
672 @rtype list of QListWidgetItem
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
673 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
674 return [itm for itm in self.__statusList.selectedItems()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
675 if itm.data(self.StatusDataRole) == "Z"]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
676
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
677 @pyqtSlot()
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
678 def __addAllUntracked(self):
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
679 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
680 Private slot to handle the Add All action menu entry.
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
681 """
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
682 self.__addUntracked(allItems=True)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
683
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
684 @pyqtSlot()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
685 def __diff(self, allItems=False):
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
686 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
687 Private slot to handle the Differences action menu entry.
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
688
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
689 @param allItems flag indicating to show the differences of all files
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
690 (defaults to False)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
691 @type bool (optional)
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
692 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
693 projectPath = self.__project.getProjectPath()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
694
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
695 names = [
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
696 os.path.join(projectPath, itm.text())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
697 for itm in self.__getModifiedItems()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
698 ] if allItems else [
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
699 os.path.join(projectPath, itm.text())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
700 for itm in self.__getSelectedModifiedItems()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
701 ]
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
702 if not names:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
703 EricMessageBox.information(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
704 self,
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
705 self.tr("Differences"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
706 self.tr("""There are no uncommitted changes"""
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
707 """ available/selected."""))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
708 return
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
709
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
710 vcs = self.__project.getVcs()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
711 vcs and vcs.vcsDiff(names)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
712
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
713 @pyqtSlot()
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
714 def __diffAll(self):
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
715 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
716 Private slot to handle the All Differences action menu entry.
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
717 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
718 self.__diff(allItems=True)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
719
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
720 @pyqtSlot()
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
721 def __sbsDiff(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
722 """
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
723 Private slot to handle the Side-By-Side Differences action menu entry.
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
724 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
725 projectPath = self.__project.getProjectPath()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
726
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
727 names = [os.path.join(projectPath, itm.text())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
728 for itm in self.__getSelectedModifiedItems()]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
729 if not names:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
730 EricMessageBox.information(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
731 self,
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
732 self.tr("Differences Side-By-Side"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
733 self.tr("""There are no uncommitted changes"""
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
734 """ available/selected."""))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
735 return
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
736 elif len(names) > 1:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
737 EricMessageBox.information(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
738 self,
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
739 self.tr("Differences Side-By-Side"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
740 self.tr("""Only one file with uncommitted changes"""
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
741 """ must be selected."""))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
742 return
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
743
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
744 vcs = self.__project.getVcs()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
745 vcs and vcs.vcsSbsDiff(names[0])
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
746
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
747 @pyqtSlot()
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
748 def __revert(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
749 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
750 Private slot to handle the Revert action menu entry.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
751 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
752 projectPath = self.__project.getProjectPath()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
753
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
754 names = [os.path.join(projectPath, itm.text())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
755 for itm in self.__getSelectedModifiedItems()]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
756 if not names:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
757 EricMessageBox.information(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
758 self,
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
759 self.tr("Revert"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
760 self.tr("""There are no uncommitted changes"""
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
761 """ available/selected."""))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
762 return
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
763
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
764 vcs = self.__project.getVcs()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
765 vcs and vcs.vcsRevert(names)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
766 self.__reload()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
767
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
768 @pyqtSlot()
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
769 def __forgetMissing(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
770 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
771 Private slot to handle the Forget action menu entry.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
772 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
773 projectPath = self.__project.getProjectPath()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
774
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
775 names = [os.path.join(projectPath, itm.text())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
776 for itm in self.__getMissingItems()]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
777 if not names:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
778 EricMessageBox.information(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
779 self,
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
780 self.tr("Forget Missing"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
781 self.tr("""There are no missing entries"""
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
782 """ available/selected."""))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
783 return
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
784
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
785 vcs = self.__project.getVcs()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
786 vcs and vcs.vcsForget(names)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
787 self.__reload()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
788
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
789 @pyqtSlot()
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
790 def __restoreMissing(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
791 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
792 Private slot to handle the Restore Missing context menu entry.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
793 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
794 projectPath = self.__project.getProjectPath()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
795
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
796 names = [os.path.join(projectPath, itm.text())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
797 for itm in self.__getMissingItems()]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
798 if not names:
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
799 EricMessageBox.information(
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
800 self,
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
801 self.tr("Revert Missing"),
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
802 self.tr("""There are no missing entries"""
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
803 """ available/selected."""))
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
804 return
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
805
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
806 vcs = self.__project.getVcs()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
807 vcs and vcs.vcsRevert(names)
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
808 self.__reload()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
809
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
810 @pyqtSlot()
8621
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
811 def __editConflict(self):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
812 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
813 Private slot to handle the Edit Conflict action menu entry.
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
814 """
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
815 projectPath = self.__project.getProjectPath()
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
816
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
817 itm = self.__getSelectedConflictingItems()[0]
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
818 filename = os.path.join(projectPath, itm.text())
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
819 if Utilities.MimeTypes.isTextFile(filename):
8c9f41115c04 Continued implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8620
diff changeset
820 self.__vm.getEditor(filename)
8622
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
821
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
822 @pyqtSlot()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
823 def __conflictResolved(self):
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
824 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
825 Private slot to handle the Conflict Resolved action menu entry.
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
826 """
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
827 projectPath = self.__project.getProjectPath()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
828
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
829 names = [os.path.join(projectPath, itm.text())
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
830 for itm in self.__getSelectedConflictingItems()]
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
831 if not names:
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
832 EricMessageBox.information(
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
833 self,
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
834 self.tr("Conflict Resolved"),
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
835 self.tr("""There are no conflicting entries"""
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
836 """ available/selected."""))
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
837 return
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
838
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
839 vcs = self.__project.getVcs()
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
840 vcs and vcs.vcsResolved(names)
149d51870ce8 Finished implementing the VCS status widget for the left side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8621
diff changeset
841 self.__reload()
8624
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
842
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
843 #######################################################################
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
844 ## Quick Commit handling methods
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
845 #######################################################################
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
846
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
847 @pyqtSlot()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
848 def __selectQuickCommitMessage(self):
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
849 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
850 Private slot to select a commit message from the list of
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
851 saved messages.
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
852 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
853 vcs = self.__project.getVcs()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
854 if vcs:
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
855 commitMessages = vcs.vcsCommitMessages()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
856 dlg = EricListSelectionDialog(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
857 commitMessages,
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
858 selectionMode=QAbstractItemView.SelectionMode.SingleSelection,
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
859 title=self.tr("Quick Commit"),
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
860 message=self.tr("Select your commit message:"),
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
861 parent=self
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
862 )
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
863 if dlg.exec() == QDialog.DialogCode.Accepted:
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
864 selection = dlg.getSelection()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
865 if selection:
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
866 self.__quickCommitEdit.setPlainText(selection[0])
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
867
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
868 @pyqtSlot()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
869 def __clearCommitMessages(self):
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
870 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
871 Private slot to clear the list of saved commit messages.
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
872 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
873 vcs = self.__project.getVcs()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
874 vcs and vcs.vcsClearCommitMessages()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
875
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
876 @pyqtSlot()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
877 def __quickCommit(self):
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
878 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
879 Private slot to commit all marked entries with the entered
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
880 commit message.
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
881 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
882 projectPath = self.__project.getProjectPath()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
883 names = []
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
884
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
885 for row in range(self.__statusList.count()):
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
886 itm = self.__statusList.item(row)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
887 if itm.checkState() == Qt.CheckState.Checked:
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
888 names.append(os.path.join(projectPath, itm.text()))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
889
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
890 if not names:
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
891 EricMessageBox.information(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
892 self,
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
893 self.tr("Commit"),
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
894 self.tr("""There are no entries selected to be"""
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
895 """ committed."""))
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
896 return
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
897
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
898 if Preferences.getVCS("AutoSaveFiles"):
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
899 vm = ericApp().getObject("ViewManager")
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
900 for name in names:
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
901 vm.saveEditor(name)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
902
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
903 commitMessage = self.__quickCommitEdit.toPlainText()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
904 vcs = self.__project.getVcs()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
905 if vcs:
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
906 vcs.vcsCommit(names, commitMessage, noDialog=True)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
907 vcs.vcsAddCommitMessage(commitMessage)
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
908
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
909 @pyqtSlot()
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
910 def __quickCommitEditTextChanged(self):
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
911 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
912 Private slot to react upon changes of the quick commit text.
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
913 """
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
914 self.__quickCommitButton.setEnabled(bool(
5192a2592324 Started implementing a 'Quick Commit' function for the new VCS Status List widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8622
diff changeset
915 self.__quickCommitEdit.toPlainText()))

eric ide

mercurial