Commit d27855e9 authored by VIGNET Pierre's avatar VIGNET Pierre

Default name for output files is based on the current model name => time saving

parent 048c40ba
......@@ -569,6 +569,7 @@ class Charter(object):
"""
# open an independant gtk.Entry for asking for the name
die = DialogEntry("Insert a model name")
die.entry.set_text("default_name")
die.okb.connect("clicked", self.ok_new_text, die)
die.cancel.connect("clicked", self.cancel, die)
die.run()
......@@ -593,7 +594,10 @@ class Charter(object):
"""
open a window to save as xml file
"""
fch = FileChooser("Export to xml", "bcx files", "*.bcx")
if not self.current_edit_mvc:
return
fch = FileChooser("Export to Cadbiom model", "bcx files", "*.bcx")
fch.set_current_name(self.current_edit_mvc.model.name + ".bcx")
fch.do_action(self.create_xml_file)
......@@ -688,7 +692,10 @@ class Charter(object):
"""
Export to CadLang
"""
if not self.current_edit_mvc:
return
fch = FileChooser("Export to Cadbiom-chart lang", "cadbiom-l", "*.cal")
fch.set_current_name(self.current_edit_mvc.model.name + ".cal")
fch.do_action(self.compile_to_lang)
def compile_to_lang(self, file_name):
......@@ -724,7 +731,10 @@ class Charter(object):
"""
Export a picture (png,jpg) of the current model
"""
if not self.current_edit_mvc:
return
fch = FileChooser("Export picture", "pictures", "*.png")
fch.set_current_name(self.current_edit_mvc.model.name + ".png")
fch.get_filter().add_pattern("*.png")
fch.do_action(self.export_picture_to_file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment