| 1630 | */ |
| 1631 | #ifdef SPEEDYNOTE_CONTROLLER_SUPPORT |
| 1632 | void ControlPanelDialog::createControllerMappingTab() { |
| 1633 | controllerMappingTab = new QWidget(this); |
| 1634 | QVBoxLayout *layout = new QVBoxLayout(controllerMappingTab); |
| 1635 | |
| 1636 | // Instructions |
| 1637 | QLabel *instructionLabel = new QLabel(tr("Configure physical controller button mappings for your Joy-Con or other controller:"), controllerMappingTab); |
| 1638 | instructionLabel->setWordWrap(true); |
| 1639 | layout->addWidget(instructionLabel); |
| 1640 | |
| 1641 | QLabel *noteLabel = new QLabel(tr("Note: This maps your physical controller buttons to the logical Joy-Con functions used by the application. " |
| 1642 | "After setting up the physical mapping, you can configure what actions each logical button performs in the 'Button Mapping' tab."), controllerMappingTab); |
| 1643 | noteLabel->setWordWrap(true); |
| 1644 | noteLabel->setStyleSheet("color: gray; font-size: 10px; margin-bottom: 10px;"); |
| 1645 | layout->addWidget(noteLabel); |
| 1646 | |
| 1647 | // Button to open controller mapping dialog |
| 1648 | QPushButton *openMappingButton = new QPushButton(tr("Configure Controller Mapping"), controllerMappingTab); |
| 1649 | openMappingButton->setMinimumHeight(40); |
| 1650 | connect(openMappingButton, &QPushButton::clicked, this, &ControlPanelDialog::openControllerMapping); |
| 1651 | layout->addWidget(openMappingButton); |
| 1652 | |
| 1653 | // Button to reconnect controller |
| 1654 | reconnectButton = new QPushButton(tr("Reconnect Controller"), controllerMappingTab); |
| 1655 | reconnectButton->setMinimumHeight(40); |
| 1656 | reconnectButton->setStyleSheet("QPushButton { background-color: #4CAF50; color: white; font-weight: bold; }"); |
| 1657 | connect(reconnectButton, &QPushButton::clicked, this, &ControlPanelDialog::reconnectController); |
| 1658 | layout->addWidget(reconnectButton); |
| 1659 | |
| 1660 | // Status information |
| 1661 | QLabel *statusLabel = new QLabel(tr("Current controller status:"), controllerMappingTab); |
| 1662 | statusLabel->setStyleSheet("font-weight: bold; margin-top: 20px;"); |
| 1663 | layout->addWidget(statusLabel); |
| 1664 | |
| 1665 | // Dynamic status label |
| 1666 | controllerStatusLabel = new QLabel(controllerMappingTab); |
| 1667 | updateControllerStatus(); |
| 1668 | layout->addWidget(controllerStatusLabel); |
| 1669 | |
| 1670 | layout->addStretch(); |
| 1671 | |
| 1672 | tabWidget->addTab(controllerMappingTab, tr("Controller Mapping")); |
| 1673 | } |
| 1674 | |
| 1675 | void ControlPanelDialog::openControllerMapping() { |
| 1676 | if (!mainWindowRef) { |
nothing calls this directly
no test coverage detected