more messing about with inconsistent menu state.
This commit is contained in:
parent
f336f4e6d1
commit
1cfa6bd69f
@ -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 ();
|
||||
|
@ -1301,19 +1301,13 @@ Editor::sensitize_the_right_region_actions ()
|
||||
}
|
||||
|
||||
a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-lock-style"));
|
||||
|
||||
CheckMenuItem* cm = dynamic_cast<CheckMenuItem*> (
|
||||
ActionManager::get_widget (X_("/Main/RegionMenu/RegionMenuPosition/toggle-region-lock-style")));
|
||||
|
||||
if (cm) {
|
||||
cm->set_inconsistent (false);
|
||||
}
|
||||
|
||||
a->set_active (have_position_lock_style_music && !have_position_lock_style_audio);
|
||||
|
||||
if (have_position_lock_style_music && have_position_lock_style_audio) {
|
||||
if (cm) {
|
||||
cm->set_inconsistent (true);
|
||||
vector<Widget*> proxies = a->get_proxies();
|
||||
for (vector<Widget*>::iterator p = proxies.begin(); p != proxies.end(); ++p) {
|
||||
CheckMenuItem* cmi = dynamic_cast<CheckMenuItem*> (*p);
|
||||
if (cmi) {
|
||||
cmi->set_inconsistent (have_position_lock_style_music && have_position_lock_style_audio);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user