mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-26 12:17:32 +00:00
Qt: add copy context menu entry to log viewer
This commit is contained in:
parent
8652b7d358
commit
1662bcfae4
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <QActionGroup>
|
#include <QActionGroup>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
@ -61,6 +62,7 @@ void log_viewer::show_context_menu(const QPoint& pos)
|
|||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction* clear = new QAction(tr("&Clear"));
|
QAction* clear = new QAction(tr("&Clear"));
|
||||||
|
QAction* copy = new QAction(tr("&Copy"));
|
||||||
QAction* open = new QAction(tr("&Open log file"));
|
QAction* open = new QAction(tr("&Open log file"));
|
||||||
QAction* save = new QAction(tr("&Save filtered log"));
|
QAction* save = new QAction(tr("&Save filtered log"));
|
||||||
QAction* filter = new QAction(tr("&Filter log"));
|
QAction* filter = new QAction(tr("&Filter log"));
|
||||||
@ -110,6 +112,8 @@ void log_viewer::show_context_menu(const QPoint& pos)
|
|||||||
init_action(notice_act, logs::level::notice);
|
init_action(notice_act, logs::level::notice);
|
||||||
init_action(trace_act, logs::level::trace);
|
init_action(trace_act, logs::level::trace);
|
||||||
|
|
||||||
|
menu.addAction(copy);
|
||||||
|
menu.addSeparator();
|
||||||
menu.addAction(open);
|
menu.addAction(open);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(save);
|
menu.addAction(save);
|
||||||
@ -128,6 +132,11 @@ void log_viewer::show_context_menu(const QPoint& pos)
|
|||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(clear);
|
menu.addAction(clear);
|
||||||
|
|
||||||
|
connect(copy, &QAction::triggered, this, [this]()
|
||||||
|
{
|
||||||
|
m_log_text->copy();
|
||||||
|
});
|
||||||
|
|
||||||
connect(clear, &QAction::triggered, this, [this]()
|
connect(clear, &QAction::triggered, this, [this]()
|
||||||
{
|
{
|
||||||
m_log_text->clear();
|
m_log_text->clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user