mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
absorbed HighlightController into Application
This commit is contained in:
parent
d0a81f3fe7
commit
f8a9850151
11 changed files with 70 additions and 103 deletions
|
@ -131,7 +131,6 @@ SOURCES += \
|
||||||
src/controllers/commands/CommandController.cpp \
|
src/controllers/commands/CommandController.cpp \
|
||||||
src/controllers/commands/CommandModel.cpp \
|
src/controllers/commands/CommandModel.cpp \
|
||||||
src/controllers/highlights/HighlightBlacklistModel.cpp \
|
src/controllers/highlights/HighlightBlacklistModel.cpp \
|
||||||
src/controllers/highlights/HighlightController.cpp \
|
|
||||||
src/controllers/highlights/HighlightModel.cpp \
|
src/controllers/highlights/HighlightModel.cpp \
|
||||||
src/controllers/highlights/HighlightPhrase.cpp \
|
src/controllers/highlights/HighlightPhrase.cpp \
|
||||||
src/controllers/highlights/UserHighlightModel.cpp \
|
src/controllers/highlights/UserHighlightModel.cpp \
|
||||||
|
@ -326,7 +325,6 @@ HEADERS += \
|
||||||
src/controllers/commands/CommandModel.hpp \
|
src/controllers/commands/CommandModel.hpp \
|
||||||
src/controllers/highlights/HighlightBlacklistModel.hpp \
|
src/controllers/highlights/HighlightBlacklistModel.hpp \
|
||||||
src/controllers/highlights/HighlightBlacklistUser.hpp \
|
src/controllers/highlights/HighlightBlacklistUser.hpp \
|
||||||
src/controllers/highlights/HighlightController.hpp \
|
|
||||||
src/controllers/highlights/HighlightModel.hpp \
|
src/controllers/highlights/HighlightModel.hpp \
|
||||||
src/controllers/highlights/HighlightPhrase.hpp \
|
src/controllers/highlights/HighlightPhrase.hpp \
|
||||||
src/controllers/highlights/UserHighlightModel.hpp \
|
src/controllers/highlights/UserHighlightModel.hpp \
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
#include "common/Args.hpp"
|
#include "common/Args.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
#include "controllers/commands/CommandController.hpp"
|
#include "controllers/commands/CommandController.hpp"
|
||||||
#include "controllers/highlights/HighlightController.hpp"
|
#include "controllers/highlights/HighlightBlacklistUser.hpp"
|
||||||
|
#include "controllers/highlights/HighlightPhrase.hpp"
|
||||||
#include "controllers/ignores/IgnoreController.hpp"
|
#include "controllers/ignores/IgnoreController.hpp"
|
||||||
#include "controllers/moderationactions/ModerationActions.hpp"
|
#include "controllers/moderationactions/ModerationActions.hpp"
|
||||||
#include "controllers/notifications/NotificationController.hpp"
|
#include "controllers/notifications/NotificationController.hpp"
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
#include "singletons/Updates.hpp"
|
#include "singletons/Updates.hpp"
|
||||||
#include "singletons/WindowManager.hpp"
|
#include "singletons/WindowManager.hpp"
|
||||||
#include "util/IsBigEndian.hpp"
|
#include "util/IsBigEndian.hpp"
|
||||||
|
#include "util/PersistSignalVector.hpp"
|
||||||
#include "util/PostToThread.hpp"
|
#include "util/PostToThread.hpp"
|
||||||
#include "widgets/Notebook.hpp"
|
#include "widgets/Notebook.hpp"
|
||||||
#include "widgets/Window.hpp"
|
#include "widgets/Window.hpp"
|
||||||
|
@ -46,7 +48,11 @@ Application *Application::instance = nullptr;
|
||||||
// to each other
|
// to each other
|
||||||
|
|
||||||
Application::Application(Settings &_settings, Paths &_paths)
|
Application::Application(Settings &_settings, Paths &_paths)
|
||||||
: themes(&this->emplace<Theme>())
|
: highlightedMessages(*new SignalVector<HighlightPhrase>())
|
||||||
|
, highlightedUsers(*new SignalVector<HighlightPhrase>())
|
||||||
|
, blacklistedUsers(*new SignalVector<HighlightBlacklistUser>())
|
||||||
|
|
||||||
|
, themes(&this->emplace<Theme>())
|
||||||
, fonts(&this->emplace<Fonts>())
|
, fonts(&this->emplace<Fonts>())
|
||||||
, emotes(&this->emplace<Emotes>())
|
, emotes(&this->emplace<Emotes>())
|
||||||
, windows(&this->emplace<WindowManager>())
|
, windows(&this->emplace<WindowManager>())
|
||||||
|
@ -54,7 +60,6 @@ Application::Application(Settings &_settings, Paths &_paths)
|
||||||
|
|
||||||
, accounts(&this->emplace<AccountController>())
|
, accounts(&this->emplace<AccountController>())
|
||||||
, commands(&this->emplace<CommandController>())
|
, commands(&this->emplace<CommandController>())
|
||||||
, highlights(&this->emplace<HighlightController>())
|
|
||||||
, notifications(&this->emplace<NotificationController>())
|
, notifications(&this->emplace<NotificationController>())
|
||||||
, pings(&this->emplace<MutedChannelController>())
|
, pings(&this->emplace<MutedChannelController>())
|
||||||
, ignores(&this->emplace<IgnoreController>())
|
, ignores(&this->emplace<IgnoreController>())
|
||||||
|
@ -63,10 +68,13 @@ Application::Application(Settings &_settings, Paths &_paths)
|
||||||
, twitch2(&this->emplace<TwitchIrcServer>())
|
, twitch2(&this->emplace<TwitchIrcServer>())
|
||||||
, chatterinoBadges(&this->emplace<ChatterinoBadges>())
|
, chatterinoBadges(&this->emplace<ChatterinoBadges>())
|
||||||
, logging(&this->emplace<Logging>())
|
, logging(&this->emplace<Logging>())
|
||||||
|
|
||||||
{
|
{
|
||||||
this->instance = this;
|
this->instance = this;
|
||||||
|
|
||||||
|
persist(this->highlightedMessages, "/highlighting/highlights");
|
||||||
|
persist(this->blacklistedUsers, "/highlighting/blacklist");
|
||||||
|
persist(this->highlightedUsers, "/highlighting/users");
|
||||||
|
|
||||||
this->fonts->fontChanged.connect(
|
this->fonts->fontChanged.connect(
|
||||||
[this]() { this->windows->layoutChannelViews(); });
|
[this]() { this->windows->layoutChannelViews(); });
|
||||||
|
|
||||||
|
@ -321,4 +329,28 @@ Application *getApp()
|
||||||
return Application::instance;
|
return Application::instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Application::isHighlightedUser(const QString &username)
|
||||||
|
{
|
||||||
|
for (const auto &highlightedUser : this->highlightedUsers)
|
||||||
|
{
|
||||||
|
if (highlightedUser.isMatch(username))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Application::isBlacklistedUser(const QString &username)
|
||||||
|
{
|
||||||
|
auto items = this->blacklistedUsers.readOnly();
|
||||||
|
|
||||||
|
for (const auto &blacklistedUser : *items)
|
||||||
|
{
|
||||||
|
if (blacklistedUser.isMatch(username))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "common/SignalVector.hpp"
|
||||||
#include "common/Singleton.hpp"
|
#include "common/Singleton.hpp"
|
||||||
#include "singletons/NativeMessaging.hpp"
|
#include "singletons/NativeMessaging.hpp"
|
||||||
|
|
||||||
|
@ -31,6 +32,9 @@ class Fonts;
|
||||||
class Toasts;
|
class Toasts;
|
||||||
class ChatterinoBadges;
|
class ChatterinoBadges;
|
||||||
|
|
||||||
|
class HighlightPhrase;
|
||||||
|
class HighlightBlacklistUser;
|
||||||
|
|
||||||
class Application
|
class Application
|
||||||
{
|
{
|
||||||
std::vector<std::unique_ptr<Singleton>> singletons_;
|
std::vector<std::unique_ptr<Singleton>> singletons_;
|
||||||
|
@ -50,6 +54,15 @@ public:
|
||||||
|
|
||||||
friend void test();
|
friend void test();
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
SignalVector<HighlightPhrase> &highlightedMessages;
|
||||||
|
SignalVector<HighlightPhrase> &highlightedUsers;
|
||||||
|
SignalVector<HighlightBlacklistUser> &blacklistedUsers;
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
bool isHighlightedUser(const QString &username);
|
||||||
|
bool isBlacklistedUser(const QString &username);
|
||||||
|
|
||||||
Theme *const themes{};
|
Theme *const themes{};
|
||||||
Fonts *const fonts{};
|
Fonts *const fonts{};
|
||||||
Emotes *const emotes{};
|
Emotes *const emotes{};
|
||||||
|
@ -58,7 +71,6 @@ public:
|
||||||
|
|
||||||
AccountController *const accounts{};
|
AccountController *const accounts{};
|
||||||
CommandController *const commands{};
|
CommandController *const commands{};
|
||||||
HighlightController *const highlights{};
|
|
||||||
NotificationController *const notifications{};
|
NotificationController *const notifications{};
|
||||||
MutedChannelController *const pings{};
|
MutedChannelController *const pings{};
|
||||||
IgnoreController *const ignores{};
|
IgnoreController *const ignores{};
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
#include "HighlightController.hpp"
|
|
||||||
|
|
||||||
#include "Application.hpp"
|
|
||||||
#include "util/PersistSignalVector.hpp"
|
|
||||||
|
|
||||||
namespace chatterino {
|
|
||||||
|
|
||||||
void HighlightController::initialize(Settings &settings, Paths &paths)
|
|
||||||
{
|
|
||||||
assert(!this->initialized_);
|
|
||||||
this->initialized_ = true;
|
|
||||||
|
|
||||||
persist(this->phrases, "/highlighting/highlights");
|
|
||||||
persist(this->blacklistedUsers, "/highlighting/blacklist");
|
|
||||||
persist(this->highlightedUsers, "/highlighting/users");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HighlightController::isHighlightedUser(const QString &username)
|
|
||||||
{
|
|
||||||
for (const auto &highlightedUser : this->highlightedUsers)
|
|
||||||
{
|
|
||||||
if (highlightedUser.isMatch(username))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HighlightController::blacklistContains(const QString &username)
|
|
||||||
{
|
|
||||||
for (const auto &blacklistedUser : *this->blacklistedUsers.readOnly())
|
|
||||||
{
|
|
||||||
if (blacklistedUser.isMatch(username))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace chatterino
|
|
|
@ -1,26 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "common/SignalVector.hpp"
|
|
||||||
#include "common/Singleton.hpp"
|
|
||||||
#include "controllers/highlights/HighlightBlacklistUser.hpp"
|
|
||||||
#include "controllers/highlights/HighlightPhrase.hpp"
|
|
||||||
|
|
||||||
namespace chatterino {
|
|
||||||
|
|
||||||
class HighlightController final : public Singleton
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void initialize(Settings &settings, Paths &paths) override;
|
|
||||||
|
|
||||||
SignalVector<HighlightPhrase> phrases;
|
|
||||||
SignalVector<HighlightBlacklistUser> blacklistedUsers;
|
|
||||||
SignalVector<HighlightPhrase> highlightedUsers;
|
|
||||||
|
|
||||||
bool isHighlightedUser(const QString &username);
|
|
||||||
bool blacklistContains(const QString &username);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool initialized_ = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace chatterino
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "providers/colors/ColorProvider.hpp"
|
#include "providers/colors/ColorProvider.hpp"
|
||||||
|
|
||||||
#include "controllers/highlights/HighlightController.hpp"
|
|
||||||
#include "singletons/Theme.hpp"
|
#include "singletons/Theme.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
@ -38,12 +37,12 @@ QSet<QColor> ColorProvider::recentColors() const
|
||||||
* Currently, only colors used in highlight phrases are considered. This
|
* Currently, only colors used in highlight phrases are considered. This
|
||||||
* may change at any point in the future.
|
* may change at any point in the future.
|
||||||
*/
|
*/
|
||||||
for (auto phrase : getApp()->highlights->phrases)
|
for (auto phrase : getApp()->highlightedMessages)
|
||||||
{
|
{
|
||||||
retVal.insert(*phrase.getColor());
|
retVal.insert(*phrase.getColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto userHl : getApp()->highlights->highlightedUsers)
|
for (auto userHl : getApp()->highlightedUsers)
|
||||||
{
|
{
|
||||||
retVal.insert(*userHl.getColor());
|
retVal.insert(*userHl.getColor());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
#include "controllers/highlights/HighlightController.hpp"
|
|
||||||
#include "messages/LimitedQueue.hpp"
|
#include "messages/LimitedQueue.hpp"
|
||||||
#include "messages/Message.hpp"
|
#include "messages/Message.hpp"
|
||||||
#include "providers/twitch/TwitchAccountManager.hpp"
|
#include "providers/twitch/TwitchAccountManager.hpp"
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "common/Common.hpp"
|
#include "common/Common.hpp"
|
||||||
#include "common/Env.hpp"
|
#include "common/Env.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
#include "controllers/highlights/HighlightController.hpp"
|
|
||||||
#include "messages/Message.hpp"
|
#include "messages/Message.hpp"
|
||||||
#include "messages/MessageBuilder.hpp"
|
#include "messages/MessageBuilder.hpp"
|
||||||
#include "providers/twitch/IrcMessageHandler.hpp"
|
#include "providers/twitch/IrcMessageHandler.hpp"
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
#include "controllers/highlights/HighlightController.hpp"
|
|
||||||
#include "controllers/ignores/IgnoreController.hpp"
|
#include "controllers/ignores/IgnoreController.hpp"
|
||||||
#include "controllers/pings/MutedChannelController.hpp"
|
#include "controllers/pings/MutedChannelController.hpp"
|
||||||
#include "messages/Message.hpp"
|
#include "messages/Message.hpp"
|
||||||
|
@ -1018,7 +1017,7 @@ void TwitchMessageBuilder::parseHighlights()
|
||||||
|
|
||||||
QString currentUsername = currentUser->getUserName();
|
QString currentUsername = currentUser->getUserName();
|
||||||
|
|
||||||
if (app->highlights->blacklistContains(this->ircMessage->nick()))
|
if (app->isBlacklistedUser(this->ircMessage->nick()))
|
||||||
{
|
{
|
||||||
// Do nothing. We ignore highlights from this user.
|
// Do nothing. We ignore highlights from this user.
|
||||||
return;
|
return;
|
||||||
|
@ -1058,7 +1057,7 @@ void TwitchMessageBuilder::parseHighlights()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Highlight because of sender
|
// Highlight because of sender
|
||||||
auto userHighlights = app->highlights->highlightedUsers.readOnly();
|
auto userHighlights = app->highlightedUsers.readOnly();
|
||||||
for (const HighlightPhrase &userHighlight : *userHighlights)
|
for (const HighlightPhrase &userHighlight : *userHighlights)
|
||||||
{
|
{
|
||||||
if (!userHighlight.isMatch(this->ircMessage->nick()))
|
if (!userHighlight.isMatch(this->ircMessage->nick()))
|
||||||
|
@ -1110,7 +1109,7 @@ void TwitchMessageBuilder::parseHighlights()
|
||||||
// TODO: This vector should only be rebuilt upon highlights being changed
|
// TODO: This vector should only be rebuilt upon highlights being changed
|
||||||
// fourtf: should be implemented in the HighlightsController
|
// fourtf: should be implemented in the HighlightsController
|
||||||
std::vector<HighlightPhrase> activeHighlights =
|
std::vector<HighlightPhrase> activeHighlights =
|
||||||
app->highlights->phrases.cloneVector();
|
app->highlightedMessages.cloneVector();
|
||||||
|
|
||||||
if (getSettings()->enableSelfHighlight && currentUsername.size() > 0)
|
if (getSettings()->enableSelfHighlight && currentUsername.size() > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "common/Channel.hpp"
|
#include "common/Channel.hpp"
|
||||||
#include "common/NetworkRequest.hpp"
|
#include "common/NetworkRequest.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
#include "controllers/highlights/HighlightController.hpp"
|
#include "controllers/highlights/HighlightBlacklistUser.hpp"
|
||||||
#include "providers/twitch/PartialTwitchUser.hpp"
|
#include "providers/twitch/PartialTwitchUser.hpp"
|
||||||
#include "providers/twitch/TwitchChannel.hpp"
|
#include "providers/twitch/TwitchChannel.hpp"
|
||||||
#include "singletons/Resources.hpp"
|
#include "singletons/Resources.hpp"
|
||||||
|
@ -336,24 +336,23 @@ void UserInfoPopup::installEvents()
|
||||||
|
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
getApp()->highlights->blacklistedUsers.insert(
|
getApp()->blacklistedUsers.insert(
|
||||||
HighlightBlacklistUser{this->userName_, false});
|
HighlightBlacklistUser{this->userName_, false});
|
||||||
this->ui_.ignoreHighlights->setEnabled(true);
|
this->ui_.ignoreHighlights->setEnabled(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto &vector =
|
const auto &vector = getApp()->blacklistedUsers.raw();
|
||||||
getApp()->highlights->blacklistedUsers.raw();
|
|
||||||
|
|
||||||
for (int i = 0; i < vector.size(); i++)
|
for (int i = 0; i < vector.size(); i++)
|
||||||
{
|
{
|
||||||
if (this->userName_ == vector[i].getPattern())
|
if (this->userName_ == vector[i].getPattern())
|
||||||
{
|
{
|
||||||
getApp()->highlights->blacklistedUsers.removeAt(i);
|
getApp()->blacklistedUsers.removeAt(i);
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getApp()->highlights->blacklistContains(this->userName_))
|
if (getApp()->isBlacklistedUser(this->userName_))
|
||||||
{
|
{
|
||||||
this->ui_.ignoreHighlights->setToolTip(
|
this->ui_.ignoreHighlights->setToolTip(
|
||||||
"Name matched by regex");
|
"Name matched by regex");
|
||||||
|
@ -456,7 +455,7 @@ void UserInfoPopup::updateUserData()
|
||||||
|
|
||||||
// get ignoreHighlights state
|
// get ignoreHighlights state
|
||||||
bool isIgnoringHighlights = false;
|
bool isIgnoringHighlights = false;
|
||||||
const auto &vector = getApp()->highlights->blacklistedUsers.raw();
|
const auto &vector = getApp()->blacklistedUsers.raw();
|
||||||
for (int i = 0; i < vector.size(); i++)
|
for (int i = 0; i < vector.size(); i++)
|
||||||
{
|
{
|
||||||
if (this->userName_ == vector[i].getPattern())
|
if (this->userName_ == vector[i].getPattern())
|
||||||
|
@ -465,7 +464,7 @@ void UserInfoPopup::updateUserData()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getApp()->highlights->blacklistContains(this->userName_) &&
|
if (getApp()->isBlacklistedUser(this->userName_) &&
|
||||||
!isIgnoringHighlights)
|
!isIgnoringHighlights)
|
||||||
{
|
{
|
||||||
this->ui_.ignoreHighlights->setToolTip("Name matched by regex");
|
this->ui_.ignoreHighlights->setToolTip("Name matched by regex");
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
#include "controllers/highlights/HighlightBlacklistModel.hpp"
|
#include "controllers/highlights/HighlightBlacklistModel.hpp"
|
||||||
#include "controllers/highlights/HighlightController.hpp"
|
|
||||||
#include "controllers/highlights/HighlightModel.hpp"
|
#include "controllers/highlights/HighlightModel.hpp"
|
||||||
#include "controllers/highlights/UserHighlightModel.hpp"
|
#include "controllers/highlights/UserHighlightModel.hpp"
|
||||||
#include "singletons/Settings.hpp"
|
#include "singletons/Settings.hpp"
|
||||||
|
@ -53,7 +52,7 @@ HighlightingPage::HighlightingPage()
|
||||||
highlights
|
highlights
|
||||||
.emplace<EditableModelView>(
|
.emplace<EditableModelView>(
|
||||||
(new HighlightModel(nullptr))
|
(new HighlightModel(nullptr))
|
||||||
->initialized(&app->highlights->phrases))
|
->initialized(&app->highlightedMessages))
|
||||||
.getElement();
|
.getElement();
|
||||||
view->addRegexHelpLink();
|
view->addRegexHelpLink();
|
||||||
view->setTitles({"Pattern", "Flash\ntaskbar", "Play\nsound",
|
view->setTitles({"Pattern", "Flash\ntaskbar", "Play\nsound",
|
||||||
|
@ -72,7 +71,7 @@ HighlightingPage::HighlightingPage()
|
||||||
});
|
});
|
||||||
|
|
||||||
view->addButtonPressed.connect([] {
|
view->addButtonPressed.connect([] {
|
||||||
getApp()->highlights->phrases.append(HighlightPhrase{
|
getApp()->highlightedMessages.append(HighlightPhrase{
|
||||||
"my phrase", true, false, false, false, "",
|
"my phrase", true, false, false, false, "",
|
||||||
*ColorProvider::instance().color(
|
*ColorProvider::instance().color(
|
||||||
ColorType::SelfHighlight)});
|
ColorType::SelfHighlight)});
|
||||||
|
@ -95,8 +94,7 @@ HighlightingPage::HighlightingPage()
|
||||||
pingUsers
|
pingUsers
|
||||||
.emplace<EditableModelView>(
|
.emplace<EditableModelView>(
|
||||||
(new UserHighlightModel(nullptr))
|
(new UserHighlightModel(nullptr))
|
||||||
->initialized(
|
->initialized(&app->highlightedUsers))
|
||||||
&app->highlights->highlightedUsers))
|
|
||||||
.getElement();
|
.getElement();
|
||||||
|
|
||||||
view->addRegexHelpLink();
|
view->addRegexHelpLink();
|
||||||
|
@ -120,9 +118,8 @@ HighlightingPage::HighlightingPage()
|
||||||
});
|
});
|
||||||
|
|
||||||
view->addButtonPressed.connect([] {
|
view->addButtonPressed.connect([] {
|
||||||
getApp()->highlights->highlightedUsers.append(
|
getApp()->highlightedUsers.append(HighlightPhrase{
|
||||||
HighlightPhrase{"highlighted user", true, false, false,
|
"highlighted user", true, false, false, false, "",
|
||||||
false, "",
|
|
||||||
*ColorProvider::instance().color(
|
*ColorProvider::instance().color(
|
||||||
ColorType::SelfHighlight)});
|
ColorType::SelfHighlight)});
|
||||||
});
|
});
|
||||||
|
@ -143,8 +140,7 @@ HighlightingPage::HighlightingPage()
|
||||||
disabledUsers
|
disabledUsers
|
||||||
.emplace<EditableModelView>(
|
.emplace<EditableModelView>(
|
||||||
(new HighlightBlacklistModel(nullptr))
|
(new HighlightBlacklistModel(nullptr))
|
||||||
->initialized(
|
->initialized(&app->blacklistedUsers))
|
||||||
&app->highlights->blacklistedUsers))
|
|
||||||
.getElement();
|
.getElement();
|
||||||
|
|
||||||
view->addRegexHelpLink();
|
view->addRegexHelpLink();
|
||||||
|
@ -162,7 +158,7 @@ HighlightingPage::HighlightingPage()
|
||||||
});
|
});
|
||||||
|
|
||||||
view->addButtonPressed.connect([] {
|
view->addButtonPressed.connect([] {
|
||||||
getApp()->highlights->blacklistedUsers.append(
|
getApp()->blacklistedUsers.append(
|
||||||
HighlightBlacklistUser{"blacklisted user", false});
|
HighlightBlacklistUser{"blacklisted user", false});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue