diff --git a/CHANGELOG.mkdn b/CHANGELOG.mkdn index abba568..aff0332 100644 --- a/CHANGELOG.mkdn +++ b/CHANGELOG.mkdn @@ -46,6 +46,7 @@ CHANGELOG * Make adding quirks into multi-page wizard - Kiooeht [evacipatedBox] * Flash the taskbar on new messages - Kiooeht [evacipatedBox] * Third beep sound for when your initials are mentioned in memos - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) +* Ctrl + click to copy links - Kiooeht [evacipatedBox] * Bug fixes * Logviewer updates - Kiooeht [evacipatedBox] * Memo scrollbar thing - Kiooeht [evacipatedBox] @@ -62,6 +63,7 @@ CHANGELOG * End all colour tags and restart them on split messages - Kiooeht [evacipatedBox] * Chat input box right-click menus - Kiooeht [evacipatedBox] * Don't overflow random colours into colourless messages - Kiooeht [evacipatedBox] + * Only open links on left click - Kiooeht [evacipatedBox] ### 3.14.1 * Pesterchum 3.14 - illuminatedwax [ghostDunk] diff --git a/convo.py b/convo.py index 8fe6099..3b538bd 100644 --- a/convo.py +++ b/convo.py @@ -368,15 +368,19 @@ class PesterText(QtGui.QTextEdit): QtGui.QTextEdit.keyPressEvent(self, event) def mousePressEvent(self, event): - url = self.anchorAt(event.pos()) - if url != "": - if url[0] == "#" and url != "#pesterchum": - self.parent().mainwindow.showMemos(url[1:]) - elif url[0] == "@": - handle = unicode(url[1:]) - self.parent().mainwindow.newConversation(handle) - else: - QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode)) + if event.button() == QtCore.Qt.LeftButton: + url = self.anchorAt(event.pos()) + if url != "": + if url[0] == "#" and url != "#pesterchum": + self.parent().mainwindow.showMemos(url[1:]) + elif url[0] == "@": + handle = unicode(url[1:]) + self.parent().mainwindow.newConversation(handle) + else: + if event.modifiers() == QtCore.Qt.ControlModifier: + QtGui.QApplication.clipboard().setText(url) + else: + QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode)) QtGui.QTextEdit.mousePressEvent(self, event) def mouseMoveEvent(self, event): QtGui.QTextEdit.mouseMoveEvent(self, event)