Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0.4 Project Load Fix #1774

Merged
merged 3 commits into from
Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def addFit(self, data, is_batch=False, tab_index=None):
self.tabs.append(tab)
if data:
self.updateFitDict(data, tab_name)
self.maxIndex = tab_index + 1
self.maxIndex = max([tab.tab_id for tab in self.tabs], default=0) + 1

icon = QtGui.QIcon()
if is_batch:
Expand Down Expand Up @@ -409,9 +409,10 @@ def setData(self, data_item=None, is_batch=False, tab_index=None):
# Find the first unassigned tab.
# If none, open a new tab.
available_tabs = [tab.acceptsData() for tab in self.tabs]
tab_ids = [tab.tab_id for tab in self.tabs]

if tab_index is not None:
if tab_index >= self.maxIndex:
if tab_index not in tab_ids:
self.addFit(data, is_batch=is_batch, tab_index=tab_index)
else:
self.setCurrentIndex(tab_index-1)
Expand Down