mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Added channelView with last messages to user popup
currently uses last messages from that channel - might want to use online logs later (or make a setting for that)
This commit is contained in:
parent
dc01cbf2a3
commit
f417006d6a
|
@ -5,6 +5,7 @@
|
||||||
#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/HighlightController.hpp"
|
||||||
|
#include "messages/Message.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"
|
||||||
|
@ -15,6 +16,8 @@
|
||||||
#include "widgets/dialogs/LogsPopup.hpp"
|
#include "widgets/dialogs/LogsPopup.hpp"
|
||||||
#include "widgets/helper/EffectLabel.hpp"
|
#include "widgets/helper/EffectLabel.hpp"
|
||||||
#include "widgets/helper/Line.hpp"
|
#include "widgets/helper/Line.hpp"
|
||||||
|
#include "widgets/helper/ChannelView.hpp"
|
||||||
|
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
@ -200,6 +203,11 @@ UserInfoPopup::UserInfoPopup()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fourth line (last messages)
|
||||||
|
this->lastMessages_ = new ChannelView();
|
||||||
|
this->lastMessages_->setScaleIndependantHeight(150);
|
||||||
|
layout.append(this->lastMessages_);
|
||||||
|
|
||||||
this->setStyleSheet("font-size: 11pt;");
|
this->setStyleSheet("font-size: 11pt;");
|
||||||
|
|
||||||
this->installEvents();
|
this->installEvents();
|
||||||
|
@ -338,6 +346,19 @@ void UserInfoPopup::setData(const QString &name, const ChannelPtr &channel)
|
||||||
this->updateUserData();
|
this->updateUserData();
|
||||||
|
|
||||||
this->userStateChanged_.invoke();
|
this->userStateChanged_.invoke();
|
||||||
|
|
||||||
|
LimitedQueueSnapshot<MessagePtr> snapshot = this->channel_->getMessageSnapshot();
|
||||||
|
ChannelPtr channelPtr(new Channel("search", Channel::Type::None));
|
||||||
|
for (size_t i = 0; i < snapshot.size(); i++)
|
||||||
|
{
|
||||||
|
MessagePtr message = snapshot[i];
|
||||||
|
if ( message->loginName.compare(this->userName_, Qt::CaseInsensitive) == 0)
|
||||||
|
{
|
||||||
|
channelPtr->addMessage(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this->lastMessages_->setChannel(channelPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInfoPopup::updateUserData()
|
void UserInfoPopup::updateUserData()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "widgets/BaseWindow.hpp"
|
#include "widgets/BaseWindow.hpp"
|
||||||
|
#include "widgets/helper/ChannelView.hpp"
|
||||||
|
|
||||||
#include <pajlada/signals/signal.hpp>
|
#include <pajlada/signals/signal.hpp>
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ private:
|
||||||
QString userName_;
|
QString userName_;
|
||||||
QString userId_;
|
QString userId_;
|
||||||
ChannelPtr channel_;
|
ChannelPtr channel_;
|
||||||
|
ChannelView* lastMessages_;
|
||||||
|
|
||||||
pajlada::Signals::NoArgSignal userStateChanged_;
|
pajlada::Signals::NoArgSignal userStateChanged_;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue