summaryrefslogtreecommitdiff
path: root/src/yuzu/configuration
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/configuration')
-rw-r--r--src/yuzu/configuration/config.cpp4
-rw-r--r--src/yuzu/configuration/configure_network.cpp117
-rw-r--r--src/yuzu/configuration/configure_network.h5
-rw-r--r--src/yuzu/configuration/configure_network.ui86
-rw-r--r--src/yuzu/configuration/configure_tas.cpp1
-rw-r--r--src/yuzu/configuration/configure_tas.ui333
6 files changed, 188 insertions, 358 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index b5796a8fc..eb941ce02 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -709,8 +709,6 @@ void Config::ReadDebuggingValues() {
void Config::ReadServiceValues() {
qt_config->beginGroup(QStringLiteral("Services"));
- ReadBasicSetting(Settings::values.bcat_backend);
- ReadBasicSetting(Settings::values.bcat_boxcat_local);
ReadBasicSetting(Settings::values.network_interface);
qt_config->endGroup();
}
@@ -1269,8 +1267,6 @@ void Config::SaveDebuggingValues() {
void Config::SaveNetworkValues() {
qt_config->beginGroup(QStringLiteral("Services"));
- WriteBasicSetting(Settings::values.bcat_backend);
- WriteBasicSetting(Settings::values.bcat_boxcat_local);
WriteBasicSetting(Settings::values.network_interface);
qt_config->endGroup();
diff --git a/src/yuzu/configuration/configure_network.cpp b/src/yuzu/configuration/configure_network.cpp
index ae22f1018..cc15d36c2 100644
--- a/src/yuzu/configuration/configure_network.cpp
+++ b/src/yuzu/configuration/configure_network.cpp
@@ -6,64 +6,25 @@
#include <QtConcurrent/QtConcurrent>
#include "common/settings.h"
#include "core/core.h"
-#include "core/hle/service/bcat/backend/boxcat.h"
#include "core/network/network_interface.h"
#include "ui_configure_network.h"
#include "yuzu/configuration/configure_network.h"
-#ifdef YUZU_ENABLE_BOXCAT
-namespace {
-QString FormatEventStatusString(const Service::BCAT::EventStatus& status) {
- QString out;
-
- if (status.header.has_value()) {
- out += QStringLiteral("<i>%1</i><br>").arg(QString::fromStdString(*status.header));
- }
-
- if (status.events.size() == 1) {
- out += QStringLiteral("%1<br>").arg(QString::fromStdString(status.events.front()));
- } else {
- for (const auto& event : status.events) {
- out += QStringLiteral("- %1<br>").arg(QString::fromStdString(event));
- }
- }
-
- if (status.footer.has_value()) {
- out += QStringLiteral("<i>%1</i><br>").arg(QString::fromStdString(*status.footer));
- }
-
- return out;
-}
-} // Anonymous namespace
-#endif
-
ConfigureNetwork::ConfigureNetwork(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureNetwork>()) {
ui->setupUi(this);
- ui->bcat_source->addItem(QStringLiteral("None"));
- ui->bcat_empty_label->setHidden(true);
- ui->bcat_empty_header->setHidden(true);
-
-#ifdef YUZU_ENABLE_BOXCAT
- ui->bcat_source->addItem(QStringLiteral("Boxcat"), QStringLiteral("boxcat"));
-#endif
-
ui->network_interface->addItem(tr("None"));
for (const auto& iface : Network::GetAvailableNetworkInterfaces()) {
ui->network_interface->addItem(QString::fromStdString(iface.name));
}
- connect(ui->bcat_source, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
- &ConfigureNetwork::OnBCATImplChanged);
-
this->SetConfiguration();
}
ConfigureNetwork::~ConfigureNetwork() = default;
void ConfigureNetwork::ApplyConfiguration() {
- Settings::values.bcat_backend = ui->bcat_source->currentText().toLower().toStdString();
Settings::values.network_interface = ui->network_interface->currentText().toStdString();
}
@@ -74,86 +35,8 @@ void ConfigureNetwork::RetranslateUi() {
void ConfigureNetwork::SetConfiguration() {
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
- const int index =
- ui->bcat_source->findData(QString::fromStdString(Settings::values.bcat_backend.GetValue()));
- ui->bcat_source->setCurrentIndex(index == -1 ? 0 : index);
-
const std::string& network_interface = Settings::values.network_interface.GetValue();
ui->network_interface->setCurrentText(QString::fromStdString(network_interface));
ui->network_interface->setEnabled(runtime_lock);
}
-
-std::pair<QString, QString> ConfigureNetwork::BCATDownloadEvents() {
-#ifdef YUZU_ENABLE_BOXCAT
- std::optional<std::string> global;
- std::map<std::string, Service::BCAT::EventStatus> map;
- const auto res = Service::BCAT::Boxcat::GetStatus(global, map);
-
- switch (res) {
- case Service::BCAT::Boxcat::StatusResult::Success:
- break;
- case Service::BCAT::Boxcat::StatusResult::Offline:
- return {QString{},
- tr("The boxcat service is offline or you are not connected to the internet.")};
- case Service::BCAT::Boxcat::StatusResult::ParseError:
- return {QString{},
- tr("There was an error while processing the boxcat event data. Contact the yuzu "
- "developers.")};
- case Service::BCAT::Boxcat::StatusResult::BadClientVersion:
- return {QString{},
- tr("The version of yuzu you are using is either too new or too old for the server. "
- "Try updating to the latest official release of yuzu.")};
- }
-
- if (map.empty()) {
- return {QStringLiteral("Current Boxcat Events"),
- tr("There are currently no events on boxcat.")};
- }
-
- QString out;
-
- if (global.has_value()) {
- out += QStringLiteral("%1<br>").arg(QString::fromStdString(*global));
- }
-
- for (const auto& [key, value] : map) {
- out += QStringLiteral("%1<b>%2</b><br>%3")
- .arg(out.isEmpty() ? QString{} : QStringLiteral("<br>"))
- .arg(QString::fromStdString(key))
- .arg(FormatEventStatusString(value));
- }
- return {tr("Current Boxcat Events"), std::move(out)};
-#else
- return {tr("Current Boxcat Events"), tr("There are currently no events on boxcat.")};
-#endif
-}
-
-void ConfigureNetwork::OnBCATImplChanged() {
-#ifdef YUZU_ENABLE_BOXCAT
- const auto boxcat = ui->bcat_source->currentText() == QStringLiteral("Boxcat");
- ui->bcat_empty_header->setHidden(!boxcat);
- ui->bcat_empty_label->setHidden(!boxcat);
- ui->bcat_empty_header->setText(QString{});
- ui->bcat_empty_label->setText(tr("Yuzu is retrieving the latest boxcat status..."));
-
- if (!boxcat)
- return;
-
- const auto future = QtConcurrent::run([this] { return BCATDownloadEvents(); });
-
- watcher.setFuture(future);
- connect(&watcher, &QFutureWatcher<std::pair<QString, QString>>::finished, this,
- [this] { OnUpdateBCATEmptyLabel(watcher.result()); });
-#endif
-}
-
-void ConfigureNetwork::OnUpdateBCATEmptyLabel(std::pair<QString, QString> string) {
-#ifdef YUZU_ENABLE_BOXCAT
- const auto boxcat = ui->bcat_source->currentText() == QStringLiteral("Boxcat");
- if (boxcat) {
- ui->bcat_empty_header->setText(string.first);
- ui->bcat_empty_label->setText(string.second);
- }
-#endif
-}
diff --git a/src/yuzu/configuration/configure_network.h b/src/yuzu/configuration/configure_network.h
index 442b68e6b..028fd4acc 100644
--- a/src/yuzu/configuration/configure_network.h
+++ b/src/yuzu/configuration/configure_network.h
@@ -25,10 +25,5 @@ public:
private:
void SetConfiguration();
- std::pair<QString, QString> BCATDownloadEvents();
- void OnBCATImplChanged();
- void OnUpdateBCATEmptyLabel(std::pair<QString, QString> string);
-
std::unique_ptr<Ui::ConfigureNetwork> ui;
- QFutureWatcher<std::pair<QString, QString>> watcher{this};
};
diff --git a/src/yuzu/configuration/configure_network.ui b/src/yuzu/configuration/configure_network.ui
index 5f9b7e97b..9a79262f0 100644
--- a/src/yuzu/configuration/configure_network.ui
+++ b/src/yuzu/configuration/configure_network.ui
@@ -35,92 +35,6 @@
</layout>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>BCAT</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="3" column="0">
- <widget class="QLabel" name="bcat_empty_header">
- <property name="text">
- <string/>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>BCAT Backend</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" colspan="2">
- <widget class="QLabel" name="label_2">
- <property name="maximumSize">
- <size>
- <width>260</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>BCAT is Nintendo's way of sending data to games to engage its community and unlock additional content.</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1" colspan="2">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://yuzu-emu.org/help/feature/boxcat&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Learn more about BCAT, Boxcat, and Current Events&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <property name="openExternalLinks">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1" colspan="2">
- <widget class="QComboBox" name="bcat_source"/>
- </item>
- <item row="3" column="1" colspan="2">
- <widget class="QLabel" name="bcat_empty_label">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="maximumSize">
- <size>
- <width>260</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
</layout>
</item>
<item>
diff --git a/src/yuzu/configuration/configure_tas.cpp b/src/yuzu/configuration/configure_tas.cpp
index b666b175a..8e5a4c72d 100644
--- a/src/yuzu/configuration/configure_tas.cpp
+++ b/src/yuzu/configuration/configure_tas.cpp
@@ -18,6 +18,7 @@ ConfigureTasDialog::ConfigureTasDialog(QWidget* parent)
setFocusPolicy(Qt::ClickFocus);
setWindowTitle(tr("TAS Configuration"));
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
connect(ui->tas_path_button, &QToolButton::pressed, this,
[this] { SetDirectory(DirectoryTarget::TAS, ui->tas_path_edit); });
diff --git a/src/yuzu/configuration/configure_tas.ui b/src/yuzu/configuration/configure_tas.ui
index 95575ed9d..3972f9083 100644
--- a/src/yuzu/configuration/configure_tas.ui
+++ b/src/yuzu/configuration/configure_tas.ui
@@ -1,153 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>ConfigureTas</class>
- <widget class="QDialog" name="ConfigureTas">
- <layout class="QVBoxLayout" name="verticalLayout_1">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_1">
- <item>
- <widget class="QGroupBox" name="groupBox_1">
- <property name="title">
- <string>TAS</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_1">
- <item row="0" column="0" colspan="4">
- <widget class="QLabel" name="label_1">
- <property name="text">
- <string>Reads controller input from scripts in the same format as TAS-nx scripts.&lt;br/&gt;For a more detailed explanation please consult the FAQ on the yuzu website.</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0" colspan="4">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -> Hotkeys).</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="4">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>WARNING: This is an experimental feature.&lt;br/&gt;It will not play back scripts frame perfectly with the current, imperfect syncing method.</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QGroupBox" name="groupBox_2">
- <property name="title">
- <string>Settings</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0" colspan="4">
- <widget class="QCheckBox" name="tas_enable">
- <property name="text">
- <string>Enable TAS features</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0" colspan="4">
- <widget class="QCheckBox" name="tas_control_swap">
- <property name="text">
- <string>Automatic controller profile swapping</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="4">
- <widget class="QCheckBox" name="tas_loop_script">
- <property name="text">
- <string>Loop script</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="4">
- <widget class="QCheckBox" name="tas_pause_on_load">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Pause execution during loads</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="QGroupBox" name="groupBox_3">
- <property name="title">
- <string>Script Directory</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Path</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QToolButton" name="tas_path_button">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="tas_path_edit"/>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <class>ConfigureTas</class>
+ <widget class="QDialog" name="ConfigureTas">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>337</width>
+ <height>316</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_1">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_1">
+ <item>
+ <widget class="QGroupBox" name="groupBox_1">
+ <property name="title">
+ <string>TAS</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_1">
+ <item row="0" column="0" colspan="4">
+ <widget class="QLabel" name="label_1">
+ <property name="text">
+ <string>Reads controller input from scripts in the same format as TAS-nx scripts.&lt;br/&gt;For a more detailed explanation please consult the FAQ on the yuzu website.</string>
</property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="4">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -&gt; Hotkeys).</string>
</property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ <property name="wordWrap">
+ <bool>true</bool>
</property>
- </widget>
- </item>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="4">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>WARNING: This is an experimental feature.&lt;br/&gt;It will not play back scripts frame perfectly with the current, imperfect syncing method.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Settings</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0" colspan="4">
+ <widget class="QCheckBox" name="tas_enable">
+ <property name="text">
+ <string>Enable TAS features</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="4">
+ <widget class="QCheckBox" name="tas_control_swap">
+ <property name="text">
+ <string>Automatic controller profile swapping</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="4">
+ <widget class="QCheckBox" name="tas_loop_script">
+ <property name="text">
+ <string>Loop script</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="4">
+ <widget class="QCheckBox" name="tas_pause_on_load">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Pause execution during loads</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Script Directory</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Path</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QToolButton" name="tas_path_button">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLineEdit" name="tas_path_edit"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
</layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>ConfigureTas</receiver>
- <slot>accept()</slot>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>ConfigureTas</receiver>
- <slot>reject()</slot>
- </connection>
- </connections>
+ </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>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>ConfigureTas</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>ConfigureTas</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>