Skip to content

Commit d1e2f99

Browse files
committed
feat: accept DCOR drag events from DCOR-Aid data browser
1 parent 2160c2b commit d1e2f99

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2.7.0
2+
- feat: accept DCOR drag events from DCOR-Aid data browser
13
2.6.9
24
- fix: don't reset color and name of dataset during duplicate
35
matrix action (#96)

shapeout2/gui/main.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,22 @@ def dragEnterEvent(self, e):
439439
def dropEvent(self, e):
440440
"""Add dropped files to view"""
441441
urls = e.mimeData().urls()
442-
pathlist = []
443-
for ff in urls:
444-
pp = pathlib.Path(ff.toLocalFile())
445-
if pp.is_dir():
446-
pathlist += list(pp.rglob("*.rtdc"))
447-
elif pp.suffix == ".rtdc":
448-
pathlist.append(pp)
449-
if pathlist:
450-
self.add_dataslot(paths=sorted(pathlist))
442+
if urls:
443+
pathlist = []
444+
is_dcor = bool(urls[0].host())
445+
for ff in urls:
446+
if is_dcor:
447+
# DCOR data
448+
pathlist.append(ff.toString())
449+
else:
450+
pp = pathlib.Path(ff.toLocalFile())
451+
if pp.is_dir():
452+
pathlist += list(pp.rglob("*.rtdc"))
453+
elif pp.suffix == ".rtdc":
454+
pathlist.append(pp)
455+
pathlist = sorted(pathlist)
456+
if pathlist:
457+
self.add_dataslot(paths=pathlist, is_dcor=is_dcor)
451458

452459
def init_analysis_view(self):
453460
sub = widgets.MDISubWindowWOButtons(self)

0 commit comments

Comments
 (0)