creates common texts for opening streams

Texts for opening streams were used in multiple locations. Created a file to store GUI texts like this and replaced were applicable
This commit is contained in:
TranRed
2019-04-27 10:12:51 +02:00
committed by pajlada
parent 01082b123f
commit f76df80575
6 changed files with 43 additions and 27 deletions
+13 -13
View File
@@ -5,6 +5,7 @@
#include "controllers/notifications/NotificationModel.hpp"
#include "singletons/Settings.hpp"
#include "util/LayoutCreator.hpp"
#include "widgets/helper/CommonTexts.hpp"
#include "widgets/helper/EditableModelView.hpp"
#include <QCheckBox>
@@ -17,10 +18,6 @@
#include <QTableView>
#include <QTimer>
#define TOAST_REACTIONS \
"in browser", "player in browser", "in streamlink", "don't open"
namespace chatterino {
NotificationPage::NotificationPage()
@@ -43,17 +40,20 @@ NotificationPage::NotificationPage()
settings.append(
this->createCheckBox("Enable toasts (Windows 8 or later)",
getSettings()->notificationToast));
auto openIn =
settings.emplace<QHBoxLayout>().withoutMargin();
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.emplace<QLabel>("Open stream from Toast: ")
->setSizePolicy(QSizePolicy::Maximum,
QSizePolicy::Preferred);
openIn
.append(this->createComboBox(
{OPEN_IN_BROWSER, OPEN_PLAYER_IN_BROWSER,
OPEN_IN_STREAMLINK, DONT_OPEN},
getSettings()->openFromToast))
->setSizePolicy(QSizePolicy::Maximum,
QSizePolicy::Preferred);
}
openIn->setContentsMargins(40,0,0,0);
openIn->setContentsMargins(40, 0, 0, 0);
openIn->setSizeConstraint(QLayout::SetMaximumSize);
#endif
auto customSound =