[fs/core] Load external content without NAND install (#2862)

Adds the capability to add DLC and Updates without installing them to NAND. This was tested on Windows only and needs Android integration.

Co-authored-by: crueter <crueter@eden-emu.dev>
Co-authored-by: wildcard <wildcard@eden-emu.dev>
Co-authored-by: nekle <nekle@protonmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2862
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: Maufeat <sahyno1996@gmail.com>
Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
Maufeat 2026-02-06 14:05:44 +01:00 committed by crueter
parent e07e269bd7
commit 69aff83ef4
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
40 changed files with 1790 additions and 126 deletions

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
@ -7,6 +7,9 @@
#include <functional>
#include <utility>
#include <vector>
#include <QDir>
#include <QFileDialog>
#include <QListWidget>
#include <QMessageBox>
#include "common/settings.h"
#include "core/core.h"
@ -29,6 +32,15 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_,
connect(ui->button_reset_defaults, &QPushButton::clicked, this,
&ConfigureGeneral::ResetDefaults);
connect(ui->add_external_dir_button, &QPushButton::pressed, this,
&ConfigureGeneral::AddExternalContentDirectory);
connect(ui->remove_external_dir_button, &QPushButton::pressed, this,
&ConfigureGeneral::RemoveSelectedExternalContentDirectory);
connect(ui->external_content_list, &QListWidget::itemSelectionChanged, this, [this] {
ui->remove_external_dir_button->setEnabled(
!ui->external_content_list->selectedItems().isEmpty());
});
if (!Settings::IsConfiguringGlobal()) {
ui->button_reset_defaults->setVisible(false);
}
@ -36,7 +48,9 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_,
ConfigureGeneral::~ConfigureGeneral() = default;
void ConfigureGeneral::SetConfiguration() {}
void ConfigureGeneral::SetConfiguration() {
UpdateExternalContentList();
}
void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
QLayout& general_layout = *ui->general_widget->layout();
@ -101,6 +115,55 @@ void ConfigureGeneral::ApplyConfiguration() {
for (const auto& func : apply_funcs) {
func(powered_on);
}
std::vector<std::string> new_dirs;
new_dirs.reserve(ui->external_content_list->count());
for (int i = 0; i < ui->external_content_list->count(); ++i) {
new_dirs.push_back(ui->external_content_list->item(i)->text().toStdString());
}
if (new_dirs != Settings::values.external_content_dirs) {
Settings::values.external_content_dirs = std::move(new_dirs);
emit ExternalContentDirsChanged();
}
}
void ConfigureGeneral::UpdateExternalContentList() {
ui->external_content_list->clear();
for (const auto& dir : Settings::values.external_content_dirs) {
ui->external_content_list->addItem(QString::fromStdString(dir));
}
}
void ConfigureGeneral::AddExternalContentDirectory() {
const QString dir_path = QFileDialog::getExistingDirectory(
this, tr("Select External Content Directory..."), QString());
if (dir_path.isEmpty()) {
return;
}
QString normalized_path = QDir::toNativeSeparators(dir_path);
if (normalized_path.back() != QDir::separator()) {
normalized_path.append(QDir::separator());
}
for (int i = 0; i < ui->external_content_list->count(); ++i) {
if (ui->external_content_list->item(i)->text() == normalized_path) {
QMessageBox::information(this, tr("Directory Already Added"),
tr("This directory is already in the list."));
return;
}
}
ui->external_content_list->addItem(normalized_path);
}
void ConfigureGeneral::RemoveSelectedExternalContentDirectory() {
auto selected = ui->external_content_list->selectedItems();
if (!selected.isEmpty()) {
qDeleteAll(ui->external_content_list->selectedItems());
}
}
void ConfigureGeneral::changeEvent(QEvent* event) {