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>
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
namespace Service::Account {
|
|
|
|
|
class ProfileManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class ConfigureProfileManager;
|
|
|
|
|
}
|
|
|
|
|
|
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:
|
2021-07-30 10:07:32 -04:00
|
|
|
explicit ConfigureProfileManager(const 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);
|
2019-01-04 17:32:13 -05:00
|
|
|
void SetUserImage();
|
|
|
|
|
|
|
|
|
|
QVBoxLayout* layout;
|
|
|
|
|
QTreeView* tree_view;
|
|
|
|
|
QStandardItemModel* item_model;
|
|
|
|
|
QGraphicsScene* scene;
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<Service::Account::ProfileManager> profile_manager;
|
2021-09-02 21:40:55 -04:00
|
|
|
|
2021-07-30 10:07:32 -04:00
|
|
|
const Core::System& system;
|
2019-01-04 17:32:13 -05:00
|
|
|
};
|