diff options
author | Mai M <mathew1800@gmail.com> | 2021-07-14 22:19:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-14 22:19:05 -0400 |
commit | 05feddc2521ef667cf5d3817ef8e544a352b40ec (patch) | |
tree | 8591def7815ce7cc9156d87e0d62567584db1a23 /src/yuzu/applets/qt_profile_select.h | |
parent | f2599534f8e096053bf7e8887ce729400a346e92 (diff) | |
parent | c6d7da88c7ab125279ea4ccad0e3e839632b2f7a (diff) |
Merge pull request #6639 from Morph1984/optimize-linker
general: Reduce compile time / linker usage on MSVC
Diffstat (limited to 'src/yuzu/applets/qt_profile_select.h')
-rw-r--r-- | src/yuzu/applets/qt_profile_select.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/yuzu/applets/qt_profile_select.h b/src/yuzu/applets/qt_profile_select.h new file mode 100644 index 000000000..4e9037488 --- /dev/null +++ b/src/yuzu/applets/qt_profile_select.h @@ -0,0 +1,72 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <vector> +#include <QDialog> +#include <QList> +#include <QTreeView> +#include "core/frontend/applets/profile_select.h" +#include "core/hle/service/acc/profile_manager.h" + +class GMainWindow; +class QDialogButtonBox; +class QGraphicsScene; +class QLabel; +class QScrollArea; +class QStandardItem; +class QStandardItemModel; +class QVBoxLayout; + +class QtProfileSelectionDialog final : public QDialog { + Q_OBJECT + +public: + explicit QtProfileSelectionDialog(QWidget* parent); + ~QtProfileSelectionDialog() override; + + int exec() override; + void accept() override; + void reject() override; + + int GetIndex() const; + +private: + void SelectUser(const QModelIndex& index); + + int user_index = 0; + + QVBoxLayout* layout; + QTreeView* tree_view; + QStandardItemModel* item_model; + QGraphicsScene* scene; + + std::vector<QList<QStandardItem*>> list_items; + + QVBoxLayout* outer_layout; + QLabel* instruction_label; + QScrollArea* scroll_area; + QDialogButtonBox* buttons; + + std::unique_ptr<Service::Account::ProfileManager> profile_manager; +}; + +class QtProfileSelector final : public QObject, public Core::Frontend::ProfileSelectApplet { + Q_OBJECT + +public: + explicit QtProfileSelector(GMainWindow& parent); + ~QtProfileSelector() override; + + void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback_) const override; + +signals: + void MainWindowSelectProfile() const; + +private: + void MainWindowFinishedSelection(std::optional<Common::UUID> uuid); + + mutable std::function<void(std::optional<Common::UUID>)> callback; +}; |