App::new_instance()
{
handle<synfig::Canvas> canvas=synfig::Canvas::create();
- canvas->set_name(strprintf("Synfig Animation %d",Instance::get_count()+1));
+ canvas->set_name(strprintf("%s%d", DEFAULT_FILENAME_PREFIX, Instance::get_count()+1));
- String file_name(strprintf("Synfig Animation %d.sifz",Instance::get_count()+1));
+ String file_name(strprintf("%s%d.sifz", DEFAULT_FILENAME_PREFIX, Instance::get_count()+1));
canvas->rend_desc().set_frame_rate(24.0);
canvas->rend_desc().set_time_start(0.0);
bool
studio::Instance::save()
{
- if(basename(get_file_name()).find("Synfig Animation")==0)
+ // the filename will be set to "Synfig Animation 1" or some such when first created
+ // and will be changed to an absolute path once it has been saved
+ // so if it still begins with "Synfig Animation " then we need to ask where to save it
+ if(get_file_name().find(DEFAULT_FILENAME_PREFIX)==0)
{
dialog_save_as();
return true;
}
return synfigapp::Instance::save();
-
}
void
#include <synfig/canvas.h>
/* === M A C R O S ========================================================= */
+#define DEFAULT_FILENAME_PREFIX _("Synfig Animation ") // will be followed by a different number for each document
/* === T Y P E D E F S ===================================================== */