-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add quick access to controller learning wizard via options menu #15577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add quick access to controller learning wizard via options menu #15577
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.
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?
There was a problem hiding this comment.
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?
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
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(); | ||
| } |
There was a problem hiding this comment.
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:
mixxx/src/controllers/controllermanager.cpp
Lines 191 to 193 in 604b32c
| // 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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