mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -07:00
Display execution log as a tab instead of a modal window
This commit is contained in:
parent
c3b7aeadd7
commit
897d0be08e
12 changed files with 133 additions and 98 deletions
32
src/executionlog.cpp
Normal file
32
src/executionlog.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#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());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue