mirror of https://github.com/mgba-emu/mgba.git
Qt: Begin adding control info to report view
This commit is contained in:
parent
54f89fec1e
commit
eef3b5a57c
|
@ -195,6 +195,10 @@ void ReportView::generateReport() {
|
||||||
addGLInfo(hwReport);
|
addGLInfo(hwReport);
|
||||||
addReport(QString("Hardware info"), hwReport.join('\n'));
|
addReport(QString("Hardware info"), hwReport.join('\n'));
|
||||||
|
|
||||||
|
QStringList controlsReport;
|
||||||
|
addGamepadInfo(controlsReport);
|
||||||
|
addReport(QString("Controls"), controlsReport.join('\n'));
|
||||||
|
|
||||||
QList<QScreen*> screens = QGuiApplication::screens();
|
QList<QScreen*> screens = QGuiApplication::screens();
|
||||||
std::sort(screens.begin(), screens.end(), [](const QScreen* a, const QScreen* b) {
|
std::sort(screens.begin(), screens.end(), [](const QScreen* a, const QScreen* b) {
|
||||||
if (a->geometry().y() < b->geometry().y()) {
|
if (a->geometry().y() < b->geometry().y()) {
|
||||||
|
@ -288,6 +292,10 @@ void ReportView::generateReport() {
|
||||||
} else {
|
} else {
|
||||||
windowReport << QString("ROM open: No");
|
windowReport << QString("ROM open: No");
|
||||||
}
|
}
|
||||||
|
#ifdef BUILD_SDL
|
||||||
|
InputController* input = window->inputController();
|
||||||
|
windowReport << QString("Active gamepad: %1").arg(input->gamepad(SDL_BINDING_BUTTON));
|
||||||
|
#endif
|
||||||
windowReport << QString("Configuration: %1").arg(configs.indexOf(config) + 1);
|
windowReport << QString("Configuration: %1").arg(configs.indexOf(config) + 1);
|
||||||
addReport(QString("Window %1").arg(winId), windowReport.join('\n'));
|
addReport(QString("Window %1").arg(winId), windowReport.join('\n'));
|
||||||
}
|
}
|
||||||
|
@ -446,6 +454,26 @@ void ReportView::addGLInfo(QStringList& report) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportView::addGamepadInfo(QStringList& report) {
|
||||||
|
#ifdef BUILD_SDL
|
||||||
|
InputController* input = GBAApp::app()->windows()[0]->inputController();
|
||||||
|
QStringList gamepads = input->connectedGamepads(SDL_BINDING_BUTTON);
|
||||||
|
report << QString("Connected gamepads: %1").arg(gamepads.size());
|
||||||
|
int i = 0;
|
||||||
|
for (const auto& gamepad : gamepads) {
|
||||||
|
report << QString("Gamepad %1: %2").arg(i).arg(gamepad);
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
if (gamepads.size()) {
|
||||||
|
i = 0;
|
||||||
|
for (Window* window : GBAApp::app()->windows()) {
|
||||||
|
++i;
|
||||||
|
report << QString("Window %1 gamepad: %2").arg(i).arg(window->inputController()->gamepad(SDL_BINDING_BUTTON));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void ReportView::addROMInfo(QStringList& report, CoreController* controller) {
|
void ReportView::addROMInfo(QStringList& report, CoreController* controller) {
|
||||||
report << QString("Currently paused: %1").arg(yesNo[controller->isPaused()]);
|
report << QString("Currently paused: %1").arg(yesNo[controller->isPaused()]);
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
void addCpuInfo(QStringList&);
|
void addCpuInfo(QStringList&);
|
||||||
void addGLInfo(QStringList&);
|
void addGLInfo(QStringList&);
|
||||||
|
void addGamepadInfo(QStringList&);
|
||||||
void addROMInfo(QStringList&, CoreController*);
|
void addROMInfo(QStringList&, CoreController*);
|
||||||
void addScreenInfo(QStringList&, const QScreen*);
|
void addScreenInfo(QStringList&, const QScreen*);
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,8 @@ public:
|
||||||
void updateMultiplayerStatus(bool canOpenAnother);
|
void updateMultiplayerStatus(bool canOpenAnother);
|
||||||
void updateMultiplayerActive(bool active);
|
void updateMultiplayerActive(bool active);
|
||||||
|
|
||||||
|
InputController* inputController() { return &m_inputController; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void startDrawing();
|
void startDrawing();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
Loading…
Reference in New Issue