-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontextmenu.cpp
More file actions
128 lines (100 loc) · 2.97 KB
/
contextmenu.cpp
File metadata and controls
128 lines (100 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include "contextmenu.h"
ContextMenu::ContextMenu(QObject *parent) : QObject(parent)
{
menu = new QMenu();
newMenu = new QMenu("New");
OpenAction = new QAction(tr("&Open"), this);
OpenAction->setToolTip("Open new folder/file");
PrintAction = new QAction(tr("&Print file"), this);
OpenAction->setToolTip("Print selected file");
NewFileAction = new QAction(tr("&New File"), this);
NewFileAction->setToolTip("Create new file");
NewFolderAction = new QAction(tr("&New Folder"), this);
NewFolderAction->setToolTip("Create new folder");
CutAction = new QAction(tr("&Cut"), this);
CutAction->setToolTip("Cut folder/file");
CopyToClipboardAction = new QAction(tr("&Copy files to clipboard"), this);
CopyToClipboardAction->setToolTip("Copy files to clipboard");
CopyAction = new QAction(tr("&Copy"), this);
CopyAction->setToolTip("Copy file/folder to another place");
PasteAction = new QAction(tr("&Paste"), this);
PasteAction->setToolTip("Paste file/folder in selected folder");
PasteToRootAction = new QAction(tr("&Paste to root"), this);
PasteToRootAction->setToolTip("Paste file/folder in current folder");
DeleteAction = new QAction(tr("&Delete"), this);
DeleteAction->setToolTip("Delete file/folder");
RenameAction = new QAction(tr("&Rename"), this);
RenameAction->setToolTip("Rename file/folder");
InfoAction = new QAction(tr("&Properties"), this);
InfoAction->setToolTip("Show info about file/folder");
newMenu->addAction(NewFileAction);
newMenu->addAction(NewFolderAction);
menu->addAction(OpenAction);
menu->addAction(PrintAction);
menu->addMenu(newMenu);
menu->addAction(CutAction);
menu->addAction(CopyAction);
menu->addAction(CopyToClipboardAction);
menu->addAction(PasteAction);
menu->addAction(PasteToRootAction);
menu->addAction(DeleteAction);
menu->addAction(RenameAction);
menu->addAction(InfoAction);
}
ContextMenu::~ContextMenu()
{
delete newMenu;
delete menu;
}
QAction *ContextMenu::getOpenAction() const
{
return OpenAction;
}
QAction *ContextMenu::getPrintAction() const
{
return PrintAction;
}
QAction *ContextMenu::getNewFileAction() const
{
return NewFileAction;
}
QAction *ContextMenu::getNewFolderAction() const
{
return NewFolderAction;
}
QAction *ContextMenu::getCutAction() const
{
return CutAction;
}
QAction *ContextMenu::getCopyAction() const
{
return CopyAction;
}
QAction *ContextMenu::getCopyToClipboardAction() const
{
return CopyToClipboardAction;
}
QAction *ContextMenu::getPasteAction() const
{
return PasteAction;
}
QAction *ContextMenu::getPasteToRootAction() const
{
return PasteToRootAction;
}
QAction *ContextMenu::getDeleteAction() const
{
return DeleteAction;
}
QAction *ContextMenu::getRenameAction() const
{
return RenameAction;
}
QAction *ContextMenu::getInfoAction() const
{
return InfoAction;
}
QMenu *ContextMenu::getMenu() const
{
return menu;
}