diff options
author | David Robillard <d@drobilla.net> | 2008-08-17 18:58:24 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-17 18:58:24 +0000 |
commit | 602e31074b30167baace71ccfff1f58a6b3f0626 (patch) | |
tree | eb7b85c99532af48adfe6322e2b620ac31c62f76 /src/libs/gui/PatchWindow.cpp | |
parent | 0e47cf5e7153a96875a64754291fad1cdbf26da7 (diff) | |
download | ingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.gz ingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.bz2 ingen-602e31074b30167baace71ccfff1f58a6b3f0626.zip |
More serialization work.
Preliminary copy/paste (nodes only)
git-svn-id: http://svn.drobilla.net/lad/ingen@1418 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/PatchWindow.cpp')
-rw-r--r-- | src/libs/gui/PatchWindow.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index ad558903..125adeea 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -98,6 +98,8 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad sigc::mem_fun(this, &PatchWindow::event_upload)); _menu_copy->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_copy)); + _menu_paste->signal_activate().connect( + sigc::mem_fun(this, &PatchWindow::event_paste)); _menu_delete->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_delete)); _menu_quit->signal_activate().connect( @@ -130,6 +132,9 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad #ifndef HAVE_CURL _menu_upload->hide(); #endif + + Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get(); + clipboard->signal_owner_change().connect(sigc::mem_fun(this, &PatchWindow::event_clipboard_changed)); } @@ -274,6 +279,14 @@ PatchWindow::event_show_engine() void +PatchWindow::event_clipboard_changed(GdkEventOwnerChange* ev) +{ + Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get(); + _menu_paste->set_sensitive(clipboard->wait_is_text_available()); +} + + +void PatchWindow::event_show_controls() { App::instance().window_factory()->present_controls(_patch); @@ -386,6 +399,14 @@ PatchWindow::event_copy() void +PatchWindow::event_paste() +{ + if (_view) + _view->canvas()->paste(); +} + + +void PatchWindow::event_delete() { if (_view) |