2 * This file is part of NixNote
\r
3 * Copyright 2009 Randy Baumgarte
\r
5 * This file may be licensed under the terms of of the
\r
6 * GNU General Public License Version 2 (the ``GPL'').
\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
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
22 //**********************************************
\r
23 //**********************************************
\r
24 //* This dialog is the debugging information
\r
25 //* page used in the Edit/Preferences dialog.
\r
26 //* It is the spelling dialog.
\r
27 //**********************************************
\r
28 //**********************************************
\r
29 package cx.fbn.nevernote.dialog;
\r
31 import com.swabunga.spell.engine.Configuration;
\r
32 import com.trolltech.qt.gui.QCheckBox;
\r
33 import com.trolltech.qt.gui.QVBoxLayout;
\r
34 import com.trolltech.qt.gui.QWidget;
\r
36 import cx.fbn.nevernote.Global;
\r
38 public class ConfigSpellPage extends QWidget {
\r
41 private final QCheckBox ignoreDigitWords;
\r
42 private final QCheckBox ignoreInternetAddresses;
\r
43 private final QCheckBox ignoreMixedCase;
\r
44 private final QCheckBox ignoreUpperCase;
\r
45 private final QCheckBox ignoreSentenceCapitalization;
\r
48 public ConfigSpellPage(QWidget parent) {
\r
49 ignoreDigitWords = new QCheckBox(tr("Ignore words with numbers in them"));
\r
50 ignoreInternetAddresses = new QCheckBox(tr("Ignore internet addresses (i.e. http:// ftp://)"));
\r
51 ignoreMixedCase = new QCheckBox(tr("Ignore words with upper and lower cased letters"));
\r
52 ignoreUpperCase = new QCheckBox(tr("Ignore upper cased words"));
\r
53 ignoreSentenceCapitalization = new QCheckBox(tr("Ignore that sentences should begin with a capital letter"));
\r
55 setIgnoreDigitWords(Global.getSpellSetting(Configuration.SPELL_IGNOREDIGITWORDS));
\r
56 setIgnoreInternetAddresses(Global.getSpellSetting(Configuration.SPELL_IGNOREINTERNETADDRESSES));
\r
57 setIgnoreMixedCase(Global.getSpellSetting(Configuration.SPELL_IGNOREMIXEDCASE));
\r
58 setIgnoreUpperCase(Global.getSpellSetting(Configuration.SPELL_IGNOREUPPERCASE));
\r
59 setIgnoreSentenceCapitalization(Global.getSpellSetting(Configuration.SPELL_IGNORESENTENCECAPITALIZATION));
\r
61 QVBoxLayout mainLayout = new QVBoxLayout();
\r
62 mainLayout.addWidget(ignoreDigitWords);
\r
63 mainLayout.addWidget(ignoreInternetAddresses);
\r
64 mainLayout.addWidget(ignoreMixedCase);
\r
65 mainLayout.addWidget(ignoreUpperCase);
\r
66 mainLayout.addWidget(ignoreSentenceCapitalization);
\r
67 mainLayout.addStretch(1);
\r
68 setLayout(mainLayout);
\r
71 //****************************************
\r
72 //* Getter/Setter for ignore digit words *
\r
73 //****************************************
\r
74 public boolean getIgnoreDigitWords() {
\r
75 return ignoreDigitWords.isChecked();
\r
77 public void setIgnoreDigitWords(boolean value) {
\r
78 ignoreDigitWords.setChecked(value);
\r
81 //***********************************************
\r
82 //* Getter/Setter for ignore internet addresses *
\r
83 //***********************************************
\r
84 public boolean getIgnoreInternetAddresses() {
\r
85 return ignoreInternetAddresses.isChecked();
\r
87 public void setIgnoreInternetAddresses(boolean value) {
\r
88 ignoreInternetAddresses.setChecked(value);
\r
91 //*********************************************
\r
92 //* Getter/Setter for ignore Mixed Case words *
\r
93 //*********************************************
\r
94 public boolean getIgnoreMixedCase() {
\r
95 return ignoreMixedCase.isChecked();
\r
97 public void setIgnoreMixedCase(boolean value) {
\r
98 ignoreMixedCase.setChecked(value);
\r
101 //*********************************************
\r
102 //* Getter/Setter for ignore Mixed Case words *
\r
103 //*********************************************
\r
104 public boolean getIgnoreUpperCase() {
\r
105 return ignoreUpperCase.isChecked();
\r
107 public void setIgnoreUpperCase(boolean value) {
\r
108 ignoreUpperCase.setChecked(value);
\r
111 //****************************************************************
\r
112 //* Getter/Setter for ignore that sentences begin with a capital *
\r
113 //****************************************************************
\r
114 public boolean getIgnoreSentenceCapitalization() {
\r
115 return ignoreSentenceCapitalization.isChecked();
\r
117 public void setIgnoreSentenceCapitalization(boolean value) {
\r
118 ignoreSentenceCapitalization.setChecked(value);
\r