From baf083b6075076cd20317d88fd25a370448f2bd7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 7 Apr 2007 00:52:22 +0000 Subject: Fix for overly loopy connections over short distances. Auto-arrange support for modules/ports. Added auto-arrange to Patchage and Ingen. git-svn-id: http://svn.drobilla.net/lad/ingen@408 a436a847-0d15-0410-975c-d299462d15a1 --- src/progs/ingenuity/PatchView.h | 2 +- src/progs/ingenuity/PatchWindow.cpp | 12 ++++++++++++ src/progs/ingenuity/PatchWindow.h | 3 ++- src/progs/ingenuity/ingenuity.glade | 38 +++++++++++++++++++++++++++++-------- 4 files changed, 45 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/progs/ingenuity/PatchView.h b/src/progs/ingenuity/PatchView.h index 264f6192..3ea52932 100644 --- a/src/progs/ingenuity/PatchView.h +++ b/src/progs/ingenuity/PatchView.h @@ -60,7 +60,7 @@ public: SharedPtr canvas() const { return _canvas; } SharedPtr patch() const { return _patch; } - Gtk::Viewport* breadcrumb_container() const { return _breadcrumb_container; } + Gtk::Viewport* breadcrumb_container() const { return _breadcrumb_container; } static SharedPtr create(SharedPtr patch); diff --git a/src/progs/ingenuity/PatchWindow.cpp b/src/progs/ingenuity/PatchWindow.cpp index 7556689b..a0a0c6a3 100644 --- a/src/progs/ingenuity/PatchWindow.cpp +++ b/src/progs/ingenuity/PatchWindow.cpp @@ -71,6 +71,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("patch_view_engine_window_menuitem", _menu_view_engine_window); xml->get_widget("patch_properties_menuitem", _menu_view_patch_properties); xml->get_widget("patch_fullscreen_menuitem", _menu_fullscreen); + xml->get_widget("patch_arrange_menuitem", _menu_arrange); xml->get_widget("patch_clear_menuitem", _menu_clear); xml->get_widget("patch_destroy_menuitem", _menu_destroy_patch); xml->get_widget("patch_view_messages_window_menuitem", _menu_view_messages_window); @@ -99,6 +100,8 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_fullscreen_toggled)); + _menu_arrange->signal_activate().connect( + sigc::mem_fun(this, &PatchWindow::event_arrange)); _menu_view_engine_window->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_show_engine)); _menu_view_control_window->signal_activate().connect( @@ -378,6 +381,7 @@ PatchWindow::event_quit() b->set_label("_Quit"); Gtk::Widget* close_img = Gtk::manage(new Gtk::Image(Gtk::Stock::QUIT, Gtk::ICON_SIZE_BUTTON)); b->set_image(*close_img); + b->grab_default(); int ret = d.run(); if (ret == 1) { @@ -403,6 +407,14 @@ PatchWindow::event_clear() App::instance().engine()->clear_patch(_patch->path()); } + +void +PatchWindow::event_arrange() +{ + _view->canvas()->arrange(); +} + + void PatchWindow::event_fullscreen_toggled() { diff --git a/src/progs/ingenuity/PatchWindow.h b/src/progs/ingenuity/PatchWindow.h index a7938f59..6fbd9cce 100644 --- a/src/progs/ingenuity/PatchWindow.h +++ b/src/progs/ingenuity/PatchWindow.h @@ -43,7 +43,6 @@ using namespace Ingen::Client; namespace Ingenuity { -class PatchCanvas; class LoadPluginWindow; class LoadPatchWindow; class NewSubpatchWindow; @@ -88,6 +87,7 @@ private: void event_destroy(); void event_clear(); void event_fullscreen_toggled(); + void event_arrange(); void event_show_properties(); void event_show_controls(); void event_show_engine(); @@ -113,6 +113,7 @@ private: Gtk::MenuItem* _menu_fullscreen; Gtk::MenuItem* _menu_clear; Gtk::MenuItem* _menu_destroy_patch; + Gtk::MenuItem* _menu_arrange; Gtk::MenuItem* _menu_view_engine_window; Gtk::MenuItem* _menu_view_control_window; Gtk::MenuItem* _menu_view_patch_properties; diff --git a/src/progs/ingenuity/ingenuity.glade b/src/progs/ingenuity/ingenuity.glade index 2ffbcc51..3e578e36 100644 --- a/src/progs/ingenuity/ingenuity.glade +++ b/src/progs/ingenuity/ingenuity.glade @@ -51,7 +51,7 @@ - + True gtk-open 1 @@ -106,7 +106,7 @@ - + True gtk-preferences 1 @@ -230,6 +230,28 @@ + + + True + Automatically arrange canvas + _Arrange + True + + + + + True + gtk-sort-ascending + 1 + 0.5 + 0.5 + 0 + 0 + + + + + True @@ -240,7 +262,7 @@ - + True gtk-preferences 1 @@ -282,7 +304,7 @@ - + True gtk-delete 1 @@ -319,7 +341,7 @@ - + True gtk-connect 1 @@ -342,7 +364,7 @@ - + True gtk-index 1 @@ -365,7 +387,7 @@ - + True gtk-dialog-error 1 @@ -400,7 +422,7 @@ - + True gtk-info 1 -- cgit v1.2.1