summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index a1ce5a0..5ce90a9 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -246,49 +246,49 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
246 catMenu->setCheckable( TRUE ); 246 catMenu->setCheckable( TRUE );
247 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); 247 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
248 populateCategories(); 248 populateCategories();
249 mbList->insertItem( tr("View"), catMenu ); 249 mbList->insertItem( tr("View"), catMenu );
250 250
251 defaultFont = new QFont( m_abView->font() ); 251 defaultFont = new QFont( m_abView->font() );
252 slotSetFont(m_config.fontSize()); 252 slotSetFont(m_config.fontSize());
253 m_curFontSize = m_config.fontSize(); 253 m_curFontSize = m_config.fontSize();
254 254
255 setCentralWidget(listContainer); 255 setCentralWidget(listContainer);
256 256
257 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 257 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
258 258
259 259
260 isLoading = false; 260 isLoading = false;
261} 261}
262 262
263 263
264void AddressbookWindow::slotConfig() 264void AddressbookWindow::slotConfig()
265{ 265{
266 ConfigDlg* dlg = new ConfigDlg( this, "Config" ); 266 ConfigDlg* dlg = new ConfigDlg( this, "Config" );
267 dlg -> setConfig( m_config ); 267 dlg -> setConfig( m_config );
268 dlg -> showMaximized(); 268 dlg -> showMaximized();
269 if ( dlg -> exec() ) { 269 if ( dlg -> exec() ) {
270 qWarning ("Config Dialog accepted !"); 270 qWarning ("Config Dialog accepted!");
271 m_config = dlg -> getConfig(); 271 m_config = dlg -> getConfig();
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
284void AddressbookWindow::slotSetFont( int size ) 284void 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
@@ -335,58 +335,58 @@ void AddressbookWindow::setDocument( const QString &filename )
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 qWarning( "Found number of contacts in File: %d", allList.count() ); 354 qWarning( "Found number of contacts in File: %d", allList.count() );
355 355
356 if ( !allList.count() ) { 356 if ( !allList.count() ) {
357 QMessageBox::information( this, "Import VCard", 357 QMessageBox::information( this, "Import VCard",
358 "It was impossible to import the VCard.\n" 358 "It was impossible to import the VCard.\n"
359 "The VCard may be corrupted !" ); 359 "The VCard may be corrupted!" );
360 } 360 }
361 361
362 bool doAsk = true; 362 bool doAsk = true;
363 OContactAccess::List::Iterator it; 363 OContactAccess::List::Iterator it;
364 for ( it = allList.begin(); it != allList.end(); ++it ){ 364 for ( it = allList.begin(); it != allList.end(); ++it ){
365 qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); 365 qWarning("Adding Contact from: %s", (*it).fullName().latin1() );
366 if ( doAsk ){ 366 if ( doAsk ){
367 switch( QMessageBox::information( this, tr ( "Add Contact ?" ), 367 switch( QMessageBox::information( this, tr ( "Add Contact?" ),
368 tr( "Do you really want add contact for \n%1 ?" ) 368 tr( "Do you really want add contact for \n%1?" )
369 .arg( (*it).fullName().latin1() ), 369 .arg( (*it).fullName().latin1() ),
370 tr( "&Yes" ), tr( "&No" ), tr( "&AllYes"), 370 tr( "&Yes" ), tr( "&No" ), tr( "&AllYes"),
371 0, // Enter == button 0 371 0, // Enter == button 0
372 2 ) ) { // Escape == button 2 372 2 ) ) { // Escape == button 2
373 case 0: 373 case 0:
374 qWarning("YES clicked"); 374 qWarning("YES clicked");
375 m_abView->addEntry( *it ); 375 m_abView->addEntry( *it );
376 break; 376 break;
377 case 1: 377 case 1:
378 qWarning("NO clicked"); 378 qWarning("NO clicked");
379 break; 379 break;
380 case 2: 380 case 2:
381 qWarning("YesAll clicked"); 381 qWarning("YesAll clicked");
382 doAsk = false; 382 doAsk = false;
383 break; 383 break;
384 } 384 }
385 }else 385 }else
386 m_abView->addEntry( *it ); 386 m_abView->addEntry( *it );
387 387
388 } 388 }
389 389
390 delete access; 390 delete access;
391} 391}
392 392
@@ -809,57 +809,57 @@ bool AddressbookWindow::save()
809 tr("Unable to save information.\n" 809 tr("Unable to save information.\n"
810 "Free up some space\n" 810 "Free up some space\n"
811 "and try again.\n" 811 "and try again.\n"
812 "\nQuit anyway?"), 812 "\nQuit anyway?"),
813 QMessageBox::Yes|QMessageBox::Escape, 813 QMessageBox::Yes|QMessageBox::Escape,
814 QMessageBox::No|QMessageBox::Default ) 814 QMessageBox::No|QMessageBox::Default )
815 != QMessageBox::No ) 815 != QMessageBox::No )
816 return TRUE; 816 return TRUE;
817 else 817 else
818 return FALSE; 818 return FALSE;
819 } 819 }
820 return TRUE; 820 return TRUE;
821} 821}
822 822
823#ifdef __DEBUG_RELEASE 823#ifdef __DEBUG_RELEASE
824void AddressbookWindow::slotSave() 824void AddressbookWindow::slotSave()
825{ 825{
826 save(); 826 save();
827} 827}
828#endif 828#endif
829 829
830 830
831void AddressbookWindow::slotNotFound() 831void AddressbookWindow::slotNotFound()
832{ 832{
833 qWarning("Got notfound signal !"); 833 qWarning("Got notfound signal!");
834 QMessageBox::information( this, tr( "Not Found" ), 834 QMessageBox::information( this, tr( "Not Found" ),
835 tr( "Unable to find a contact for this \n search pattern!" ) ); 835 tr( "Unable to find a contact for this \n search pattern!" ) );
836 836
837 837
838} 838}
839void AddressbookWindow::slotWrapAround() 839void AddressbookWindow::slotWrapAround()
840{ 840{
841 qWarning("Got wrap signal !"); 841 qWarning("Got wrap signal!");
842 // if ( doNotifyWrapAround ) 842 // if ( doNotifyWrapAround )
843 // QMessageBox::information( this, tr( "End of list" ), 843 // QMessageBox::information( this, tr( "End of list" ),
844 // tr( "End of list. Wrap around now...!" ) + "\n" ); 844 // tr( "End of list. Wrap around now...!" ) + "\n" );
845 845
846} 846}
847 847
848void AddressbookWindow::slotSetCategory( int c ) 848void AddressbookWindow::slotSetCategory( int c )
849{ 849{
850 qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() ); 850 qWarning( "void AddressbookWindow::slotSetCategory( %d ) from %d", c, catMenu->count() );
851 851
852 QString cat, book; 852 QString cat, book;
853 AbView::Views view = AbView::TableView; 853 AbView::Views view = AbView::TableView;
854 854
855 if ( c <= 0 ) 855 if ( c <= 0 )
856 return; 856 return;
857 857
858 // Switch view 858 // Switch view
859 if ( c < 3 ) 859 if ( c < 3 )
860 for ( unsigned int i = 1; i < 3; i++ ){ 860 for ( unsigned int i = 1; i < 3; i++ ){
861 if ( catMenu ) 861 if ( catMenu )
862 catMenu->setItemChecked( i, c == (int)i ); 862 catMenu->setItemChecked( i, c == (int)i );
863 } 863 }
864 else 864 else
865 // Checkmark Category Menu Item Selected 865 // Checkmark Category Menu Item Selected