Skip to content

Commit

Permalink
applets: also accept '/' as dataset path separator for completion
Browse files Browse the repository at this point in the history
sbourdeauducq committed Apr 24, 2016
1 parent e91961f commit 0636396
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions artiq/gui/applets.py
Original file line number Diff line number Diff line change
@@ -206,11 +206,8 @@ def __init__(self, parent, completer):

def _insert_completion(self, completion):
parents = self._completer.completionPrefix()
try:
idx = parents.rindex(".")
except ValueError:
pass
else:
idx = max(parents.rfind("."), parents.rfind("/"))
if idx >= 0:
parents = parents[:idx+1]
completion = parents + completion

@@ -256,7 +253,7 @@ def keyPressEvent(self, event):
class _CompleterDelegate(QtWidgets.QStyledItemDelegate):
def createEditor(self, parent, option, index):
completer = QtWidgets.QCompleter()
completer.splitPath = lambda path: path.split(".")
completer.splitPath = lambda path: path.replace("/", ".").split(".")
completer.setModelSorting(
QtWidgets.QCompleter.CaseSensitivelySortedModel)
completer.setCompletionRole(QtCore.Qt.DisplayRole)

0 comments on commit 0636396

Please sign in to comment.