From 1ba12e1cdbd28ccbdb25860e550724639d6dd9ea Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 17 Aug 2018 13:21:36 +0800 Subject: [PATCH] gui/log: print messages in tooltips This helps reading long messages in small log windows. --- artiq/gui/log.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/gui/log.py b/artiq/gui/log.py index a6d68cb3d..2b5d7185f 100644 --- a/artiq/gui/log.py +++ b/artiq/gui/log.py @@ -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):