From 32ff9b5e6822f4af04c5be4a71b43c5363f58031 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 27 Nov 2008 06:25:35 +0000 Subject: Replace "modes" with boolean "edit controls" in tooltips etc. Give edit controls a menu entry. Cleanup toolbar, fix some clashing mnemonics, etc. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1790 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/PatchView.cpp | 9 +++++-- src/gui/PatchView.hpp | 4 +++- src/gui/PatchWindow.cpp | 47 +++++++++++++++++++++--------------- src/gui/PatchWindow.hpp | 6 +++-- src/gui/ingen_gui.glade | 64 ++++++++++++++++++------------------------------- 5 files changed, 65 insertions(+), 65 deletions(-) (limited to 'src/gui') diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index 02e6fc97..deac1b22 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -47,7 +47,6 @@ PatchView::PatchView(BaseObjectType* cobject, const Glib::RefPtrget_widget("patch_view_process_but", _process_but); xml->get_widget("patch_view_poly_spin", _poly_spin); xml->get_widget("patch_view_clear_but", _clear_but); - xml->get_widget("patch_view_destroy_but", _destroy_but); xml->get_widget("patch_view_refresh_but", _refresh_but); xml->get_widget("patch_view_save_but", _save_but); xml->get_widget("patch_view_zoom_full_but", _zoom_full_but); @@ -78,7 +77,6 @@ PatchView::set_patch(SharedPtr patch) _canvas_scrolledwindow->add(*_canvas); _poly_spin->set_value(patch->poly()); - _destroy_but->set_sensitive(patch->path() != "/"); for (GraphObject::Properties::const_iterator i = patch->properties().begin(); i != patch->properties().end(); ++i) @@ -149,6 +147,13 @@ void PatchView::editable_toggled() { const bool editable = _edit_mode_but->get_active(); + set_editable(editable); +} + + +void +PatchView::set_editable(bool editable) +{ _patch->set_editable(editable); _canvas->lock(!editable); } diff --git a/src/gui/PatchView.hpp b/src/gui/PatchView.hpp index 77da6263..c88e334a 100644 --- a/src/gui/PatchView.hpp +++ b/src/gui/PatchView.hpp @@ -62,6 +62,8 @@ public: SharedPtr canvas() const { return _canvas; } SharedPtr patch() const { return _patch; } Gtk::Viewport* breadcrumb_container() const { return _breadcrumb_container; } + + void set_editable(bool editable); static SharedPtr create(SharedPtr patch); @@ -77,6 +79,7 @@ private: void refresh_clicked(); void on_editable_sig(bool locked); void editable_toggled(); + void canvas_item_entered(Gnome::Canvas::Item* item); void canvas_item_left(Gnome::Canvas::Item* item); @@ -93,7 +96,6 @@ private: Gtk::ToggleToolButton* _process_but; Gtk::SpinButton* _poly_spin; Gtk::ToolButton* _clear_but; - Gtk::ToolButton* _destroy_but; Gtk::ToolButton* _refresh_but; Gtk::ToolButton* _save_but; Gtk::ToolButton* _zoom_normal_but; diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 280682ba..0863b770 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -69,6 +69,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("patch_save_menuitem", _menu_save); xml->get_widget("patch_save_as_menuitem", _menu_save_as); xml->get_widget("patch_upload_menuitem", _menu_upload); + xml->get_widget("patch_edit_controls_menuitem", _menu_edit_controls); xml->get_widget("patch_cut_menuitem", _menu_cut); xml->get_widget("patch_copy_menuitem", _menu_copy); xml->get_widget("patch_paste_menuitem", _menu_paste); @@ -85,7 +86,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("patch_status_bar_menuitem", _menu_show_status_bar); 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); xml->get_widget("patch_view_patch_tree_window_menuitem", _menu_view_patch_tree_window); xml->get_widget("patch_help_about_menuitem", _menu_help_about); @@ -106,6 +106,8 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_upload)); + _menu_edit_controls->signal_activate().connect( + sigc::mem_fun(this, &PatchWindow::event_edit_controls)); _menu_copy->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_copy)); _menu_paste->signal_activate().connect( @@ -132,8 +134,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_show_properties)); - _menu_destroy_patch->signal_activate().connect( - sigc::mem_fun(this, &PatchWindow::event_destroy)); _menu_clear->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_clear)); _menu_view_messages_window->signal_activate().connect( @@ -195,6 +195,7 @@ PatchWindow::set_patch(SharedPtr patch, SharedPtr view) new_port_connection.disconnect(); removed_port_connection.disconnect(); + edit_mode_connection.disconnect(); _entered_connection.disconnect(); _left_connection.disconnect(); @@ -247,15 +248,13 @@ PatchWindow::set_patch(SharedPtr patch, SharedPtr view) set_title(_patch->path() + " - Ingen"); - //m_properties_window->patch_model(pc->patch_model()); - - if (patch->path() == "/") - _menu_destroy_patch->set_sensitive(false); - else - _menu_destroy_patch->set_sensitive(true); - - new_port_connection = patch->signal_new_port.connect(sigc::mem_fun(this, &PatchWindow::patch_port_added)); - removed_port_connection = patch->signal_removed_port.connect(sigc::mem_fun(this, &PatchWindow::patch_port_removed)); + new_port_connection = patch->signal_new_port.connect( + sigc::mem_fun(this, &PatchWindow::patch_port_added)); + removed_port_connection = patch->signal_removed_port.connect( + sigc::mem_fun(this, &PatchWindow::patch_port_removed)); + removed_port_connection = patch->signal_editable.connect( + sigc::mem_fun(this, &PatchWindow::editable_changed)); + show_all(); _view->signal_object_entered.connect(sigc::mem_fun(this, &PatchWindow::object_entered)); @@ -333,6 +332,15 @@ PatchWindow::object_left(ObjectModel* model) } +void +PatchWindow::editable_changed(bool editable) +{ + //const Atom& enabled = _patch->get_variable("ingen:enabled"); + _menu_edit_controls->set_active(editable); +} + + + void PatchWindow::event_show_engine() { @@ -453,6 +461,14 @@ PatchWindow::event_upload() } +void +PatchWindow::event_edit_controls() +{ + if (_view) + _view->set_editable(_menu_edit_controls->get_active()); +} + + void PatchWindow::event_copy() { @@ -561,13 +577,6 @@ PatchWindow::event_quit() } -void -PatchWindow::event_destroy() -{ - App::instance().engine()->destroy(_patch->path()); -} - - void PatchWindow::event_clear() { diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp index 3e0c75bf..5cfa2936 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/PatchWindow.hpp @@ -78,18 +78,19 @@ private: void patch_port_removed(SharedPtr port); void object_entered(ObjectModel* model); void object_left(ObjectModel* model); + void editable_changed(bool editable); void event_import(); void event_import_location(); void event_save(); void event_save_as(); void event_upload(); + void event_edit_controls(); void event_copy(); void event_paste(); void event_delete(); void event_select_all(); void event_quit(); - void event_destroy(); void event_clear(); void event_fullscreen_toggled(); void event_status_bar_toggled(); @@ -106,6 +107,7 @@ private: sigc::connection new_port_connection; sigc::connection removed_port_connection; + sigc::connection edit_mode_connection; bool _enable_signal; bool _position_stored; @@ -117,6 +119,7 @@ private: Gtk::MenuItem* _menu_save; Gtk::MenuItem* _menu_save_as; Gtk::MenuItem* _menu_upload; + Gtk::CheckMenuItem* _menu_edit_controls; Gtk::MenuItem* _menu_cut; Gtk::MenuItem* _menu_copy; Gtk::MenuItem* _menu_paste; @@ -129,7 +132,6 @@ private: Gtk::CheckMenuItem* _menu_show_status_bar; 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; diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade index 5d249bd4..c94d4e8c 100644 --- a/src/gui/ingen_gui.glade +++ b/src/gui/ingen_gui.glade @@ -143,6 +143,21 @@ True + + + True + Enable editing of connections and dragging of nodes (disable to manipulate controls) + _Edit connections + True + True + + + + + + True + + True @@ -225,22 +240,6 @@ - - - True - Destoy this patch (remove it from the engine) - _Destroy Patch - True - - - - True - gtk-delete - 1 - - - - True @@ -267,7 +266,7 @@ True View/Edit properties for this patch - _Properties... + P_roperties... True @@ -1475,7 +1474,7 @@ True - Enable DSP processing + Enable patch True gtk-execute True @@ -1503,10 +1502,12 @@ True + Polyphony True True + Patch polyphony 1 1 512 1 10 10 1 True @@ -1537,19 +1538,10 @@ False - - - True - - - False - False - - True - Clear (Destroy all children) + Clear patch contents True gtk-clear @@ -1557,16 +1549,6 @@ False - - - True - Destroy this patch - gtk-delete - - - False - - True @@ -1600,7 +1582,7 @@ True - Fit patch to window + Zoom to contents True gtk-zoom-fit @@ -1622,9 +1604,9 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Enable edit mode to move objects and make connections, disable to play controls ('e' to toggle) + Edit connections Edit - gtk-edit + gtk-connect True -- cgit v1.2.1