diff options
author | David Robillard <d@drobilla.net> | 2016-07-08 16:13:52 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-07-08 16:13:52 -0400 |
commit | 7135ce7a402d90fc1312f861dda9009374a904ef (patch) | |
tree | a52d7b5005d1130a08d8ca1e4cf25db7cd5e8785 /src/Patchage.cpp | |
parent | da388743027dfec64dc7ad7f1b3927eb7ef62468 (diff) | |
download | patchage-7135ce7a402d90fc1312f861dda9009374a904ef.tar.gz patchage-7135ce7a402d90fc1312f861dda9009374a904ef.tar.bz2 patchage-7135ce7a402d90fc1312f861dda9009374a904ef.zip |
Add option to disable port sorting
Fixes #1082
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r-- | src/Patchage.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 91755e1..b9386cb 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -142,6 +142,7 @@ Patchage::Patchage(int argc, char** argv) , INIT_WIDGET(_menu_view_toolbar) , INIT_WIDGET(_menu_view_refresh) , INIT_WIDGET(_menu_view_human_names) + , INIT_WIDGET(_menu_view_sort_ports) , INIT_WIDGET(_menu_zoom_in) , INIT_WIDGET(_menu_zoom_out) , INIT_WIDGET(_menu_zoom_normal) @@ -255,6 +256,8 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(this, &Patchage::refresh)); _menu_view_human_names->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_view_human_names)); + _menu_view_sort_ports->signal_activate().connect( + sigc::mem_fun(this, &Patchage::on_view_sort_ports)); _menu_view_arrange->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_arrange)); _menu_view_sprung_layout->signal_activate().connect( @@ -307,7 +310,9 @@ Patchage::Patchage(int argc, char** argv) _conf->load(); _canvas->set_zoom(_conf->get_zoom()); _canvas->set_font_size(_conf->get_font_size()); - _canvas->set_port_order(port_order, NULL); + if (_conf->get_sort_ports()) { + _canvas->set_port_order(port_order, NULL); + } _main_win->resize( static_cast<int>(_conf->get_window_size().x), @@ -352,6 +357,7 @@ Patchage::Patchage(int argc, char** argv) update_state(); _menu_view_toolbar->set_active(_conf->get_show_toolbar()); _menu_view_sprung_layout->set_active(_conf->get_sprung_layout()); + _menu_view_sort_ports->set_active(_conf->get_sort_ports()); _status_text->set_pixels_inside_wrap(2); _status_text->set_left_margin(4); _status_text->set_right_margin(4); @@ -812,6 +818,15 @@ Patchage::on_view_human_names() } void +Patchage::on_view_sort_ports() +{ + const bool sort_ports = this->sort_ports(); + _canvas->set_port_order(sort_ports ? port_order : NULL, NULL); + _conf->set_sort_ports(sort_ports); + refresh(); +} + +void Patchage::on_zoom_in() { const float zoom = _canvas->get_zoom() * 1.25; |