2
* Copyright (c) 2008 Lukas Tvrdy <lukast.dev@gmail.com>
3
* Copyright (c) 2010 José Luis Vergara <pentalis@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#include "kis_hatching_preferences.h"
22
#include "ui_wdghatchingpreferences.h"
24
class KisHatchingPreferencesWidget: public QWidget, public Ui::WdgHatchingPreferences
27
KisHatchingPreferencesWidget(QWidget *parent = 0)
33
KisHatchingPreferences::KisHatchingPreferences()
34
: KisPaintOpOption(i18n("Hatching preferences"), KisPaintOpOption::brushCategory(), false)
37
m_options = new KisHatchingPreferencesWidget();
40
connect(m_options->trigonometryAlgebraRadioButton, SIGNAL(clicked(bool)),SIGNAL(sigSettingChanged()));
41
connect(m_options->scratchOffRadioButton, SIGNAL(clicked(bool)),SIGNAL(sigSettingChanged()));
44
connect(m_options->antialiasCheckBox, SIGNAL(clicked(bool)),SIGNAL(sigSettingChanged()));
45
connect(m_options->opaqueBackgroundCheckBox, SIGNAL(clicked(bool)),SIGNAL(sigSettingChanged()));
46
connect(m_options->subpixelPrecisionCheckBox, SIGNAL(clicked(bool)),SIGNAL(sigSettingChanged()));
48
setConfigurationPage(m_options);
51
KisHatchingPreferences::~KisHatchingPreferences()
55
void KisHatchingPreferences::writeOptionSetting(KisPropertiesConfiguration* setting) const
58
setting->setProperty("Hatching/bool_trigonometryalgebra", m_options->trigonometryAlgebraRadioButton->isChecked() );
59
setting->setProperty("Hatching/bool_scratchoff", m_options->scratchOffRadioButton->isChecked() );
62
setting->setProperty("Hatching/bool_antialias", m_options->antialiasCheckBox->isChecked() );
63
setting->setProperty("Hatching/bool_opaquebackground", m_options->opaqueBackgroundCheckBox->isChecked() );
64
setting->setProperty("Hatching/bool_subpixelprecision", m_options->subpixelPrecisionCheckBox->isChecked() );
67
void KisHatchingPreferences::readOptionSetting(const KisPropertiesConfiguration* setting)
70
m_options->trigonometryAlgebraRadioButton->setChecked( setting->getBool("Hatching/bool_trigonometryalgebra") );
71
m_options->scratchOffRadioButton->setChecked( setting->getBool("Hatching/bool_scratchoff") );
74
m_options->antialiasCheckBox->setChecked( setting->getBool("Hatching/bool_antialias") );
75
m_options->opaqueBackgroundCheckBox->setChecked( setting->getBool("Hatching/bool_opaquebackground") );
76
m_options->subpixelPrecisionCheckBox->setChecked( setting->getBool("Hatching/bool_subpixelprecision") );