When doing a 'Save As', default to saving in the same directory that the file was...
[synfig.git] / synfig-studio / trunk / src / gtkmm / instance.cpp
index f0451ad..8ac71f2 100644 (file)
@@ -54,6 +54,7 @@
 #include "iconcontroller.h"
 #include <sys/stat.h>
 #include <errno.h>
+#include <ETL/stringf>
 
 #include "general.h"
 
@@ -210,10 +211,12 @@ studio::Instance::save()
        // 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)
+       {
                if (dialog_save_as())
                        return STATUS_OK;
                else
                        return STATUS_CANCEL;
+       }
 
        if (synfigapp::Instance::save())
                return STATUS_OK;
@@ -254,6 +257,9 @@ studio::Instance::dialog_save_as()
                }
        }
 
+       if (get_file_name().find(DEFAULT_FILENAME_PREFIX) != 0)
+               filename = absolute_path(filename);
+
        // show the canvas' name if it has one, else its ID
        while (App::dialog_save_file((_("Choose a Filename to Save As") +
                                                                  String(" (") +
@@ -696,8 +702,8 @@ Instance::add_actions_to_group(const Glib::RefPtr<Gtk::ActionGroup>& action_grou
 
        candidate_list.sort();
 
-       if(candidate_list.empty())
-               synfig::warning("%s:%d Action CandidateList is empty!", __FILE__, __LINE__);
+       // if(candidate_list.empty())
+       //      synfig::warning("%s:%d Action CandidateList is empty!", __FILE__, __LINE__);
 
        for(iter=candidate_list.begin();iter!=candidate_list.end();++iter)
        {