author | drw <drw> | 2005-02-06 23:12:25 (UTC) |
---|---|---|
committer | drw <drw> | 2005-02-06 23:12:25 (UTC) |
commit | 5652634e4ff03370564925ce0856b260c001dc0f (patch) (unidiff) | |
tree | 614cbdec8ff9f4f674a9cb4e5caf44cce1def4f8 /core/pim/addressbook/abconfig.cpp | |
parent | 266d71ee80151b3c97671acc95275aa65b682388 (diff) | |
download | opie-5652634e4ff03370564925ce0856b260c001dc0f.zip opie-5652634e4ff03370564925ce0856b260c001dc0f.tar.gz opie-5652634e4ff03370564925ce0856b260c001dc0f.tar.bz2 |
Convert to OPimMainWindow and UI tweaks. There is still a couple items yet to do...
Diffstat (limited to 'core/pim/addressbook/abconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abconfig.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/pim/addressbook/abconfig.cpp b/core/pim/addressbook/abconfig.cpp index a3fd222..2583327 100644 --- a/core/pim/addressbook/abconfig.cpp +++ b/core/pim/addressbook/abconfig.cpp | |||
@@ -10,25 +10,25 @@ AbConfig::AbConfig( ): | |||
10 | m_useRegExp( false ), | 10 | m_useRegExp( false ), |
11 | m_beCaseSensitive( false ), | 11 | m_beCaseSensitive( false ), |
12 | m_fontSize( 1 ), | 12 | m_fontSize( 1 ), |
13 | m_barPos( QMainWindow::Top ), | 13 | m_barPos( QMainWindow::Top ), |
14 | m_fixedBars( true ), | 14 | m_fixedBars( true ), |
15 | m_lpSearchMode( LastName ), | 15 | m_lpSearchMode( LastName ), |
16 | m_changed( false ) | 16 | m_changed( false ) |
17 | { | 17 | { |
18 | } | 18 | } |
19 | 19 | ||
20 | AbConfig::~AbConfig() | 20 | AbConfig::~AbConfig() |
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
24 | bool AbConfig::useRegExp() const | 24 | bool AbConfig::useRegExp() const |
25 | { | 25 | { |
26 | return m_useRegExp; | 26 | return m_useRegExp; |
27 | } | 27 | } |
28 | bool AbConfig::useWildCards() const | 28 | bool AbConfig::useWildCards() const |
29 | { | 29 | { |
30 | return !m_useRegExp; | 30 | return !m_useRegExp; |
31 | } | 31 | } |
32 | bool AbConfig::useQtMail() const | 32 | bool AbConfig::useQtMail() const |
33 | { | 33 | { |
34 | return m_useQtMail; | 34 | return m_useQtMail; |
@@ -57,24 +57,29 @@ QMainWindow::ToolBarDock AbConfig::getToolBarPos() const | |||
57 | } | 57 | } |
58 | 58 | ||
59 | bool AbConfig::fixedBars() const | 59 | bool AbConfig::fixedBars() const |
60 | { | 60 | { |
61 | return m_fixedBars; | 61 | return m_fixedBars; |
62 | } | 62 | } |
63 | 63 | ||
64 | AbConfig::LPSearchMode AbConfig::letterPickerSearch() const | 64 | AbConfig::LPSearchMode AbConfig::letterPickerSearch() const |
65 | { | 65 | { |
66 | return ( AbConfig::LPSearchMode ) m_lpSearchMode; | 66 | return ( AbConfig::LPSearchMode ) m_lpSearchMode; |
67 | } | 67 | } |
68 | 68 | ||
69 | const QString &AbConfig::category() const | ||
70 | { | ||
71 | return m_category; | ||
72 | } | ||
73 | |||
69 | void AbConfig::setUseRegExp( bool v ) | 74 | void AbConfig::setUseRegExp( bool v ) |
70 | { | 75 | { |
71 | m_useRegExp = v ; | 76 | m_useRegExp = v ; |
72 | m_changed = true; | 77 | m_changed = true; |
73 | } | 78 | } |
74 | void AbConfig::setUseWildCards( bool v ) | 79 | void AbConfig::setUseWildCards( bool v ) |
75 | { | 80 | { |
76 | m_useRegExp = !v; | 81 | m_useRegExp = !v; |
77 | m_changed = true; | 82 | m_changed = true; |
78 | } | 83 | } |
79 | void AbConfig::setBeCaseSensitive( bool v ) | 84 | void AbConfig::setBeCaseSensitive( bool v ) |
80 | { | 85 | { |
@@ -112,29 +117,37 @@ void AbConfig::setToolBarDock( const QMainWindow::ToolBarDock v ) | |||
112 | void AbConfig::setFixedBars( const bool fixed ) | 117 | void AbConfig::setFixedBars( const bool fixed ) |
113 | { | 118 | { |
114 | m_fixedBars = fixed; | 119 | m_fixedBars = fixed; |
115 | m_changed = true; | 120 | m_changed = true; |
116 | } | 121 | } |
117 | 122 | ||
118 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) | 123 | void AbConfig::setLetterPickerSearch( const AbConfig::LPSearchMode mode ) |
119 | { | 124 | { |
120 | m_lpSearchMode = mode; | 125 | m_lpSearchMode = mode; |
121 | m_changed = true; | 126 | m_changed = true; |
122 | } | 127 | } |
123 | 128 | ||
129 | void AbConfig::setCategory( const QString &cat ) | ||
130 | { | ||
131 | m_category = cat; | ||
132 | } | ||
133 | |||
124 | void AbConfig::load() | 134 | void AbConfig::load() |
125 | { | 135 | { |
126 | // Read Config settings | 136 | // Read Config settings |
127 | Config cfg("AddressBook"); | 137 | Config cfg("AddressBook"); |
128 | 138 | ||
139 | cfg.setGroup( "View" ); | ||
140 | m_category = cfg.readEntry( "Category", "All" ); | ||
141 | |||
129 | cfg.setGroup("Font"); | 142 | cfg.setGroup("Font"); |
130 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); | 143 | m_fontSize = cfg.readNumEntry( "fontSize", 1 ); |
131 | 144 | ||
132 | cfg.setGroup("Search"); | 145 | cfg.setGroup("Search"); |
133 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); | 146 | m_useRegExp = cfg.readBoolEntry( "useRegExp", false ); |
134 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); | 147 | m_beCaseSensitive = cfg.readBoolEntry( "caseSensitive", false ); |
135 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FileAs ); | 148 | m_lpSearchMode = cfg.readNumEntry( "lpSearchMode", FileAs ); |
136 | 149 | ||
137 | cfg.setGroup("Mail"); | 150 | cfg.setGroup("Mail"); |
138 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); | 151 | m_useQtMail = cfg.readBoolEntry( "useQtMail", true ); |
139 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); | 152 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); |
140 | 153 | ||
@@ -157,24 +170,27 @@ void AbConfig::load() | |||
157 | 170 | ||
158 | cfg.setGroup("ToolBar"); | 171 | cfg.setGroup("ToolBar"); |
159 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); | 172 | m_barPos = cfg.readNumEntry( "Position", QMainWindow::Top ); |
160 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); | 173 | m_fixedBars= cfg.readBoolEntry( "fixedBars", true ); |
161 | 174 | ||
162 | m_changed = false; | 175 | m_changed = false; |
163 | } | 176 | } |
164 | 177 | ||
165 | void AbConfig::save() | 178 | void AbConfig::save() |
166 | { | 179 | { |
167 | if ( m_changed ){ | 180 | if ( m_changed ){ |
168 | Config cfg("AddressBook"); | 181 | Config cfg("AddressBook"); |
182 | cfg.setGroup( "View" ); | ||
183 | cfg.writeEntry( "Category", m_category ); | ||
184 | |||
169 | cfg.setGroup("Font"); | 185 | cfg.setGroup("Font"); |
170 | cfg.writeEntry("fontSize", m_fontSize); | 186 | cfg.writeEntry("fontSize", m_fontSize); |
171 | 187 | ||
172 | cfg.setGroup("Search"); | 188 | cfg.setGroup("Search"); |
173 | cfg.writeEntry("useRegExp", m_useRegExp); | 189 | cfg.writeEntry("useRegExp", m_useRegExp); |
174 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); | 190 | cfg.writeEntry("caseSensitive", m_beCaseSensitive); |
175 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); | 191 | cfg.writeEntry("lpSearchMode", m_lpSearchMode ); |
176 | 192 | ||
177 | cfg.setGroup("Mail"); | 193 | cfg.setGroup("Mail"); |
178 | cfg.writeEntry( "useQtMail", m_useQtMail ); | 194 | cfg.writeEntry( "useQtMail", m_useQtMail ); |
179 | cfg.writeEntry( "useOpieMail", m_useOpieMail); | 195 | cfg.writeEntry( "useOpieMail", m_useOpieMail); |
180 | 196 | ||
@@ -184,27 +200,27 @@ void AbConfig::save() | |||
184 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); | 200 | cfg.writeEntry( "ContactID_"+QString::number(i), m_ordered[i] ); |
185 | } | 201 | } |
186 | 202 | ||
187 | cfg.setGroup("ToolBar"); | 203 | cfg.setGroup("ToolBar"); |
188 | cfg.writeEntry( "Position", m_barPos ); | 204 | cfg.writeEntry( "Position", m_barPos ); |
189 | cfg.writeEntry( "fixedBars", m_fixedBars ); | 205 | cfg.writeEntry( "fixedBars", m_fixedBars ); |
190 | 206 | ||
191 | cfg.setGroup("Version"); | 207 | cfg.setGroup("Version"); |
192 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); | 208 | cfg.writeEntry( "AppName", APPNAME + QString(" V" ) + MAINVERSION + QString(".") + SUBVERSION + QString(".") + PATCHVERSION); |
193 | cfg.writeEntry( "Mainversion", MAINVERSION ); | 209 | cfg.writeEntry( "Mainversion", MAINVERSION ); |
194 | cfg.writeEntry( "SubVersion", SUBVERSION ); | 210 | cfg.writeEntry( "SubVersion", SUBVERSION ); |
195 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); | 211 | cfg.writeEntry( "PatchVersion", PATCHVERSION ); |
196 | 212 | ||
197 | } | 213 | } |
198 | 214 | ||
199 | } | 215 | } |
200 | 216 | ||
201 | void AbConfig::operator= ( const AbConfig& cnf ) | 217 | void AbConfig::operator= ( const AbConfig& cnf ) |
202 | { | 218 | { |
203 | m_useQtMail = cnf.m_useQtMail; | 219 | m_useQtMail = cnf.m_useQtMail; |
204 | m_useOpieMail = cnf.m_useOpieMail; | 220 | m_useOpieMail = cnf.m_useOpieMail; |
205 | m_useRegExp = cnf.m_useRegExp; | 221 | m_useRegExp = cnf.m_useRegExp; |
206 | m_beCaseSensitive = cnf.m_beCaseSensitive; | 222 | m_beCaseSensitive = cnf.m_beCaseSensitive; |
207 | m_fontSize = cnf.m_fontSize; | 223 | m_fontSize = cnf.m_fontSize; |
208 | m_ordered = cnf.m_ordered; | 224 | m_ordered = cnf.m_ordered; |
209 | m_barPos = cnf.m_barPos; | 225 | m_barPos = cnf.m_barPos; |
210 | m_fixedBars = cnf.m_fixedBars; | 226 | m_fixedBars = cnf.m_fixedBars; |