From 3b257a6a2f81c677cab83111051a79c5c3d5307f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 21 Nov 2012 18:45:38 +0000 Subject: Move human name and port label options to main configuration. This makes it possible to persistently set the desired style in configuration files. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4843 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/GraphBox.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/gui/GraphBox.cpp') diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp index b0847f4a..2fd796d8 100644 --- a/src/gui/GraphBox.cpp +++ b/src/gui/GraphBox.cpp @@ -24,6 +24,7 @@ #include #include "ingen/Interface.hpp" +#include "ingen/Configuration.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/GraphModel.hpp" @@ -183,8 +184,8 @@ GraphBox::init_box(App& app) _menu_view_graph_tree_window->signal_activate().connect( sigc::mem_fun(_app->graph_tree(), &GraphTreeWindow::present)); - _menu_help_about->signal_activate().connect(sigc::hide_return( - sigc::mem_fun(_app, &App::show_about))); + _menu_help_about->signal_activate().connect( + sigc::hide_return(sigc::mem_fun(_app, &App::show_about))); _breadcrumbs = new BreadCrumbs(*_app); _breadcrumbs->signal_graph_selected.connect( @@ -279,6 +280,11 @@ GraphBox::set_graph(SharedPtr graph, _view->signal_object_left.connect( sigc::mem_fun(this, &GraphBox::object_left)); + _menu_human_names->set_active( + _app->world()->conf().option("human-names").get_bool()); + _menu_show_port_names->set_active( + _app->world()->conf().option("port-labels").get_bool()); + _enable_signal = true; } @@ -684,15 +690,17 @@ void GraphBox::event_human_names_toggled() { _view->canvas()->show_human_names(_menu_human_names->get_active()); - if (_menu_human_names->get_active()) - _app->configuration()->set_name_style(Configuration::HUMAN); - else - _app->configuration()->set_name_style(Configuration::PATH); + _app->world()->conf().set( + "human-names", + _app->world()->forge().make(_menu_human_names->get_active())); } void GraphBox::event_port_names_toggled() { + _app->world()->conf().set( + "port-labels", + _app->world()->forge().make(_menu_show_port_names->get_active())); if (_menu_show_port_names->get_active()) { _view->canvas()->set_direction(GANV_DIRECTION_RIGHT); _view->canvas()->show_port_names(true); -- cgit v1.2.1