eden-miror/src/yuzu/configuration/system/new_user_dialog.h
crueter 8678cb06eb
Some checks failed
tx-src / sources (push) Has been cancelled
Check Strings / check-strings (push) Has been cancelled
[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>
2026-03-10 06:51:08 +01:00

71 lines
1.7 KiB
C++

// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QDialog>
#include "common/uuid.h"
#include "core/file_sys/vfs/vfs_types.h"
class QGraphicsScene;
class ProfileAvatarDialog;
namespace Ui {
class NewUserDialog;
}
struct User {
QString username;
Common::UUID uuid;
QPixmap pixmap;
};
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);
~NewUserDialog();
bool isDefaultAvatar() const;
void setIsDefaultAvatar(bool newIsDefaultAvatar);
static QString GetImagePath(const Common::UUID& uuid);
static QPixmap GetIcon(const Common::UUID& uuid);
static QPixmap DefaultAvatar();
private:
Ui::NewUserDialog* ui;
QGraphicsScene* m_scene;
QPixmap m_pixmap;
ProfileAvatarDialog* avatar_dialog;
bool m_isDefaultAvatar = true;
bool m_editing = false;
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 selectImage();
void setAvatar();
void revertImage();
void updateRevertButton();
void generateUUID();
void verifyUser();
void dispatchUser();
signals:
void isDefaultAvatarChanged(bool isDefaultAvatar);
void userAdded(User user);
};