|
|
|
@ -45,8 +45,11 @@ LogListWidget::LogListWidget(int max_lines, QWidget *parent) :
@@ -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()
@@ -87,3 +90,8 @@ void LogListWidget::copySelection()
|
|
|
|
|
|
|
|
|
|
QApplication::clipboard()->setText(strings.join("\n")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void LogListWidget::clearLog() { |
|
|
|
|
clear(); |
|
|
|
|
emit logCleared(); |
|
|
|
|
} |
|
|
|
|