revert clickable links on chatlogs, there's a weird bug
This commit is contained in:
parent
92085020b8
commit
dda37268d4
16
gameview.py
16
gameview.py
@ -199,15 +199,15 @@ class ChatLogs(QtGui.QTextEdit):
|
|||||||
def mouseMoveEvent(self, e):
|
def mouseMoveEvent(self, e):
|
||||||
super(ChatLogs, self).mouseMoveEvent(e)
|
super(ChatLogs, self).mouseMoveEvent(e)
|
||||||
self.anchor = self.anchorAt(e.pos())
|
self.anchor = self.anchorAt(e.pos())
|
||||||
if self.anchor:
|
# if self.anchor:
|
||||||
QtGui.QApplication.setOverrideCursor(QtCore.Qt.PointingHandCursor)
|
# QtGui.QApplication.setOverrideCursor(QtCore.Qt.PointingHandCursor)
|
||||||
else:
|
# else:
|
||||||
QtGui.QApplication.setOverrideCursor(QtCore.Qt.ArrowCursor)
|
# QtGui.QApplication.setOverrideCursor(QtCore.Qt.ArrowCursor)
|
||||||
|
|
||||||
def mouseReleaseEvent(self, e):
|
def mouseReleaseEvent(self, e):
|
||||||
if self.anchor:
|
if self.anchor:
|
||||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(self.anchor))
|
QtGui.QDesktopServices.openUrl(QtCore.QUrl(self.anchor))
|
||||||
QtGui.QApplication.setOverrideCursor(QtCore.Qt.ArrowCursor)
|
# QtGui.QApplication.setOverrideCursor(QtCore.Qt.ArrowCursor)
|
||||||
self.anchor = None
|
self.anchor = None
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
@ -233,9 +233,9 @@ class ChatLogs(QtGui.QTextEdit):
|
|||||||
else:
|
else:
|
||||||
self.logfile.write(text.toUtf8()+"\n")
|
self.logfile.write(text.toUtf8()+"\n")
|
||||||
|
|
||||||
if "http" in text:
|
# if "http" in text:
|
||||||
text = unicode(text) # Get rid of QStrings
|
# text = unicode(text) # Get rid of QStrings
|
||||||
text = re.sub(URL_REGEX, r'<a href="\g<0>">\g<0></a>', text)
|
# text = re.sub(URL_REGEX, r'<a href="\g<0>">\g<0></a>', text)
|
||||||
|
|
||||||
super(ChatLogs, self).append(text)
|
super(ChatLogs, self).append(text)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user