Add option to disable Discord Presence in Qt UI

This commit is contained in:
Sleepy Flower Girl
2018-06-03 15:29:25 -04:00
parent d9351a5b45
commit ae2337aff6
5 changed files with 42 additions and 0 deletions
+20
View File
@@ -19,6 +19,10 @@
#include "DolphinQt2/Settings.h"
#include "InputCommon/InputConfig.h"
#ifdef USE_DISCORD_PRESENCE
#include "UICommon/DiscordPresence.h"
#endif
Settings::Settings()
{
qRegisterMetaType<Core::State>();
@@ -476,3 +480,19 @@ void Settings::SetBatchModeEnabled(bool batch)
{
m_batch = batch;
}
#ifdef USE_DISCORD_PRESENCE
void Settings::SetDiscordPresenceEnabled(bool enabled)
{
if (SConfig::GetInstance().bUseDiscordPresence == enabled)
return;
if (SConfig::GetInstance().bUseDiscordPresence)
Discord::Shutdown();
SConfig::GetInstance().bUseDiscordPresence = enabled;
if (SConfig::GetInstance().bUseDiscordPresence)
Discord::Init();
}
#endif