1
0
forked from IPKM/nmreval

Sort option to context menu in data tree added; fixes T226

This commit is contained in:
Dominik Demuth
2023-01-07 18:00:38 +01:00
parent 2c09573d2a
commit 46952e1648
2 changed files with 41 additions and 9 deletions

View File

@ -144,6 +144,9 @@ class UpperManagement(QtCore.QObject):
def active_sets(self):
return self.graphs.active(self.current_graph)
def get_attributes(self, graph_id: str, attr: str) -> dict[str, Any]:
return {self.data[i].id: getattr(self.data[i], attr) for i in self.graphs[graph_id].sets}
def add(self, data, **kwargs):
_id = str(uuid.uuid4())
self.__setitem__(_id, data, **kwargs)
@ -230,7 +233,7 @@ class UpperManagement(QtCore.QObject):
self.graphs[self.data[key].graph].remove(key)
@QtCore.pyqtSlot(list, str, str)
def move_sets(self, sets: list, dest: str, src, pos: int = -1):
def move_sets(self, sets: list, dest: str, src: (str|list), pos: int = -1):
if isinstance(src, str):
src = [src]*len(sets)