-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmallcontextmenu.cpp
More file actions
56 lines (44 loc) · 1.27 KB
/
smallcontextmenu.cpp
File metadata and controls
56 lines (44 loc) · 1.27 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
#include "smallcontextmenu.h"
SmallContextMenu::SmallContextMenu(QObject *parent) : QObject(parent)
{
menu = new QMenu();
newMenu = new QMenu("New");
NewFileAction = new QAction(tr("&New File"), this);
NewFileAction->setToolTip("Create new file");
NewFolderAction = new QAction(tr("&New Folder"), this);
NewFolderAction->setToolTip("Create new folder");
PasteToRootAction = new QAction(tr("&Paste to root"), this);
PasteToRootAction->setToolTip("Paste file/folder in current folder");
InfoAction = new QAction(tr("&Properties"), this);
InfoAction->setToolTip("Show info about file/folder");
newMenu->addAction(NewFileAction);
newMenu->addAction(NewFolderAction);
menu->addMenu(newMenu);
menu->addAction(PasteToRootAction);
menu->addAction(InfoAction);
}
SmallContextMenu::~SmallContextMenu()
{
delete newMenu;
delete menu;
}
QAction *SmallContextMenu::getNewFileAction() const
{
return NewFileAction;
}
QAction *SmallContextMenu::getNewFolderAction() const
{
return NewFolderAction;
}
QAction *SmallContextMenu::getPasteToRootAction() const
{
return PasteToRootAction;
}
QAction *SmallContextMenu::getInfoAction() const
{
return InfoAction;
}
QMenu *SmallContextMenu::getMenu() const
{
return menu;
}