summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-12 04:30:51 +0000
committerDavid Robillard <d@drobilla.net>2012-05-12 04:30:51 +0000
commite6ef6533ecd35aa7623fb8e286ef7e6bb4515fb4 (patch)
tree4dc588850cba294da046390567e3f4358c8ce740 /src/gui
parent8f5f234b6a81f96fa156257531c20b1b5bd17cfe (diff)
downloadingen-e6ef6533ecd35aa7623fb8e286ef7e6bb4515fb4.tar.gz
ingen-e6ef6533ecd35aa7623fb8e286ef7e6bb4515fb4.tar.bz2
ingen-e6ef6533ecd35aa7623fb8e286ef7e6bb4515fb4.zip
Select newly pasted objects so they can be easily moved.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4370 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/NodeModule.cpp5
-rw-r--r--src/gui/NodeModule.hpp2
-rw-r--r--src/gui/PatchCanvas.cpp5
-rw-r--r--src/gui/PatchCanvas.hpp3
4 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index ad3f23bb..e6bbee67 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -414,9 +414,9 @@ NodeModule::property_changed(const URI& key, const Atom& value)
void
NodeModule::set_selected(gboolean b)
{
- const URIs& uris = app().uris();
if (b != get_selected()) {
- Module::set_selected(b);
+ Ganv::Module::set_selected(b);
+ #if 0
if (b) {
PatchWindow* win = app().window_factory()->parent_patch_window(node());
if (win) {
@@ -432,6 +432,7 @@ NodeModule::set_selected(gboolean b)
}
}
}
+ #endif
}
}
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index 7d89dc32..0cfa4ec8 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -61,6 +61,7 @@ public:
virtual void store_location(double x, double y);
void show_human_names(bool b);
+ void set_selected(gboolean b);
SharedPtr<const Client::NodeModel> node() const { return _node; }
@@ -75,7 +76,6 @@ protected:
void embed_gui(bool embed);
bool popup_gui();
void on_gui_window_close();
- void set_selected(gboolean b);
void rename();
void property_changed(const Raul::URI& predicate, const Raul::Atom& value);
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index 587928a6..90664e1f 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -408,6 +408,9 @@ PatchCanvas::add_node(SharedPtr<const NodeModel> nm)
module->show();
_views.insert(std::make_pair(nm, module));
+ if (_pastees.find(nm->path()) != _pastees.end()) {
+ module->set_selected(true);
+ }
}
void
@@ -700,6 +703,7 @@ PatchCanvas::paste()
}
clear_selection();
+ _pastees.clear();
++_paste_count;
const URIs& uris = _app.uris();
@@ -758,6 +762,7 @@ PatchCanvas::paste()
y->second.get_float() + (20.0f * _paste_count));
builder.build(i->second);
+ _pastees.insert(i->first);
}
builder.connect(PtrCast<const PatchModel>(clipboard.object(_patch->path())));
diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp
index 98276d30..47b645d6 100644
--- a/src/gui/PatchCanvas.hpp
+++ b/src/gui/PatchCanvas.hpp
@@ -136,6 +136,9 @@ private:
int _last_click_y;
int _paste_count;
+ // Track pasted objects so they can be selected when they arrive
+ std::set<Raul::Path> _pastees;
+
struct MenuRecord {
MenuRecord(Gtk::MenuItem* i, Gtk::Menu* m) : item(i), menu(m) {}
Gtk::MenuItem* item;