add compatibility reporting to qt frontend

This commit is contained in:
BreadFish64 2018-01-01 19:25:38 -06:00
parent ae42267cc7
commit e768a92587
14 changed files with 353 additions and 8 deletions

View file

@ -48,6 +48,10 @@
#include "core/loader/loader.h"
#include "core/settings.h"
#ifdef CITRA_ENABLE_COMPATIBILITY_REPORTING
#include "citra_qt/compatdb.h"
#endif
#ifdef QT_STATICPLUGIN
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
#endif
@ -144,6 +148,9 @@ GMainWindow::~GMainWindow() {
}
void GMainWindow::InitializeWidgets() {
#ifdef CITRA_ENABLE_COMPATIBILITY_REPORTING
ui.action_Report_Compatibility->setVisible(true);
#endif
render_window = new GRenderWindow(this, emu_thread.get());
render_window->hide();
@ -359,6 +366,8 @@ void GMainWindow::ConnectMenuEvents() {
connect(ui.action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame);
connect(ui.action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame);
connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame);
connect(ui.action_Report_Compatibility, &QAction::triggered, this,
&GMainWindow::OnMenuReportCompatibility);
connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
// View
@ -614,6 +623,7 @@ void GMainWindow::ShutdownGame() {
ui.action_Start->setText(tr("Start"));
ui.action_Pause->setEnabled(false);
ui.action_Stop->setEnabled(false);
ui.action_Report_Compatibility->setEnabled(false);
render_window->hide();
game_list->show();
game_list->setFilterFocus();
@ -795,6 +805,7 @@ void GMainWindow::OnStartGame() {
ui.action_Pause->setEnabled(true);
ui.action_Stop->setEnabled(true);
ui.action_Report_Compatibility->setEnabled(true);
}
void GMainWindow::OnPauseGame() {
@ -809,6 +820,21 @@ void GMainWindow::OnStopGame() {
ShutdownGame();
}
void GMainWindow::OnMenuReportCompatibility() {
#ifdef CITRA_ENABLE_COMPATIBILITY_REPORTING
if (!Settings::values.citra_token.empty() && !Settings::values.citra_username.empty()) {
CompatDB compatdb{this};
compatdb.exec();
} else {
QMessageBox::critical(
this, tr("Missing Citra Account"),
tr("In order to submit a game compatibility test case, you must link your Citra "
"account.<br><br/>To link your Citra account, go to Emulation \> Configuration \> "
"Web."));
}
#endif
}
void GMainWindow::ToggleFullscreen() {
if (!emulation_running) {
return;