From 72a21b5dbe82ac726f4d7a4308601d802001d9c0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Apr 2007 03:46:40 +0000 Subject: Serialization (both saving and restoring) of nested patches. Serialization of patch (float) metadata. Removed useless cruft from Save dialog. Remember filename on save to avoid save as next time. git-svn-id: http://svn.drobilla.net/lad/ingen@437 a436a847-0d15-0410-975c-d299462d15a1 --- src/progs/ingenuity/PatchWindow.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/progs') diff --git a/src/progs/ingenuity/PatchWindow.cpp b/src/progs/ingenuity/PatchWindow.cpp index 22305247..ddcccf10 100644 --- a/src/progs/ingenuity/PatchWindow.cpp +++ b/src/progs/ingenuity/PatchWindow.cpp @@ -267,16 +267,18 @@ PatchWindow::event_save_as() { Gtk::FileChooserDialog dialog(*this, "Save Patch", Gtk::FILE_CHOOSER_ACTION_SAVE); - Gtk::VBox* box = dialog.get_vbox(); + /*Gtk::VBox* box = dialog.get_vbox(); Gtk::Label warning("Warning: Recursively saving will overwrite any subpatch files \ without confirmation."); box->pack_start(warning, false, false, 2); Gtk::CheckButton recursive_checkbutton("Recursively save all subpatches"); box->pack_start(recursive_checkbutton, false, false, 0); recursive_checkbutton.show(); + */ dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + Gtk::Button* save_button = dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + save_button->property_has_default() = true; // Set current folder to most sensible default const string& current_filename = _patch->filename(); @@ -286,7 +288,7 @@ PatchWindow::event_save_as() dialog.set_current_folder(App::instance().configuration()->patch_folder()); int result = dialog.run(); - bool recursive = recursive_checkbutton.get_active(); + //bool recursive = recursive_checkbutton.get_active(); assert(result == Gtk::RESPONSE_OK || result == Gtk::RESPONSE_CANCEL || result == Gtk::RESPONSE_NONE); @@ -313,8 +315,9 @@ PatchWindow::event_save_as() fin.close(); if (confirm) { - App::instance().loader()->save_patch(_patch, filename, recursive); - //m_patch->set_metadata("filename", Atom(filename.c_str())); + App::instance().loader()->save_patch(_patch, filename, true); + _patch->set_filename(filename); + //_patch->set_metadata("filename", Atom(filename.c_str())); } } App::instance().configuration()->set_patch_folder(dialog.get_current_folder()); -- cgit v1.2.1