added SpecialChannelPage with a description for /mentions

This commit is contained in:
fourtf 2018-01-23 23:10:27 +01:00
parent f42d48860c
commit d741bf6df3
7 changed files with 76 additions and 24 deletions

View file

@ -165,7 +165,8 @@ SOURCES += \
src/widgets/streamview.cpp \ src/widgets/streamview.cpp \
src/util/networkrequest.cpp \ src/util/networkrequest.cpp \
src/widgets/settingspages/ignoreuserspage.cpp \ src/widgets/settingspages/ignoreuserspage.cpp \
src/widgets/settingspages/ignoremessagespage.cpp src/widgets/settingspages/ignoremessagespage.cpp \
src/widgets/settingspages/specialchannelspage.cpp
HEADERS += \ HEADERS += \
src/precompiled_header.hpp \ src/precompiled_header.hpp \
@ -270,7 +271,8 @@ HEADERS += \
src/util/networkworker.hpp \ src/util/networkworker.hpp \
src/util/networkrequester.hpp \ src/util/networkrequester.hpp \
src/widgets/settingspages/ignoreuserspage.hpp \ src/widgets/settingspages/ignoreuserspage.hpp \
src/widgets/settingspages/ignoremessagespage.hpp src/widgets/settingspages/ignoremessagespage.hpp \
src/widgets/settingspages/specialchannelspage.hpp
RESOURCES += \ RESOURCES += \
resources/resources.qrc resources/resources.qrc

View file

@ -12,6 +12,7 @@
#include "widgets/settingspages/ignoreuserspage.hpp" #include "widgets/settingspages/ignoreuserspage.hpp"
#include "widgets/settingspages/logspage.hpp" #include "widgets/settingspages/logspage.hpp"
#include "widgets/settingspages/moderationpage.hpp" #include "widgets/settingspages/moderationpage.hpp"
#include "widgets/settingspages/specialchannelspage.hpp"
#include <QDialogButtonBox> #include <QDialogButtonBox>
@ -79,11 +80,13 @@ void SettingsDialog::addTabs()
this->addTab(new settingspages::BehaviourPage); this->addTab(new settingspages::BehaviourPage);
this->addTab(new settingspages::CommandPage); this->addTab(new settingspages::CommandPage);
this->addTab(new settingspages::EmotesPage); this->addTab(new settingspages::EmotesPage);
this->addTab(new settingspages::IgnoreUsersPage);
this->addTab(new settingspages::IgnoreMessagesPage);
this->addTab(new settingspages::HighlightingPage); this->addTab(new settingspages::HighlightingPage);
// this->addTab(new settingspages::LogsPage); this->addTab(new settingspages::IgnoreMessagesPage);
this->addTab(new settingspages::IgnoreUsersPage);
this->addTab(new settingspages::LogsPage);
this->addTab(new settingspages::ModerationPage); this->addTab(new settingspages::ModerationPage);
this->addTab(new settingspages::SpecialChannelsPage);
this->ui.tabContainer->addStretch(1); this->ui.tabContainer->addStretch(1);
this->addTab(new settingspages::AboutPage, Qt::AlignBottom); this->addTab(new settingspages::AboutPage, Qt::AlignBottom);
} }

View file

@ -9,7 +9,7 @@ namespace chatterino {
namespace widgets { namespace widgets {
namespace settingspages { namespace settingspages {
IgnoreMessagesPage::IgnoreMessagesPage() IgnoreMessagesPage::IgnoreMessagesPage()
: SettingsPage("Ignore Messages", ":/images/theme.svg") : SettingsPage("Ignore Messages", "")
{ {
singletons::SettingManager &settings = singletons::SettingManager::getInstance(); singletons::SettingManager &settings = singletons::SettingManager::getInstance();
util::LayoutCreator<IgnoreMessagesPage> layoutCreator(this); util::LayoutCreator<IgnoreMessagesPage> layoutCreator(this);

View file

@ -4,20 +4,21 @@
#include "util/layoutcreator.hpp" #include "util/layoutcreator.hpp"
#include <QCheckBox> #include <QCheckBox>
#include <QGroupBox>
#include <QLabel> #include <QLabel>
#include <QListView> #include <QListView>
#include <QPushButton> #include <QPushButton>
#include <QVBoxLayout> #include <QVBoxLayout>
// clang-format off // clang-format off
#define INFO "/ignore <user> in chat ignores a user\n/unignore <user> in chat unignores a user\n\nChatterino uses the twitch api for ignored users so they are shared with the webchat.\nIf you use your own oauth key make sure that it has the correct permissions." #define INFO "/ignore <user> in chat ignores a user\n/unignore <user> in chat unignores a user\n\nChatterino uses the twitch api for ignored users so they are shared with the webchat.\nIf you use your own oauth key make sure that it has the correct permissions.\n"
// clang-format on // clang-format on
namespace chatterino { namespace chatterino {
namespace widgets { namespace widgets {
namespace settingspages { namespace settingspages {
IgnoreUsersPage::IgnoreUsersPage() IgnoreUsersPage::IgnoreUsersPage()
: SettingsPage("Ignore Users", ":/images/theme.svg") : SettingsPage("Ignore Users", "")
{ {
singletons::SettingManager &settings = singletons::SettingManager::getInstance(); singletons::SettingManager &settings = singletons::SettingManager::getInstance();
util::LayoutCreator<IgnoreUsersPage> layoutCreator(this); util::LayoutCreator<IgnoreUsersPage> layoutCreator(this);
@ -27,24 +28,27 @@ IgnoreUsersPage::IgnoreUsersPage()
label->setWordWrap(true); label->setWordWrap(true);
label->setStyleSheet("color: #BBB"); label->setStyleSheet("color: #BBB");
layout.append( auto group = layout.emplace<QGroupBox>("Ignored users").setLayoutType<QVBoxLayout>();
{
group.append(
this->createCheckBox("Enable twitch ignored users", settings.enableTwitchIgnoredUsers)); this->createCheckBox("Enable twitch ignored users", settings.enableTwitchIgnoredUsers));
auto anyways = layout.emplace<QHBoxLayout>().withoutMargin(); auto anyways = group.emplace<QHBoxLayout>().withoutMargin();
{ {
anyways.emplace<QLabel>("Show anyways if:"); anyways.emplace<QLabel>("Show anyways if:");
anyways.emplace<QComboBox>(); anyways.emplace<QComboBox>();
anyways->addStretch(1); anyways->addStretch(1);
} }
auto addremove = layout.emplace<QHBoxLayout>().withoutMargin(); auto addremove = group.emplace<QHBoxLayout>().withoutMargin();
{ {
auto add = addremove.emplace<QPushButton>("Ignore user"); auto add = addremove.emplace<QPushButton>("Ignore user");
auto remove = addremove.emplace<QPushButton>("Unignore User"); auto remove = addremove.emplace<QPushButton>("Unignore User");
addremove->addStretch(1); addremove->addStretch(1);
} }
auto userList = layout.emplace<QListView>(); auto userList = group.emplace<QListView>();
}
} }
} // namespace settingspages } // namespace settingspages
} // namespace widgets } // namespace widgets

View file

@ -4,7 +4,7 @@ namespace chatterino {
namespace widgets { namespace widgets {
namespace settingspages { namespace settingspages {
LogsPage::LogsPage() LogsPage::LogsPage()
: SettingsPage("Logs", ":/images/VSO_Link_blue_16x.png") : SettingsPage("Logs", "")
{ {
} }
} // namespace settingspages } // namespace settingspages

View file

@ -0,0 +1,28 @@
#include "specialchannelspage.hpp"
#include "singletons/settingsmanager.hpp"
#include "util/layoutcreator.hpp"
#include <QGroupBox>
#include <QLabel>
#include <QVBoxLayout>
namespace chatterino {
namespace widgets {
namespace settingspages {
SpecialChannelsPage::SpecialChannelsPage()
: SettingsPage("Special channels", "")
{
util::LayoutCreator<SpecialChannelsPage> layoutCreator(this);
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
auto mentions = layout.emplace<QGroupBox>("Mentions channel").setLayoutType<QVBoxLayout>();
{
mentions.emplace<QLabel>("Join /mentions to view your mentions.");
}
layout->addStretch(1);
}
} // namespace settingspages
} // namespace widgets
} // namespace chatterino

View file

@ -0,0 +1,15 @@
#pragma once
#include "widgets/settingspages/settingspage.hpp"
namespace chatterino {
namespace widgets {
namespace settingspages {
class SpecialChannelsPage : public SettingsPage
{
public:
SpecialChannelsPage();
};
} // namespace settingspages
} // namespace widgets
} // namespace chatterino