Skip to content

Conversation

@mxmilkiib
Copy link
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 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
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
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
implements feature request from issue mixxxdj#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 mixxxdj#12262
@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 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
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 on lines +307 to +308
connect(
pControllerDlg,
Copy link
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,

// 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
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

Qt::UniqueConnection);
// Initialize the menu with current controllers
slotUpdateControllerLearningMenu();
}
Copy link
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
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

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