mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Qt: Add copy to clipboard for game data
This commit is contained in:
parent
d013524ea9
commit
79dd62cda2
1 changed files with 13 additions and 0 deletions
|
@ -21,6 +21,8 @@
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
|
|
||||||
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
|
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
|
||||||
|
|
||||||
|
@ -639,6 +641,9 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
|
||||||
QAction* downloadCompat = myMenu.addAction(tr("&Download Compatibility Database"));
|
QAction* downloadCompat = myMenu.addAction(tr("&Download Compatibility Database"));
|
||||||
myMenu.addSeparator();
|
myMenu.addSeparator();
|
||||||
QAction* editNotes = myMenu.addAction(tr("&Edit Tooltip Notes"));
|
QAction* editNotes = myMenu.addAction(tr("&Edit Tooltip Notes"));
|
||||||
|
QMenu* infoMenu = myMenu.addMenu(tr("&Copy Info"));
|
||||||
|
QAction* copyName = infoMenu->addAction(tr("&Copy Name"));
|
||||||
|
QAction* copySerial = infoMenu->addAction(tr("&Copy Serial"));
|
||||||
|
|
||||||
const std::string config_base_dir = fs::get_config_dir() + "data/" + currGame.serial;
|
const std::string config_base_dir = fs::get_config_dir() + "data/" + currGame.serial;
|
||||||
|
|
||||||
|
@ -749,6 +754,14 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
connect(copyName, &QAction::triggered, [=]
|
||||||
|
{
|
||||||
|
QApplication::clipboard()->setText(name);
|
||||||
|
});
|
||||||
|
connect(copySerial, &QAction::triggered, [=]
|
||||||
|
{
|
||||||
|
QApplication::clipboard()->setText(serial);
|
||||||
|
});
|
||||||
|
|
||||||
//Disable options depending on software category
|
//Disable options depending on software category
|
||||||
QString category = qstr(currGame.category);
|
QString category = qstr(currGame.category);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue