1
/****************************************************************************
3
** This file is part of the LibreCAD project, a 2D CAD program
5
** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
6
** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
9
** This file may be distributed and/or modified under the terms of the
10
** GNU General Public License version 2 as published by the Free Software
11
** Foundation and appearing in the file gpl-2.0.txt included in the
12
** packaging of this file.
14
** This program is distributed in the hope that it will be useful,
15
** but WITHOUT ANY WARRANTY; without even the implied warranty of
16
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
** GNU General Public License for more details.
19
** You should have received a copy of the GNU General Public License
20
** along with this program; if not, write to the Free Software
21
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
** This copyright notice MUST APPEAR in all copies of the script!
25
**********************************************************************/
27
#include "rs_actionlayersfreezeall.h"
30
#include "rs_graphic.h"
34
RS_ActionLayersFreezeAll::RS_ActionLayersFreezeAll(bool freeze,
35
RS_EntityContainer& container,
36
RS_GraphicView& graphicView)
37
:RS_ActionInterface("Freeze all Layers",
38
container, graphicView) {
40
this->freeze = freeze;
43
QAction* RS_ActionLayersFreezeAll::createGUIAction(RS2::ActionType type, QObject* /*parent*/) {
46
if (type==RS2::ActionLayersFreezeAll) {
48
action = new QAction(tr("&Hide all"), NULL);
49
//action->zetStatusTip(tr("Freeze all layers"));
50
action->setIcon(QIcon(":/ui/hiddenblock.png"));
52
else if (type==RS2::ActionLayersDefreezeAll) {
54
action = new QAction(tr("&Show all"), NULL);
55
//action->zetStatusTip(tr("Defreeze all layers"));
56
action->setIcon(QIcon(":/ui/visibleblock.png"));
62
void RS_ActionLayersFreezeAll::trigger() {
63
RS_DEBUG->print("RS_ActionLayersFreezeAll::trigger");
65
//RS_Layer* layer = graphic->getActiveLayer();
66
graphic->freezeAllLayers(freeze);
73
void RS_ActionLayersFreezeAll::init(int status) {
74
RS_ActionInterface::init(status);