summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-28 03:02:58 +0000
committerDavid Robillard <d@drobilla.net>2008-09-28 03:02:58 +0000
commit7471821294765f6da694d14ff81581b31d1a983a (patch)
treedd951664dd83a45e23f18eea46fece64b3b715b7
parent77f7faa59bd8b6c447f11fba6dede9c29542c37a (diff)
downloadingen-7471821294765f6da694d14ff81581b31d1a983a.tar.gz
ingen-7471821294765f6da694d14ff81581b31d1a983a.tar.bz2
ingen-7471821294765f6da694d14ff81581b31d1a983a.zip
Select all support (from kfoltman).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1519 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/libs/gui/PatchCanvas.cpp9
-rw-r--r--src/libs/gui/PatchCanvas.hpp1
-rw-r--r--src/libs/gui/PatchWindow.cpp11
-rw-r--r--src/libs/gui/PatchWindow.hpp2
-rw-r--r--src/libs/gui/ingen_gui.glade11
5 files changed, 34 insertions, 0 deletions
diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp
index bd3a6bee..ddbbdc2b 100644
--- a/src/libs/gui/PatchCanvas.cpp
+++ b/src/libs/gui/PatchCanvas.cpp
@@ -561,6 +561,15 @@ PatchCanvas::destroy_selection()
}
}
+void
+PatchCanvas::select_all()
+{
+ unselect_ports();
+ for (list<boost::shared_ptr<Item> >::iterator m = _items.begin(); m != _items.end(); ++m)
+ if (boost::dynamic_pointer_cast<FlowCanvas::Module>(*m))
+ if (!(*m)->selected())
+ select_item(*m);
+}
void
PatchCanvas::copy_selection()
diff --git a/src/libs/gui/PatchCanvas.hpp b/src/libs/gui/PatchCanvas.hpp
index 667b65a1..fcf68e76 100644
--- a/src/libs/gui/PatchCanvas.hpp
+++ b/src/libs/gui/PatchCanvas.hpp
@@ -81,6 +81,7 @@ public:
void destroy_selection();
void copy_selection();
void paste();
+ void select_all();
void show_menu(GdkEvent* event);
diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp
index e0dc4b06..664b06c5 100644
--- a/src/libs/gui/PatchWindow.cpp
+++ b/src/libs/gui/PatchWindow.cpp
@@ -67,6 +67,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
xml->get_widget("patch_copy_menuitem", _menu_copy);
xml->get_widget("patch_paste_menuitem", _menu_paste);
xml->get_widget("patch_delete_menuitem", _menu_delete);
+ xml->get_widget("patch_select_all_menuitem", _menu_select_all);
xml->get_widget("patch_close_menuitem", _menu_close);
xml->get_widget("patch_quit_menuitem", _menu_quit);
xml->get_widget("patch_view_control_window_menuitem", _menu_view_control_window);
@@ -103,6 +104,8 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
sigc::mem_fun(this, &PatchWindow::event_paste));
_menu_delete->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_delete));
+ _menu_select_all->signal_activate().connect(
+ sigc::mem_fun(this, &PatchWindow::event_select_all));
_menu_quit->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_quit));
_menu_fullscreen->signal_activate().connect(
@@ -418,6 +421,14 @@ PatchWindow::event_delete()
void
+PatchWindow::event_select_all()
+{
+ if (_view)
+ _view->canvas()->select_all();
+}
+
+
+void
PatchWindow::on_show()
{
if (_position_stored)
diff --git a/src/libs/gui/PatchWindow.hpp b/src/libs/gui/PatchWindow.hpp
index ec3d14e8..4d4f0f1e 100644
--- a/src/libs/gui/PatchWindow.hpp
+++ b/src/libs/gui/PatchWindow.hpp
@@ -91,6 +91,7 @@ private:
void event_copy();
void event_paste();
void event_delete();
+ void event_select_all();
void event_quit();
void event_destroy();
void event_clear();
@@ -122,6 +123,7 @@ private:
Gtk::MenuItem* _menu_copy;
Gtk::MenuItem* _menu_paste;
Gtk::MenuItem* _menu_delete;
+ Gtk::MenuItem* _menu_select_all;
Gtk::MenuItem* _menu_close;
Gtk::MenuItem* _menu_quit;
Gtk::CheckMenuItem* _menu_human_names;
diff --git a/src/libs/gui/ingen_gui.glade b/src/libs/gui/ingen_gui.glade
index 5dbc318b..aa0680ea 100644
--- a/src/libs/gui/ingen_gui.glade
+++ b/src/libs/gui/ingen_gui.glade
@@ -184,6 +184,17 @@
</widget>
</child>
<child>
+ <widget class="GtkImageMenuItem" id="patch_select_all_menuitem">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Select all objects in a patch</property>
+ <property name="label">gtk-select-all</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="on_patch_select_all_menuitem_activate"/>
+ <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ </widget>
+ </child>
+ <child>
<widget class="GtkSeparatorMenuItem" id="menuitem1">
<property name="visible">True</property>
</widget>