stuff does compile
This commit is contained in:
@@ -144,6 +144,7 @@ public:
|
||||
false};
|
||||
BoolSetting notificationPlaySound = {"/notifications/enablePlaySound",
|
||||
false};
|
||||
BoolSetting notificationToast = {"/notifications/enableToast", false};
|
||||
|
||||
/// External tools
|
||||
// Streamlink
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchServer.hpp"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
#include <wintoastlib.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
@@ -70,12 +74,19 @@ bool Toasts::wasChannelLive(const QString &channelName)
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
void Toasts::sendChannelNotification(const QString &channelName, int &platform)
|
||||
bool Toasts::isEnabled()
|
||||
{
|
||||
return WinToastLib::WinToast::isCompatible() &&
|
||||
getApp()->settings->notificationToast;
|
||||
}
|
||||
|
||||
void Toasts::sendChannelNotification(const QString &channelName, Platform p)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
if (WinToastLib::WinToast::isCompatible()) {
|
||||
sendWindowsNotification(channelName, platform);
|
||||
}
|
||||
|
||||
sendWindowsNotification(channelName, p);
|
||||
return;
|
||||
|
||||
#endif
|
||||
// OSX
|
||||
|
||||
@@ -127,7 +138,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void Toasts::sendWindowsNotification(const QString &channelName, int &platform)
|
||||
void Toasts::sendWindowsNotification(const QString &channelName, Platform p)
|
||||
{
|
||||
WinToastLib::WinToastTemplate templ = WinToastLib::WinToastTemplate(
|
||||
WinToastLib::WinToastTemplate::ImageAndText02);
|
||||
|
||||
@@ -7,18 +7,20 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
enum class Platform : uint8_t;
|
||||
|
||||
class Toasts final : public Singleton
|
||||
{
|
||||
public:
|
||||
void sendChannelNotification(const QString &channelName, int &platform);
|
||||
bool isEnabled(const QString &channelName);
|
||||
void sendChannelNotification(const QString &channelName, Platform p);
|
||||
/*
|
||||
Toasts();
|
||||
virtual void initialize(Settings &settings, Paths &paths) override final;
|
||||
*/
|
||||
static bool isEnabled();
|
||||
|
||||
private:
|
||||
void sendWindowsNotification(const QString &channelName, int &platform);
|
||||
void sendWindowsNotification(const QString &channelName, Platform p);
|
||||
/*
|
||||
void updateLiveChannels(const QString &channelName);
|
||||
void removeFromLiveChannels(const QString &channelName);
|
||||
|
||||
Reference in New Issue
Block a user