Make logviewer compliant with @links
This commit is contained in:
parent
d3c674e4b3
commit
74d86bd7df
1 changed files with 7 additions and 4 deletions
11
logviewer.py
11
logviewer.py
|
@ -219,15 +219,18 @@ class PesterLogText(PesterText):
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
url = self.anchorAt(event.pos())
|
url = self.anchorAt(event.pos())
|
||||||
if url != "":
|
if url != "":
|
||||||
if url[0] != "#":
|
if url[0] == "#" and url != "#pesterchum":
|
||||||
|
self.parent().parent.showMemos(url[1:])
|
||||||
|
elif url[0] == "@":
|
||||||
|
handle = unicode(url[1:])
|
||||||
|
self.parent().parent.newConversation(handle)
|
||||||
|
else:
|
||||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode))
|
QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode))
|
||||||
QtGui.QTextEdit.mousePressEvent(self, event)
|
QtGui.QTextEdit.mousePressEvent(self, event)
|
||||||
def mouseMoveEvent(self, event):
|
def mouseMoveEvent(self, event):
|
||||||
QtGui.QTextEdit.mouseMoveEvent(self, event)
|
QtGui.QTextEdit.mouseMoveEvent(self, event)
|
||||||
if self.anchorAt(event.pos()):
|
if self.anchorAt(event.pos()):
|
||||||
if self.viewport().cursor().shape != QtCore.Qt.PointingHandCursor:
|
if self.viewport().cursor().shape != QtCore.Qt.PointingHandCursor:
|
||||||
url = self.anchorAt(event.pos())
|
self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
||||||
if url != "" and url[0] != "#":
|
|
||||||
self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
|
|
||||||
else:
|
else:
|
||||||
self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
|
self.viewport().setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
|
||||||
|
|
Loading…
Reference in a new issue