The "SaveAs" feature was saving the image even if the filename field was leaved empty, because it was automatically adding the format suffix.

The SaveAsDialog is now most secured too: no empty filename field is allowed when pressing OK.
This commit is contained in:
Hombre
2011-08-09 23:24:14 +02:00
parent aac3be6386
commit 613f8308a3
3 changed files with 24 additions and 3 deletions

View File

@@ -974,10 +974,12 @@ void EditorPanel::saveAsPressed () {
saveAsDialog->setInitialFileName (removeExtension (Glib::path_get_basename (openThm->getFileName())));
do {
saveAsDialog->run ();
fname = saveAsDialog->getFileName ();
if (fname=="")
if (saveAsDialog->getResponse()==Gtk::RESPONSE_CANCEL)
return;
// The SaveAsDialog ensure that a filename has been specified
fname = saveAsDialog->getFileName ();
options.lastSaveAsPath = saveAsDialog->getDirectory ();
options.saveAsDialogWidth = saveAsDialog->get_width();
options.saveAsDialogHeight = saveAsDialog->get_height();