mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	Remove the telemetry (#45)
* remove the telemetry except from the renderers as I'm not being capable to remove it from there
* remove the telemetry except from the renderers as I'm not being capable to remove it from there
* Remove remainder of non-functional Telemetry and Citra Web Services
Squashed commit of the following:
commit f6dd4d4579c91db323877f0d08b9c01c82e1bb32
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 14:02:26 2024 -0600
    gl_driver.h: add back missing functions
commit 8f14384e7a7b763c3f2ccb3af6b5a59df641d9ee
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 13:56:16 2024 -0600
    gl_driver.cpp: add back missing functions
commit 5c802524b01a6eb05952d88ccf9dd78d63baee0a
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 13:39:46 2024 -0600
    apply clang-format
commit e8f62a7d3ee8a3da885a28bce21bcfcb84f13a84
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 13:16:22 2024 -0600
    remove web_tab
commit ced7f1e4909ae7b2714a96e3c3fa0500e8c62968
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 13:13:47 2024 -0600
    remove unused call?
commit f10e05da887e4570853fae2bd55a71087b4bcc77
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 13:03:47 2024 -0600
    fix build errors
commit 0489c1770b4b48d51f626145ae9235d3c81029fc
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 12:54:35 2024 -0600
    Remove deleted files
commit b2eb56f5a1f01663cc9874d99fe77ee64b48622b
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 12:43:17 2024 -0600
    Remove ConfigureWeb
commit b96f7c724006b2c5ee2272becaa70584fe90d012
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:49:51 2024 -0600
    remove unused DebugHandler
commit 91ddf16f63f9ae07b0cb2768171728dc878d1653
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:41:31 2024 -0600
    remove CollectToolingInfo() reference
commit 3909ac0502f23f8fb54944b53d5072b6986f8ffd
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:33:39 2024 -0600
    Fix "clean renderer_vulkan.cpp"
    This reverts commit 8a882658da9fabca40d71d73bfaf3bb5702acd72.
commit f4a10c4e4f27471b0a263ac363a6fa2abc9d6dc9
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:25:12 2024 -0600
    remove Core() references
commit 5593b8484e7c9f525ea218902dd2c13148d86b37
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:09:26 2024 -0600
    clean core/core.cpp
commit 55bbd8ad283297ef79db11e19ca6303fdfba6626
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:03:45 2024 -0600
    apply clang-format
commit 3707a0b2705dd415876130c9c90b0916bdea11db
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:02:16 2024 -0600
    citra_qt/main.h
commit ddbdea9be4d8179a333e04e7c302e215868715a9
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 11:01:30 2024 -0600
    clean common/detached_tasks.h
commit b513ba3b91ebc81bddd634b5690b6434824e1c7a
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:58:51 2024 -0600
    clean android/app/src/main/jni/default_ini.h
commit b6ba7d7cd730393883fdca294c651a4186727b55
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:58:14 2024 -0600
    clean android/app/src/main/jni/native.cpp
commit 2351305bb24b005920af0f3f7bb6bbb5bb3124bd
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:56:59 2024 -0600
    network/network_settings.h
commit 5b4c1ebb97c7fad5daf7789e1d3640041c2412fb
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:55:53 2024 -0600
    clean citra_qt/configuration/configure_web.ui
commit 9526d5122995c2e9c52b4d93b6e836a2ea4c80ef
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:54:53 2024 -0600
    citra_qt/configuration/config.cpp
commit ec6fe57412ce97e06096fc07f8b86dd080b7b944
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:53:50 2024 -0600
    clean citra/default_ini.h
commit acba1cf7e94de2fa87174e9f6d7c7c4554146352
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:52:47 2024 -0600
    clean citra/config.cpp
commit 02888777590d4e4bf1423e168a672ca0c5e140e5
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:50:42 2024 -0600
    clean vk_instance.cpp
commit eae451d5825b3601382c3a6dd08a3bde5c7a9460
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:48:53 2024 -0600
    clean vk_instanch.h
commit 8a882658da9fabca40d71d73bfaf3bb5702acd72
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:47:11 2024 -0600
    clean renderer_vulkan.cpp
commit ea6df111bc447913d2999acd86de984acced7eeb
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:45:51 2024 -0600
    clean renderer_opengl.cpp
commit 6b1bea0ef8cf8831c520d1c4e90b9d73d421c764
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:44:17 2024 -0600
    clean pica_to_gl.h
commit c12e984045a430cb10500241ada68701f73c85ac
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:42:48 2024 -0600
    clean gl_driver.h
commit ca3fe7801fff125a1ab8706bfc3998ca2928bded
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:40:14 2024 -0600
    clean gl_driver.cpp
commit d57381c38b217a423a7039bc7b413d79f59c2ff1
Author: Reg Tiangha <rtiangha@users.noreply.github.com>
Date:   Fri Mar 29 10:38:44 2024 -0600
    delete telemetry files
commit 1af826d1a045c5568a0d9ef4ca423514f298aee2
Author: Miguel <81558772+Miguel-hrvs@users.noreply.github.com>
Date:   Wed Mar 27 16:17:58 2024 +0100
    remove the telemetry except from the renderers as I'm not being capable to remove it from there
* rebase renderer_vulkan
* clean up renderer_vulkan
* bring back vulkan gpu logging
* clang-format vk_instance.h
* fix-formatting
---------
Co-authored-by: Reg Tiangha <rtiangha@users.noreply.github.com>
			
			
This commit is contained in:
		
							parent
							
								
									a442389a60
								
							
						
					
					
						commit
						8e35df1a6c
					
				
					 62 changed files with 49 additions and 4395 deletions
				
			
		|  | @ -81,9 +81,6 @@ add_executable(citra-qt | |||
|     configuration/configure_ui.cpp | ||||
|     configuration/configure_ui.h | ||||
|     configuration/configure_ui.ui | ||||
|     configuration/configure_web.cpp | ||||
|     configuration/configure_web.h | ||||
|     configuration/configure_web.ui | ||||
|     configuration/configure_cheats.cpp | ||||
|     configuration/configure_cheats.h | ||||
|     configuration/configure_cheats.ui | ||||
|  |  | |||
|  | @ -7,14 +7,12 @@ | |||
| #include <QPushButton> | ||||
| #include <QtConcurrent/qtconcurrentrun.h> | ||||
| #include "citra_qt/compatdb.h" | ||||
| #include "common/telemetry.h" | ||||
| #include "core/core.h" | ||||
| #include "core/telemetry_session.h" | ||||
| #include "ui_compatdb.h" | ||||
| 
 | ||||
| CompatDB::CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent) | ||||
| CompatDB::CompatDB(QWidget* parent) | ||||
|     : QWizard(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint), | ||||
|       ui{std::make_unique<Ui::CompatDB>()}, telemetry_session{telemetry_session_} { | ||||
|       ui{std::make_unique<Ui::CompatDB>()} { | ||||
|     ui->setupUi(this); | ||||
|     connect(ui->radioButton_Perfect, &QRadioButton::clicked, this, &CompatDB::EnableNext); | ||||
|     connect(ui->radioButton_Great, &QRadioButton::clicked, this, &CompatDB::EnableNext); | ||||
|  | @ -52,15 +50,11 @@ void CompatDB::Submit() { | |||
|     case CompatDBPage::Final: | ||||
|         back(); | ||||
|         LOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId()); | ||||
|         telemetry_session.AddField(Common::Telemetry::FieldType::UserFeedback, "Compatibility", | ||||
|                                    compatibility->checkedId()); | ||||
| 
 | ||||
|         button(NextButton)->setEnabled(false); | ||||
|         button(NextButton)->setText(tr("Submitting")); | ||||
|         button(CancelButton)->setVisible(false); | ||||
| 
 | ||||
|         testcase_watcher.setFuture( | ||||
|             QtConcurrent::run([this] { return telemetry_session.SubmitTestcase(); })); | ||||
|         break; | ||||
|     default: | ||||
|         LOG_ERROR(Frontend, "Unexpected page: {}", currentId()); | ||||
|  |  | |||
|  | @ -8,10 +8,6 @@ | |||
| #include <QFutureWatcher> | ||||
| #include <QWizard> | ||||
| 
 | ||||
| namespace Core { | ||||
| class TelemetrySession; | ||||
| } | ||||
| 
 | ||||
| namespace Ui { | ||||
| class CompatDB; | ||||
| } | ||||
|  | @ -20,7 +16,7 @@ class CompatDB : public QWizard { | |||
|     Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|     explicit CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent = nullptr); | ||||
|     explicit CompatDB(QWidget* parent = nullptr); | ||||
|     ~CompatDB(); | ||||
| 
 | ||||
| private: | ||||
|  | @ -31,6 +27,4 @@ private: | |||
|     void Submit(); | ||||
|     void OnTestcaseSubmitted(); | ||||
|     void EnableNext(); | ||||
| 
 | ||||
|     Core::TelemetrySession& telemetry_session; | ||||
| }; | ||||
|  |  | |||
|  | @ -837,8 +837,6 @@ void Config::ReadUpdaterValues() { | |||
| void Config::ReadWebServiceValues() { | ||||
|     qt_config->beginGroup(QStringLiteral("WebService")); | ||||
| 
 | ||||
|     NetSettings::values.enable_telemetry = | ||||
|         ReadSetting(QStringLiteral("enable_telemetry"), false).toBool(); | ||||
|     NetSettings::values.web_api_url = | ||||
|         ReadSetting(QStringLiteral("web_api_url"), QStringLiteral("https://api.citra-emu.org")) | ||||
|             .toString() | ||||
|  | @ -1319,7 +1317,6 @@ void Config::SaveUpdaterValues() { | |||
| void Config::SaveWebServiceValues() { | ||||
|     qt_config->beginGroup(QStringLiteral("WebService")); | ||||
| 
 | ||||
|     WriteSetting(QStringLiteral("enable_telemetry"), NetSettings::values.enable_telemetry, false); | ||||
|     WriteSetting(QStringLiteral("web_api_url"), | ||||
|                  QString::fromStdString(NetSettings::values.web_api_url), | ||||
|                  QStringLiteral("https://api.citra-emu.org")); | ||||
|  |  | |||
|  | @ -97,12 +97,6 @@ | |||
|    <header>configuration/configure_enhancements.h</header> | ||||
|    <container>1</container> | ||||
|   </customwidget> | ||||
|   <customwidget> | ||||
|    <class>ConfigureWeb</class> | ||||
|    <extends>QWidget</extends> | ||||
|    <header>configuration/configure_web.h</header> | ||||
|    <container>1</container> | ||||
|   </customwidget> | ||||
|   <customwidget> | ||||
|    <class>ConfigureUi</class> | ||||
|    <extends>QWidget</extends> | ||||
|  |  | |||
|  | @ -16,7 +16,6 @@ | |||
| #include "citra_qt/configuration/configure_storage.h" | ||||
| #include "citra_qt/configuration/configure_system.h" | ||||
| #include "citra_qt/configuration/configure_ui.h" | ||||
| #include "citra_qt/configuration/configure_web.h" | ||||
| #include "citra_qt/hotkeys.h" | ||||
| #include "common/settings.h" | ||||
| #include "core/core.h" | ||||
|  | @ -38,7 +37,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, Cor | |||
|       camera_tab{std::make_unique<ConfigureCamera>(this)}, | ||||
|       debug_tab{std::make_unique<ConfigureDebug>(is_powered_on, this)}, | ||||
|       storage_tab{std::make_unique<ConfigureStorage>(is_powered_on, this)}, | ||||
|       web_tab{std::make_unique<ConfigureWeb>(this)}, ui_tab{std::make_unique<ConfigureUi>(this)} { | ||||
|       ui_tab{std::make_unique<ConfigureUi>(this)} { | ||||
|     Settings::SetConfiguringGlobal(true); | ||||
| 
 | ||||
|     ui->setupUi(this); | ||||
|  | @ -53,11 +52,9 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, Cor | |||
|     ui->tabWidget->addTab(camera_tab.get(), tr("Camera")); | ||||
|     ui->tabWidget->addTab(debug_tab.get(), tr("Debug")); | ||||
|     ui->tabWidget->addTab(storage_tab.get(), tr("Storage")); | ||||
|     ui->tabWidget->addTab(web_tab.get(), tr("Web")); | ||||
|     ui->tabWidget->addTab(ui_tab.get(), tr("UI")); | ||||
| 
 | ||||
|     hotkeys_tab->Populate(registry); | ||||
|     web_tab->SetWebServiceConfigEnabled(enable_web_config); | ||||
| 
 | ||||
|     PopulateSelectionList(); | ||||
| 
 | ||||
|  | @ -90,7 +87,6 @@ void ConfigureDialog::SetConfiguration() { | |||
|     audio_tab->SetConfiguration(); | ||||
|     camera_tab->SetConfiguration(); | ||||
|     debug_tab->SetConfiguration(); | ||||
|     web_tab->SetConfiguration(); | ||||
|     ui_tab->SetConfiguration(); | ||||
|     storage_tab->SetConfiguration(); | ||||
| } | ||||
|  | @ -106,7 +102,6 @@ void ConfigureDialog::ApplyConfiguration() { | |||
|     audio_tab->ApplyConfiguration(); | ||||
|     camera_tab->ApplyConfiguration(); | ||||
|     debug_tab->ApplyConfiguration(); | ||||
|     web_tab->ApplyConfiguration(); | ||||
|     ui_tab->ApplyConfiguration(); | ||||
|     storage_tab->ApplyConfiguration(); | ||||
|     system.ApplySettings(); | ||||
|  | @ -119,7 +114,7 @@ void ConfigureDialog::PopulateSelectionList() { | |||
|     ui->selectorList->clear(); | ||||
| 
 | ||||
|     const std::array<std::pair<QString, QList<QWidget*>>, 5> items{ | ||||
|         {{tr("General"), {general_tab.get(), web_tab.get(), debug_tab.get(), ui_tab.get()}}, | ||||
|         {{tr("General"), {general_tab.get(), debug_tab.get(), ui_tab.get()}}, | ||||
|          {tr("System"), {system_tab.get(), camera_tab.get(), storage_tab.get()}}, | ||||
|          {tr("Graphics"), {enhancements_tab.get(), graphics_tab.get()}}, | ||||
|          {tr("Audio"), {audio_tab.get()}}, | ||||
|  | @ -159,7 +154,6 @@ void ConfigureDialog::RetranslateUI() { | |||
|     audio_tab->RetranslateUI(); | ||||
|     camera_tab->RetranslateUI(); | ||||
|     debug_tab->RetranslateUI(); | ||||
|     web_tab->RetranslateUI(); | ||||
|     ui_tab->RetranslateUI(); | ||||
|     storage_tab->RetranslateUI(); | ||||
| } | ||||
|  | @ -179,7 +173,6 @@ void ConfigureDialog::UpdateVisibleTabs() { | |||
|                                                  {camera_tab.get(), tr("Camera")}, | ||||
|                                                  {debug_tab.get(), tr("Debug")}, | ||||
|                                                  {storage_tab.get(), tr("Storage")}, | ||||
|                                                  {web_tab.get(), tr("Web")}, | ||||
|                                                  {ui_tab.get(), tr("UI")}}; | ||||
| 
 | ||||
|     ui->tabWidget->clear(); | ||||
|  |  | |||
|  | @ -29,7 +29,6 @@ class ConfigureAudio; | |||
| class ConfigureCamera; | ||||
| class ConfigureDebug; | ||||
| class ConfigureStorage; | ||||
| class ConfigureWeb; | ||||
| class ConfigureUi; | ||||
| 
 | ||||
| class ConfigureDialog : public QDialog { | ||||
|  | @ -70,6 +69,5 @@ private: | |||
|     std::unique_ptr<ConfigureCamera> camera_tab; | ||||
|     std::unique_ptr<ConfigureDebug> debug_tab; | ||||
|     std::unique_ptr<ConfigureStorage> storage_tab; | ||||
|     std::unique_ptr<ConfigureWeb> web_tab; | ||||
|     std::unique_ptr<ConfigureUi> ui_tab; | ||||
| }; | ||||
|  |  | |||
|  | @ -1,165 +0,0 @@ | |||
| // Copyright 2017 Citra Emulator Project
 | ||||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <QIcon> | ||||
| #include <QMessageBox> | ||||
| #include <QtConcurrent/QtConcurrentRun> | ||||
| #include "citra_qt/configuration/configure_web.h" | ||||
| #include "citra_qt/uisettings.h" | ||||
| #include "core/telemetry_session.h" | ||||
| #include "network/network_settings.h" | ||||
| #include "ui_configure_web.h" | ||||
| 
 | ||||
| static constexpr char token_delimiter{':'}; | ||||
| 
 | ||||
| static std::string GenerateDisplayToken(const std::string& username, const std::string& token) { | ||||
|     if (username.empty() || token.empty()) { | ||||
|         return {}; | ||||
|     } | ||||
| 
 | ||||
|     const std::string unencoded_display_token{username + token_delimiter + token}; | ||||
|     QByteArray b{unencoded_display_token.c_str()}; | ||||
|     QByteArray b64 = b.toBase64(); | ||||
|     return b64.toStdString(); | ||||
| } | ||||
| 
 | ||||
| static std::string UsernameFromDisplayToken(const std::string& display_token) { | ||||
|     const std::string unencoded_display_token{ | ||||
|         QByteArray::fromBase64(display_token.c_str()).toStdString()}; | ||||
|     return unencoded_display_token.substr(0, unencoded_display_token.find(token_delimiter)); | ||||
| } | ||||
| 
 | ||||
| static std::string TokenFromDisplayToken(const std::string& display_token) { | ||||
|     const std::string unencoded_display_token{ | ||||
|         QByteArray::fromBase64(display_token.c_str()).toStdString()}; | ||||
|     return unencoded_display_token.substr(unencoded_display_token.find(token_delimiter) + 1); | ||||
| } | ||||
| 
 | ||||
| ConfigureWeb::ConfigureWeb(QWidget* parent) | ||||
|     : QWidget(parent), ui(std::make_unique<Ui::ConfigureWeb>()) { | ||||
|     ui->setupUi(this); | ||||
|     connect(ui->button_regenerate_telemetry_id, &QPushButton::clicked, this, | ||||
|             &ConfigureWeb::RefreshTelemetryID); | ||||
|     connect(ui->button_verify_login, &QPushButton::clicked, this, &ConfigureWeb::VerifyLogin); | ||||
|     connect(&verify_watcher, &QFutureWatcher<bool>::finished, this, &ConfigureWeb::OnLoginVerified); | ||||
| 
 | ||||
| #ifndef USE_DISCORD_PRESENCE | ||||
|     ui->discord_group->setVisible(false); | ||||
| #endif | ||||
|     SetConfiguration(); | ||||
| } | ||||
| 
 | ||||
| ConfigureWeb::~ConfigureWeb() = default; | ||||
| 
 | ||||
| void ConfigureWeb::SetConfiguration() { | ||||
|     ui->web_credentials_disclaimer->setWordWrap(true); | ||||
|     ui->telemetry_learn_more->setOpenExternalLinks(true); | ||||
|     ui->telemetry_learn_more->setText(tr("<a " | ||||
|                                          "href='https://citra-emu.org/entry/" | ||||
|                                          "telemetry-and-why-thats-a-good-thing/'><span " | ||||
|                                          "style=\"text-decoration: underline; " | ||||
|                                          "color:#039be5;\">Learn more</span></a>")); | ||||
| 
 | ||||
|     ui->web_signup_link->setOpenExternalLinks(true); | ||||
|     ui->web_signup_link->setText( | ||||
|         tr("<a href='https://profile.citra-emu.org/'><span style=\"text-decoration: underline; " | ||||
|            "color:#039be5;\">Sign up</span></a>")); | ||||
|     ui->web_token_info_link->setOpenExternalLinks(true); | ||||
|     ui->web_token_info_link->setText( | ||||
|         tr("<a href='https://citra-emu.org/wiki/citra-web-service/'><span style=\"text-decoration: " | ||||
|            "underline; color:#039be5;\">What is my token?</span></a>")); | ||||
| 
 | ||||
|     ui->toggle_telemetry->setChecked(NetSettings::values.enable_telemetry); | ||||
| 
 | ||||
|     if (NetSettings::values.citra_username.empty()) { | ||||
|         ui->username->setText(tr("Unspecified")); | ||||
|     } else { | ||||
|         ui->username->setText(QString::fromStdString(NetSettings::values.citra_username)); | ||||
|     } | ||||
| 
 | ||||
|     ui->edit_token->setText(QString::fromStdString( | ||||
|         GenerateDisplayToken(NetSettings::values.citra_username, NetSettings::values.citra_token))); | ||||
| 
 | ||||
|     // Connect after setting the values, to avoid calling OnLoginChanged now
 | ||||
|     connect(ui->edit_token, &QLineEdit::textChanged, this, &ConfigureWeb::OnLoginChanged); | ||||
|     ui->label_telemetry_id->setText( | ||||
|         tr("Telemetry ID: 0x%1").arg(QString::number(Core::GetTelemetryId(), 16).toUpper())); | ||||
|     user_verified = true; | ||||
| 
 | ||||
|     ui->toggle_discordrpc->setChecked(UISettings::values.enable_discord_presence.GetValue()); | ||||
| } | ||||
| 
 | ||||
| void ConfigureWeb::ApplyConfiguration() { | ||||
|     NetSettings::values.enable_telemetry = ui->toggle_telemetry->isChecked(); | ||||
|     UISettings::values.enable_discord_presence = ui->toggle_discordrpc->isChecked(); | ||||
|     if (user_verified) { | ||||
|         NetSettings::values.citra_username = | ||||
|             UsernameFromDisplayToken(ui->edit_token->text().toStdString()); | ||||
|         NetSettings::values.citra_token = | ||||
|             TokenFromDisplayToken(ui->edit_token->text().toStdString()); | ||||
|     } else { | ||||
|         QMessageBox::warning( | ||||
|             this, tr("Token not verified"), | ||||
|             tr("Token was not verified. The change to your token has not been saved.")); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void ConfigureWeb::RefreshTelemetryID() { | ||||
|     const u64 new_telemetry_id{Core::RegenerateTelemetryId()}; | ||||
|     ui->label_telemetry_id->setText( | ||||
|         tr("Telemetry ID: 0x%1").arg(QString::number(new_telemetry_id, 16).toUpper())); | ||||
| } | ||||
| 
 | ||||
| void ConfigureWeb::OnLoginChanged() { | ||||
|     if (ui->edit_token->text().isEmpty()) { | ||||
|         user_verified = true; | ||||
| 
 | ||||
|         const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("checked")).pixmap(16); | ||||
|         ui->label_token_verified->setPixmap(pixmap); | ||||
|     } else { | ||||
|         user_verified = false; | ||||
| 
 | ||||
|         const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("failed")).pixmap(16); | ||||
|         ui->label_token_verified->setPixmap(pixmap); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void ConfigureWeb::VerifyLogin() { | ||||
|     ui->button_verify_login->setDisabled(true); | ||||
|     ui->button_verify_login->setText(tr("Verifying...")); | ||||
|     verify_watcher.setFuture(QtConcurrent::run( | ||||
|         [username = UsernameFromDisplayToken(ui->edit_token->text().toStdString()), | ||||
|          token = TokenFromDisplayToken(ui->edit_token->text().toStdString())] { | ||||
|             return Core::VerifyLogin(username, token); | ||||
|         })); | ||||
| } | ||||
| 
 | ||||
| void ConfigureWeb::OnLoginVerified() { | ||||
|     ui->button_verify_login->setEnabled(true); | ||||
|     ui->button_verify_login->setText(tr("Verify")); | ||||
|     if (verify_watcher.result()) { | ||||
|         user_verified = true; | ||||
| 
 | ||||
|         const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("checked")).pixmap(16); | ||||
|         ui->label_token_verified->setPixmap(pixmap); | ||||
|         ui->username->setText( | ||||
|             QString::fromStdString(UsernameFromDisplayToken(ui->edit_token->text().toStdString()))); | ||||
|     } else { | ||||
|         const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("failed")).pixmap(16); | ||||
|         ui->label_token_verified->setPixmap(pixmap); | ||||
|         ui->username->setText(tr("Unspecified")); | ||||
|         QMessageBox::critical(this, tr("Verification failed"), | ||||
|                               tr("Verification failed. Check that you have entered your token " | ||||
|                                  "correctly, and that your internet connection is working.")); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void ConfigureWeb::RetranslateUI() { | ||||
|     ui->retranslateUi(this); | ||||
| } | ||||
| 
 | ||||
| void ConfigureWeb::SetWebServiceConfigEnabled(bool enabled) { | ||||
|     ui->label_disable_info->setVisible(!enabled); | ||||
|     ui->groupBoxWebConfig->setEnabled(enabled); | ||||
| } | ||||
|  | @ -1,37 +0,0 @@ | |||
| // Copyright 2017 Citra Emulator Project
 | ||||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include <memory> | ||||
| #include <QFutureWatcher> | ||||
| #include <QWidget> | ||||
| 
 | ||||
| namespace Ui { | ||||
| class ConfigureWeb; | ||||
| } | ||||
| 
 | ||||
| class ConfigureWeb : public QWidget { | ||||
|     Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|     explicit ConfigureWeb(QWidget* parent = nullptr); | ||||
|     ~ConfigureWeb() override; | ||||
| 
 | ||||
|     void ApplyConfiguration(); | ||||
|     void RetranslateUI(); | ||||
|     void SetConfiguration(); | ||||
|     void SetWebServiceConfigEnabled(bool enabled); | ||||
| 
 | ||||
| private: | ||||
|     void RefreshTelemetryID(); | ||||
|     void OnLoginChanged(); | ||||
|     void VerifyLogin(); | ||||
|     void OnLoginVerified(); | ||||
| 
 | ||||
|     bool user_verified = true; | ||||
|     QFutureWatcher<bool> verify_watcher; | ||||
| 
 | ||||
|     std::unique_ptr<Ui::ConfigureWeb> ui; | ||||
| }; | ||||
|  | @ -1,214 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ui version="4.0"> | ||||
|  <class>ConfigureWeb</class> | ||||
|  <widget class="QWidget" name="ConfigureWeb"> | ||||
|   <property name="geometry"> | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>996</width> | ||||
|     <height>561</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|    <string>Form</string> | ||||
|   </property> | ||||
|   <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|    <item> | ||||
|     <layout class="QVBoxLayout" name="verticalLayout_3"> | ||||
|      <item> | ||||
|       <widget class="QGroupBox" name="groupBoxWebConfig"> | ||||
|        <property name="title"> | ||||
|         <string>Citra Web Service</string> | ||||
|        </property> | ||||
|        <layout class="QVBoxLayout" name="verticalLayoutCitraWebService"> | ||||
|         <item> | ||||
|          <widget class="QLabel" name="web_credentials_disclaimer"> | ||||
|           <property name="text"> | ||||
|            <string>By providing your username and token, you agree to allow Citra to collect additional usage data, which may include user identifying information.</string> | ||||
|           </property> | ||||
|          </widget> | ||||
|         </item> | ||||
|         <item> | ||||
|          <layout class="QGridLayout" name="gridLayoutCitraUsername"> | ||||
|           <item row="2" column="3"> | ||||
|            <widget class="QPushButton" name="button_verify_login"> | ||||
|             <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>Verify</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="2" column="0"> | ||||
|            <widget class="QLabel" name="web_signup_link"> | ||||
|             <property name="text"> | ||||
|              <string>Sign up</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="0" column="1" colspan="3"> | ||||
|            <widget class="QLabel" name="username"/> | ||||
|           </item> | ||||
|           <item row="1" column="0"> | ||||
|            <widget class="QLabel" name="label_token"> | ||||
|             <property name="text"> | ||||
|              <string>Token: </string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="1" column="4"> | ||||
|            <widget class="QLabel" name="label_token_verified"/> | ||||
|           </item> | ||||
|           <item row="0" column="0"> | ||||
|            <widget class="QLabel" name="label_username"> | ||||
|             <property name="text"> | ||||
|              <string>Username: </string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="1" column="1" colspan="3"> | ||||
|            <widget class="QLineEdit" name="edit_token"> | ||||
|             <property name="maxLength"> | ||||
|              <number>80</number> | ||||
|             </property> | ||||
|             <property name="echoMode"> | ||||
|              <enum>QLineEdit::Password</enum> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="2" column="1"> | ||||
|            <widget class="QLabel" name="web_token_info_link"> | ||||
|             <property name="text"> | ||||
|              <string>What is my token?</string> | ||||
|             </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> | ||||
|      <item> | ||||
|       <widget class="QLabel" name="label_disable_info"> | ||||
|        <property name="text"> | ||||
|         <string>Web Service configuration can only be changed when a public room isn't being hosted.</string> | ||||
|        </property> | ||||
|        <property name="wordWrap"> | ||||
|         <bool>true</bool> | ||||
|        </property> | ||||
|       </widget> | ||||
|      </item> | ||||
|      <item> | ||||
|       <widget class="QGroupBox" name="groupBox"> | ||||
|        <property name="title"> | ||||
|         <string>Telemetry</string> | ||||
|        </property> | ||||
|        <layout class="QVBoxLayout" name="verticalLayout_2"> | ||||
|         <item> | ||||
|          <widget class="QCheckBox" name="toggle_telemetry"> | ||||
|           <property name="text"> | ||||
|            <string>Share anonymous usage data with the Citra team</string> | ||||
|           </property> | ||||
|          </widget> | ||||
|         </item> | ||||
|         <item> | ||||
|          <widget class="QLabel" name="telemetry_learn_more"> | ||||
|           <property name="text"> | ||||
|            <string>Learn more</string> | ||||
|           </property> | ||||
|          </widget> | ||||
|         </item> | ||||
|         <item> | ||||
|          <layout class="QGridLayout" name="gridLayoutTelemetryId"> | ||||
|           <item row="0" column="0"> | ||||
|            <widget class="QLabel" name="label_telemetry_id"> | ||||
|             <property name="text"> | ||||
|              <string>Telemetry ID:</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="0" column="1"> | ||||
|            <widget class="QPushButton" name="button_regenerate_telemetry_id"> | ||||
|             <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>Regenerate</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|          </layout> | ||||
|         </item> | ||||
|        </layout> | ||||
|       </widget> | ||||
|      </item> | ||||
|     </layout> | ||||
|    </item> | ||||
|    <item> | ||||
|     <widget class="QGroupBox" name="discord_group"> | ||||
|      <property name="title"> | ||||
|       <string>Discord Presence</string> | ||||
|      </property> | ||||
|      <layout class="QVBoxLayout" name="verticalLayout_21"> | ||||
|       <item> | ||||
|        <widget class="QCheckBox" name="toggle_discordrpc"> | ||||
|         <property name="text"> | ||||
|          <string>Show Current Game in your Discord Status</string> | ||||
|         </property> | ||||
|        </widget> | ||||
|       </item> | ||||
|      </layout> | ||||
|     </widget> | ||||
|    </item> | ||||
|    <item> | ||||
|     <spacer name="verticalSpacer"> | ||||
|      <property name="orientation"> | ||||
|       <enum>Qt::Vertical</enum> | ||||
|      </property> | ||||
|      <property name="sizeHint" stdset="0"> | ||||
|       <size> | ||||
|        <width>20</width> | ||||
|        <height>40</height> | ||||
|       </size> | ||||
|      </property> | ||||
|     </spacer> | ||||
|    </item> | ||||
|   </layout> | ||||
|  </widget> | ||||
|  <tabstops> | ||||
|   <tabstop>edit_token</tabstop> | ||||
|   <tabstop>button_verify_login</tabstop> | ||||
|   <tabstop>toggle_telemetry</tabstop> | ||||
|   <tabstop>button_regenerate_telemetry_id</tabstop> | ||||
|   <tabstop>toggle_discordrpc</tabstop> | ||||
|  </tabstops> | ||||
|  <resources/> | ||||
|  <connections/> | ||||
| </ui> | ||||
|  | @ -15,7 +15,6 @@ | |||
| #include <QtGui> | ||||
| #include <QtWidgets> | ||||
| #include <fmt/format.h> | ||||
| #include "core/telemetry_session.h" | ||||
| #ifdef __APPLE__ | ||||
| #include <unistd.h> // for chdir
 | ||||
| #endif | ||||
|  | @ -128,27 +127,6 @@ constexpr int default_mouse_timeout = 2500; | |||
|  * is a bitfield "callout_flags" options, used to track if a message has already been shown to the | ||||
|  * user. This is 32-bits - if we have more than 32 callouts, we should retire and recycle old ones. | ||||
|  */ | ||||
| enum class CalloutFlag : uint32_t { | ||||
|     Telemetry = 0x1, | ||||
| }; | ||||
| 
 | ||||
| void GMainWindow::ShowTelemetryCallout() { | ||||
|     if (UISettings::values.callout_flags.GetValue() & | ||||
|         static_cast<uint32_t>(CalloutFlag::Telemetry)) { | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     UISettings::values.callout_flags = | ||||
|         UISettings::values.callout_flags.GetValue() | static_cast<uint32_t>(CalloutFlag::Telemetry); | ||||
|     const QString telemetry_message = | ||||
|         tr("<a href='https://citra-emu.org/entry/telemetry-and-why-thats-a-good-thing/'>Anonymous " | ||||
|            "data is collected</a> to help improve Citra. " | ||||
|            "<br/><br/>Would you like to share your usage data with us?"); | ||||
|     if (QMessageBox::question(this, tr("Telemetry"), telemetry_message) == QMessageBox::Yes) { | ||||
|         NetSettings::values.enable_telemetry = true; | ||||
|         system.ApplySettings(); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| const int GMainWindow::max_recent_files_item; | ||||
| 
 | ||||
|  | @ -263,9 +241,6 @@ GMainWindow::GMainWindow(Core::System& system_) | |||
|     game_list->LoadCompatibilityList(); | ||||
|     game_list->PopulateAsync(UISettings::values.game_dirs); | ||||
| 
 | ||||
|     // Show one-time "callout" messages to the user
 | ||||
|     ShowTelemetryCallout(); | ||||
| 
 | ||||
|     mouse_hide_timer.setInterval(default_mouse_timeout); | ||||
|     connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor); | ||||
|     connect(ui->menubar, &QMenuBar::hovered, this, &GMainWindow::OnMouseActivity); | ||||
|  | @ -1244,7 +1219,6 @@ bool GMainWindow::LoadROM(const QString& filename) { | |||
| 
 | ||||
|     game_path = filename; | ||||
| 
 | ||||
|     system.TelemetrySession().AddField(Common::Telemetry::FieldType::App, "Frontend", "Qt"); | ||||
|     return true; | ||||
| } | ||||
| 
 | ||||
|  | @ -1988,7 +1962,7 @@ void GMainWindow::OnLoadComplete() { | |||
| 
 | ||||
| void GMainWindow::OnMenuReportCompatibility() { | ||||
|     if (!NetSettings::values.citra_token.empty() && !NetSettings::values.citra_username.empty()) { | ||||
|         CompatDB compatdb{system.TelemetrySession(), this}; | ||||
|         CompatDB compatdb{this}; | ||||
|         compatdb.exec(); | ||||
|     } else { | ||||
|         QMessageBox::critical(this, tr("Missing Citra Account"), | ||||
|  |  | |||
|  | @ -152,7 +152,6 @@ private: | |||
|     void BootGame(const QString& filename); | ||||
|     void ShutdownGame(); | ||||
| 
 | ||||
|     void ShowTelemetryCallout(); | ||||
|     void SetDiscordEnabled(bool state); | ||||
|     void LoadAmiibo(const QString& filename); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue