Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 14caa2713cea
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2dfc1a8d17e0
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 5, 2016

  1. Copy the full SHA
    d9b2968 View commit details
  2. Copy the full SHA
    2dfc1a8 View commit details
Showing with 16 additions and 4 deletions.
  1. +4 −0 artiq/gui/explorer.py
  2. +12 −4 artiq/gui/models.py
4 changes: 4 additions & 0 deletions artiq/gui/explorer.py
Original file line number Diff line number Diff line change
@@ -117,6 +117,10 @@ class Model(DictSyncTreeSepModel):
def __init__(self, init):
DictSyncTreeSepModel.__init__(self, "/", ["Experiment"], init)

def convert_tooltip(self, k, v, column):
return ("<b>File:</b> {file}<br><b>Class:</b> {cls}"
.format(file=v["file"], cls=v["class_name"]))


class StatusUpdater:
def __init__(self, init):
16 changes: 12 additions & 4 deletions artiq/gui/models.py
Original file line number Diff line number Diff line change
@@ -359,19 +359,27 @@ def index_to_key(self, index):
return key

def data(self, index, role):
if not index.isValid() or role != QtCore.Qt.DisplayRole:
if not index.isValid() or (role != QtCore.Qt.DisplayRole
and role != QtCore.Qt.ToolTipRole):
return None
else:
column = index.column()
if column == 0:
if column == 0 and role == QtCore.Qt.DisplayRole:
return index.internalPointer().name
else:
key = self.index_to_key(index)
if key is None:
return None
else:
return self.convert(key, self.backing_store[key],
column)
if role == QtCore.Qt.DisplayRole:
convert = self.convert
else:
convert = self.convert_tooltip
return convert(key, self.backing_store[key],
column)

def convert(self, k, v, column):
raise NotImplementedError

def convert_tooltip(self, k, v, column):
return None