2025-06-26 18:39:28 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.
Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.
The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.
Following REUSE has a few advantages over the current approach:
- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
`.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
files like binary assets / images is always accurate and up to date
To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.
[REUSE]: https://reuse.software
Follow-up to b2eb10382941bef0914f4a0a4685b9033440aa9f
2022-05-15 02:06:02 +02:00
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2019-01-04 17:32:13 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-11-15 17:57:01 -05:00
|
|
|
#include <functional>
|
2019-01-04 17:32:13 -05:00
|
|
|
#include <memory>
|
|
|
|
|
2022-11-15 17:57:01 -05:00
|
|
|
#include <QDialog>
|
2019-01-04 17:32:13 -05:00
|
|
|
#include <QList>
|
|
|
|
#include <QWidget>
|
2025-08-08 01:25:00 +02:00
|
|
|
#include "core/file_sys/vfs/vfs_types.h"
|
2019-01-04 17:32:13 -05:00
|
|
|
|
2022-11-15 19:25:09 -05:00
|
|
|
namespace Common {
|
|
|
|
struct UUID;
|
|
|
|
}
|
2022-11-15 17:57:01 -05:00
|
|
|
|
2021-09-02 21:40:55 -04:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2019-01-04 17:32:13 -05:00
|
|
|
class QGraphicsScene;
|
2022-11-15 17:57:01 -05:00
|
|
|
class QDialogButtonBox;
|
|
|
|
class QLabel;
|
2019-01-04 17:32:13 -05:00
|
|
|
class QStandardItem;
|
|
|
|
class QStandardItemModel;
|
|
|
|
class QTreeView;
|
|
|
|
class QVBoxLayout;
|
2025-06-26 18:39:28 +00:00
|
|
|
class QListWidget;
|
2019-01-04 17:32:13 -05:00
|
|
|
|
|
|
|
namespace Service::Account {
|
|
|
|
class ProfileManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ConfigureProfileManager;
|
|
|
|
}
|
|
|
|
|
2025-06-26 18:39:28 +00:00
|
|
|
class ConfigureProfileManagerAvatarDialog : public QDialog {
|
|
|
|
public:
|
|
|
|
explicit ConfigureProfileManagerAvatarDialog(QWidget* parent);
|
|
|
|
~ConfigureProfileManagerAvatarDialog();
|
|
|
|
|
|
|
|
void LoadImages(const QVector<QPixmap>& avatar_images);
|
|
|
|
bool AreImagesLoaded() const;
|
|
|
|
QPixmap GetSelectedAvatar();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void SetBackgroundColor(const QColor& color);
|
|
|
|
QPixmap CreateAvatar(const QPixmap& avatar);
|
|
|
|
void RefreshAvatars();
|
|
|
|
|
|
|
|
QVector<QPixmap> avatar_image_store;
|
|
|
|
QListWidget* avatar_list;
|
|
|
|
QColor avatar_bg_color;
|
|
|
|
QPushButton* bg_color_button;
|
|
|
|
};
|
|
|
|
|
2022-11-15 17:57:01 -05:00
|
|
|
class ConfigureProfileManagerDeleteDialog : public QDialog {
|
|
|
|
public:
|
|
|
|
explicit ConfigureProfileManagerDeleteDialog(QWidget* parent);
|
|
|
|
~ConfigureProfileManagerDeleteDialog();
|
|
|
|
|
2022-11-15 19:25:09 -05:00
|
|
|
void SetInfo(const QString& username, const Common::UUID& uuid,
|
2022-11-15 17:57:01 -05:00
|
|
|
std::function<void()> accept_callback);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QDialogButtonBox* dialog_button_box;
|
|
|
|
QGraphicsScene* icon_scene;
|
|
|
|
QLabel* label_info;
|
|
|
|
};
|
|
|
|
|
2019-01-04 17:32:13 -05:00
|
|
|
class ConfigureProfileManager : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-12-09 23:28:18 -06:00
|
|
|
explicit ConfigureProfileManager(Core::System& system_, QWidget* parent = nullptr);
|
2019-01-04 17:32:13 -05:00
|
|
|
~ConfigureProfileManager() override;
|
|
|
|
|
2019-05-26 00:39:23 -04:00
|
|
|
void ApplyConfiguration();
|
2019-01-04 17:32:13 -05:00
|
|
|
|
|
|
|
private:
|
2019-06-05 18:39:46 -04:00
|
|
|
void changeEvent(QEvent* event) override;
|
|
|
|
void RetranslateUI();
|
|
|
|
|
2019-05-26 00:39:23 -04:00
|
|
|
void SetConfiguration();
|
|
|
|
|
2019-01-04 17:32:13 -05:00
|
|
|
void PopulateUserList();
|
|
|
|
void UpdateCurrentUser();
|
|
|
|
|
|
|
|
void SelectUser(const QModelIndex& index);
|
|
|
|
void AddUser();
|
|
|
|
void RenameUser();
|
2022-11-15 17:57:01 -05:00
|
|
|
void ConfirmDeleteUser();
|
2022-11-15 19:25:09 -05:00
|
|
|
void DeleteUser(const Common::UUID& uuid);
|
2025-06-26 18:39:28 +00:00
|
|
|
void SetUserImage(const QImage& image);
|
|
|
|
void SelectImageFile();
|
|
|
|
void SelectFirmwareAvatar();
|
|
|
|
bool LoadAvatarData();
|
|
|
|
std::vector<uint8_t> DecompressYaz0(const FileSys::VirtualFile& file);
|
2019-01-04 17:32:13 -05:00
|
|
|
|
|
|
|
QVBoxLayout* layout;
|
|
|
|
QTreeView* tree_view;
|
|
|
|
QStandardItemModel* item_model;
|
|
|
|
QGraphicsScene* scene;
|
|
|
|
|
2025-06-26 18:39:28 +00:00
|
|
|
ConfigureProfileManagerAvatarDialog* avatar_dialog;
|
2022-11-15 19:25:09 -05:00
|
|
|
ConfigureProfileManagerDeleteDialog* confirm_dialog;
|
2022-11-15 17:57:01 -05:00
|
|
|
|
2019-01-04 17:32:13 -05:00
|
|
|
std::vector<QList<QStandardItem*>> list_items;
|
|
|
|
|
|
|
|
std::unique_ptr<Ui::ConfigureProfileManager> ui;
|
|
|
|
bool enabled = false;
|
|
|
|
|
2023-12-09 23:28:18 -06:00
|
|
|
Service::Account::ProfileManager& profile_manager;
|
2021-07-30 10:07:32 -04:00
|
|
|
const Core::System& system;
|
2019-01-04 17:32:13 -05:00
|
|
|
};
|