]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionfileopen.cpp
7093bbcbd235e842448511b75e0af063b353cbe4
[architektonas] / src / actions / rs_actionfileopen.cpp
1
2 #include "rs_actionfileopen.h"
3
4 #include "drawing.h"
5
6 RS_ActionFileOpen::RS_ActionFileOpen(RS_EntityContainer & container,
7         RS_GraphicView & graphicView):
8         RS_ActionInterface("File Open", container, graphicView)
9 {
10 }
11
12 RS_ActionFileOpen::~RS_ActionFileOpen()
13 {
14 }
15
16 QAction * RS_ActionFileOpen::createGUIAction(RS2::ActionType /*type*/, QObject * parent)
17 {
18         //icon = QPixmap(fileopen_xpm);
19         QAction * action = new QAction(QIcon(":/res/fileopen2.png"), tr("&Open..."), parent);
20         action->setShortcut(Qt::CTRL + Qt::Key_O);
21 //      QAction* action = new QAction(tr("Open Drawing"),
22 //                                                                      QPixmap::fromMimeSource("fileopen2.png"),
23 //                                                                      tr("&Open..."), CTRL+Key_O, parent);
24         action->setStatusTip(tr("Opens an existing drawing"));
25         return action;
26 }
27
28 void RS_ActionFileOpen::trigger()
29 {
30     /*
31     // Not supported currently
32     RS_DEBUG->print("RS_ActionFileOpen::trigger");
33
34     QString fileName; //= RS_DIALOGFACTORY->requestFileOpenDialog();
35     if (graphic!=NULL && !fileName.isEmpty()) {
36         graphic->open(fileName, );
37 }
38     */
39     finish();
40 }
41
42 void RS_ActionFileOpen::init(int status)
43 {
44     RS_ActionInterface::init(status);
45     trigger();
46 }