-rw-r--r-- | core/pim/addressbook/abview.cpp | 27 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 7 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 2 | ||||
-rw-r--r-- | core/pim/addressbook/version.h | 2 |
4 files changed, 28 insertions, 10 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 7abb45c..6be19f8 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -96,209 +96,220 @@ AbView::~AbView() | |||
96 | delete m_storedDB; | 96 | delete m_storedDB; |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | 100 | ||
101 | void AbView::setView( Views view ) | 101 | void AbView::setView( Views view ) |
102 | { | 102 | { |
103 | odebug << "AbView::setView( Views view )" << oendl; | 103 | odebug << "AbView::setView( Views view )" << oendl; |
104 | m_curr_View = view; | 104 | m_curr_View = view; |
105 | load(); | 105 | load(); |
106 | } | 106 | } |
107 | 107 | ||
108 | void AbView::addEntry( const Opie::OPimContact &newContact ) | 108 | void AbView::addEntry( const Opie::OPimContact &newContact ) |
109 | { | 109 | { |
110 | odebug << "AbView::AddContact" << oendl; | 110 | odebug << "AbView::AddContact" << oendl; |
111 | m_contactdb->add ( newContact ); | 111 | m_contactdb->add ( newContact ); |
112 | load(); | 112 | load(); |
113 | 113 | ||
114 | } | 114 | } |
115 | void AbView::removeEntry( const int UID ) | 115 | void AbView::removeEntry( const int UID ) |
116 | { | 116 | { |
117 | odebug << "AbView;:RemoveContact" << oendl; | 117 | odebug << "AbView;:RemoveContact" << oendl; |
118 | m_contactdb->remove( UID ); | 118 | m_contactdb->remove( UID ); |
119 | load(); | 119 | load(); |
120 | } | 120 | } |
121 | 121 | ||
122 | void AbView::replaceEntry( const Opie::OPimContact &contact ) | 122 | void AbView::replaceEntry( const Opie::OPimContact &contact ) |
123 | { | 123 | { |
124 | odebug << "AbView::ReplaceContact" << oendl; | 124 | odebug << "AbView::ReplaceContact" << oendl; |
125 | m_contactdb->replace( contact ); | 125 | m_contactdb->replace( contact ); |
126 | load(); | 126 | load(); |
127 | 127 | ||
128 | } | 128 | } |
129 | 129 | ||
130 | Opie::OPimContact AbView::currentEntry() | 130 | Opie::OPimContact AbView::currentEntry() |
131 | { | 131 | { |
132 | Opie::OPimContact currentContact; | 132 | Opie::OPimContact currentContact; |
133 | 133 | ||
134 | switch ( (int) m_curr_View ) { | 134 | switch ( (int) m_curr_View ) { |
135 | case TableView: | 135 | case TableView: |
136 | currentContact = m_abTable -> currentEntry(); | 136 | currentContact = m_abTable -> currentEntry(); |
137 | break; | 137 | break; |
138 | case CardView: | 138 | case CardView: |
139 | currentContact = m_ablabel -> currentEntry(); | 139 | currentContact = m_ablabel -> currentEntry(); |
140 | break; | 140 | break; |
141 | } | 141 | } |
142 | m_curr_Contact = currentContact.uid(); | 142 | m_curr_Contact = currentContact.uid(); |
143 | return currentContact; | 143 | return currentContact; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool AbView::save() | 146 | bool AbView::save() |
147 | { | 147 | { |
148 | //odebug << "AbView::Save data" << oendl; | 148 | //odebug << "AbView::Save data" << oendl; |
149 | 149 | ||
150 | return m_contactdb->save(); | 150 | return m_contactdb->save(); |
151 | } | 151 | } |
152 | 152 | ||
153 | void AbView::load() | 153 | void AbView::load() |
154 | { | 154 | { |
155 | odebug << "AbView::Load data" << oendl; | 155 | odebug << "AbView::Load data" << oendl; |
156 | 156 | ||
157 | // Letter Search is stopped at this place | 157 | // Letter Search is stopped at this place |
158 | emit signalClearLetterPicker(); | 158 | emit signalClearLetterPicker(); |
159 | 159 | ||
160 | if ( m_inPersonal ) | 160 | if ( m_curr_category == 0 ) { |
161 | // VCard Backend does not sort.. | 161 | // Show unfiled |
162 | m_list = m_contactdb->allRecords(); | 162 | m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, |
163 | else{ | 163 | Opie::OPimContactAccess::DoNotShowWithCategory, 0 ); |
164 | m_list = m_contactdb->sorted( true, 0, 0, 0 ); | 164 | } elseif ( m_curr_category != -1 ){ |
165 | if ( m_curr_category != -1 ) | 165 | // Just show selected category |
166 | clearForCategory(); | 166 | m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, |
167 | Opie::OPimBase::FilterCategory, m_curr_category ); | ||
168 | } else { | ||
169 | // Show all categories | ||
170 | m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, | ||
171 | Opie::OPimBase::FilterOff, 0 ); | ||
167 | } | 172 | } |
173 | |||
174 | // if ( m_curr_category != -1 ) | ||
175 | // clearForCategory(); | ||
168 | 176 | ||
169 | odebug << "Number of contacts: " << m_list.count() << oendl; | 177 | odebug << "Number of contacts: " << m_list.count() << oendl; |
170 | 178 | ||
171 | updateView( true ); | 179 | updateView( true ); |
172 | 180 | ||
173 | } | 181 | } |
174 | 182 | ||
175 | void AbView::reload() | 183 | void AbView::reload() |
176 | { | 184 | { |
177 | odebug << "AbView::::reload()" << oendl; | 185 | odebug << "AbView::::reload()" << oendl; |
178 | 186 | ||
179 | m_contactdb->reload(); | 187 | m_contactdb->reload(); |
180 | load(); | 188 | load(); |
181 | } | 189 | } |
182 | 190 | ||
183 | void AbView::clear() | 191 | void AbView::clear() |
184 | { | 192 | { |
185 | // :SX | 193 | // :SX |
186 | } | 194 | } |
187 | 195 | ||
188 | void AbView::setShowByCategory( const QString& cat ) | 196 | void AbView::setShowByCategory( const QString& cat ) |
189 | { | 197 | { |
190 | odebug << "AbView::setShowCategory( const QString& cat )" << oendl; | 198 | odebug << "AbView::setShowCategory( const QString& cat )" << oendl; |
191 | 199 | ||
192 | int intCat = 0; | 200 | int intCat = 0; |
193 | 201 | ||
194 | // All (cat == NULL) will be stored as -1 | 202 | // All (cat == NULL) will be stored as -1 |
195 | if ( cat.isNull() ) | 203 | if ( cat.isNull() ) |
196 | intCat = -1; | 204 | intCat = -1; |
197 | else | 205 | else |
198 | intCat = mCat.id("Contacts", cat ); | 206 | intCat = mCat.id("Contacts", cat ); |
199 | 207 | ||
200 | // Just do anything if we really change the category | 208 | // Just do anything if we really change the category |
201 | if ( intCat != m_curr_category ){ | 209 | if ( intCat != m_curr_category ){ |
202 | // odebug << "Categories: Selected " << cat << ".. Number: " | 210 | // odebug << "Categories: Selected " << cat << ".. Number: " |
203 | // << m_curr_category << oendl; | 211 | // << m_curr_category << oendl; |
204 | 212 | ||
205 | m_curr_category = intCat; | 213 | m_curr_category = intCat; |
206 | emit signalClearLetterPicker(); | 214 | emit signalClearLetterPicker(); |
207 | 215 | ||
208 | load(); | 216 | load(); |
209 | } | 217 | } |
210 | 218 | ||
211 | } | 219 | } |
212 | 220 | ||
213 | void AbView::setShowToView( Views view ) | 221 | void AbView::setShowToView( Views view ) |
214 | { | 222 | { |
215 | odebug << "void AbView::setShowToView( View " << view << " )" << oendl; | 223 | odebug << "void AbView::setShowToView( View " << view << " )" << oendl; |
216 | 224 | ||
217 | if ( m_curr_View != view ){ | 225 | if ( m_curr_View != view ){ |
218 | odebug << "Change the View (Category is: " << m_curr_category << ")" << oendl; | 226 | odebug << "Change the View (Category is: " << m_curr_category << ")" << oendl; |
219 | m_prev_View = m_curr_View; | 227 | m_prev_View = m_curr_View; |
220 | m_curr_View = view; | 228 | m_curr_View = view; |
221 | 229 | ||
222 | updateView(); | 230 | updateView(); |
223 | } | 231 | } |
224 | 232 | ||
225 | } | 233 | } |
226 | 234 | ||
227 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) | 235 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) |
228 | { | 236 | { |
229 | odebug << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl; | 237 | odebug << "void AbView::setShowByLetter( " << c << ", " << mode << " )" << oendl; |
230 | 238 | ||
231 | assert( mode < AbConfig::LASTELEMENT ); | 239 | assert( mode < AbConfig::LASTELEMENT ); |
232 | 240 | ||
233 | Opie::OPimContact query; | 241 | Opie::OPimContact query; |
234 | if ( c == 0 ){ | 242 | if ( c == 0 ){ |
235 | load(); | 243 | load(); |
236 | return; | 244 | return; |
237 | }else{ | 245 | }else{ |
238 | // If the current Backend is unable to solve the query, we will | 246 | // If the current Backend is unable to solve the query, we will |
239 | // ignore the request .. | 247 | // ignore the request .. |
240 | if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ) ){ | 248 | if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards | |
249 | Opie::OPimContactAccess::IgnoreCase ) ){ | ||
250 | owarn << "Tried to access queryByExample which is not supported by the current backend!!" << oendl; | ||
251 | owarn << "I have to ignore this access!" << oendl; | ||
241 | return; | 252 | return; |
242 | } | 253 | } |
243 | 254 | ||
244 | switch( mode ){ | 255 | switch( mode ){ |
245 | case AbConfig::LastName: | 256 | case AbConfig::LastName: |
246 | query.setLastName( QString("%1*").arg(c) ); | 257 | query.setLastName( QString("%1*").arg(c) ); |
247 | break; | 258 | break; |
248 | case AbConfig::FileAs: | 259 | case AbConfig::FileAs: |
249 | query.setFileAs( QString("%1*").arg(c) ); | 260 | query.setFileAs( QString("%1*").arg(c) ); |
250 | break; | 261 | break; |
251 | default: | 262 | default: |
252 | owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl | 263 | owarn << "Unknown Searchmode for AbView::setShowByLetter ! -> " << mode << oendl |
253 | << "I will ignore it.." << oendl; | 264 | << "I will ignore it.." << oendl; |
254 | return; | 265 | return; |
255 | } | 266 | } |
256 | m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ); | 267 | m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ); |
257 | if ( m_curr_category != -1 ) | 268 | if ( m_curr_category != -1 ) |
258 | clearForCategory(); | 269 | clearForCategory(); |
259 | m_curr_Contact = 0; | 270 | m_curr_Contact = 0; |
260 | } | 271 | } |
261 | updateView( true ); | 272 | updateView( true ); |
262 | } | 273 | } |
263 | 274 | ||
264 | void AbView::setListOrder( const QValueList<int>& ordered ) | 275 | void AbView::setListOrder( const QValueList<int>& ordered ) |
265 | { | 276 | { |
266 | m_orderedFields = ordered; | 277 | m_orderedFields = ordered; |
267 | if ( m_abTable ){ | 278 | if ( m_abTable ){ |
268 | m_abTable->setOrderedList( ordered ); | 279 | m_abTable->setOrderedList( ordered ); |
269 | m_abTable->refresh(); | 280 | m_abTable->refresh(); |
270 | } | 281 | } |
271 | updateView(); | 282 | updateView(); |
272 | } | 283 | } |
273 | 284 | ||
274 | 285 | ||
275 | QString AbView::showCategory() const | 286 | QString AbView::showCategory() const |
276 | { | 287 | { |
277 | return mCat.label( "Contacts", m_curr_category ); | 288 | return mCat.label( "Contacts", m_curr_category ); |
278 | } | 289 | } |
279 | 290 | ||
280 | void AbView::showPersonal( bool personal ) | 291 | void AbView::showPersonal( bool personal ) |
281 | { | 292 | { |
282 | odebug << "void AbView::showPersonal( " << personal << " )" << oendl; | 293 | odebug << "void AbView::showPersonal( " << personal << " )" << oendl; |
283 | 294 | ||
284 | if ( personal ){ | 295 | if ( personal ){ |
285 | 296 | ||
286 | if ( m_inPersonal ) | 297 | if ( m_inPersonal ) |
287 | return; | 298 | return; |
288 | 299 | ||
289 | // Now switch to vCard Backend and load data. | 300 | // Now switch to vCard Backend and load data. |
290 | // The current default backend will be stored | 301 | // The current default backend will be stored |
291 | // to avoid unneeded load/stores. | 302 | // to avoid unneeded load/stores. |
292 | m_storedDB = m_contactdb; | 303 | m_storedDB = m_contactdb; |
293 | 304 | ||
294 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, | 305 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
295 | addressbookPersonalVCardName() ); | 306 | addressbookPersonalVCardName() ); |
296 | m_contactdb = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 307 | m_contactdb = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
297 | 308 | ||
298 | m_inPersonal = true; | 309 | m_inPersonal = true; |
299 | m_curr_View = CardView; | 310 | m_curr_View = CardView; |
300 | 311 | ||
301 | }else{ | 312 | }else{ |
302 | 313 | ||
303 | if ( !m_inPersonal ) | 314 | if ( !m_inPersonal ) |
304 | return; | 315 | return; |
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 835038a..0654e1a 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -291,128 +291,135 @@ void AddressbookWindow::slotSetFont( int size ) | |||
291 | m_config.setFontSize( size ); | 291 | m_config.setFontSize( size ); |
292 | 292 | ||
293 | QFont *currentFont; | 293 | QFont *currentFont; |
294 | 294 | ||
295 | switch (size) { | 295 | switch (size) { |
296 | case 0: | 296 | case 0: |
297 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); | 297 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); |
298 | currentFont = new QFont (m_abView->font()); | 298 | currentFont = new QFont (m_abView->font()); |
299 | // abList->resizeRows(currentFont->pixelSize() + 7); :SX | 299 | // abList->resizeRows(currentFont->pixelSize() + 7); :SX |
300 | // abList->resizeRows(); | 300 | // abList->resizeRows(); |
301 | break; | 301 | break; |
302 | case 1: | 302 | case 1: |
303 | m_abView->setFont( *defaultFont ); | 303 | m_abView->setFont( *defaultFont ); |
304 | currentFont = new QFont (m_abView->font()); | 304 | currentFont = new QFont (m_abView->font()); |
305 | // // abList->resizeRows(currentFont->pixelSize() + 7); | 305 | // // abList->resizeRows(currentFont->pixelSize() + 7); |
306 | // abList->resizeRows(); | 306 | // abList->resizeRows(); |
307 | break; | 307 | break; |
308 | case 2: | 308 | case 2: |
309 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); | 309 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); |
310 | currentFont = new QFont (m_abView->font()); | 310 | currentFont = new QFont (m_abView->font()); |
311 | // //abList->resizeRows(currentFont->pixelSize() + 7); | 311 | // //abList->resizeRows(currentFont->pixelSize() + 7); |
312 | // abList->resizeRows(); | 312 | // abList->resizeRows(); |
313 | break; | 313 | break; |
314 | } | 314 | } |
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | void AddressbookWindow::importvCard() { | 319 | void AddressbookWindow::importvCard() { |
320 | QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | 320 | QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); |
321 | if(!str.isEmpty() ){ | 321 | if(!str.isEmpty() ){ |
322 | setDocument((const QString&) str ); | 322 | setDocument((const QString&) str ); |
323 | } | 323 | } |
324 | 324 | ||
325 | } | 325 | } |
326 | void AddressbookWindow::exportvCard() | 326 | void AddressbookWindow::exportvCard() |
327 | { | 327 | { |
328 | odebug << "void AddressbookWindow::exportvCard()" << oendl; | 328 | odebug << "void AddressbookWindow::exportvCard()" << oendl; |
329 | QString filename = Opie::Ui::OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); | 329 | QString filename = Opie::Ui::OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); |
330 | if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ | 330 | if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ |
331 | odebug << " Save to file " << filename << ", (" << filename.length()-1 << ")" << oendl; | 331 | odebug << " Save to file " << filename << ", (" << filename.length()-1 << ")" << oendl; |
332 | Opie::OPimContact curCont = m_abView->currentEntry(); | 332 | Opie::OPimContact curCont = m_abView->currentEntry(); |
333 | if ( !curCont.isEmpty() ){ | 333 | if ( !curCont.isEmpty() ){ |
334 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, | 334 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
335 | filename ); | 335 | filename ); |
336 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); | 336 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); |
337 | if ( access ){ | 337 | if ( access ){ |
338 | access->add( curCont ); | 338 | access->add( curCont ); |
339 | access->save(); | 339 | access->save(); |
340 | } | 340 | } |
341 | delete access; | 341 | delete access; |
342 | }else | 342 | }else |
343 | QMessageBox::critical( 0, "Export VCard", | 343 | QMessageBox::critical( 0, "Export VCard", |
344 | QString( tr( "You have to select a contact !") ) ); | 344 | QString( tr( "You have to select a contact !") ) ); |
345 | 345 | ||
346 | }else | 346 | }else |
347 | QMessageBox::critical( 0, "Export VCard", | 347 | QMessageBox::critical( 0, "Export VCard", |
348 | QString( tr( "You have to set a filename !") ) ); | 348 | QString( tr( "You have to set a filename !") ) ); |
349 | } | 349 | } |
350 | 350 | ||
351 | void AddressbookWindow::setDocument( const QString &filename ) | 351 | void AddressbookWindow::setDocument( const QString &filename ) |
352 | { | 352 | { |
353 | odebug << "void AddressbookWindow::setDocument( " << filename << " )" << oendl; | 353 | odebug << "void AddressbookWindow::setDocument( " << filename << " )" << oendl; |
354 | 354 | ||
355 | // Switch to default backend. This should avoid to import into | ||
356 | // the personal database accidently. | ||
357 | if ( actionPersonal->isOn() ){ | ||
358 | actionPersonal->setOn( false ); | ||
359 | slotPersonalView(); | ||
360 | } | ||
361 | |||
355 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ | 362 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ |
356 | 363 | ||
357 | 364 | ||
358 | 365 | ||
359 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), | 366 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), |
360 | tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), | 367 | tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), |
361 | tr( "&Yes" ), tr( "&No" ), QString::null, | 368 | tr( "&Yes" ), tr( "&No" ), QString::null, |
362 | 0, // Enter == button 0 | 369 | 0, // Enter == button 0 |
363 | 2 ) ) { // Escape == button 2 | 370 | 2 ) ) { // Escape == button 2 |
364 | case 0: | 371 | case 0: |
365 | odebug << "YES clicked" << oendl; | 372 | odebug << "YES clicked" << oendl; |
366 | break; | 373 | break; |
367 | case 1: | 374 | case 1: |
368 | odebug << "NO clicked" << oendl; | 375 | odebug << "NO clicked" << oendl; |
369 | return; | 376 | return; |
370 | break; | 377 | break; |
371 | } | 378 | } |
372 | } | 379 | } |
373 | 380 | ||
374 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, | 381 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
375 | filename ); | 382 | filename ); |
376 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 383 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
377 | Opie::OPimContactAccess::List allList = access->allRecords(); | 384 | Opie::OPimContactAccess::List allList = access->allRecords(); |
378 | odebug << "Found number of contacts in File: " << allList.count() << oendl; | 385 | odebug << "Found number of contacts in File: " << allList.count() << oendl; |
379 | 386 | ||
380 | if ( !allList.count() ) { | 387 | if ( !allList.count() ) { |
381 | QMessageBox::information( this, "Import VCard", | 388 | QMessageBox::information( this, "Import VCard", |
382 | "It was impossible to import\nthe VCard.\n" | 389 | "It was impossible to import\nthe VCard.\n" |
383 | "The VCard may be corrupted!" ); | 390 | "The VCard may be corrupted!" ); |
384 | } | 391 | } |
385 | 392 | ||
386 | bool doAsk = true; | 393 | bool doAsk = true; |
387 | Opie::OPimContactAccess::List::Iterator it; | 394 | Opie::OPimContactAccess::List::Iterator it; |
388 | for ( it = allList.begin(); it != allList.end(); ++it ){ | 395 | for ( it = allList.begin(); it != allList.end(); ++it ){ |
389 | odebug << "Adding Contact from: " << (*it).fullName() << oendl; | 396 | odebug << "Adding Contact from: " << (*it).fullName() << oendl; |
390 | if ( doAsk ){ | 397 | if ( doAsk ){ |
391 | switch( QMessageBox::information( this, tr ( "Add Contact?" ), | 398 | switch( QMessageBox::information( this, tr ( "Add Contact?" ), |
392 | tr( "Do you really want add contact for \n%1?" ) | 399 | tr( "Do you really want add contact for \n%1?" ) |
393 | .arg( (*it).fullName().latin1() ), | 400 | .arg( (*it).fullName().latin1() ), |
394 | tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"), | 401 | tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"), |
395 | 0, // Enter == button 0 | 402 | 0, // Enter == button 0 |
396 | 2 ) ) { // Escape == button 2 | 403 | 2 ) ) { // Escape == button 2 |
397 | case 0: | 404 | case 0: |
398 | odebug << "YES clicked" << oendl; | 405 | odebug << "YES clicked" << oendl; |
399 | m_abView->addEntry( *it ); | 406 | m_abView->addEntry( *it ); |
400 | break; | 407 | break; |
401 | case 1: | 408 | case 1: |
402 | odebug << "NO clicked" << oendl; | 409 | odebug << "NO clicked" << oendl; |
403 | break; | 410 | break; |
404 | case 2: | 411 | case 2: |
405 | odebug << "YesAll clicked" << oendl; | 412 | odebug << "YesAll clicked" << oendl; |
406 | doAsk = false; | 413 | doAsk = false; |
407 | break; | 414 | break; |
408 | } | 415 | } |
409 | }else | 416 | }else |
410 | m_abView->addEntry( *it ); | 417 | m_abView->addEntry( *it ); |
411 | 418 | ||
412 | } | 419 | } |
413 | 420 | ||
414 | delete access; | 421 | delete access; |
415 | } | 422 | } |
416 | 423 | ||
417 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) | 424 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) |
418 | { | 425 | { |
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index 9217e95..7cc61bf 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h | |||
@@ -3,129 +3,129 @@ | |||
3 | ** | 3 | ** |
4 | ** This file is part of Qt Palmtop Environment. | 4 | ** This file is part of Qt Palmtop Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef Addressbook_H | 20 | #ifndef Addressbook_H |
21 | #define Addressbook_H | 21 | #define Addressbook_H |
22 | 22 | ||
23 | // Remove this for OPIE releae 1.0 ! | 23 | // Remove this for OPIE releae 1.0 ! |
24 | // #define __DEBUG_RELEASE | 24 | // #define __DEBUG_RELEASE |
25 | 25 | ||
26 | #include <qmainwindow.h> | 26 | #include <qmainwindow.h> |
27 | #include <qvaluelist.h> | 27 | #include <qvaluelist.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include "ofloatbar.h" | 30 | #include "ofloatbar.h" |
31 | #include "abview.h" | 31 | #include "abview.h" |
32 | #include "abconfig.h" | 32 | #include "abconfig.h" |
33 | 33 | ||
34 | class ContactEditor; | 34 | class ContactEditor; |
35 | class AbLabel; | 35 | class AbLabel; |
36 | class AbTable; | 36 | class AbTable; |
37 | class QToolBar; | 37 | class QToolBar; |
38 | class QPopupMenu; | 38 | class QPopupMenu; |
39 | class QToolButton; | 39 | class QToolButton; |
40 | class QDialog; | 40 | class QDialog; |
41 | class Ir; | 41 | class Ir; |
42 | class QAction; | 42 | class QAction; |
43 | class LetterPicker; | 43 | class LetterPicker; |
44 | 44 | ||
45 | class AddressbookWindow: public QMainWindow | 45 | class AddressbookWindow: public QMainWindow |
46 | { | 46 | { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | public: | 48 | public: |
49 | enum EntryMode { NewEntry=0, EditEntry }; | 49 | enum EntryMode { NewEntry=0, EditEntry }; |
50 | 50 | ||
51 | static QString appName() { return QString::fromLatin1("addressbook"); } | 51 | static QString appName() { return QString::fromLatin1("addressbook"); } |
52 | AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 52 | AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
53 | ~AddressbookWindow(); | 53 | ~AddressbookWindow(); |
54 | 54 | ||
55 | protected: | 55 | protected: |
56 | void resizeEvent( QResizeEvent * e ); | 56 | void resizeEvent( QResizeEvent * e ); |
57 | 57 | ||
58 | void editPersonal(); | 58 | void editPersonal(); |
59 | void editEntry( EntryMode ); | 59 | void editEntry( EntryMode ); |
60 | void closeEvent( QCloseEvent *e ); | 60 | void closeEvent( QCloseEvent *e ); |
61 | bool save(); | 61 | bool save(); |
62 | 62 | ||
63 | public slots: | 63 | public slots: |
64 | void flush(); | 64 | void flush(); |
65 | void reload(); | 65 | void reload(); |
66 | void appMessage(const QCString &, const QByteArray &); | 66 | void appMessage(const QCString &, const QByteArray &); |
67 | void setDocument( const QString & ); | 67 | void setDocument( const QString & ); // Called by obex receiver and internally! |
68 | #ifdef __DEBUG_RELEASE | 68 | #ifdef __DEBUG_RELEASE |
69 | // void slotSave(); | 69 | // void slotSave(); |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | private slots: | 72 | private slots: |
73 | void importvCard(); | 73 | void importvCard(); |
74 | void exportvCard(); | 74 | void exportvCard(); |
75 | void slotListNew(); | 75 | void slotListNew(); |
76 | /* void slotListView(); */ | 76 | /* void slotListView(); */ |
77 | void slotListDelete(); | 77 | void slotListDelete(); |
78 | void slotViewBack(); | 78 | void slotViewBack(); |
79 | void slotViewEdit(); | 79 | void slotViewEdit(); |
80 | void slotPersonalView(); | 80 | void slotPersonalView(); |
81 | void listIsEmpty( bool ); | 81 | void listIsEmpty( bool ); |
82 | /* void slotSettings(); */ | 82 | /* void slotSettings(); */ |
83 | void writeMail(); | 83 | void writeMail(); |
84 | void slotBeam(); | 84 | void slotBeam(); |
85 | void beamDone( Ir * ); | 85 | void beamDone( Ir * ); |
86 | void slotSetCategory( int ); | 86 | void slotSetCategory( int ); |
87 | void slotSetLetter( char ); | 87 | void slotSetLetter( char ); |
88 | void slotUpdateToolbar(); | 88 | void slotUpdateToolbar(); |
89 | void slotSetFont(int); | 89 | void slotSetFont(int); |
90 | 90 | ||
91 | void slotFindOpen(); | 91 | void slotFindOpen(); |
92 | void slotFindClose(); | 92 | void slotFindClose(); |
93 | void slotFind(); | 93 | void slotFind(); |
94 | void slotNotFound(); | 94 | void slotNotFound(); |
95 | void slotWrapAround(); | 95 | void slotWrapAround(); |
96 | 96 | ||
97 | void slotViewSwitched( int ); | 97 | void slotViewSwitched( int ); |
98 | void slotListView(); | 98 | void slotListView(); |
99 | void slotCardView(); | 99 | void slotCardView(); |
100 | 100 | ||
101 | void slotConfig(); | 101 | void slotConfig(); |
102 | 102 | ||
103 | private: | 103 | private: |
104 | void populateCategories(); | 104 | void populateCategories(); |
105 | 105 | ||
106 | QPopupMenu *catMenu; | 106 | QPopupMenu *catMenu; |
107 | QToolBar *listTools; | 107 | QToolBar *listTools; |
108 | QToolButton *deleteButton; | 108 | QToolButton *deleteButton; |
109 | enum Panes { paneList=0, paneView, paneEdit }; | 109 | enum Panes { paneList=0, paneView, paneEdit }; |
110 | ContactEditor *abEditor; | 110 | ContactEditor *abEditor; |
111 | LetterPicker *pLabel; | 111 | LetterPicker *pLabel; |
112 | AbView* m_abView; | 112 | AbView* m_abView; |
113 | QWidget *listContainer; | 113 | QWidget *listContainer; |
114 | 114 | ||
115 | // Searching stuff | 115 | // Searching stuff |
116 | OFloatBar* searchBar; | 116 | OFloatBar* searchBar; |
117 | QLineEdit* searchEdit; | 117 | QLineEdit* searchEdit; |
118 | 118 | ||
119 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; | 119 | QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; |
120 | 120 | ||
121 | int viewMargin; | 121 | int viewMargin; |
122 | 122 | ||
123 | bool syncing; | 123 | bool syncing; |
124 | QFont *defaultFont; | 124 | QFont *defaultFont; |
125 | int m_curFontSize; | 125 | int m_curFontSize; |
126 | 126 | ||
127 | bool isLoading; | 127 | bool isLoading; |
128 | 128 | ||
129 | AbConfig m_config; | 129 | AbConfig m_config; |
130 | 130 | ||
131 | QAction* m_tableViewButton; | 131 | QAction* m_tableViewButton; |
diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index 790aa95..7ce9752 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h | |||
@@ -1,10 +1,10 @@ | |||
1 | #ifndef _VERSION_H_ | 1 | #ifndef _VERSION_H_ |
2 | #define _VERSION_H_ | 2 | #define _VERSION_H_ |
3 | 3 | ||
4 | #define MAINVERSION "1" | 4 | #define MAINVERSION "1" |
5 | #define SUBVERSION "1" | 5 | #define SUBVERSION "1" |
6 | #define PATCHVERSION "0" | 6 | #define PATCHVERSION "1" |
7 | 7 | ||
8 | #define APPNAME "OPIE_ADDRESSBOOK" | 8 | #define APPNAME "OPIE_ADDRESSBOOK" |
9 | 9 | ||
10 | #endif | 10 | #endif |