mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-12 18:24:58 +08:00
Allow clearing of execution log and peer ban log
This commit is contained in:
parent
9c7807ded4
commit
3309706964
@ -57,6 +57,8 @@ ExecutionLog::ExecutionLog(QWidget *parent) :
|
||||
addBanMessage(msg);
|
||||
connect(QBtSession::instance(), SIGNAL(newConsoleMessage(QString)), SLOT(addLogMessage(QString)));
|
||||
connect(QBtSession::instance(), SIGNAL(newBanMessage(QString)), SLOT(addBanMessage(QString)));
|
||||
connect(m_logList, SIGNAL(logCleared()), QBtSession::instance(), SLOT(clearConsoleMessages()));
|
||||
connect(m_banList, SIGNAL(logCleared()), QBtSession::instance(), SLOT(clearPeerBanMessages()));
|
||||
}
|
||||
|
||||
ExecutionLog::~ExecutionLog()
|
||||
|
@ -45,8 +45,11 @@ LogListWidget::LogListWidget(int max_lines, QWidget *parent) :
|
||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
// Context menu
|
||||
QAction *copyAct = new QAction(IconProvider::instance()->getIcon("edit-copy"), tr("Copy"), this);
|
||||
QAction *clearAct = new QAction(IconProvider::instance()->getIcon("edit-clear"), tr("Clear"), this);
|
||||
connect(copyAct, SIGNAL(triggered()), SLOT(copySelection()));
|
||||
connect(clearAct, SIGNAL(triggered()), SLOT(clearLog()));
|
||||
addAction(copyAct);
|
||||
addAction(clearAct);
|
||||
setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
}
|
||||
|
||||
@ -87,3 +90,8 @@ void LogListWidget::copySelection()
|
||||
|
||||
QApplication::clipboard()->setText(strings.join("\n"));
|
||||
}
|
||||
|
||||
void LogListWidget::clearLog() {
|
||||
clear();
|
||||
emit logCleared();
|
||||
}
|
||||
|
@ -48,6 +48,10 @@ public slots:
|
||||
|
||||
protected slots:
|
||||
void copySelection();
|
||||
void clearLog();
|
||||
|
||||
signals:
|
||||
void logCleared();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
@ -166,6 +166,8 @@ public slots:
|
||||
void addConsoleMessage(QString msg, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||
#endif
|
||||
void addPeerBanMessage(QString msg, bool from_ipfilter);
|
||||
void clearConsoleMessages() { consoleMessages.clear(); }
|
||||
void clearPeerBanMessages() { peerBanMessages.clear(); }
|
||||
void processDownloadedFile(QString, QString);
|
||||
void addMagnetSkipAddDlg(const QString& uri, const QString& save_path = QString(), const QString& label = QString());
|
||||
void addMagnetInteractive(const QString& uri);
|
||||
|
Loading…
Reference in New Issue
Block a user