OSDN Git Service

Show User Name
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / dialog / ConfigSpellPage.java
1 /*\r
2  * This file is part of NeverNote \r
3  * Copyright 2009 Randy Baumgarte\r
4  * \r
5  * This file may be licensed under the terms of of the\r
6  * GNU General Public License Version 2 (the ``GPL'').\r
7  *\r
8  * Software distributed under the License is distributed\r
9  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either\r
10  * express or implied. See the GPL for the specific language\r
11  * governing rights and limitations.\r
12  *\r
13  * You should have received a copy of the GPL along with this\r
14  * program. If not, go to http://www.gnu.org/licenses/gpl.html\r
15  * or write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
17  *\r
18 */\r
19 \r
20 package cx.fbn.nevernote.dialog;\r
21 \r
22 import com.swabunga.spell.engine.Configuration;\r
23 import com.trolltech.qt.gui.QCheckBox;\r
24 import com.trolltech.qt.gui.QVBoxLayout;\r
25 import com.trolltech.qt.gui.QWidget;\r
26 \r
27 import cx.fbn.nevernote.Global;\r
28 \r
29 public class ConfigSpellPage extends QWidget {\r
30         \r
31 \r
32         private final QCheckBox ignoreDigitWords;\r
33         private final QCheckBox ignoreInternetAddresses;\r
34         private final QCheckBox ignoreMixedCase;\r
35         private final QCheckBox ignoreUpperCase;\r
36         private final QCheckBox ignoreSentenceCapitalization;\r
37 \r
38         \r
39         public ConfigSpellPage(QWidget parent) {        \r
40                 ignoreDigitWords = new QCheckBox(tr("Ignore words with numbers in them"));\r
41                 ignoreInternetAddresses = new QCheckBox(tr("Ignore internet addresses (i.e. http:// ftp://)"));\r
42                 ignoreMixedCase = new QCheckBox(tr("Ignore words with upper and lower cased letters"));\r
43                 ignoreUpperCase = new QCheckBox(tr("Ignore upper cased words"));\r
44                 ignoreSentenceCapitalization = new QCheckBox(tr("Ignore that sentences should begin with a capital letter"));\r
45                 \r
46                 setIgnoreDigitWords(Global.getSpellSetting(Configuration.SPELL_IGNOREDIGITWORDS));\r
47                 setIgnoreInternetAddresses(Global.getSpellSetting(Configuration.SPELL_IGNOREINTERNETADDRESSES));\r
48                 setIgnoreMixedCase(Global.getSpellSetting(Configuration.SPELL_IGNOREMIXEDCASE));\r
49                 setIgnoreUpperCase(Global.getSpellSetting(Configuration.SPELL_IGNOREUPPERCASE));\r
50                 setIgnoreSentenceCapitalization(Global.getSpellSetting(Configuration.SPELL_IGNORESENTENCECAPITALIZATION));\r
51                 \r
52                 QVBoxLayout mainLayout = new QVBoxLayout();\r
53                 mainLayout.addWidget(ignoreDigitWords);\r
54                 mainLayout.addWidget(ignoreInternetAddresses);\r
55                 mainLayout.addWidget(ignoreMixedCase);\r
56                 mainLayout.addWidget(ignoreUpperCase);\r
57                 mainLayout.addWidget(ignoreSentenceCapitalization);\r
58                 mainLayout.addStretch(1);\r
59                 setLayout(mainLayout);\r
60         }\r
61         \r
62         //****************************************\r
63         //* Getter/Setter for ignore digit words *\r
64         //****************************************\r
65         public boolean getIgnoreDigitWords() {\r
66                 return ignoreDigitWords.isChecked();\r
67         }\r
68         public void setIgnoreDigitWords(boolean value) {\r
69                 ignoreDigitWords.setChecked(value);\r
70         }\r
71         \r
72         //***********************************************\r
73         //* Getter/Setter for ignore internet addresses *\r
74         //***********************************************\r
75         public boolean getIgnoreInternetAddresses() {\r
76                 return ignoreInternetAddresses.isChecked();\r
77         }\r
78         public void setIgnoreInternetAddresses(boolean value) {\r
79                 ignoreInternetAddresses.setChecked(value);\r
80         }\r
81         \r
82         //*********************************************\r
83         //* Getter/Setter for ignore Mixed Case words *\r
84         //*********************************************\r
85         public boolean getIgnoreMixedCase() {\r
86                 return ignoreMixedCase.isChecked();\r
87         }\r
88         public void setIgnoreMixedCase(boolean value) {\r
89                 ignoreMixedCase.setChecked(value);\r
90         }\r
91         \r
92         //*********************************************\r
93         //* Getter/Setter for ignore Mixed Case words *\r
94         //*********************************************\r
95         public boolean getIgnoreUpperCase() {\r
96                 return ignoreUpperCase.isChecked();\r
97         }\r
98         public void setIgnoreUpperCase(boolean value) {\r
99                 ignoreUpperCase.setChecked(value);\r
100         }\r
101         \r
102         //****************************************************************\r
103         //* Getter/Setter for ignore that sentences begin with a capital *\r
104         //****************************************************************\r
105         public boolean getIgnoreSentenceCapitalization() {\r
106                 return ignoreSentenceCapitalization.isChecked();\r
107         }\r
108         public void setIgnoreSentenceCapitalization(boolean value) {\r
109                 ignoreSentenceCapitalization.setChecked(value);\r
110         }\r
111 \r
112 }\r