Added setting for opening streams from toast

Implemented #710

Added options for opening streams from clicking the toas notficiation: (according to options in splits)
- open in browser
- open player in browser
- open in streamlink (needs to be tested, but should in theory work, since I only use the already existing function)
- don't open the stream (in case someone wants to prevent opening streams "by accident")
This commit is contained in:
TranRed
2019-04-22 09:03:52 +02:00
parent 4cf656fe62
commit ad38d0ca1c
3 changed files with 47 additions and 5 deletions
@@ -17,6 +17,10 @@
#include <QTableView>
#include <QTimer>
#define TOAST_REACTIONS \
"in browser", "player in browser", "in streamlink", "don't open"
namespace chatterino {
NotificationPage::NotificationPage()
@@ -39,6 +43,18 @@ NotificationPage::NotificationPage()
settings.append(
this->createCheckBox("Enable toasts (Windows 8 or later)",
getSettings()->notificationToast));
auto openIn =
settings.emplace<QHBoxLayout>().withoutMargin();
{
openIn.emplace<QLabel>("Open stream from Toast: ")->setSizePolicy(
QSizePolicy::Maximum, QSizePolicy::Preferred);
openIn.append(
this->createComboBox({TOAST_REACTIONS},
getSettings()->openFromToast))->setSizePolicy(
QSizePolicy::Maximum, QSizePolicy::Preferred);
}
openIn->setContentsMargins(40,0,0,0);
openIn->setSizeConstraint(QLayout::SetMaximumSize);
#endif
auto customSound =
layout.emplace<QHBoxLayout>().withoutMargin();