Skip to content

add quick access to controller learning wizard via options menu#15577

Open
mxmilkiib wants to merge 6 commits into
mixxxdj:mainfrom
mxmilkiib:feature/2025.11nov.04-controller-wizard-quick-access
Open

add quick access to controller learning wizard via options menu#15577
mxmilkiib wants to merge 6 commits into
mixxxdj:mainfrom
mxmilkiib:feature/2025.11nov.04-controller-wizard-quick-access

Conversation

@mxmilkiib

Copy link
Copy Markdown
Contributor

implements feature request from issue #12262 to provide quicker access to the midi controller learning wizard.

changes

options menu submenu

  • added "controller learning wizard" submenu under options menu
  • dynamically populated with enabled controllers only
  • shows "no controllers enabled" when no controllers are enabled
  • updates automatically when controllers are enabled/disabled

navigation

  • clicking a controller menu item opens preferences dialog
  • automatically navigates to that specific controller's page
  • expands the controllers tree and selects the correct item
  • user can then click the "learning wizard" button on that page

implementation

  • wmainmenubar: added menu creation and signal emission
  • mixxxmainwindow: connected signals, filters to show only enabled controllers
  • dlgprefcontrollers: added method to navigate to specific controller
  • dlgpreferences: added method to delegate to controllers dialog

follows the same architectural pattern as the existing vinyl control menu implementation for consistency.

fixes #12262

@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.04-controller-wizard-quick-access branch from bb8a876 to 6546404 Compare November 5, 2025 04:50
Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment on lines +299 to +318
// Temporarily disconnect the mappingEnded signal to prevent
// showing the preferences dialog when the wizard closes
disconnect(pControllerDlg,
&DlgPrefController::mappingEnded,
m_pDlgPreferences,
&DlgPreferences::show);

// Reconnect after wizard closes to restore normal behavior
connect(
pControllerDlg,
&DlgPrefController::mappingEnded,
this,
[this, pControllerDlg]() {
// Restore the connection for future uses from preferences
connect(pControllerDlg,
&DlgPrefController::mappingEnded,
m_pDlgPreferences,
&DlgPreferences::show);
},
Qt::SingleShotConnection);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to disconnect this?
when a new mappng has been added, the mapping needs to be saved/applied, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stops prefs reopening

"disconnect only affects UI flow, not saving. prevents preferences dialog popping up when wizard is launched from menu instead of from within preferences. saving/applying happens in 'slotStopLearning()' before mappingEnded emits. single-shot reconnect restores normal behavior for preference-based launches."

maybe there is a more elegant way?

@mxmilkiib mxmilkiib marked this pull request as ready for review November 15, 2025 07:21
@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.04-controller-wizard-quick-access branch from 6546404 to 2978aa3 Compare November 15, 2025 17:55
Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment on lines +296 to +298
for (int i = 0; i < m_controllerPages.size(); ++i) {
DlgPrefController* pControllerDlg = m_controllerPages.at(i);
if (pControllerDlg && pControllerDlg->controller() == pController) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (int i = 0; i < m_controllerPages.size(); ++i) {
DlgPrefController* pControllerDlg = m_controllerPages.at(i);
if (pControllerDlg && pControllerDlg->controller() == pController) {
for (auto* pControllerDlg : m_controllerPages) {
if (pControllerDlg->controller() == pController) {

Comment thread src/controllers/dlgprefcontrollers.cpp Outdated
Comment on lines +307 to +308
connect(
pControllerDlg,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connect(
pControllerDlg,
connect(pControllerDlg,

Comment thread src/widget/wmainmenubar.cpp Outdated
// Show "No controllers enabled" if list is empty
if (m_controllerLearningActions.isEmpty()) {
auto* pNoControllersAction = new QAction(tr("No controllers enabled"), this);
pNoControllersAction->setEnabled(false);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to work (here, with Qt 6.2.3), action is still enabled, can be selected and clicked

Comment thread src/mixxxmainwindow.cpp
Qt::UniqueConnection);
// Initialize the menu with current controllers
slotUpdateControllerLearningMenu();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work as intended, I don't see updated after startup.
The funtion that emits devicesChanged clearly states:

// NOTE: Currently this function is only called on startup. If hotplug is added, changes to the
// controller list must be synchronized with dlgprefcontrollers to avoid dangling connections
// and possible crashes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may try to connect to ControllerManager::mappingApplied but I'm not sure if the controller is already open because there is also a blocking call openController(pController);.
See here and #15524

@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.04-controller-wizard-quick-access branch from 5c79bd7 to e5d50a7 Compare January 30, 2026 03:29
@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.04-controller-wizard-quick-access branch 5 times, most recently from 2caf883 to 46eb90d Compare February 15, 2026 03:47
@mxmilkiib

Copy link
Copy Markdown
Contributor Author

addressed ronso0's nov 16 feedback:

  • connected to ControllerManager::mappingApplied in addition to devicesChanged — devicesChanged is only emitted once on startup (as noted in the comment at controllermanager.cpp:193), so the menu wasn't updating when a controller was enabled post-startup. mappingApplied fires after openController() is queued, so the menu now reflects open state correctly.
  • simplified openLearningWizard loop to range-for as suggested.

mxmilkiib pushed a commit to mxmilkiib/mixxx that referenced this pull request Feb 22, 2026
@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.04-controller-wizard-quick-access branch from 642d2d9 to 56e185c Compare February 22, 2026 10:56
@mxmilkiib mxmilkiib requested a review from ronso0 February 28, 2026 08:52
@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.04-controller-wizard-quick-access branch 4 times, most recently from 1d37504 to c84cc15 Compare May 17, 2026 02:23
Milkii Brewster added 6 commits May 26, 2026 07:13
implements feature request from issue mixxxdj#12262 to provide quicker access to the midi controller learning wizard.

- added "controller learning wizard" submenu under options menu
- dynamically populated with enabled controllers only
- hides when no controllers are enabled (fixes Qt 6.2.3 issue)
- updates when controllers are enabled/disabled via mappingApplied signal

- clicking a controller menu item opens preferences dialog
- automatically navigates to that specific controller's page
- expands the controllers tree and selects the correct item
- user can then click the "learning wizard" button on that page

- wmainmenubar: added menu creation and signal emission
- mixxxmainwindow: connected signals, filters to show only enabled controllers
- dlgprefcontrollers: added method to navigate to specific controller
- dlgpreferences: added method to delegate to controllers dialog

- use ControllerManager::mappingApplied instead of devicesChanged for menu updates
- hide menu when empty instead of disabled action (fixes Qt 6.2.3 clickable issue)
- flag-based solution instead of disconnect/reconnect for cleaner code flow
- suppress preferences dialog show when wizard launched from menu

follows the same architectural pattern as the existing vinyl control menu implementation for consistency.

fixes mixxxdj#12262
- replace mappingApplied signal with direct Controller::openChanged connections
  - fixes menu not updating after startup
  - connect/disconnect as controllers are added/removed
  - properly tracks per-controller open state
- keep setVisible workaround for Qt 6.2.3 (already correct)
- replace suppress flag with preferences dialog visibility check
  - more elegant solution per ronso0 feedback
  - checks actual dialog visibility state at wizard start
  - only emits mappingStarted/mappingEnded if dialog was visible
Connect to ControllerManager::mappingApplied in addition to
devicesChanged. devicesChanged is only emitted once on startup
(per the comment in controllermanager.cpp); mappingApplied fires
after a controller is opened when a mapping is applied post-startup,
so the menu now updates correctly when controllers are enabled.

Also simplify openLearningWizard loop to range-for per review.
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.
@mxmilkiib mxmilkiib force-pushed the feature/2025.11nov.04-controller-wizard-quick-access branch from c84cc15 to 7f001f0 Compare May 26, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quicker access to the controller MIDI mapping wizard?

2 participants