diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2017-08-01 12:55:21 +0200 |
|---|---|---|
| committer | spycrab <spycrab@users.noreply.github.com> | 2017-08-10 06:49:57 +0200 |
| commit | 78cc759d560f96e89fda07a62c57a8a577d83cdc (patch) | |
| tree | 3767b81f59f6b00d3fdc9881eb0224c141f13176 /Source/Core | |
| parent | 2e29509b75652a5446873121177db511e134415b (diff) | |
Settings: Implement NetPlay globals
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt2/GameList/GameList.cpp | 9 | ||||
| -rw-r--r-- | Source/Core/DolphinQt2/GameList/GameList.h | 1 | ||||
| -rw-r--r-- | Source/Core/DolphinQt2/Settings.cpp | 27 | ||||
| -rw-r--r-- | Source/Core/DolphinQt2/Settings.h | 17 |
4 files changed, 44 insertions, 10 deletions
diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp index 00e8632f12..8d09f63091 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.cpp +++ b/Source/Core/DolphinQt2/GameList/GameList.cpp @@ -416,16 +416,7 @@ QString GameList::GetSelectedGame() const return QStringLiteral(""); } -<<<<<<< HEAD -GameListModel* GameList::GetModel() const -{ - return m_model; -} - -void GameList::SetPreferredView(bool table) -======= void GameList::SetPreferredView(bool list) ->>>>>>> af63a1c36d... tmp. { m_prefer_list = list; Settings::Instance().SetPreferredView(list); diff --git a/Source/Core/DolphinQt2/GameList/GameList.h b/Source/Core/DolphinQt2/GameList/GameList.h index dbe4a9a568..44af5b58d4 100644 --- a/Source/Core/DolphinQt2/GameList/GameList.h +++ b/Source/Core/DolphinQt2/GameList/GameList.h @@ -20,7 +20,6 @@ class GameList final : public QStackedWidget public: explicit GameList(QWidget* parent = nullptr); QString GetSelectedGame() const; - GameListModel* GetModel() const; void SetListView() { SetPreferredView(true); } void SetGridView() { SetPreferredView(false); } diff --git a/Source/Core/DolphinQt2/Settings.cpp b/Source/Core/DolphinQt2/Settings.cpp index 99632fa78b..505614eae3 100644 --- a/Source/Core/DolphinQt2/Settings.cpp +++ b/Source/Core/DolphinQt2/Settings.cpp @@ -11,6 +11,7 @@ #include "Common/FileUtil.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" +#include "DolphinQt2/GameList/GameListModel.h" #include "DolphinQt2/Settings.h" #include "InputCommon/InputConfig.h" @@ -171,3 +172,29 @@ void Settings::SetLogConfigVisible(bool visible) emit LogConfigVisibilityChanged(visible); } } + +GameListModel* Settings::GetGameListModel() const +{ + static GameListModel* model = new GameListModel; + return model; +} + +NetPlayClient* Settings::GetNetPlayClient() +{ + return m_client.get(); +} + +void Settings::ResetNetPlayClient(NetPlayClient* client) +{ + m_client.reset(client); +} + +NetPlayServer* Settings::GetNetPlayServer() +{ + return m_server.get(); +} + +void Settings::ResetNetPlayServer(NetPlayServer* server) +{ + m_server.reset(server); +} diff --git a/Source/Core/DolphinQt2/Settings.h b/Source/Core/DolphinQt2/Settings.h index be9e32dec4..d3d800668b 100644 --- a/Source/Core/DolphinQt2/Settings.h +++ b/Source/Core/DolphinQt2/Settings.h @@ -4,16 +4,22 @@ #pragma once +#include <memory> + #include <QObject> #include <QVector> #include "Common/NonCopyable.h" +#include "Core/NetPlayClient.h" +#include "Core/NetPlayServer.h" + namespace DiscIO { enum class Language; } +class GameListModel; class InputConfig; // UI settings to be stored in the config directory. @@ -57,6 +63,15 @@ public: void IncreaseVolume(int volume); void DecreaseVolume(int volume); + // NetPlay + NetPlayClient* GetNetPlayClient(); + void ResetNetPlayClient(NetPlayClient* client = nullptr); + NetPlayServer* GetNetPlayServer(); + void ResetNetPlayServer(NetPlayServer* server = nullptr); + + // Other + GameListModel* GetGameListModel() const; + signals: void ThemeChanged(); void PathAdded(const QString&); @@ -68,5 +83,7 @@ signals: void LogConfigVisibilityChanged(bool visible); private: + std::unique_ptr<NetPlayClient> m_client; + std::unique_ptr<NetPlayServer> m_server; Settings(); }; |
