mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-14 19:26:57 +02:00
fix a large variety of issues (#101)
- GLASM/SPIR-V mixup on Android - potential greenscreen fix (thx suyu) - save memory layout and add 10gb/12gb options - potential samsung gaming hub fix - fix layout of controller UI - fix default settings to sensible defaults. - note to TotK that you should increase memory layout - Error checking for Windows linking - fix an IDE error - improved migration system w/threading and busy indicator - disabled citron migration for now - replaced some user-facing legacy strings with eden - Added 10GB and 12GB DRAM layouts - Fix Android black screen issues - add discord link & update FAQ/Quickstart - update links in about page - add back rich presence - add Don't show again for desktop pre alpha banner - add citron warning to android and polaris to desktop Signed-off-by: swurl <swurl@swurl.xyz> Co-authored-by: Pavel Barabanov <pavelbarabanov94@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/101 Co-authored-by: swurl <swurl@swurl.xyz> Co-committed-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
5bbb9eba32
commit
7e943732bf
76 changed files with 1154 additions and 516 deletions
|
|
@ -238,6 +238,8 @@ add_executable(yuzu
|
|||
yuzu.qrc
|
||||
yuzu.rc
|
||||
migration_dialog.h migration_dialog.cpp
|
||||
migration_worker.h
|
||||
migration_worker.cpp
|
||||
)
|
||||
|
||||
set_target_properties(yuzu PROPERTIES OUTPUT_NAME "eden")
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ li.checked::marker { content: "\2612"; }
|
|||
<item>
|
||||
<widget class="QLabel" name="labelLinks">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><a href="https://yuzu-emu.org/"><span style=" text-decoration: underline; color:#039be5;">Website</span></a> | <a href="https://github.com/yuzu-emu"><span style=" text-decoration: underline; color:#039be5;">Source Code</span></a> | <a href="https://github.com/yuzu-emu/yuzu/graphs/contributors"><span style=" text-decoration: underline; color:#039be5;">Contributors</span></a> | <a href="https://github.com/yuzu-emu/yuzu/blob/master/LICENSE.txt"><span style=" text-decoration: underline; color:#039be5;">License</span></a></p></body></html></string>
|
||||
<string><html><head/><body><p><a href="https://eden-emulator.github.io/"><span style=" text-decoration: underline; color:#039be5;">Website</span></a> | <a href="https://git.eden-emu.dev"><span style=" text-decoration: underline; color:#039be5;">Source Code</span></a> | <a href="https://git.eden-emu.dev/eden-emu/eden/activity/contributors"><span style=" text-decoration: underline; color:#039be5;">Contributors</span></a> | <a href="https://git.eden-emu.dev/eden-emu/eden/src/branch/master/LICENSE.txt"><span style=" text-decoration: underline; color:#039be5;">License</span></a></p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
|
|||
Core::System& system_)
|
||||
: QWidget(parent),
|
||||
emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, system{system_} {
|
||||
setWindowTitle(QStringLiteral("yuzu %1 | %2-%3")
|
||||
setWindowTitle(QStringLiteral("eden %1 | %2-%3")
|
||||
.arg(QString::fromUtf8(Common::g_build_name),
|
||||
QString::fromUtf8(Common::g_scm_branch),
|
||||
QString::fromUtf8(Common::g_scm_desc)));
|
||||
|
|
@ -1137,4 +1137,4 @@ bool GRenderWindow::eventFilter(QObject* object, QEvent* event) {
|
|||
emit MouseActivity();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<string>Report Compatibility</string>
|
||||
</property>
|
||||
<property name="options">
|
||||
<set>QWizard::DisabledBackButtonOnLastPage|QWizard::HelpButtonOnRight|QWizard::NoBackButtonOnStartPage</set>
|
||||
<set>QWizard::WizardOption::DisabledBackButtonOnLastPage|QWizard::WizardOption::HelpButtonOnRight|QWizard::WizardOption::NoBackButtonOnStartPage</set>
|
||||
</property>
|
||||
<widget class="QWizardPage" name="wizard_Info">
|
||||
<property name="title">
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="lbl_Spiel">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:10pt;">Should you choose to submit a test case to the </span><a href="https://yuzu-emu.org/game/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">yuzu 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 yuzu 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 yuzu account</li></ul></body></html></string>
|
||||
<string><html><head/><body><p><span style=" font-size:10pt;">Should you choose to submit a test case to the </span><a href="https://eden-emulator.github.io/game/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">eden 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 eden 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 eden account</li></ul></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
@ -202,7 +202,7 @@
|
|||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
@ -254,7 +254,7 @@
|
|||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
@ -313,7 +313,7 @@
|
|||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
@ -372,7 +372,7 @@
|
|||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@
|
|||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="use_auto_stub">
|
||||
<property name="text">
|
||||
<string>Enable Auto-Stub**</string>
|
||||
<string>Enable Auto-Stub</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -553,7 +553,7 @@
|
|||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>**This will be reset automatically when yuzu closes.</string>
|
||||
<string>**This will be reset automatically when eden closes.</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>20</number>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>While it's recommended to use state 3, some games may perform better on lower states. Setting to 0 (disabled) may also break games.
|
||||
If your device doesn't support the selected state, the renderer will automatically disable the unsupported states.</string>
|
||||
If your GPU is older (i.e. RX570/580 or older), it may not support these features. If this is the case, set the slider to 0 and uncheck all boxes.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
|
|
|||
|
|
@ -2656,7 +2656,7 @@
|
|||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="enable_raw_input">
|
||||
<property name="toolTip">
|
||||
<string>Requires restarting yuzu</string>
|
||||
<string>Requires restarting eden</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
|
@ -2698,7 +2698,7 @@
|
|||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="enable_joycon_driver">
|
||||
<property name="toolTip">
|
||||
<string>Requires restarting yuzu</string>
|
||||
<string>Requires restarting eden</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
|
@ -2714,7 +2714,7 @@
|
|||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="enable_procon_driver">
|
||||
<property name="toolTip">
|
||||
<string>Requires restarting yuzu</string>
|
||||
<string>Requires restarting eden</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
|
|
|||
|
|
@ -1363,55 +1363,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="buttonMiscButtonsPlusGroup">
|
||||
<property name="title">
|
||||
<string>Plus</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="buttonMiscPlusVerticalLayout">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonPlus">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>68</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">min-width: 68px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Plus</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="buttonMiscButtonsMinusGroup">
|
||||
<property name="title">
|
||||
|
|
@ -1461,6 +1412,55 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="buttonMiscButtonsPlusGroup">
|
||||
<property name="title">
|
||||
<string>Plus</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="buttonMiscPlusVerticalLayout">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonPlus">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>68</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">min-width: 68px;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Plus</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="horizontalSpacerShoulderButtonsWidget3" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalSpacerShoulderButtonsWidget3Layout">
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent,
|
|||
ui->udp_learn_more->setOpenExternalLinks(true);
|
||||
ui->udp_learn_more->setText(
|
||||
tr("<a "
|
||||
"href='https://yuzu-emu.org/wiki/"
|
||||
"href='https://eden-emulator.github.io/wiki/"
|
||||
"using-a-controller-or-android-phone-for-motion-or-touch-input'><span "
|
||||
"style=\"text-decoration: underline; color:#039be5;\">Learn More</span></a>"));
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QLabel" name="label_1">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Reads controller input from scripts in the same format as TAS-nx scripts.<br/>For a more detailed explanation, please consult the <a href="https://yuzu-emu.org/help/feature/tas/"><span style=" text-decoration: underline; color:#039be5;">help page</span></a> on the yuzu website.</p></body></html></string>
|
||||
<string><html><head/><body><p>Reads controller input from scripts in the same format as TAS-nx scripts.<br/>For a more detailed explanation, please consult the <a href="https://eden-emulator.github.io/help/feature/tas/"><span style=" text-decoration: underline; color:#039be5;">help page</span></a> on the eden website.</p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warning: The settings in this page affect the inner workings of yuzu's emulated touchscreen. Changing them may result in undesirable behavior, such as the touchscreen partially or not working. You should only use this page if you know what you are doing.</string>
|
||||
<string>Warning: The settings in this page affect the inner workings of eden's emulated touchscreen. Changing them may result in undesirable behavior, such as the touchscreen partially or not working. You should only use this page if you know what you are doing.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void ConfigureWeb::RetranslateUI() {
|
|||
"color:#039be5;\">Sign up</span></a>"));
|
||||
|
||||
ui->web_token_info_link->setText(
|
||||
tr("<a href='https://yuzu-emu.org/wiki/yuzu-web-service/'><span style=\"text-decoration: "
|
||||
tr("<a href='https://eden-emulator.github.io/wiki/yuzu-web-service/'><span style=\"text-decoration: "
|
||||
"underline; color:#039be5;\">What is my token?</span></a>"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@
|
|||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxWebConfig">
|
||||
<property name="title">
|
||||
<string>yuzu Web Service</string>
|
||||
<string>eden Web Service</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayoutYuzuWebService">
|
||||
<item>
|
||||
<widget class="QLabel" name="web_credentials_disclaimer">
|
||||
<property name="text">
|
||||
<string>By providing your username and token, you agree to allow yuzu to collect additional usage data, which may include user identifying information.</string>
|
||||
<string>By providing your username and token, you agree to allow eden to collect additional usage data, which may include user identifying information.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
|
|
@ -289,10 +289,10 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
|
|||
|
||||
// Ui General
|
||||
INSERT(UISettings, select_user_on_boot, tr("Prompt for user on game boot"),
|
||||
tr("Ask to select a user profile on each boot, useful if multiple people use yuzu on "
|
||||
tr("Ask to select a user profile on each boot, useful if multiple people use eden on "
|
||||
"the same PC."));
|
||||
INSERT(UISettings, pause_when_in_background, tr("Pause emulation when in background"),
|
||||
tr("This setting pauses yuzu when focusing other windows."));
|
||||
tr("This setting pauses eden when focusing other windows."));
|
||||
INSERT(UISettings, confirm_before_stopping, tr("Confirm before stopping emulation"),
|
||||
tr("This setting overrides game prompts asking to confirm stopping the game.\nEnabling "
|
||||
"it bypasses such prompts and directly exits the emulation."));
|
||||
|
|
@ -544,7 +544,9 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
|
|||
{
|
||||
PAIR(MemoryLayout, Memory_4Gb, tr("4GB DRAM (Default)")),
|
||||
PAIR(MemoryLayout, Memory_6Gb, tr("6GB DRAM (Unsafe)")),
|
||||
PAIR(MemoryLayout, Memory_8Gb, tr("8GB DRAM (Unsafe)")),
|
||||
PAIR(MemoryLayout, Memory_8Gb, tr("8GB DRAM")),
|
||||
PAIR(MemoryLayout, Memory_10Gb, tr("10GB DRAM (Unsafe)")),
|
||||
PAIR(MemoryLayout, Memory_12Gb, tr("12GB DRAM (Unsafe)")),
|
||||
}});
|
||||
translations->insert({Settings::EnumMetadata<Settings::ConsoleMode>::Index(),
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include "core/core.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "yuzu/discord_impl.h"
|
||||
#include "yuzu/uisettings.h"
|
||||
|
||||
namespace DiscordRPC {
|
||||
|
||||
|
|
@ -24,7 +23,7 @@ DiscordImpl::DiscordImpl(Core::System& system_) : system{system_} {
|
|||
DiscordEventHandlers handlers{};
|
||||
// The number is the client ID for yuzu, it's used for images and the
|
||||
// application name
|
||||
Discord_Initialize("712465656758665259", &handlers, 1, nullptr);
|
||||
Discord_Initialize("1371246384434380841", &handlers, 1, nullptr);
|
||||
}
|
||||
|
||||
DiscordImpl::~DiscordImpl() {
|
||||
|
|
@ -62,8 +61,9 @@ std::string DiscordImpl::GetGameString(const std::string& title) {
|
|||
}
|
||||
|
||||
void DiscordImpl::UpdateGameStatus(bool use_default) {
|
||||
const std::string default_text = "yuzu is an emulator for the Nintendo Switch";
|
||||
const std::string default_image = "yuzu_logo";
|
||||
const std::string default_text = "eden is an emulator for the Nintendo Switch";
|
||||
const std::string default_image = "https://git.eden-emu.dev/eden-emu/eden/raw/branch/master/"
|
||||
"dist/qt_themes/default/icons/256x256/eden_named.png";
|
||||
const std::string url = use_default ? default_image : game_url;
|
||||
s64 start_time = std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
|
|
@ -81,15 +81,18 @@ void DiscordImpl::UpdateGameStatus(bool use_default) {
|
|||
}
|
||||
|
||||
void DiscordImpl::Update() {
|
||||
const std::string default_text = "yuzu is an emulator for the Nintendo Switch";
|
||||
const std::string default_image = "yuzu_logo";
|
||||
const std::string default_text = "eden is an emulator for the Nintendo Switch";
|
||||
const std::string default_image = "https://git.eden-emu.dev/eden-emu/eden/raw/branch/master/"
|
||||
"dist/qt_themes/default/icons/256x256/eden_named.png";
|
||||
|
||||
if (system.IsPoweredOn()) {
|
||||
system.GetAppLoader().ReadTitle(game_title);
|
||||
|
||||
// Used to format Icon URL for yuzu website game compatibility page
|
||||
std::string icon_name = GetGameString(game_title);
|
||||
game_url = fmt::format("https://yuzu-emu.org/images/game/boxart/{}.png", icon_name);
|
||||
game_url = fmt::format(
|
||||
"https://raw.githubusercontent.com/eden-emulator/boxart/refs/heads/master/img/{}.png",
|
||||
icon_name);
|
||||
|
||||
QNetworkAccessManager manager;
|
||||
QNetworkRequest request;
|
||||
|
|
@ -100,6 +103,7 @@ void DiscordImpl::Update() {
|
|||
QObject::connect(reply, &QNetworkReply::finished, &request_event_loop, &QEventLoop::quit);
|
||||
request_event_loop.exec();
|
||||
UpdateGameStatus(reply->error());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -374,20 +374,36 @@ GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvid
|
|||
warning_layout = new QHBoxLayout;
|
||||
pre_alpha_warning = new QLabel;
|
||||
pre_alpha_warning->setText(
|
||||
tr("IMPORTANT: Eden is PRE-ALPHA SOFTWARE."
|
||||
tr("IMPORTANT: Eden is PRE-ALPHA SOFTWARE. "
|
||||
"Bugs and unfinished features are expected to be present at this stage."));
|
||||
pre_alpha_warning->setWordWrap(true);
|
||||
pre_alpha_warning->setOpenExternalLinks(true);
|
||||
pre_alpha_warning->setStyleSheet(
|
||||
QString::fromStdString("color: black; font-weight: bold;"));
|
||||
|
||||
warning_layout->addWidget(pre_alpha_warning);
|
||||
warning_dont_show_again = new QPushButton(this);
|
||||
warning_dont_show_again->setStyleSheet(
|
||||
QString::fromStdString("color: #DFDFDF; background-color: #383838;"));
|
||||
warning_dont_show_again->setText(tr("Don't Show Again"));
|
||||
connect(warning_dont_show_again, &QPushButton::clicked, this, [=, this] {
|
||||
Settings::values.hide_pre_alpha_warning.SetValue(true);
|
||||
|
||||
layout->removeWidget(warning_widget);
|
||||
warning_widget->hide();
|
||||
});
|
||||
|
||||
warning_layout->addWidget(pre_alpha_warning, 1);
|
||||
warning_layout->addWidget(warning_dont_show_again);
|
||||
warning_layout->setContentsMargins(3, 3, 3, 3);
|
||||
warning_widget = new QWidget;
|
||||
warning_widget->setStyleSheet(QString::fromStdString("background-color: khaki;"));
|
||||
warning_widget->setLayout(warning_layout);
|
||||
|
||||
layout->addWidget(warning_widget);
|
||||
if (!Settings::values.hide_pre_alpha_warning.GetValue()) {
|
||||
layout->addWidget(warning_widget);
|
||||
} else {
|
||||
warning_widget->hide();
|
||||
}
|
||||
|
||||
layout->addWidget(tree_view);
|
||||
layout->addWidget(search_field);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QList>
|
||||
#include <QPushButton>
|
||||
#include <QStandardItemModel>
|
||||
#include <QString>
|
||||
#include <QTreeView>
|
||||
|
|
@ -172,8 +173,10 @@ private:
|
|||
QFileSystemWatcher* watcher = nullptr;
|
||||
ControllerNavigation* controller_navigation = nullptr;
|
||||
CompatibilityList compatibility_list;
|
||||
|
||||
QHBoxLayout* warning_layout = nullptr;
|
||||
QWidget* warning_widget = nullptr;
|
||||
QPushButton* warning_dont_show_again = nullptr;
|
||||
QLabel* pre_alpha_warning = nullptr;
|
||||
|
||||
friend class GameListSearchField;
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
|
|||
|
||||
QMessageBox::warning(this, tr("Broken Vulkan Installation Detected"),
|
||||
tr("Vulkan initialization failed during boot.<br><br>Click <a "
|
||||
"href='https://yuzu-emu.org/wiki/faq/"
|
||||
"href='https://eden-emulator.github.io/wiki/faq/"
|
||||
"#yuzu-starts-with-the-error-broken-vulkan-installation-detected'>"
|
||||
"here for instructions to fix the issue</a>."));
|
||||
|
||||
|
|
@ -1592,6 +1592,7 @@ void GMainWindow::ConnectMenuEvents() {
|
|||
|
||||
// Help
|
||||
connect_menu(ui->action_Open_yuzu_Folder, &GMainWindow::OnOpenYuzuFolder);
|
||||
connect_menu(ui->action_Discord, &GMainWindow::OnOpenDiscord);
|
||||
connect_menu(ui->action_Verify_installed_contents, &GMainWindow::OnVerifyInstalledContents);
|
||||
connect_menu(ui->action_Install_Firmware, &GMainWindow::OnInstallFirmware);
|
||||
connect_menu(ui->action_Install_Keys, &GMainWindow::OnInstallDecryptionKeys);
|
||||
|
|
@ -1806,11 +1807,11 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
|
|||
msg->setWindowTitle(tr("Game Updates Warning"));
|
||||
msg->setIcon(QMessageBox::Warning);
|
||||
msg->setText(tr("The game you are trying to launch is known to have performance or booting "
|
||||
"issues when updates are applied. It's recommended to disable any updates "
|
||||
"to this game before attempting to launch, or switch to an earlier update. "
|
||||
"If you don't have any updates installed or enabled, you can safely ignore "
|
||||
"this message.<br><br>Press \"OK\" to continue launching, or \"Cancel\" to "
|
||||
"cancel the launch."));
|
||||
"issues when updates are applied. Please try increasing the memory layout to "
|
||||
"6GB or 8GB if any issues occur.<br><br>Press \"OK\" to continue launching, or "
|
||||
"\"Cancel\" to cancel the launch."));
|
||||
|
||||
// TODO: TMP: Recommends more memory for TotK.
|
||||
|
||||
msg->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||
|
||||
|
|
@ -1859,7 +1860,7 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
|
|||
"outdated format that has been superseded by others such as NCA, NAX, XCI, or "
|
||||
"NSP. Deconstructed ROM directories lack icons, metadata, and update "
|
||||
"support.<br><br>For an explanation of the various Switch formats eden supports, <a "
|
||||
"href='https://yuzu-emu.org/wiki/overview-of-switch-game-formats'>check out our "
|
||||
"href='https://eden-emulator.github.io/wiki/overview-of-switch-game-formats'>check out our "
|
||||
"wiki</a>. This message will not be shown again."));
|
||||
}
|
||||
|
||||
|
|
@ -1877,7 +1878,7 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
|
|||
"This is usually caused by outdated GPU drivers, including integrated ones. "
|
||||
"Please see the log for more details. "
|
||||
"For more information on accessing the log, please see the following page: "
|
||||
"<a href='https://yuzu-emu.org/help/reference/log-files/'>"
|
||||
"<a href='https://eden-emulator.github.io/help/reference/log-files/'>"
|
||||
"How to Upload the Log File</a>. "));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -2882,7 +2883,7 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id,
|
|||
directory = it->second.second;
|
||||
}
|
||||
|
||||
QDesktopServices::openUrl(QUrl(QStringLiteral("https://yuzu-emu.org/game/") + directory));
|
||||
QDesktopServices::openUrl(QUrl(QStringLiteral("https://eden-emulator.github.io/game/") + directory));
|
||||
}
|
||||
|
||||
bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
|
||||
|
|
@ -3040,8 +3041,8 @@ bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_vi
|
|||
}
|
||||
|
||||
// Create icon file path
|
||||
out_icon_path /= (program_id == 0 ? fmt::format("yuzu-{}.{}", game_file_name, ico_extension)
|
||||
: fmt::format("yuzu-{:016X}.{}", program_id, ico_extension));
|
||||
out_icon_path /= (program_id == 0 ? fmt::format("eden-{}.{}", game_file_name, ico_extension)
|
||||
: fmt::format("eden-{:016X}.{}", program_id, ico_extension));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -3596,8 +3597,8 @@ void GMainWindow::OnMenuReportCompatibility() {
|
|||
} else {
|
||||
QMessageBox::critical(
|
||||
this, tr("Missing yuzu Account"),
|
||||
tr("In order to submit a game compatibility test case, you must link your yuzu "
|
||||
"account.<br><br/>To link your yuzu account, go to Emulation > Configuration "
|
||||
tr("In order to submit a game compatibility test case, you must link your eden "
|
||||
"account.<br><br/>To link your eden account, go to Emulation > Configuration "
|
||||
"> "
|
||||
"Web."));
|
||||
}
|
||||
|
|
@ -3621,11 +3622,16 @@ void GMainWindow::OnOpenModsPage() {
|
|||
}
|
||||
|
||||
void GMainWindow::OnOpenQuickstartGuide() {
|
||||
OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/help/quickstart/")));
|
||||
OpenURL(QUrl(QStringLiteral("https://yuzu-mirror.github.io/help/quickstart/")));
|
||||
}
|
||||
|
||||
void GMainWindow::OnOpenFAQ() {
|
||||
OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/wiki/faq/")));
|
||||
OpenURL(QUrl(QStringLiteral("https://eden-emulator.github.io/")));
|
||||
}
|
||||
|
||||
void GMainWindow::OnOpenDiscord()
|
||||
{
|
||||
OpenURL(QUrl(QStringLiteral("https://discord.gg/edenemu")));
|
||||
}
|
||||
|
||||
void GMainWindow::ToggleFullscreen() {
|
||||
|
|
@ -4199,7 +4205,7 @@ void GMainWindow::OnInstallFirmware() {
|
|||
if (!ContentManager::AreKeysPresent()) {
|
||||
QMessageBox::information(
|
||||
this, tr("Keys not installed"),
|
||||
tr("Install decryption keys and restart yuzu before attempting to install firmware."));
|
||||
tr("Install decryption keys and restart eden before attempting to install firmware."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ private slots:
|
|||
void OnOpenModsPage();
|
||||
void OnOpenQuickstartGuide();
|
||||
void OnOpenFAQ();
|
||||
void OnOpenDiscord();
|
||||
/// Called whenever a user selects a game in the game list widget.
|
||||
void OnGameListLoadFile(QString game_path, u64 program_id);
|
||||
void OnGameListOpenFolder(u64 program_id, GameListOpenTarget target,
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@
|
|||
<addaction name="action_Open_FAQ"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_About"/>
|
||||
<addaction name="action_Discord"/>
|
||||
</widget>
|
||||
<addaction name="menu_File"/>
|
||||
<addaction name="menu_Emulation"/>
|
||||
|
|
@ -484,6 +485,11 @@
|
|||
<string>Open Home Menu</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Discord">
|
||||
<property name="text">
|
||||
<string>&Discord</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="yuzu.qrc"/>
|
||||
|
|
|
|||
123
src/yuzu/migration_worker.cpp
Normal file
123
src/yuzu/migration_worker.cpp
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
#include "migration_worker.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "common/fs/path_util.h"
|
||||
|
||||
MigrationWorker::MigrationWorker(const LegacyEmu selected_legacy_emu_,
|
||||
const bool clear_shader_cache_,
|
||||
const MigrationStrategy strategy_)
|
||||
: QObject()
|
||||
, selected_legacy_emu(selected_legacy_emu_)
|
||||
, clear_shader_cache(clear_shader_cache_)
|
||||
, strategy(strategy_)
|
||||
{}
|
||||
|
||||
void MigrationWorker::process()
|
||||
{
|
||||
namespace fs = std::filesystem;
|
||||
const auto copy_options = fs::copy_options::update_existing | fs::copy_options::recursive;
|
||||
|
||||
std::string legacy_user_dir;
|
||||
std::string legacy_config_dir;
|
||||
std::string legacy_cache_dir;
|
||||
|
||||
#define LEGACY_EMU(emu) \
|
||||
case LegacyEmu::emu: \
|
||||
legacy_user_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##Dir).string(); \
|
||||
legacy_config_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##ConfigDir) \
|
||||
.string(); \
|
||||
legacy_cache_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##CacheDir) \
|
||||
.string(); \
|
||||
break;
|
||||
|
||||
switch (selected_legacy_emu) {
|
||||
LEGACY_EMU(Citron)
|
||||
LEGACY_EMU(Sudachi)
|
||||
LEGACY_EMU(Yuzu)
|
||||
LEGACY_EMU(Suyu)
|
||||
}
|
||||
|
||||
#undef LEGACY_EMU
|
||||
|
||||
fs::path eden_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::EdenDir);
|
||||
fs::path config_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::ConfigDir);
|
||||
fs::path cache_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::CacheDir);
|
||||
fs::path shader_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::ShaderDir);
|
||||
|
||||
try {
|
||||
fs::remove_all(eden_dir);
|
||||
} catch (fs::filesystem_error &_) {
|
||||
// ignore because linux does stupid crap sometimes.
|
||||
}
|
||||
|
||||
switch (strategy) {
|
||||
case MigrationStrategy::Link:
|
||||
// Create symlinks/directory junctions if requested
|
||||
|
||||
// Windows 11 has random permission nonsense to deal with.
|
||||
try {
|
||||
fs::create_directory_symlink(legacy_user_dir, eden_dir);
|
||||
} catch (const fs::filesystem_error &e) {
|
||||
emit error(tr("Linking the old directory failed. You may need to re-run with "
|
||||
"administrative privileges on Windows.\nOS gave error: %1")
|
||||
.arg(tr(e.what())));
|
||||
return;
|
||||
}
|
||||
|
||||
// Windows doesn't need any more links, because cache and config
|
||||
// are already children of the root directory
|
||||
#ifndef WIN32
|
||||
if (fs::is_directory(legacy_config_dir)) {
|
||||
fs::create_directory_symlink(legacy_config_dir, config_dir);
|
||||
}
|
||||
|
||||
if (fs::is_directory(legacy_cache_dir)) {
|
||||
fs::create_directory_symlink(legacy_cache_dir, cache_dir);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MigrationStrategy::Move:
|
||||
// Rename directories if deletion is requested (achieves the same result)
|
||||
fs::rename(legacy_user_dir, eden_dir);
|
||||
|
||||
// Windows doesn't need any more renames, because cache and config
|
||||
// are already children of the root directory
|
||||
#ifndef WIN32
|
||||
if (fs::is_directory(legacy_config_dir)) {
|
||||
fs::rename(legacy_config_dir, config_dir);
|
||||
}
|
||||
|
||||
if (fs::is_directory(legacy_cache_dir)) {
|
||||
fs::rename(legacy_cache_dir, cache_dir);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MigrationStrategy::Copy:
|
||||
default:
|
||||
// Default behavior: copy
|
||||
fs::copy(legacy_user_dir, eden_dir, copy_options);
|
||||
|
||||
if (fs::is_directory(legacy_config_dir)) {
|
||||
fs::copy(legacy_config_dir, config_dir, copy_options);
|
||||
}
|
||||
|
||||
if (fs::is_directory(legacy_cache_dir)) {
|
||||
fs::copy(legacy_cache_dir, cache_dir, copy_options);
|
||||
}
|
||||
|
||||
success_text.append(tr("\n\nIf you wish to clean up the files which were left in the old "
|
||||
"data location, you can do so by deleting the following directory:\n"
|
||||
"%1")
|
||||
.arg(QString::fromStdString(legacy_user_dir)));
|
||||
break;
|
||||
}
|
||||
|
||||
// Delete and re-create shader dir
|
||||
if (clear_shader_cache) {
|
||||
fs::remove_all(shader_dir);
|
||||
fs::create_directory(shader_dir);
|
||||
}
|
||||
|
||||
emit finished(success_text);
|
||||
}
|
||||
41
src/yuzu/migration_worker.h
Normal file
41
src/yuzu/migration_worker.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef MIGRATION_WORKER_H
|
||||
#define MIGRATION_WORKER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class MigrationWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum class LegacyEmu {
|
||||
Citron,
|
||||
Sudachi,
|
||||
Yuzu,
|
||||
Suyu,
|
||||
};
|
||||
|
||||
enum class MigrationStrategy {
|
||||
Copy,
|
||||
Move,
|
||||
Link,
|
||||
};
|
||||
|
||||
MigrationWorker(const LegacyEmu selected_legacy_emu,
|
||||
const bool clear_shader_cache,
|
||||
const MigrationStrategy strategy);
|
||||
|
||||
public slots:
|
||||
void process();
|
||||
|
||||
signals:
|
||||
void finished(const QString &success_text);
|
||||
void error(const QString &error_message);
|
||||
|
||||
private:
|
||||
LegacyEmu selected_legacy_emu;
|
||||
bool clear_shader_cache;
|
||||
MigrationStrategy strategy;
|
||||
QString success_text = tr("Data was migrated successfully.");
|
||||
};
|
||||
|
||||
#endif // MIGRATION_WORKER_H
|
||||
|
|
@ -58,7 +58,7 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
|
|||
ui->username->setText(
|
||||
QString::fromStdString(UISettings::values.multiplayer_room_nickname.GetValue()));
|
||||
if (ui->username->text().isEmpty() && !Settings::values.yuzu_username.GetValue().empty()) {
|
||||
// Use yuzu Web Service user name as nickname by default
|
||||
// Use eden Web Service user name as nickname by default
|
||||
ui->username->setText(QString::fromStdString(Settings::values.yuzu_username.GetValue()));
|
||||
}
|
||||
ui->room_name->setText(
|
||||
|
|
@ -184,7 +184,7 @@ void HostRoomWindow::Host() {
|
|||
QMessageBox::warning(
|
||||
this, tr("Error"),
|
||||
tr("Failed to announce the room to the public lobby. In order to host a "
|
||||
"room publicly, you must have a valid yuzu account configured in "
|
||||
"room publicly, you must have a valid eden account configured in "
|
||||
"Emulation -> Configure -> Web. If you do not want to publish a room in "
|
||||
"the public lobby, then select Unlisted instead.\nDebug Message: ") +
|
||||
QString::fromStdString(result.result_string),
|
||||
|
|
|
|||
|
|
@ -14,15 +14,17 @@
|
|||
#include "migration_dialog.h"
|
||||
|
||||
// Needs to be included at the end due to https://bugreports.qt.io/browse/QTBUG-73263
|
||||
#include <QApplication>
|
||||
#include <QButtonGroup>
|
||||
#include <QCheckBox>
|
||||
#include <QProgressDialog>
|
||||
#include <QRadioButton>
|
||||
#include <QThread>
|
||||
#include <filesystem>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
UserDataMigrator::UserDataMigrator(
|
||||
QMainWindow *main_window)
|
||||
UserDataMigrator::UserDataMigrator(QMainWindow *main_window)
|
||||
{
|
||||
// NOTE: Logging is not initialized yet, do not produce logs here.
|
||||
|
||||
|
|
@ -34,8 +36,7 @@ UserDataMigrator::UserDataMigrator(
|
|||
}
|
||||
}
|
||||
|
||||
void UserDataMigrator::ShowMigrationPrompt(
|
||||
QMainWindow *main_window)
|
||||
void UserDataMigrator::ShowMigrationPrompt(QMainWindow *main_window)
|
||||
{
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
|
|
@ -90,15 +91,15 @@ void UserDataMigrator::ShowMigrationPrompt(
|
|||
// Reflection would make this code 10x better
|
||||
// but for now... MACRO MADNESS!!!!
|
||||
QMap<QString, bool> found;
|
||||
QMap<QString, LegacyEmu> legacyMap;
|
||||
QMap<QString, MigrationWorker::LegacyEmu> legacyMap;
|
||||
QMap<QString, QAbstractButton *> buttonMap;
|
||||
|
||||
#define EMU_MAP(name) \
|
||||
const bool name##_found = fs::is_directory( \
|
||||
Common::FS::GetLegacyPath(Common::FS::LegacyPath::name##Dir)); \
|
||||
legacyMap[main_window->tr(#name)] = LegacyEmu::name; \
|
||||
found[main_window->tr(#name)] = name##_found; \
|
||||
if (name##_found) \
|
||||
legacyMap[main_window->tr(#name)] = MigrationWorker::LegacyEmu::name; \
|
||||
found[main_window->tr(#name)] = name##_found; \
|
||||
if (name##_found) \
|
||||
any_found = true;
|
||||
|
||||
EMU_MAP(Citron)
|
||||
|
|
@ -118,7 +119,15 @@ void UserDataMigrator::ShowMigrationPrompt(
|
|||
if (!iter.value())
|
||||
continue;
|
||||
|
||||
buttonMap[iter.key()] = migration_prompt.addButton(iter.key());
|
||||
QAbstractButton *button = migration_prompt.addButton(iter.key());
|
||||
// TMP: disable citron
|
||||
if (iter.key() == main_window->tr("Citron")) {
|
||||
button->setEnabled(false);
|
||||
button->setToolTip(
|
||||
main_window->tr("Citron migration is known to cause issues. It's recommended "
|
||||
"to manually set up your data again."));
|
||||
}
|
||||
buttonMap[iter.key()] = button;
|
||||
promptText.append(main_window->tr("\n- %1").arg(iter.key()));
|
||||
}
|
||||
|
||||
|
|
@ -129,13 +138,13 @@ void UserDataMigrator::ShowMigrationPrompt(
|
|||
|
||||
migration_prompt.exec();
|
||||
|
||||
MigrationStrategy strategy;
|
||||
MigrationWorker::MigrationStrategy strategy;
|
||||
if (link->isChecked()) {
|
||||
strategy = MigrationStrategy::Link;
|
||||
strategy = MigrationWorker::MigrationStrategy::Link;
|
||||
} else if (clear_old->isChecked()) {
|
||||
strategy = MigrationStrategy::Move;
|
||||
strategy = MigrationWorker::MigrationStrategy::Move;
|
||||
} else {
|
||||
strategy = MigrationStrategy::Copy;
|
||||
strategy = MigrationWorker::MigrationStrategy::Copy;
|
||||
}
|
||||
|
||||
QMapIterator buttonIter(buttonMap);
|
||||
|
|
@ -159,8 +168,7 @@ void UserDataMigrator::ShowMigrationPrompt(
|
|||
return;
|
||||
}
|
||||
|
||||
void UserDataMigrator::ShowMigrationCancelledMessage(
|
||||
QMainWindow *main_window)
|
||||
void UserDataMigrator::ShowMigrationCancelledMessage(QMainWindow *main_window)
|
||||
{
|
||||
QMessageBox::information(main_window,
|
||||
main_window->tr("Migration"),
|
||||
|
|
@ -173,107 +181,38 @@ void UserDataMigrator::ShowMigrationCancelledMessage(
|
|||
QMessageBox::Ok);
|
||||
}
|
||||
|
||||
void UserDataMigrator::MigrateUserData(
|
||||
QMainWindow *main_window,
|
||||
const LegacyEmu selected_legacy_emu,
|
||||
const bool clear_shader_cache,
|
||||
const MigrationStrategy strategy)
|
||||
void UserDataMigrator::MigrateUserData(QMainWindow *main_window,
|
||||
const MigrationWorker::LegacyEmu selected_legacy_emu,
|
||||
const bool clear_shader_cache,
|
||||
const MigrationWorker::MigrationStrategy strategy)
|
||||
{
|
||||
namespace fs = std::filesystem;
|
||||
const auto copy_options = fs::copy_options::update_existing | fs::copy_options::recursive;
|
||||
// Create a dialog to let the user know it's migrating, some users noted confusion.
|
||||
QProgressDialog *progress = new QProgressDialog(main_window);
|
||||
progress->setWindowTitle(main_window->tr("Migrating"));
|
||||
progress->setLabelText(main_window->tr("Migrating, this may take a while..."));
|
||||
progress->setRange(0, 0);
|
||||
progress->setCancelButton(nullptr);
|
||||
progress->setWindowModality(Qt::WindowModality::ApplicationModal);
|
||||
|
||||
QString success_text = main_window->tr("Data was migrated successfully.");
|
||||
QThread *thread = new QThread(main_window);
|
||||
MigrationWorker *worker = new MigrationWorker(selected_legacy_emu, clear_shader_cache, strategy);
|
||||
worker->moveToThread(thread);
|
||||
|
||||
std::string legacy_user_dir;
|
||||
std::string legacy_config_dir;
|
||||
std::string legacy_cache_dir;
|
||||
thread->connect(thread, &QThread::started, worker, &MigrationWorker::process);
|
||||
|
||||
#define LEGACY_EMU(emu) \
|
||||
case LegacyEmu::emu: \
|
||||
legacy_user_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##Dir).string(); \
|
||||
legacy_config_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##ConfigDir) \
|
||||
.string(); \
|
||||
legacy_cache_dir = Common::FS::GetLegacyPath(Common::FS::LegacyPath::emu##CacheDir) \
|
||||
.string(); \
|
||||
break;
|
||||
thread->connect(worker, &MigrationWorker::finished, progress, [=](const QString &success_text) {
|
||||
progress->close();
|
||||
QMessageBox::information(main_window,
|
||||
main_window->tr("Migration"),
|
||||
success_text,
|
||||
QMessageBox::Ok);
|
||||
|
||||
switch (selected_legacy_emu) {
|
||||
LEGACY_EMU(Citron)
|
||||
LEGACY_EMU(Sudachi)
|
||||
LEGACY_EMU(Yuzu)
|
||||
LEGACY_EMU(Suyu)
|
||||
}
|
||||
thread->quit();
|
||||
});
|
||||
|
||||
#undef LEGACY_EMU
|
||||
thread->connect(worker, &MigrationWorker::finished, worker, &QObject::deleteLater);
|
||||
thread->connect(thread, &QThread::finished, thread, &QObject::deleteLater);
|
||||
|
||||
fs::path eden_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::EdenDir);
|
||||
fs::path config_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::ConfigDir);
|
||||
fs::path cache_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::CacheDir);
|
||||
fs::path shader_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::ShaderDir);
|
||||
|
||||
fs::remove_all(eden_dir);
|
||||
|
||||
switch (strategy) {
|
||||
case MigrationStrategy::Link:
|
||||
// Create symlinks/directory junctions if requested
|
||||
fs::create_directory_symlink(legacy_user_dir, eden_dir);
|
||||
|
||||
// Windows doesn't need any more links, because cache and config
|
||||
// are already children of the root directory
|
||||
#ifndef WIN32
|
||||
if (fs::is_directory(legacy_config_dir)) {
|
||||
fs::create_directory_symlink(legacy_config_dir, config_dir);
|
||||
}
|
||||
|
||||
if (fs::is_directory(legacy_cache_dir)) {
|
||||
fs::create_directory_symlink(legacy_cache_dir, cache_dir);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MigrationStrategy::Move:
|
||||
// Rename directories if deletion is requested (achieves the same result)
|
||||
fs::rename(legacy_user_dir, eden_dir);
|
||||
|
||||
// Windows doesn't need any more renames, because cache and config
|
||||
// are already children of the root directory
|
||||
#ifndef WIN32
|
||||
if (fs::is_directory(legacy_config_dir)) {
|
||||
fs::rename(legacy_config_dir, config_dir);
|
||||
}
|
||||
|
||||
if (fs::is_directory(legacy_cache_dir)) {
|
||||
fs::rename(legacy_cache_dir, cache_dir);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MigrationStrategy::Copy:
|
||||
default:
|
||||
// Default behavior: copy
|
||||
fs::copy(legacy_user_dir, eden_dir, copy_options);
|
||||
|
||||
if (fs::is_directory(legacy_config_dir)) {
|
||||
fs::copy(legacy_config_dir, config_dir, copy_options);
|
||||
}
|
||||
|
||||
if (fs::is_directory(legacy_cache_dir)) {
|
||||
fs::copy(legacy_cache_dir, cache_dir, copy_options);
|
||||
}
|
||||
|
||||
success_text.append(
|
||||
main_window->tr("\n\nIf you wish to clean up the files which were left in the old "
|
||||
"data location, you can do so by deleting the following directory:\n"
|
||||
"%1").arg(QString::fromStdString(legacy_user_dir)));
|
||||
break;
|
||||
}
|
||||
|
||||
// Delete and re-create shader dir
|
||||
if (clear_shader_cache) {
|
||||
fs::remove_all(shader_dir);
|
||||
fs::create_directory(shader_dir);
|
||||
}
|
||||
|
||||
QMessageBox::information(main_window,
|
||||
main_window->tr("Migration"),
|
||||
success_text,
|
||||
QMessageBox::Ok);
|
||||
thread->start();
|
||||
progress->exec();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,27 +8,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "migration_worker.h"
|
||||
|
||||
class UserDataMigrator {
|
||||
public:
|
||||
UserDataMigrator(QMainWindow* main_window);
|
||||
|
||||
private:
|
||||
enum class LegacyEmu {
|
||||
Citron,
|
||||
Sudachi,
|
||||
Yuzu,
|
||||
Suyu,
|
||||
};
|
||||
|
||||
enum class MigrationStrategy {
|
||||
Copy,
|
||||
Move,
|
||||
Link,
|
||||
};
|
||||
|
||||
void ShowMigrationPrompt(QMainWindow* main_window);
|
||||
void ShowMigrationCancelledMessage(QMainWindow* main_window);
|
||||
void MigrateUserData(QMainWindow* main_window, const LegacyEmu selected_legacy_emu,
|
||||
const bool clear_shader_cache, const MigrationStrategy strategy);
|
||||
void MigrateUserData(QMainWindow* main_window,
|
||||
const MigrationWorker::LegacyEmu selected_legacy_emu,
|
||||
const bool clear_shader_cache,
|
||||
const MigrationWorker::MigrationStrategy strategy);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue