return false;
}
-bool
+Instance::Status
studio::Instance::save()
{
// 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)
- return dialog_save_as();
+ if (dialog_save_as())
+ return STATUS_OK;
+ else
+ return STATUS_CANCEL;
- return synfigapp::Instance::save();
+ if (synfigapp::Instance::save())
+ return STATUS_OK;
+ else
+ return STATUS_ERROR;
}
bool
string str=strprintf(_("Would you like to save your changes to %s?"),basename(get_file_name()).c_str() );
int answer=uim->yes_no_cancel(get_canvas()->get_name(),str,synfigapp::UIInterface::RESPONSE_YES);
if(answer==synfigapp::UIInterface::RESPONSE_YES)
- if (save()) break;
+ {
+ enum Status status = save();
+ if (status == STATUS_OK) break;
+ else if (status == STATUS_CANCEL) return false;
+ }
if(answer==synfigapp::UIInterface::RESPONSE_NO)
break;
if(answer==synfigapp::UIInterface::RESPONSE_CANCEL)
public:
typedef std::list< etl::handle<CanvasView> > CanvasViewList;
+ enum Status
+ {
+ STATUS_OK,
+ STATUS_ERROR,
+ STATUS_CANCEL
+ };
+
class CanvasTreeModel : public Gtk::TreeModel::ColumnRecord
{
public:
//! returns true if the save was successful
bool dialog_save_as();
- bool save();
+ Status save();
void dialog_cvs_commit();
return;
}
- if(!studio::App::get_selected_instance()->save())
+ if(studio::App::get_selected_instance()->save() == studio::Instance::STATUS_ERROR)
App::dialog_error_blocking("Save - Error","Unable to save file");
}