60 QMenu itemContextMenu;
62 QAction openAction(tr(
"Open",
"Text on a menu item the user presses to open a file/image"));
63 itemContextMenu.addAction(&openAction);
64 connect(&openAction, &QAction::triggered, [
this]() {
68 QAction openInDefaultViewer(tr(
"Open in viewer",
"Text on a menu item the user presses to open an image/piece of media in a viewer"));
69 itemContextMenu.addAction(&openInDefaultViewer);
70 connect(&openInDefaultViewer, &QAction::triggered, [
this]() {
74 QAction revealInDefaultExplorer(tr(
"Reveal in file explorer",
"Text on a menu item the user presses to open an image/piece of media in a file viewer/explorer"));
75 itemContextMenu.addAction(&revealInDefaultExplorer);
76 connect(&revealInDefaultExplorer, &QAction::triggered, [
this]() {
80 QAction copyToClipboard(tr(
"Copy file path to clipboard",
"Text on a menu item the user selects to copy a file path to the copy-paste clipboard"));
81 itemContextMenu.addAction(©ToClipboard);
82 connect(©ToClipboard, &QAction::triggered, [
this]() {
86 QAction removalAction(tr(
"Remove from list",
"Text on a menu item the user presses to remove an item from a list of items"));
87 itemContextMenu.addAction(&removalAction);
88 connect(&removalAction, &QAction::triggered, [
this]() {
92 itemContextMenu.exec(e->globalPos());
bool openInDefaultApplication(const std::string &path)
openInDefaultApplication Opens the given path in the default application.
Definition: util.cpp:219
bool revealInDefaultApplication(const std::string &path)
revealInDefaultApplication Reveals the given path in the parent folder (or path with the filename tri...
Definition: util.cpp:224
void setGlobalClipboardText(const std::string &text)
setClipboardText Sets the global system clipboard text.
Definition: util.cpp:240