From d5cc3f720e50583f172425fbebf401e6be0c8b78 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 15 May 2008 00:43:05 +0000 Subject: Show error messages from engine in a pop-up dialog. Don't attempt to create root patch when loading deprecated (.om) patches. git-svn-id: http://svn.drobilla.net/lad/ingen@1208 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/DeprecatedLoader.cpp | 2 +- src/libs/client/Store.cpp | 4 ++-- src/libs/gui/App.cpp | 17 +++++++++++++++-- src/libs/gui/App.hpp | 1 + 4 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src/libs') diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index b193c86f..ffe9da14 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -221,7 +221,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, poly = 1; // Create it, if we're not merging - if (!existing) { + if (!existing && path != "/") { _engine->create_patch(path, poly); for (GraphObject::Variables::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) _engine->set_variable(path, i->first, i->second); diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 60c03049..b679b01a 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -33,8 +33,8 @@ namespace Client { Store::Store(SharedPtr engine, SharedPtr emitter) -: _engine(engine) -, _emitter(emitter) + : _engine(engine) + , _emitter(emitter) { emitter->signal_object_destroyed.connect(sigc::mem_fun(this, &Store::destruction_event)); emitter->signal_object_renamed.connect(sigc::mem_fun(this, &Store::rename_event)); diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index 46737d01..8b3013ad 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -186,6 +186,9 @@ App::attach(SharedPtr engine, SharedPtr cli _loader = SharedPtr(new ThreadedLoader(engine)); _patch_tree_window->init(*_store); + + _client->signal_response_error.connect(sigc::mem_fun(this, &App::error_response)); + _client->signal_error.connect(sigc::mem_fun(this, &App::error_message)); } @@ -204,12 +207,22 @@ App::detach() } +void +App::error_response(int32_t id, const string& str) +{ + error_message(str); +} + + void App::error_message(const string& str) { _messages_window->post(str); - _messages_window->show(); - _messages_window->raise(); + + if (!_messages_window->is_visible()) + _messages_window->present(); + + _messages_window->set_urgency_hint(true); } diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp index bfe58f53..6bb7083b 100644 --- a/src/libs/gui/App.hpp +++ b/src/libs/gui/App.hpp @@ -136,6 +136,7 @@ protected: App(Ingen::Shared::World* world); bool animate(); + void error_response(int32_t id, const string& str); static void* icon_destroyed(void* data); -- cgit v1.2.1