Handle cancels of imports gracefully
This commit is contained in:
parent
3354775a9a
commit
ec0a4a5d4b
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue