summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/imagewidget.cpp25
-rw-r--r--kaddressbook/kabcore.cpp52
-rw-r--r--kaddressbook/xxportselectdialog.cpp48
-rw-r--r--kaddressbook/xxportselectdialog.h1
4 files changed, 87 insertions, 39 deletions
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp
index 9ee4eac..1e9743c 100644
--- a/kaddressbook/imagewidget.cpp
+++ b/kaddressbook/imagewidget.cpp
@@ -24,124 +24,123 @@
24#include <kabc/picture.h> 24#include <kabc/picture.h>
25 25
26#ifndef KAB_EMBEDDED 26#ifndef KAB_EMBEDDED
27#include <kaccelmanager.h> 27#include <kaccelmanager.h>
28#include <kio/netaccess.h> 28#include <kio/netaccess.h>
29#include <kimageio.h> 29#include <kimageio.h>
30#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
31 31
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kdialog.h> 33#include <kdialog.h>
34#include <kiconloader.h> 34#include <kiconloader.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kurlrequester.h> 36#include <kurlrequester.h>
37#include <kurl.h> 37#include <kurl.h>
38 38
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qgroupbox.h> 40#include <qgroupbox.h>
41#include <qlabel.h> 41#include <qlabel.h>
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qpixmap.h> 43#include <qpixmap.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qapplication.h> 45#include <qapplication.h>
46 46
47#include "imagewidget.h" 47#include "imagewidget.h"
48 48
49ImageWidget::ImageWidget( QWidget *parent, const char *name ) 49ImageWidget::ImageWidget( QWidget *parent, const char *name )
50 : QWidget( parent, name ) 50 : QWidget( parent, name )
51{ 51{
52 QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), 52 QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(),
53 KDialog::spacingHint() ); 53 KDialog::spacingHint() );
54 54
55 QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); 55 QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this );
56 QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 4, 2, 56 QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2,
57 KDialog::spacingHint() ); 57 KDialog::spacingHint() );
58 boxLayout->setRowStretch( 2, 1 ); 58 boxLayout->setRowStretch( 2, 1 );
59 59
60 mPhotoLabel = new QLabel( photoBox ); 60 mPhotoLabel = new QLabel( photoBox );
61 int fac = 9; 61 int fac = 9;
62 if ( QApplication::desktop()->width() > 320 ) 62 if ( QApplication::desktop()->width() > 320 )
63 fac = 6; 63 fac = 6;
64 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 64 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac );
65 mPhotoLabel->setScaledContents( true ); 65 mPhotoLabel->setScaledContents( true );
66 mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 66 mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
67 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); 67 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 );
68 68
69 mPhotoUrl = new KURLRequester( photoBox ); 69 mPhotoUrl = new KURLRequester( photoBox );
70#ifndef KAB_EMBEDDED 70#ifndef KAB_EMBEDDED
71 mPhotoUrl->setFilter( KImageIO::pattern() ); 71 mPhotoUrl->setFilter( KImageIO::pattern() );
72#else //KAB_EMBEDDED 72#else //KAB_EMBEDDED
73//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???"); 73//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???");
74#endif //KAB_EMBEDDED 74#endif //KAB_EMBEDDED
75 75
76 76
77 boxLayout->addWidget( mPhotoUrl, 0, 1 ); 77 boxLayout->addWidget( mPhotoUrl, 0, 1 );
78 78 QHBox *hb1 = new QHBox ( photoBox );
79 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), photoBox ); 79 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 );
80 mUsePhotoUrl->setEnabled( false ); 80 mUsePhotoUrl->setEnabled( false );
81 boxLayout->addWidget( mUsePhotoUrl, 1, 1 ); 81 boxLayout->addWidget( hb1, 1, 1 );
82 82
83 QPushButton * pb = new QPushButton( i18n( "Remove" ), photoBox ); 83 QPushButton * pb = new QPushButton( i18n( "Remove" ), hb1 );
84 connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) ); 84 connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) );
85 boxLayout->addWidget( pb, 2, 1 ); 85 boxLayout->addWidget( new QLabel( photoBox ), 2, 1 );
86 boxLayout->addWidget( new QLabel( photoBox ), 3, 1 );
87 86
88 topLayout->addWidget( photoBox, 0, 0 ); 87 topLayout->addWidget( photoBox, 0, 0 );
89 88
90 QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); 89 QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this );
91 boxLayout = new QGridLayout( logoBox->layout(), 4, 2, KDialog::spacingHint() ); 90 boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() );
92 boxLayout->setRowStretch( 2, 1 ); 91 boxLayout->setRowStretch( 2, 1 );
93 92
94 mLogoLabel = new QLabel( logoBox ); 93 mLogoLabel = new QLabel( logoBox );
95 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 94 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac );
96 mLogoLabel->setScaledContents( true ); 95 mLogoLabel->setScaledContents( true );
97 mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 96 mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
98 boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); 97 boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 );
99 98
100 mLogoUrl = new KURLRequester( logoBox ); 99 mLogoUrl = new KURLRequester( logoBox );
101#ifndef KAB_EMBEDDED 100#ifndef KAB_EMBEDDED
102 mLogoUrl->setFilter( KImageIO::pattern() ); 101 mLogoUrl->setFilter( KImageIO::pattern() );
103#else //KAB_EMBEDDED 102#else //KAB_EMBEDDED
104//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); 103//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2");
105#endif //KAB_EMBEDDED 104#endif //KAB_EMBEDDED
106 boxLayout->addWidget( mLogoUrl, 0, 1 ); 105 boxLayout->addWidget( mLogoUrl, 0, 1 );
107 106
108 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), logoBox ); 107 QHBox *hb2 = new QHBox ( logoBox );
108 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 );
109 mUseLogoUrl->setEnabled( false ); 109 mUseLogoUrl->setEnabled( false );
110 boxLayout->addWidget( mUseLogoUrl, 1, 1 ); 110 boxLayout->addWidget( hb2, 1, 1 );
111 111
112 pb = new QPushButton( i18n( "Remove" ), logoBox ); 112 pb = new QPushButton( i18n( "Remove" ), hb2 );
113 connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) ); 113 connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) );
114 boxLayout->addWidget( pb, 2, 1 ); 114 boxLayout->addWidget( new QLabel( logoBox ), 2, 1 );
115 boxLayout->addWidget( new QLabel( logoBox ), 3, 1 );
116 topLayout->addWidget( logoBox, 1, 0 ); 115 topLayout->addWidget( logoBox, 1, 0 );
117 116
118 connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ), 117 connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ),
119 SIGNAL( changed() ) ); 118 SIGNAL( changed() ) );
120 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), 119 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
121 SLOT( loadPhoto() ) ); 120 SLOT( loadPhoto() ) );
122 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), 121 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
123 SIGNAL( changed() ) ); 122 SIGNAL( changed() ) );
124 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), 123 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
125 SLOT( updateGUI() ) ); 124 SLOT( updateGUI() ) );
126 connect( mUsePhotoUrl, SIGNAL( toggled( bool ) ), 125 connect( mUsePhotoUrl, SIGNAL( toggled( bool ) ),
127 SIGNAL( changed() ) ); 126 SIGNAL( changed() ) );
128 127
129 connect( mLogoUrl, SIGNAL( textChanged( const QString& ) ), 128 connect( mLogoUrl, SIGNAL( textChanged( const QString& ) ),
130 SIGNAL( changed() ) ); 129 SIGNAL( changed() ) );
131 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), 130 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
132 SLOT( loadLogo() ) ); 131 SLOT( loadLogo() ) );
133 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), 132 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
134 SIGNAL( changed() ) ); 133 SIGNAL( changed() ) );
135 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), 134 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
136 SLOT( updateGUI() ) ); 135 SLOT( updateGUI() ) );
137 connect( mUseLogoUrl, SIGNAL( toggled( bool ) ), 136 connect( mUseLogoUrl, SIGNAL( toggled( bool ) ),
138 SIGNAL( changed() ) ); 137 SIGNAL( changed() ) );
139 138
140#ifndef KAB_EMBEDDED 139#ifndef KAB_EMBEDDED
141 KAcceleratorManager::manage( this ); 140 KAcceleratorManager::manage( this );
142#endif //KAB_EMBEDDED 141#endif //KAB_EMBEDDED
143 142
144} 143}
145 144
146ImageWidget::~ImageWidget() 145ImageWidget::~ImageWidget()
147{ 146{
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 9526f23..d393660 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -196,65 +196,66 @@ class KABCatPrefs : public QDialog
196private: 196private:
197 QRadioButton* addCatBut; 197 QRadioButton* addCatBut;
198}; 198};
199 199
200class KABFormatPrefs : public QDialog 200class KABFormatPrefs : public QDialog
201{ 201{
202 public: 202 public:
203 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : 203 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) :
204 QDialog( parent, name, true ) 204 QDialog( parent, name, true )
205 { 205 {
206 setCaption( i18n("Set formatted name") ); 206 setCaption( i18n("Set formatted name") );
207 QVBoxLayout* lay = new QVBoxLayout( this ); 207 QVBoxLayout* lay = new QVBoxLayout( this );
208 lay->setSpacing( 3 ); 208 lay->setSpacing( 3 );
209 lay->setMargin( 3 ); 209 lay->setMargin( 3 );
210 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); 210 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this );
211 lay->addWidget( lab ); 211 lay->addWidget( lab );
212 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 212 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this );
213 lay->addWidget( format ); 213 lay->addWidget( format );
214 format->setExclusive ( true ) ; 214 format->setExclusive ( true ) ;
215 simple = new QRadioButton(i18n("Simple: James Bond"), format ); 215 simple = new QRadioButton(i18n("Simple: James Bond"), format );
216 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); 216 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format );
217 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 217 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
218 company = new QRadioButton(i18n("Organization: MI6"), format ); 218 company = new QRadioButton(i18n("Organization: MI6"), format );
219 simple->setChecked( true ); 219 simple->setChecked( true );
220 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); 220 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this);
221 lay->addWidget( setCompany ); 221 lay->addWidget( setCompany );
222 QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); 222 QPushButton * ok = new QPushButton( i18n("Select contact list"), this );
223 lay->addWidget( ok ); 223 lay->addWidget( ok );
224 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 224 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
225 lay->addWidget( cancel ); 225 lay->addWidget( cancel );
226 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 226 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
227 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 227 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
228 resize( 200, 200 ); 228 //resize( 200, 200 );
229
229 } 230 }
230public: 231public:
231 QRadioButton* simple, *full, *reverse, *company; 232 QRadioButton* simple, *full, *reverse, *company;
232 QCheckBox* setCompany; 233 QCheckBox* setCompany;
233}; 234};
234 235
235 236
236 237
237class KAex2phonePrefs : public QDialog 238class KAex2phonePrefs : public QDialog
238{ 239{
239 public: 240 public:
240 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 241 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
241 QDialog( parent, name, true ) 242 QDialog( parent, name, true )
242 { 243 {
243 setCaption( i18n("Export to phone options") ); 244 setCaption( i18n("Export to phone options") );
244 QVBoxLayout* lay = new QVBoxLayout( this ); 245 QVBoxLayout* lay = new QVBoxLayout( this );
245 lay->setSpacing( 3 ); 246 lay->setSpacing( 3 );
246 lay->setMargin( 3 ); 247 lay->setMargin( 3 );
247 QLabel *lab; 248 QLabel *lab;
248 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 249 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
249 lab->setAlignment (AlignHCenter ); 250 lab->setAlignment (AlignHCenter );
250 QHBox* temphb; 251 QHBox* temphb;
251 temphb = new QHBox( this ); 252 temphb = new QHBox( this );
252 new QLabel( i18n("I/O device: "), temphb ); 253 new QLabel( i18n("I/O device: "), temphb );
253 mPhoneDevice = new QLineEdit( temphb); 254 mPhoneDevice = new QLineEdit( temphb);
254 lay->addWidget( temphb ); 255 lay->addWidget( temphb );
255 temphb = new QHBox( this ); 256 temphb = new QHBox( this );
256 new QLabel( i18n("Connection: "), temphb ); 257 new QLabel( i18n("Connection: "), temphb );
257 mPhoneConnection = new QLineEdit( temphb); 258 mPhoneConnection = new QLineEdit( temphb);
258 lay->addWidget( temphb ); 259 lay->addWidget( temphb );
259 temphb = new QHBox( this ); 260 temphb = new QHBox( this );
260 new QLabel( i18n("Model(opt.): "), temphb ); 261 new QLabel( i18n("Model(opt.): "), temphb );
@@ -1344,65 +1345,66 @@ void KABCore::editContact( const QString &uid )
1344 } 1345 }
1345} 1346}
1346 1347
1347/** 1348/**
1348 Shows or edits the detail view for the given uid. If the uid is QString::null, 1349 Shows or edits the detail view for the given uid. If the uid is QString::null,
1349 the method will try to find a selected addressee in the view. 1350 the method will try to find a selected addressee in the view.
1350 */ 1351 */
1351void KABCore::executeContact( const QString &uid /*US = QString::null*/ ) 1352void KABCore::executeContact( const QString &uid /*US = QString::null*/ )
1352{ 1353{
1353 if ( mMultipleViewsAtOnce ) 1354 if ( mMultipleViewsAtOnce )
1354 { 1355 {
1355 editContact( uid ); 1356 editContact( uid );
1356 } 1357 }
1357 else 1358 else
1358 { 1359 {
1359 setDetailsVisible( true ); 1360 setDetailsVisible( true );
1360 mActionDetails->setChecked(true); 1361 mActionDetails->setChecked(true);
1361 } 1362 }
1362 1363
1363} 1364}
1364 1365
1365void KABCore::save() 1366void KABCore::save()
1366{ 1367{
1367 if (syncManager->blockSave()) 1368 if (syncManager->blockSave())
1368 return; 1369 return;
1369 if ( !mModified ) 1370 if ( !mModified )
1370 return; 1371 return;
1371 1372
1372 syncManager->setBlockSave(true); 1373 syncManager->setBlockSave(true);
1373 QString text = i18n( "There was an error while attempting to save\n the " 1374 QString text = i18n( "There was an error while attempting to save\n the "
1374 "address book. Please check that some \nother application is " 1375 "address book. Please check that some \nother application is "
1375 "not using it. " ); 1376 "not using it. " );
1376 message(i18n("Saving addressbook ... ")); 1377 message(i18n("Saving ... please wait! "));
1378 qApp->processEvents();
1377#ifndef KAB_EMBEDDED 1379#ifndef KAB_EMBEDDED
1378 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); 1380 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook );
1379 if ( !b || !b->save() ) { 1381 if ( !b || !b->save() ) {
1380 KMessageBox::error( this, text, i18n( "Unable to Save" ) ); 1382 KMessageBox::error( this, text, i18n( "Unable to Save" ) );
1381 } 1383 }
1382#else //KAB_EMBEDDED 1384#else //KAB_EMBEDDED
1383 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); 1385 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook );
1384 if ( !b || !b->save() ) { 1386 if ( !b || !b->save() ) {
1385 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); 1387 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok"));
1386 } 1388 }
1387#endif //KAB_EMBEDDED 1389#endif //KAB_EMBEDDED
1388 1390
1389 message(i18n("Addressbook saved!")); 1391 message(i18n("Addressbook saved!"));
1390 setModified( false ); 1392 setModified( false );
1391 syncManager->setBlockSave(false); 1393 syncManager->setBlockSave(false);
1392} 1394}
1393 1395
1394 1396
1395void KABCore::undo() 1397void KABCore::undo()
1396{ 1398{
1397 UndoStack::instance()->undo(); 1399 UndoStack::instance()->undo();
1398 1400
1399 // Refresh the view 1401 // Refresh the view
1400 mViewManager->refreshView(); 1402 mViewManager->refreshView();
1401} 1403}
1402 1404
1403void KABCore::redo() 1405void KABCore::redo()
1404{ 1406{
1405 RedoStack::instance()->redo(); 1407 RedoStack::instance()->redo();
1406 1408
1407 // Refresh the view 1409 // Refresh the view
1408 mViewManager->refreshView(); 1410 mViewManager->refreshView();
@@ -2334,89 +2336,95 @@ void KABCore::manageCategories( )
2334 mAddressBook->insertAddressee( (*it) ); 2336 mAddressBook->insertAddressee( (*it) );
2335 } 2337 }
2336 } 2338 }
2337 setModified( true ); 2339 setModified( true );
2338 mViewManager->refreshView(); 2340 mViewManager->refreshView();
2339 message( i18n("Removing categories done!")); 2341 message( i18n("Removing categories done!"));
2340 } 2342 }
2341 delete cp; 2343 delete cp;
2342} 2344}
2343void KABCore::removeVoice() 2345void KABCore::removeVoice()
2344{ 2346{
2345 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) 2347 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
2346 return; 2348 return;
2347 KABC::Addressee::List list; 2349 KABC::Addressee::List list;
2348 XXPortSelectDialog dlg( this, false, this ); 2350 XXPortSelectDialog dlg( this, false, this );
2349 if ( dlg.exec() ) 2351 if ( dlg.exec() )
2350 list = dlg.contacts(); 2352 list = dlg.contacts();
2351 else 2353 else
2352 return; 2354 return;
2353 KABC::Addressee::List::Iterator it; 2355 KABC::Addressee::List::Iterator it;
2354 for ( it = list.begin(); it != list.end(); ++it ) { 2356 for ( it = list.begin(); it != list.end(); ++it ) {
2355 if ( (*it).removeVoice() ) 2357 if ( (*it).removeVoice() )
2356 addrModified((*it), false ); 2358 addrModified((*it), false );
2357 } 2359 }
2358} 2360}
2359 2361
2360void KABCore::setFormattedName() 2362void KABCore::setFormattedName()
2361{ 2363{
2362 KABFormatPrefs setpref; 2364 KABFormatPrefs setpref;
2363 if ( !setpref.exec() ) { 2365 if ( !setpref.exec() ) {
2364 return; 2366 return;
2365 } 2367 }
2366 KABC::Addressee::List list;
2367 XXPortSelectDialog dlg( this, false, this ); 2368 XXPortSelectDialog dlg( this, false, this );
2368 if ( dlg.exec() ) 2369 if ( !dlg.exec() )
2369 list = dlg.contacts();
2370 else
2371 return; 2370 return;
2372 KABC::Addressee::List::Iterator it; 2371 mAddressBook->setUntagged();
2373 for ( it = list.begin(); it != list.end(); ++it ) { 2372 dlg.tagSelected();
2374 QString fName; 2373 int count = 0;
2375 if ( setpref.simple->isChecked() ) 2374 KABC::AddressBook::Iterator it;
2376 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); 2375 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2377 else if ( setpref.full->isChecked() ) 2376 if ( (*it).tagged() ) {
2378 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); 2377 message(i18n("Changing contact #%1").arg( ++count ) );
2379 else if ( setpref.reverse->isChecked() ) 2378 qApp->processEvents();
2380 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); 2379 QString fName;
2381 else 2380 if ( setpref.simple->isChecked() )
2382 fName = (*it).organization(); 2381 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName );
2383 if ( setpref.setCompany->isChecked() ) 2382 else if ( setpref.full->isChecked() )
2384 if ( fName.isEmpty() || fName =="," ) 2383 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName );
2384 else if ( setpref.reverse->isChecked() )
2385 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName );
2386 else
2385 fName = (*it).organization(); 2387 fName = (*it).organization();
2386 (*it).setFormattedName( fName ); 2388 if ( setpref.setCompany->isChecked() )
2387 addrModified((*it),false ); 2389 if ( fName.isEmpty() || fName =="," )
2390 fName = (*it).organization();
2391 (*it).setFormattedName( fName );
2392 }
2388 } 2393 }
2394 message(i18n("Refreshing view...") );
2395 mViewManager->refreshView( "" );
2389 Addressee add; 2396 Addressee add;
2390 mDetails->setAddressee( add ); 2397 mDetails->setAddressee( add );
2398 message(i18n("Setting formatted name completed!") );
2391} 2399}
2392 2400
2393void KABCore::clipboardDataChanged() 2401void KABCore::clipboardDataChanged()
2394{ 2402{
2395 2403
2396 if ( mReadWrite ) 2404 if ( mReadWrite )
2397 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2405 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
2398 2406
2399} 2407}
2400 2408
2401void KABCore::updateActionMenu() 2409void KABCore::updateActionMenu()
2402{ 2410{
2403 UndoStack *undo = UndoStack::instance(); 2411 UndoStack *undo = UndoStack::instance();
2404 RedoStack *redo = RedoStack::instance(); 2412 RedoStack *redo = RedoStack::instance();
2405 2413
2406 if ( undo->isEmpty() ) 2414 if ( undo->isEmpty() )
2407 mActionUndo->setText( i18n( "Undo" ) ); 2415 mActionUndo->setText( i18n( "Undo" ) );
2408 else 2416 else
2409 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 2417 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
2410 2418
2411 mActionUndo->setEnabled( !undo->isEmpty() ); 2419 mActionUndo->setEnabled( !undo->isEmpty() );
2412 2420
2413 if ( !redo->top() ) 2421 if ( !redo->top() )
2414 mActionRedo->setText( i18n( "Redo" ) ); 2422 mActionRedo->setText( i18n( "Redo" ) );
2415 else 2423 else
2416 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2424 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2417 2425
2418 mActionRedo->setEnabled( !redo->isEmpty() ); 2426 mActionRedo->setEnabled( !redo->isEmpty() );
2419} 2427}
2420 2428
2421void KABCore::configureKeyBindings() 2429void KABCore::configureKeyBindings()
2422{ 2430{
@@ -3177,65 +3185,65 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3177 disableBR( true ); 3185 disableBR( true );
3178 if ( manager != syncManager ) 3186 if ( manager != syncManager )
3179 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); 3187 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager ");
3180 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3188 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3181 3189
3182 AddressBook abLocal( resource,"syncContact"); 3190 AddressBook abLocal( resource,"syncContact");
3183 bool syncOK = false; 3191 bool syncOK = false;
3184 if ( abLocal.load() ) { 3192 if ( abLocal.load() ) {
3185 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3193 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
3186 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3194 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3187 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); 3195 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
3188 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3196 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3189 if ( syncOK ) { 3197 if ( syncOK ) {
3190 if ( syncManager->mWriteBackFile ) { 3198 if ( syncManager->mWriteBackFile ) {
3191 abLocal.removeSyncAddressees( false ); 3199 abLocal.removeSyncAddressees( false );
3192 abLocal.saveAB(); 3200 abLocal.saveAB();
3193 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3201 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3194 } 3202 }
3195 } else 3203 } else
3196 message( i18n("Sync cancelled or failed.") ); 3204 message( i18n("Sync cancelled or failed.") );
3197 setModified(); 3205 setModified();
3198 } 3206 }
3199 abLocal.removeResources(); 3207 abLocal.removeResources();
3200 if ( syncOK ) 3208 if ( syncOK )
3201 mViewManager->refreshView(); 3209 mViewManager->refreshView();
3202 disableBR( false ); 3210 disableBR( false );
3203 return syncOK; 3211 return syncOK;
3204 3212
3205} 3213}
3206void KABCore::message( QString m ) 3214void KABCore::message( QString m )
3207{ 3215{
3208 topLevelWidget()->setCaption( m ); 3216 topLevelWidget()->setCaption( m );
3209 mMessageTimer->start( 15000, true ); 3217 mMessageTimer->start( 20000, true );
3210} 3218}
3211bool KABCore::syncPhone() 3219bool KABCore::syncPhone()
3212{ 3220{
3213 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 3221 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
3214 QString fileName = getPhoneFile(); 3222 QString fileName = getPhoneFile();
3215 if ( !PhoneAccess::readFromPhone( fileName) ) { 3223 if ( !PhoneAccess::readFromPhone( fileName) ) {
3216 message(i18n("Phone access failed!")); 3224 message(i18n("Phone access failed!"));
3217 return false; 3225 return false;
3218 } 3226 }
3219 AddressBook abLocal( fileName,"syncContact"); 3227 AddressBook abLocal( fileName,"syncContact");
3220 bool syncOK = false; 3228 bool syncOK = false;
3221 { 3229 {
3222 abLocal.importFromFile( fileName ); 3230 abLocal.importFromFile( fileName );
3223 qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3231 qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
3224 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3232 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3225 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 3233 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
3226 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3234 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3227 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3235 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3228 if ( syncOK ) { 3236 if ( syncOK ) {
3229 if ( syncManager->mWriteBackFile ) { 3237 if ( syncManager->mWriteBackFile ) {
3230 abLocal.removeSyncAddressees( true ); 3238 abLocal.removeSyncAddressees( true );
3231 abLocal.saveABphone( fileName ); 3239 abLocal.saveABphone( fileName );
3232 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3240 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3233 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3241 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3234 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3242 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3235 } 3243 }
3236 } 3244 }
3237 setModified(); 3245 setModified();
3238 } 3246 }
3239 abLocal.removeResources(); 3247 abLocal.removeResources();
3240 if ( syncOK ) 3248 if ( syncOK )
3241 mViewManager->refreshView(); 3249 mViewManager->refreshView();
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index 6282453..e7bc8c0 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -25,126 +25,166 @@
25/* 25/*
26Enhanced Version of the file for platform independent KDE tools. 26Enhanced Version of the file for platform independent KDE tools.
27Copyright (c) 2004 Ulf Schenk 27Copyright (c) 2004 Ulf Schenk
28 28
29$Id$ 29$Id$
30*/ 30*/
31 31
32#include <kabc/addressbook.h> 32#include <kabc/addressbook.h>
33#include <kapplication.h> 33#include <kapplication.h>
34#include <kcombobox.h> 34#include <kcombobox.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kglobal.h> 36#include <kglobal.h>
37 37
38#include <qapplication.h> 38#include <qapplication.h>
39#include <qbuttongroup.h> 39#include <qbuttongroup.h>
40#include <qcombobox.h> 40#include <qcombobox.h>
41#include <qheader.h> 41#include <qheader.h>
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qlistview.h> 44#include <qlistview.h>
45#include <qpushbutton.h> 45#include <qpushbutton.h>
46#include <qradiobutton.h> 46#include <qradiobutton.h>
47#include <qstringlist.h> 47#include <qstringlist.h>
48#include <qwhatsthis.h> 48#include <qwhatsthis.h>
49 49
50#include "kabcore.h" 50#include "kabcore.h"
51#include "kabprefs.h" 51#include "kabprefs.h"
52 52
53#include "xxportselectdialog.h" 53#include "xxportselectdialog.h"
54 54
55XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, 55XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
56 QWidget* parent, const char* name ) 56 QWidget* parent, const char* name )
57 : KDialogBase( Plain, i18n( "Choose which contacts to select" ), Help | Ok | Cancel, 57 : KDialogBase( Plain, i18n( "Choose contact selection" ), Help | Ok | Cancel,
58 Ok, parent, name, true, true ), mCore( core ), 58 Ok, parent, name, true, true ), mCore( core ),
59 mUseSorting( sort ) 59 mUseSorting( sort )
60{ 60{
61 initGUI(); 61 initGUI();
62 62
63 connect( mFiltersCombo, SIGNAL( activated( int ) ), 63 connect( mFiltersCombo, SIGNAL( activated( int ) ),
64 SLOT( filterChanged( int ) ) ); 64 SLOT( filterChanged( int ) ) );
65 connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), 65 connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ),
66 SLOT( categoryClicked( QListViewItem* ) ) ); 66 SLOT( categoryClicked( QListViewItem* ) ) );
67 67
68 // setup filters 68 // setup filters
69#ifndef KAB_EMBEDDED 69#ifndef KAB_EMBEDDED
70 mFilters = Filter::restore( kapp->config(), "Filter" ); 70 mFilters = Filter::restore( kapp->config(), "Filter" );
71 Filter::List::iterator filterIt; 71 Filter::List::iterator filterIt;
72#else //KAB_EMBEDDED 72#else //KAB_EMBEDDED
73 mFilters = Filter::restore( KGlobal::config(), "Filter" ); 73 mFilters = Filter::restore( KGlobal::config(), "Filter" );
74 Filter::List::Iterator filterIt; 74 Filter::List::Iterator filterIt;
75#endif //KAB_EMBEDDED 75#endif //KAB_EMBEDDED
76 QStringList filters; 76 QStringList filters;
77 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 77 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
78 filters.append( (*filterIt).name() ); 78 filters.append( (*filterIt).name() );
79 79
80 mFiltersCombo->insertStringList( filters ); 80 mFiltersCombo->insertStringList( filters );
81 mUseFilters->setEnabled( filters.count() > 0 ); 81 mUseFilters->setEnabled( filters.count() > 0 );
82 82
83 // setup categories 83 // setup categories
84 QStringList categories = KABPrefs::instance()->mCustomCategories; 84 QStringList categories = KABPrefs::instance()->mCustomCategories;
85 QStringList::Iterator it; 85 QStringList::Iterator it;
86 for ( it = categories.begin(); it != categories.end(); ++it ) 86 for ( it = categories.begin(); it != categories.end(); ++it )
87 new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); 87 new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox );
88 mUseCategories->setEnabled( categories.count() > 0 ); 88 mUseCategories->setEnabled( categories.count() > 0 );
89 89
90 int count = mCore->selectedUIDs().count(); 90 int count = mCore->selectedUIDs().count();
91 mUseSelection->setEnabled( count != 0 ); 91 mUseSelection->setEnabled( count != 0 );
92 mUseSelection->setChecked( count > 1 ); 92 mUseSelection->setChecked( count > 1 );
93 93
94 mSortTypeCombo->insertItem( i18n( "Ascending" ) ); 94 mSortTypeCombo->insertItem( i18n( "Ascending" ) );
95 mSortTypeCombo->insertItem( i18n( "Descending" ) ); 95 mSortTypeCombo->insertItem( i18n( "Descending" ) );
96 96
97 mFields = mCore->addressBook()->fields( KABC::Field::All ); 97 mFields = mCore->addressBook()->fields( KABC::Field::All );
98 KABC::Field::List::Iterator fieldIt; 98 KABC::Field::List::Iterator fieldIt;
99 for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt ) 99 for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt )
100 mFieldCombo->insertItem( (*fieldIt)->label() ); 100 mFieldCombo->insertItem( (*fieldIt)->label() );
101} 101}
102 102
103QStringList XXPortSelectDialog::uids() 103QStringList XXPortSelectDialog::uids()
104{ 104{
105 QStringList uidlist; 105 QStringList uidlist;
106 KABC::AddresseeList list = contacts(); 106 KABC::AddresseeList list = contacts();
107 KABC::Addressee::List::Iterator it; 107 KABC::Addressee::List::Iterator it;
108 for ( it = list.begin(); it != list.end(); ++it ) 108 for ( it = list.begin(); it != list.end(); ++it )
109 uidlist.append((*it).uid()); 109 uidlist.append((*it).uid());
110 return uidlist; 110 return uidlist;
111} 111}
112void XXPortSelectDialog::tagSelected()
113{
114 if ( mUseSelection->isChecked() ) {
115
116 QStringList selection = mCore->selectedUIDs();
117 KABC::AddressBook::Iterator it;
118 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
119 if ( selection.findIndex((*it).uid()) >= 0 )
120 (*it).setTagged( true );
121 }
122 } else if ( mUseFilters->isChecked() ) {
123 // find contacts that can pass selected filter
124 Filter::List::Iterator filterIt;
125 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
126 if ( (*filterIt).name() == mFiltersCombo->currentText() )
127 break;
128 KABC::AddressBook::Iterator it;
129 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
130 if ( (*filterIt).filterAddressee( *it ) )
131 (*it).setTagged( true );
132 }
133 } else if ( mUseCategories->isChecked() ) {
134 QStringList categorieList = categories();
135 KABC::AddressBook::Iterator it;
136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
137 QStringList tmp( (*it).categories() );
138 QStringList::Iterator tmpIt;
139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
140 if ( categorieList.contains( *tmpIt ) ) {
141 (*it).setTagged( true );
142 break;
143 }
144 }
145 } else {
146 // create a string list of all entries:
147 KABC::AddressBook::Iterator it;
148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
149 (*it).setTagged( true );
150 }
151}
112KABC::AddresseeList XXPortSelectDialog::contacts() 152KABC::AddresseeList XXPortSelectDialog::contacts()
113{ 153{
114 QStringList selection = mCore->selectedUIDs();
115 154
116 KABC::AddresseeList list; 155 KABC::AddresseeList list;
117 if ( mUseSelection->isChecked() ) { 156 if ( mUseSelection->isChecked() ) {
118 QStringList::Iterator it; 157 QStringList::Iterator it;
158 QStringList selection = mCore->selectedUIDs();
119 for ( it = selection.begin(); it != selection.end(); ++it ) { 159 for ( it = selection.begin(); it != selection.end(); ++it ) {
120 KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); 160 KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
121 if ( !addr.isEmpty() ) 161 if ( !addr.isEmpty() )
122 list.append( addr ); 162 list.append( addr );
123 } 163 }
124 } else if ( mUseFilters->isChecked() ) { 164 } else if ( mUseFilters->isChecked() ) {
125 // find contacts that can pass selected filter 165 // find contacts that can pass selected filter
126 Filter::List::Iterator filterIt; 166 Filter::List::Iterator filterIt;
127 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 167 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
128 if ( (*filterIt).name() == mFiltersCombo->currentText() ) 168 if ( (*filterIt).name() == mFiltersCombo->currentText() )
129 break; 169 break;
130 170
131 KABC::AddressBook::Iterator it; 171 KABC::AddressBook::Iterator it;
132 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 172 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
133 if ( (*filterIt).filterAddressee( *it ) ) 173 if ( (*filterIt).filterAddressee( *it ) )
134 list.append( *it ); 174 list.append( *it );
135 } 175 }
136 } else if ( mUseCategories->isChecked() ) { 176 } else if ( mUseCategories->isChecked() ) {
137 QStringList categorieList = categories(); 177 QStringList categorieList = categories();
138 KABC::AddressBook::Iterator it; 178 KABC::AddressBook::Iterator it;
139 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 179 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
140 QStringList tmp( (*it).categories() ); 180 QStringList tmp( (*it).categories() );
141 QStringList::Iterator tmpIt; 181 QStringList::Iterator tmpIt;
142 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) 182 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
143 if ( categorieList.contains( *tmpIt ) ) { 183 if ( categorieList.contains( *tmpIt ) ) {
144 list.append( *it ); 184 list.append( *it );
145 break; 185 break;
146 } 186 }
147 } 187 }
148 } else { 188 } else {
149 // create a string list of all entries: 189 // create a string list of all entries:
150 KABC::AddressBook::Iterator it; 190 KABC::AddressBook::Iterator it;
@@ -217,66 +257,66 @@ void XXPortSelectDialog::initGUI()
217 groupLayout->setAlignment( Qt::AlignTop ); 257 groupLayout->setAlignment( Qt::AlignTop );
218 258
219 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); 259 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup );
220 mUseWholeBook->setChecked( true ); 260 mUseWholeBook->setChecked( true );
221 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); 261 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) );
222 groupLayout->addWidget( mUseWholeBook, 0, 0 ); 262 groupLayout->addWidget( mUseWholeBook, 0, 0 );
223 263
224 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); 264 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup );
225 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" 265 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n"
226 "This option is disabled if no contacts are selected." ) ); 266 "This option is disabled if no contacts are selected." ) );
227 groupLayout->addWidget( mUseSelection, 1, 0 ); 267 groupLayout->addWidget( mUseSelection, 1, 0 );
228 268
229 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); 269 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup );
230 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" 270 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n"
231 "This option is disabled if you haven't defined any filters" ) ); 271 "This option is disabled if you haven't defined any filters" ) );
232 groupLayout->addWidget( mUseFilters, 2, 0 ); 272 groupLayout->addWidget( mUseFilters, 2, 0 );
233 273
234 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); 274 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup );
235 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" 275 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n"
236 "This option is disabled if you have no categories." ) ); 276 "This option is disabled if you have no categories." ) );
237 groupLayout->addWidget( mUseCategories, 3, 0 ); 277 groupLayout->addWidget( mUseCategories, 3, 0 );
238 278
239 mFiltersCombo = new QComboBox( false, mButtonGroup ); 279 mFiltersCombo = new QComboBox( false, mButtonGroup );
240 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); 280 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) );
241 groupLayout->addWidget( mFiltersCombo, 2, 1 ); 281 groupLayout->addWidget( mFiltersCombo, 2, 1 );
242 282
243 mCategoriesView = new QListView( mButtonGroup ); 283 mCategoriesView = new QListView( mButtonGroup );
244 mCategoriesView->addColumn( "" ); 284 mCategoriesView->addColumn( "" );
245 mCategoriesView->header()->hide(); 285 mCategoriesView->header()->hide();
246 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); 286 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) );
247 groupLayout->addWidget( mCategoriesView, 3, 1 ); 287 groupLayout->addWidget( mCategoriesView, 3, 1 );
248 288
249 // if (QApplication::desktop()->height() == 480 ) 289 if (QApplication::desktop()->height() == 480 )
250 // mCategoriesView->setMaximumHeight( 240 ); 290 mCategoriesView->setMaximumHeight( 240 );
251 topLayout->addWidget( mButtonGroup ); 291 topLayout->addWidget( mButtonGroup );
252 292
253 QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); 293 QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page );
254 sortingGroup->setColumnLayout( 0, Qt::Vertical ); 294 sortingGroup->setColumnLayout( 0, Qt::Vertical );
255 QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, 295 QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2,
256 KDialog::spacingHint() ); 296 KDialog::spacingHint() );
257 sortLayout->setAlignment( Qt::AlignTop ); 297 sortLayout->setAlignment( Qt::AlignTop );
258 298
259 label = new QLabel( i18n( "Criterion:" ), sortingGroup ); 299 label = new QLabel( i18n( "Criterion:" ), sortingGroup );
260 sortLayout->addWidget( label, 0, 0 ); 300 sortLayout->addWidget( label, 0, 0 );
261 301
262#ifndef KAB_EMBEDDED 302#ifndef KAB_EMBEDDED
263 mFieldCombo = new KComboBox( false, sortingGroup ); 303 mFieldCombo = new KComboBox( false, sortingGroup );
264#else //KAB_EMBEDDED 304#else //KAB_EMBEDDED
265 //US Combobox is not editable anyway 305 //US Combobox is not editable anyway
266 mFieldCombo = new KComboBox( sortingGroup ); 306 mFieldCombo = new KComboBox( sortingGroup );
267#endif //KAB_EMBEDDED 307#endif //KAB_EMBEDDED
268 sortLayout->addWidget( mFieldCombo, 0, 1 ); 308 sortLayout->addWidget( mFieldCombo, 0, 1 );
269 309
270 label = new QLabel( i18n( "Order:" ), sortingGroup ); 310 label = new QLabel( i18n( "Order:" ), sortingGroup );
271 sortLayout->addWidget( label, 1, 0 ); 311 sortLayout->addWidget( label, 1, 0 );
272 312
273#ifndef KAB_EMBEDDED 313#ifndef KAB_EMBEDDED
274 mSortTypeCombo = new KComboBox( false, sortingGroup ); 314 mSortTypeCombo = new KComboBox( false, sortingGroup );
275#else //KAB_EMBEDDED 315#else //KAB_EMBEDDED
276 //US Combobox is not editable anyway 316 //US Combobox is not editable anyway
277 mSortTypeCombo = new KComboBox( sortingGroup ); 317 mSortTypeCombo = new KComboBox( sortingGroup );
278#endif //KAB_EMBEDDED 318#endif //KAB_EMBEDDED
279 sortLayout->addWidget( mSortTypeCombo, 1, 1 ); 319 sortLayout->addWidget( mSortTypeCombo, 1, 1 );
280 320
281 topLayout->addWidget( sortingGroup ); 321 topLayout->addWidget( sortingGroup );
282 322
diff --git a/kaddressbook/xxportselectdialog.h b/kaddressbook/xxportselectdialog.h
index 3bb696f..28b1fef 100644
--- a/kaddressbook/xxportselectdialog.h
+++ b/kaddressbook/xxportselectdialog.h
@@ -19,64 +19,65 @@
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef XXPORTSELECTDIALOG_H 24#ifndef XXPORTSELECTDIALOG_H
25#define XXPORTSELECTDIALOG_H 25#define XXPORTSELECTDIALOG_H
26 26
27#include <kabc/addresseelist.h> 27#include <kabc/addresseelist.h>
28#include <kabc/field.h> 28#include <kabc/field.h>
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30 30
31#include "filter.h" 31#include "filter.h"
32 32
33class QButtonGroup; 33class QButtonGroup;
34class QComboBox; 34class QComboBox;
35class QListView; 35class QListView;
36class QListViewItem; 36class QListViewItem;
37class QRadioButton; 37class QRadioButton;
38 38
39class KABCore; 39class KABCore;
40class KComboBox; 40class KComboBox;
41 41
42class XXPortSelectDialog : public KDialogBase 42class XXPortSelectDialog : public KDialogBase
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 45
46 public: 46 public:
47 XXPortSelectDialog( KABCore *core, bool sort, QWidget* parent, 47 XXPortSelectDialog( KABCore *core, bool sort, QWidget* parent,
48 const char* name = 0 ); 48 const char* name = 0 );
49 49
50 KABC::AddresseeList contacts(); 50 KABC::AddresseeList contacts();
51 void tagSelected();
51 QStringList uids(); 52 QStringList uids();
52 53
53 private slots: 54 private slots:
54 void filterChanged( int ); 55 void filterChanged( int );
55 void categoryClicked( QListViewItem * i ); 56 void categoryClicked( QListViewItem * i );
56 57
57 protected slots: 58 protected slots:
58 void slotHelp(); 59 void slotHelp();
59 60
60 private: 61 private:
61 void initGUI(); 62 void initGUI();
62 QStringList categories() const; 63 QStringList categories() const;
63 64
64 QButtonGroup* mButtonGroup; 65 QButtonGroup* mButtonGroup;
65 QRadioButton* mUseCategories; 66 QRadioButton* mUseCategories;
66 QRadioButton* mUseFilters; 67 QRadioButton* mUseFilters;
67 QRadioButton* mUseWholeBook; 68 QRadioButton* mUseWholeBook;
68 QRadioButton* mUseSelection; 69 QRadioButton* mUseSelection;
69 QComboBox* mFiltersCombo; 70 QComboBox* mFiltersCombo;
70 QListView* mCategoriesView; 71 QListView* mCategoriesView;
71 72
72 KComboBox *mFieldCombo; 73 KComboBox *mFieldCombo;
73 KComboBox *mSortTypeCombo; 74 KComboBox *mSortTypeCombo;
74 75
75 KABCore *mCore; 76 KABCore *mCore;
76 KABC::AddresseeList mAddresseeList; 77 KABC::AddresseeList mAddresseeList;
77 Filter::List mFilters; 78 Filter::List mFilters;
78 KABC::Field::List mFields; 79 KABC::Field::List mFields;
79 bool mUseSorting; 80 bool mUseSorting;
80}; 81};
81 82
82#endif 83#endif