summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-04 19:15:40 +0000
committerDavid Robillard <d@drobilla.net>2010-02-04 19:15:40 +0000
commit89405ae847f6690471462319a794c541cc6343b1 (patch)
tree9d234fb528a8f2b41500f716fc82fd76418d5a30 /src/gui
parent6483b0601eba9489e9113f8f802a7176bdfda527 (diff)
downloadingen-89405ae847f6690471462319a794c541cc6343b1.tar.gz
ingen-89405ae847f6690471462319a794c541cc6343b1.tar.bz2
ingen-89405ae847f6690471462319a794c541cc6343b1.zip
Change patch port label when human name changes (e.g. update label when changed in the rename dialog).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2424 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/PatchPortModule.cpp17
-rw-r--r--src/gui/PatchPortModule.hpp1
-rw-r--r--src/gui/Port.cpp7
3 files changed, 15 insertions, 10 deletions
diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp
index b1a71cf2..a32d202f 100644
--- a/src/gui/PatchPortModule.cpp
+++ b/src/gui/PatchPortModule.cpp
@@ -23,13 +23,14 @@
#include "client/PatchModel.hpp"
#include "client/NodeModel.hpp"
#include "App.hpp"
+#include "Configuration.hpp"
+#include "GladeFactory.hpp"
#include "PatchCanvas.hpp"
+#include "PatchWindow.hpp"
#include "Port.hpp"
-#include "GladeFactory.hpp"
+#include "PortMenu.hpp"
#include "RenameWindow.hpp"
-#include "PatchWindow.hpp"
#include "WindowFactory.hpp"
-#include "PortMenu.hpp"
using namespace std;
using namespace Raul;
@@ -41,7 +42,6 @@ namespace GUI {
PatchPortModule::PatchPortModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortModel> model)
: FlowCanvas::Module(canvas, "", 0, 0, false) // FIXME: coords?
, _model(model)
- , _human_name_visible(false)
{
assert(canvas);
assert(model);
@@ -113,8 +113,6 @@ void
PatchPortModule::show_human_names(bool b)
{
const LV2URIMap& uris = App::instance().uris();
- using namespace std;
- _human_name_visible = b;
const Atom& name = _model->get_property(uris.lv2_name);
if (b && name.type() == Atom::STRING)
set_name(name.get_string());
@@ -146,11 +144,14 @@ PatchPortModule::set_property(const URI& key, const Atom& value)
}
break;
case Atom::STRING:
- if (key == uris.lv2_name && _human_name_visible) {
+ if (key == uris.lv2_name
+ && App::instance().configuration()->name_style() == Configuration::HUMAN) {
set_name(value.get_string());
- } else if (key == uris.lv2_symbol && !_human_name_visible) {
+ } else if (key == uris.lv2_symbol
+ && App::instance().configuration()->name_style() == Configuration::PATH) {
set_name(value.get_string());
}
+ break;
case Atom::BOOL:
if (key == uris.ingen_polyphonic) {
set_stacked_border(value.get_bool());
diff --git a/src/gui/PatchPortModule.hpp b/src/gui/PatchPortModule.hpp
index e85b7c90..6659864a 100644
--- a/src/gui/PatchPortModule.hpp
+++ b/src/gui/PatchPortModule.hpp
@@ -74,7 +74,6 @@ protected:
SharedPtr<PortModel> _model;
SharedPtr<Port> _port;
PortMenu* _menu;
- bool _human_name_visible;
};
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 84557548..e353190d 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -227,10 +227,15 @@ Port::property_changed(const URI& key, const Atom& value)
} else if (key == uris.lv2_portProperty) {
if (value == uris.lv2_toggled)
set_toggled(true);
- } else if (value.type() == Atom::URI) {
+ } else if (key == uris.ctx_context) {
ArtVpathDash* dash = this->dash();
_rect->property_dash() = dash;
set_border_width(dash ? 2.0 : 0.0);
+ } else if (key == uris.lv2_name) {
+ if (value.type() == Atom::STRING
+ && App::instance().configuration()->name_style() == Configuration::HUMAN) {
+ set_name(value.get_string());
+ }
}
}