mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
b975900043
* Fixes a bug where avatars weren't loaded on fresh installations of Chatterino. * Avatars now update every two weeks. * Removes misleading `DownlaodManager` (now part of `Toasts.cpp`). * Refactors usage of WinToast to be easier to read. * Added version to AUMI. * Removes manual `QString` → `std::wstring` conversions. * Removes uses of implicit ASCII casts in `Toasts.cpp`, meaning it can be compiled with `QT_NO_CAST_FROM_ASCII`.
39 lines
932 B
C++
39 lines
932 B
C++
#pragma once
|
|
|
|
#include "common/Singleton.hpp"
|
|
|
|
#include <pajlada/settings/setting.hpp>
|
|
#include <QString>
|
|
|
|
namespace chatterino {
|
|
|
|
enum class Platform : uint8_t;
|
|
|
|
enum class ToastReaction {
|
|
OpenInBrowser = 0,
|
|
OpenInPlayer = 1,
|
|
OpenInStreamlink = 2,
|
|
DontOpen = 3
|
|
};
|
|
|
|
class Toasts final : public Singleton
|
|
{
|
|
public:
|
|
void sendChannelNotification(const QString &channelName,
|
|
const QString &channelTitle, Platform p);
|
|
static QString findStringFromReaction(const ToastReaction &reaction);
|
|
static QString findStringFromReaction(
|
|
const pajlada::Settings::Setting<int> &reaction);
|
|
|
|
static bool isEnabled();
|
|
|
|
private:
|
|
#ifdef Q_OS_WIN
|
|
void ensureInitialized();
|
|
void sendWindowsNotification(const QString &channelName,
|
|
const QString &channelTitle, Platform p);
|
|
|
|
bool initialized_ = false;
|
|
#endif
|
|
};
|
|
} // namespace chatterino
|