Skip to content
Snippets Groups Projects
Commit cf3e3b06 authored by Dimitar Tasev's avatar Dimitar Tasev
Browse files

Sort workspace now uses the algorithm, re #24547

parent 51c30963
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,8 @@ class TableWorkspaceDisplayModel:
def sort(self, column_index, sort_ascending):
column_name = self.ws.getColumnNames()[column_index]
if self.is_peaks_workspace():
SortPeaksWorkspace(self.ws, ColumnNameToSortBy=column_name, SortAscending=sort_ascending)
SortPeaksWorkspace(InputWorkspace=self.ws, OutputWorkspace=self.ws, ColumnNameToSortBy=column_name,
SortAscending=sort_ascending)
else:
SortTableWorkspace(InputWorkspace=self.ws, OutputWorkspace=self.ws, Columns=[column_name],
Ascending=[sort_ascending])
SortTableWorkspace(InputWorkspace=self.ws, OutputWorkspace=self.ws, Columns=column_name,
Ascending=sort_ascending)
......@@ -56,7 +56,7 @@ class TableWorkspaceDisplay(ObservingPresenter):
"""
self.model = model if model else TableWorkspaceDisplayModel(ws)
self.name = self.model.get_name() if name is None else name
self.name = name if name else self.model.get_name()
self.view = view if view else TableWorkspaceDisplayView(self, parent, self.name)
self.parent = parent
self.plot = plot
......@@ -83,6 +83,9 @@ class TableWorkspaceDisplay(ObservingPresenter):
def replace_workspace(self, workspace_name, workspace):
if self.model.workspace_equals(workspace_name):
self.model = TableWorkspaceDisplayModel(workspace)
# block signals to prevent triggering of handleItemChanged event
# which causes an infinite recursion and a stack overflow error
self.view.blockSignals(True)
self.load_data(self.view)
self.view.emit_repaint()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment