16 QTreeWidgetItem, |
16 QTreeWidgetItem, |
17 QApplication, |
17 QApplication, |
18 QWidget, |
18 QWidget, |
19 ) |
19 ) |
20 |
20 |
21 from EricWidgets.EricApplication import ericApp |
21 from eric7.EricWidgets.EricApplication import ericApp |
22 |
22 |
23 from .Ui_HgConflictsListDialog import Ui_HgConflictsListDialog |
23 from .Ui_HgConflictsListDialog import Ui_HgConflictsListDialog |
24 |
24 |
25 import Utilities.MimeTypes |
25 from eric7.Utilities import MimeTypes |
26 |
26 |
27 |
27 |
28 class HgConflictsListDialog(QWidget, Ui_HgConflictsListDialog): |
28 class HgConflictsListDialog(QWidget, Ui_HgConflictsListDialog): |
29 """ |
29 """ |
30 Class implementing a dialog to show a list of files which had or still |
30 Class implementing a dialog to show a list of files which had or still |
242 self.resolvedButton.setEnabled(unresolved > 0) |
242 self.resolvedButton.setEnabled(unresolved > 0) |
243 self.unresolvedButton.setEnabled(resolved > 0) |
243 self.unresolvedButton.setEnabled(resolved > 0) |
244 self.reMergeButton.setEnabled(unresolved > 0) |
244 self.reMergeButton.setEnabled(unresolved > 0) |
245 self.editButton.setEnabled( |
245 self.editButton.setEnabled( |
246 selectedCount == 1 |
246 selectedCount == 1 |
247 and Utilities.MimeTypes.isTextFile( |
247 and MimeTypes.isTextFile( |
248 self.conflictsList.selectedItems()[0].data(0, self.FilenameRole) |
248 self.conflictsList.selectedItems()[0].data(0, self.FilenameRole) |
249 ) |
249 ) |
250 ) |
250 ) |
251 |
251 |
252 @pyqtSlot() |
252 @pyqtSlot() |
295 """ |
295 """ |
296 Private slot to open the selected file in an editor. |
296 Private slot to open the selected file in an editor. |
297 """ |
297 """ |
298 itm = self.conflictsList.selectedItems()[0] |
298 itm = self.conflictsList.selectedItems()[0] |
299 filename = itm.data(0, self.FilenameRole) |
299 filename = itm.data(0, self.FilenameRole) |
300 if Utilities.MimeTypes.isTextFile(filename): |
300 if MimeTypes.isTextFile(filename): |
301 ericApp().getObject("ViewManager").getEditor(filename) |
301 ericApp().getObject("ViewManager").getEditor(filename) |