1 // rs_actionblocksfreezeall.cpp
3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/22/2010 Added this text. :-)
15 #include "rs_actionblocksfreezeall.h"
17 #include "rs_graphic.h"
19 RS_ActionBlocksFreezeAll::RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container,
20 RS_GraphicView& graphicView): RS_ActionInterface("Freeze all Blocks",
21 container, graphicView)
23 this->freeze = freeze;
26 QAction * RS_ActionBlocksFreezeAll::createGUIAction(RS2::ActionType type, QObject* /*parent*/)
28 QAction * action = NULL;
30 if (type == RS2::ActionBlocksFreezeAll)
32 action = new QAction(tr("&Freeze all"), 0);
33 // action= new QAction(tr("Freeze all"), tr("&Freeze all"),
34 // QKeySequence(), NULL);
35 action->setStatusTip(tr("Freeze all blocks"));
37 else if (type == RS2::ActionBlocksDefreezeAll)
39 action = new QAction(tr("&Defreeze all"), 0);
40 // action = new QAction(tr("Defreeze all"), tr("&Defreeze all"),
41 // QKeySequence(), NULL);
42 action->setStatusTip(tr("Defreeze all blocks"));
48 void RS_ActionBlocksFreezeAll::trigger()
50 RS_DEBUG->print("RS_ActionBlocksFreezeAll::trigger");
53 graphic->freezeAllBlocks(freeze);
55 graphicView->redraw();
59 void RS_ActionBlocksFreezeAll::init(int status)
61 RS_ActionInterface::init(status);