-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 58fbccf..3b2e4b8 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -272,129 +272,129 @@ void AddressbookWindow::slotConfig() | |||
272 | if ( m_curFontSize != m_config.fontSize() ){ | 272 | if ( m_curFontSize != m_config.fontSize() ){ |
273 | qWarning("Font was changed!"); | 273 | qWarning("Font was changed!"); |
274 | m_curFontSize = m_config.fontSize(); | 274 | m_curFontSize = m_config.fontSize(); |
275 | emit slotSetFont( m_curFontSize ); | 275 | emit slotSetFont( m_curFontSize ); |
276 | } | 276 | } |
277 | m_abView -> setListOrder( m_config.orderList() ); | 277 | m_abView -> setListOrder( m_config.orderList() ); |
278 | } | 278 | } |
279 | 279 | ||
280 | delete dlg; | 280 | delete dlg; |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
284 | void AddressbookWindow::slotSetFont( int size ) | 284 | void AddressbookWindow::slotSetFont( int size ) |
285 | { | 285 | { |
286 | qWarning("void AddressbookWindow::slotSetFont( %d )", size); | 286 | qWarning("void AddressbookWindow::slotSetFont( %d )", size); |
287 | 287 | ||
288 | if (size > 2 || size < 0) | 288 | if (size > 2 || size < 0) |
289 | size = 1; | 289 | size = 1; |
290 | 290 | ||
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 = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | 320 | QString str = 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 | 326 | ||
327 | void AddressbookWindow::setDocument( const QString &filename ) | 327 | void AddressbookWindow::setDocument( const QString &filename ) |
328 | { | 328 | { |
329 | qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); | 329 | qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); |
330 | 330 | ||
331 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ | 331 | if ( filename.find(".vcf") != int(filename.length()) - 4 ){ |
332 | 332 | ||
333 | 333 | ||
334 | 334 | ||
335 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), | 335 | switch( QMessageBox::information( this, tr ( "Right file type ?" ), |
336 | tr( "The selected file \n does not end with \".vcf\" \n. Do you really want to open it?" ), | 336 | tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), |
337 | tr( "&Yes" ), tr( "&No" ), QString::null, | 337 | tr( "&Yes" ), tr( "&No" ), QString::null, |
338 | 0, // Enter == button 0 | 338 | 0, // Enter == button 0 |
339 | 2 ) ) { // Escape == button 2 | 339 | 2 ) ) { // Escape == button 2 |
340 | case 0: | 340 | case 0: |
341 | qWarning("YES clicked"); | 341 | qWarning("YES clicked"); |
342 | break; | 342 | break; |
343 | case 1: | 343 | case 1: |
344 | qWarning("NO clicked"); | 344 | qWarning("NO clicked"); |
345 | return; | 345 | return; |
346 | break; | 346 | break; |
347 | } | 347 | } |
348 | } | 348 | } |
349 | 349 | ||
350 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 350 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, |
351 | filename ); | 351 | filename ); |
352 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 352 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
353 | OContactAccess::List allList = access->allRecords(); | 353 | OContactAccess::List allList = access->allRecords(); |
354 | 354 | ||
355 | OContactAccess::List::Iterator it; | 355 | OContactAccess::List::Iterator it; |
356 | for ( it = allList.begin(); it != allList.end(); ++it ){ | 356 | for ( it = allList.begin(); it != allList.end(); ++it ){ |
357 | m_abView->addEntry( *it ); | 357 | m_abView->addEntry( *it ); |
358 | } | 358 | } |
359 | 359 | ||
360 | delete access; | 360 | delete access; |
361 | } | 361 | } |
362 | 362 | ||
363 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) | 363 | void AddressbookWindow::resizeEvent( QResizeEvent *e ) |
364 | { | 364 | { |
365 | QMainWindow::resizeEvent( e ); | 365 | QMainWindow::resizeEvent( e ); |
366 | 366 | ||
367 | 367 | ||
368 | } | 368 | } |
369 | 369 | ||
370 | AddressbookWindow::~AddressbookWindow() | 370 | AddressbookWindow::~AddressbookWindow() |
371 | { | 371 | { |
372 | ToolBarDock dock; | 372 | ToolBarDock dock; |
373 | int dummy; | 373 | int dummy; |
374 | bool bDummy; | 374 | bool bDummy; |
375 | getLocation ( listTools, dock, dummy, bDummy, dummy ); | 375 | getLocation ( listTools, dock, dummy, bDummy, dummy ); |
376 | m_config.setToolBarDock( dock ); | 376 | m_config.setToolBarDock( dock ); |
377 | m_config.save(); | 377 | m_config.save(); |
378 | } | 378 | } |
379 | 379 | ||
380 | void AddressbookWindow::slotUpdateToolbar() | 380 | void AddressbookWindow::slotUpdateToolbar() |
381 | { | 381 | { |
382 | OContact ce = m_abView->currentEntry(); | 382 | OContact ce = m_abView->currentEntry(); |
383 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); | 383 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); |
384 | } | 384 | } |
385 | 385 | ||
386 | void AddressbookWindow::slotListNew() | 386 | void AddressbookWindow::slotListNew() |
387 | { | 387 | { |
388 | OContact cnt; | 388 | OContact cnt; |
389 | if( !syncing ) { | 389 | if( !syncing ) { |
390 | editEntry( NewEntry ); | 390 | editEntry( NewEntry ); |
391 | } else { | 391 | } else { |
392 | QMessageBox::warning(this, tr("OContacts"), | 392 | QMessageBox::warning(this, tr("OContacts"), |
393 | tr("Can not edit data, currently syncing")); | 393 | tr("Can not edit data, currently syncing")); |
394 | } | 394 | } |
395 | } | 395 | } |
396 | 396 | ||
397 | // void AddressbookWindow::slotListView() | 397 | // void AddressbookWindow::slotListView() |
398 | // { | 398 | // { |
399 | // m_abView -> init( abList->currentEntry() ); | 399 | // m_abView -> init( abList->currentEntry() ); |
400 | // // :SX mView->sync(); | 400 | // // :SX mView->sync(); |