From e768a92587d96861f8489df06730309fef675495 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Mon, 1 Jan 2018 19:25:38 -0600 Subject: [PATCH 01/10] add compatibility reporting to qt frontend --- .travis/linux-frozen/build.sh | 2 +- .travis/linux-frozen/docker.sh | 2 +- .travis/linux/build.sh | 2 +- .travis/linux/docker.sh | 2 +- .travis/macos/build.sh | 2 +- CMakeLists.txt | 4 + appveyor.yml | 5 +- src/citra_qt/CMakeLists.txt | 3 + src/citra_qt/compatdb.cpp | 55 +++++++++ src/citra_qt/compatdb.h | 27 +++++ src/citra_qt/compatdb.ui | 215 +++++++++++++++++++++++++++++++++ src/citra_qt/main.cpp | 26 ++++ src/citra_qt/main.h | 1 + src/citra_qt/main.ui | 15 ++- 14 files changed, 353 insertions(+), 8 deletions(-) create mode 100644 src/citra_qt/compatdb.cpp create mode 100644 src/citra_qt/compatdb.h create mode 100644 src/citra_qt/compatdb.ui diff --git a/.travis/linux-frozen/build.sh b/.travis/linux-frozen/build.sh index 25c655516..25fa0259e 100755 --- a/.travis/linux-frozen/build.sh +++ b/.travis/linux-frozen/build.sh @@ -1,4 +1,4 @@ #!/bin/bash -ex docker pull ubuntu:16.04 -docker run -v $(pwd):/citra ubuntu:16.04 /bin/bash -ex /citra/.travis/linux-frozen/docker.sh +docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:16.04 /bin/bash -ex /citra/.travis/linux-frozen/docker.sh diff --git a/.travis/linux-frozen/docker.sh b/.travis/linux-frozen/docker.sh index edca9a7a1..f5cb1b0c0 100755 --- a/.travis/linux-frozen/docker.sh +++ b/.travis/linux-frozen/docker.sh @@ -21,7 +21,7 @@ echo y | sh cmake-3.9.0-Linux-x86_64.sh --prefix=cmake export PATH=/citra/cmake/cmake-3.9.0-Linux-x86_64/bin:$PATH mkdir build && cd build -cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release +cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} make -j4 ctest -VV -C Release diff --git a/.travis/linux/build.sh b/.travis/linux/build.sh index 14deaf31c..3e7b212f4 100755 --- a/.travis/linux/build.sh +++ b/.travis/linux/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -ex -docker run -v $(pwd):/citra ubuntu:16.04 /bin/bash -ex /citra/.travis/linux/docker.sh +docker run -e ENABLE_COMPATIBILITY_REPORTING -v $(pwd):/citra ubuntu:16.04 /bin/bash -ex /citra/.travis/linux/docker.sh diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh index e27af5600..b03424904 100755 --- a/.travis/linux/docker.sh +++ b/.travis/linux/docker.sh @@ -11,7 +11,7 @@ echo y | sh cmake-3.9.0-Linux-x86_64.sh --prefix=cmake export PATH=/citra/cmake/cmake-3.9.0-Linux-x86_64/bin:$PATH mkdir build && cd build -cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release +cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_BUILD_TYPE=Release -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} make -j4 ctest -VV -C Release diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh index c957cdf21..2930292c2 100755 --- a/.travis/macos/build.sh +++ b/.travis/macos/build.sh @@ -6,7 +6,7 @@ export MACOSX_DEPLOYMENT_TARGET=10.9 export Qt5_DIR=$(brew --prefix)/opt/qt5 mkdir build && cd build -cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release +cmake .. -DUSE_SYSTEM_CURL=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} make -j4 ctest -VV -C Release diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c7c48ab..2a2be43b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ option(ENABLE_QT "Enable the Qt frontend" ON) option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) +option(CITRA_ENABLE_COMPATIBILITY_REPORTING "Enable compatibility reporting" OFF) option(CITRA_USE_BUNDLED_CURL "FOR MINGW ONLY: Download curl configured against winssl instead of openssl" OFF) if (ENABLE_WEB_SERVICE AND CITRA_USE_BUNDLED_CURL AND WINDOWS AND MSVC) message("Turning off use bundled curl as msvc can compile curl on cpr") @@ -235,6 +236,9 @@ endif() if (ENABLE_WEB_SERVICE) add_definitions(-DENABLE_WEB_SERVICE) endif() +if (CITRA_ENABLE_COMPATIBILITY_REPORTING) + add_definitions(-DCITRA_ENABLE_COMPATIBILITY_REPORTING) +endif() # Platform-specific library requirements # ====================================== diff --git a/appveyor.yml b/appveyor.yml index 5fd7c6490..9215bcd40 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,11 +41,12 @@ before_build: - mkdir %BUILD_TYPE%_build - cd %BUILD_TYPE%_build - ps: | + $COMPAT = if ($env:ENABLE_COMPATIBILITY_REPORTING -eq $null) {0} else {$env:ENABLE_COMPATIBILITY_REPORTING} if ($env:BUILD_TYPE -eq 'msvc') { # redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning - cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 -DCMAKE_USE_OPENSSL=0 .. 2>&1 && exit 0' + cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 -DCMAKE_USE_OPENSSL=0 -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} .. 2>&1 && exit 0' } else { - C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DUSE_SYSTEM_CURL=1 -DCITRA_USE_BUNDLED_CURL=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1" + C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DUSE_SYSTEM_CURL=1 -DCITRA_USE_BUNDLED_CURL=1 -DCMAKE_BUILD_TYPE=Release -DCITRA_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} .. 2>&1" } - cd .. diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 9da384620..56a1eae99 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -65,6 +65,8 @@ add_executable(citra-qt util/spinbox.h util/util.cpp util/util.h + compatdb.cpp + compatdb.h ) set(UIS @@ -80,6 +82,7 @@ set(UIS aboutdialog.ui hotkeys.ui main.ui + compatdb.ui ) file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) diff --git a/src/citra_qt/compatdb.cpp b/src/citra_qt/compatdb.cpp new file mode 100644 index 000000000..595d57f8c --- /dev/null +++ b/src/citra_qt/compatdb.cpp @@ -0,0 +1,55 @@ +// Copyright 2017 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include +#include "citra_qt/compatdb.h" +#include "common/telemetry.h" +#include "core/core.h" +#include "ui_compatdb.h" + +CompatDB::CompatDB(QWidget* parent) + : QWizard(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint), + ui{std::make_unique()} { + ui->setupUi(this); + connect(ui->radioButton_Perfect, &QRadioButton::clicked, this, &CompatDB::EnableNext); + connect(ui->radioButton_Great, &QRadioButton::clicked, this, &CompatDB::EnableNext); + connect(ui->radioButton_Okay, &QRadioButton::clicked, this, &CompatDB::EnableNext); + connect(ui->radioButton_Bad, &QRadioButton::clicked, this, &CompatDB::EnableNext); + connect(ui->radioButton_IntroMenu, &QRadioButton::clicked, this, &CompatDB::EnableNext); + connect(ui->radioButton_WontBoot, &QRadioButton::clicked, this, &CompatDB::EnableNext); + connect(button(NextButton), &QPushButton::clicked, this, &CompatDB::Submit); +} + +CompatDB::~CompatDB() = default; + +void CompatDB::Submit() { + QButtonGroup* compatibility = new QButtonGroup(this); + compatibility->addButton(ui->radioButton_Perfect, 0); + compatibility->addButton(ui->radioButton_Great, 1); + compatibility->addButton(ui->radioButton_Okay, 2); + compatibility->addButton(ui->radioButton_Bad, 3); + compatibility->addButton(ui->radioButton_IntroMenu, 4); + compatibility->addButton(ui->radioButton_WontBoot, 5); + switch (currentId()) { + case 1: + if (compatibility->checkedId() == -1) { + button(NextButton)->setEnabled(false); + } + break; + case 2: + LOG_DEBUG( + Frontend, + tr("Compatibility Rating: %1").arg(compatibility->checkedId()).toStdString().c_str()); + Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", + compatibility->checkedId()); + // the frozen dependency Linux build does not support the "NoCancelButtonOnLastPage" option, + // this is a workaround + button(QWizard::CancelButton)->setVisible(false); + break; + } +} +void CompatDB::EnableNext() { + button(NextButton)->setEnabled(true); +} diff --git a/src/citra_qt/compatdb.h b/src/citra_qt/compatdb.h new file mode 100644 index 000000000..0a0f27cca --- /dev/null +++ b/src/citra_qt/compatdb.h @@ -0,0 +1,27 @@ +// Copyright 2017 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +namespace Ui { +class CompatDB; +} + +class CompatDB : public QWizard { + Q_OBJECT + +public: + explicit CompatDB(QWidget* parent = nullptr); + ~CompatDB(); + +private: + std::unique_ptr ui; + +private slots: + void Submit(); + void EnableNext(); +}; diff --git a/src/citra_qt/compatdb.ui b/src/citra_qt/compatdb.ui new file mode 100644 index 000000000..2e00550f2 --- /dev/null +++ b/src/citra_qt/compatdb.ui @@ -0,0 +1,215 @@ + + + CompatDB + + + + 0 + 0 + 600 + 482 + + + + + 500 + 410 + + + + Report Compatibility + + + QWizard::DisabledBackButtonOnLastPage|QWizard::HelpButtonOnRight|QWizard::NoBackButtonOnStartPage + + + + Report Game Compatibility + + + 0 + + + + + + <html><head/><body><p><span style=" font-size:10pt;">Should you choose to submit a test case to the </span><a href="https://citra-emu.org/game/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">Citra Compatibility List</span></a><span style=" font-size:10pt;">, The following information will be collected and displayed on the site:</span></p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hardware Information (CPU / GPU / Operating System)</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Which version of Citra you are running</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The connected Citra account</li></ul></body></html> + + + true + + + true + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + Report Game Compatibility + + + 1 + + + + + + Perfect + + + + + + + <html><head/><body><p>Game functions flawlessly with no audio or graphical glitches.</p></body></html> + + + true + + + + + + + Great + + + + + + + <html><head/><body><p>Game functions with minor graphical or audio glitches and is playable from start to finish. May require some workarounds.</p></body></html> + + + true + + + + + + + Okay + + + + + + + <html><head/><body><p>Game functions with major graphical or audio glitches, but game is playable from start to finish with workarounds.</p></body></html> + + + true + + + + + + + Bad + + + + + + + <html><head/><body><p>Game functions, but with major graphical or audio glitches. Unable to progress in specific areas due to glitches even with workarounds.</p></body></html> + + + true + + + + + + + Intro/Menu + + + + + + + <html><head/><body><p>Game is completely unplayable due to major graphical or audio glitches. Unable to progress past the Start Screen.</p></body></html> + + + true + + + + + + + Won't Boot + + + true + + + false + + + + + + + <html><head/><body><p>The game crashes when attempting to startup.</p></body></html> + + + + + + + + 10 + + + + <html><head/><body><p>Independent of speed or performance, how well does this game play from start to finish on this version of Citra?</p></body></html> + + + true + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + Thank you for your submission! + + + 2 + + + + + + diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index e7c327540..bb647098a 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -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.

To link your Citra account, go to Emulation \> Configuration \> " + "Web.")); + } +#endif +} + void GMainWindow::ToggleFullscreen() { if (!emulation_running) { return; diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 70fb309e7..a96a9b061 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -126,6 +126,7 @@ private slots: void OnStartGame(); void OnPauseGame(); void OnStopGame(); + void OnMenuReportCompatibility(); /// Called whenever a user selects a game in the game list widget. void OnGameListLoadFile(QString game_path); void OnGameListOpenSaveFolder(u64 program_id); diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui index 1bc071776..901dcd2fe 100644 --- a/src/citra_qt/main.ui +++ b/src/citra_qt/main.ui @@ -45,7 +45,7 @@ 0 0 1081 - 21 + 26 @@ -73,6 +73,7 @@ + @@ -233,6 +234,18 @@ Check for Updates + + + false + + + Report Compatibility + + + false + + + From 68959823e92260cfc095d27a2faebcc65676fc45 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Sat, 6 Jan 2018 11:56:12 -0600 Subject: [PATCH 02/10] move menu action --- src/citra_qt/main.ui | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui index 901dcd2fe..bbc82f9e7 100644 --- a/src/citra_qt/main.ui +++ b/src/citra_qt/main.ui @@ -73,7 +73,6 @@ - @@ -101,6 +100,8 @@ + + From b71d9e108d70aacd6d69c29f3aeb3516f2604d8d Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Wed, 10 Jan 2018 19:05:14 -0600 Subject: [PATCH 03/10] address wwylele's feedback --- src/citra_qt/compatdb.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/citra_qt/compatdb.cpp b/src/citra_qt/compatdb.cpp index 595d57f8c..2ef52ad74 100644 --- a/src/citra_qt/compatdb.cpp +++ b/src/citra_qt/compatdb.cpp @@ -39,17 +39,16 @@ void CompatDB::Submit() { } break; case 2: - LOG_DEBUG( - Frontend, - tr("Compatibility Rating: %1").arg(compatibility->checkedId()).toStdString().c_str()); + LOG_DEBUG(Frontend, "Compatibility Rating: %1", compatibility->checkedId()); Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", compatibility->checkedId()); - // the frozen dependency Linux build does not support the "NoCancelButtonOnLastPage" option, - // this is a workaround + // older versions of QT don't support the "NoCancelButtonOnLastPage" option, this is a + // workaround button(QWizard::CancelButton)->setVisible(false); break; } } + void CompatDB::EnableNext() { button(NextButton)->setEnabled(true); } From da59ce91c9ad0541b783ba21b77b5201e7864469 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Wed, 10 Jan 2018 19:44:09 -0600 Subject: [PATCH 04/10] require web services --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a2be43b4..d77fdb8ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,10 @@ if (ENABLE_WEB_SERVICE AND NOT CITRA_USE_BUNDLED_CURL AND MINGW) message(AUTHOR_WARNING "Turning on CITRA_USE_BUNDLED_CURL. Override it only if you know what you are doing.") SET(CITRA_USE_BUNDLED_CURL ON CACHE BOOL "" FORCE) endif() +if (CITRA_ENABLE_COMPATIBILITY_REPORTING AND NOT ENABLE_WEB_SERVICE) + message("Compatibility reporting requires web services to be enabled") + SET(CITRA_ENABLE_COMPATIBILITY_REPORTING OFF CACHE BOOL "" FORCE) +endif() if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) message(STATUS "Copying pre-commit hook") From f985d277c8b2129ee3a17da37a3ad1b5dcca4eca Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Wed, 10 Jan 2018 20:39:32 -0600 Subject: [PATCH 05/10] get rid of cmake GUI option --- CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d77fdb8ab..14dc89e7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,12 +13,7 @@ option(ENABLE_QT "Enable the Qt frontend" ON) option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) -option(CITRA_ENABLE_COMPATIBILITY_REPORTING "Enable compatibility reporting" OFF) option(CITRA_USE_BUNDLED_CURL "FOR MINGW ONLY: Download curl configured against winssl instead of openssl" OFF) -if (ENABLE_WEB_SERVICE AND CITRA_USE_BUNDLED_CURL AND WINDOWS AND MSVC) - message("Turning off use bundled curl as msvc can compile curl on cpr") - SET(CITRA_USE_BUNDLED_CURL OFF CACHE BOOL "" FORCE) -endif() if (ENABLE_WEB_SERVICE AND NOT CITRA_USE_BUNDLED_CURL AND MINGW) message(AUTHOR_WARNING "Turning on CITRA_USE_BUNDLED_CURL. Override it only if you know what you are doing.") SET(CITRA_USE_BUNDLED_CURL ON CACHE BOOL "" FORCE) From ca960776015ee75cc3f289a557e5c28c90fa9e60 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Thu, 11 Jan 2018 10:57:44 -0600 Subject: [PATCH 06/10] 1 -> d --- src/citra_qt/compatdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citra_qt/compatdb.cpp b/src/citra_qt/compatdb.cpp index 2ef52ad74..8bee64b05 100644 --- a/src/citra_qt/compatdb.cpp +++ b/src/citra_qt/compatdb.cpp @@ -39,7 +39,7 @@ void CompatDB::Submit() { } break; case 2: - LOG_DEBUG(Frontend, "Compatibility Rating: %1", compatibility->checkedId()); + LOG_DEBUG(Frontend, "Compatibility Rating: %d", compatibility->checkedId()); Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", compatibility->checkedId()); // older versions of QT don't support the "NoCancelButtonOnLastPage" option, this is a From 11d2825070ae57538332b23feca27975ac89836d Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Wed, 17 Jan 2018 13:57:42 -0600 Subject: [PATCH 07/10] only enable menu visibility --- src/citra_qt/main.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index bb647098a..ab8de008a 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -17,6 +17,7 @@ #include #include "citra_qt/aboutdialog.h" #include "citra_qt/bootmanager.h" +#include "citra_qt/compatdb.h" #include "citra_qt/configuration/config.h" #include "citra_qt/configuration/configure_dialog.h" #include "citra_qt/debugger/graphics/graphics.h" @@ -48,10 +49,6 @@ #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 @@ -821,7 +818,6 @@ void GMainWindow::OnStopGame() { } void GMainWindow::OnMenuReportCompatibility() { -#ifdef CITRA_ENABLE_COMPATIBILITY_REPORTING if (!Settings::values.citra_token.empty() && !Settings::values.citra_username.empty()) { CompatDB compatdb{this}; compatdb.exec(); @@ -832,7 +828,6 @@ void GMainWindow::OnMenuReportCompatibility() { "account.

To link your Citra account, go to Emulation \> Configuration \> " "Web.")); } -#endif } void GMainWindow::ToggleFullscreen() { From d462eacefba24344fc707f14faff212dc80076ed Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Thu, 18 Jan 2018 10:40:24 -0600 Subject: [PATCH 08/10] get rid of useless if statement --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2835285f..6b00aa770 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,10 +24,6 @@ if (ENABLE_WEB_SERVICE AND NOT CITRA_USE_BUNDLED_CURL AND MINGW) message(AUTHOR_WARNING "Turning on CITRA_USE_BUNDLED_CURL. Override it only if you know what you are doing.") SET(CITRA_USE_BUNDLED_CURL ON CACHE BOOL "" FORCE) endif() -if (CITRA_ENABLE_COMPATIBILITY_REPORTING AND NOT ENABLE_WEB_SERVICE) - message("Compatibility reporting requires web services to be enabled") - SET(CITRA_ENABLE_COMPATIBILITY_REPORTING OFF CACHE BOOL "" FORCE) -endif() if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) message(STATUS "Copying pre-commit hook") From 169b07691391e3cfee09a41ac6a239278d08f283 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Thu, 18 Jan 2018 21:02:55 -0600 Subject: [PATCH 09/10] use enum and add default case --- src/citra_qt/compatdb.cpp | 6 ++++-- src/citra_qt/compatdb.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/compatdb.cpp b/src/citra_qt/compatdb.cpp index 8bee64b05..a3e6ba3e2 100644 --- a/src/citra_qt/compatdb.cpp +++ b/src/citra_qt/compatdb.cpp @@ -33,12 +33,12 @@ void CompatDB::Submit() { compatibility->addButton(ui->radioButton_IntroMenu, 4); compatibility->addButton(ui->radioButton_WontBoot, 5); switch (currentId()) { - case 1: + case CompatDBPage::SelectionPage: if (compatibility->checkedId() == -1) { button(NextButton)->setEnabled(false); } break; - case 2: + case CompatDBPage::FinalPage: LOG_DEBUG(Frontend, "Compatibility Rating: %d", compatibility->checkedId()); Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", compatibility->checkedId()); @@ -46,6 +46,8 @@ void CompatDB::Submit() { // workaround button(QWizard::CancelButton)->setVisible(false); break; + default: + LOG_ERROR(Frontend, "Unexpected page: %d", currentId()); } } diff --git a/src/citra_qt/compatdb.h b/src/citra_qt/compatdb.h index 0a0f27cca..dfc259b4f 100644 --- a/src/citra_qt/compatdb.h +++ b/src/citra_qt/compatdb.h @@ -25,3 +25,5 @@ private slots: void Submit(); void EnableNext(); }; + +enum CompatDBPage { IntroPage = 0, SelectionPage = 1, FinalPage = 2 }; From fc1bdc3c626aa088ffa84a9903e134eeddb5dad8 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Sat, 20 Jan 2018 09:56:02 -0600 Subject: [PATCH 10/10] enum class --- src/citra_qt/compatdb.cpp | 8 +++++--- src/citra_qt/compatdb.h | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/citra_qt/compatdb.cpp b/src/citra_qt/compatdb.cpp index a3e6ba3e2..f2ad7927d 100644 --- a/src/citra_qt/compatdb.cpp +++ b/src/citra_qt/compatdb.cpp @@ -24,6 +24,8 @@ CompatDB::CompatDB(QWidget* parent) CompatDB::~CompatDB() = default; +enum class CompatDBPage { Intro = 0, Selection = 1, Final = 2 }; + void CompatDB::Submit() { QButtonGroup* compatibility = new QButtonGroup(this); compatibility->addButton(ui->radioButton_Perfect, 0); @@ -32,13 +34,13 @@ void CompatDB::Submit() { compatibility->addButton(ui->radioButton_Bad, 3); compatibility->addButton(ui->radioButton_IntroMenu, 4); compatibility->addButton(ui->radioButton_WontBoot, 5); - switch (currentId()) { - case CompatDBPage::SelectionPage: + switch ((static_cast(currentId()))) { + case CompatDBPage::Selection: if (compatibility->checkedId() == -1) { button(NextButton)->setEnabled(false); } break; - case CompatDBPage::FinalPage: + case CompatDBPage::Final: LOG_DEBUG(Frontend, "Compatibility Rating: %d", compatibility->checkedId()); Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", compatibility->checkedId()); diff --git a/src/citra_qt/compatdb.h b/src/citra_qt/compatdb.h index dfc259b4f..0a0f27cca 100644 --- a/src/citra_qt/compatdb.h +++ b/src/citra_qt/compatdb.h @@ -25,5 +25,3 @@ private slots: void Submit(); void EnableNext(); }; - -enum CompatDBPage { IntroPage = 0, SelectionPage = 1, FinalPage = 2 };