Skip to content

Commit ebe5460

Browse files
committed
make initial view the currentview and always create a default view
1 parent 8825405 commit ebe5460

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

openmc_plotter/plotmodel.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def __init__(self, use_settings_pkl):
144144
self.previousViews = []
145145
self.subsequentViews = []
146146

147+
self.defaultView = self.getDefaultView()
148+
147149
if use_settings_pkl and os.path.isfile('plot_settings.pkl'):
148150
with open('plot_settings.pkl', 'rb') as file:
149151
try:
@@ -156,7 +158,7 @@ def __init__(self, use_settings_pkl):
156158
msg_box.setIcon(QMessageBox.Warning)
157159
msg_box.setStandardButtons(QMessageBox.Ok)
158160
msg_box.exec_()
159-
self.defaultView = self.getDefaultView()
161+
self.currentView = copy.deepcopy(self.defaultView)
160162

161163
else:
162164
restore_domains = False
@@ -191,14 +193,13 @@ def __init__(self, use_settings_pkl):
191193
msg_box.exec_()
192194
self.statepoint = None
193195

194-
self.defaultView = PlotView(restore_view=view,
196+
self.currentView = PlotView(restore_view=view,
195197
restore_domains=restore_domains)
196198

197199
else:
198-
self.defaultView = self.getDefaultView()
200+
self.currentView = copy.deepcopy(self.defaultView)
199201

200-
self.currentView = copy.deepcopy(self.defaultView)
201-
self.activeView = copy.deepcopy(self.defaultView)
202+
self.activeView = copy.deepcopy(self.currentView)
202203

203204
def openStatePoint(self, filename):
204205
self.statepoint = StatePointModel(filename, open_file=True)

0 commit comments

Comments
 (0)