3
3
from __future__ import annotations
4
4
import os
5
5
import uuid
6
+ from collections .abc import Iterable
6
7
7
8
from PyQt5 .QtWidgets import QDialogButtonBox , QFileDialog , QRadioButton
8
9
10
+ from mantidimaging .core .data .dataset import Dataset
9
11
from mantidimaging .gui .mvp_base import BaseDialogView
10
- from mantidimaging .gui .windows .main .presenter import DatasetId
11
12
12
13
NXS_EXT = ".nxs"
13
14
@@ -18,7 +19,7 @@ class NexusSaveDialog(BaseDialogView):
18
19
floatRadioButton : QRadioButton
19
20
intRadioButton : QRadioButton
20
21
21
- def __init__ (self , parent , dataset_list : list [ DatasetId ]):
22
+ def __init__ (self , parent , dataset_list : Iterable [ Dataset ]):
22
23
super ().__init__ (parent , 'gui/ui/nexus_save_dialog.ui' )
23
24
24
25
self .browseButton .clicked .connect (self ._set_save_path )
@@ -32,9 +33,10 @@ def __init__(self, parent, dataset_list: list[DatasetId]):
32
33
33
34
self .selected_dataset = None
34
35
35
- def _create_dataset_lists (self , dataset_list ):
36
+ def _create_dataset_lists (self , dataset_list : Iterable [ Dataset ] ):
36
37
if dataset_list :
37
- self .dataset_uuids , dataset_names = zip (* dataset_list , strict = True )
38
+ self .dataset_uuids = [ds .id for ds in dataset_list ]
39
+ dataset_names = [ds .name for ds in dataset_list ]
38
40
self .datasetNames .addItems (dataset_names )
39
41
40
42
def accept (self ) -> None :
0 commit comments