Skip to content

Commit

Permalink
Fix issues with scrolling through the presets and loading music notat…
Browse files Browse the repository at this point in the history
…ion offsets.

Fix: #122
Fix: #138
  • Loading branch information
cameronwhite committed Sep 21, 2014
1 parent 07bb497 commit 8b62e0e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/dialogs/tuningdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ TuningDialog::TuningDialog(QWidget *parent, const Tuning &currentTuning,
ui->sharpsCheckBox->setChecked(currentTuning.usesSharps());
connect(ui->sharpsCheckBox, SIGNAL(toggled(bool)), this,
SLOT(toggleSharps(bool)));
connect(ui->sharpsCheckBox, SIGNAL(clicked(bool)), this,
SLOT(invalidatePreset()));

ui->capoSpinBox->setMinimum(Tuning::MIN_CAPO);
ui->capoSpinBox->setMaximum(Tuning::MAX_CAPO);
Expand Down Expand Up @@ -125,8 +127,6 @@ void TuningDialog::toggleSharps(bool usesSharps)
selector->addItems(myNoteNames);
selector->setCurrentIndex(selectedIndex);
}

invalidatePreset();
}

void TuningDialog::updateEnabledStrings(int numStrings)
Expand Down Expand Up @@ -167,6 +167,16 @@ void TuningDialog::loadPreset()
ui->presetComboBox->currentIndex()).value<const Tuning *>();

ui->sharpsCheckBox->setChecked(tuning->usesSharps());

// Don't invalidate the preset.
ui->capoSpinBox->blockSignals(true);
ui->capoSpinBox->setValue(tuning->getCapo());
ui->capoSpinBox->blockSignals(false);

ui->notationOffsetSpinBox->blockSignals(true);
ui->notationOffsetSpinBox->setValue(tuning->getMusicNotationOffset());
ui->notationOffsetSpinBox->blockSignals(false);

initStringSelectors(*tuning);
}

Expand Down

0 comments on commit 8b62e0e

Please sign in to comment.