2
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
#include "wb_editor_layer.h"
22
#include "base/string_utilities.h"
24
LayerEditorBE::LayerEditorBE(bec::GRTManager *grtm, const workbench_physical_LayerRef &layer)
25
: BaseEditor(grtm, layer), _layer(layer)
30
bool LayerEditorBE::should_close_on_delete_of(const std::string &oid)
32
if (_layer.id() == oid || _layer->owner().id() == oid)
39
void LayerEditorBE::set_color(const std::string &color)
41
if (_layer->color() != color)
43
bec::AutoUndoEdit undo(this, _layer, "color");
45
undo.end(_("Change Layer Color"));
50
std::string LayerEditorBE::get_color()
52
return _layer->color();
55
void LayerEditorBE::set_name(const std::string &name)
57
if (_layer->name() != name)
59
bec::AutoUndoEdit undo(this, _layer, "name");
61
undo.end(_("Change Layer Name"));
66
std::string LayerEditorBE::get_name()
68
return _layer->name();