eric6/Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py

changeset 7970
c4ee8a81584c
parent 7923
91e843545d9a
child 8143
2c730d5fd177
equal deleted inserted replaced
7969:62eff8b34a8d 7970:c4ee8a81584c
5 5
6 """ 6 """
7 Module implementing a dialog to show a list of files which had or still have 7 Module implementing a dialog to show a list of files which had or still have
8 conflicts. 8 conflicts.
9 """ 9 """
10
11 import os
12 10
13 from PyQt5.QtCore import pyqtSlot, Qt, QPoint 11 from PyQt5.QtCore import pyqtSlot, Qt, QPoint
14 from PyQt5.QtWidgets import ( 12 from PyQt5.QtWidgets import (
15 QAbstractButton, QDialogButtonBox, QHeaderView, QTreeWidgetItem, 13 QAbstractButton, QDialogButtonBox, QHeaderView, QTreeWidgetItem,
16 QApplication, QWidget 14 QApplication, QWidget
81 if not self.__position.isNull(): 79 if not self.__position.isNull():
82 self.move(self.__position) 80 self.move(self.__position)
83 81
84 super(HgConflictsListDialog, self).show() 82 super(HgConflictsListDialog, self).show()
85 83
86 def start(self, path): 84 def start(self):
87 """ 85 """
88 Public slot to start the tags command. 86 Public slot to start the tags command.
89
90 @param path name of directory to list conflicts for (string)
91 """ 87 """
92 self.errorGroup.hide() 88 self.errorGroup.hide()
93 QApplication.processEvents() 89 QApplication.processEvents()
94 90
95 self.intercept = False 91 self.intercept = False
96 dname, fname = self.vcs.splitPath(path)
97
98 # find the root of the repo
99 self.__repodir = dname
100 while not os.path.isdir(
101 os.path.join(self.__repodir, self.vcs.adminDir)):
102 self.__repodir = os.path.dirname(self.__repodir)
103 if os.path.splitdrive(self.__repodir)[1] == os.sep:
104 return
105 92
106 self.activateWindow() 93 self.activateWindow()
107 self.raise_() 94 self.raise_()
108 95
109 self.conflictsList.clear() 96 self.conflictsList.clear()
218 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 205 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
219 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) 206 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True)
220 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 207 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
221 208
222 self.refreshButton.setEnabled(False) 209 self.refreshButton.setEnabled(False)
223 self.start(self.__repodir) 210 self.start()
224 211
225 @pyqtSlot(QTreeWidgetItem, int) 212 @pyqtSlot(QTreeWidgetItem, int)
226 def on_conflictsList_itemDoubleClicked(self, item, column): 213 def on_conflictsList_itemDoubleClicked(self, item, column):
227 """ 214 """
228 Private slot to open the double clicked entry. 215 Private slot to open the double clicked entry.

eric ide

mercurial