summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
authorzautrix <zautrix>2004-12-13 12:35:00 (UTC)
committer zautrix <zautrix>2004-12-13 12:35:00 (UTC)
commit7ac6c21e832b7d16bd0888d0b66252b6e152005a (patch) (unidiff)
treec7610e0e25020f19af82ac6257c2debab2638316 /kaddressbook/viewmanager.cpp
parent17b25691f0332e648dd1d800e89ccf4e1da8955d (diff)
downloadkdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.zip
kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.gz
kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.bz2
many bugfixes
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 0d91c12..33bef5a 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -1,205 +1,209 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31 31
32#ifndef KAB_EMBEDDED 32#ifndef KAB_EMBEDDED
33#include <libkdepim/kvcarddrag.h> 33#include <libkdepim/kvcarddrag.h>
34#include <kabc/vcardconverter.h> 34#include <kabc/vcardconverter.h>
35#include <kconfig.h> 35#include <kconfig.h>
36#include <kdeversion.h> 36#include <kdeversion.h>
37#include <kiconloader.h> 37#include <kiconloader.h>
38#include <klocale.h> 38#include <klocale.h>
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40#include <kmultipledrag.h> 40#include <kmultipledrag.h>
41#include <ktrader.h> 41#include <ktrader.h>
42#include <kurldrag.h> 42#include <kurldrag.h>
43 43
44#include "addresseeutil.h" 44#include "addresseeutil.h"
45#else //KAB_EMBEDDED 45#else //KAB_EMBEDDED
46#include "views/kaddressbookiconview.h" 46#include "views/kaddressbookiconview.h"
47#include "views/kaddressbooktableview.h" 47#include "views/kaddressbooktableview.h"
48#include "views/kaddressbookcardview.h" 48#include "views/kaddressbookcardview.h"
49#include "kaddressbookview.h" 49#include "kaddressbookview.h"
50 50
51#include <qaction.h> 51#include <qaction.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qpopupmenu.h> 53#include <qpopupmenu.h>
54#include <kconfigbase.h> 54#include <kconfigbase.h>
55 55
56#endif //KAB_EMBEDDED 56#endif //KAB_EMBEDDED
57 57
58 58
59#include <kdebug.h> 59#include <kdebug.h>
60#include <kactionclasses.h> 60#include <kactionclasses.h>
61 61
62#include <qlayout.h> 62#include <qlayout.h>
63#include <qapplication.h>
63#include <qwidgetstack.h> 64#include <qwidgetstack.h>
64 65
65#include <kabc/addressbook.h> 66#include <kabc/addressbook.h>
66#include "filtereditdialog.h" 67#include "filtereditdialog.h"
67#include "addviewdialog.h" 68#include "addviewdialog.h"
68#include "kabcore.h" 69#include "kabcore.h"
69#include "kabprefs.h" 70#include "kabprefs.h"
70#include "viewmanager.h" 71#include "viewmanager.h"
71 72
72ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name ) 73ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name )
73 : QWidget( parent, name ), mCore( core ), mActiveView( 0 ) 74 : QWidget( parent, name ), mCore( core ), mActiveView( 0 )
74{ 75{
75 initGUI(); 76 initGUI();
76 initActions(); 77 initActions();
77 78
78 mViewDict.setAutoDelete( true ); 79 mViewDict.setAutoDelete( true );
79 80
80 createViewFactories(); 81 createViewFactories();
81} 82}
82 83
83ViewManager::~ViewManager() 84ViewManager::~ViewManager()
84{ 85{
85 unloadViews(); 86 unloadViews();
86 mViewFactoryDict.clear(); 87 mViewFactoryDict.clear();
87} 88}
88void ViewManager::scrollUP() 89void ViewManager::scrollUP()
89{ 90{
90 if ( mActiveView ) 91 if ( mActiveView )
91 mActiveView->scrollUP(); 92 mActiveView->scrollUP();
92} 93}
93void ViewManager::scrollDOWN() 94void ViewManager::scrollDOWN()
94{ 95{
95 if ( mActiveView ) 96 if ( mActiveView )
96 mActiveView->scrollDOWN(); 97 mActiveView->scrollDOWN();
97} 98}
98void ViewManager::restoreSettings() 99void ViewManager::restoreSettings()
99{ 100{
100 mViewNameList = KABPrefs::instance()->mViewNames; 101 mViewNameList = KABPrefs::instance()->mViewNames;
101 QString activeViewName = KABPrefs::instance()->mCurrentView; 102 QString activeViewName = KABPrefs::instance()->mCurrentView;
102 103
103 mActionSelectView->setItems( mViewNameList ); 104 mActionSelectView->setItems( mViewNameList );
104 105
105 // Filter 106 // Filter
106 mFilterList = Filter::restore( mCore->config(), "Filter" ); 107 mFilterList = Filter::restore( mCore->config(), "Filter" );
107 mActionSelectFilter->setItems( filterNames() ); 108 mActionSelectFilter->setItems( filterNames() );
108 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); 109 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
109 mActionSelectFilter->setComboWidth( 150 ); 110 int cw = 150;
111 if (QApplication::desktop()->width() == 480 )
112 cw = 0;
113 mActionSelectFilter->setComboWidth( cw );
110 // Tell the views to reread their config, since they may have 114 // Tell the views to reread their config, since they may have
111 // been modified by global settings 115 // been modified by global settings
112 QString _oldgroup = mCore->config()->group(); 116 QString _oldgroup = mCore->config()->group();
113 117
114 QDictIterator<KAddressBookView> it( mViewDict ); 118 QDictIterator<KAddressBookView> it( mViewDict );
115 for ( it.toFirst(); it.current(); ++it ) { 119 for ( it.toFirst(); it.current(); ++it ) {
116 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 120 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
117 it.current()->readConfig( mCore->config() ); 121 it.current()->readConfig( mCore->config() );
118 } 122 }
119 setActiveView( activeViewName ); 123 setActiveView( activeViewName );
120 124
121 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 125 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
122} 126}
123 127
124void ViewManager::saveSettings() 128void ViewManager::saveSettings()
125{ 129{
126 QString _oldgroup = mCore->config()->group(); 130 QString _oldgroup = mCore->config()->group();
127 131
128 QDictIterator<KAddressBookView> it( mViewDict ); 132 QDictIterator<KAddressBookView> it( mViewDict );
129 for ( it.toFirst(); it.current(); ++it ) { 133 for ( it.toFirst(); it.current(); ++it ) {
130 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 134 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
131#ifdef DESKTOP_VERSION 135#ifdef DESKTOP_VERSION
132 (*it)->writeConfig( mCore->config() ); 136 (*it)->writeConfig( mCore->config() );
133#else 137#else
134 (*it).writeConfig( mCore->config() ); 138 (*it).writeConfig( mCore->config() );
135#endif 139#endif
136 } 140 }
137 141
138 Filter::save( mCore->config(), "Filter", mFilterList ); 142 Filter::save( mCore->config(), "Filter", mFilterList );
139 KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem(); 143 KABPrefs::instance()->mCurrentFilter = mActionSelectFilter->currentItem();
140 144
141 // write the view name list 145 // write the view name list
142 KABPrefs::instance()->mViewNames = mViewNameList; 146 KABPrefs::instance()->mViewNames = mViewNameList;
143 KABPrefs::instance()->mCurrentView = mActiveView->caption(); 147 KABPrefs::instance()->mCurrentView = mActiveView->caption();
144 148
145} 149}
146 150
147QStringList ViewManager::selectedUids() const 151QStringList ViewManager::selectedUids() const
148{ 152{
149 if ( mActiveView ) 153 if ( mActiveView )
150 return mActiveView->selectedUids(); 154 return mActiveView->selectedUids();
151 else 155 else
152 return QStringList(); 156 return QStringList();
153} 157}
154 158
155QStringList ViewManager::selectedEmails() const 159QStringList ViewManager::selectedEmails() const
156{ 160{
157 if ( mActiveView ) 161 if ( mActiveView )
158 return mActiveView->selectedEmails(); 162 return mActiveView->selectedEmails();
159 else 163 else
160 return QStringList(); 164 return QStringList();
161} 165}
162 166
163KABC::Addressee::List ViewManager::selectedAddressees() const 167KABC::Addressee::List ViewManager::selectedAddressees() const
164{ 168{
165 KABC::Addressee::List list; 169 KABC::Addressee::List list;
166 if ( mActiveView ) { 170 if ( mActiveView ) {
167 QStringList uids = mActiveView->selectedUids(); 171 QStringList uids = mActiveView->selectedUids();
168 QStringList::Iterator it; 172 QStringList::Iterator it;
169 for ( it = uids.begin(); it != uids.end(); ++it ) { 173 for ( it = uids.begin(); it != uids.end(); ++it ) {
170 KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); 174 KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
171 if ( !addr.isEmpty() ) 175 if ( !addr.isEmpty() )
172 list.append( addr ); 176 list.append( addr );
173 } 177 }
174 } 178 }
175 179
176 return list; 180 return list;
177} 181}
178//US added another method with no parameter, since my moc compiler does not support default parameters. 182//US added another method with no parameter, since my moc compiler does not support default parameters.
179void ViewManager::setSelected() 183void ViewManager::setSelected()
180{ 184{
181 setSelected( QString::null, true ); 185 setSelected( QString::null, true );
182} 186}
183 187
184void ViewManager::setSelected( const QString &uid, bool selected ) 188void ViewManager::setSelected( const QString &uid, bool selected )
185{ 189{
186 if ( mActiveView ) 190 if ( mActiveView )
187 mActiveView->setSelected( uid, selected ); 191 mActiveView->setSelected( uid, selected );
188} 192}
189 193
190void ViewManager::setListSelected(QStringList list) 194void ViewManager::setListSelected(QStringList list)
191{ 195{
192 int i, count = list.count(); 196 int i, count = list.count();
193 for ( i = 0; i < count;++i ) 197 for ( i = 0; i < count;++i )
194 setSelected( list[i], true ); 198 setSelected( list[i], true );
195 199
196} 200}
197void ViewManager::unloadViews() 201void ViewManager::unloadViews()
198{ 202{
199 mViewDict.clear(); 203 mViewDict.clear();
200 mActiveView = 0; 204 mActiveView = 0;
201} 205}
202 206
203void ViewManager::setActiveView( const QString &name ) 207void ViewManager::setActiveView( const QString &name )
204{ 208{
205 KAddressBookView *view = 0; 209 KAddressBookView *view = 0;
@@ -504,193 +508,196 @@ void ViewManager::dropped( QDropEvent *e )
504 } 508 }
505 } else if ( c == 1 ) 509 } else if ( c == 1 )
506 emit urlDropped( *it ); 510 emit urlDropped( *it );
507 } else if ( KVCardDrag::decode( e, vcards ) ) { 511 } else if ( KVCardDrag::decode( e, vcards ) ) {
508 KABC::Addressee addr; 512 KABC::Addressee addr;
509 KABC::VCardConverter converter; 513 KABC::VCardConverter converter;
510 QStringList list = QStringList::split( "\r\n\r\n", vcards ); 514 QStringList list = QStringList::split( "\r\n\r\n", vcards );
511 QStringList::Iterator it; 515 QStringList::Iterator it;
512 for ( it = list.begin(); it != list.end(); ++it ) { 516 for ( it = list.begin(); it != list.end(); ++it ) {
513 if ( converter.vCardToAddressee( (*it).stripWhiteSpace(), addr ) ) { 517 if ( converter.vCardToAddressee( (*it).stripWhiteSpace(), addr ) ) {
514 KABC::Addressee a = mCore->addressBook()->findByUid( addr.uid() ); 518 KABC::Addressee a = mCore->addressBook()->findByUid( addr.uid() );
515 if ( a.isEmpty() ) { 519 if ( a.isEmpty() ) {
516 mCore->addressBook()->insertAddressee( addr ); 520 mCore->addressBook()->insertAddressee( addr );
517 emit modified(); 521 emit modified();
518 } 522 }
519 } 523 }
520 } 524 }
521 525
522 mActiveView->refresh(); 526 mActiveView->refresh();
523 } 527 }
524#else //KAB_EMBEDDED 528#else //KAB_EMBEDDED
525qDebug("ViewManager::dropped() has to be changed!!" ); 529qDebug("ViewManager::dropped() has to be changed!!" );
526#endif //KAB_EMBEDDED 530#endif //KAB_EMBEDDED
527 531
528} 532}
529 533
530void ViewManager::startDrag() 534void ViewManager::startDrag()
531{ 535{
532 kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl; 536 kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl;
533 537
534#ifndef KAB_EMBEDDED 538#ifndef KAB_EMBEDDED
535 539
536 // Get the list of all the selected addressees 540 // Get the list of all the selected addressees
537 KABC::Addressee::List addrList; 541 KABC::Addressee::List addrList;
538 QStringList uidList = selectedUids(); 542 QStringList uidList = selectedUids();
539 QStringList::Iterator iter; 543 QStringList::Iterator iter;
540 for ( iter = uidList.begin(); iter != uidList.end(); ++iter ) 544 for ( iter = uidList.begin(); iter != uidList.end(); ++iter )
541 addrList.append( mCore->addressBook()->findByUid( *iter ) ); 545 addrList.append( mCore->addressBook()->findByUid( *iter ) );
542 546
543 KMultipleDrag *drag = new KMultipleDrag( this ); 547 KMultipleDrag *drag = new KMultipleDrag( this );
544 drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); 548 drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) );
545 KABC::Addressee::List::Iterator it; 549 KABC::Addressee::List::Iterator it;
546 QStringList vcards; 550 QStringList vcards;
547 for ( it = addrList.begin(); it != addrList.end(); ++it ) { 551 for ( it = addrList.begin(); it != addrList.end(); ++it ) {
548 QString vcard = QString::null; 552 QString vcard = QString::null;
549 KABC::VCardConverter converter; 553 KABC::VCardConverter converter;
550 if ( converter.addresseeToVCard( *it, vcard ) ) 554 if ( converter.addresseeToVCard( *it, vcard ) )
551 vcards.append( vcard ); 555 vcards.append( vcard );
552 } 556 }
553 drag->addDragObject( new KVCardDrag( vcards.join( "\r\n" ), this ) ); 557 drag->addDragObject( new KVCardDrag( vcards.join( "\r\n" ), this ) );
554 558
555 drag->setPixmap( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop ) ); 559 drag->setPixmap( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop ) );
556 drag->dragCopy(); 560 drag->dragCopy();
557 561
558#else //KAB_EMBEDDED 562#else //KAB_EMBEDDED
559qDebug("ViewManager::startDrag() has to be changed!!" ); 563qDebug("ViewManager::startDrag() has to be changed!!" );
560#endif //KAB_EMBEDDED 564#endif //KAB_EMBEDDED
561 565
562} 566}
563void ViewManager::doSearch( const QString& s,KABC::Field *field ) 567void ViewManager::doSearch( const QString& s,KABC::Field *field )
564{ 568{
565 if ( mActiveView ) 569 if ( mActiveView )
566 mActiveView->doSearch( s, field ); 570 mActiveView->doSearch( s, field );
567 571
568} 572}
569void ViewManager::setActiveFilter( int index ) 573void ViewManager::setActiveFilter( int index )
570{ 574{
571 Filter currentFilter; 575 Filter currentFilter;
572 576
573 if ( ( index - 1 ) < 0 ) 577 if ( ( index - 1 ) < 0 )
574 currentFilter = Filter(); 578 currentFilter = Filter();
575 else 579 else
576 currentFilter = mFilterList[ index - 1 ]; 580 currentFilter = mFilterList[ index - 1 ];
577 581
578 // 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
579 // 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.
580 if ( mActiveView ) { 584 if ( mActiveView ) {
581 mActiveView->setFilter( currentFilter ); 585 mActiveView->setFilter( currentFilter );
582 mActiveView->refresh(); 586 mActiveView->refresh();
583 emit selected( QString::null ); 587 emit selected( QString::null );
584 } 588 }
585} 589}
586 590
587void ViewManager::configureFilters() 591void ViewManager::configureFilters()
588{ 592{
589 FilterDialog dlg( this ); 593 FilterDialog dlg( this );
590 594
591 dlg.setFilters( mFilterList ); 595 dlg.setFilters( mFilterList );
592 596
593 if ( dlg.exec() ) 597 if ( dlg.exec() )
594 mFilterList = dlg.filters(); 598 mFilterList = dlg.filters();
595 599
596 uint pos = mActionSelectFilter->currentItem(); 600 uint pos = mActionSelectFilter->currentItem();
597 mActionSelectFilter->setItems( filterNames() ); 601 mActionSelectFilter->setItems( filterNames() );
598 mActionSelectFilter->setCurrentItem( pos ); 602 mActionSelectFilter->setCurrentItem( pos );
599 setActiveFilter( pos ); 603 setActiveFilter( pos );
600 mActionSelectFilter->setComboWidth( 150 ); 604 int cw = 150;
605 if (QApplication::desktop()->width() == 480 )
606 cw = 0;
607 mActionSelectFilter->setComboWidth( cw );
601} 608}
602 609
603QStringList ViewManager::filterNames() const 610QStringList ViewManager::filterNames() const
604{ 611{
605 QStringList names( i18n( "No Filter" ) ); 612 QStringList names( i18n( "No Filter" ) );
606 613
607 Filter::List::ConstIterator it; 614 Filter::List::ConstIterator it;
608 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) 615 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
609 names.append( (*it).name() ); 616 names.append( (*it).name() );
610 617
611 return names; 618 return names;
612} 619}
613 620
614int ViewManager::filterPosition( const QString &name ) const 621int ViewManager::filterPosition( const QString &name ) const
615{ 622{
616 int pos = 0; 623 int pos = 0;
617 624
618 Filter::List::ConstIterator it; 625 Filter::List::ConstIterator it;
619 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos ) 626 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos )
620 if ( name == (*it).name() ) 627 if ( name == (*it).name() )
621 return pos + 1; 628 return pos + 1;
622 629
623 return 0; 630 return 0;
624} 631}
625 632
626void ViewManager::initActions() 633void ViewManager::initActions()
627{ 634{
628//US <ActionList name="view_loadedviews"/> 635//US <ActionList name="view_loadedviews"/>
629//US <Separator/> 636//US <Separator/>
630 637
631#ifdef KAB_EMBEDDED 638#ifdef KAB_EMBEDDED
632 QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu(); 639 QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu();
633 QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); 640 QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu();
634 QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); 641 QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu();
635#endif //KAB_EMBEDDED 642#endif //KAB_EMBEDDED
636 643
637 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); 644 mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" );
638#if KDE_VERSION >= 309 645#if KDE_VERSION >= 309
639 mActionSelectView->setMenuAccelsEnabled( false ); 646 mActionSelectView->setMenuAccelsEnabled( false );
640#endif 647#endif
641 connect( mActionSelectView, SIGNAL( activated( const QString& ) ), 648 connect( mActionSelectView, SIGNAL( activated( const QString& ) ),
642 SLOT( setActiveView( const QString& ) ) ); 649 SLOT( setActiveView( const QString& ) ) );
643 650
644 651
645#ifdef KAB_EMBEDDED 652#ifdef KAB_EMBEDDED
646 mActionSelectView->plug(viewmenu); 653 mActionSelectView->plug(viewmenu);
647 viewmenu->insertSeparator(); 654 viewmenu->insertSeparator();
648#endif //KAB_EMBEDDED 655#endif //KAB_EMBEDDED
649 656
650 KAction *action; 657 KAction *action;
651 658
652 action = new KAction( i18n( "Modify View..." ), "configure", 0, this, 659 action = new KAction( i18n( "Modify View..." ), "configure", 0, this,
653 SLOT( editView() ), mCore->actionCollection(), "view_modify" ); 660 SLOT( editView() ), mCore->actionCollection(), "view_modify" );
654#ifndef KAB_EMBEDDED 661#ifndef KAB_EMBEDDED
655 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." ) ); 662 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." ) );
656#else //KAB_EMBEDDED 663#else //KAB_EMBEDDED
657 action->plug(viewmenu); 664 action->plug(viewmenu);
658#endif //KAB_EMBEDDED 665#endif //KAB_EMBEDDED
659 666
660 action = new KAction( i18n( "Add View..." ), "window_new", 0, this, 667 action = new KAction( i18n( "Add View..." ), "window_new", 0, this,
661 SLOT( addView() ), mCore->actionCollection(), "view_add" ); 668 SLOT( addView() ), mCore->actionCollection(), "view_add" );
662#ifndef KAB_EMBEDDED 669#ifndef KAB_EMBEDDED
663 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." ) ); 670 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." ) );
664#else //KAB_EMBEDDED 671#else //KAB_EMBEDDED
665 action->plug(viewmenu); 672 action->plug(viewmenu);
666#endif //KAB_EMBEDDED 673#endif //KAB_EMBEDDED
667 674
668 mActionDeleteView = new KAction( i18n( "Delete View" ), "view_remove", 0, 675 mActionDeleteView = new KAction( i18n( "Delete View" ), "view_remove", 0,
669 this, SLOT( deleteView() ), 676 this, SLOT( deleteView() ),
670 mCore->actionCollection(), "view_delete" ); 677 mCore->actionCollection(), "view_delete" );
671#ifndef KAB_EMBEDDED 678#ifndef KAB_EMBEDDED
672 mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) ); 679 mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) );
673#else //KAB_EMBEDDED 680#else //KAB_EMBEDDED
674 mActionDeleteView->plug(viewmenu); 681 mActionDeleteView->plug(viewmenu);
675 viewmenu->insertSeparator(); 682 viewmenu->insertSeparator();
676#endif //KAB_EMBEDDED 683#endif //KAB_EMBEDDED
677 684
678#ifndef KAB_EMBEDDED 685#ifndef KAB_EMBEDDED
679 action = new KAction( i18n( "Refresh View" ), "reload", 0, this, 686 action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
680 SLOT( refreshView(const QString &) ), mCore->actionCollection(), 687 SLOT( refreshView(const QString &) ), mCore->actionCollection(),
681 "view_refresh" ); 688 "view_refresh" );
682 action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) ); 689 action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) );
683#else //KAB_EMBEDDED 690#else //KAB_EMBEDDED
684 action = new KAction( i18n( "Refresh View" ), "reload", 0, this, 691 action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
685 SLOT( refreshView()), mCore->actionCollection(), 692 SLOT( refreshView()), mCore->actionCollection(),
686 "view_refresh" ); 693 "view_refresh" );
687 action->plug(viewmenu); 694 action->plug(viewmenu);
688 viewmenu->insertSeparator(); 695 viewmenu->insertSeparator();
689#endif //KAB_EMBEDDED 696#endif //KAB_EMBEDDED
690 697
691 action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this, 698 action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this,
692 SLOT( configureFilters() ), mCore->actionCollection(), 699 SLOT( configureFilters() ), mCore->actionCollection(),
693 "options_edit_filters" ); 700 "options_edit_filters" );
694 701
695 mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); 702 mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" );
696#if KDE_VERSION >= 309 703#if KDE_VERSION >= 309