1 /*
2  * Copyright (c) 2009 Lukáš Tvrdý (lukast.dev@gmail.com)
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
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.
13  *
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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 #include "kis_grid_paintop_settings_widget.h"
19 
20 #include "kis_gridop_option.h"
21 #include "kis_grid_paintop_settings.h"
22 #include "kis_grid_shape_option.h"
23 
24 #include <kis_color_option.h>
25 
26 #include <kis_paintop_settings_widget.h>
27 #include <kis_paint_action_type_option.h>
28 #include <kis_compositeop_option.h>
29 #include <klocalizedstring.h>
30 
KisGridPaintOpSettingsWidget(QWidget * parent)31 KisGridPaintOpSettingsWidget:: KisGridPaintOpSettingsWidget(QWidget* parent)
32     : KisPaintOpSettingsWidget(parent)
33 {
34     m_gridOption =  new KisGridOpOption();
35     m_gridShapeOption = new KisGridShapeOption();
36     m_ColorOption = new KisColorOption();
37 
38     addPaintOpOption(m_gridOption, i18n("Brush size"));
39     addPaintOpOption(m_gridShapeOption, i18n("Particle type"));
40     addPaintOpOption(new KisCompositeOpOption(true), i18n("Blending Mode"));
41     addPaintOpOption(m_ColorOption, i18n("Color options"));
42     addPaintOpOption(new KisPaintActionTypeOption(), i18n("Painting Mode"));
43 }
44 
~KisGridPaintOpSettingsWidget()45 KisGridPaintOpSettingsWidget::~ KisGridPaintOpSettingsWidget()
46 {
47 }
48 
configuration() const49 KisPropertiesConfigurationSP  KisGridPaintOpSettingsWidget::configuration() const
50 {
51     KisGridPaintOpSettings* config = new KisGridPaintOpSettings();
52     config->setOptionsWidget(const_cast<KisGridPaintOpSettingsWidget*>(this));
53     config->setProperty("paintop", "gridbrush"); // XXX: make this a const id string
54     writeConfiguration(config);
55     return config;
56 }
57