Skip to content

Commit

Permalink
fix load_file so cancel does not break reload
Browse files Browse the repository at this point in the history
also is_filedialog_open guard was not needed
  • Loading branch information
paroj committed Apr 19, 2024
1 parent 0dfe840 commit c01afeb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ogre_mesh_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def __init__(self, app):
self.show_metrics = False
self.show_render_settings = False
self.side_panel_visible = True
self.is_filedialog_open = False

self.app = app

Expand Down Expand Up @@ -202,12 +201,11 @@ def draw_loading(self):
ImGui.End()

def load_file(self):
# Avoid recursive calling, which might block the window manager
if self.is_filedialog_open:
infile = askopenfilename(app.filedir)
if not infile:
return
self.is_filedialog_open = True
app.infile = askopenfilename(app.filedir)
self.is_filedialog_open = False

app.infile = infile
app.reload()

def preRenderTargetUpdate(self, evt):
Expand Down

0 comments on commit c01afeb

Please sign in to comment.