2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-24 19:04:02 +08:00

gui/log: print messages in tooltips

This helps reading long messages in small log windows.
This commit is contained in:
Sebastien Bourdeauducq 2018-08-17 13:21:36 +08:00
parent 2463e5667d
commit 1ba12e1cdb

View File

@ -161,8 +161,13 @@ class _Model(QtCore.QAbstractItemModel):
return v[3][item.row+1]
elif role == QtCore.Qt.ToolTipRole:
v = self.entries[msgnum]
if item.parent is self:
lineno = 0
else:
lineno = item.row + 1
return (log_level_to_name(v[0]) + ", " +
time.strftime("%m/%d %H:%M:%S", time.localtime(v[2])))
time.strftime("%m/%d %H:%M:%S", time.localtime(v[2])) +
"\n" + v[3][lineno])
class LogDock(QDockWidgetCloseDetect):