add quick access to controller learning wizard via options menu#15577
add quick access to controller learning wizard via options menu#15577mxmilkiib wants to merge 6 commits into
Conversation
bb8a876 to
6546404
Compare
| // 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); |
There was a problem hiding this comment.
why do we need to disconnect this?
when a new mappng has been added, the mapping needs to be saved/applied, no?
There was a problem hiding this comment.
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?
6546404 to
2978aa3
Compare
| for (int i = 0; i < m_controllerPages.size(); ++i) { | ||
| DlgPrefController* pControllerDlg = m_controllerPages.at(i); | ||
| if (pControllerDlg && pControllerDlg->controller() == pController) { |
There was a problem hiding this comment.
| 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) { |
| connect( | ||
| pControllerDlg, |
There was a problem hiding this comment.
| 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); |
There was a problem hiding this comment.
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(); | ||
| } |
There was a problem hiding this comment.
This doesn't work as intended, I don't see updated after startup.
The funtion that emits devicesChanged clearly states:
mixxx/src/controllers/controllermanager.cpp
Lines 191 to 193 in 604b32c
5c79bd7 to
e5d50a7
Compare
2caf883 to
46eb90d
Compare
|
addressed ronso0's nov 16 feedback:
|
…m/main, fold into mixxxdj#15577
642d2d9 to
56e185c
Compare
1d37504 to
c84cc15
Compare
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.
c84cc15 to
7f001f0
Compare
implements feature request from issue #12262 to provide quicker access to the midi controller learning wizard.
changes
options menu submenu
navigation
implementation
follows the same architectural pattern as the existing vinyl control menu implementation for consistency.
fixes #12262