Skip to content

Commit

Permalink
gui/log: better-looking new dock feature
Browse files Browse the repository at this point in the history
sbourdeauducq committed Dec 1, 2015
1 parent 08abc2e commit b626061
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions artiq/gui/log.py
Original file line number Diff line number Diff line change
@@ -161,6 +161,15 @@ def __init__(self, manager, name, log_sub):
self.filter_freetext_changed)
grid.addWidget(self.filter_freetext, 0, 2)

newdock = QtGui.QToolButton()
newdock.setToolTip("Create new log dock")
newdock.setIcon(QtGui.QApplication.style().standardIcon(
QtGui.QStyle.SP_FileDialogNewFolder))
# note the lambda, the default parameter is overriden otherwise
newdock.clicked.connect(lambda: manager.create_new_dock())
grid.addWidget(newdock, 0, 3)
grid.layout.setColumnStretch(2, 1)

self.log = QtGui.QTableView()
self.log.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
self.log.horizontalHeader().setResizeMode(
@@ -179,12 +188,6 @@ def __init__(self, manager, name, log_sub):
self.scroll_at_bottom = False
self.scroll_value = 0

self.log.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
newlog_action = QtGui.QAction("Create new log dock", self.log)
# note the lambda, the default parameter is overriden otherwise
newlog_action.triggered.connect(lambda: manager.create_new_dock())
self.log.addAction(newlog_action)

log_sub.add_setmodel_callback(self.set_model)

def filter_level_changed(self):

0 comments on commit b626061

Please sign in to comment.