mirror of https://git.suyu.dev/suyu/suyu
qt: Add web configuration tab.
parent
41328afb58
commit
fb17e866aa
@ -0,0 +1,44 @@
|
||||
// Copyright 2017 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "citra_qt/configuration/configure_web.h"
|
||||
#include "core/settings.h"
|
||||
#include "ui_configure_web.h"
|
||||
|
||||
ConfigureWeb::ConfigureWeb(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureWeb>()) {
|
||||
ui->setupUi(this);
|
||||
this->setConfiguration();
|
||||
}
|
||||
|
||||
ConfigureWeb::~ConfigureWeb() {}
|
||||
|
||||
void ConfigureWeb::setConfiguration() {
|
||||
ui->web_credentials_disclaimer->setWordWrap(true);
|
||||
ui->telemetry_learn_more->setOpenExternalLinks(true);
|
||||
ui->telemetry_learn_more->setText("<a "
|
||||
"href='https://citra-emu.org/entry/"
|
||||
"telemetry-and-why-thats-a-good-thing/'>Learn more</a>");
|
||||
|
||||
ui->web_signup_link->setOpenExternalLinks(true);
|
||||
ui->web_signup_link->setText("<a href='https://services.citra-emu.org/'>Sign up</a>");
|
||||
ui->web_token_info_link->setOpenExternalLinks(true);
|
||||
ui->web_token_info_link->setText(
|
||||
"<a href='https://citra-emu.org/wiki/citra-web-service/'>What is my token?</a>");
|
||||
|
||||
ui->toggle_telemetry->setChecked(Settings::values.enable_telemetry);
|
||||
ui->edit_username->setText(QString::fromStdString(Settings::values.citra_username));
|
||||
ui->edit_token->setText(QString::fromStdString(Settings::values.citra_token));
|
||||
|
||||
updateWeb();
|
||||
}
|
||||
|
||||
void ConfigureWeb::applyConfiguration() {
|
||||
Settings::values.enable_telemetry = ui->toggle_telemetry->isChecked();
|
||||
Settings::values.citra_username = ui->edit_username->text().toStdString();
|
||||
Settings::values.citra_token = ui->edit_token->text().toStdString();
|
||||
Settings::Apply();
|
||||
}
|
||||
|
||||
void ConfigureWeb::updateWeb() {}
|
@ -0,0 +1,30 @@
|
||||
// Copyright 2017 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureWeb;
|
||||
}
|
||||
|
||||
class ConfigureWeb : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureWeb(QWidget* parent = nullptr);
|
||||
~ConfigureWeb();
|
||||
|
||||
void applyConfiguration();
|
||||
|
||||
public slots:
|
||||
void updateWeb();
|
||||
|
||||
private:
|
||||
void setConfiguration();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureWeb> ui;
|
||||
};
|
@ -0,0 +1,126 @@
|
||||
<?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>400</width>
|
||||
<height>300</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="groupBox">
|
||||
<property name="title">
|
||||
<string>Citra Web Service</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<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="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_username">
|
||||
<property name="text">
|
||||
<string>Username: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="edit_username">
|
||||
<property name="maxLength">
|
||||
<number>36</number>
|
||||
</property>
|
||||
</widget>
|
||||
</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="1">
|
||||
<widget class="QLineEdit" name="edit_token">
|
||||
<property name="maxLength">
|
||||
<number>36</number>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</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="2" column="1">
|
||||
<widget class="QLabel" name="web_token_info_link">
|
||||
<property name="text">
|
||||
<string>What is my token?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</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>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</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>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in New Issue