diff options
author | David Robillard <d@drobilla.net> | 2008-06-09 21:48:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-06-09 21:48:32 +0000 |
commit | 43dc73756cf97b4e4bc2ebdec59f3cb15f99750b (patch) | |
tree | ebc539b2636fc36a83349d95a1358158e008a300 | |
parent | 4300b61b1c32ff14ac0e77e003ac52aa8f8c8266 (diff) | |
download | ingen-43dc73756cf97b4e4bc2ebdec59f3cb15f99750b.tar.gz ingen-43dc73756cf97b4e4bc2ebdec59f3cb15f99750b.tar.bz2 ingen-43dc73756cf97b4e4bc2ebdec59f3cb15f99750b.zip |
Fix prompting for filename when patch is loaded from command line.
git-svn-id: http://svn.drobilla.net/lad/ingen@1264 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/libs/gui/LoadPatchWindow.cpp | 5 | ||||
-rw-r--r-- | src/libs/gui/PatchWindow.cpp | 2 | ||||
-rw-r--r-- | src/libs/serialisation/Loader.cpp | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/libs/gui/LoadPatchWindow.cpp b/src/libs/gui/LoadPatchWindow.cpp index 57ae1536..398eaf1f 100644 --- a/src/libs/gui/LoadPatchWindow.cpp +++ b/src/libs/gui/LoadPatchWindow.cpp @@ -127,11 +127,8 @@ LoadPatchWindow::ok_clicked() if (_poly_from_user_radio->get_active()) _initial_data.insert(make_pair("ingen:polyphony", _poly_spinbutton->get_value_as_int())); - if (_replace) { + if (_replace) App::instance().engine()->clear_patch(_patch->path()); - App::instance().engine()->set_variable(_patch->path(), "ingen:document", - Atom(get_uri().c_str())); - } if (_patch->path() != "/") parent = _patch->path().parent(); diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index 865cc9eb..9367f2d7 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -366,8 +366,6 @@ PatchWindow::event_save_as() if (confirm) { App::instance().loader()->save_patch(_patch, filename); - App::instance().engine()->set_variable(_patch->path(), "ingen:document", - Atom(Glib::filename_to_uri(filename).c_str())); } } App::instance().configuration()->set_patch_folder(dialog.get_current_folder()); diff --git a/src/libs/serialisation/Loader.cpp b/src/libs/serialisation/Loader.cpp index 88b0a6a3..84b935d9 100644 --- a/src/libs/serialisation/Loader.cpp +++ b/src/libs/serialisation/Loader.cpp @@ -114,6 +114,10 @@ Loader::load(SharedPtr<EngineInterface> engine, if (patch_path != "/") engine->create_patch(patch_path, patch_poly); + + /* Set document metadata (so File->Save doesn't prompt) + * FIXME: This needs some thinking for multiple clients... */ + engine->set_variable(patch_path, "ingen:document", Atom(document_uri.c_str())); /* Load (plugin) nodes */ |