Handle cancels of imports gracefully
This commit is contained in:
@@ -629,7 +629,11 @@ def save_file_as(widget=None):
|
|||||||
svlgui.FILE = thetarfile
|
svlgui.FILE = thetarfile
|
||||||
pass
|
pass
|
||||||
def import_to_stage(widget=None):
|
def import_to_stage(widget=None):
|
||||||
|
try:
|
||||||
thefile = svlgui.file_dialog("open",None,["jpg","png","bmp","wav"]).path
|
thefile = svlgui.file_dialog("open",None,["jpg","png","bmp","wav"]).path
|
||||||
|
except AttributeError:
|
||||||
|
# User cancelled
|
||||||
|
return
|
||||||
for i in ("jpg","png","bmp"):
|
for i in ("jpg","png","bmp"):
|
||||||
if thefile.endswith(i):
|
if thefile.endswith(i):
|
||||||
# im = svlgui.Image(thefile)
|
# im = svlgui.Image(thefile)
|
||||||
|
|||||||
Reference in New Issue
Block a user