Add viewing logs to UserInfoPopup (#548)

* Add cbenni logviewer

* Remove unneeded includes

* Updated getLogs to check for logs on Overrustle

will check logs on overrustle if none were found on cbenni

* Formatting, fix some bugs

* Fixes per PR comments

* Should really take more time when pushing

* Changes per PR, simplify code a lot

* Style/formatting fixes
This commit is contained in:
DatGuy1
2018-07-05 23:47:51 +03:00
committed by fourtf
parent eeb514c444
commit 086ae010b1
6 changed files with 191 additions and 1 deletions
+10
View File
@@ -7,6 +7,7 @@
#include "util/LayoutCreator.hpp"
#include "util/PostToThread.hpp"
#include "widgets/Label.hpp"
#include "widgets/dialogs/LogsPopup.hpp"
#include "widgets/helper/Line.hpp"
#include "widgets/helper/RippleEffectLabel.hpp"
@@ -68,6 +69,8 @@ UserInfoPopup::UserInfoPopup()
user.emplace<QCheckBox>("Follow").assign(&this->ui_.follow);
user.emplace<QCheckBox>("Ignore").assign(&this->ui_.ignore);
user.emplace<QCheckBox>("Ignore highlights").assign(&this->ui_.ignoreHighlights);
auto viewLogs = user.emplace<RippleEffectLabel>(this).assign(&this->ui_.viewLogs);
this->ui_.viewLogs->getLabel().setText("Logs");
auto mod = user.emplace<RippleEffectButton>(this);
mod->setPixmap(app->resources->buttons.mod);
@@ -78,6 +81,13 @@ UserInfoPopup::UserInfoPopup()
user->addStretch(1);
QObject::connect(viewLogs.getElement(), &RippleEffectLabel::clicked, [this] {
auto logs = new LogsPopup();
logs->setInfo(this->channel_, this->userName_);
logs->setAttribute(Qt::WA_DeleteOnClose);
logs->show();
});
QObject::connect(mod.getElement(), &RippleEffectButton::clicked,
[this] { this->channel_->sendMessage("/mod " + this->userName_); });
QObject::connect(unmod.getElement(), &RippleEffectButton::clicked,