Skip to content

Commit 1d37504

Browse files
author
Milkii Brewster
committed
Fix MIDI learning wizard not appearing when opened from prefs button
DlgControllerLearning is parented to DlgPrefController, which is a child of DlgPreferences. Previously, mappingStarted() was emitted after show(), causing DlgPreferences::hide() to cascade-hide the wizard immediately. Emit mappingStarted() before creating and showing the wizard so the prefs dialog is already hidden when the wizard appears.
1 parent eddcde5 commit 1d37504

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/controllers/dlgprefcontroller.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,11 @@ void DlgPrefController::showLearningWizard(bool suppressPrefsDialogOnClose) {
398398
showMapping(m_pMapping);
399399
}
400400

401+
// Hide the prefs dialog before showing the wizard. The wizard is parented
402+
// to this page (a child of the prefs dialog), so hiding the prefs dialog
403+
// after show() would cascade-hide the wizard too.
404+
emit mappingStarted();
405+
401406
// Note that DlgControllerLearning is set to delete itself on close using
402407
// the Qt::WA_DeleteOnClose attribute (so this "new" doesn't leak memory)
403408
m_pDlgControllerLearning =
@@ -422,10 +427,6 @@ void DlgPrefController::showLearningWizard(bool suppressPrefsDialogOnClose) {
422427
&DlgControllerLearning::inputMappingsLearned,
423428
this,
424429
&DlgPrefController::midiInputMappingsLearned);
425-
426-
if (m_bPrefsDialogWasVisible) {
427-
emit mappingStarted();
428-
}
429430
connect(m_pDlgControllerLearning,
430431
&DlgControllerLearning::stopLearning,
431432
this,

0 commit comments

Comments
 (0)