summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchTreeWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-22 03:08:06 +0000
committerDavid Robillard <d@drobilla.net>2011-10-22 03:08:06 +0000
commitac1d6d135bda8d739fdb8bf564f89c38b664c097 (patch)
treed750da79dd88b64ab2a88cca1651c2a5a240bd72 /src/gui/PatchTreeWindow.cpp
parent143968e38cc2f058dd7c500e984904a39864d652 (diff)
downloadingen-ac1d6d135bda8d739fdb8bf564f89c38b664c097.tar.gz
ingen-ac1d6d135bda8d739fdb8bf564f89c38b664c097.tar.bz2
ingen-ac1d6d135bda8d739fdb8bf564f89c38b664c097.zip
De-singleton-ify GUI.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3584 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/PatchTreeWindow.cpp')
-rw-r--r--src/gui/PatchTreeWindow.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp
index 0c75dd6a..c728fd2b 100644
--- a/src/gui/PatchTreeWindow.cpp
+++ b/src/gui/PatchTreeWindow.cpp
@@ -37,6 +37,7 @@ namespace GUI {
PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml)
: Window(cobject)
+ , _app(NULL)
, _enable_signal(true)
{
xml->get_widget_derived("patches_treeview", _patches_treeview);
@@ -68,8 +69,9 @@ PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject,
}
void
-PatchTreeWindow::init(ClientStore& store)
+PatchTreeWindow::init(App& app, ClientStore& store)
{
+ _app = &app;
store.signal_new_object().connect(
sigc::mem_fun(this, &PatchTreeWindow::new_object));
}
@@ -89,7 +91,7 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm)
Gtk::TreeModel::iterator iter = _patch_treestore->append();
Gtk::TreeModel::Row row = *iter;
if (pm->path().is_root()) {
- row[_patch_tree_columns.name_col] = App::instance().engine()->uri().str();
+ row[_patch_tree_columns.name_col] = _app->engine()->uri().str();
} else {
row[_patch_tree_columns.name_col] = pm->symbol().c_str();
}
@@ -170,7 +172,7 @@ PatchTreeWindow::event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::Tr
Gtk::TreeModel::Row row = *active;
SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col];
- App::instance().window_factory()->present_patch(pm);
+ _app->window_factory()->present_patch(pm);
}
void
@@ -184,15 +186,15 @@ PatchTreeWindow::event_patch_enabled_toggled(const Glib::ustring& path_str)
assert(pm);
if (_enable_signal)
- App::instance().engine()->set_property(pm->path(),
- App::instance().uris().ingen_enabled, (bool)!pm->enabled());
+ _app->engine()->set_property(pm->path(),
+ _app->uris().ingen_enabled, (bool)!pm->enabled());
}
void
PatchTreeWindow::patch_property_changed(const URI& key, const Atom& value,
SharedPtr<PatchModel> patch)
{
- const URIs& uris = App::instance().uris();
+ const URIs& uris = _app->uris();
_enable_signal = false;
if (key == uris.ingen_enabled && value.type() == Atom::BOOL) {
Gtk::TreeModel::iterator i = find_patch(_patch_treestore->children(), patch);