Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: add copy context menu entry to log viewer #13362

Merged
merged 1 commit into from Feb 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions rpcs3/rpcs3qt/log_viewer.cpp
Expand Up @@ -7,6 +7,7 @@

#include <QActionGroup>
#include <QApplication>
#include <QClipboard>
#include <QMenu>
#include <QFile>
#include <QFileDialog>
Expand Down Expand Up @@ -61,6 +62,7 @@ void log_viewer::show_context_menu(const QPoint& pos)
{
QMenu menu;
QAction* clear = new QAction(tr("&Clear"));
QAction* copy = new QAction(tr("&Copy"));
QAction* open = new QAction(tr("&Open log file"));
QAction* save = new QAction(tr("&Save filtered log"));
QAction* filter = new QAction(tr("&Filter log"));
Expand Down Expand Up @@ -110,6 +112,8 @@ void log_viewer::show_context_menu(const QPoint& pos)
init_action(notice_act, logs::level::notice);
init_action(trace_act, logs::level::trace);

menu.addAction(copy);
menu.addSeparator();
menu.addAction(open);
menu.addSeparator();
menu.addAction(save);
Expand All @@ -128,6 +132,11 @@ void log_viewer::show_context_menu(const QPoint& pos)
menu.addSeparator();
menu.addAction(clear);

connect(copy, &QAction::triggered, this, [this]()
{
m_log_text->copy();
});

connect(clear, &QAction::triggered, this, [this]()
{
m_log_text->clear();
Expand Down