mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-24 15:37:05 +02:00
[meta] clang-format literally all of the Qt code (#3706)
I'm tired of dealing with this tbh Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3706 Reviewed-by: Lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
769edbfea3
commit
8678cb06eb
107 changed files with 1457 additions and 1737 deletions
|
|
@ -1,29 +1,24 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "yuzu/about_dialog.h"
|
||||
#include <QIcon>
|
||||
#include <fmt/ranges.h>
|
||||
#include "common/scm_rev.h"
|
||||
#include "ui_aboutdialog.h"
|
||||
#include <fmt/ranges.h>
|
||||
#include "yuzu/about_dialog.h"
|
||||
|
||||
AboutDialog::AboutDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, ui{std::make_unique<Ui::AboutDialog>()}
|
||||
{
|
||||
: QDialog(parent), ui{std::make_unique<Ui::AboutDialog>()} {
|
||||
static const std::string build_id = std::string{Common::g_build_id};
|
||||
static const std::string yuzu_build = fmt::format("{} | {} | {}",
|
||||
std::string{Common::g_build_name},
|
||||
std::string{Common::g_build_version},
|
||||
std::string{Common::g_compiler_id}
|
||||
);
|
||||
static const std::string yuzu_build =
|
||||
fmt::format("{} | {} | {}", std::string{Common::g_build_name},
|
||||
std::string{Common::g_build_version}, std::string{Common::g_compiler_id});
|
||||
|
||||
const auto override_build = fmt::format(fmt::runtime(
|
||||
std::string(Common::g_title_bar_format_idle)),
|
||||
build_id);
|
||||
const auto override_build =
|
||||
fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id);
|
||||
const auto yuzu_build_version = override_build.empty() ? yuzu_build : override_build;
|
||||
|
||||
ui->setupUi(this);
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -17,8 +17,8 @@
|
|||
#include "hid_core/hid_core.h"
|
||||
#include "hid_core/hid_types.h"
|
||||
#include "hid_core/resources/npad/npad.h"
|
||||
#include "ui_qt_controller.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "ui_qt_controller.h"
|
||||
#include "yuzu/applets/qt_controller.h"
|
||||
#include "yuzu/configuration/configure_input.h"
|
||||
#include "yuzu/configuration/configure_input_profile_dialog.h"
|
||||
|
|
@ -188,14 +188,15 @@ QtControllerSelectorDialog::QtControllerSelectorDialog(
|
|||
CheckIfParametersMet();
|
||||
});
|
||||
|
||||
connect(connected_controller_checkboxes[i], &QCheckBox::STATE_CHANGED, [this, i](int state) {
|
||||
player_groupboxes[i]->setChecked(state == Qt::Checked);
|
||||
UpdateControllerIcon(i);
|
||||
UpdateControllerState(i);
|
||||
UpdateLEDPattern(i);
|
||||
UpdateBorderColor(i);
|
||||
CheckIfParametersMet();
|
||||
});
|
||||
connect(connected_controller_checkboxes[i], &QCheckBox::STATE_CHANGED,
|
||||
[this, i](int state) {
|
||||
player_groupboxes[i]->setChecked(state == Qt::Checked);
|
||||
UpdateControllerIcon(i);
|
||||
UpdateControllerState(i);
|
||||
UpdateLEDPattern(i);
|
||||
UpdateBorderColor(i);
|
||||
CheckIfParametersMet();
|
||||
});
|
||||
|
||||
if (i == 0) {
|
||||
connect(emulated_controllers[i], qOverload<int>(&QComboBox::currentIndexChanged),
|
||||
|
|
|
|||
|
|
@ -1499,22 +1499,22 @@ void QtSoftwareKeyboardDialog::StartInputThread() {
|
|||
input_interpreter->PollInput();
|
||||
HandleButtonPressedOnce<
|
||||
Core::HID::NpadButton::A, Core::HID::NpadButton::B, Core::HID::NpadButton::X,
|
||||
Core::HID::NpadButton::Y, Core::HID::NpadButton::StickL, Core::HID::NpadButton::StickR,
|
||||
Core::HID::NpadButton::L, Core::HID::NpadButton::R, Core::HID::NpadButton::Plus,
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown, Core::HID::NpadButton::StickRLeft,
|
||||
Core::HID::NpadButton::StickRUp, Core::HID::NpadButton::StickRRight,
|
||||
Core::HID::NpadButton::StickRDown>();
|
||||
Core::HID::NpadButton::Y, Core::HID::NpadButton::StickL,
|
||||
Core::HID::NpadButton::StickR, Core::HID::NpadButton::L, Core::HID::NpadButton::R,
|
||||
Core::HID::NpadButton::Plus, Core::HID::NpadButton::Left, Core::HID::NpadButton::Up,
|
||||
Core::HID::NpadButton::Right, Core::HID::NpadButton::Down,
|
||||
Core::HID::NpadButton::StickLLeft, Core::HID::NpadButton::StickLUp,
|
||||
Core::HID::NpadButton::StickLRight, Core::HID::NpadButton::StickLDown,
|
||||
Core::HID::NpadButton::StickRLeft, Core::HID::NpadButton::StickRUp,
|
||||
Core::HID::NpadButton::StickRRight, Core::HID::NpadButton::StickRDown>();
|
||||
HandleButtonHold<Core::HID::NpadButton::B, Core::HID::NpadButton::L,
|
||||
Core::HID::NpadButton::R, Core::HID::NpadButton::Left,
|
||||
Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown, Core::HID::NpadButton::StickRLeft,
|
||||
Core::HID::NpadButton::StickRUp, Core::HID::NpadButton::StickRRight,
|
||||
Core::HID::NpadButton::StickRDown>();
|
||||
Core::HID::NpadButton::R, Core::HID::NpadButton::Left,
|
||||
Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown, Core::HID::NpadButton::StickRLeft,
|
||||
Core::HID::NpadButton::StickRUp, Core::HID::NpadButton::StickRRight,
|
||||
Core::HID::NpadButton::StickRDown>();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ QtNXWebEngineView::QtNXWebEngineView(QWidget* parent, Core::System& system,
|
|||
: QWebEngineView(parent), input_subsystem{input_subsystem_},
|
||||
url_interceptor(std::make_unique<UrlRequestInterceptor>()),
|
||||
input_interpreter(std::make_unique<InputInterpreter>(system)),
|
||||
default_profile{QWebEngineProfile::defaultProfile()}, global_settings{
|
||||
default_profile->settings()} {
|
||||
default_profile{QWebEngineProfile::defaultProfile()},
|
||||
global_settings{default_profile->settings()} {
|
||||
default_profile->setPersistentStoragePath(QString::fromStdString(Common::FS::PathToUTF8String(
|
||||
Common::FS::GetEdenPath(Common::FS::EdenPath::EdenDir) / "qtwebengine")));
|
||||
|
||||
|
|
@ -299,21 +299,21 @@ void QtNXWebEngineView::StartInputThread() {
|
|||
while (!stoken.stop_requested()) {
|
||||
input_interpreter->PollInput();
|
||||
|
||||
HandleWindowFooterButtonPressedOnce<Core::HID::NpadButton::A, Core::HID::NpadButton::B,
|
||||
Core::HID::NpadButton::X, Core::HID::NpadButton::Y,
|
||||
Core::HID::NpadButton::L, Core::HID::NpadButton::R>();
|
||||
HandleWindowFooterButtonPressedOnce<
|
||||
Core::HID::NpadButton::A, Core::HID::NpadButton::B, Core::HID::NpadButton::X,
|
||||
Core::HID::NpadButton::Y, Core::HID::NpadButton::L, Core::HID::NpadButton::R>();
|
||||
|
||||
HandleWindowKeyButtonPressedOnce<
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown>();
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up,
|
||||
Core::HID::NpadButton::Right, Core::HID::NpadButton::Down,
|
||||
Core::HID::NpadButton::StickLLeft, Core::HID::NpadButton::StickLUp,
|
||||
Core::HID::NpadButton::StickLRight, Core::HID::NpadButton::StickLDown>();
|
||||
|
||||
HandleWindowKeyButtonHold<
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown>();
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up,
|
||||
Core::HID::NpadButton::Right, Core::HID::NpadButton::Down,
|
||||
Core::HID::NpadButton::StickLLeft, Core::HID::NpadButton::StickLUp,
|
||||
Core::HID::NpadButton::StickLRight, Core::HID::NpadButton::StickLDown>();
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,7 +169,8 @@ private:
|
|||
std::unique_ptr<InputInterpreter> input_interpreter;
|
||||
std::jthread input_thread;
|
||||
std::atomic<bool> finished{};
|
||||
Service::AM::Frontend::WebExitReason exit_reason{Service::AM::Frontend::WebExitReason::EndButtonPressed};
|
||||
Service::AM::Frontend::WebExitReason exit_reason{
|
||||
Service::AM::Frontend::WebExitReason::EndButtonPressed};
|
||||
std::string last_url{"http://localhost/"};
|
||||
bool is_local{};
|
||||
QWebEngineProfile* default_profile;
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@
|
|||
#include "input_common/drivers/tas_input.h"
|
||||
#include "input_common/drivers/touch_screen.h"
|
||||
#include "input_common/main.h"
|
||||
#include "qt_common/qt_common.h"
|
||||
#include "video_core/gpu.h"
|
||||
#include "video_core/rasterizer_interface.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
#include "yuzu/bootmanager.h"
|
||||
#include "yuzu/main_window.h"
|
||||
#include "qt_common/qt_common.h"
|
||||
|
||||
class QObject;
|
||||
class QPaintEngine;
|
||||
|
|
@ -282,8 +282,8 @@ struct NullRenderWidget : public RenderWidget {
|
|||
GRenderWindow::GRenderWindow(MainWindow* parent, EmuThread* emu_thread_,
|
||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
|
||||
Core::System& system_)
|
||||
: QWidget(parent),
|
||||
emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, system{system_} {
|
||||
: QWidget(parent), emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)},
|
||||
system{system_} {
|
||||
setWindowTitle(QStringLiteral("Eden %1 | %2-%3")
|
||||
.arg(QString::fromUtf8(Common::g_build_name),
|
||||
QString::fromUtf8(Common::g_scm_branch),
|
||||
|
|
@ -887,13 +887,14 @@ void GRenderWindow::resizeEvent(QResizeEvent* event) {
|
|||
|
||||
std::unique_ptr<Core::Frontend::GraphicsContext> GRenderWindow::CreateSharedContext() const {
|
||||
#ifdef HAS_OPENGL
|
||||
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLSL
|
||||
|| Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLASM
|
||||
|| Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_SPIRV) {
|
||||
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLSL ||
|
||||
Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLASM ||
|
||||
Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_SPIRV) {
|
||||
auto c = static_cast<OpenGLSharedContext*>(main_context.get());
|
||||
// Bind the shared contexts to the main surface in case the backend wants to take over
|
||||
// presentation
|
||||
return std::make_unique<OpenGLSharedContext>(c->GetShareContext(), child_widget->windowHandle());
|
||||
return std::make_unique<OpenGLSharedContext>(c->GetShareContext(),
|
||||
child_widget->windowHandle());
|
||||
}
|
||||
#endif
|
||||
return std::make_unique<DummyContext>();
|
||||
|
|
@ -940,9 +941,9 @@ bool GRenderWindow::InitRenderTarget() {
|
|||
OnFramebufferSizeChanged();
|
||||
BackupGeometry();
|
||||
|
||||
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLSL
|
||||
|| Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLASM
|
||||
|| Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_SPIRV)
|
||||
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLSL ||
|
||||
Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_GLASM ||
|
||||
Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL_SPIRV)
|
||||
return LoadOpenGL();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1050,21 +1051,23 @@ bool GRenderWindow::LoadOpenGL() {
|
|||
}
|
||||
// Display various warnings (but not fatal errors) for missing OpenGL extensions or lack of
|
||||
// OpenGL 4.6 support
|
||||
const QString renderer = QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
|
||||
const QString renderer =
|
||||
QString::fromUtf8(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
|
||||
if (!GLAD_GL_VERSION_4_6) {
|
||||
QMessageBox::warning(this, tr("Error while initializing OpenGL 4.6!"),
|
||||
tr("Your GPU may not support OpenGL 4.6, or you do not have the "
|
||||
"latest graphics driver.<br><br>GL Renderer:<br>%1")
|
||||
.arg(renderer));
|
||||
tr("Your GPU may not support OpenGL 4.6, or you do not have the "
|
||||
"latest graphics driver.<br><br>GL Renderer:<br>%1")
|
||||
.arg(renderer));
|
||||
return false;
|
||||
}
|
||||
if (QStringList missing_ext = GetUnsupportedGLExtensions(); !missing_ext.empty()) {
|
||||
QMessageBox::warning(
|
||||
this, tr("Error while initializing OpenGL!"),
|
||||
tr("Your GPU may not support one or more required OpenGL extensions. Please ensure you "
|
||||
"have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported "
|
||||
"extensions:<br>%2")
|
||||
.arg(renderer).arg(missing_ext.join(QStringLiteral("<br>"))));
|
||||
"have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported "
|
||||
"extensions:<br>%2")
|
||||
.arg(renderer)
|
||||
.arg(missing_ext.join(QStringLiteral("<br>"))));
|
||||
// Non fatal
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ ModSelectDialog::ModSelectDialog(const QStringList& mods, QWidget* parent)
|
|||
width = qMax(width, item_model->item(i)->sizeHint().width());
|
||||
}
|
||||
|
||||
width += ui->treeView->contentsMargins().left() * 4 + ui->treeView->contentsMargins().right() * 4;
|
||||
width +=
|
||||
ui->treeView->contentsMargins().left() * 4 + ui->treeView->contentsMargins().right() * 4;
|
||||
ui->treeView->setMinimumHeight(qMin(height, 600));
|
||||
ui->treeView->setMinimumWidth(qMin(width, 700));
|
||||
adjustSize();
|
||||
|
|
|
|||
|
|
@ -14,11 +14,12 @@ class ModSelectDialog : public QDialog {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ModSelectDialog(const QStringList &mods, QWidget* parent = nullptr);
|
||||
explicit ModSelectDialog(const QStringList& mods, QWidget* parent = nullptr);
|
||||
~ModSelectDialog();
|
||||
|
||||
signals:
|
||||
void modsSelected(const QStringList &mods);
|
||||
void modsSelected(const QStringList& mods);
|
||||
|
||||
private:
|
||||
Ui::ModSelectDialog* ui;
|
||||
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2018 yuzu Emulator Project
|
||||
|
|
@ -16,12 +16,12 @@
|
|||
#include "common/settings.h"
|
||||
#include "common/settings_common.h"
|
||||
#include "core/core.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_audio.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_audio.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "yuzu/configuration/shared_widget.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
ConfigureAudio::ConfigureAudio(const Core::System& system_,
|
||||
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
|
||||
|
|
@ -188,8 +188,8 @@ void ConfigureAudio::SetOutputSinkFromSinkID() {
|
|||
|
||||
const std::string new_sink_id = []() -> const std::string {
|
||||
const Settings::AudioEngine sink_id = Settings::values.sink_id.GetValue();
|
||||
const auto canonicalizations
|
||||
= Settings::EnumMetadata<Settings::AudioEngine>::Canonicalizations();
|
||||
const auto canonicalizations =
|
||||
Settings::EnumMetadata<Settings::AudioEngine>::Canonicalizations();
|
||||
|
||||
for (u32 i = 0; i < canonicalizations.size(); ++i) {
|
||||
const Settings::AudioEngine value = canonicalizations[i].second;
|
||||
|
|
@ -242,8 +242,8 @@ void ConfigureAudio::ApplyConfiguration() {
|
|||
|
||||
const u32 new_sink_id = [this]() {
|
||||
const std::string sink_id = sink_combo_box->currentText().toStdString();
|
||||
const auto canonicalizations
|
||||
= Settings::EnumMetadata<Settings::AudioEngine>::Canonicalizations();
|
||||
const auto canonicalizations =
|
||||
Settings::EnumMetadata<Settings::AudioEngine>::Canonicalizations();
|
||||
|
||||
for (u32 i = 0; i < canonicalizations.size(); ++i) {
|
||||
if (sink_id == canonicalizations[i].first)
|
||||
|
|
@ -291,7 +291,8 @@ void ConfigureAudio::InitializeAudioSinkComboBox() {
|
|||
sink_combo_box->clear();
|
||||
sink_combo_box->addItem(QString::fromUtf8(AudioCore::Sink::auto_device_name));
|
||||
for (const auto& id : AudioCore::Sink::GetSinkIDs())
|
||||
sink_combo_box->addItem(QString::fromStdString(std::string{Settings::CanonicalizeEnum(id)}));
|
||||
sink_combo_box->addItem(
|
||||
QString::fromStdString(std::string{Settings::CanonicalizeEnum(id)}));
|
||||
}
|
||||
|
||||
void ConfigureAudio::RetranslateUI() {
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -76,9 +76,9 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
|
|||
} else if (setting->Id() == Settings::values.cpu_backend.Id()) {
|
||||
backend_layout->addWidget(widget);
|
||||
backend_combobox = widget->combobox;
|
||||
} else if (setting->Id() == Settings::values.fast_cpu_time.Id()
|
||||
|| setting->Id() == Settings::values.vtable_bouncing.Id()
|
||||
|| setting->Id() == Settings::values.cpu_ticks.Id()) {
|
||||
} else if (setting->Id() == Settings::values.fast_cpu_time.Id() ||
|
||||
setting->Id() == Settings::values.vtable_bouncing.Id() ||
|
||||
setting->Id() == Settings::values.cpu_ticks.Id()) {
|
||||
ui->general_layout->addWidget(widget);
|
||||
} else {
|
||||
// Presently, all other settings here are unsafe checkboxes
|
||||
|
|
@ -93,12 +93,12 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
|
|||
UpdateGroup();
|
||||
}
|
||||
|
||||
void ConfigureCpu::UpdateGroup()
|
||||
{
|
||||
void ConfigureCpu::UpdateGroup() {
|
||||
const u32 accuracy = accuracy_combobox->currentIndex();
|
||||
const u32 backend = backend_combobox->currentIndex();
|
||||
// TODO(crueter): see if this works on NCE
|
||||
ui->unsafe_group->setVisible(accuracy == (u32) Settings::CpuAccuracy::Unsafe && backend == (u32) Settings::CpuBackend::Dynarmic);
|
||||
ui->unsafe_group->setVisible(accuracy == (u32)Settings::CpuAccuracy::Unsafe &&
|
||||
backend == (u32)Settings::CpuBackend::Dynarmic);
|
||||
}
|
||||
|
||||
void ConfigureCpu::ApplyConfiguration() {
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
#include <QWidget>
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
|
||||
class QComboBox;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "core/crypto/key_manager.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_debug.h"
|
||||
#include "yuzu/configuration/configure_debug.h"
|
||||
#include "yuzu/debugger/console.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
ConfigureDebug::ConfigureDebug(const Core::System& system_, QWidget* parent)
|
||||
: QScrollArea(parent), ui{std::make_unique<Ui::ConfigureDebug>()}, system{system_} {
|
||||
|
|
@ -60,7 +60,8 @@ void ConfigureDebug::SetConfiguration() {
|
|||
|
||||
// Immutable after starting
|
||||
ui->homebrew_args_edit->setEnabled(runtime_lock);
|
||||
ui->homebrew_args_edit->setText(QString::fromStdString(Settings::values.program_args.GetValue()));
|
||||
ui->homebrew_args_edit->setText(
|
||||
QString::fromStdString(Settings::values.program_args.GetValue()));
|
||||
ui->toggle_console->setEnabled(runtime_lock);
|
||||
ui->toggle_console->setChecked(UISettings::values.show_console.GetValue());
|
||||
ui->fs_access_log->setEnabled(runtime_lock);
|
||||
|
|
@ -84,7 +85,8 @@ void ConfigureDebug::SetConfiguration() {
|
|||
ui->disable_macro_hle->setEnabled(runtime_lock);
|
||||
ui->disable_macro_hle->setChecked(Settings::values.disable_macro_hle.GetValue());
|
||||
ui->disable_loop_safety_checks->setEnabled(runtime_lock);
|
||||
ui->disable_loop_safety_checks->setChecked(Settings::values.disable_shader_loop_safety_checks.GetValue());
|
||||
ui->disable_loop_safety_checks->setChecked(
|
||||
Settings::values.disable_shader_loop_safety_checks.GetValue());
|
||||
ui->perform_vulkan_check->setChecked(Settings::values.perform_vulkan_check.GetValue());
|
||||
ui->debug_knobs_spinbox->setValue(Settings::values.debug_knobs.GetValue());
|
||||
#ifdef YUZU_USE_QT_WEB_ENGINE
|
||||
|
|
@ -118,7 +120,8 @@ void ConfigureDebug::ApplyConfiguration() {
|
|||
Settings::values.enable_nsight_aftermath = ui->enable_nsight_aftermath->isChecked();
|
||||
Settings::values.dump_shaders = ui->dump_shaders->isChecked();
|
||||
Settings::values.dump_macros = ui->dump_macros->isChecked();
|
||||
Settings::values.disable_shader_loop_safety_checks = ui->disable_loop_safety_checks->isChecked();
|
||||
Settings::values.disable_shader_loop_safety_checks =
|
||||
ui->disable_loop_safety_checks->isChecked();
|
||||
Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked();
|
||||
Settings::values.disable_macro_hle = ui->disable_macro_hle->isChecked();
|
||||
Settings::values.extended_logging = ui->extended_logging->isChecked();
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "common/settings.h"
|
||||
#include "common/settings_enums.h"
|
||||
#include "core/core.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure.h"
|
||||
#include "vk_device_info.h"
|
||||
#include "yuzu/configuration/configure_applets.h"
|
||||
|
|
@ -30,15 +31,14 @@
|
|||
#include "yuzu/configuration/configure_ui.h"
|
||||
#include "yuzu/configuration/configure_web.h"
|
||||
#include "yuzu/hotkeys.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
|
||||
InputCommon::InputSubsystem* input_subsystem,
|
||||
std::vector<VkDeviceInfo::Record>& vk_device_records,
|
||||
Core::System& system_, bool enable_web_config)
|
||||
: QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()},
|
||||
registry(registry_), system{system_}, builder{std::make_unique<ConfigurationShared::Builder>(
|
||||
this, !system_.IsPoweredOn())},
|
||||
: QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry(registry_),
|
||||
system{system_},
|
||||
builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())},
|
||||
applets_tab{std::make_unique<ConfigureApplets>(system_, nullptr, *builder, this)},
|
||||
audio_tab{std::make_unique<ConfigureAudio>(system_, nullptr, *builder, this)},
|
||||
cpu_tab{std::make_unique<ConfigureCpu>(system_, nullptr, *builder, this)},
|
||||
|
|
@ -46,9 +46,9 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
|
|||
filesystem_tab{std::make_unique<ConfigureFilesystem>(this)},
|
||||
general_tab{std::make_unique<ConfigureGeneral>(system_, nullptr, *builder, this)},
|
||||
graphics_advanced_tab{
|
||||
std::make_unique<ConfigureGraphicsAdvanced>(system_, nullptr, *builder, this)},
|
||||
std::make_unique<ConfigureGraphicsAdvanced>(system_, nullptr, *builder, this)},
|
||||
graphics_extensions_tab{
|
||||
std::make_unique<ConfigureGraphicsExtensions>(system_, nullptr, *builder, this)},
|
||||
std::make_unique<ConfigureGraphicsExtensions>(system_, nullptr, *builder, this)},
|
||||
ui_tab{std::make_unique<ConfigureUi>(system_, this)},
|
||||
graphics_tab{std::make_unique<ConfigureGraphics>(
|
||||
system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); },
|
||||
|
|
@ -113,7 +113,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
|
|||
adjustSize();
|
||||
ui->selectorList->setCurrentRow(0);
|
||||
|
||||
// Selects the leftmost button on the bottom bar (Cancel as of writing)
|
||||
// Selects the leftmost button on the bottom bar (Cancel as of writing)
|
||||
ui->buttonBox->setFocus();
|
||||
}
|
||||
|
||||
|
|
@ -172,16 +172,17 @@ Q_DECLARE_METATYPE(QList<QWidget*>);
|
|||
|
||||
void ConfigureDialog::PopulateSelectionList() {
|
||||
const std::array<std::pair<QString, QList<QWidget*>>, 6> items{
|
||||
{{tr("General"),
|
||||
{general_tab.get(), hotkeys_tab.get(), ui_tab.get(), web_tab.get(), debug_tab_tab.get()}},
|
||||
{tr("System"),
|
||||
{system_tab.get(), profile_tab.get(), network_tab.get(), filesystem_tab.get(),
|
||||
applets_tab.get()}},
|
||||
{tr("CPU"), {cpu_tab.get()}},
|
||||
{tr("Graphics"), {graphics_tab.get(), graphics_advanced_tab.get(), graphics_extensions_tab.get()}},
|
||||
{tr("Audio"), {audio_tab.get()}},
|
||||
{tr("Controls"), input_tab->GetSubTabs()}},
|
||||
};
|
||||
{{tr("General"),
|
||||
{general_tab.get(), hotkeys_tab.get(), ui_tab.get(), web_tab.get(), debug_tab_tab.get()}},
|
||||
{tr("System"),
|
||||
{system_tab.get(), profile_tab.get(), network_tab.get(), filesystem_tab.get(),
|
||||
applets_tab.get()}},
|
||||
{tr("CPU"), {cpu_tab.get()}},
|
||||
{tr("Graphics"),
|
||||
{graphics_tab.get(), graphics_advanced_tab.get(), graphics_extensions_tab.get()}},
|
||||
{tr("Audio"), {audio_tab.get()}},
|
||||
{tr("Controls"), input_tab->GetSubTabs()}},
|
||||
};
|
||||
|
||||
[[maybe_unused]] const QSignalBlocker blocker(ui->selectorList);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
#include <vector>
|
||||
#include <QDialog>
|
||||
#include "configuration/shared_widget.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/vk_device_info.h"
|
||||
|
||||
namespace Core {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "yuzu/configuration/configure_filesystem.h"
|
||||
#include <filesystem>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
|
@ -12,10 +11,11 @@
|
|||
#include "common/fs/fs.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include "common/settings.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "qt_common/util/game.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_filesystem.h"
|
||||
#include "yuzu/configuration/configure_filesystem.h"
|
||||
|
||||
ConfigureFilesystem::ConfigureFilesystem(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureFilesystem>()) {
|
||||
|
|
@ -26,8 +26,7 @@ ConfigureFilesystem::ConfigureFilesystem(QWidget* parent)
|
|||
[this] { SetDirectory(DirectoryTarget::NAND, ui->nand_directory_edit); });
|
||||
connect(ui->sdmc_directory_button, &QToolButton::pressed, this,
|
||||
[this] { SetDirectory(DirectoryTarget::SD, ui->sdmc_directory_edit); });
|
||||
connect(ui->save_directory_button, &QToolButton::pressed, this,
|
||||
[this] { SetSaveDirectory(); });
|
||||
connect(ui->save_directory_button, &QToolButton::pressed, this, [this] { SetSaveDirectory(); });
|
||||
connect(ui->gamecard_path_button, &QToolButton::pressed, this,
|
||||
[this] { SetDirectory(DirectoryTarget::Gamecard, ui->gamecard_path_edit); });
|
||||
connect(ui->dump_path_button, &QToolButton::pressed, this,
|
||||
|
|
@ -221,9 +220,9 @@ void ConfigureFilesystem::PromptSaveMigration(const QString& from_path, const QS
|
|||
.arg(QString::fromStdString(dest_save_dir.string()));
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton reply = QMessageBox::question(
|
||||
this, tr("Migrate Save Data"), message,
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
||||
QMessageBox::StandardButton reply =
|
||||
QMessageBox::question(this, tr("Migrate Save Data"), message,
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
||||
|
||||
if (reply != QMessageBox::Yes) {
|
||||
return;
|
||||
|
|
@ -249,17 +248,17 @@ void ConfigureFilesystem::PromptSaveMigration(const QString& from_path, const QS
|
|||
progress.close();
|
||||
|
||||
if (ec) {
|
||||
QMessageBox::warning(this, tr("Migration Failed"),
|
||||
tr("Failed to migrate save data:\n%1")
|
||||
.arg(QString::fromStdString(ec.message())));
|
||||
QMessageBox::warning(
|
||||
this, tr("Migration Failed"),
|
||||
tr("Failed to migrate save data:\n%1").arg(QString::fromStdString(ec.message())));
|
||||
return;
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton deleteReply = QMessageBox::question(
|
||||
this, tr("Migration Complete"),
|
||||
tr("Save data has been migrated successfully.\n\n"
|
||||
"Would you like to delete the old save data?"),
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||
QMessageBox::StandardButton deleteReply =
|
||||
QMessageBox::question(this, tr("Migration Complete"),
|
||||
tr("Save data has been migrated successfully.\n\n"
|
||||
"Would you like to delete the old save data?"),
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||
|
||||
if (deleteReply == QMessageBox::Yes) {
|
||||
Common::FS::RemoveDirRecursively(source_save_dir);
|
||||
|
|
@ -278,7 +277,6 @@ void ConfigureFilesystem::UpdateEnabledControls() {
|
|||
!ui->gamecard_current_game->isChecked());
|
||||
}
|
||||
|
||||
|
||||
void ConfigureFilesystem::RetranslateUI() {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
#include <QMessageBox>
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_general.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_general.h"
|
||||
#include "yuzu/configuration/shared_widget.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
ConfigureGeneral::ConfigureGeneral(const Core::System& system_,
|
||||
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@
|
|||
#include "common/settings.h"
|
||||
#include "common/settings_enums.h"
|
||||
#include "core/core.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "qt_common/qt_common.h"
|
||||
#include "ui_configure_graphics.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_graphics.h"
|
||||
#include "yuzu/configuration/shared_widget.h"
|
||||
#include "qt_common/qt_common.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/vk_device_info.h"
|
||||
|
||||
static const std::vector<VkPresentModeKHR> default_present_modes{VK_PRESENT_MODE_IMMEDIATE_KHR,
|
||||
|
|
@ -91,8 +91,7 @@ ConfigureGraphics::ConfigureGraphics(
|
|||
: ConfigurationShared::Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphics>()},
|
||||
records{records_}, expose_compute_option{expose_compute_option_},
|
||||
update_aspect_ratio{update_aspect_ratio_}, system{system_},
|
||||
combobox_translations{builder.ComboboxTranslations()}
|
||||
{
|
||||
combobox_translations{builder.ComboboxTranslations()} {
|
||||
vulkan_device = Settings::values.vulkan_device.GetValue();
|
||||
RetrieveVulkanDevices();
|
||||
|
||||
|
|
@ -215,9 +214,9 @@ void ConfigureGraphics::PopulateVSyncModeSelection(bool use_setting) {
|
|||
|
||||
const Settings::VSyncMode global_vsync_mode = Settings::values.vsync_mode.GetValue(true);
|
||||
vsync_restore_global_button->setEnabled(
|
||||
((backend == Settings::RendererBackend::OpenGL_GLSL
|
||||
|| backend == Settings::RendererBackend::OpenGL_GLASM
|
||||
|| backend == Settings::RendererBackend::OpenGL_SPIRV) &&
|
||||
((backend == Settings::RendererBackend::OpenGL_GLSL ||
|
||||
backend == Settings::RendererBackend::OpenGL_GLASM ||
|
||||
backend == Settings::RendererBackend::OpenGL_SPIRV) &&
|
||||
(global_vsync_mode == Settings::VSyncMode::Immediate ||
|
||||
global_vsync_mode == Settings::VSyncMode::Fifo)) ||
|
||||
backend == Settings::RendererBackend::Vulkan);
|
||||
|
|
@ -286,7 +285,9 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
|
|||
api_combobox = widget->combobox;
|
||||
api_restore_global_button = widget->restore_button;
|
||||
if (!Settings::IsConfiguringGlobal()) {
|
||||
api_restore_global_button->connect(api_restore_global_button, &QAbstractButton::clicked, [this](bool) { UpdateAPILayout(); });
|
||||
api_restore_global_button->connect(api_restore_global_button,
|
||||
&QAbstractButton::clicked,
|
||||
[this](bool) { UpdateAPILayout(); });
|
||||
// Detach API's restore button and place it where we want
|
||||
// Lets us put it on the side, and it will automatically scale if there's a
|
||||
// second combobox (vulkan_device)
|
||||
|
|
@ -312,20 +313,21 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
|
|||
widget->layout()->addWidget(restore_button);
|
||||
|
||||
restore_button->connect(restore_button, &QAbstractButton::clicked,
|
||||
[restore_button, this](bool) {
|
||||
Settings::values.vsync_mode.SetGlobal(true);
|
||||
PopulateVSyncModeSelection(true);
|
||||
[restore_button, this](bool) {
|
||||
Settings::values.vsync_mode.SetGlobal(true);
|
||||
PopulateVSyncModeSelection(true);
|
||||
|
||||
restore_button->setVisible(false);
|
||||
});
|
||||
restore_button->setVisible(false);
|
||||
});
|
||||
|
||||
std::function<void()> set_non_global = [restore_button, this]() {
|
||||
Settings::values.vsync_mode.SetGlobal(false);
|
||||
UpdateVsyncSetting();
|
||||
restore_button->setVisible(true);
|
||||
};
|
||||
widget->combobox->connect(widget->combobox, QOverload<int>::of(&QComboBox::activated),
|
||||
[set_non_global]() { set_non_global(); });
|
||||
widget->combobox->connect(widget->combobox,
|
||||
QOverload<int>::of(&QComboBox::activated),
|
||||
[set_non_global]() { set_non_global(); });
|
||||
vsync_restore_global_button = restore_button;
|
||||
}
|
||||
hold_graphics.emplace(setting->Id(), widget);
|
||||
|
|
@ -364,15 +366,15 @@ void ConfigureGraphics::Setup(const ConfigurationShared::Builder& builder) {
|
|||
ui->bg_widget->layout()->addWidget(bg_restore_button);
|
||||
|
||||
bg_restore_button->connect(bg_restore_button, &QAbstractButton::clicked,
|
||||
[bg_restore_button, this](bool) {
|
||||
const int r = Settings::values.bg_red.GetValue(true);
|
||||
const int g = Settings::values.bg_green.GetValue(true);
|
||||
const int b = Settings::values.bg_blue.GetValue(true);
|
||||
UpdateBackgroundColorButton(QColor::fromRgb(r, g, b));
|
||||
[bg_restore_button, this](bool) {
|
||||
const int r = Settings::values.bg_red.GetValue(true);
|
||||
const int g = Settings::values.bg_green.GetValue(true);
|
||||
const int b = Settings::values.bg_blue.GetValue(true);
|
||||
UpdateBackgroundColorButton(QColor::fromRgb(r, g, b));
|
||||
|
||||
bg_restore_button->setVisible(false);
|
||||
bg_restore_button->setEnabled(false);
|
||||
});
|
||||
bg_restore_button->setVisible(false);
|
||||
bg_restore_button->setEnabled(false);
|
||||
});
|
||||
|
||||
ui->bg_button->connect(ui->bg_button, &QAbstractButton::clicked, [bg_restore_button](bool) {
|
||||
bg_restore_button->setVisible(true);
|
||||
|
|
@ -397,17 +399,19 @@ const QString ConfigureGraphics::TranslateVSyncMode(VkPresentModeKHR mode,
|
|||
Settings::RendererBackend backend) const {
|
||||
switch (mode) {
|
||||
case VK_PRESENT_MODE_IMMEDIATE_KHR:
|
||||
return (backend == Settings::RendererBackend::OpenGL_GLSL
|
||||
|| backend == Settings::RendererBackend::OpenGL_GLASM
|
||||
|| backend == Settings::RendererBackend::OpenGL_SPIRV)
|
||||
? tr("Off") : QStringLiteral("Immediate (%1)").arg(tr("VSync Off"));
|
||||
return (backend == Settings::RendererBackend::OpenGL_GLSL ||
|
||||
backend == Settings::RendererBackend::OpenGL_GLASM ||
|
||||
backend == Settings::RendererBackend::OpenGL_SPIRV)
|
||||
? tr("Off")
|
||||
: QStringLiteral("Immediate (%1)").arg(tr("VSync Off"));
|
||||
case VK_PRESENT_MODE_MAILBOX_KHR:
|
||||
return QStringLiteral("Mailbox (%1)").arg(tr("Recommended"));
|
||||
case VK_PRESENT_MODE_FIFO_KHR:
|
||||
return (backend == Settings::RendererBackend::OpenGL_GLSL
|
||||
|| backend == Settings::RendererBackend::OpenGL_GLASM
|
||||
|| backend == Settings::RendererBackend::OpenGL_SPIRV)
|
||||
? tr("On") : QStringLiteral("FIFO (%1)").arg(tr("VSync On"));
|
||||
return (backend == Settings::RendererBackend::OpenGL_GLSL ||
|
||||
backend == Settings::RendererBackend::OpenGL_GLASM ||
|
||||
backend == Settings::RendererBackend::OpenGL_SPIRV)
|
||||
? tr("On")
|
||||
: QStringLiteral("FIFO (%1)").arg(tr("VSync On"));
|
||||
case VK_PRESENT_MODE_FIFO_RELAXED_KHR:
|
||||
return QStringLiteral("FIFO Relaxed");
|
||||
default:
|
||||
|
|
@ -416,7 +420,9 @@ const QString ConfigureGraphics::TranslateVSyncMode(VkPresentModeKHR mode,
|
|||
}
|
||||
|
||||
int ConfigureGraphics::FindIndex(u32 enumeration, int value) const {
|
||||
for (u32 i = 0; enumeration < combobox_translations.size() && i < combobox_translations.at(enumeration).size(); i++)
|
||||
for (u32 i = 0; enumeration < combobox_translations.size() &&
|
||||
i < combobox_translations.at(enumeration).size();
|
||||
i++)
|
||||
if (combobox_translations.at(enumeration)[i].first == u32(value))
|
||||
return i;
|
||||
return -1;
|
||||
|
|
@ -432,10 +438,14 @@ void ConfigureGraphics::ApplyConfiguration() {
|
|||
|
||||
Settings::values.vulkan_device.SetGlobal(true);
|
||||
auto const index = Settings::EnumMetadata<Settings::RendererBackend>::Index();
|
||||
if (Settings::IsConfiguringGlobal() || (!Settings::IsConfiguringGlobal() && api_restore_global_button->isEnabled())) {
|
||||
auto backend = index >= combobox_translations.size() || size_t(api_combobox->currentIndex()) >= combobox_translations.at(index).size()
|
||||
? Settings::values.renderer_backend.GetValue()
|
||||
: Settings::RendererBackend(combobox_translations.at(index)[api_combobox->currentIndex()].first);
|
||||
if (Settings::IsConfiguringGlobal() ||
|
||||
(!Settings::IsConfiguringGlobal() && api_restore_global_button->isEnabled())) {
|
||||
auto backend =
|
||||
index >= combobox_translations.size() ||
|
||||
size_t(api_combobox->currentIndex()) >= combobox_translations.at(index).size()
|
||||
? Settings::values.renderer_backend.GetValue()
|
||||
: Settings::RendererBackend(
|
||||
combobox_translations.at(index)[api_combobox->currentIndex()].first);
|
||||
switch (backend) {
|
||||
case Settings::RendererBackend::Vulkan:
|
||||
Settings::values.vulkan_device.SetGlobal(Settings::IsConfiguringGlobal());
|
||||
|
|
@ -506,12 +516,15 @@ Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const {
|
|||
auto const index = Settings::EnumMetadata<Settings::RendererBackend>::Index();
|
||||
if (!Settings::IsConfiguringGlobal() && !api_restore_global_button->isEnabled())
|
||||
return Settings::values.renderer_backend.GetValue(true);
|
||||
return index >= combobox_translations.size() || size_t(api_combobox->currentIndex()) >= combobox_translations.at(index).size()
|
||||
? Settings::values.renderer_backend.GetValue()
|
||||
: Settings::RendererBackend(combobox_translations.at(index).at(api_combobox->currentIndex()).first);
|
||||
return index >= combobox_translations.size() || size_t(api_combobox->currentIndex()) >=
|
||||
combobox_translations.at(index).size()
|
||||
? Settings::values.renderer_backend.GetValue()
|
||||
: Settings::RendererBackend(
|
||||
combobox_translations.at(index).at(api_combobox->currentIndex()).first);
|
||||
}();
|
||||
|
||||
if (selected_backend == Settings::RendererBackend::Vulkan && UISettings::values.has_broken_vulkan)
|
||||
if (selected_backend == Settings::RendererBackend::Vulkan &&
|
||||
UISettings::values.has_broken_vulkan)
|
||||
return Settings::RendererBackend::OpenGL_GLSL;
|
||||
return selected_backend;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -9,10 +9,10 @@
|
|||
#include <qnamespace.h>
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "ui_configure_graphics_advanced.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_graphics_advanced.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "yuzu/configuration/shared_widget.h"
|
||||
|
||||
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <vector>
|
||||
#include <QLabel>
|
||||
#include <qnamespace.h>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QSlider>
|
||||
#include <qnamespace.h>
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "ui_configure_graphics_extensions.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_graphics_extensions.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "yuzu/configuration/shared_widget.h"
|
||||
|
||||
ConfigureGraphicsExtensions::ConfigureGraphicsExtensions(
|
||||
const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
|
||||
const ConfigurationShared::Builder& builder, QWidget* parent)
|
||||
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsExtensions>()}, system{system_} {
|
||||
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsExtensions>()},
|
||||
system{system_} {
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
|
|
@ -44,8 +45,8 @@ void ConfigureGraphicsExtensions::Setup(const ConfigurationShared::Builder& buil
|
|||
if (setting->Id() == Settings::values.sample_shading.Id()) {
|
||||
// TODO(crueter): should support this natively perhaps?
|
||||
return builder.BuildWidget(
|
||||
setting, apply_funcs, ConfigurationShared::RequestType::Slider, true,
|
||||
1.0f, nullptr, tr("%", "Sample Shading percentage (e.g. 50%)"));
|
||||
setting, apply_funcs, ConfigurationShared::RequestType::Slider, true, 1.0f,
|
||||
nullptr, tr("%", "Sample Shading percentage (e.g. 50%)"));
|
||||
} else {
|
||||
return builder.BuildWidget(setting, apply_funcs);
|
||||
}
|
||||
|
|
@ -64,7 +65,8 @@ void ConfigureGraphicsExtensions::Setup(const ConfigurationShared::Builder& buil
|
|||
#ifdef __APPLE__
|
||||
if (setting->Id() == Settings::values.dyna_state.Id()) {
|
||||
widget->setEnabled(false);
|
||||
widget->setToolTip(tr("Extended Dynamic State is disabled on macOS due to MoltenVK compatibility issues that cause black screens."));
|
||||
widget->setToolTip(tr("Extended Dynamic State is disabled on macOS due to MoltenVK "
|
||||
"compatibility issues that cause black screens."));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: 2017 Citra Emulator Project
|
||||
|
|
@ -13,10 +13,10 @@
|
|||
#include "hid_core/hid_core.h"
|
||||
|
||||
#include "frontend_common/config.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_hotkeys.h"
|
||||
#include "yuzu/configuration/configure_hotkeys.h"
|
||||
#include "yuzu/hotkeys.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/util/sequence_dialog/sequence_dialog.h"
|
||||
|
||||
constexpr int name_column = 0;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -15,10 +15,10 @@
|
|||
#include "core/hle/service/sm/sm.h"
|
||||
#include "hid_core/frontend/emulated_controller.h"
|
||||
#include "hid_core/hid_core.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "ui_configure_input.h"
|
||||
#include "ui_configure_input_advanced.h"
|
||||
#include "ui_configure_input_player.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "yuzu/configuration/configure_camera.h"
|
||||
#include "yuzu/configuration/configure_debug_controller.h"
|
||||
#include "yuzu/configuration/configure_input.h"
|
||||
|
|
@ -102,7 +102,7 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
|
|||
};
|
||||
|
||||
for (std::size_t i = 0; i < player_tabs.size(); ++i) {
|
||||
QHBoxLayout *tab_layout = new QHBoxLayout(player_tabs[i]);
|
||||
QHBoxLayout* tab_layout = new QHBoxLayout(player_tabs[i]);
|
||||
tab_layout->addWidget(player_controllers[i]);
|
||||
connect(player_controllers[i], &ConfigureInputPlayer::Connected, [this, i](bool checked) {
|
||||
// Ensures that connecting a controller changes the number of players
|
||||
|
|
@ -125,10 +125,11 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
|
|||
&ConfigureInput::UpdateAllInputDevices);
|
||||
connect(player_controllers[i], &ConfigureInputPlayer::RefreshInputProfiles, this,
|
||||
&ConfigureInput::UpdateAllInputProfiles, Qt::QueuedConnection);
|
||||
connect(connected_controller_checkboxes[i], &QCheckBox::STATE_CHANGED, [this, i](int state) {
|
||||
// Keep activated controllers synced with the "Connected Controllers" checkboxes
|
||||
player_controllers[i]->ConnectPlayer(state == Qt::Checked);
|
||||
});
|
||||
connect(connected_controller_checkboxes[i], &QCheckBox::STATE_CHANGED,
|
||||
[this, i](int state) {
|
||||
// Keep activated controllers synced with the "Connected Controllers" checkboxes
|
||||
player_controllers[i]->ConnectPlayer(state == Qt::Checked);
|
||||
});
|
||||
|
||||
// Remove/hide all the elements that exceed max_players, if applicable.
|
||||
if (i >= max_players) {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include "core/core.h"
|
||||
#include "hid_core/frontend/emulated_controller.h"
|
||||
#include "hid_core/hid_core.h"
|
||||
#include "ui_configure_input_advanced.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "ui_configure_input_advanced.h"
|
||||
#include "yuzu/configuration/configure_input_advanced.h"
|
||||
|
||||
ConfigureInputAdvanced::ConfigureInputAdvanced(Core::HID::HIDCore& hid_core_, QWidget* parent)
|
||||
|
|
|
|||
|
|
@ -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: 2022 yuzu Emulator Project
|
||||
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
#include <QWidget>
|
||||
|
||||
#include "qt_common/config/qt_config.h"
|
||||
#include "ui_configure_input_per_game.h"
|
||||
#include "yuzu/configuration/input_profiles.h"
|
||||
#include "qt_common/config/qt_config.h"
|
||||
|
||||
class QComboBox;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -14,13 +14,13 @@
|
|||
#include <QTimer>
|
||||
#include "common/assert.h"
|
||||
#include "common/param_package.h"
|
||||
#include "qt_common/config/qt_config.h"
|
||||
#include "hid_core/frontend/emulated_controller.h"
|
||||
#include "hid_core/hid_core.h"
|
||||
#include "hid_core/hid_types.h"
|
||||
#include "input_common/drivers/keyboard.h"
|
||||
#include "input_common/drivers/mouse.h"
|
||||
#include "input_common/main.h"
|
||||
#include "qt_common/config/qt_config.h"
|
||||
#include "ui_configure_input_player.h"
|
||||
#include "yuzu/bootmanager.h"
|
||||
#include "yuzu/configuration/configure_input_player.h"
|
||||
|
|
@ -294,11 +294,11 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|||
InputCommon::InputSubsystem* input_subsystem_,
|
||||
InputProfiles* profiles_, Core::HID::HIDCore& hid_core_,
|
||||
bool is_powered_on_, bool debug_)
|
||||
: QWidget(parent),
|
||||
ui(std::make_unique<Ui::ConfigureInputPlayer>()), player_index{player_index_}, debug{debug_},
|
||||
is_powered_on{is_powered_on_}, input_subsystem{input_subsystem_}, profiles(profiles_),
|
||||
timeout_timer(std::make_unique<QTimer>()),
|
||||
poll_timer(std::make_unique<QTimer>()), bottom_row{bottom_row_}, hid_core{hid_core_} {
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureInputPlayer>()),
|
||||
player_index{player_index_}, debug{debug_}, is_powered_on{is_powered_on_},
|
||||
input_subsystem{input_subsystem_}, profiles(profiles_),
|
||||
timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()),
|
||||
bottom_row{bottom_row_}, hid_core{hid_core_} {
|
||||
if (player_index == 0) {
|
||||
auto* emulated_controller_p1 =
|
||||
hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
|
||||
|
|
@ -1215,10 +1215,8 @@ void ConfigureInputPlayer::UpdateControllerAvailableButtons() {
|
|||
case Core::HID::NpadStyleIndex::Fullkey:
|
||||
case Core::HID::NpadStyleIndex::Handheld:
|
||||
layout_hidden = {
|
||||
ui->buttonShoulderButtonsSLSRLeft,
|
||||
ui->buttonShoulderButtonsSLSRRight,
|
||||
ui->horizontalSpacerShoulderButtonsWidget2,
|
||||
ui->horizontalSpacerShoulderButtonsWidget4,
|
||||
ui->buttonShoulderButtonsSLSRLeft, ui->buttonShoulderButtonsSLSRRight,
|
||||
ui->horizontalSpacerShoulderButtonsWidget2, ui->horizontalSpacerShoulderButtonsWidget4,
|
||||
ui->buttonMiscButtonsScreenshotGroup,
|
||||
};
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -2432,7 +2432,8 @@ void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, co
|
|||
1.0 - std::sqrt((offset.x() * offset.x()) + (offset.y() * offset.y())) * 0.1f);
|
||||
|
||||
const float rotation =
|
||||
((offset.x() == 0.f) ? std::atan(1.f) * 2.f : std::atan(offset.y() / offset.x())) * (180.f / (std::atan(1.f) * 4.f));
|
||||
((offset.x() == 0.f) ? std::atan(1.f) * 2.f : std::atan(offset.y() / offset.x())) *
|
||||
(180.f / (std::atan(1.f) * 4.f));
|
||||
|
||||
p.save();
|
||||
p.translate(offset_center);
|
||||
|
|
|
|||
|
|
@ -12,10 +12,7 @@
|
|||
#include "yuzu/configuration/configure_network.h"
|
||||
|
||||
ConfigureNetwork::ConfigureNetwork(const Core::System& system_, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, ui(std::make_unique<Ui::ConfigureNetwork>())
|
||||
, system{system_}
|
||||
{
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureNetwork>()), system{system_} {
|
||||
ui->setupUi(this);
|
||||
for (const auto& iface : Network::GetAvailableNetworkInterfaces())
|
||||
ui->network_interface->addItem(QString::fromStdString(iface.name));
|
||||
|
|
|
|||
|
|
@ -29,28 +29,28 @@
|
|||
#include "core/file_sys/xts_archive.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "frontend_common/config.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_per_game.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_applets.h"
|
||||
#include "yuzu/configuration/configure_audio.h"
|
||||
#include "yuzu/configuration/configure_cpu.h"
|
||||
#include "yuzu/configuration/configure_graphics.h"
|
||||
#include "yuzu/configuration/configure_graphics_advanced.h"
|
||||
#include "yuzu/configuration/configure_graphics_extensions.h"
|
||||
#include "yuzu/configuration/configure_input_per_game.h"
|
||||
#include "yuzu/configuration/configure_network.h"
|
||||
#include "yuzu/configuration/configure_per_game.h"
|
||||
#include "yuzu/configuration/configure_per_game_addons.h"
|
||||
#include "yuzu/configuration/configure_system.h"
|
||||
#include "yuzu/configuration/configure_network.h"
|
||||
#include "yuzu/configuration/configure_applets.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/util/util.h"
|
||||
#include "yuzu/vk_device_info.h"
|
||||
|
||||
ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name,
|
||||
std::vector<VkDeviceInfo::Record>& vk_device_records,
|
||||
Core::System& system_)
|
||||
: QDialog(parent),
|
||||
ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_},
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_},
|
||||
system{system_},
|
||||
builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())},
|
||||
tab_group{std::make_shared<std::vector<ConfigurationShared::Tab*>>()} {
|
||||
const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name));
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
#include "configuration/shared_widget.h"
|
||||
#include "core/file_sys/vfs/vfs_types.h"
|
||||
#include "frontend_common/config.h"
|
||||
#include "vk_device_info.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "qt_common/config/qt_config.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "vk_device_info.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ ConfigurePerGameAddons::ConfigurePerGameAddons(Core::System& system_, QWidget* p
|
|||
connect(ui->folder, &QAbstractButton::clicked, this, &ConfigurePerGameAddons::InstallModFolder);
|
||||
connect(ui->zip, &QAbstractButton::clicked, this, &ConfigurePerGameAddons::InstallModZip);
|
||||
|
||||
connect(tree_view, &QTreeView::customContextMenuRequested, this, &ConfigurePerGameAddons::showContextMenu);
|
||||
connect(tree_view, &QTreeView::customContextMenuRequested, this,
|
||||
&ConfigurePerGameAddons::showContextMenu);
|
||||
}
|
||||
|
||||
ConfigurePerGameAddons::~ConfigurePerGameAddons() = default;
|
||||
|
|
@ -92,10 +93,10 @@ void ConfigurePerGameAddons::OnItemChanged(QStandardItem* item) {
|
|||
for (auto* update_item : update_items) {
|
||||
if (update_item != item && update_item->checkState() == Qt::Checked) {
|
||||
disconnect(item_model, &QStandardItemModel::itemChanged, this,
|
||||
&ConfigurePerGameAddons::OnItemChanged);
|
||||
&ConfigurePerGameAddons::OnItemChanged);
|
||||
update_item->setCheckState(Qt::Unchecked);
|
||||
connect(item_model, &QStandardItemModel::itemChanged, this,
|
||||
&ConfigurePerGameAddons::OnItemChanged);
|
||||
&ConfigurePerGameAddons::OnItemChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -109,7 +110,8 @@ void ConfigurePerGameAddons::ApplyConfiguration() {
|
|||
const auto disabled = item.front()->checkState() == Qt::Unchecked;
|
||||
if (disabled) {
|
||||
QVariant userData = item.front()->data(Qt::UserRole);
|
||||
if (userData.isValid() && userData.canConvert<quint32>() && item.front()->text() == QStringLiteral("Update")) {
|
||||
if (userData.isValid() && userData.canConvert<quint32>() &&
|
||||
item.front()->text() == QStringLiteral("Update")) {
|
||||
quint32 numeric_version = userData.toUInt();
|
||||
disabled_addons.push_back(fmt::format("Update@{}", numeric_version));
|
||||
} else {
|
||||
|
|
@ -164,7 +166,7 @@ void ConfigurePerGameAddons::InstallMods(const QStringList& mods) {
|
|||
}
|
||||
}
|
||||
|
||||
void ConfigurePerGameAddons::InstallModPath(const QString& path, const QString &fallbackName) {
|
||||
void ConfigurePerGameAddons::InstallModPath(const QString& path, const QString& fallbackName) {
|
||||
const auto mods = QtCommon::Mod::GetModFolders(path, fallbackName);
|
||||
|
||||
if (mods.size() > 1) {
|
||||
|
|
@ -203,8 +205,9 @@ void ConfigurePerGameAddons::InstallModZip() {
|
|||
|
||||
void ConfigurePerGameAddons::AddonDeleteRequested(QList<QModelIndex> selected) {
|
||||
QList<QModelIndex> filtered;
|
||||
for (const QModelIndex &index : selected) {
|
||||
if (!index.data(PATCH_LOCATION).toString().isEmpty()) filtered << index;
|
||||
for (const QModelIndex& index : selected) {
|
||||
if (!index.data(PATCH_LOCATION).toString().isEmpty())
|
||||
filtered << index;
|
||||
}
|
||||
|
||||
if (filtered.empty()) {
|
||||
|
|
@ -215,10 +218,9 @@ void ConfigurePerGameAddons::AddonDeleteRequested(QList<QModelIndex> selected) {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
const auto header = tr("You are about to delete the following installed mods:\n");
|
||||
QString selected_str;
|
||||
for (const QModelIndex &index : filtered) {
|
||||
for (const QModelIndex& index : filtered) {
|
||||
selected_str = selected_str % index.data().toString() % QStringLiteral("\n");
|
||||
}
|
||||
|
||||
|
|
@ -231,9 +233,10 @@ void ConfigurePerGameAddons::AddonDeleteRequested(QList<QModelIndex> selected) {
|
|||
QtCommon::Frontend::StandardButton::Yes |
|
||||
QtCommon::Frontend::StandardButton::No);
|
||||
|
||||
if (choice == QtCommon::Frontend::StandardButton::No) return;
|
||||
if (choice == QtCommon::Frontend::StandardButton::No)
|
||||
return;
|
||||
|
||||
for (const QModelIndex &index : filtered) {
|
||||
for (const QModelIndex& index : filtered) {
|
||||
std::filesystem::remove_all(index.data(PATCH_LOCATION).toString().toStdString());
|
||||
}
|
||||
|
||||
|
|
@ -252,17 +255,18 @@ void ConfigurePerGameAddons::showContextMenu(const QPoint& pos) {
|
|||
auto selected = tree_view->selectionModel()->selectedRows();
|
||||
if (index.isValid() && selected.empty()) {
|
||||
QModelIndex idx = item_model->index(index.row(), 0);
|
||||
if (idx.isValid()) selected << idx;
|
||||
if (idx.isValid())
|
||||
selected << idx;
|
||||
}
|
||||
|
||||
if (selected.empty()) return;
|
||||
if (selected.empty())
|
||||
return;
|
||||
|
||||
QMenu menu(this);
|
||||
|
||||
QAction *remove = menu.addAction(tr("&Delete"));
|
||||
connect(remove, &QAction::triggered, this, [this, selected]() {
|
||||
AddonDeleteRequested(selected);
|
||||
});
|
||||
QAction* remove = menu.addAction(tr("&Delete"));
|
||||
connect(remove, &QAction::triggered, this,
|
||||
[this, selected]() { AddonDeleteRequested(selected); });
|
||||
|
||||
if (selected.length() == 1) {
|
||||
auto loc = selected.at(0).data(PATCH_LOCATION).toString();
|
||||
|
|
@ -333,9 +337,11 @@ void ConfigurePerGameAddons::LoadConfiguration() {
|
|||
bool patch_disabled = false;
|
||||
if (is_external_update) {
|
||||
std::string disabled_key = fmt::format("Update@{}", patch.numeric_version);
|
||||
patch_disabled = std::find(disabled.begin(), disabled.end(), disabled_key) != disabled.end();
|
||||
patch_disabled =
|
||||
std::find(disabled.begin(), disabled.end(), disabled_key) != disabled.end();
|
||||
} else {
|
||||
patch_disabled = std::find(disabled.begin(), disabled.end(), name.toStdString()) != disabled.end();
|
||||
patch_disabled =
|
||||
std::find(disabled.begin(), disabled.end(), name.toStdString()) != disabled.end();
|
||||
}
|
||||
|
||||
bool should_enable = !patch_disabled;
|
||||
|
|
|
|||
|
|
@ -32,10 +32,7 @@ class ConfigurePerGameAddons : public QWidget {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum PatchData {
|
||||
NUMERIC_VERSION = Qt::UserRole,
|
||||
PATCH_LOCATION
|
||||
};
|
||||
enum PatchData { NUMERIC_VERSION = Qt::UserRole, PATCH_LOCATION };
|
||||
|
||||
explicit ConfigurePerGameAddons(Core::System& system_, QWidget* parent = nullptr);
|
||||
~ConfigurePerGameAddons() override;
|
||||
|
|
@ -48,7 +45,7 @@ public:
|
|||
void SetTitleId(u64 id);
|
||||
|
||||
public slots:
|
||||
void InstallMods(const QStringList &mods);
|
||||
void InstallMods(const QStringList& mods);
|
||||
void InstallModPath(const QString& path, const QString& fallbackName = {});
|
||||
|
||||
void InstallModFolder();
|
||||
|
|
|
|||
|
|
@ -106,7 +106,8 @@ ConfigureProfileManager::ConfigureProfileManager(Core::System& system_, QWidget*
|
|||
|
||||
ui->scrollArea->setLayout(layout);
|
||||
|
||||
connect(tree_view, &QTreeView::customContextMenuRequested, this, &ConfigureProfileManager::showContextMenu);
|
||||
connect(tree_view, &QTreeView::customContextMenuRequested, this,
|
||||
&ConfigureProfileManager::showContextMenu);
|
||||
|
||||
connect(tree_view, &QTreeView::clicked, this, &ConfigureProfileManager::SelectUser);
|
||||
|
||||
|
|
@ -229,8 +230,7 @@ void ConfigureProfileManager::showContextMenu(const QPoint& pos) {
|
|||
QAction* edit = menu.addAction(tr("&Edit"));
|
||||
QAction* remove = menu.addAction(tr("&Delete"));
|
||||
|
||||
QAction* chosen =
|
||||
menu.exec(tree_view->viewport()->mapToGlobal(pos));
|
||||
QAction* chosen = menu.exec(tree_view->viewport()->mapToGlobal(pos));
|
||||
|
||||
if (!chosen)
|
||||
return;
|
||||
|
|
@ -250,7 +250,7 @@ void ConfigureProfileManager::SelectUser(const QModelIndex& index) {
|
|||
}
|
||||
|
||||
void ConfigureProfileManager::AddUser() {
|
||||
NewUserDialog *dialog = new NewUserDialog(this);
|
||||
NewUserDialog* dialog = new NewUserDialog(this);
|
||||
|
||||
connect(dialog, &NewUserDialog::userAdded, this, [dialog, this](User user) {
|
||||
auto uuid = user.uuid;
|
||||
|
|
@ -285,35 +285,37 @@ void ConfigureProfileManager::EditUser() {
|
|||
std::string username;
|
||||
username.reserve(32);
|
||||
|
||||
std::ranges::copy_if(profile.username, std::back_inserter(username), [](u8 byte) { return byte != 0; });
|
||||
std::ranges::copy_if(profile.username, std::back_inserter(username),
|
||||
[](u8 byte) { return byte != 0; });
|
||||
|
||||
NewUserDialog *dialog = new NewUserDialog(uuid.value(), username, tr("Edit User"), this);
|
||||
NewUserDialog* dialog = new NewUserDialog(uuid.value(), username, tr("Edit User"), this);
|
||||
|
||||
connect(dialog, &NewUserDialog::userAdded, this, [dialog, profile, user_idx, uuid, this](User user) mutable {
|
||||
// TODO: MOVE UUID
|
||||
// auto new_uuid = user.uuid;
|
||||
auto new_username = user.username;
|
||||
auto pixmap = user.pixmap;
|
||||
connect(dialog, &NewUserDialog::userAdded, this,
|
||||
[dialog, profile, user_idx, uuid, this](User user) mutable {
|
||||
// TODO: MOVE UUID
|
||||
// auto new_uuid = user.uuid;
|
||||
auto new_username = user.username;
|
||||
auto pixmap = user.pixmap;
|
||||
|
||||
auto const uuid_val = uuid.value();
|
||||
auto const uuid_val = uuid.value();
|
||||
|
||||
const auto username_std = new_username.toStdString();
|
||||
std::fill(profile.username.begin(), profile.username.end(), '\0');
|
||||
std::copy(username_std.begin(), username_std.end(), profile.username.begin());
|
||||
const auto username_std = new_username.toStdString();
|
||||
std::fill(profile.username.begin(), profile.username.end(), '\0');
|
||||
std::copy(username_std.begin(), username_std.end(), profile.username.begin());
|
||||
|
||||
profile_manager.SetProfileBase(uuid_val, profile);
|
||||
profile_manager.WriteUserSaveFile();
|
||||
profile_manager.SetProfileBase(uuid_val, profile);
|
||||
profile_manager.WriteUserSaveFile();
|
||||
|
||||
item_model->setItem(
|
||||
user_idx, 0,
|
||||
new QStandardItem{pixmap,
|
||||
FormatUserEntryText(QString::fromStdString(username_std), uuid_val)});
|
||||
item_model->setItem(
|
||||
user_idx, 0,
|
||||
new QStandardItem{pixmap, FormatUserEntryText(
|
||||
QString::fromStdString(username_std), uuid_val)});
|
||||
|
||||
saveImage(pixmap, uuid_val);
|
||||
UpdateCurrentUser();
|
||||
saveImage(pixmap, uuid_val);
|
||||
UpdateCurrentUser();
|
||||
|
||||
dialog->deleteLater();
|
||||
});
|
||||
dialog->deleteLater();
|
||||
});
|
||||
|
||||
connect(dialog, &QDialog::rejected, dialog, &QObject::deleteLater);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ public:
|
|||
explicit ConfigureProfileManagerDeleteDialog(QWidget* parent);
|
||||
~ConfigureProfileManagerDeleteDialog();
|
||||
|
||||
void SetInfo(const QString& username, const Common::UUID& uuid,
|
||||
int index);
|
||||
void SetInfo(const QString& username, const Common::UUID& uuid, int index);
|
||||
|
||||
signals:
|
||||
void deleteUser(int index);
|
||||
|
|
@ -71,7 +70,7 @@ public:
|
|||
|
||||
private slots:
|
||||
void saveImage(QPixmap pixmap, Common::UUID uuid);
|
||||
void showContextMenu(const QPoint &pos);
|
||||
void showContextMenu(const QPoint& pos);
|
||||
void DeleteUser(const int index);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2022 yuzu Emulator Project
|
||||
|
|
@ -11,12 +11,12 @@
|
|||
#include <QTimer>
|
||||
#include <fmt/ranges.h>
|
||||
|
||||
#include "qt_common/config/qt_config.h"
|
||||
#include "hid_core/frontend/emulated_controller.h"
|
||||
#include "hid_core/hid_core.h"
|
||||
#include "input_common/drivers/keyboard.h"
|
||||
#include "input_common/drivers/mouse.h"
|
||||
#include "input_common/main.h"
|
||||
#include "qt_common/config/qt_config.h"
|
||||
#include "ui_configure_ringcon.h"
|
||||
#include "yuzu/bootmanager.h"
|
||||
#include "yuzu/configuration/configure_ringcon.h"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "ui_configure_system.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "ui_configure_system.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_system.h"
|
||||
#include "yuzu/configuration/shared_widget.h"
|
||||
|
|
@ -87,7 +87,8 @@ ConfigureSystem::ConfigureSystem(Core::System& system_,
|
|||
|
||||
connect(combo_language, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
|
||||
connect(combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
|
||||
connect(checkbox_rtc, qOverload<CHECKSTATE_TYPE>(&QCheckBox::STATE_CHANGED), this, update_rtc_date);
|
||||
connect(checkbox_rtc, qOverload<CHECKSTATE_TYPE>(&QCheckBox::STATE_CHANGED), this,
|
||||
update_rtc_date);
|
||||
connect(date_rtc_offset, qOverload<int>(&QSpinBox::valueChanged), this, update_rtc_date);
|
||||
connect(date_rtc, &QDateTimeEdit::dateTimeChanged, this, update_date_offset);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
#include "common/fs/fs.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include "common/settings.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_tas.h"
|
||||
#include "yuzu/configuration/configure_tas.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
ConfigureTasDialog::ConfigureTasDialog(QWidget* parent)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureTas>()) {
|
||||
|
|
@ -35,7 +35,8 @@ void ConfigureTasDialog::LoadConfiguration() {
|
|||
ui->tas_enable->setChecked(Settings::values.tas_enable.GetValue());
|
||||
ui->tas_loop_script->setChecked(Settings::values.tas_loop.GetValue());
|
||||
ui->tas_pause_on_load->setChecked(Settings::values.pause_tas_on_load.GetValue());
|
||||
ui->tas_show_recording_dialog->setChecked(Settings::values.tas_show_recording_dialog.GetValue());
|
||||
ui->tas_show_recording_dialog->setChecked(
|
||||
Settings::values.tas_show_recording_dialog.GetValue());
|
||||
}
|
||||
|
||||
void ConfigureTasDialog::ApplyConfiguration() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
#include <QInputDialog>
|
||||
|
|
@ -548,9 +548,8 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) {
|
|||
}
|
||||
const auto mouse_event = static_cast<QMouseEvent*>(event);
|
||||
if (!drag_state.active) {
|
||||
drag_state.active =
|
||||
(mouse_event->globalPosition().toPoint() - drag_state.start_pos).manhattanLength() >=
|
||||
QApplication::startDragDistance();
|
||||
drag_state.active = (mouse_event->globalPosition().toPoint() - drag_state.start_pos)
|
||||
.manhattanLength() >= QApplication::startDragDistance();
|
||||
if (!drag_state.active) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
#include "core/frontend/framebuffer_layout.h"
|
||||
#include "ui_configure_ui.h"
|
||||
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: 2017 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "yuzu/configuration/configure_web.h"
|
||||
#include <QIcon>
|
||||
#include <QMessageBox>
|
||||
#include "yuzu/configuration/configure_web.h"
|
||||
|
||||
#if QT_VERSION_MAJOR >= 6
|
||||
#include <QRegularExpressionValidator>
|
||||
|
|
@ -16,28 +16,25 @@
|
|||
|
||||
#include <QtConcurrentRun>
|
||||
#include "common/settings.h"
|
||||
#include "ui_configure_web.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_configure_web.h"
|
||||
|
||||
ConfigureWeb::ConfigureWeb(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, ui(std::make_unique<Ui::ConfigureWeb>())
|
||||
, m_rng{QRandomGenerator::system()}
|
||||
{
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureWeb>()), m_rng{QRandomGenerator::system()} {
|
||||
ui->setupUi(this);
|
||||
|
||||
QString user_regex = QStringLiteral(".{4,20}");
|
||||
QString token_regex = QStringLiteral("[a-z]{48}");
|
||||
|
||||
#if QT_VERSION_MAJOR >= 6
|
||||
QRegularExpressionValidator *username_validator = new QRegularExpressionValidator(this);
|
||||
QRegularExpressionValidator *token_validator = new QRegularExpressionValidator(this);
|
||||
QRegularExpressionValidator* username_validator = new QRegularExpressionValidator(this);
|
||||
QRegularExpressionValidator* token_validator = new QRegularExpressionValidator(this);
|
||||
|
||||
username_validator->setRegularExpression(QRegularExpression(user_regex));
|
||||
token_validator->setRegularExpression(QRegularExpression(token_regex));
|
||||
#else
|
||||
QRegExpValidator *username_validator = new QRegExpValidator(this);
|
||||
QRegExpValidator *token_validator = new QRegExpValidator(this);
|
||||
QRegExpValidator* username_validator = new QRegExpValidator(this);
|
||||
QRegExpValidator* token_validator = new QRegExpValidator(this);
|
||||
|
||||
username_validator->setRegExp(QRegExp(user_regex));
|
||||
token_validator->setRegExp(QRegExp(token_regex));
|
||||
|
|
@ -121,7 +118,8 @@ void ConfigureWeb::VerifyLogin() {
|
|||
ui->label_token_verified->setToolTip(tr("All Good", "Tooltip"));
|
||||
} else {
|
||||
ui->label_token_verified->setPixmap(failed);
|
||||
ui->label_token_verified->setToolTip(tr("Must be 48 characters, and lowercase a-z", "Tooltip"));
|
||||
ui->label_token_verified->setToolTip(
|
||||
tr("Must be 48 characters, and lowercase a-z", "Tooltip"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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: 2017 Citra Emulator Project
|
||||
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#include <QRandomGenerator>
|
||||
|
||||
#include <QWidget>
|
||||
#include <memory>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureWeb;
|
||||
|
|
@ -32,7 +32,7 @@ private:
|
|||
void SetConfiguration();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureWeb> ui;
|
||||
QRandomGenerator *m_rng;
|
||||
QRandomGenerator* m_rng;
|
||||
|
||||
private slots:
|
||||
void GenerateToken();
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@
|
|||
#include "common/logging/log.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/settings_common.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
#include "qt_common/qt_compat.h"
|
||||
|
||||
namespace ConfigurationShared {
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
|
|||
|
||||
if (!Settings::IsConfiguringGlobal()) {
|
||||
combobox->connect(combobox, QOverload<int>::of(&QComboBox::activated),
|
||||
[touch]() { touch(); });
|
||||
[touch]() { touch(); });
|
||||
}
|
||||
|
||||
return combobox;
|
||||
|
|
@ -413,13 +413,13 @@ QWidget* Widget::CreateDoubleSpinBox(const QString& given_suffix,
|
|||
};
|
||||
|
||||
if (!Settings::IsConfiguringGlobal()) {
|
||||
double_spinbox->connect(double_spinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
|
||||
[this, touch]() {
|
||||
if (double_spinbox->value() !=
|
||||
std::strtod(setting.ToStringGlobal().c_str(), nullptr)) {
|
||||
touch();
|
||||
}
|
||||
});
|
||||
double_spinbox->connect(
|
||||
double_spinbox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [this, touch]() {
|
||||
if (double_spinbox->value() !=
|
||||
std::strtod(setting.ToStringGlobal().c_str(), nullptr)) {
|
||||
touch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return double_spinbox;
|
||||
|
|
@ -491,11 +491,11 @@ QWidget* Widget::CreateDateTimeEdit(bool disabled, bool restrict,
|
|||
|
||||
if (!Settings::IsConfiguringGlobal()) {
|
||||
date_time_edit->connect(date_time_edit, &QDateTimeEdit::editingFinished,
|
||||
[this, get_clear_val, touch]() {
|
||||
if (date_time_edit->dateTime() != get_clear_val()) {
|
||||
touch();
|
||||
}
|
||||
});
|
||||
[this, get_clear_val, touch]() {
|
||||
if (date_time_edit->dateTime() != get_clear_val()) {
|
||||
touch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return date_time_edit;
|
||||
|
|
@ -570,7 +570,8 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
|
|||
}
|
||||
|
||||
if (require_checkbox) {
|
||||
QWidget* lhs = CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch);
|
||||
QWidget* lhs =
|
||||
CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch);
|
||||
layout->addWidget(lhs, 1);
|
||||
} else if (type_id != "bool") {
|
||||
QLabel* qt_label = CreateLabel(label);
|
||||
|
|
@ -665,16 +666,16 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
|
|||
layout->addWidget(restore_button);
|
||||
|
||||
restore_button->connect(restore_button, &QAbstractButton::clicked,
|
||||
[this, restore_func, checkbox_restore_func](bool) {
|
||||
LOG_DEBUG(Frontend, "Restore global state for \"{}\"",
|
||||
setting.GetLabel());
|
||||
[this, restore_func, checkbox_restore_func](bool) {
|
||||
LOG_DEBUG(Frontend, "Restore global state for \"{}\"",
|
||||
setting.GetLabel());
|
||||
|
||||
restore_button->setEnabled(false);
|
||||
restore_button->setVisible(false);
|
||||
restore_button->setEnabled(false);
|
||||
restore_button->setVisible(false);
|
||||
|
||||
checkbox_restore_func();
|
||||
restore_func();
|
||||
});
|
||||
checkbox_restore_func();
|
||||
restore_func();
|
||||
});
|
||||
|
||||
load_func = [this, serializer, require_checkbox, checkbox_serializer, other_setting]() {
|
||||
bool using_global = !restore_button->isEnabled();
|
||||
|
|
@ -766,8 +767,8 @@ Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translati
|
|||
|
||||
Builder::Builder(QWidget* parent_, bool runtime_lock_)
|
||||
: translations{InitializeTranslations(parent_)},
|
||||
combobox_translations{ComboboxEnumeration(parent_)}, parent{parent_}, runtime_lock{
|
||||
runtime_lock_} {}
|
||||
combobox_translations{ComboboxEnumeration(parent_)}, parent{parent_},
|
||||
runtime_lock{runtime_lock_} {}
|
||||
|
||||
Builder::~Builder() = default;
|
||||
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2023 yuzu Emulator Project
|
||||
|
|
@ -10,10 +10,10 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringLiteral>
|
||||
#include <QWidget>
|
||||
#include <QObject>
|
||||
#include <qobjectdefs.h>
|
||||
#include "qt_common/config/shared_translation.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -20,15 +20,15 @@ struct User {
|
|||
QPixmap pixmap;
|
||||
};
|
||||
|
||||
class NewUserDialog : public QDialog
|
||||
{
|
||||
class NewUserDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool isDefaultAvatar READ isDefaultAvatar WRITE setIsDefaultAvatar NOTIFY
|
||||
isDefaultAvatarChanged FINAL)
|
||||
|
||||
public:
|
||||
explicit NewUserDialog(QWidget *parent = nullptr);
|
||||
explicit NewUserDialog(Common::UUID uuid, const std::string &username, const QString &title, QWidget *parent = nullptr);
|
||||
explicit NewUserDialog(QWidget* parent = nullptr);
|
||||
explicit NewUserDialog(Common::UUID uuid, const std::string& username, const QString& title,
|
||||
QWidget* parent = nullptr);
|
||||
~NewUserDialog();
|
||||
|
||||
bool isDefaultAvatar() const;
|
||||
|
|
@ -39,8 +39,8 @@ public:
|
|||
static QPixmap DefaultAvatar();
|
||||
|
||||
private:
|
||||
Ui::NewUserDialog *ui;
|
||||
QGraphicsScene *m_scene;
|
||||
Ui::NewUserDialog* ui;
|
||||
QGraphicsScene* m_scene;
|
||||
QPixmap m_pixmap;
|
||||
|
||||
ProfileAvatarDialog* avatar_dialog;
|
||||
|
|
@ -48,12 +48,12 @@ private:
|
|||
bool m_isDefaultAvatar = true;
|
||||
bool m_editing = false;
|
||||
|
||||
void setup(Common::UUID uuid, const std::string &username, const QString &title);
|
||||
void setup(Common::UUID uuid, const std::string& username, const QString& title);
|
||||
bool LoadAvatarData();
|
||||
std::vector<uint8_t> DecompressYaz0(const FileSys::VirtualFile& file);
|
||||
|
||||
public slots:
|
||||
void setImage(const QPixmap &pixmap);
|
||||
void setImage(const QPixmap& pixmap);
|
||||
void selectImage();
|
||||
void setAvatar();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "data_dialog.h"
|
||||
#include "frontend_common/data_manager.h"
|
||||
#include "qt_common/util/content.h"
|
||||
#include "qt_common/qt_string_lookup.h"
|
||||
#include "qt_common/util/content.h"
|
||||
#include "ui_data_dialog.h"
|
||||
#include "util/util.h"
|
||||
|
||||
|
|
@ -18,18 +18,14 @@
|
|||
|
||||
#include <applets/qt_profile_select.h>
|
||||
|
||||
DataDialog::DataDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(std::make_unique<Ui::DataDialog>())
|
||||
{
|
||||
DataDialog::DataDialog(QWidget* parent) : QDialog(parent), ui(std::make_unique<Ui::DataDialog>()) {
|
||||
ui->setupUi(this);
|
||||
|
||||
// TODO: Should we make this a single widget that pulls data from a model?
|
||||
#define WIDGET(label, name) \
|
||||
ui->page->addWidget(new DataWidget(FrontendCommon::DataManager::DataDir::name, \
|
||||
QtCommon::StringLookup::DataManager##name##Tooltip, \
|
||||
QStringLiteral(#name), \
|
||||
this)); \
|
||||
#define WIDGET(label, name) \
|
||||
ui->page->addWidget(new DataWidget(FrontendCommon::DataManager::DataDir::name, \
|
||||
QtCommon::StringLookup::DataManager##name##Tooltip, \
|
||||
QStringLiteral(#name), this)); \
|
||||
ui->labels->addItem(label);
|
||||
|
||||
WIDGET(tr("Shaders"), Shaders)
|
||||
|
|
@ -53,14 +49,10 @@ DataDialog::DataDialog(QWidget *parent)
|
|||
DataDialog::~DataDialog() = default;
|
||||
|
||||
DataWidget::DataWidget(FrontendCommon::DataManager::DataDir data_dir,
|
||||
QtCommon::StringLookup::StringKey tooltip,
|
||||
const QString &exportName,
|
||||
QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(std::make_unique<Ui::DataWidget>())
|
||||
, m_dir(data_dir)
|
||||
, m_exportName(exportName)
|
||||
{
|
||||
QtCommon::StringLookup::StringKey tooltip, const QString& exportName,
|
||||
QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::DataWidget>()), m_dir(data_dir),
|
||||
m_exportName(exportName) {
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->tooltip->setText(QtCommon::StringLookup::Lookup(tooltip));
|
||||
|
|
@ -78,28 +70,24 @@ DataWidget::DataWidget(FrontendCommon::DataManager::DataDir data_dir,
|
|||
scan();
|
||||
}
|
||||
|
||||
void DataWidget::clear()
|
||||
{
|
||||
void DataWidget::clear() {
|
||||
std::string user_id = selectProfile();
|
||||
QtCommon::Content::ClearDataDir(m_dir, user_id);
|
||||
scan();
|
||||
}
|
||||
|
||||
void DataWidget::open()
|
||||
{
|
||||
void DataWidget::open() {
|
||||
std::string user_id = selectProfile();
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(
|
||||
QString::fromStdString(FrontendCommon::DataManager::GetDataDirString(m_dir, user_id))));
|
||||
}
|
||||
|
||||
void DataWidget::upload()
|
||||
{
|
||||
void DataWidget::upload() {
|
||||
std::string user_id = selectProfile();
|
||||
QtCommon::Content::ExportDataDir(m_dir, user_id, m_exportName);
|
||||
}
|
||||
|
||||
void DataWidget::download()
|
||||
{
|
||||
void DataWidget::download() {
|
||||
std::string user_id = selectProfile();
|
||||
QtCommon::Content::ImportDataDir(m_dir, user_id, std::bind(&DataWidget::scan, this));
|
||||
}
|
||||
|
|
@ -107,7 +95,7 @@ void DataWidget::download()
|
|||
void DataWidget::scan() {
|
||||
ui->size->setText(tr("Calculating..."));
|
||||
|
||||
QFutureWatcher<u64> *watcher = new QFutureWatcher<u64>(this);
|
||||
QFutureWatcher<u64>* watcher = new QFutureWatcher<u64>(this);
|
||||
|
||||
connect(watcher, &QFutureWatcher<u64>::finished, this, [=, this]() {
|
||||
u64 size = watcher->result();
|
||||
|
|
@ -120,8 +108,7 @@ void DataWidget::scan() {
|
|||
QtConcurrent::run([this]() { return FrontendCommon::DataManager::DataDirSize(m_dir); }));
|
||||
}
|
||||
|
||||
std::string DataWidget::selectProfile()
|
||||
{
|
||||
std::string DataWidget::selectProfile() {
|
||||
std::string user_id{};
|
||||
if (m_dir == FrontendCommon::DataManager::DataDir::Saves) {
|
||||
user_id = GetProfileIDString();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
#ifndef DATA_DIALOG_H
|
||||
|
|
@ -14,26 +14,23 @@ namespace Ui {
|
|||
class DataDialog;
|
||||
}
|
||||
|
||||
class DataDialog : public QDialog
|
||||
{
|
||||
class DataDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DataDialog(QWidget *parent = nullptr);
|
||||
explicit DataDialog(QWidget* parent = nullptr);
|
||||
~DataDialog();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::DataDialog> ui;
|
||||
};
|
||||
|
||||
class DataWidget : public QWidget
|
||||
{
|
||||
class DataWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DataWidget(FrontendCommon::DataManager::DataDir data_dir,
|
||||
QtCommon::StringLookup::StringKey tooltip,
|
||||
const QString &exportName,
|
||||
QWidget *parent = nullptr);
|
||||
QtCommon::StringLookup::StringKey tooltip, const QString& exportName,
|
||||
QWidget* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2018 yuzu Emulator Project
|
||||
|
|
@ -11,8 +11,8 @@
|
|||
#endif
|
||||
|
||||
#include "common/logging/backend.h"
|
||||
#include "yuzu/debugger/console.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/debugger/console.h"
|
||||
|
||||
namespace Debugger {
|
||||
void ToggleConsole() {
|
||||
|
|
|
|||
|
|
@ -1,24 +1,21 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "yuzu/deps_dialog.h"
|
||||
#include <QAbstractTextDocumentLayout>
|
||||
#include <QDesktopServices>
|
||||
#include <QIcon>
|
||||
#include <QPainter>
|
||||
#include <QTableWidget>
|
||||
#include <QTextEdit>
|
||||
#include <fmt/ranges.h>
|
||||
#include "dep_hashes.h"
|
||||
#include "ui_deps_dialog.h"
|
||||
#include <fmt/ranges.h>
|
||||
#include "yuzu/deps_dialog.h"
|
||||
|
||||
DepsDialog::DepsDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, ui{std::make_unique<Ui::DepsDialog>()}
|
||||
{
|
||||
DepsDialog::DepsDialog(QWidget* parent) : QDialog(parent), ui{std::make_unique<Ui::DepsDialog>()} {
|
||||
ui->setupUi(this);
|
||||
|
||||
constexpr int rows = (int) Common::dep_hashes.size();
|
||||
constexpr int rows = (int)Common::dep_hashes.size();
|
||||
ui->tableDeps->setRowCount(rows);
|
||||
|
||||
QStringList labels;
|
||||
|
|
@ -36,8 +33,8 @@ DepsDialog::DepsDialog(QWidget* parent)
|
|||
|
||||
std::string dependency = fmt::format("<a href=\"{}\">{}</a>", url, name);
|
||||
|
||||
QTableWidgetItem *nameItem = new QTableWidgetItem(QString::fromStdString(dependency));
|
||||
QTableWidgetItem *shaItem = new QTableWidgetItem(QString::fromStdString(sha));
|
||||
QTableWidgetItem* nameItem = new QTableWidgetItem(QString::fromStdString(dependency));
|
||||
QTableWidgetItem* shaItem = new QTableWidgetItem(QString::fromStdString(sha));
|
||||
|
||||
ui->tableDeps->setItem(i, 0, nameItem);
|
||||
ui->tableDeps->setItem(i, 1, shaItem);
|
||||
|
|
@ -48,14 +45,10 @@ DepsDialog::DepsDialog(QWidget* parent)
|
|||
|
||||
DepsDialog::~DepsDialog() = default;
|
||||
|
||||
LinkItemDelegate::LinkItemDelegate(QObject *parent)
|
||||
: QStyledItemDelegate(parent)
|
||||
{}
|
||||
LinkItemDelegate::LinkItemDelegate(QObject* parent) : QStyledItemDelegate(parent) {}
|
||||
|
||||
void LinkItemDelegate::paint(QPainter *painter,
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
void LinkItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) const {
|
||||
auto options = option;
|
||||
initStyleOption(&options, index);
|
||||
|
||||
|
|
@ -71,8 +64,8 @@ void LinkItemDelegate::paint(QPainter *painter,
|
|||
painter->restore();
|
||||
}
|
||||
|
||||
QSize LinkItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
QSize LinkItemDelegate::sizeHint(const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) const {
|
||||
QStyleOptionViewItem options = option;
|
||||
initStyleOption(&options, index);
|
||||
|
||||
|
|
@ -82,13 +75,10 @@ QSize LinkItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QMode
|
|||
return QSize(doc.idealWidth(), doc.size().height());
|
||||
}
|
||||
|
||||
bool LinkItemDelegate::editorEvent(QEvent *event,
|
||||
QAbstractItemModel *model,
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index)
|
||||
{
|
||||
bool LinkItemDelegate::editorEvent(QEvent* event, QAbstractItemModel* model,
|
||||
const QStyleOptionViewItem& option, const QModelIndex& index) {
|
||||
if (event->type() == QEvent::MouseButtonRelease) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton) {
|
||||
QString html = index.data(Qt::DisplayRole).toString();
|
||||
QTextDocument doc;
|
||||
|
|
@ -96,7 +86,7 @@ bool LinkItemDelegate::editorEvent(QEvent *event,
|
|||
doc.setTextWidth(option.rect.width());
|
||||
|
||||
// this is kinda silly but it werks
|
||||
QAbstractTextDocumentLayout *layout = doc.documentLayout();
|
||||
QAbstractTextDocumentLayout* layout = doc.documentLayout();
|
||||
|
||||
QPoint pos = mouseEvent->pos() - option.rect.topLeft();
|
||||
int charPos = layout->hitTest(pos, Qt::ExactHit);
|
||||
|
|
|
|||
|
|
@ -1,41 +1,38 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QTableView>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui { class DepsDialog; }
|
||||
namespace Ui {
|
||||
class DepsDialog;
|
||||
}
|
||||
|
||||
class DepsDialog : public QDialog
|
||||
{
|
||||
class DepsDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DepsDialog(QWidget *parent);
|
||||
explicit DepsDialog(QWidget* parent);
|
||||
~DepsDialog() override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::DepsDialog> ui;
|
||||
};
|
||||
|
||||
class LinkItemDelegate : public QStyledItemDelegate
|
||||
{
|
||||
class LinkItemDelegate : public QStyledItemDelegate {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LinkItemDelegate(QObject *parent = 0);
|
||||
explicit LinkItemDelegate(QObject* parent = 0);
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter,
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const override;
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
bool editorEvent(QEvent *event,
|
||||
QAbstractItemModel *model,
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) override;
|
||||
void paint(QPainter* painter, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) const override;
|
||||
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
|
||||
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,9 +73,7 @@ void GameCard::paint(QPainter* painter, const QStyleOptionViewItem& option,
|
|||
painter->restore();
|
||||
} else {
|
||||
// if there is no icon just draw a blank rect
|
||||
iconRect = QRect(cardRect.left() + padding,
|
||||
cardRect.top() + padding,
|
||||
_iconsize, _iconsize);
|
||||
iconRect = QRect(cardRect.left() + padding, cardRect.top() + padding, _iconsize, _iconsize);
|
||||
}
|
||||
|
||||
if (UISettings::values.show_game_name.GetValue()) {
|
||||
|
|
|
|||
|
|
@ -14,12 +14,10 @@ class GameCard : public QStyledItemDelegate {
|
|||
public:
|
||||
explicit GameCard(QObject* parent = nullptr);
|
||||
|
||||
void paint(QPainter *painter,
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const override;
|
||||
void paint(QPainter* painter, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) const override;
|
||||
|
||||
QSize sizeHint(const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const override;
|
||||
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
|
||||
void setSize(const QSize& newSize, const int padding);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -218,11 +218,13 @@ void GameList::OnTextChanged(const QString& new_text) {
|
|||
|
||||
for (int i = 0; i < row_count; ++i) {
|
||||
QStandardItem* item = item_model->item(i, 0);
|
||||
if (!item) continue;
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
children_total++;
|
||||
|
||||
const QString file_path = item->data(GameListItemPath::FullPathRole).toString().toLower();
|
||||
const QString file_path =
|
||||
item->data(GameListItemPath::FullPathRole).toString().toLower();
|
||||
const QString file_title = item->data(GameListItemPath::TitleRole).toString().toLower();
|
||||
const QString file_name = file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) +
|
||||
QLatin1Char{' '} + file_title;
|
||||
|
|
@ -236,7 +238,8 @@ void GameList::OnTextChanged(const QString& new_text) {
|
|||
}
|
||||
search_field->setFilterResult(result_count, children_total);
|
||||
} else if (edit_filter_text.isEmpty()) {
|
||||
hide(0, UISettings::values.favorited_ids.size() == 0, item_model->invisibleRootItem()->index());
|
||||
hide(0, UISettings::values.favorited_ids.size() == 0,
|
||||
item_model->invisibleRootItem()->index());
|
||||
for (int i = 1; i < item_model->rowCount() - 1; ++i) {
|
||||
folder = item_model->item(i, 0);
|
||||
const QModelIndex folder_index = folder->index();
|
||||
|
|
@ -362,7 +365,8 @@ GameList::GameList(FileSys::VirtualFilesystem vfs_, FileSys::ManualContentProvid
|
|||
|
||||
external_watcher = new QFileSystemWatcher(this);
|
||||
ResetExternalWatcher();
|
||||
connect(external_watcher, &QFileSystemWatcher::directoryChanged, this, &GameList::RefreshExternalContent);
|
||||
connect(external_watcher, &QFileSystemWatcher::directoryChanged, this,
|
||||
&GameList::RefreshExternalContent);
|
||||
|
||||
this->main_window = parent;
|
||||
layout = new QVBoxLayout;
|
||||
|
|
@ -471,7 +475,7 @@ bool GameList::IsTreeMode() {
|
|||
}
|
||||
|
||||
void GameList::ResetViewMode() {
|
||||
auto &setting = UISettings::values.game_list_mode;
|
||||
auto& setting = UISettings::values.game_list_mode;
|
||||
bool newTreeMode = false;
|
||||
|
||||
switch (setting.GetValue()) {
|
||||
|
|
@ -678,7 +682,7 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
|
|||
return;
|
||||
|
||||
QMenu blank_menu;
|
||||
QAction *addGameDirAction = blank_menu.addAction(tr("&Add New Game Directory"));
|
||||
QAction* addGameDirAction = blank_menu.addAction(tr("&Add New Game Directory"));
|
||||
|
||||
connect(addGameDirAction, &QAction::triggered, this, &GameList::AddDirectory);
|
||||
blank_menu.exec(m_currentView->viewport()->mapToGlobal(menu_location));
|
||||
|
|
@ -1113,8 +1117,7 @@ const QStringList GameList::supported_file_extensions = {
|
|||
QStringLiteral("nso"), QStringLiteral("nro"), QStringLiteral("nca"),
|
||||
QStringLiteral("xci"), QStringLiteral("nsp"), QStringLiteral("kip")};
|
||||
|
||||
void GameList::RefreshGameDirectory()
|
||||
{
|
||||
void GameList::RefreshGameDirectory() {
|
||||
// Reset the externals watcher whenever the game list is reloaded,
|
||||
// primarily ensures that new titles and external dirs are caught.
|
||||
ResetExternalWatcher();
|
||||
|
|
@ -1142,7 +1145,7 @@ void GameList::ResetExternalWatcher() {
|
|||
external_watcher->removePaths(watch_dirs);
|
||||
}
|
||||
|
||||
for (const std::string &dir : Settings::values.external_content_dirs) {
|
||||
for (const std::string& dir : Settings::values.external_content_dirs) {
|
||||
external_watcher->addPath(QString::fromStdString(dir));
|
||||
}
|
||||
}
|
||||
|
|
@ -1286,8 +1289,8 @@ bool GameList::eventFilter(QObject* obj, QEvent* event) {
|
|||
horizontal_scroll_target = m_currentView->horizontalScrollBar()->value();
|
||||
|
||||
horizontal_scroll_target -= deltaX;
|
||||
horizontal_scroll_target =
|
||||
qBound(0, horizontal_scroll_target, m_currentView->horizontalScrollBar()->maximum());
|
||||
horizontal_scroll_target = qBound(0, horizontal_scroll_target,
|
||||
m_currentView->horizontalScrollBar()->maximum());
|
||||
|
||||
horizontal_scroll->stop();
|
||||
horizontal_scroll->setStartValue(m_currentView->horizontalScrollBar()->value());
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@
|
|||
|
||||
#include "common/common_types.h"
|
||||
#include "core/core.h"
|
||||
#include "frontend_common/play_time_manager.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "qt_common/util/game.h"
|
||||
#include "yuzu/compatibility_list.h"
|
||||
#include "frontend_common/play_time_manager.h"
|
||||
|
||||
class QVariantAnimation;
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ signals:
|
|||
void NavigateToGamedbEntryRequested(u64 program_id,
|
||||
const CompatibilityList& compatibility_list);
|
||||
void OpenPerGameGeneralRequested(const std::string& file);
|
||||
void LinkToRyujinxRequested(const u64 &program_id);
|
||||
void LinkToRyujinxRequested(const u64& program_id);
|
||||
void OpenDirectory(const QString& directory);
|
||||
void AddDirectory();
|
||||
void ShowList(bool show);
|
||||
|
|
@ -170,8 +170,8 @@ private:
|
|||
QVBoxLayout* layout = nullptr;
|
||||
|
||||
QTreeView* tree_view = nullptr;
|
||||
QListView *list_view = nullptr;
|
||||
GameCard *m_gameCard = nullptr;
|
||||
QListView* list_view = nullptr;
|
||||
GameCard* m_gameCard = nullptr;
|
||||
|
||||
QStandardItemModel* item_model = nullptr;
|
||||
std::unique_ptr<GameListWorker> current_worker;
|
||||
|
|
@ -194,7 +194,7 @@ private:
|
|||
Core::System& system;
|
||||
|
||||
bool m_isTreeMode = true;
|
||||
QAbstractItemView *m_currentView = tree_view;
|
||||
QAbstractItemView* m_currentView = tree_view;
|
||||
};
|
||||
|
||||
class GameListPlaceholder : public QWidget {
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@
|
|||
#include <QCoreApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QObject>
|
||||
#include <QRegularExpression>
|
||||
#include <QStandardItem>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/logging/log.h"
|
||||
|
|
@ -77,7 +77,7 @@ public:
|
|||
GameListItemPath() = default;
|
||||
GameListItemPath(const QString& game_path, const std::vector<u8>& picture_data,
|
||||
const QString& game_name, const QString& game_type, u64 program_id,
|
||||
u64 play_time, const QString &patch_versions) {
|
||||
u64 play_time, const QString& patch_versions) {
|
||||
setData(type(), TypeRole);
|
||||
setData(game_path, FullPathRole);
|
||||
setData(game_name, TitleRole);
|
||||
|
|
@ -85,14 +85,15 @@ public:
|
|||
setData(game_type, FileTypeRole);
|
||||
|
||||
const auto readable_play_time =
|
||||
play_time > 0
|
||||
? QObject::tr("Play Time: %1").arg(QString::fromStdString(PlayTime::PlayTimeManager::GetReadablePlayTime(play_time)))
|
||||
: QObject::tr("Never Played");
|
||||
play_time > 0 ? QObject::tr("Play Time: %1")
|
||||
.arg(QString::fromStdString(
|
||||
PlayTime::PlayTimeManager::GetReadablePlayTime(play_time)))
|
||||
: QObject::tr("Never Played");
|
||||
|
||||
const auto enabled_update = [patch_versions]() -> QString {
|
||||
const QStringList lines = patch_versions.split(QLatin1Char('\n'));
|
||||
const QRegularExpression regex{QStringLiteral(R"(^Update \(([0-9\.]+)\))")};
|
||||
for (const QString &line : std::as_const(lines)) {
|
||||
for (const QString& line : std::as_const(lines)) {
|
||||
const auto match = regex.match(line);
|
||||
if (match.hasMatch() && match.hasCaptured(1))
|
||||
return QObject::tr("Version: %1").arg(match.captured(1));
|
||||
|
|
@ -100,9 +101,7 @@ public:
|
|||
return QObject::tr("Version: 1.0.0");
|
||||
}();
|
||||
|
||||
const auto tooltip = QStringLiteral("%1\n%2").arg(
|
||||
readable_play_time,
|
||||
enabled_update);
|
||||
const auto tooltip = QStringLiteral("%1\n%2").arg(readable_play_time, enabled_update);
|
||||
|
||||
setData(tooltip, Qt::ToolTipRole);
|
||||
|
||||
|
|
@ -145,7 +144,7 @@ public:
|
|||
return row1.toLower();
|
||||
}
|
||||
|
||||
// None
|
||||
// None
|
||||
if (row2_id == 4) {
|
||||
return row1;
|
||||
}
|
||||
|
|
@ -163,7 +162,6 @@ public:
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return GameListItem::data(role);
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@
|
|||
#include "core/file_sys/romfs.h"
|
||||
#include "core/file_sys/submission_package.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/compatibility_list.h"
|
||||
#include "yuzu/game/game_list.h"
|
||||
#include "yuzu/game/game_list_p.h"
|
||||
#include "yuzu/game/game_list_worker.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
@ -198,26 +198,24 @@ QString FormatPatchNameVersions(const FileSys::PatchManager& patch_manager,
|
|||
return out;
|
||||
}
|
||||
|
||||
QList<QStandardItem*> MakeGameListEntry(const std::string& path,
|
||||
const std::string& name,
|
||||
const std::size_t size,
|
||||
const std::vector<u8>& icon,
|
||||
Loader::AppLoader& loader,
|
||||
u64 program_id,
|
||||
QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::string& name,
|
||||
const std::size_t size, const std::vector<u8>& icon,
|
||||
Loader::AppLoader& loader, u64 program_id,
|
||||
const CompatibilityList& compatibility_list,
|
||||
const PlayTime::PlayTimeManager& play_time_manager,
|
||||
const FileSys::PatchManager& patch)
|
||||
{
|
||||
const FileSys::PatchManager& patch) {
|
||||
auto const it = FindMatchingCompatibilityEntry(compatibility_list, program_id);
|
||||
// The game list uses 99 as compatibility number for untested games
|
||||
QString compatibility = it != compatibility_list.end() ? it->second.first : QStringLiteral("99");
|
||||
QString compatibility =
|
||||
it != compatibility_list.end() ? it->second.first : QStringLiteral("99");
|
||||
|
||||
auto const file_type = loader.GetFileType();
|
||||
auto const file_type_string = QString::fromStdString(Loader::GetFileTypeString(file_type));
|
||||
|
||||
QString patch_versions = GetGameListCachedObject(fmt::format("{:016X}", patch.GetTitleID()), "pv.txt", [&patch, &loader] {
|
||||
return FormatPatchNameVersions(patch, loader, loader.IsRomFSUpdatable());
|
||||
});
|
||||
QString patch_versions = GetGameListCachedObject(
|
||||
fmt::format("{:016X}", patch.GetTitleID()), "pv.txt", [&patch, &loader] {
|
||||
return FormatPatchNameVersions(patch, loader, loader.IsRomFSUpdatable());
|
||||
});
|
||||
|
||||
u64 play_time = play_time_manager.GetPlayTime(program_id);
|
||||
return QList<QStandardItem*>{
|
||||
|
|
@ -238,13 +236,9 @@ GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs_,
|
|||
const CompatibilityList& compatibility_list_,
|
||||
const PlayTime::PlayTimeManager& play_time_manager_,
|
||||
Core::System& system_)
|
||||
: vfs{std::move(vfs_)}
|
||||
, provider{provider_}
|
||||
, game_dirs{game_dirs_}
|
||||
, compatibility_list{compatibility_list_}
|
||||
, play_time_manager{play_time_manager_}
|
||||
, system{system_}
|
||||
{
|
||||
: vfs{std::move(vfs_)}, provider{provider_}, game_dirs{game_dirs_},
|
||||
compatibility_list{compatibility_list_}, play_time_manager{play_time_manager_},
|
||||
system{system_} {
|
||||
// We want the game list to manage our lifetime.
|
||||
setAutoDelete(false);
|
||||
}
|
||||
|
|
@ -338,15 +332,8 @@ void GameListWorker::AddTitlesToGameList(GameListDir* parent_dir) {
|
|||
GetMetadataFromControlNCA(patch, *control, icon, name);
|
||||
}
|
||||
|
||||
auto entry = MakeGameListEntry(file->GetFullPath(),
|
||||
name,
|
||||
file->GetSize(),
|
||||
icon,
|
||||
*loader,
|
||||
program_id,
|
||||
compatibility_list,
|
||||
play_time_manager,
|
||||
patch);
|
||||
auto entry = MakeGameListEntry(file->GetFullPath(), name, file->GetSize(), icon, *loader,
|
||||
program_id, compatibility_list, play_time_manager, patch);
|
||||
RecordEvent([=](GameList* game_list) { game_list->AddEntry(entry, parent_dir); });
|
||||
}
|
||||
}
|
||||
|
|
@ -424,15 +411,9 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa
|
|||
const FileSys::PatchManager patch{id, system.GetFileSystemController(),
|
||||
system.GetContentProvider()};
|
||||
|
||||
auto entry = MakeGameListEntry(physical_name,
|
||||
name,
|
||||
Common::FS::GetSize(physical_name),
|
||||
icon,
|
||||
*loader,
|
||||
id,
|
||||
compatibility_list,
|
||||
play_time_manager,
|
||||
patch);
|
||||
auto entry = MakeGameListEntry(
|
||||
physical_name, name, Common::FS::GetSize(physical_name), icon, *loader,
|
||||
id, compatibility_list, play_time_manager, patch);
|
||||
|
||||
RecordEvent(
|
||||
[=](GameList* game_list) { game_list->AddEntry(entry, parent_dir); });
|
||||
|
|
@ -447,15 +428,9 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa
|
|||
const FileSys::PatchManager patch{program_id, system.GetFileSystemController(),
|
||||
system.GetContentProvider()};
|
||||
|
||||
auto entry = MakeGameListEntry(physical_name,
|
||||
name,
|
||||
Common::FS::GetSize(physical_name),
|
||||
icon,
|
||||
*loader,
|
||||
program_id,
|
||||
compatibility_list,
|
||||
play_time_manager,
|
||||
patch);
|
||||
auto entry = MakeGameListEntry(
|
||||
physical_name, name, Common::FS::GetSize(physical_name), icon, *loader,
|
||||
program_id, compatibility_list, play_time_manager, patch);
|
||||
|
||||
RecordEvent(
|
||||
[=](GameList* game_list) { game_list->AddEntry(entry, parent_dir); });
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
#include "common/thread.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "frontend_common/play_time_manager.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/compatibility_list.h"
|
||||
#include "frontend_common/play_time_manager.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
|
|
|
|||
|
|
@ -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: 2014 Citra Emulator Project
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#include "hid_core/frontend/emulated_controller.h"
|
||||
#include "yuzu/hotkeys.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/hotkeys.h"
|
||||
|
||||
HotkeyRegistry::HotkeyRegistry() = default;
|
||||
HotkeyRegistry::~HotkeyRegistry() = default;
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include "yuzu/install_dialog.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/install_dialog.h"
|
||||
|
||||
InstallDialog::InstallDialog(QWidget* parent, const QStringList& files) : QDialog(parent) {
|
||||
file_list = new QListWidget(this);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QFileDialog>
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QProgressDialog>
|
||||
#include <QAbstractButton>
|
||||
|
||||
#include "libqt_common.h"
|
||||
#include "qt_common/abstract/frontend.h"
|
||||
|
|
@ -14,10 +14,11 @@
|
|||
|
||||
namespace QtCommon::Frontend {
|
||||
|
||||
StandardButton ShowMessage(
|
||||
Icon icon, const QString &title, const QString &text, StandardButtons buttons, QObject *parent)
|
||||
{
|
||||
QMessageBox *box = new QMessageBox(QMessageBox::Icon(int(icon)), title, text, QMessageBox::StandardButtons(int(buttons)), (QWidget *) parent);
|
||||
StandardButton ShowMessage(Icon icon, const QString& title, const QString& text,
|
||||
StandardButtons buttons, QObject* parent) {
|
||||
QMessageBox* box =
|
||||
new QMessageBox(QMessageBox::Icon(int(icon)), title, text,
|
||||
QMessageBox::StandardButtons(int(buttons)), (QWidget*)parent);
|
||||
return StandardButton(box->exec());
|
||||
}
|
||||
|
||||
|
|
@ -81,15 +82,15 @@ void WidgetsProgressDialog::show() {
|
|||
m_dialog->show();
|
||||
}
|
||||
|
||||
std::unique_ptr<QtProgressDialog> newProgressDialog(const QString& labelText, const QString& cancelButtonText,
|
||||
int minimum, int maximum, Qt::WindowFlags f) {
|
||||
std::unique_ptr<QtProgressDialog> newProgressDialog(const QString& labelText,
|
||||
const QString& cancelButtonText, int minimum,
|
||||
int maximum, Qt::WindowFlags f) {
|
||||
return std::make_unique<WidgetsProgressDialog>(labelText, cancelButtonText, minimum, maximum,
|
||||
(QWidget*)rootObject, f);
|
||||
}
|
||||
|
||||
QtProgressDialog* newProgressDialogPtr(const QString& labelText, const QString& cancelButtonText,
|
||||
int minimum, int maximum,
|
||||
Qt::WindowFlags f) {
|
||||
int minimum, int maximum, Qt::WindowFlags f) {
|
||||
return new WidgetsProgressDialog(labelText, cancelButtonText, minimum, maximum,
|
||||
(QWidget*)rootObject, f);
|
||||
}
|
||||
|
|
@ -115,5 +116,4 @@ const QString GetTextInput(const QString& title, const QString& caption,
|
|||
return QInputDialog::getText(rootObject, title, caption, QLineEdit::Normal, defaultText);
|
||||
}
|
||||
|
||||
|
||||
} // namespace QtCommon::Frontend
|
||||
|
|
|
|||
|
|
@ -34,4 +34,4 @@ private:
|
|||
QProgressDialog* m_dialog;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace QtCommon::Frontend
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include <QBuffer>
|
||||
#include <QByteArray>
|
||||
#include <QGraphicsOpacityEffect>
|
||||
|
|
@ -14,6 +13,7 @@
|
|||
#include <QPixmap>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QStyleOption>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "core/frontend/framebuffer_layout.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "ui_loading_screen.h"
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
#include "startup_checks.h"
|
||||
|
||||
#if YUZU_ROOM
|
||||
#include "dedicated_room/yuzu_room.h"
|
||||
#include <cstring>
|
||||
#include "dedicated_room/yuzu_room.h"
|
||||
#endif
|
||||
|
||||
#include <common/detached_tasks.h>
|
||||
|
|
@ -62,9 +62,8 @@ static Qt::HighDpiScaleFactorRoundingPolicy GetHighDpiRoundingPolicy() {
|
|||
|
||||
// Get the lower of the 2 ratios and truncate, this is the maximum integer scale.
|
||||
const qreal max_ratio = std::trunc(std::min(width_ratio, height_ratio));
|
||||
return max_ratio > real_ratio
|
||||
? Qt::HighDpiScaleFactorRoundingPolicy::Round
|
||||
: Qt::HighDpiScaleFactorRoundingPolicy::Floor;
|
||||
return max_ratio > real_ratio ? Qt::HighDpiScaleFactorRoundingPolicy::Round
|
||||
: Qt::HighDpiScaleFactorRoundingPolicy::Floor;
|
||||
#else
|
||||
// Other OSes should be better than Windows at fractional scaling.
|
||||
return Qt::HighDpiScaleFactorRoundingPolicy::PassThrough;
|
||||
|
|
@ -174,7 +173,7 @@ int main(int argc, char* argv[]) {
|
|||
main_window.show();
|
||||
|
||||
app.connect(&app, &QGuiApplication::applicationStateChanged, &main_window,
|
||||
&MainWindow::OnAppFocusStateChanged);
|
||||
&MainWindow::OnAppFocusStateChanged);
|
||||
|
||||
int result = app.exec();
|
||||
detached_tasks.WaitForAllTasks();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -24,15 +24,15 @@
|
|||
#include "input_common/drivers/tas_input.h"
|
||||
#include "qt_common/config/qt_config.h"
|
||||
#include "qt_common/util/game.h"
|
||||
#include "yuzu/user_data_migration.h"
|
||||
#include "yuzu/compatibility_list.h"
|
||||
#include "yuzu/hotkeys.h"
|
||||
#include "yuzu/user_data_migration.h"
|
||||
|
||||
#ifdef __unix__
|
||||
#include <QDBusObjectPath>
|
||||
#include <QSocketNotifier>
|
||||
#include <QVariant>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
#include <QSocketNotifier>
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_UPDATE_CHECKER
|
||||
|
|
@ -218,9 +218,10 @@ signals:
|
|||
void WebBrowserClosed(Service::AM::Frontend::WebExitReason exit_reason, std::string last_url);
|
||||
|
||||
void SigInterrupt();
|
||||
void sizeChanged(const QSize &size);
|
||||
void positionChanged(const QPoint &pos);
|
||||
void statsUpdated(const Core::PerfStatsResults &results, const VideoCore::ShaderNotify &shaders);
|
||||
void sizeChanged(const QSize& size);
|
||||
void positionChanged(const QPoint& pos);
|
||||
void statsUpdated(const Core::PerfStatsResults& results,
|
||||
const VideoCore::ShaderNotify& shaders);
|
||||
|
||||
public slots:
|
||||
void OnLoadComplete();
|
||||
|
|
@ -317,8 +318,8 @@ private:
|
|||
void RequestGameExit();
|
||||
void changeEvent(QEvent* event) override;
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void moveEvent(QMoveEvent *event) override;
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
void moveEvent(QMoveEvent* event) override;
|
||||
|
||||
std::string CreateTASFramesString(
|
||||
std::array<size_t, InputCommon::TasInput::PLAYER_NUMBER> frames) const;
|
||||
|
|
@ -360,8 +361,7 @@ private slots:
|
|||
void OnGameListCopyTID(u64 program_id);
|
||||
void OnGameListNavigateToGamedbEntry(u64 program_id,
|
||||
const CompatibilityList& compatibility_list);
|
||||
void OnGameListCreateShortcut(u64 program_id,
|
||||
const std::string& game_path,
|
||||
void OnGameListCreateShortcut(u64 program_id, const std::string& game_path,
|
||||
const QtCommon::Game::ShortcutTarget target);
|
||||
void OnGameListOpenDirectory(const QString& directory);
|
||||
void OnGameListAddDirectory();
|
||||
|
|
@ -483,7 +483,7 @@ private:
|
|||
*/
|
||||
bool question(QWidget* parent, const QString& title, const QString& text,
|
||||
QMessageBox::StandardButtons buttons =
|
||||
QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No),
|
||||
QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No),
|
||||
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
|
||||
std::unique_ptr<Ui::MainWindow> ui;
|
||||
|
|
@ -504,7 +504,7 @@ private:
|
|||
LoadingScreen* loading_screen = nullptr;
|
||||
QTimer shutdown_timer;
|
||||
OverlayDialog* shutdown_dialog{};
|
||||
PerformanceOverlay *perf_overlay = nullptr;
|
||||
PerformanceOverlay* perf_overlay = nullptr;
|
||||
|
||||
GameListPlaceholder* game_list_placeholder = nullptr;
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ private:
|
|||
|
||||
QString startup_icon_theme;
|
||||
|
||||
QActionGroup *game_size_actions;
|
||||
QActionGroup* game_size_actions;
|
||||
|
||||
// Debugger panes
|
||||
ControllerDialog* controller_dialog = nullptr;
|
||||
|
|
@ -595,12 +595,9 @@ private:
|
|||
|
||||
std::filesystem::path GetEdenCommand();
|
||||
|
||||
void CreateShortcut(const std::string& game_path,
|
||||
const u64 program_id,
|
||||
const std::string& game_title,
|
||||
QtCommon::Game::ShortcutTarget target,
|
||||
std::string arguments,
|
||||
const bool needs_title);
|
||||
void CreateShortcut(const std::string& game_path, const u64 program_id,
|
||||
const std::string& game_title, QtCommon::Game::ShortcutTarget target,
|
||||
std::string arguments, const bool needs_title);
|
||||
|
||||
void InstallFirmware(const QString& location, bool recursive = false);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "migration_dialog.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
|
@ -6,11 +9,8 @@
|
|||
#include <QPushButton>
|
||||
#include <QStyle>
|
||||
|
||||
MigrationDialog::MigrationDialog(
|
||||
QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
MigrationDialog::MigrationDialog(QWidget* parent) : QDialog(parent) {
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
|
||||
m_text = new QLabel(this);
|
||||
m_boxes = new QVBoxLayout;
|
||||
|
|
@ -26,23 +26,16 @@ MigrationDialog::~MigrationDialog() {
|
|||
m_buttons->deleteLater();
|
||||
}
|
||||
|
||||
void MigrationDialog::setText(
|
||||
const QString &text)
|
||||
{
|
||||
void MigrationDialog::setText(const QString& text) {
|
||||
m_text->setText(text);
|
||||
}
|
||||
|
||||
void MigrationDialog::addBox(
|
||||
QWidget *box)
|
||||
{
|
||||
void MigrationDialog::addBox(QWidget* box) {
|
||||
m_boxes->addWidget(box);
|
||||
|
||||
}
|
||||
|
||||
QAbstractButton *MigrationDialog::addButton(
|
||||
const QString &text, const bool reject)
|
||||
{
|
||||
QAbstractButton *button = new QPushButton(this);
|
||||
QAbstractButton* MigrationDialog::addButton(const QString& text, const bool reject) {
|
||||
QAbstractButton* button = new QPushButton(this);
|
||||
button->setText(text);
|
||||
m_buttons->addWidget(button, 1);
|
||||
|
||||
|
|
@ -58,7 +51,6 @@ QAbstractButton *MigrationDialog::addButton(
|
|||
return button;
|
||||
}
|
||||
|
||||
QAbstractButton *MigrationDialog::clickedButton() const
|
||||
{
|
||||
QAbstractButton* MigrationDialog::clickedButton() const {
|
||||
return m_clickedButton;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,33 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef MIGRATION_DIALOG_H
|
||||
#define MIGRATION_DIALOG_H
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMessageBox>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class MigrationDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
MigrationDialog(QWidget *parent = nullptr);
|
||||
MigrationDialog(QWidget* parent = nullptr);
|
||||
|
||||
virtual ~MigrationDialog();
|
||||
|
||||
void setText(const QString &text);
|
||||
void addBox(QWidget *box);
|
||||
QAbstractButton *addButton(const QString &text, const bool reject = false);
|
||||
void setText(const QString& text);
|
||||
void addBox(QWidget* box);
|
||||
QAbstractButton* addButton(const QString& text, const bool reject = false);
|
||||
|
||||
QAbstractButton *clickedButton() const;
|
||||
QAbstractButton* clickedButton() const;
|
||||
|
||||
private:
|
||||
QLabel *m_text;
|
||||
QVBoxLayout *m_boxes;
|
||||
QHBoxLayout *m_buttons;
|
||||
QLabel* m_text;
|
||||
QVBoxLayout* m_boxes;
|
||||
QHBoxLayout* m_buttons;
|
||||
|
||||
QAbstractButton *m_clickedButton;
|
||||
QAbstractButton* m_clickedButton;
|
||||
};
|
||||
|
||||
#endif // MIGRATION_DIALOG_H
|
||||
|
|
|
|||
|
|
@ -1,27 +1,22 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "migration_worker.h"
|
||||
#include "common/fs/symlink.h"
|
||||
#include "migration_worker.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <QMap>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <filesystem>
|
||||
|
||||
#include "common/fs/path_util.h"
|
||||
|
||||
MigrationWorker::MigrationWorker(const Emulator selected_emu_,
|
||||
const bool clear_shader_cache_,
|
||||
MigrationWorker::MigrationWorker(const Emulator selected_emu_, const bool clear_shader_cache_,
|
||||
const MigrationStrategy strategy_)
|
||||
: QObject()
|
||||
, selected_emu(selected_emu_)
|
||||
, clear_shader_cache(clear_shader_cache_)
|
||||
, strategy(strategy_)
|
||||
{}
|
||||
: QObject(), selected_emu(selected_emu_), clear_shader_cache(clear_shader_cache_),
|
||||
strategy(strategy_) {}
|
||||
|
||||
void MigrationWorker::process()
|
||||
{
|
||||
void MigrationWorker::process() {
|
||||
namespace fs = std::filesystem;
|
||||
constexpr auto copy_options = fs::copy_options::update_existing | fs::copy_options::recursive;
|
||||
|
||||
|
|
@ -42,7 +37,7 @@ void MigrationWorker::process()
|
|||
|
||||
try {
|
||||
fs::remove_all(eden_dir);
|
||||
} catch (fs::filesystem_error &_) {
|
||||
} catch (fs::filesystem_error& _) {
|
||||
// ignore because linux does stupid crap sometimes
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +48,7 @@ void MigrationWorker::process()
|
|||
// Windows 11 has random permission nonsense to deal with.
|
||||
try {
|
||||
Common::FS::CreateSymlink(legacy_user_dir, eden_dir);
|
||||
} catch (const fs::filesystem_error &e) {
|
||||
} 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())));
|
||||
|
|
@ -74,8 +69,7 @@ void MigrationWorker::process()
|
|||
|
||||
success_text.append(tr("\n\nNote that your configuration and data will be shared with %1.\n"
|
||||
"If this is not desirable, delete the following files:\n%2\n%3\n%4")
|
||||
.arg(selected_emu.name(),
|
||||
QString::fromStdString(eden_dir.string()),
|
||||
.arg(selected_emu.name(), QString::fromStdString(eden_dir.string()),
|
||||
QString::fromStdString(config_dir.string()),
|
||||
QString::fromStdString(cache_dir.string())));
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
#ifndef MIGRATION_WORKER_H
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#include "common/fs/path_util.h"
|
||||
|
||||
typedef struct Emulator {
|
||||
const char *m_name;
|
||||
const char* m_name;
|
||||
|
||||
Common::FS::EmuPath e_user_dir;
|
||||
Common::FS::EmuPath e_config_dir;
|
||||
|
|
@ -26,14 +26,20 @@ typedef struct Emulator {
|
|||
return Common::FS::GetLegacyPath(e_cache_dir).string();
|
||||
}
|
||||
|
||||
const QString name() const { return QObject::tr(m_name);
|
||||
const QString name() const {
|
||||
return QObject::tr(m_name);
|
||||
}
|
||||
|
||||
const QString lower_name() const { return name().toLower();
|
||||
const QString lower_name() const {
|
||||
return name().toLower();
|
||||
}
|
||||
} Emulator;
|
||||
|
||||
#define STRUCT_EMU(name, enumName) Emulator{name, Common::FS::enumName##Dir, Common::FS::enumName##ConfigDir, Common::FS::enumName##CacheDir}
|
||||
#define STRUCT_EMU(name, enumName) \
|
||||
Emulator { \
|
||||
name, Common::FS::enumName##Dir, Common::FS::enumName##ConfigDir, \
|
||||
Common::FS::enumName##CacheDir \
|
||||
}
|
||||
|
||||
static constexpr std::array<Emulator, 4> legacy_emus = {
|
||||
STRUCT_EMU(QT_TR_NOOP("Citron"), Citron),
|
||||
|
|
@ -42,8 +48,7 @@ static constexpr std::array<Emulator, 4> legacy_emus = {
|
|||
STRUCT_EMU(QT_TR_NOOP("Yuzu"), Yuzu),
|
||||
};
|
||||
|
||||
class MigrationWorker : public QObject
|
||||
{
|
||||
class MigrationWorker : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum class MigrationStrategy {
|
||||
|
|
@ -52,16 +57,15 @@ public:
|
|||
Link,
|
||||
};
|
||||
|
||||
MigrationWorker(const Emulator selected_emu,
|
||||
const bool clear_shader_cache,
|
||||
MigrationWorker(const Emulator selected_emu, const bool clear_shader_cache,
|
||||
const MigrationStrategy strategy);
|
||||
|
||||
public slots:
|
||||
void process();
|
||||
|
||||
signals:
|
||||
void finished(const QString &success_text, const std::string &user_dir);
|
||||
void error(const QString &error_message);
|
||||
void finished(const QString& success_text, const std::string& user_dir);
|
||||
void error(const QString& error_message);
|
||||
|
||||
private:
|
||||
Emulator selected_emu;
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include <QDialog>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStandardItemModel>
|
||||
#include <QVariant>
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "network/network.h"
|
||||
|
||||
namespace Ui {
|
||||
|
|
|
|||
|
|
@ -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: Copyright 2017 Citra Emulator Project
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
#include "core/core.h"
|
||||
#include "core/internal_network/network_interface.h"
|
||||
#include "network/network.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_direct_connect.h"
|
||||
#include "yuzu/main_window.h"
|
||||
#include "yuzu/multiplayer/client_room.h"
|
||||
|
|
@ -21,7 +22,6 @@
|
|||
#include "yuzu/multiplayer/message.h"
|
||||
#include "yuzu/multiplayer/state.h"
|
||||
#include "yuzu/multiplayer/validation.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
enum class ConnectionType : u8 { TraversalServer, IP };
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include "core/core.h"
|
||||
#include "core/internal_network/network_interface.h"
|
||||
#include "network/announce_multiplayer_session.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_host_room.h"
|
||||
#include "yuzu/game/game_list_p.h"
|
||||
#include "yuzu/main_window.h"
|
||||
|
|
@ -25,7 +26,6 @@
|
|||
#include "yuzu/multiplayer/message.h"
|
||||
#include "yuzu/multiplayer/state.h"
|
||||
#include "yuzu/multiplayer/validation.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/verify_user_jwt.h"
|
||||
#endif
|
||||
|
|
@ -34,8 +34,7 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
|
|||
std::shared_ptr<Core::AnnounceMultiplayerSession> session,
|
||||
Core::System& system_)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
||||
ui(std::make_unique<Ui::HostRoom>()),
|
||||
announce_multiplayer_session(session), system{system_} {
|
||||
ui(std::make_unique<Ui::HostRoom>()), announce_multiplayer_session(session), system{system_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
// set up validation for all of the fields
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include "core/hle/service/acc/profile_manager.h"
|
||||
#include "core/internal_network/network_interface.h"
|
||||
#include "network/network.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "ui_lobby.h"
|
||||
#include "yuzu/game/game_list_p.h"
|
||||
#include "yuzu/main_window.h"
|
||||
|
|
@ -22,7 +23,6 @@
|
|||
#include "yuzu/multiplayer/message.h"
|
||||
#include "yuzu/multiplayer/state.h"
|
||||
#include "yuzu/multiplayer/validation.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/web_backend.h"
|
||||
#endif
|
||||
|
|
@ -30,8 +30,7 @@
|
|||
Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
|
||||
std::shared_ptr<Core::AnnounceMultiplayerSession> session, Core::System& system_)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
||||
ui(std::make_unique<Ui::Lobby>()),
|
||||
announce_multiplayer_session(session), system{system_} {
|
||||
ui(std::make_unique<Ui::Lobby>()), announce_multiplayer_session(session), system{system_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
// setup the watcher for background connections
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "common/announce_multiplayer_room.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/game/game_list.h"
|
||||
#include "yuzu/multiplayer/client_room.h"
|
||||
#include "yuzu/multiplayer/direct_connect.h"
|
||||
|
|
@ -18,7 +19,6 @@
|
|||
#include "yuzu/multiplayer/lobby.h"
|
||||
#include "yuzu/multiplayer/message.h"
|
||||
#include "yuzu/multiplayer/state.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
#include "yuzu/util/clickable_label.h"
|
||||
|
||||
MultiplayerState::MultiplayerState(QWidget* parent, QStandardItemModel* game_list_model_,
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ protected:
|
|||
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseMoveEvent(QMouseEvent* event) override;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
private:
|
||||
void resetPosition(const QPoint& pos);
|
||||
void updateStats(const Core::PerfStatsResults &results, const VideoCore::ShaderNotify &shaders);
|
||||
void updateStats(const Core::PerfStatsResults& results, const VideoCore::ShaderNotify& shaders);
|
||||
|
||||
MainWindow *m_mainWindow = nullptr;
|
||||
MainWindow* m_mainWindow = nullptr;
|
||||
Ui::PerformanceOverlay* ui;
|
||||
|
||||
// colors
|
||||
|
|
@ -62,11 +62,11 @@ private:
|
|||
QPoint m_drag_start_pos;
|
||||
|
||||
// fps chart
|
||||
QLineSeries *m_fpsSeries = nullptr;
|
||||
QChart *m_fpsChart = nullptr;
|
||||
QChartView *m_fpsChartView = nullptr;
|
||||
QValueAxis *m_fpsX = nullptr;
|
||||
QValueAxis *m_fpsY = nullptr;
|
||||
QLineSeries* m_fpsSeries = nullptr;
|
||||
QChart* m_fpsChart = nullptr;
|
||||
QChartView* m_fpsChartView = nullptr;
|
||||
QValueAxis* m_fpsX = nullptr;
|
||||
QValueAxis* m_fpsY = nullptr;
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
|
|
|
|||
|
|
@ -1,20 +1,16 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "qt_common/abstract/frontend.h"
|
||||
#include "ryujinx_dialog.h"
|
||||
#include "qt_common/util/fs.h"
|
||||
#include "ui_ryujinx_dialog.h"
|
||||
#include <filesystem>
|
||||
#include "qt_common/abstract/frontend.h"
|
||||
#include "qt_common/util/fs.h"
|
||||
#include "ryujinx_dialog.h"
|
||||
#include "ui_ryujinx_dialog.h"
|
||||
|
||||
RyujinxDialog::RyujinxDialog(std::filesystem::path eden_path,
|
||||
std::filesystem::path ryu_path,
|
||||
QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::RyujinxDialog)
|
||||
, m_eden(eden_path.make_preferred())
|
||||
, m_ryu(ryu_path.make_preferred())
|
||||
{
|
||||
RyujinxDialog::RyujinxDialog(std::filesystem::path eden_path, std::filesystem::path ryu_path,
|
||||
QWidget* parent)
|
||||
: QDialog(parent), ui(new Ui::RyujinxDialog), m_eden(eden_path.make_preferred()),
|
||||
m_ryu(ryu_path.make_preferred()) {
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->eden, &QPushButton::clicked, this, &RyujinxDialog::fromEden);
|
||||
|
|
@ -22,13 +18,11 @@ RyujinxDialog::RyujinxDialog(std::filesystem::path eden_path,
|
|||
connect(ui->cancel, &QPushButton::clicked, this, &RyujinxDialog::reject);
|
||||
}
|
||||
|
||||
RyujinxDialog::~RyujinxDialog()
|
||||
{
|
||||
RyujinxDialog::~RyujinxDialog() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void RyujinxDialog::fromEden()
|
||||
{
|
||||
void RyujinxDialog::fromEden() {
|
||||
accept();
|
||||
|
||||
// Workaround: Ryujinx deletes and re-creates its directory structure???
|
||||
|
|
@ -38,17 +32,17 @@ void RyujinxDialog::fromEden()
|
|||
fs::remove_all(m_ryu);
|
||||
fs::create_directories(m_ryu);
|
||||
fs::copy(m_eden, m_ryu, fs::copy_options::recursive);
|
||||
} catch (std::exception &e) {
|
||||
QtCommon::Frontend::Critical(tr("Failed to link save data"),
|
||||
tr("OS returned error: %1").arg(QString::fromStdString(e.what())));
|
||||
} catch (std::exception& e) {
|
||||
QtCommon::Frontend::Critical(
|
||||
tr("Failed to link save data"),
|
||||
tr("OS returned error: %1").arg(QString::fromStdString(e.what())));
|
||||
}
|
||||
|
||||
// ?ploo
|
||||
QtCommon::FS::LinkRyujinx(m_ryu, m_eden);
|
||||
}
|
||||
|
||||
void RyujinxDialog::fromRyujinx()
|
||||
{
|
||||
void RyujinxDialog::fromRyujinx() {
|
||||
accept();
|
||||
QtCommon::FS::LinkRyujinx(m_ryu, m_eden);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef RYUJINX_DIALOG_H
|
||||
#define RYUJINX_DIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <filesystem>
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class RyujinxDialog;
|
||||
}
|
||||
|
||||
class RyujinxDialog : public QDialog
|
||||
{
|
||||
class RyujinxDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RyujinxDialog(std::filesystem::path eden_path, std::filesystem::path ryu_path, QWidget *parent = nullptr);
|
||||
explicit RyujinxDialog(std::filesystem::path eden_path, std::filesystem::path ryu_path,
|
||||
QWidget* parent = nullptr);
|
||||
~RyujinxDialog();
|
||||
|
||||
private slots:
|
||||
|
|
@ -24,7 +24,7 @@ private slots:
|
|||
void fromRyujinx();
|
||||
|
||||
private:
|
||||
Ui::RyujinxDialog *ui;
|
||||
Ui::RyujinxDialog* ui;
|
||||
std::filesystem::path m_eden;
|
||||
std::filesystem::path m_ryu;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,20 +1,23 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "yuzu/set_play_time_dialog.h"
|
||||
#include "frontend_common/play_time_manager.h"
|
||||
#include "ui_set_play_time_dialog.h"
|
||||
#include "yuzu/set_play_time_dialog.h"
|
||||
|
||||
SetPlayTimeDialog::SetPlayTimeDialog(QWidget* parent, u64 current_play_time)
|
||||
: QDialog(parent), ui{std::make_unique<Ui::SetPlayTimeDialog>()} {
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->hoursSpinBox->setValue(
|
||||
QString::fromStdString(PlayTime::PlayTimeManager::GetPlayTimeHours(current_play_time)).toInt());
|
||||
QString::fromStdString(PlayTime::PlayTimeManager::GetPlayTimeHours(current_play_time))
|
||||
.toInt());
|
||||
ui->minutesSpinBox->setValue(
|
||||
QString::fromStdString(PlayTime::PlayTimeManager::GetPlayTimeMinutes(current_play_time)).toInt());
|
||||
QString::fromStdString(PlayTime::PlayTimeManager::GetPlayTimeMinutes(current_play_time))
|
||||
.toInt());
|
||||
ui->secondsSpinBox->setValue(
|
||||
QString::fromStdString(PlayTime::PlayTimeManager::GetPlayTimeSeconds(current_play_time)).toInt());
|
||||
QString::fromStdString(PlayTime::PlayTimeManager::GetPlayTimeSeconds(current_play_time))
|
||||
.toInt());
|
||||
|
||||
connect(ui->hoursSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this,
|
||||
&SetPlayTimeDialog::OnValueChanged);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Ui {
|
||||
|
|
|
|||
|
|
@ -1,42 +1,41 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "user_data_migration.h"
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QString>
|
||||
#include <QTranslator>
|
||||
#include "common/fs/path_util.h"
|
||||
#include "qt_common/qt_string_lookup.h"
|
||||
#include "user_data_migration.h"
|
||||
#include "yuzu/migration_dialog.h"
|
||||
|
||||
// Needs to be included at the end due to https://bugreports.qt.io/browse/QTBUG-73263
|
||||
#include <filesystem>
|
||||
#include <QButtonGroup>
|
||||
#include <QCheckBox>
|
||||
#include <QGuiApplication>
|
||||
#include <QProgressDialog>
|
||||
#include <QRadioButton>
|
||||
#include <QThread>
|
||||
#include <filesystem>
|
||||
|
||||
UserDataMigrator::UserDataMigrator(QMainWindow *main_window)
|
||||
{
|
||||
UserDataMigrator::UserDataMigrator(QMainWindow* main_window) {
|
||||
// NOTE: Logging is not initialized yet, do not produce logs here.
|
||||
|
||||
// Check migration if config directory does not exist
|
||||
// TODO: ProfileManager messes with us a bit here, and force-creates the /nand/system/save/8000000000000010/su/avators/profiles.dat
|
||||
// file. Find a way to reorder operations and have it create after this guy runs.
|
||||
// TODO: ProfileManager messes with us a bit here, and force-creates the
|
||||
// /nand/system/save/8000000000000010/su/avators/profiles.dat file. Find a way to reorder
|
||||
// operations and have it create after this guy runs.
|
||||
if (!std::filesystem::is_directory(Common::FS::GetEdenPath(Common::FS::EdenPath::ConfigDir))) {
|
||||
ShowMigrationPrompt(main_window);
|
||||
}
|
||||
}
|
||||
|
||||
void UserDataMigrator::ShowMigrationPrompt(QMainWindow *main_window)
|
||||
{
|
||||
void UserDataMigrator::ShowMigrationPrompt(QMainWindow* main_window) {
|
||||
namespace fs = std::filesystem;
|
||||
using namespace QtCommon::StringLookup;
|
||||
|
||||
|
|
@ -44,35 +43,36 @@ void UserDataMigrator::ShowMigrationPrompt(QMainWindow *main_window)
|
|||
migration_prompt.setWindowTitle(QObject::tr("Migration"));
|
||||
|
||||
// mutually exclusive
|
||||
QButtonGroup *group = new QButtonGroup(&migration_prompt);
|
||||
QButtonGroup* group = new QButtonGroup(&migration_prompt);
|
||||
|
||||
// MACRO MADNESS
|
||||
|
||||
#define BUTTON(clazz, name, text, tooltip, checkState) \
|
||||
clazz *name = new clazz(&migration_prompt); \
|
||||
name->setText(text); \
|
||||
name->setToolTip(Lookup(tooltip)); \
|
||||
name->setChecked(checkState); \
|
||||
#define BUTTON(clazz, name, text, tooltip, checkState) \
|
||||
clazz* name = new clazz(&migration_prompt); \
|
||||
name->setText(text); \
|
||||
name->setToolTip(Lookup(tooltip)); \
|
||||
name->setChecked(checkState); \
|
||||
migration_prompt.addBox(name);
|
||||
|
||||
BUTTON(QCheckBox, clear_shaders, QObject::tr("Clear Shader Cache"), MigrationTooltipClearShader, true)
|
||||
BUTTON(QCheckBox, clear_shaders, QObject::tr("Clear Shader Cache"), MigrationTooltipClearShader,
|
||||
true)
|
||||
|
||||
u32 id = 0;
|
||||
|
||||
#define RADIO(name, text, tooltip, checkState) \
|
||||
BUTTON(QRadioButton, name, text, tooltip, checkState) \
|
||||
#define RADIO(name, text, tooltip, checkState) \
|
||||
BUTTON(QRadioButton, name, text, tooltip, checkState) \
|
||||
group->addButton(name, ++id);
|
||||
|
||||
RADIO(keep_old, QObject::tr("Keep Old Data"), MigrationTooltipKeepOld, true)
|
||||
RADIO(keep_old, QObject::tr("Keep Old Data"), MigrationTooltipKeepOld, true)
|
||||
RADIO(clear_old, QObject::tr("Clear Old Data"), MigrationTooltipClearOld, false)
|
||||
RADIO(link_old, QObject::tr("Link Old Directory"), MigrationTooltipLinkOld, false)
|
||||
RADIO(link_old, QObject::tr("Link Old Directory"), MigrationTooltipLinkOld, false)
|
||||
|
||||
#undef RADIO
|
||||
#undef BUTTON
|
||||
|
||||
std::vector<Emulator> found{};
|
||||
|
||||
for (const Emulator &emu : legacy_emus)
|
||||
for (const Emulator& emu : legacy_emus)
|
||||
if (fs::is_directory(emu.get_user_dir()))
|
||||
found.emplace_back(emu);
|
||||
|
||||
|
|
@ -86,10 +86,10 @@ void UserDataMigrator::ShowMigrationPrompt(QMainWindow *main_window)
|
|||
QString prompt_text = Lookup(MigrationPromptPrefix);
|
||||
|
||||
// natural language processing is a nightmare
|
||||
for (const Emulator &emu : found) {
|
||||
for (const Emulator& emu : found) {
|
||||
prompt_text = prompt_text % QStringLiteral("\n ") % emu.name();
|
||||
|
||||
QAbstractButton *button = migration_prompt.addButton(emu.name());
|
||||
QAbstractButton* button = migration_prompt.addButton(emu.name());
|
||||
|
||||
// This is cursed, but it's actually the most efficient way by a mile
|
||||
button->setProperty("emulator", QVariant::fromValue(emu));
|
||||
|
|
@ -103,26 +103,22 @@ void UserDataMigrator::ShowMigrationPrompt(QMainWindow *main_window)
|
|||
|
||||
migration_prompt.exec();
|
||||
|
||||
QAbstractButton *button = migration_prompt.clickedButton();
|
||||
QAbstractButton* button = migration_prompt.clickedButton();
|
||||
|
||||
if (button->text() == QObject::tr("No")) {
|
||||
return ShowMigrationCancelledMessage(main_window);
|
||||
}
|
||||
|
||||
MigrationWorker::MigrationStrategy strategy = static_cast<MigrationWorker::MigrationStrategy>(
|
||||
group->checkedId());
|
||||
MigrationWorker::MigrationStrategy strategy =
|
||||
static_cast<MigrationWorker::MigrationStrategy>(group->checkedId());
|
||||
|
||||
selected_emu = button->property("emulator").value<Emulator>();
|
||||
|
||||
MigrateUserData(main_window,
|
||||
clear_shaders->isChecked(),
|
||||
strategy);
|
||||
MigrateUserData(main_window, clear_shaders->isChecked(), strategy);
|
||||
}
|
||||
|
||||
void UserDataMigrator::ShowMigrationCancelledMessage(QMainWindow *main_window)
|
||||
{
|
||||
QMessageBox::information(main_window,
|
||||
QObject::tr("Migration"),
|
||||
void UserDataMigrator::ShowMigrationCancelledMessage(QMainWindow* main_window) {
|
||||
QMessageBox::information(main_window, QObject::tr("Migration"),
|
||||
QObject::tr("You can manually re-trigger this prompt by deleting the "
|
||||
"new config directory:\n%1")
|
||||
.arg(QString::fromStdString(Common::FS::GetEdenPathString(
|
||||
|
|
@ -130,33 +126,27 @@ void UserDataMigrator::ShowMigrationCancelledMessage(QMainWindow *main_window)
|
|||
QMessageBox::Ok);
|
||||
}
|
||||
|
||||
void UserDataMigrator::MigrateUserData(QMainWindow *main_window,
|
||||
const bool clear_shader_cache,
|
||||
const MigrationWorker::MigrationStrategy strategy)
|
||||
{
|
||||
void UserDataMigrator::MigrateUserData(QMainWindow* main_window, const bool clear_shader_cache,
|
||||
const MigrationWorker::MigrationStrategy strategy) {
|
||||
// Create a dialog to let the user know it's migrating
|
||||
QProgressDialog *progress = new QProgressDialog(main_window);
|
||||
QProgressDialog* progress = new QProgressDialog(main_window);
|
||||
progress->setWindowTitle(QObject::tr("Migrating"));
|
||||
progress->setLabelText(QObject::tr("Migrating, this may take a while..."));
|
||||
progress->setRange(0, 0);
|
||||
progress->setCancelButton(nullptr);
|
||||
progress->setWindowModality(Qt::WindowModality::ApplicationModal);
|
||||
|
||||
QThread *thread = new QThread(main_window);
|
||||
MigrationWorker *worker = new MigrationWorker(selected_emu, clear_shader_cache, strategy);
|
||||
QThread* thread = new QThread(main_window);
|
||||
MigrationWorker* worker = new MigrationWorker(selected_emu, clear_shader_cache, strategy);
|
||||
worker->moveToThread(thread);
|
||||
|
||||
thread->connect(thread, &QThread::started, worker, &MigrationWorker::process);
|
||||
|
||||
thread->connect(worker,
|
||||
&MigrationWorker::finished,
|
||||
progress,
|
||||
[=, this](const QString &success_text, const std::string &path) {
|
||||
thread->connect(worker, &MigrationWorker::finished, progress,
|
||||
[=, this](const QString& success_text, const std::string& path) {
|
||||
progress->close();
|
||||
QMessageBox::information(main_window,
|
||||
QObject::tr("Migration"),
|
||||
success_text,
|
||||
QMessageBox::Ok);
|
||||
QMessageBox::information(main_window, QObject::tr("Migration"),
|
||||
success_text, QMessageBox::Ok);
|
||||
|
||||
migrated = true;
|
||||
thread->quit();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
|
|
@ -21,7 +21,6 @@ public:
|
|||
private:
|
||||
void ShowMigrationPrompt(QMainWindow* main_window);
|
||||
void ShowMigrationCancelledMessage(QMainWindow* main_window);
|
||||
void MigrateUserData(QMainWindow* main_window,
|
||||
const bool clear_shader_cache,
|
||||
void MigrateUserData(QMainWindow* main_window, const bool clear_shader_cache,
|
||||
const MigrationWorker::MigrationStrategy strategy);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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: 2015 Citra Emulator Project
|
||||
|
|
@ -157,11 +157,11 @@ const std::optional<Common::UUID> GetProfileID() {
|
|||
|
||||
const auto select_profile = [] {
|
||||
const Core::Frontend::ProfileSelectParameters parameters{
|
||||
.mode = Service::AM::Frontend::UiMode::UserSelector,
|
||||
.invalid_uid_list = {},
|
||||
.display_options = {},
|
||||
.purpose = Service::AM::Frontend::UserSelectionPurpose::General,
|
||||
};
|
||||
.mode = Service::AM::Frontend::UiMode::UserSelector,
|
||||
.invalid_uid_list = {},
|
||||
.display_options = {},
|
||||
.purpose = Service::AM::Frontend::UserSelectionPurpose::General,
|
||||
};
|
||||
QtProfileSelectionDialog dialog(*QtCommon::system, QtCommon::rootObject, parameters);
|
||||
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
|
||||
Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
|
||||
|
|
|
|||
|
|
@ -62,12 +62,13 @@ void PopulateRecords(std::vector<Record>& records, QWindow* window) try {
|
|||
|
||||
const auto driverID = driver_properties.driverID;
|
||||
|
||||
bool has_broken_compute{Vulkan::Device::CheckBrokenCompute(
|
||||
driverID, properties.properties.driverVersion)};
|
||||
bool has_broken_compute{
|
||||
Vulkan::Device::CheckBrokenCompute(driverID, properties.properties.driverVersion)};
|
||||
|
||||
std::string driver_string = Vulkan::vk::GetDriverName(driver_properties);
|
||||
|
||||
if (driver_string.empty()) driver_string = "Unknown";
|
||||
if (driver_string.empty())
|
||||
driver_string = "Unknown";
|
||||
|
||||
name = fmt::format("{} ({})", name, driver_string);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue