unsigned int grid_ind = (unsigned int)gt;
- if (internal_editing()) {
+ if (internal_editing() && UIConfiguration::instance().get_grid_follows_internal()) {
internal_grid_type = gt;
} else {
pre_internal_grid_type = gt;
}
/* show appropriate rulers for this grid setting.
- * TODO: perhaps make this optional.
- * Currently this is 'required' because the RULER calculates the grid_marks which will be used by grid_lines
*/
if (grid_musical()) {
ruler_tempo_action->set_active(true);
ruler_meter_action->set_active(true);
-
ruler_bbt_action->set_active(true);
- ruler_timecode_action->set_active(false);
- ruler_minsec_action->set_active(false);
- ruler_samples_action->set_active(false);
- } else if (_grid_type == GridTypeTimecode) {
- ruler_tempo_action->set_active(false);
- ruler_meter_action->set_active(false);
- ruler_bbt_action->set_active(false);
+ if ( UIConfiguration::instance().get_rulers_follow_grid() ) {
+ ruler_timecode_action->set_active(false);
+ ruler_minsec_action->set_active(false);
+ ruler_samples_action->set_active(false);
+ }
+ } else if (_grid_type == GridTypeTimecode) {
ruler_timecode_action->set_active(true);
- ruler_minsec_action->set_active(false);
- ruler_samples_action->set_active(false);
- } else if (_grid_type == GridTypeMinSec) {
- ruler_tempo_action->set_active(false);
- ruler_meter_action->set_active(false);
- ruler_bbt_action->set_active(false);
- ruler_timecode_action->set_active(false);
+ if ( UIConfiguration::instance().get_rulers_follow_grid() ) {
+ ruler_tempo_action->set_active(false);
+ ruler_meter_action->set_active(false);
+ ruler_bbt_action->set_active(false);
+ ruler_minsec_action->set_active(false);
+ ruler_samples_action->set_active(false);
+ }
+ } else if (_grid_type == GridTypeMinSec) {
ruler_minsec_action->set_active(true);
- ruler_samples_action->set_active(false);
- } else if (_grid_type == GridTypeCDFrame) {
- ruler_tempo_action->set_active(false);
- ruler_meter_action->set_active(false);
- ruler_bbt_action->set_active(false);
- ruler_timecode_action->set_active(false);
+ if ( UIConfiguration::instance().get_rulers_follow_grid() ) {
+ ruler_tempo_action->set_active(false);
+ ruler_meter_action->set_active(false);
+ ruler_bbt_action->set_active(false);
+ ruler_timecode_action->set_active(false);
+ ruler_samples_action->set_active(false);
+ }
+ } else if (_grid_type == GridTypeCDFrame) {
+ ruler_cd_marker_action->set_active(true);
ruler_minsec_action->set_active(true);
- ruler_cd_marker_action->set_active(true);
- ruler_samples_action->set_active(false);
+ if ( UIConfiguration::instance().get_rulers_follow_grid() ) {
+ ruler_tempo_action->set_active(false);
+ ruler_meter_action->set_active(false);
+ ruler_bbt_action->set_active(false);
+ ruler_timecode_action->set_active(false);
+ ruler_samples_action->set_active(false);
+ }
}
instant_save ();
/* Switch snap type/mode if we're moving to/from an internal tool. Note
this must toggle the actions and not call set_snap_*() directly,
otherwise things get out of sync and the combo box stops working. */
- if (!was_internal && internal_editing()) {
+ if (!UIConfiguration::instance().get_grid_follows_internal()) {
+ grid_type_action(pre_internal_grid_type)->set_active(true);
+ snap_mode_action(pre_internal_snap_mode)->set_active(true);
+ } else if (!was_internal && internal_editing()) {
grid_type_action(internal_grid_type)->set_active(true);
snap_mode_action(internal_snap_mode)->set_active(true);
} else if (was_internal && !internal_editing()) {
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_rubberbanding_snaps_to_grid)
));
+ add_option (_("Editor/Snap"),
+ new BoolOption (
+ "grid-follows-internal",
+ _("Grid switches to alternate selection for Internal Edit tools"),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_grid_follows_internal),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_grid_follows_internal)
+ ));
+
+ add_option (_("Editor/Snap"),
+ new BoolOption (
+ "rulers-follow-grid",
+ _("Rulers automatically change to follow the Grid mode selection"),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_rulers_follow_grid),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_rulers_follow_grid)
+ ));
+
add_option (_("Editor/Snap"), new OptionEditorHeading (_("When \"Snap\" is enabled, snap to:")));
UI_CONFIG_VARIABLE (bool, snap_to_region_start, "snap-to-region-start", true)
UI_CONFIG_VARIABLE (bool, snap_to_region_end, "snap-to-region-end", true)
UI_CONFIG_VARIABLE (bool, snap_to_grid, "snap-to-grid", true)
+UI_CONFIG_VARIABLE (bool, rulers_follow_grid, "rulers-follow-grid", false)
+UI_CONFIG_VARIABLE (bool, grid_follows_internal, "grid-follows-internal", false) //this feature is deprecated, default it FALSE for now; remove it in v6