summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
Unidiff
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 59bddd9..9c3a641 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -365,362 +365,371 @@ void ViewManager::editView()
365 emit modified(); 365 emit modified();
366 366
367 } 367 }
368 368
369 } 369 }
370 delete dlg; 370 delete dlg;
371} 371}
372 372
373void ViewManager::deleteView() 373void ViewManager::deleteView()
374{ 374{
375 QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" ) 375 QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" )
376 .arg( mActiveView->caption() ); 376 .arg( mActiveView->caption() );
377 QString caption = i18n( "Confirm Delete" ); 377 QString caption = i18n( "Confirm Delete" );
378 378
379 379
380 if (QMessageBox::information( this, caption, 380 if (QMessageBox::information( this, caption,
381 text, 381 text,
382 i18n("Yes!"), i18n("No"), 0, 0 ) == 0) 382 i18n("Yes!"), i18n("No"), 0, 0 ) == 0)
383 { 383 {
384 mViewNameList.remove( mActiveView->caption() ); 384 mViewNameList.remove( mActiveView->caption() );
385 385
386 // remove the view from the config file 386 // remove the view from the config file
387 KConfig *config = mCore->config(); 387 KConfig *config = mCore->config();
388 config->deleteGroup( mActiveView->caption() ); 388 config->deleteGroup( mActiveView->caption() );
389 389
390 mViewDict.remove( mActiveView->caption() ); 390 mViewDict.remove( mActiveView->caption() );
391 mActiveView = 0; 391 mActiveView = 0;
392 392
393 // we are in an invalid state now, but that should be fixed after 393 // we are in an invalid state now, but that should be fixed after
394 // we emit the signal 394 // we emit the signal
395 mActionSelectView->setItems( mViewNameList ); 395 mActionSelectView->setItems( mViewNameList );
396 if ( mViewNameList.count() > 0 ) { 396 if ( mViewNameList.count() > 0 ) {
397 mActionSelectView->setCurrentItem( 0 ); 397 mActionSelectView->setCurrentItem( 0 );
398 setActiveView( mViewNameList[ 0 ] ); 398 setActiveView( mViewNameList[ 0 ] );
399 } 399 }
400 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 400 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
401 } 401 }
402} 402}
403 403
404void ViewManager::addView() 404void ViewManager::addView()
405{ 405{
406 AddViewDialog dialog( &mViewFactoryDict, this ); 406 AddViewDialog dialog( &mViewFactoryDict, this );
407 407
408 if ( dialog.exec() ) { 408 if ( dialog.exec() ) {
409 QString newName = dialog.viewName(); 409 QString newName = dialog.viewName();
410 QString type = dialog.viewType(); 410 QString type = dialog.viewType();
411 411
412 // Check for name conflicts 412 // Check for name conflicts
413 bool firstConflict = true; 413 bool firstConflict = true;
414 int numTries = 1; 414 int numTries = 1;
415 while ( mViewNameList.contains( newName ) > 0 ) { 415 while ( mViewNameList.contains( newName ) > 0 ) {
416 if ( !firstConflict ) { 416 if ( !firstConflict ) {
417 newName = newName.left( newName.length() - 4 ); 417 newName = newName.left( newName.length() - 4 );
418 firstConflict = false; 418 firstConflict = false;
419 } 419 }
420 420
421 newName = QString( "%1 <%2>" ).arg( newName ).arg( numTries ); 421 newName = QString( "%1 <%2>" ).arg( newName ).arg( numTries );
422 numTries++; 422 numTries++;
423 } 423 }
424 424
425 // Add the new one to the list 425 // Add the new one to the list
426 mViewNameList.append( newName ); 426 mViewNameList.append( newName );
427 427
428 // write the view to the config file, 428 // write the view to the config file,
429 KConfig *config = mCore->config(); 429 KConfig *config = mCore->config();
430 430
431 config->deleteGroup( newName ); 431 config->deleteGroup( newName );
432 432
433 KConfigGroupSaver saver( config, newName ); 433 KConfigGroupSaver saver( config, newName );
434 434
435 config->writeEntry( "Type", type ); 435 config->writeEntry( "Type", type );
436 436
437 // try to set the active view 437 // try to set the active view
438 mActionSelectView->setItems( mViewNameList ); 438 mActionSelectView->setItems( mViewNameList );
439 mActionSelectView->setCurrentItem( mViewNameList.findIndex( newName ) ); 439 mActionSelectView->setCurrentItem( mViewNameList.findIndex( newName ) );
440 setActiveView( newName ); 440 setActiveView( newName );
441 441
442 editView(); 442 editView();
443 443
444 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 444 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
445 } 445 }
446} 446}
447 447
448void ViewManager::createViewFactories() 448void ViewManager::createViewFactories()
449{ 449{
450#ifndef KAB_EMBEDDED 450#ifndef KAB_EMBEDDED
451 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/View" ); 451 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/View" );
452 KTrader::OfferList::ConstIterator it; 452 KTrader::OfferList::ConstIterator it;
453 for ( it = plugins.begin(); it != plugins.end(); ++it ) { 453 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
454 if ( !(*it)->hasServiceType( "KAddressBook/View" ) ) 454 if ( !(*it)->hasServiceType( "KAddressBook/View" ) )
455 continue; 455 continue;
456 456
457 KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); 457 KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() );
458 458
459 if ( !factory ) { 459 if ( !factory ) {
460 kdDebug(5720) << "ViewManager::createViewFactories(): Factory creation failed" << endl; 460 kdDebug(5720) << "ViewManager::createViewFactories(): Factory creation failed" << endl;
461 continue; 461 continue;
462 } 462 }
463 463
464 ViewFactory *viewFactory = static_cast<ViewFactory*>( factory ); 464 ViewFactory *viewFactory = static_cast<ViewFactory*>( factory );
465 465
466 if ( !viewFactory ) { 466 if ( !viewFactory ) {
467 kdDebug(5720) << "ViewManager::createViewFactories(): Cast failed" << endl; 467 kdDebug(5720) << "ViewManager::createViewFactories(): Cast failed" << endl;
468 continue; 468 continue;
469 } 469 }
470 470
471 mViewFactoryDict.insert( viewFactory->type(), viewFactory ); 471 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
472 } 472 }
473 473
474#else //KAB_EMBEDDED 474#else //KAB_EMBEDDED
475 ViewFactory* viewFactory = new IconViewFactory(); 475 ViewFactory* viewFactory = new IconViewFactory();
476 mViewFactoryDict.insert( viewFactory->type(), viewFactory ); 476 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
477// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); 477// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1());
478 478
479 viewFactory = new TableViewFactory(); 479 viewFactory = new TableViewFactory();
480 mViewFactoryDict.insert( viewFactory->type(), viewFactory ); 480 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
481// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); 481// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1());
482 482
483 viewFactory = new CardViewFactory(); 483 viewFactory = new CardViewFactory();
484 mViewFactoryDict.insert( viewFactory->type(), viewFactory ); 484 mViewFactoryDict.insert( viewFactory->type(), viewFactory );
485// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); 485// qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1());
486 486
487#endif //KAB_EMBEDDED 487#endif //KAB_EMBEDDED
488 488
489} 489}
490 490
491void ViewManager::dropped( QDropEvent *e ) 491void ViewManager::dropped( QDropEvent *e )
492{ 492{
493 kdDebug(5720) << "ViewManager::dropped: got a drop event" << endl; 493 kdDebug(5720) << "ViewManager::dropped: got a drop event" << endl;
494 494
495#ifndef KAB_EMBEDDED 495#ifndef KAB_EMBEDDED
496 496
497 QString clipText, vcards; 497 QString clipText, vcards;
498 KURL::List urls; 498 KURL::List urls;
499 499
500 if ( KURLDrag::decode( e, urls) ) { 500 if ( KURLDrag::decode( e, urls) ) {
501 KURL::List::Iterator it = urls.begin(); 501 KURL::List::Iterator it = urls.begin();
502 int c = urls.count(); 502 int c = urls.count();
503 if ( c > 1 ) { 503 if ( c > 1 ) {
504 QString questionString = i18n( "Import one contact into your addressbook?", "Import %n contacts into your addressbook?", c ); 504 QString questionString = i18n( "Import one contact into your addressbook?", "Import %n contacts into your addressbook?", c );
505 if ( KMessageBox::questionYesNo( this, questionString, i18n( "Import Contacts?" ) ) == KMessageBox::Yes ) { 505 if ( KMessageBox::questionYesNo( this, questionString, i18n( "Import Contacts?" ) ) == KMessageBox::Yes ) {
506 for ( ; it != urls.end(); ++it ) 506 for ( ; it != urls.end(); ++it )
507 emit urlDropped( *it ); 507 emit urlDropped( *it );
508 } 508 }
509 } else if ( c == 1 ) 509 } else if ( c == 1 )
510 emit urlDropped( *it ); 510 emit urlDropped( *it );
511 } else if ( KVCardDrag::decode( e, vcards ) ) { 511 } else if ( KVCardDrag::decode( e, vcards ) ) {
512 KABC::Addressee addr; 512 KABC::Addressee addr;
513 KABC::VCardConverter converter; 513 KABC::VCardConverter converter;
514 QStringList list = QStringList::split( "\r\n\r\n", vcards ); 514 QStringList list = QStringList::split( "\r\n\r\n", vcards );
515 QStringList::Iterator it; 515 QStringList::Iterator it;
516 for ( it = list.begin(); it != list.end(); ++it ) { 516 for ( it = list.begin(); it != list.end(); ++it ) {
517 if ( converter.vCardToAddressee( (*it).stripWhiteSpace(), addr ) ) { 517 if ( converter.vCardToAddressee( (*it).stripWhiteSpace(), addr ) ) {
518 KABC::Addressee a = mCore->addressBook()->findByUid( addr.uid() ); 518 KABC::Addressee a = mCore->addressBook()->findByUid( addr.uid() );
519 if ( a.isEmpty() ) { 519 if ( a.isEmpty() ) {
520 mCore->addressBook()->insertAddressee( addr ); 520 mCore->addressBook()->insertAddressee( addr );
521 emit modified(); 521 emit modified();
522 } 522 }
523 } 523 }
524 } 524 }
525 525
526 mActiveView->refresh(); 526 mActiveView->refresh();
527 } 527 }
528#else //KAB_EMBEDDED 528#else //KAB_EMBEDDED
529qDebug("ViewManager::dropped() has to be changed!!" ); 529qDebug("ViewManager::dropped() has to be changed!!" );
530#endif //KAB_EMBEDDED 530#endif //KAB_EMBEDDED
531 531
532} 532}
533 533
534void ViewManager::startDrag() 534void ViewManager::startDrag()
535{ 535{
536 kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl; 536 kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl;
537 537
538#ifndef KAB_EMBEDDED 538#ifndef KAB_EMBEDDED
539 539
540 // Get the list of all the selected addressees 540 // Get the list of all the selected addressees
541 KABC::Addressee::List addrList; 541 KABC::Addressee::List addrList;
542 QStringList uidList = selectedUids(); 542 QStringList uidList = selectedUids();
543 QStringList::Iterator iter; 543 QStringList::Iterator iter;
544 for ( iter = uidList.begin(); iter != uidList.end(); ++iter ) 544 for ( iter = uidList.begin(); iter != uidList.end(); ++iter )
545 addrList.append( mCore->addressBook()->findByUid( *iter ) ); 545 addrList.append( mCore->addressBook()->findByUid( *iter ) );
546 546
547 KMultipleDrag *drag = new KMultipleDrag( this ); 547 KMultipleDrag *drag = new KMultipleDrag( this );
548 drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); 548 drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) );
549 KABC::Addressee::List::Iterator it; 549 KABC::Addressee::List::Iterator it;
550 QStringList vcards; 550 QStringList vcards;
551 for ( it = addrList.begin(); it != addrList.end(); ++it ) { 551 for ( it = addrList.begin(); it != addrList.end(); ++it ) {
552 QString vcard = QString::null; 552 QString vcard = QString::null;
553 KABC::VCardConverter converter; 553 KABC::VCardConverter converter;
554 if ( converter.addresseeToVCard( *it, vcard ) ) 554 if ( converter.addresseeToVCard( *it, vcard ) )
555 vcards.append( vcard ); 555 vcards.append( vcard );
556 } 556 }
557 drag->addDragObject( new KVCardDrag( vcards.join( "\r\n" ), this ) ); 557 drag->addDragObject( new KVCardDrag( vcards.join( "\r\n" ), this ) );
558 558
559 drag->setPixmap( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop ) ); 559 drag->setPixmap( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop ) );
560 drag->dragCopy(); 560 drag->dragCopy();
561 561
562#else //KAB_EMBEDDED 562#else //KAB_EMBEDDED
563qDebug("ViewManager::startDrag() has to be changed!!" ); 563qDebug("ViewManager::startDrag() has to be changed!!" );
564#endif //KAB_EMBEDDED 564#endif //KAB_EMBEDDED
565 565
566} 566}
567void ViewManager::doSearch( const QString& s,KABC::Field *field ) 567void ViewManager::doSearch( const QString& s,KABC::Field *field )
568{ 568{
569 if ( mActiveView ) 569 if ( mActiveView )
570 mActiveView->doSearch( s, field ); 570 mActiveView->doSearch( s, field );
571 571
572} 572}
573void ViewManager::setActiveFilter( int index ) 573void ViewManager::setActiveFilter( int index )
574{ 574{
575 Filter currentFilter; 575 Filter currentFilter;
576 576
577 if ( ( index - 1 ) < 0 ) 577 if ( ( index - 1 ) < 0 )
578 currentFilter = Filter(); 578 currentFilter = Filter();
579 else 579 else
580 currentFilter = mFilterList[ index - 1 ]; 580 currentFilter = mFilterList[ index - 1 ];
581 581
582 // Check if we have a view. Since the filter combo is created before 582 // Check if we have a view. Since the filter combo is created before
583 // the view, this slot could be called before there is a valid view. 583 // the view, this slot could be called before there is a valid view.
584 if ( mActiveView ) { 584 if ( mActiveView ) {
585 mActiveView->setFilter( currentFilter ); 585 mActiveView->setFilter( currentFilter );
586 mActiveView->refresh(); 586 mActiveView->refresh();
587 emit selected( QString::null ); 587 emit selected( QString::null );
588 } 588 }
589} 589}
590 590
591void ViewManager::configureFilters() 591void ViewManager::configureFilters()
592{ 592{
593 FilterDialog dlg( this ); 593 FilterDialog dlg( this );
594 594
595 dlg.setFilters( mFilterList ); 595 dlg.setFilters( mFilterList );
596 596
597 if ( dlg.exec() ) 597 if ( dlg.exec() )
598 mFilterList = dlg.filters(); 598 mFilterList = dlg.filters();
599 599
600 uint pos = mActionSelectFilter->currentItem(); 600 uint pos = mActionSelectFilter->currentItem();
601 mActionSelectFilter->setItems( filterNames() ); 601 mActionSelectFilter->setItems( filterNames() );
602 mActionSelectFilter->setCurrentItem( pos ); 602 mActionSelectFilter->setCurrentItem( pos );
603 setActiveFilter( pos ); 603 setActiveFilter( pos );
604 int cw = 150; 604 int cw = 150;
605 if (QApplication::desktop()->width() == 480 ) 605 if (QApplication::desktop()->width() == 480 )
606 cw = 0; 606 cw = 0;
607 mActionSelectFilter->setComboWidth( cw ); 607 mActionSelectFilter->setComboWidth( cw );
608 saveSettings(); 608 saveSettings();
609} 609}
610 610
611QStringList ViewManager::filterNames() const 611QStringList ViewManager::filterNames() const
612{ 612{
613 QStringList names( i18n( "No Filter" ) ); 613 QStringList names( i18n( "No Filter" ) );
614 614
615 Filter::List::ConstIterator it; 615 Filter::List::ConstIterator it;
616 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) 616 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
617 names.append( (*it).name() ); 617 names.append( (*it).name() );
618 618
619 return names; 619 return names;
620} 620}
621Filter ViewManager::getFilterByName( const QString &name ) const
622{
623 Filter::List::ConstIterator it;
624 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
625 if ( name == (*it).name() )
626 return (*it);
627
628 return Filter();
629}
621 630
622int ViewManager::filterPosition( const QString &name ) const 631int ViewManager::filterPosition( const QString &name ) const
623{ 632{
624 int pos = 0; 633 int pos = 0;
625 634
626 Filter::List::ConstIterator it; 635 Filter::List::ConstIterator it;
627 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos ) 636 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos )
628 if ( name == (*it).name() ) 637 if ( name == (*it).name() )
629 return pos + 1; 638 return pos + 1;
630 639
631 return 0; 640 return 0;
632} 641}
633 642
634void ViewManager::initActions() 643void ViewManager::initActions()
635{ 644{
636//US <ActionList name="view_loadedviews"/> 645//US <ActionList name="view_loadedviews"/>
637//US <Separator/> 646//US <Separator/>
638 647
639#ifdef KAB_EMBEDDED 648#ifdef KAB_EMBEDDED
640 QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu(); 649 QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu();
641 QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); 650 QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu();
642 QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); 651 QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu();
643#endif //KAB_EMBEDDED 652#endif //KAB_EMBEDDED
644 653
645 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); 654 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" );
646#if KDE_VERSION >= 309 655#if KDE_VERSION >= 309
647 mActionSelectView->setMenuAccelsEnabled( false ); 656 mActionSelectView->setMenuAccelsEnabled( false );
648#endif 657#endif
649 connect( mActionSelectView, SIGNAL( activated( const QString& ) ), 658 connect( mActionSelectView, SIGNAL( activated( const QString& ) ),
650 SLOT( setActiveView( const QString& ) ) ); 659 SLOT( setActiveView( const QString& ) ) );
651 660
652 661
653#ifdef KAB_EMBEDDED 662#ifdef KAB_EMBEDDED
654 mActionSelectView->plug(viewmenu); 663 mActionSelectView->plug(viewmenu);
655 viewmenu->insertSeparator(); 664 viewmenu->insertSeparator();
656#endif //KAB_EMBEDDED 665#endif //KAB_EMBEDDED
657 666
658 KAction *action; 667 KAction *action;
659 668
660 action = new KAction( i18n( "Modify View..." ), "configure", 0, this, 669 action = new KAction( i18n( "Modify View..." ), "configure", 0, this,
661 SLOT( editView() ), mCore->actionCollection(), "view_modify" ); 670 SLOT( editView() ), mCore->actionCollection(), "view_modify" );
662#ifndef KAB_EMBEDDED 671#ifndef KAB_EMBEDDED
663 action->setWhatsThis( i18n( "By pressing this button a dialog opens that allows you to modify the view of the addressbook. There you can add or remove fields that you want to be shown or hidden in the addressbook like the name for example." ) ); 672 action->setWhatsThis( i18n( "By pressing this button a dialog opens that allows you to modify the view of the addressbook. There you can add or remove fields that you want to be shown or hidden in the addressbook like the name for example." ) );
664#else //KAB_EMBEDDED 673#else //KAB_EMBEDDED
665 action->plug(viewmenu); 674 action->plug(viewmenu);
666#endif //KAB_EMBEDDED 675#endif //KAB_EMBEDDED
667 676
668 action = new KAction( i18n( "Add View..." ), "window_new", 0, this, 677 action = new KAction( i18n( "Add View..." ), "window_new", 0, this,
669 SLOT( addView() ), mCore->actionCollection(), "view_add" ); 678 SLOT( addView() ), mCore->actionCollection(), "view_add" );
670#ifndef KAB_EMBEDDED 679#ifndef KAB_EMBEDDED
671 action->setWhatsThis( i18n( "You can add a new view by choosing one of the dialog that appears after pressing the button. You have to give the view a name, so that you can distinguish between the different views." ) ); 680 action->setWhatsThis( i18n( "You can add a new view by choosing one of the dialog that appears after pressing the button. You have to give the view a name, so that you can distinguish between the different views." ) );
672#else //KAB_EMBEDDED 681#else //KAB_EMBEDDED
673 action->plug(viewmenu); 682 action->plug(viewmenu);
674#endif //KAB_EMBEDDED 683#endif //KAB_EMBEDDED
675 684
676 mActionDeleteView = new KAction( i18n( "Delete View" ), "view_remove", 0, 685 mActionDeleteView = new KAction( i18n( "Delete View" ), "view_remove", 0,
677 this, SLOT( deleteView() ), 686 this, SLOT( deleteView() ),
678 mCore->actionCollection(), "view_delete" ); 687 mCore->actionCollection(), "view_delete" );
679#ifndef KAB_EMBEDDED 688#ifndef KAB_EMBEDDED
680 mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) ); 689 mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) );
681#else //KAB_EMBEDDED 690#else //KAB_EMBEDDED
682 mActionDeleteView->plug(viewmenu); 691 mActionDeleteView->plug(viewmenu);
683 viewmenu->insertSeparator(); 692 viewmenu->insertSeparator();
684#endif //KAB_EMBEDDED 693#endif //KAB_EMBEDDED
685 694
686#ifndef KAB_EMBEDDED 695#ifndef KAB_EMBEDDED
687 action = new KAction( i18n( "Refresh View" ), "reload", 0, this, 696 action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
688 SLOT( refreshView(const QString &) ), mCore->actionCollection(), 697 SLOT( refreshView(const QString &) ), mCore->actionCollection(),
689 "view_refresh" ); 698 "view_refresh" );
690 action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) ); 699 action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) );
691#else //KAB_EMBEDDED 700#else //KAB_EMBEDDED
692 action = new KAction( i18n( "Refresh View" ), "reload", 0, this, 701 action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
693 SLOT( refreshView()), mCore->actionCollection(), 702 SLOT( refreshView()), mCore->actionCollection(),
694 "view_refresh" ); 703 "view_refresh" );
695 action->plug(viewmenu); 704 action->plug(viewmenu);
696 viewmenu->insertSeparator(); 705 viewmenu->insertSeparator();
697#endif //KAB_EMBEDDED 706#endif //KAB_EMBEDDED
698 707
699 action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this, 708 action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this,
700 SLOT( configureFilters() ), mCore->actionCollection(), 709 SLOT( configureFilters() ), mCore->actionCollection(),
701 "options_edit_filters" ); 710 "options_edit_filters" );
702 711
703 mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); 712 mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" );
704#if KDE_VERSION >= 309 713#if KDE_VERSION >= 309
705 mActionSelectFilter->setMenuAccelsEnabled( false ); 714 mActionSelectFilter->setMenuAccelsEnabled( false );
706#endif 715#endif
707 connect( mActionSelectFilter, SIGNAL( activated( int ) ), 716 connect( mActionSelectFilter, SIGNAL( activated( int ) ),
708 SLOT( setActiveFilter( int ) ) ); 717 SLOT( setActiveFilter( int ) ) );
709 718
710#ifdef KAB_EMBEDDED 719#ifdef KAB_EMBEDDED
711 action->plug(settingsmenu); 720 action->plug(settingsmenu);
712 mActionSelectFilter->plug(viewmenu); 721 mActionSelectFilter->plug(viewmenu);
713#endif //KAB_EMBEDDED 722#endif //KAB_EMBEDDED
714 723
715} 724}
716 725
717void ViewManager::initGUI() 726void ViewManager::initGUI()
718{ 727{
719 QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 ); 728 QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 );
720 mViewWidgetStack = new QWidgetStack( this ); 729 mViewWidgetStack = new QWidgetStack( this );
721 layout->addWidget( mViewWidgetStack ); 730 layout->addWidget( mViewWidgetStack );
722} 731}
723 732
724#ifndef KAB_EMBEDDED 733#ifndef KAB_EMBEDDED
725#include "viewmanager.moc" 734#include "viewmanager.moc"
726#endif //KAB_EMBEDDED 735#endif //KAB_EMBEDDED