2022-07-27 18:06:50 +00:00
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-12-28 15:15:37 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include <QWidget>
|
|
|
|
|
2021-10-09 00:29:53 +00:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2020-12-28 15:15:37 +00:00
|
|
|
class QGraphicsScene;
|
|
|
|
class QStandardItem;
|
|
|
|
class QStandardItemModel;
|
|
|
|
class QTreeView;
|
|
|
|
class QVBoxLayout;
|
|
|
|
|
|
|
|
namespace Service::Account {
|
|
|
|
class ProfileManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ConfigureProfileManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ConfigureProfileManager : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-10-09 00:29:53 +00:00
|
|
|
explicit ConfigureProfileManager(const Core::System& system_, QWidget* parent = nullptr);
|
2020-12-28 15:15:37 +00:00
|
|
|
~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();
|
|
|
|
void DeleteUser();
|
|
|
|
void SetUserImage();
|
|
|
|
|
|
|
|
QVBoxLayout* layout;
|
|
|
|
QTreeView* tree_view;
|
|
|
|
QStandardItemModel* item_model;
|
|
|
|
QGraphicsScene* scene;
|
|
|
|
|
|
|
|
std::vector<QList<QStandardItem*>> list_items;
|
|
|
|
|
|
|
|
std::unique_ptr<Ui::ConfigureProfileManager> ui;
|
|
|
|
bool enabled = false;
|
|
|
|
|
|
|
|
std::unique_ptr<Service::Account::ProfileManager> profile_manager;
|
2021-10-09 00:29:53 +00:00
|
|
|
|
|
|
|
const Core::System& system;
|
2020-12-28 15:15:37 +00:00
|
|
|
};
|