mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-25 05:17:44 +00:00
Add action to Data Explorer to copy the file path
This commit is contained in:
parent
002a460379
commit
ce29debf24
1 changed files with 9 additions and 0 deletions
|
@ -4,6 +4,8 @@
|
|||
#include "filetreewindow.h"
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <QClipboard>
|
||||
#include <QGuiApplication>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
|
@ -63,6 +65,13 @@ FileTreeWindow::FileTreeWindow(HashDatabase &database, const QString &gamePath,
|
|||
Q_EMIT extractFile(path);
|
||||
});
|
||||
|
||||
auto copyFilePathAction = menu->addAction(i18nc("@action:inmenu", "Copy file path"));
|
||||
copyFilePathAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy-symbolic")));
|
||||
connect(copyFilePathAction, &QAction::triggered, this, [this, path] {
|
||||
QClipboard *clipboard = QGuiApplication::clipboard();
|
||||
clipboard->setText(path);
|
||||
});
|
||||
|
||||
menu->exec(treeWidget->mapToGlobal(pos));
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue