Added a new valuenode type for real values: 'Exponent'. Given a real value, it sets...
[synfig.git] / synfig-studio / trunk / src / gtkmm / app.cpp
index d004654..075d440 100644 (file)
@@ -757,7 +757,7 @@ init_ui_manager()
        DEFINE_ACTION("quality-09", _("Use Quality Level 9"));
        DEFINE_ACTION("quality-10", _("Use Quality Level 10"));
        DEFINE_ACTION("play", _("Play"));
-       DEFINE_ACTION("pause", _("Pause"));
+       // DEFINE_ACTION("pause", _("Pause"));
        DEFINE_ACTION("stop", _("Stop"));
        DEFINE_ACTION("toggle-grid-show", _("Toggle Grid Show"));
        DEFINE_ACTION("toggle-grid-snap", _("Toggle Grid Snap"));
@@ -885,7 +885,7 @@ init_ui_manager()
 "              </menu>"
 "              <separator name='bleh08'/>"
 "              <menuitem action='play'/>"
-"              <menuitem action='pause'/>"
+//"            <menuitem action='pause'/>"
 "              <menuitem action='stop'/>"
 "              <menuitem action='dialog-flipbook'/>"
 "              <separator name='bleh09'/>"
@@ -1040,6 +1040,7 @@ init_ui_manager()
        ACCEL2(Gtk::AccelKey('>',Gdk::CONTROL_MASK,"<Actions>//seek-next-second"));
        ACCEL2(Gtk::AccelKey('<',Gdk::CONTROL_MASK,"<Actions>//seek-prev-second"));
        ACCEL2(Gtk::AccelKey('o',Gdk::CONTROL_MASK,"<Actions>//toggle-onion-skin"));
+       ACCEL("<Actions>//play",              "<Control>p");
        ACCEL("<Actions>//seek-begin","Home");
        ACCEL("<Actions>//seek-end","End");
 
@@ -1806,6 +1807,7 @@ App::dialog_save_file(const std::string &title, std::string &filename)
        if(GetSaveFileName(&ofn))
        {
                filename=szFilename;
+               _preferences.set_value("curr_path",dirname(filename));
                return true;
        }
        return false;
@@ -1820,13 +1822,24 @@ App::dialog_save_file(const std::string &title, std::string &filename)
     dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
     dialog->add_button(Gtk::Stock::SAVE,   Gtk::RESPONSE_ACCEPT);
     if(!filename.empty())
+       {
+               std::string full_path;
                if (is_absolute_path(filename))
-                       dialog->set_filename(filename);
+                       full_path = filename;
                else
-                       dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename);
+                       full_path = prev_path + ETL_DIRECTORY_SEPARATOR + filename;
+               // select the file if it exists
+               dialog->set_filename(full_path);
+
+               // if the file doesn't exist, put its name into the filename box
+               struct stat s;
+               if(stat(full_path.c_str(),&s) == -1 && errno == ENOENT)
+                       dialog->set_current_name(basename(filename));
+       }
     if(dialog->run()==GTK_RESPONSE_ACCEPT) {
         filename=dialog->get_filename();
         delete dialog;
+               _preferences.set_value("curr_path",dirname(filename));
         return true;
     }
     delete dialog;
@@ -1997,9 +2010,9 @@ void
 App::new_instance()
 {
        handle<synfig::Canvas> canvas=synfig::Canvas::create();
-       canvas->set_name(strprintf("Untitled%d",Instance::get_count()));
+       canvas->set_name(strprintf("%s%d", DEFAULT_FILENAME_PREFIX, Instance::get_count()+1));
 
-       String file_name(strprintf("untitled%d.sif",Instance::get_count()));
+       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);