Implemented requested changes

changed setting from String to int.
changed EnumCase

I used createComboBox only has an implementation that handles stringsettings. I implemented my own combobox to handle the ToastsSettings now. Not sure if this is the best way. Won't come up with something smarter for now.
This commit is contained in:
TranRed
2019-04-27 18:15:41 +02:00
committed by pajlada
parent c20629c165
commit 2a590adba7
5 changed files with 67 additions and 33 deletions
+6 -4
View File
@@ -8,10 +8,10 @@ namespace chatterino {
enum class Platform : uint8_t;
enum class ToastReactions {
openInBrowser,
openInPlayer,
openInStreamlink,
dontOpen
OpenInBrowser = 0,
OpenInPlayer = 1,
OpenInStreamlink = 2,
DontOpen = 3
};
class Toasts final : public Singleton
@@ -19,6 +19,8 @@ class Toasts final : public Singleton
public:
void sendChannelNotification(const QString &channelName, Platform p);
static QString findStringFromReaction(const ToastReactions &reaction);
static QString findStringFromReaction(
const pajlada::Settings::Setting<int> &reaction);
static ToastReactions findReactionFromString(const QString &string);
static std::map<ToastReactions, QString> reactionToString;
static std::map<QString, ToastReactions> stringToReaction;