Added default file name
This commit is contained in:
parent
d4f8b0b59a
commit
b7a187e97a
|
|
@ -441,7 +441,7 @@ def save_file(widget=None):
|
||||||
tarinfo = tarfile.TarInfo('basefile')
|
tarinfo = tarfile.TarInfo('basefile')
|
||||||
tarinfo.size = len(data)
|
tarinfo.size = len(data)
|
||||||
if svlgui.FILE.name.startswith(svlgui.TEMPDIR):
|
if svlgui.FILE.name.startswith(svlgui.TEMPDIR):
|
||||||
thetarfile = tarfile.open(fileobj=svlgui.file_dialog("save").open('wb'),mode="w:gz")
|
thetarfile = tarfile.open(fileobj=svlgui.file_dialog("save", name="untitled.beam").open('wb'),mode="w:gz")
|
||||||
print thetarfile.name
|
print thetarfile.name
|
||||||
else:
|
else:
|
||||||
thetarfile = tarfile.open(svlgui.FILE.name,mode="w:gz")
|
thetarfile = tarfile.open(svlgui.FILE.name,mode="w:gz")
|
||||||
|
|
|
||||||
|
|
@ -301,8 +301,8 @@ if SYSTEM=="osx":
|
||||||
class Lightningbeam(GUI.Application):
|
class Lightningbeam(GUI.Application):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GUI.Application.__init__(self)
|
GUI.Application.__init__(self)
|
||||||
self.file_type = FileType(name = "Untitled Document", suffix = "changethis",
|
self.file_type = FileType(name = "Untitled Document", suffix = "beam",
|
||||||
mac_creator = "BLBE", mac_type = "BLOB"), # These are optional)
|
mac_creator = "LNBM", mac_type = "BEAM"), # These are optional)
|
||||||
def setup_menus(self, m):
|
def setup_menus(self, m):
|
||||||
m.about_cmd.enabled = 1
|
m.about_cmd.enabled = 1
|
||||||
m.quit_cmd.enabled = 1
|
m.quit_cmd.enabled = 1
|
||||||
|
|
@ -2622,7 +2622,7 @@ def alert(text,critical=False,confirm=False,async=False):
|
||||||
# reloading the page is equivalent to force-quitting, right?
|
# reloading the page is equivalent to force-quitting, right?
|
||||||
jscommunicate("window.location.reload()")
|
jscommunicate("window.location.reload()")
|
||||||
|
|
||||||
def file_dialog(mode="open",default=None,types=None,multiple=False):
|
def file_dialog(mode="open",default=None,types=None,multiple=False,name=None):
|
||||||
if SYSTEM=="osx":
|
if SYSTEM=="osx":
|
||||||
if types:
|
if types:
|
||||||
ntypes = []
|
ntypes = []
|
||||||
|
|
@ -2642,7 +2642,7 @@ def file_dialog(mode="open",default=None,types=None,multiple=False):
|
||||||
else:
|
else:
|
||||||
return FileDialogs.request_old_file(default_dir=default,file_types=types)
|
return FileDialogs.request_old_file(default_dir=default,file_types=types)
|
||||||
elif mode=="save":
|
elif mode=="save":
|
||||||
return FileDialogs.request_new_file(default_dir=default,file_type=types)
|
return FileDialogs.request_new_file(default_name=name,default_dir=default,file_type=types)
|
||||||
|
|
||||||
def execute(command):
|
def execute(command):
|
||||||
rv = os.system(command.replace("/",sep))
|
rv = os.system(command.replace("/",sep))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue