Some work about adaptive color scheme for Web UI (PR #19901) http://[316:c51a:62a3:8b9::4]/d4708/qBittorrent/src/branch/adaptive-webui
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

#include "executionlog.h"
#include "ui_executionlog.h"
#include "qbtsession.h"
#include "misc.h"
ExecutionLog::ExecutionLog(QWidget *parent) :
QWidget(parent),
ui(new Ui::ExecutionLog)
{
ui->setupUi(this);
ui->tabConsole->setTabIcon(0, misc::getIcon("view-calendar-journal"));
ui->tabConsole->setTabIcon(1, misc::getIcon("view-filter"));
ui->textConsole->setHtml(QBtSession::instance()->getConsoleMessages().join("<br>"));
connect(QBtSession::instance(), SIGNAL(newConsoleMessage(QString)), SLOT(addLogMessage(QString)));
ui->textBannedPeers->setHtml(QBtSession::instance()->getPeerBanMessages().join("<br>"));
connect(QBtSession::instance(), SIGNAL(newBanMessage(QString)), SLOT(addBanMessage(QString)));
}
ExecutionLog::~ExecutionLog()
{
delete ui;
}
void ExecutionLog::addLogMessage(const QString &msg)
{
ui->textConsole->setHtml(msg+ui->textConsole->toHtml());
}
void ExecutionLog::addBanMessage(const QString &msg)
{
ui->textBannedPeers->setHtml(msg+ui->textBannedPeers->toHtml());
}