absorbed HighlightController into Application

This commit is contained in:
fourtf
2020-02-23 21:18:40 +01:00
parent d0a81f3fe7
commit f8a9850151
11 changed files with 70 additions and 103 deletions
+9 -13
View File
@@ -2,7 +2,6 @@
#include "Application.hpp"
#include "controllers/highlights/HighlightBlacklistModel.hpp"
#include "controllers/highlights/HighlightController.hpp"
#include "controllers/highlights/HighlightModel.hpp"
#include "controllers/highlights/UserHighlightModel.hpp"
#include "singletons/Settings.hpp"
@@ -53,7 +52,7 @@ HighlightingPage::HighlightingPage()
highlights
.emplace<EditableModelView>(
(new HighlightModel(nullptr))
->initialized(&app->highlights->phrases))
->initialized(&app->highlightedMessages))
.getElement();
view->addRegexHelpLink();
view->setTitles({"Pattern", "Flash\ntaskbar", "Play\nsound",
@@ -72,7 +71,7 @@ HighlightingPage::HighlightingPage()
});
view->addButtonPressed.connect([] {
getApp()->highlights->phrases.append(HighlightPhrase{
getApp()->highlightedMessages.append(HighlightPhrase{
"my phrase", true, false, false, false, "",
*ColorProvider::instance().color(
ColorType::SelfHighlight)});
@@ -95,8 +94,7 @@ HighlightingPage::HighlightingPage()
pingUsers
.emplace<EditableModelView>(
(new UserHighlightModel(nullptr))
->initialized(
&app->highlights->highlightedUsers))
->initialized(&app->highlightedUsers))
.getElement();
view->addRegexHelpLink();
@@ -120,11 +118,10 @@ HighlightingPage::HighlightingPage()
});
view->addButtonPressed.connect([] {
getApp()->highlights->highlightedUsers.append(
HighlightPhrase{"highlighted user", true, false, false,
false, "",
*ColorProvider::instance().color(
ColorType::SelfHighlight)});
getApp()->highlightedUsers.append(HighlightPhrase{
"highlighted user", true, false, false, false, "",
*ColorProvider::instance().color(
ColorType::SelfHighlight)});
});
QObject::connect(view->getTableView(), &QTableView::clicked,
@@ -143,8 +140,7 @@ HighlightingPage::HighlightingPage()
disabledUsers
.emplace<EditableModelView>(
(new HighlightBlacklistModel(nullptr))
->initialized(
&app->highlights->blacklistedUsers))
->initialized(&app->blacklistedUsers))
.getElement();
view->addRegexHelpLink();
@@ -162,7 +158,7 @@ HighlightingPage::HighlightingPage()
});
view->addButtonPressed.connect([] {
getApp()->highlights->blacklistedUsers.append(
getApp()->blacklistedUsers.append(
HighlightBlacklistUser{"blacklisted user", false});
});
}