|
|
@ -45,8 +45,11 @@ LogListWidget::LogListWidget(int max_lines, QWidget *parent) : |
|
|
|
setSelectionMode(QAbstractItemView::ExtendedSelection); |
|
|
|
setSelectionMode(QAbstractItemView::ExtendedSelection); |
|
|
|
// Context menu
|
|
|
|
// Context menu
|
|
|
|
QAction *copyAct = new QAction(IconProvider::instance()->getIcon("edit-copy"), tr("Copy"), this); |
|
|
|
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(copyAct, SIGNAL(triggered()), SLOT(copySelection())); |
|
|
|
|
|
|
|
connect(clearAct, SIGNAL(triggered()), SLOT(clearLog())); |
|
|
|
addAction(copyAct); |
|
|
|
addAction(copyAct); |
|
|
|
|
|
|
|
addAction(clearAct); |
|
|
|
setContextMenuPolicy(Qt::ActionsContextMenu); |
|
|
|
setContextMenuPolicy(Qt::ActionsContextMenu); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -87,3 +90,8 @@ void LogListWidget::copySelection() |
|
|
|
|
|
|
|
|
|
|
|
QApplication::clipboard()->setText(strings.join("\n")); |
|
|
|
QApplication::clipboard()->setText(strings.join("\n")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LogListWidget::clearLog() { |
|
|
|
|
|
|
|
clear(); |
|
|
|
|
|
|
|
emit logCleared(); |
|
|
|
|
|
|
|
} |
|
|
|