2010-12-20 21:07:36 +03:00
|
|
|
#include "executionlog.h"
|
|
|
|
#include "ui_executionlog.h"
|
|
|
|
#include "qbtsession.h"
|
2011-01-01 16:05:28 +03:00
|
|
|
#include "iconprovider.h"
|
2010-12-20 21:07:36 +03:00
|
|
|
|
|
|
|
ExecutionLog::ExecutionLog(QWidget *parent) :
|
|
|
|
QWidget(parent),
|
|
|
|
ui(new Ui::ExecutionLog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2011-01-01 16:05:28 +03:00
|
|
|
ui->tabConsole->setTabIcon(0, IconProvider::instance()->getIcon("view-calendar-journal"));
|
|
|
|
ui->tabConsole->setTabIcon(1, IconProvider::instance()->getIcon("view-filter"));
|
2010-12-20 21:07:36 +03:00
|
|
|
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());
|
|
|
|
}
|