pineapple-src/src/yuzu/configuration/configure_profile_manager.h

92 lines
2 KiB
C
Raw Normal View History

2022-11-05 12:58:44 +00:00
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
2022-11-16 04:23:24 +00:00
#include <functional>
2022-11-05 12:58:44 +00:00
#include <memory>
2022-11-16 04:23:24 +00:00
#include <QDialog>
2022-11-05 12:58:44 +00:00
#include <QList>
#include <QWidget>
2022-11-16 04:23:24 +00:00
namespace Common {
struct UUID;
}
2022-11-05 12:58:44 +00:00
namespace Core {
class System;
}
class QGraphicsScene;
2022-11-16 04:23:24 +00:00
class QDialogButtonBox;
class QLabel;
2022-11-05 12:58:44 +00:00
class QStandardItem;
class QStandardItemModel;
class QTreeView;
class QVBoxLayout;
namespace Service::Account {
class ProfileManager;
}
namespace Ui {
class ConfigureProfileManager;
}
2022-11-16 04:23:24 +00:00
class ConfigureProfileManagerDeleteDialog : public QDialog {
public:
explicit ConfigureProfileManagerDeleteDialog(QWidget* parent);
~ConfigureProfileManagerDeleteDialog();
void SetInfo(const QString& username, const Common::UUID& uuid,
std::function<void()> accept_callback);
private:
QDialogButtonBox* dialog_button_box;
QGraphicsScene* icon_scene;
QLabel* label_info;
};
2022-11-05 12:58:44 +00:00
class ConfigureProfileManager : public QWidget {
Q_OBJECT
public:
explicit ConfigureProfileManager(const Core::System& system_, QWidget* parent = nullptr);
~ConfigureProfileManager() override;
void ApplyConfiguration();
private:
void changeEvent(QEvent* event) override;
void RetranslateUI();
void SetConfiguration();
void PopulateUserList();
void UpdateCurrentUser();
void SelectUser(const QModelIndex& index);
void AddUser();
void RenameUser();
2022-11-16 04:23:24 +00:00
void ConfirmDeleteUser();
void DeleteUser(const Common::UUID& uuid);
2022-11-05 12:58:44 +00:00
void SetUserImage();
QVBoxLayout* layout;
QTreeView* tree_view;
QStandardItemModel* item_model;
QGraphicsScene* scene;
2022-11-16 04:23:24 +00:00
ConfigureProfileManagerDeleteDialog* confirm_dialog;
2022-11-05 12:58:44 +00:00
std::vector<QList<QStandardItem*>> list_items;
std::unique_ptr<Ui::ConfigureProfileManager> ui;
bool enabled = false;
std::unique_ptr<Service::Account::ProfileManager> profile_manager;
const Core::System& system;
};