summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-16 23:11:54 +0000
committerDavid Robillard <d@drobilla.net>2008-11-16 23:11:54 +0000
commit89ebed9d01c1851ca003f6e01d963b1940da9cf9 (patch)
treefe60a90dc8597898e1757b4a0ea3792a76d515c7 /src/gui/PatchWindow.cpp
parent001eb2b49a2a0127bde1fea4db6c0f976b838584 (diff)
downloadingen-89ebed9d01c1851ca003f6e01d963b1940da9cf9.tar.gz
ingen-89ebed9d01c1851ca003f6e01d963b1940da9cf9.tar.bz2
ingen-89ebed9d01c1851ca003f6e01d963b1940da9cf9.zip
Remember patch save file location in client (fix ticket #239).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1741 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/PatchWindow.cpp')
-rw-r--r--src/gui/PatchWindow.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index d7499bfb..13413b5c 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -324,10 +324,12 @@ void
PatchWindow::event_save()
{
GraphObject::Variables::const_iterator doc = _patch->variables().find("ingen:document");
- if (doc == _patch->variables().end())
+ if (doc == _patch->variables().end()) {
event_save_as();
- else
- App::instance().loader()->save_patch(_patch, doc->second.get_string());
+ } else {
+ const Glib::ustring& filename = Glib::filename_from_uri(doc->second.get_string());
+ App::instance().loader()->save_patch(_patch, filename);
+ }
}
@@ -336,15 +338,6 @@ PatchWindow::event_save_as()
{
Gtk::FileChooserDialog dialog(*this, "Save Patch", Gtk::FILE_CHOOSER_ACTION_SAVE);
- /*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);
Gtk::Button* save_button = dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
save_button->property_has_default() = true;
@@ -363,7 +356,7 @@ PatchWindow::event_save_as()
string filename = dialog.get_filename();
if (filename.length() < 11 || filename.substr(filename.length()-10) != ".ingen.ttl")
filename += ".ingen.ttl";
-
+
bool confirm = false;
std::fstream fin;
fin.open(filename.c_str(), std::ios::in);
@@ -383,6 +376,7 @@ PatchWindow::event_save_as()
if (confirm) {
App::instance().loader()->save_patch(_patch, filename);
+ _patch->set_variable("ingen:document", Atom(Glib::filename_to_uri(filename).c_str()));
}
}
App::instance().configuration()->set_patch_folder(dialog.get_current_folder());