compatibility reporting rewrite

This commit is contained in:
Behunin 2023-07-23 17:16:40 -06:00
parent 11b123ba01
commit e1cce410fe
16 changed files with 1608 additions and 593 deletions

View File

@ -572,6 +572,10 @@ struct Values {
Setting<std::string> yuzu_username{linkage, std::string(), "yuzu_username",
Category::WebService};
Setting<std::string> yuzu_token{linkage, std::string(), "yuzu_token", Category::WebService};
Setting<std::string> report_api_url{linkage, "https://yuzu-cms.ddev.site", "report_api_url",
Category::WebService};
Setting<std::string> yuzu_cookie{linkage, std::string(), "yuzu_cookie", Category::WebService};
Setting<std::string> report_user{linkage, std::string(), "report_user", Category::WebService};
// Add-Ons
std::map<u64, std::vector<std::string>> disabled_addons;

View File

@ -44,6 +44,10 @@ public:
[[nodiscard]] virtual std::string GetDeviceVendor() const = 0;
[[nodiscard]] virtual std::string GetDeviceModel() const = 0;
[[nodiscard]] virtual std::string GetDeviceDriverVersion() const = 0;
// Getter/setter functions:
// ------------------------

View File

@ -28,6 +28,14 @@ public:
return "NULL";
}
[[nodiscard]] std::string GetDeviceModel() const override {
return "NULL";
}
[[nodiscard]] std::string GetDeviceDriverVersion() const override {
return "NULL";
}
private:
Tegra::GPU& m_gpu;
RasterizerNull m_rasterizer;

View File

@ -687,6 +687,16 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
// program_manager.RestoreGuestPipeline();
}
std::string RendererOpenGL::GetDeviceModel() const {
return reinterpret_cast<char const*>(glGetString(GL_RENDERER));
}
std::string RendererOpenGL::GetDeviceDriverVersion() const {
std::string tmp{"OpenGL: "};
tmp += reinterpret_cast<char const*>(glGetString(GL_VERSION));
return tmp;
}
void RendererOpenGL::RenderScreenshot() {
if (!renderer_settings.screenshot_requested) {
return;

View File

@ -75,6 +75,10 @@ public:
return device.GetVendorName();
}
[[nodiscard]] std::string GetDeviceModel() const override;
[[nodiscard]] std::string GetDeviceDriverVersion() const override;
private:
/// Initializes the OpenGL state and creates persistent objects.
void InitOpenGLObjects();

View File

@ -116,6 +116,16 @@ RendererVulkan::~RendererVulkan() {
void(device.GetLogical().WaitIdle());
}
std::string RendererVulkan::GetDeviceModel() const {
return std::string{device.GetModelName()};
}
std::string RendererVulkan::GetDeviceDriverVersion() const {
std::string tmp{"Vulkan: "};
tmp += GetReadableVersion(device.ApiVersion());
return tmp;
}
void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
if (!framebuffer) {
return;

View File

@ -56,6 +56,10 @@ public:
return device.GetDriverName();
}
[[nodiscard]] std::string GetDeviceModel() const override;
[[nodiscard]] std::string GetDeviceDriverVersion() const override;
private:
void Report() const;

View File

@ -35,7 +35,6 @@ add_executable(yuzu
applets/qt_web_browser_scripts.h
bootmanager.cpp
bootmanager.h
compatdb.ui
compatibility_list.cpp
compatibility_list.h
configuration/configuration_shared.cpp

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +1,382 @@
// SPDX-FileCopyrightText: 2017 Citra Emulator Project
// SPDX-FileCopyrightText: 2023 Yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <memory>
#include <QFutureWatcher>
#include <QButtonGroup>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QListWidgetItem>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QProgressBar>
#include <QPushButton>
#include <QRadioButton>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QVariant>
#include <QWizard>
#include <QWizardPage>
#include <nlohmann/json.hpp>
#include "common/settings.h"
#include "core/telemetry_session.h"
namespace Ui {
class CompatDB;
}
using json = nlohmann::json;
using DirectCreatorUploadResponses = std::array<json, 3>;
enum class CompatibilityStatus {
Perfect = 0,
Playable = 1,
// Unused: Okay = 2,
Ingame = 3,
IntroMenu = 4,
WontBoot = 5,
Perfect = 7,
Playable = 8,
Ingame = 9,
IntroMenu = 10,
WontBoot = 11,
};
class IntroPage : public QWizardPage {
Q_OBJECT
public:
IntroPage(std::string* host_, std::string* username_, std::string* token_, std::string* cookie_,
std::string* current_user_, QNetworkAccessManager& network_manager_,
QWidget* parent = nullptr);
bool isComplete() const override;
void OnLogin(QNetworkReply* reply);
void OnLogout(QNetworkReply* reply);
void Login();
void Logout();
signals:
void UserChange();
void NetworkError(QString error);
void ClearErrors();
void LoggedOut();
private:
QLabel* cookie_verified;
QString login;
QString logout;
QString ready;
QPushButton* report_login;
QPushButton* report_logout;
QRadioButton* login_yes;
QLabel* header;
QVBoxLayout* layout;
QHBoxLayout* h_layout;
std::string* host;
std::string* username;
std::string* token;
std::string* cookie;
std::string* current_user;
QNetworkAccessManager& network_manager;
};
class BootPage : public QWizardPage {
Q_OBJECT
public:
BootPage(QWidget* parent = nullptr);
bool isComplete() const override;
private:
QButtonGroup* game_boot;
QRadioButton* game_boot_yes;
QRadioButton* game_boot_no;
QLabel* header;
QVBoxLayout* layout;
};
class GamePlayPage : public QWizardPage {
Q_OBJECT
public:
GamePlayPage(QWidget* parent = nullptr);
bool isComplete() const override;
private:
QButtonGroup* game_play;
QRadioButton* game_play_yes;
QRadioButton* game_play_no;
QLabel* header;
QVBoxLayout* layout;
};
class FreezePage : public QWizardPage {
Q_OBJECT
public:
FreezePage(QWidget* parent = nullptr);
bool isComplete() const override;
private:
QButtonGroup* freeze;
QRadioButton* freeze_yes;
QRadioButton* freeze_no;
QLabel* header;
QVBoxLayout* layout;
};
class CompletePage : public QWizardPage {
Q_OBJECT
public:
CompletePage(QWidget* parent = nullptr);
bool isComplete() const override;
private:
QButtonGroup* complete;
QRadioButton* complete_yes;
QRadioButton* complete_no;
QLabel* header;
QVBoxLayout* layout;
};
class GraphicalPage : public QWizardPage {
Q_OBJECT
public:
GraphicalPage(QWidget* parent = nullptr);
bool isComplete() const override;
private:
QButtonGroup* graphical;
QRadioButton* graphical_major;
QRadioButton* graphical_minor;
QRadioButton* graphical_none;
QLabel* header;
QVBoxLayout* layout;
};
class AudioPage : public QWizardPage {
Q_OBJECT
public:
AudioPage(QWidget* parent = nullptr);
bool isComplete() const override;
private:
QButtonGroup* audio;
QRadioButton* audio_major;
QRadioButton* audio_minor;
QRadioButton* audio_none;
QLabel* header;
QVBoxLayout* layout;
};
class CommentPage : public QWizardPage {
Q_OBJECT
public:
CommentPage(QWidget* parent = nullptr);
bool isComplete() const override;
private:
QButtonGroup* comment;
QRadioButton* comment_yes;
QRadioButton* comment_no;
QTextEdit* editor;
QLabel* header;
QVBoxLayout* layout;
};
class ReviewPage : public QWizardPage {
Q_OBJECT
public:
ReviewPage(std::string* host_, std::string* cookie_, std::string* csrf_,
std::string yuzu_version_, std::string game_version_, std::string program_id_,
std::string cpu_model_, std::string cpu_brand_string_, std::string ram_,
std::string swap_, std::string gpu_vendor_, std::string gpu_model_,
std::string gpu_version_, std::string os_, Settings::Values& settings_values_,
QNetworkAccessManager& network_manager_, QWidget* parent = nullptr);
CompatibilityStatus CalculateCompatibility() const;
bool isComplete() const override;
void initializePage() override;
void CSRF();
void OnCSRF(QNetworkReply* reply);
void EnableSend(const QString& text);
void Send();
void OnSend(QNetworkReply* reply);
signals:
void NetworkError(QString error);
void ClearErrors();
void ReportMade(QByteArray review);
void SetCSRF(QByteArray csrf_);
private:
QRadioButton* report_sent;
QPushButton* report_send;
QVBoxLayout* layout;
QLabel* review;
QLabel* label;
QLineEdit* label_edit;
QLabel* comment;
QLabel* comment_view;
QLabel* rating;
QLabel* rating_view;
json report;
std::string yuzu_version;
std::string game_version;
std::string program_id;
std::string cpu_model;
std::string cpu_brand_string;
std::string ram;
std::string swap;
std::string gpu_vendor;
std::string gpu_model;
std::string gpu_version;
std::string os;
std::string* host;
std::string* cookie;
std::string* csrf;
QNetworkAccessManager& network_manager;
Settings::Values& settings_values;
};
class ScreenshotsPage : public QWizardPage {
Q_OBJECT
public:
friend class QVariant;
ScreenshotsPage(std::string* host_, std::string* cookie_, std::string* csrf_,
std::string* report_, std::string screenshot_path_,
QNetworkAccessManager& network_manager_, QWidget* parent = nullptr);
bool isComplete() const override;
void initializePage() override;
void UploadFiles();
void RemoveFiles();
void OnUploadURL(QNetworkReply* reply);
void GetUploadURL();
void OnUpload(QNetworkReply* reply);
void OnEdit(QNetworkReply* reply);
void EditReport();
void Checked() {
bool vis = false;
for (int i = 0; i < file_list->count(); i++) {
auto item_ = file_list->item(i);
if (item_->checkState() == Qt::Checked) {
vis = true;
}
}
upload->setVisible(vis);
}
signals:
void NetworkError(QString error);
void ClearErrors();
void ReportChange(QByteArray report_);
public slots:
void UploadProgress(qint64 bytesSent, qint64 bytesTotal);
void PickFiles();
void PickItems(QListWidgetItem* item);
private:
QRadioButton* edit_sent;
QButtonGroup* screenshots;
QRadioButton* screenshots_yes;
QRadioButton* screenshots_no;
QPushButton* upload;
QPushButton* del;
QLabel* info;
QLabel* status;
QLabel* header;
QVBoxLayout* layout;
QFileDialog* file_picker;
QListWidget* file_list;
std::string screenshot_path;
std::string* host;
std::string* cookie;
std::string* csrf;
std::string* report;
json json_report;
QProgressBar* upload_progress;
QNetworkAccessManager& network_manager;
int imgs;
/**
* see:
* https://developers.cloudflare.com/images/cloudflare-images/upload-images/direct-creator-upload/
*/
DirectCreatorUploadResponses dcus;
int uploaded;
int failed;
const QString file_filter =
QString::fromLatin1("PNG (*.png);;JPEG (*.jpg *.jpeg);;WEBP (*.webp)");
};
class ThankYouPage : public QWizardPage {
Q_OBJECT
public:
ThankYouPage(QWidget* parent = nullptr);
};
class CompatDB : public QWizard {
Q_OBJECT
public:
explicit CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent = nullptr);
~CompatDB();
explicit CompatDB(std::string yuzu_verison_, std::string game_version_, std::string program_id_,
std::string cpu_model_, std::string cpu_brand_string_, std::string ram_,
std::string swap_, std::string gpu_vendor_, std::string gpu_model_,
std::string gpu_version_, std::string os_, Settings::Values& settings_values_,
std::string screenshot_path_, QWidget* parent = nullptr);
~CompatDB() = default;
int nextId() const override;
private:
QFutureWatcher<bool> testcase_watcher;
std::unique_ptr<Ui::CompatDB> ui;
void Submit();
CompatibilityStatus CalculateCompatibility() const;
void OnTestcaseSubmitted();
void EnableNext();
Core::TelemetrySession& telemetry_session;
enum {
Page_Intro,
Page_GameBoot,
Page_GamePlay,
Page_Freeze,
Page_Complete,
Page_Graphical,
Page_Audio,
Page_Comment,
Page_Review,
Page_Screenshots,
Page_ThankYou
};
public slots:
void OnUserChange();
void NetworkError(QString error);
void Logout();
void ClearErrors();
void SetCSRFToken(QByteArray csrrf_);
void ReportMade(QByteArray report_);
signals:
void UserChange(QString cookie, QString user);
private:
QLabel* network_errors;
std::string host;
std::string username;
std::string token;
std::string cookie;
std::string csrf_token;
std::string current_user;
std::string report;
QNetworkAccessManager* network_manager;
};

View File

@ -1,398 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CompatDB</class>
<widget class="QWizard" name="CompatDB">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>482</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>410</height>
</size>
</property>
<property name="windowTitle">
<string>Report Compatibility</string>
</property>
<property name="options">
<set>QWizard::DisabledBackButtonOnLastPage|QWizard::HelpButtonOnRight|QWizard::NoBackButtonOnStartPage</set>
</property>
<widget class="QWizardPage" name="wizard_Info">
<property name="title">
<string>Report Game Compatibility</string>
</property>
<attribute name="pageId">
<string notr="true">0</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="lbl_Spiel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Should you choose to submit a test case to the &lt;/span&gt;&lt;a href=&quot;https://yuzu-emu.org/game/&quot;&gt;&lt;span style=&quot; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;yuzu Compatibility List&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;, The following information will be collected and displayed on the site:&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Hardware Information (CPU / GPU / Operating System)&lt;/li&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Which version of yuzu you are running&lt;/li&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The connected yuzu account&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizard_GameBoot">
<property name="title">
<string>Report Game Compatibility</string>
</property>
<attribute name="pageId">
<string notr="true">1</string>
</attribute>
<layout class="QFormLayout" name="formLayout1">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lbl_Independent1">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Does the game boot?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<spacer name="verticalSpacer1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="radioButton_GameBoot_Yes">
<property name="text">
<string>Yes The game starts to output video or audio</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="radioButton_GameBoot_No">
<property name="text">
<string>No The game doesn't get past the &quot;Launching...&quot; screen</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizard_GamePlay">
<property name="title">
<string>Report Game Compatibility</string>
</property>
<attribute name="pageId">
<string notr="true">2</string>
</attribute>
<layout class="QFormLayout" name="formLayout2">
<item row="2" column="0">
<widget class="QRadioButton" name="radioButton_Gameplay_Yes">
<property name="text">
<string>Yes The game gets past the intro/menu and into gameplay</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="radioButton_Gameplay_No">
<property name="text">
<string>No The game crashes or freezes while loading or using the menu</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lbl_Independent2">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Does the game reach gameplay?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<spacer name="verticalSpacer2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizard_NoFreeze">
<property name="title">
<string>Report Game Compatibility</string>
</property>
<attribute name="pageId">
<string notr="true">3</string>
</attribute>
<layout class="QFormLayout" name="formLayout3">
<item row="2" column="0">
<widget class="QRadioButton" name="radioButton_NoFreeze_Yes">
<property name="text">
<string>Yes The game works without crashes</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="radioButton_NoFreeze_No">
<property name="text">
<string>No The game crashes or freezes during gameplay</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lbl_Independent3">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Does the game work without crashing, freezing or locking up during gameplay?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<spacer name="verticalSpacer3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizard_Complete">
<property name="title">
<string>Report Game Compatibility</string>
</property>
<attribute name="pageId">
<string notr="true">4</string>
</attribute>
<layout class="QFormLayout" name="formLayout4">
<item row="2" column="0">
<widget class="QRadioButton" name="radioButton_Complete_Yes">
<property name="text">
<string>Yes The game can be finished without any workarounds</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="radioButton_Complete_No">
<property name="text">
<string>No The game can't progress past a certain area</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lbl_Independent4">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Is the game completely playable from start to finish?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<spacer name="verticalSpacer4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizard_Graphical">
<property name="title">
<string>Report Game Compatibility</string>
</property>
<attribute name="pageId">
<string notr="true">5</string>
</attribute>
<layout class="QFormLayout" name="formLayout5">
<item row="2" column="0">
<widget class="QRadioButton" name="radioButton_Graphical_Major">
<property name="text">
<string>Major The game has major graphical errors</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="radioButton_Graphical_Minor">
<property name="text">
<string>Minor The game has minor graphical errors</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QRadioButton" name="radioButton_Graphical_No">
<property name="text">
<string>None Everything is rendered as it looks on the Nintendo Switch</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lbl_Independent5">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Does the game have any graphical glitches?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<spacer name="verticalSpacer5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizard_Audio">
<property name="title">
<string>Report Game Compatibility</string>
</property>
<attribute name="pageId">
<string notr="true">6</string>
</attribute>
<layout class="QFormLayout" name="formLayout6">
<item row="2" column="0">
<widget class="QRadioButton" name="radioButton_Audio_Major">
<property name="text">
<string>Major The game has major audio errors</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QRadioButton" name="radioButton_Audio_Minor">
<property name="text">
<string>Minor The game has minor audio errors</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QRadioButton" name="radioButton_Audio_No">
<property name="text">
<string>None Audio is played perfectly</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lbl_Independent6">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Does the game have any audio glitches / missing effects?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<spacer name="verticalSpacer6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWizardPage" name="wizard_ThankYou">
<property name="title">
<string>Thank you for your submission!</string>
</property>
<attribute name="pageId">
<string notr="true">7</string>
</attribute>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -42,6 +42,7 @@ ConfigureWeb::ConfigureWeb(QWidget* parent)
&ConfigureWeb::RefreshTelemetryID);
connect(ui->button_verify_login, &QPushButton::clicked, this, &ConfigureWeb::VerifyLogin);
connect(&verify_watcher, &QFutureWatcher<bool>::finished, this, &ConfigureWeb::OnLoginVerified);
connect(ui->button_change_url, &QPushButton::clicked, this, &ConfigureWeb::ChangeURL);
#ifndef USE_DISCORD_PRESENCE
ui->discord_group->setVisible(false);
@ -93,6 +94,7 @@ void ConfigureWeb::SetConfiguration() {
ui->username->setText(QString::fromStdString(Settings::values.yuzu_username.GetValue()));
}
ui->edit_url->setText(QString::fromStdString(Settings::values.report_api_url.GetValue()));
ui->toggle_telemetry->setChecked(Settings::values.enable_telemetry.GetValue());
ui->edit_token->setText(QString::fromStdString(GenerateDisplayToken(
Settings::values.yuzu_username.GetValue(), Settings::values.yuzu_token.GetValue())));
@ -178,3 +180,7 @@ void ConfigureWeb::SetWebServiceConfigEnabled(bool enabled) {
ui->label_disable_info->setVisible(!enabled);
ui->groupBoxWebConfig->setEnabled(enabled);
}
void ConfigureWeb::ChangeURL() {
Settings::values.report_api_url = ui->edit_url->text().toStdString();
}

View File

@ -32,6 +32,8 @@ private:
void SetConfiguration();
void ChangeURL();
bool user_verified = true;
QFutureWatcher<bool> verify_watcher;

View File

@ -109,6 +109,53 @@
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayoutYuzureport">
<item row="2" column="3">
<widget class="QPushButton" name="button_change_url">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_url">
<property name="text">
<string>URL: </string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QLineEdit" name="edit_url">
<property name="maxLength">
<number>80</number>
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>

View File

@ -3617,6 +3617,12 @@ void GMainWindow::ErrorDisplayRequestExit() {
}
}
void GMainWindow::OnReportUserChange(QString cookie_, QString user_) {
Settings::values.yuzu_cookie = cookie_.toStdString();
Settings::values.report_user = user_.toStdString();
config->SaveAllValues();
}
void GMainWindow::OnMenuReportCompatibility() {
#if defined(ARCHITECTURE_x86_64) && !defined(__APPLE__)
const auto& caps = Common::GetCPUCaps();
@ -3635,7 +3641,64 @@ void GMainWindow::OnMenuReportCompatibility() {
if (!Settings::values.yuzu_token.GetValue().empty() &&
!Settings::values.yuzu_username.GetValue().empty()) {
CompatDB compatdb{system->TelemetrySession(), this};
Loader::AppLoader& app_loader = system->GetAppLoader();
FileSys::ContentProvider& content_provider = system->GetContentProvider();
Service::FileSystem::FileSystemController& fsc = system->GetFileSystemController();
u64 program_id{};
std::string game_version;
std::string formatted_program_id;
const Loader::ResultStatus res{app_loader.ReadProgramId(program_id)};
if (res == Loader::ResultStatus::Success) {
formatted_program_id = fmt::format("{:016X}", program_id);
FileSys::NACP control;
app_loader.ReadControlData(control);
game_version = control.GetVersionString();
if (game_version.empty()) {
const auto metadata = [&content_provider, &fsc, program_id] {
const FileSys::PatchManager pm{program_id, fsc, content_provider};
return pm.GetControlMetadata();
}();
if (auto meta = metadata.first.get(); meta != nullptr) {
game_version = meta->GetVersionString();
}
}
}
std::string yuzu_version = std::string{Common::g_build_name};
if (yuzu_version.empty()) {
yuzu_version = std::string{Common::g_scm_branch};
}
std::string cpu_model{caps.cpu_string};
std::string cpu_brand_string{caps.brand_string};
std::string ram =
fmt::format("{:.2f} GiB", Common::GetMemInfo().TotalPhysicalMemory / f64{1_GiB});
std::string swap =
fmt::format("{:.2f} GiB", Common::GetMemInfo().TotalSwapMemory / f64{1_GiB});
std::string os = PrettyProductName().toStdString();
const auto& renderer = system->GPU().Renderer();
const auto gpu_vendor = renderer.GetDeviceVendor();
const auto gpu_model = renderer.GetDeviceModel();
const auto gpu_version = renderer.GetDeviceDriverVersion();
CompatDB compatdb{yuzu_version,
game_version,
formatted_program_id,
cpu_model,
cpu_brand_string,
ram,
swap,
gpu_vendor,
gpu_model,
gpu_version,
os,
Settings::values,
Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir),
this};
connect(&compatdb, &CompatDB::UserChange, this, &GMainWindow::OnReportUserChange);
compatdb.exec();
} else {
QMessageBox::critical(

View File

@ -262,6 +262,7 @@ public slots:
void WebBrowserRequestExit();
void OnAppFocusStateChanged(Qt::ApplicationState state);
void OnTasStateChanged();
void OnReportUserChange(QString cookie, QString user);
private:
/// Updates an action's shortcut and text to reflect an updated hotkey from the hotkey registry.