summaryrefslogtreecommitdiffstats
path: root/src/progs/ingenuity/App.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs/ingenuity/App.cpp')
-rw-r--r--src/progs/ingenuity/App.cpp65
1 files changed, 16 insertions, 49 deletions
diff --git a/src/progs/ingenuity/App.cpp b/src/progs/ingenuity/App.cpp
index 6470a807..00f4cee4 100644
--- a/src/progs/ingenuity/App.cpp
+++ b/src/progs/ingenuity/App.cpp
@@ -57,9 +57,7 @@ App* App::_instance = 0;
App::App()
-: _store(NULL),
- _loader(NULL),
- _configuration(new Configuration()),
+: _configuration(new Configuration()),
_about_dialog(NULL),
_window_factory(new WindowFactory()),
_enable_signal(true)
@@ -99,14 +97,27 @@ App::attach(const SharedPtr<ModelEngineInterface>& engine, const SharedPtr<SigCl
_engine = engine;
_client = client;
- _store = new Store(engine, client);
- _loader = new ThreadedLoader(engine);
+ _store = SharedPtr<Store>(new Store(engine, client));
+ _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(engine));
_patch_tree_window->init(*_store);
}
void
+App::detach()
+{
+ _window_factory->clear();
+ _store->clear();
+
+ _loader.reset();
+ _store.reset();
+ _client.reset();
+ _engine.reset();
+}
+
+
+void
App::error_message(const string& str)
{
_messages_window->post(str);
@@ -207,50 +218,6 @@ App::event_save_session_as()
}
#endif
-void
-App::add_patch_window(PatchWindow* pw)
-{
- _windows.push_back(pw);
-}
-
-
-void
-App::remove_patch_window(PatchWindow* pw)
-{
- _windows.erase(find(_windows.begin(), _windows.end(), pw));
-}
-
-
-/** Returns the number of Patch windows currently visible.
- */
-int
-App::num_open_patch_windows()
-{
- int ret = 0;
- for (list<PatchWindow*>::iterator i = _windows.begin(); i != _windows.end(); ++i)
- if ((*i)->is_visible())
- ++ret;
-
- return ret;
-}
-
-
-void
-App::disconnect()
-{
- // FIXME: this is pretty gross.. figure out the death situation better
-
- list<PatchWindow*> windows = _windows; // make a copy
-
- for (list<PatchWindow*>::iterator i = windows.begin(); i != windows.end(); ++i)
- delete (*i);
-
- _store->clear();
-
- // PatchWindow destructor removes them from the list
- assert(_windows.size() == 0);
-}
-
void
App::quit()