2018-06-26 14:09:39 +02:00
|
|
|
#include "HighlightController.hpp"
|
2018-05-06 00:32:45 +02:00
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "Application.hpp"
|
|
|
|
#include "controllers/highlights/HighlightModel.hpp"
|
2018-06-26 15:11:45 +02:00
|
|
|
#include "widgets/dialogs/NotificationPopup.hpp"
|
2018-05-06 00:32:45 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
HighlightController::HighlightController()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void HighlightController::initialize()
|
|
|
|
{
|
|
|
|
assert(!this->initialized);
|
|
|
|
this->initialized = true;
|
|
|
|
|
|
|
|
for (const HighlightPhrase &phrase : this->highlightsSetting.getValue()) {
|
|
|
|
this->phrases.appendItem(phrase);
|
|
|
|
}
|
|
|
|
|
|
|
|
this->phrases.delayedItemsChanged.connect([this] { //
|
|
|
|
this->highlightsSetting.setValue(this->phrases.getVector());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
HighlightModel *HighlightController::createModel(QObject *parent)
|
|
|
|
{
|
|
|
|
HighlightModel *model = new HighlightModel(parent);
|
|
|
|
model->init(&this->phrases);
|
|
|
|
|
|
|
|
return model;
|
|
|
|
}
|
|
|
|
|
2018-05-23 22:27:29 +02:00
|
|
|
void HighlightController::addHighlight(const messages::MessagePtr &msg)
|
|
|
|
{
|
|
|
|
// static widgets::NotificationPopup popup;
|
|
|
|
|
|
|
|
// popup.updatePosition();
|
|
|
|
// popup.addMessage(msg);
|
|
|
|
// popup.show();
|
|
|
|
}
|
|
|
|
|
2018-05-06 00:32:45 +02:00
|
|
|
} // namespace chatterino
|