diff options
author | nick_m <mainsbridge@gmail.com> | 2017-02-01 22:58:48 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2017-02-04 22:57:36 +1100 |
commit | 1cfa6bd69fc83420db228cfcc23970f798edf78b (patch) | |
tree | 548a2d5ab5aa446ba6c4dd95bcd937707ee2d088 /gtk2_ardour/editor_ops.cc | |
parent | f336f4e6d1f36cce50f4892a0ece24af8d87c13c (diff) |
more messing about with inconsistent menu state.
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 376dd3f086..20992d881a 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -5743,15 +5743,18 @@ Editor::toggle_region_lock_style () return; } - bool inconsistent = false; - CheckMenuItem* cm = dynamic_cast<CheckMenuItem*> ( - ActionManager::get_widget (X_("/Main/RegionMenu/RegionMenuPosition/toggle-region-lock-style"))); - - if (cm && cm->get_inconsistent()) { - inconsistent = true; + bool have_position_lock_style_audio = false; + bool have_position_lock_style_music = false; + for (list<RegionView*>::const_iterator i = rs.begin(); i != rs.end(); ++i) { + if ((*i)->region()->position_lock_style() == MusicTime) { + have_position_lock_style_music = true; + } else { + have_position_lock_style_audio = true; + } } + bool const inconsistent = have_position_lock_style_audio && have_position_lock_style_music; - begin_reversible_command (_("region lock style")); + begin_reversible_command (_("toggle region lock style")); for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->clear_changes (); |