mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-29 13:13:34 +08:00
browser: wire up activate in list
This commit is contained in:
parent
f1747b5ea5
commit
ecdbf2ae08
@ -126,6 +126,7 @@ class FilesDock(QtWidgets.QDockWidget):
|
|||||||
self.rl.setModel(self.model)
|
self.rl.setModel(self.model)
|
||||||
self.rl.selectionModel().currentChanged.connect(
|
self.rl.selectionModel().currentChanged.connect(
|
||||||
self.list_current_changed)
|
self.list_current_changed)
|
||||||
|
self.rl.activated.connect(self.list_activated)
|
||||||
self.splitter.addWidget(self.rl)
|
self.splitter.addWidget(self.rl)
|
||||||
|
|
||||||
self.restore_selected = select is None
|
self.restore_selected = select is None
|
||||||
@ -152,6 +153,14 @@ class FilesDock(QtWidgets.QDockWidget):
|
|||||||
rd = {k: (True, v.value) for k, v in f["datasets"].items()}
|
rd = {k: (True, v.value) for k, v in f["datasets"].items()}
|
||||||
self.datasets.init(rd)
|
self.datasets.init(rd)
|
||||||
|
|
||||||
|
def list_activated(self, idx):
|
||||||
|
if not self.model.fileInfo(idx).isDir():
|
||||||
|
return
|
||||||
|
self.rl.setRootIndex(idx)
|
||||||
|
idx = self.rt.model().mapFromSource(idx)
|
||||||
|
self.rt.expand(idx)
|
||||||
|
self.rt.setCurrentIndex(idx)
|
||||||
|
|
||||||
def select_dir(self, path):
|
def select_dir(self, path):
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user