diff options
author | David Robillard <d@drobilla.net> | 2008-08-18 06:26:24 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-18 06:26:24 +0000 |
commit | 76466bde179e9b0d58b1586fb3f4ed40dedbdc13 (patch) | |
tree | dff00bee8eed5787d7cb0466a539acd853423293 /src/libs/gui | |
parent | 640cbadb284544ecc876ae650c1c945c57adcce8 (diff) | |
download | ingen-76466bde179e9b0d58b1586fb3f4ed40dedbdc13.tar.gz ingen-76466bde179e9b0d58b1586fb3f4ed40dedbdc13.tar.bz2 ingen-76466bde179e9b0d58b1586fb3f4ed40dedbdc13.zip |
Fix loading / importing patches at root and in subpatches.
git-svn-id: http://svn.drobilla.net/lad/ingen@1430 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r-- | src/libs/gui/LoadPatchWindow.cpp | 5 | ||||
-rw-r--r-- | src/libs/gui/PatchCanvas.cpp | 10 | ||||
-rw-r--r-- | src/libs/gui/ThreadedLoader.cpp | 18 |
3 files changed, 27 insertions, 6 deletions
diff --git a/src/libs/gui/LoadPatchWindow.cpp b/src/libs/gui/LoadPatchWindow.cpp index 4a86515a..2f3b6af7 100644 --- a/src/libs/gui/LoadPatchWindow.cpp +++ b/src/libs/gui/LoadPatchWindow.cpp @@ -129,8 +129,9 @@ LoadPatchWindow::ok_clicked() if (_replace) App::instance().engine()->clear_patch(_patch->path()); - if (_patch->path() != "/") - parent = _patch->path().parent(); + //if (_patch->path() != "/") + // parent = _patch->path().parent(); + parent = _patch->path(); _patch.reset(); hide(); diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp index 135a28c8..2ea4496c 100644 --- a/src/libs/gui/PatchCanvas.cpp +++ b/src/libs/gui/PatchCanvas.cpp @@ -58,7 +58,9 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height) , _last_click_x(0) , _last_click_y(0) , _refresh_menu(false) + , _menu(NULL) , _internal_menu(NULL) + , _plugin_menu(NULL) { Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference(); xml->get_widget("canvas_menu", _menu); @@ -590,7 +592,7 @@ PatchCanvas::paste() ClashAvoider avoider(*App::instance().store().get(), _patch->path(), clipboard); //parser->parse_string(App::instance().world(), &avoider, str, _patch->path().base()); parser->parse_string(App::instance().world(), &avoider, str, "/", - boost::optional<Glib::ustring>(), _patch->path()); + boost::optional<Glib::ustring>(), (Glib::ustring)_patch->path()); for (Store::iterator i = clipboard.begin(); i != clipboard.end(); ++i) { if (_patch->path() == "/" && i->first == "/") { @@ -616,9 +618,13 @@ PatchCanvas::paste() builder.build(_patch->path(), i->second); } + //avoider.set_target(*App::instance().engine()); + for (ClientStore::ConnectionRecords::const_iterator i = clipboard.connection_records().begin(); - i != clipboard.connection_records().end(); ++i) + i != clipboard.connection_records().end(); ++i) { + cout << "CONNECTING " << i->first << " -> " << i->second << endl; App::instance().engine()->connect(i->first, i->second); + } } diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp index 88dd4b1a..86c4ea1c 100644 --- a/src/libs/gui/ThreadedLoader.cpp +++ b/src/libs/gui/ThreadedLoader.cpp @@ -100,13 +100,27 @@ ThreadedLoader::load_patch(bool merge, engine_data, false))); } else { + Glib::ustring engine_base = ""; + if (engine_parent) { + if (merge) + engine_base = engine_parent.get(); + else + engine_base = engine_parent.get().base(); + } + + cout << "ENGINE BASE 1: " << engine_base << endl; + if (merge && engine_parent.get() == "/" || !engine_parent) + engine_base = engine_base.substr(0, engine_base.find_last_of("/")); + + cout << "ENGINE BASE: " << engine_base << endl; + cout << "PARENT: " << (engine_parent ? (string)engine_parent.get() : "NONE") << endl; _events.push_back(sigc::hide_return(sigc::bind( sigc::mem_fun(_parser.get(), &Ingen::Serialisation::Parser::parse_document), App::instance().world(), App::instance().world()->engine.get(), data_base_uri, // document - data_base_uri, // patch (root of document) - engine_parent, + data_base_uri + data_path.substr(1), // object URI document + engine_base, engine_symbol, engine_data))); } |