eric6/UI/CompareDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8043
0acf98cd089a
parent 8143
2c730d5fd177
child 8273
698ae46f40a4
equal deleted inserted replaced
8153:e01ae92db699 8176:31965986ecd1
103 103
104 self.file1Picker.setMode(E5PathPickerModes.OpenFileMode) 104 self.file1Picker.setMode(E5PathPickerModes.OpenFileMode)
105 self.file2Picker.setMode(E5PathPickerModes.OpenFileMode) 105 self.file2Picker.setMode(E5PathPickerModes.OpenFileMode)
106 106
107 self.diffButton = self.buttonBox.addButton( 107 self.diffButton = self.buttonBox.addButton(
108 self.tr("Compare"), QDialogButtonBox.ActionRole) 108 self.tr("Compare"), QDialogButtonBox.ButtonRole.ActionRole)
109 self.diffButton.setToolTip( 109 self.diffButton.setToolTip(
110 self.tr("Press to perform the comparison of the two files")) 110 self.tr("Press to perform the comparison of the two files"))
111 self.diffButton.setEnabled(False) 111 self.diffButton.setEnabled(False)
112 self.diffButton.setDefault(True) 112 self.diffButton.setDefault(True)
113 113
198 @param line text to insert (string) 198 @param line text to insert (string)
199 @param charFormat text format to be used (QTextCharFormat) 199 @param charFormat text format to be used (QTextCharFormat)
200 @param interLine flag indicating interline changes (boolean) 200 @param interLine flag indicating interline changes (boolean)
201 """ 201 """
202 tc = pane.textCursor() 202 tc = pane.textCursor()
203 tc.movePosition(QTextCursor.End) 203 tc.movePosition(QTextCursor.MoveOperation.End)
204 pane.setTextCursor(tc) 204 pane.setTextCursor(tc)
205 pane.setCurrentCharFormat(charFormat) 205 pane.setCurrentCharFormat(charFormat)
206 if interLine: 206 if interLine:
207 pane.insertPlainText("{0} ".format(linenumber)) 207 pane.insertPlainText("{0} ".format(linenumber))
208 for txt in re.split(self.markerPattern, line): 208 for txt in re.split(self.markerPattern, line):
209 if txt: 209 if txt:
210 if txt.count('\1'): 210 if txt.count('\1'):
211 txt1, txt = txt.split('\1', 1) 211 txt1, txt = txt.split('\1', 1)
212 tc = pane.textCursor() 212 tc = pane.textCursor()
213 tc.movePosition(QTextCursor.End) 213 tc.movePosition(QTextCursor.MoveOperation.End)
214 pane.setTextCursor(tc) 214 pane.setTextCursor(tc)
215 pane.setCurrentCharFormat(charFormat) 215 pane.setCurrentCharFormat(charFormat)
216 pane.insertPlainText(txt1) 216 pane.insertPlainText(txt1)
217 tc = pane.textCursor() 217 tc = pane.textCursor()
218 tc.movePosition(QTextCursor.End) 218 tc.movePosition(QTextCursor.MoveOperation.End)
219 pane.setTextCursor(tc) 219 pane.setTextCursor(tc)
220 pane.setCurrentCharFormat(self.cNormalFormat) 220 pane.setCurrentCharFormat(self.cNormalFormat)
221 pane.insertPlainText(txt) 221 pane.insertPlainText(txt)
222 else: 222 else:
223 pane.insertPlainText("{0} {1}".format(linenumber, line)) 223 pane.insertPlainText("{0} {1}".format(linenumber, line))
487 487
488 @param obj reference to the object the event is meant for (QObject) 488 @param obj reference to the object the event is meant for (QObject)
489 @param event reference to the event object (QEvent) 489 @param event reference to the event object (QEvent)
490 @return flag indicating, whether the event was handled (boolean) 490 @return flag indicating, whether the event was handled (boolean)
491 """ 491 """
492 if event.type() == QEvent.Close: 492 if event.type() == QEvent.Type.Close:
493 QApplication.exit() 493 QApplication.exit()
494 return True 494 return True
495 495
496 return False 496 return False

eric ide

mercurial