summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-03 13:37:47 (UTC)
committer zautrix <zautrix>2005-06-03 13:37:47 (UTC)
commit7aa43257ffb63e772342f24c1f7945e285171ee6 (patch) (unidiff)
tree7d68896cbbd5ae699bce7905e17824939022a488
parentf0554322b2f27e1fa60dc79a5d76ef0741bf3423 (diff)
downloadkdepimpi-7aa43257ffb63e772342f24c1f7945e285171ee6.zip
kdepimpi-7aa43257ffb63e772342f24c1f7945e285171ee6.tar.gz
kdepimpi-7aa43257ffb63e772342f24c1f7945e285171ee6.tar.bz2
export kapi fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--kabc/addresseeview.cpp6
-rw-r--r--kaddressbook/xxportselectdialog.cpp12
3 files changed, 18 insertions, 4 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 3532084..93edc59 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,87 +1,91 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.1.5 ************ 3********** VERSION 2.1.5 ************
4 4
5This is the new stable version. 5This is the new stable version.
6Bugfix: 6Bugfix:
7Fixed a problem with agenda popup on the desktop in KO/Pi. 7Fixed a problem with agenda popup on the desktop in KO/Pi.
8Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. 8Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization.
9Added config option to not display completed todos in agenda view. 9Added config option to not display completed todos in agenda view.
10Addressee view is now using the formatted name, if defined.
11That makes it possible to display "lastname, firstname" in that view now.
12To set the formatted name for all contacts, please use menu:
13Edit->Change->Set formatted name.
10 14
11********** VERSION 2.1.4 ************ 15********** VERSION 2.1.4 ************
12 16
13Fixed two more bugs in the KA/Pi CSV import dialog: 17Fixed two more bugs in the KA/Pi CSV import dialog:
14Made it possible to read multi-line fields and import it to the "Note" field. 18Made it possible to read multi-line fields and import it to the "Note" field.
15Fixed a problem in mapping custom fields, whatever a custem field is... 19Fixed a problem in mapping custom fields, whatever a custem field is...
16 20
17********** VERSION 2.1.3 ************ 21********** VERSION 2.1.3 ************
18 22
19Changed the menu structure of the alarm applet: 23Changed the menu structure of the alarm applet:
20Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 24Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
21 25
22Fixed several problems in the KA/Pi CSV import dialog: 26Fixed several problems in the KA/Pi CSV import dialog:
23Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 27Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
24 28
25 29
26********** VERSION 2.1.2 ************ 30********** VERSION 2.1.2 ************
27 31
28Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 32Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
29 33
30Fixed a problem when importing data from Outlook with mutiple categories set. 34Fixed a problem when importing data from Outlook with mutiple categories set.
31 35
32Changed display of days in datenavigator: 36Changed display of days in datenavigator:
33Birthdays are now blue, not dark green. 37Birthdays are now blue, not dark green.
34When todo view is shown, no birtdays are shown and days with due todos are shown blue. 38When todo view is shown, no birtdays are shown and days with due todos are shown blue.
35When journal view is shown, only holidays are shown and days with journals are blue. 39When journal view is shown, only holidays are shown and days with journals are blue.
36 40
37Added Backup options to global config: 41Added Backup options to global config:
38You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). 42You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ).
39It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. 43It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again.
40The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. 44The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups.
41 45
42********** VERSION 2.1.1 ************ 46********** VERSION 2.1.1 ************
43 47
44Stable release 2.1.1! 48Stable release 2.1.1!
45 49
46KO/Pi: 50KO/Pi:
47Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 51Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
48 52
49********** VERSION 2.1.0 ************ 53********** VERSION 2.1.0 ************
50 54
51Stable release 2.1.0! 55Stable release 2.1.0!
52 56
53Summary of changes/fixes compared to version 2.0.6: 57Summary of changes/fixes compared to version 2.0.6:
54 58
55Many bugs of version 2.0.6 fixed. 59Many bugs of version 2.0.6 fixed.
56Most of them were small bugs, but some of them were important. 60Most of them were small bugs, but some of them were important.
57It is recommended to use version 2.1.0 and not version 2.0.6. 61It is recommended to use version 2.1.0 and not version 2.0.6.
58 62
59Important changes: 63Important changes:
60 64
61Added recurring todos to KO/Pi. 65Added recurring todos to KO/Pi.
62 66
63Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. 67Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
64 68
65Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 69Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
66 70
67Datenavigator can now display many months. Very useful on the desktop. 71Datenavigator can now display many months. Very useful on the desktop.
68 72
69KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. 73KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
70 74
71Made alarm sound working on Linux desktop. 75Made alarm sound working on Linux desktop.
72 76
73Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. 77Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
74 78
75Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. 79Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
76 80
77Many other usebility enhancements. 81Many other usebility enhancements.
78Special thanks to Ben for his suggestions! 82Special thanks to Ben for his suggestions!
79 83
80You can find the complete changelog 84You can find the complete changelog
81from version 1.7.7 to 2.1.0 85from version 1.7.7 to 2.1.0
82in the source package or on 86in the source package or on
83 87
84http://www.pi-sync.net/html/changelog.html 88http://www.pi-sync.net/html/changelog.html
85 89
86 90
87 91
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index 9118c3d..667a5e2 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -1,225 +1,231 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 3
4 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 4 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <kabc/address.h> 22#include <kabc/address.h>
23#include <kabc/addressee.h> 23#include <kabc/addressee.h>
24#include <kabc/phonenumber.h> 24#include <kabc/phonenumber.h>
25#include <kglobal.h> 25#include <kglobal.h>
26//US#include <kglobalsettings.h> 26//US#include <kglobalsettings.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include <klocale.h> 28#include <klocale.h>
29//US #include <kstringhandler.h> 29//US #include <kstringhandler.h>
30#include <qscrollview.h> 30#include <qscrollview.h>
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qvbox.h> 33#include <qvbox.h>
34#include <qlabel.h> 34#include <qlabel.h>
35#include <qwidget.h> 35#include <qwidget.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qapplication.h> 37#include <qapplication.h>
38#include <qpushbutton.h> 38#include <qpushbutton.h>
39#ifdef DESKTOP_VERSION 39#ifdef DESKTOP_VERSION
40#include <qpaintdevicemetrics.h> 40#include <qpaintdevicemetrics.h>
41#include <qprinter.h> 41#include <qprinter.h>
42#include <qpainter.h> 42#include <qpainter.h>
43#endif 43#endif
44 44
45 45
46#include <qstylesheet.h>
46#include "externalapphandler.h" 47#include "externalapphandler.h"
47#include <kabc/addresseeview.h> 48#include <kabc/addresseeview.h>
48 49
49 50
50//US #ifndef DESKTOP_VERSION 51//US #ifndef DESKTOP_VERSION
51//US #include <qtopia/qcopenvelope_qws.h> 52//US #include <qtopia/qcopenvelope_qws.h>
52//US #include <qpe/qpeapplication.h> 53//US #include <qpe/qpeapplication.h>
53//US #endif 54//US #endif
54 55
55//US static int kphoneInstalled = 0; 56//US static int kphoneInstalled = 0;
56 57
57using namespace KABC; 58using namespace KABC;
58 59
59AddresseeView::AddresseeView( QWidget *parent, const char *name ) 60AddresseeView::AddresseeView( QWidget *parent, const char *name )
60 : QTextBrowser( parent, name ) 61 : QTextBrowser( parent, name )
61 62
62 63
63{ 64{
64//US setWrapPolicy( QTextEdit::AtWordBoundary ); 65//US setWrapPolicy( QTextEdit::AtWordBoundary );
65 setLinkUnderline( false ); 66 setLinkUnderline( false );
66 // setVScrollBarMode( QScrollView::AlwaysOff ); 67 // setVScrollBarMode( QScrollView::AlwaysOff );
67 //setHScrollBarMode( QScrollView::AlwaysOff ); 68 //setHScrollBarMode( QScrollView::AlwaysOff );
68 69
69//US QStyleSheet *sheet = styleSheet(); 70//US QStyleSheet *sheet = styleSheet();
70//US QStyleSheetItem *link = sheet->item( "a" ); 71//US QStyleSheetItem *link = sheet->item( "a" );
71//US link->setColor( KGlobalSettings::linkColor() ); 72//US link->setColor( KGlobalSettings::linkColor() );
72 73
74
73} 75}
74void AddresseeView::printMe() 76void AddresseeView::printMe()
75{ 77{
76#ifdef DESKTOP_VERSION 78#ifdef DESKTOP_VERSION
77 QPrinter printer; 79 QPrinter printer;
78 if (!printer.setup() ) 80 if (!printer.setup() )
79 return; 81 return;
80 QPainter p; 82 QPainter p;
81 p.begin ( &printer ); 83 p.begin ( &printer );
82 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 84 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
83 float dx, dy; 85 float dx, dy;
84 int wid = (m.width() * 9)/10; 86 int wid = (m.width() * 9)/10;
85 dx = (float) wid/(float)contentsWidth (); 87 dx = (float) wid/(float)contentsWidth ();
86 dy = (float)(m.height()) / (float)contentsHeight (); 88 dy = (float)(m.height()) / (float)contentsHeight ();
87 float scale; 89 float scale;
88 // scale to fit the width or height of the paper 90 // scale to fit the width or height of the paper
89 if ( dx < dy ) 91 if ( dx < dy )
90 scale = dx; 92 scale = dx;
91 else 93 else
92 scale = dy; 94 scale = dy;
93 p.translate( m.width()/10,0 ); 95 p.translate( m.width()/10,0 );
94 p.scale( scale, scale ); 96 p.scale( scale, scale );
95 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 97 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
96 p.end(); 98 p.end();
97#endif 99#endif
98} 100}
99void AddresseeView::setSource(const QString& n) 101void AddresseeView::setSource(const QString& n)
100{ 102{
101 //qDebug("********AddresseeView::setSource %s", n.latin1()); 103 //qDebug("********AddresseeView::setSource %s", n.latin1());
102 104
103 if ( n.left( 6 ) == "mailto" ) 105 if ( n.left( 6 ) == "mailto" )
104 ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); 106 ExternalAppHandler::instance()->mailToOneContact( n.mid(7) );
105 else if ( n.left( 7 ) == "phoneto" ) 107 else if ( n.left( 7 ) == "phoneto" )
106 ExternalAppHandler::instance()->callByPhone( n.mid(8) ); 108 ExternalAppHandler::instance()->callByPhone( n.mid(8) );
107 else if ( n.left( 5 ) == "faxto" ) 109 else if ( n.left( 5 ) == "faxto" )
108 ExternalAppHandler::instance()->callByFax( n.mid(6) ); 110 ExternalAppHandler::instance()->callByFax( n.mid(6) );
109 else if ( n.left( 5 ) == "smsto" ) 111 else if ( n.left( 5 ) == "smsto" )
110 ExternalAppHandler::instance()->callBySMS( n.mid(6) ); 112 ExternalAppHandler::instance()->callBySMS( n.mid(6) );
111 else if ( n.left( 7 ) == "pagerto" ) 113 else if ( n.left( 7 ) == "pagerto" )
112 ExternalAppHandler::instance()->callByPager( n.mid(8) ); 114 ExternalAppHandler::instance()->callByPager( n.mid(8) );
113 else if ( n.left( 5 ) == "sipto" ) 115 else if ( n.left( 5 ) == "sipto" )
114 ExternalAppHandler::instance()->callBySIP( n.mid(6) ); 116 ExternalAppHandler::instance()->callBySIP( n.mid(6) );
115 117
116} 118}
117void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) 119void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
118{ 120{
119 bool kemailAvail = ExternalAppHandler::instance()->isEmailAppAvailable(); 121 bool kemailAvail = ExternalAppHandler::instance()->isEmailAppAvailable();
120 // mAddressee = addr; 122 // mAddressee = addr;
121 // clear view 123 // clear view
122 //setText( QString::null ); 124 //setText( QString::null );
123 125
124 if ( mAddressee.isEmpty() ) { 126 if ( mAddressee.isEmpty() ) {
125 setText( QString::null); 127 setText( QString::null);
126 return; 128 return;
127 } 129 }
130#if 0
128 QString name = ( mAddressee.assembledName().isEmpty() ? 131 QString name = ( mAddressee.assembledName().isEmpty() ?
129 mAddressee.formattedName() : mAddressee.assembledName() ); 132 mAddressee.formattedName() : mAddressee.assembledName() );
133#endif
134
135 QString name = mAddressee.realName();
130 136
131 QString dynamicPart; 137 QString dynamicPart;
132 138
133 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(),true ); 139 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(),true );
134 QStringList emails = mAddressee.emails(); 140 QStringList emails = mAddressee.emails();
135 QStringList::ConstIterator emailIt; 141 QStringList::ConstIterator emailIt;
136 QString type = i18n( "Email" ); 142 QString type = i18n( "Email" );
137 emailIt = emails.begin(); 143 emailIt = emails.begin();
138 if ( emailIt != emails.end() ) { 144 if ( emailIt != emails.end() ) {
139 if ( kemailAvail ) { 145 if ( kemailAvail ) {
140 dynamicPart += QString( 146 dynamicPart += QString(
141 "<tr><td align=\"right\"><b>%1</b></td>" 147 "<tr><td align=\"right\"><b>%1</b></td>"
142 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) 148 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" )
143 .arg( type ) 149 .arg( type )
144 .arg( name ) 150 .arg( name )
145 .arg( *emailIt ) 151 .arg( *emailIt )
146 .arg( *emailIt ); 152 .arg( *emailIt );
147 ++emailIt; 153 ++emailIt;
148 } else { 154 } else {
149 dynamicPart += QString( 155 dynamicPart += QString(
150 "<tr><td align=\"right\"><b>%1</b></td>" 156 "<tr><td align=\"right\"><b>%1</b></td>"
151 "<td align=\"left\">%2</td></tr>" ) 157 "<td align=\"left\">%2</td></tr>" )
152 .arg( type ) 158 .arg( type )
153 .arg( *emailIt ); 159 .arg( *emailIt );
154 ++emailIt; 160 ++emailIt;
155 } 161 }
156 } 162 }
157 if ( mAddressee.birthday().date().isValid() ) { 163 if ( mAddressee.birthday().date().isValid() ) {
158 dynamicPart += QString( 164 dynamicPart += QString(
159 "<tr><td align=\"right\"><b>%1</b></td>" 165 "<tr><td align=\"right\"><b>%1</b></td>"
160 "<td align=\"left\">%2</td></tr>" ) 166 "<td align=\"left\">%2</td></tr>" )
161 .arg( i18n ("Birthday") ) 167 .arg( i18n ("Birthday") )
162 .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) ); 168 .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) );
163 } 169 }
164 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(), false ); 170 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(), false );
165 171
166 for ( ; emailIt != emails.end(); ++emailIt ) { 172 for ( ; emailIt != emails.end(); ++emailIt ) {
167 if ( kemailAvail ) { 173 if ( kemailAvail ) {
168 dynamicPart += QString( 174 dynamicPart += QString(
169 "<tr><td align=\"right\"><b>%1</b></td>" 175 "<tr><td align=\"right\"><b>%1</b></td>"
170 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) 176 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" )
171 .arg( type ) 177 .arg( type )
172 .arg( name ) 178 .arg( name )
173 .arg( *emailIt ) 179 .arg( *emailIt )
174 .arg( *emailIt ); 180 .arg( *emailIt );
175 } else { 181 } else {
176 dynamicPart += QString( 182 dynamicPart += QString(
177 "<tr><td align=\"right\"><b>%1</b></td>" 183 "<tr><td align=\"right\"><b>%1</b></td>"
178 "<td align=\"left\">%2</td></tr>" ) 184 "<td align=\"left\">%2</td></tr>" )
179 .arg( type ) 185 .arg( type )
180 .arg( *emailIt ); 186 .arg( *emailIt );
181 } 187 }
182 } 188 }
183 189
184 if ( !mAddressee.url().url().isEmpty() ) { 190 if ( !mAddressee.url().url().isEmpty() ) {
185 dynamicPart += QString( 191 dynamicPart += QString(
186 "<tr><td align=\"right\"><b>%1</b></td>" 192 "<tr><td align=\"right\"><b>%1</b></td>"
187 "<td align=\"left\">%2</td></tr>" ) 193 "<td align=\"left\">%2</td></tr>" )
188 .arg( i18n( "Homepage" ) ) 194 .arg( i18n( "Homepage" ) )
189//US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) ); 195//US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) );
190 .arg( mAddressee.url().url() ); 196 .arg( mAddressee.url().url() );
191 //qDebug("AddresseeView::setAddressee has to be verified."); 197 //qDebug("AddresseeView::setAddressee has to be verified.");
192 } 198 }
193 199
194 KABC::Address::List addresses = mAddressee.addresses(); 200 KABC::Address::List addresses = mAddressee.addresses();
195 KABC::Address::List::ConstIterator addrIt; 201 KABC::Address::List::ConstIterator addrIt;
196 for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) { 202 for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) {
197 if ( true /*(*addrIt).label().isEmpty()*/ ) { 203 if ( true /*(*addrIt).label().isEmpty()*/ ) {
198 QString formattedAddress = (*addrIt).formattedAddress().stripWhiteSpace(); 204 QString formattedAddress = (*addrIt).formattedAddress().stripWhiteSpace();
199//US formattedAddress = formattedAddress.replace( '\n', "<br>" ); 205//US formattedAddress = formattedAddress.replace( '\n', "<br>" );
200 //qDebug("adresss %s ",formattedAddress.latin1() ); 206 //qDebug("adresss %s ",formattedAddress.latin1() );
201 formattedAddress = formattedAddress.replace( QRegExp("\n"), "<br>" ); 207 formattedAddress = formattedAddress.replace( QRegExp("\n"), "<br>" );
202 //qDebug("AddresseeView::setAddressee has to be verified."); 208 //qDebug("AddresseeView::setAddressee has to be verified.");
203 209
204 dynamicPart += QString( 210 dynamicPart += QString(
205 "<tr><td align=\"right\"><b>%1</b></td>" 211 "<tr><td align=\"right\"><b>%1</b></td>"
206 "<td align=\"left\">%2</td></tr>" ) 212 "<td align=\"left\">%2</td></tr>" )
207 .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) 213 .arg( KABC::Address::typeLabel( (*addrIt).type() ) )
208 .arg( formattedAddress ); 214 .arg( formattedAddress );
209 } else { 215 } else {
210 216
211 dynamicPart += QString( 217 dynamicPart += QString(
212 "<tr><td align=\"right\"><b>%1</b></td>" 218 "<tr><td align=\"right\"><b>%1</b></td>"
213 "<td align=\"left\">%2</td></tr>" ) 219 "<td align=\"left\">%2</td></tr>" )
214 .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) 220 .arg( KABC::Address::typeLabel( (*addrIt).type() ) )
215//US .arg( (*addrIt).label().replace( '\n', "<br>" ) ); 221//US .arg( (*addrIt).label().replace( '\n', "<br>" ) );
216 .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ ); 222 .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ );
217 223
218 } 224 }
219 } 225 }
220 226
221 QString notes; 227 QString notes;
222 if ( !mAddressee.note().isEmpty() ) { 228 if ( !mAddressee.note().isEmpty() ) {
223 notes = QString( 229 notes = QString(
224 "<tr>" 230 "<tr>"
225 "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label 231 "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index e134f97..278cab0 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -66,223 +66,227 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
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() 112void XXPortSelectDialog::tagSelected()
113{ 113{
114 if ( mUseSelection->isChecked() ) { 114 if ( mUseSelection->isChecked() ) {
115 115
116 QStringList selection = mCore->selectedUIDs(); 116 QStringList selection = mCore->selectedUIDs();
117 KABC::AddressBook::Iterator it; 117 KABC::AddressBook::Iterator it;
118 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 118 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
119 if ( selection.findIndex((*it).uid()) >= 0 ) 119 if ( selection.findIndex((*it).uid()) >= 0 )
120 (*it).setTagged( true ); 120 (*it).setTagged( true );
121 } 121 }
122 } else if ( mUseFilters->isChecked() ) { 122 } else if ( mUseFilters->isChecked() ) {
123 // find contacts that can pass selected filter 123 // find contacts that can pass selected filter
124 Filter::List::Iterator filterIt; 124 Filter::List::Iterator filterIt;
125 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 125 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
126 if ( (*filterIt).name() == mFiltersCombo->currentText() ) 126 if ( (*filterIt).name() == mFiltersCombo->currentText() )
127 break; 127 break;
128 KABC::AddressBook::Iterator it; 128 KABC::AddressBook::Iterator it;
129 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 129 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
130 if ( (*filterIt).filterAddressee( *it ) ) 130 if ( (*filterIt).filterAddressee( *it ) )
131 (*it).setTagged( true ); 131 (*it).setTagged( true );
132 } 132 }
133 } else if ( mUseCategories->isChecked() ) { 133 } else if ( mUseCategories->isChecked() ) {
134 QStringList categorieList = categories(); 134 QStringList categorieList = categories();
135 KABC::AddressBook::Iterator it; 135 KABC::AddressBook::Iterator it;
136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
137 QStringList tmp( (*it).categories() ); 137 QStringList tmp( (*it).categories() );
138 QStringList::Iterator tmpIt; 138 QStringList::Iterator tmpIt;
139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) 139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
140 if ( categorieList.contains( *tmpIt ) ) { 140 if ( categorieList.contains( *tmpIt ) ) {
141 (*it).setTagged( true ); 141 (*it).setTagged( true );
142 break; 142 break;
143 } 143 }
144 } 144 }
145 } else { 145 } else {
146 // create a string list of all entries: 146 // create a string list of all entries:
147 KABC::AddressBook::Iterator it; 147 KABC::AddressBook::Iterator it;
148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) 148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
149 (*it).setTagged( true ); 149 (*it).setTagged( true );
150 } 150 }
151} 151}
152KABC::AddresseeList XXPortSelectDialog::contacts() 152KABC::AddresseeList XXPortSelectDialog::contacts()
153{ 153{
154 154
155 KABC::AddresseeList list; 155 KABC::AddresseeList list;
156 if ( mUseSelection->isChecked() ) { 156 if ( mUseSelection->isChecked() ) {
157 QStringList::Iterator it; 157 QStringList::Iterator it;
158 QStringList selection = mCore->selectedUIDs(); 158 QStringList selection = mCore->selectedUIDs();
159 for ( it = selection.begin(); it != selection.end(); ++it ) { 159 for ( it = selection.begin(); it != selection.end(); ++it ) {
160 KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); 160 KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
161 if ( !addr.isEmpty() ) 161 if ( !addr.isEmpty() )
162 list.append( addr ); 162 if ( addr.uid().left( 19 ) != QString("last-syncAddressee-") )
163 list.append( addr );
163 } 164 }
164 } else if ( mUseFilters->isChecked() ) { 165 } else if ( mUseFilters->isChecked() ) {
165 // find contacts that can pass selected filter 166 // find contacts that can pass selected filter
166 Filter::List::Iterator filterIt; 167 Filter::List::Iterator filterIt;
167 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 168 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
168 if ( (*filterIt).name() == mFiltersCombo->currentText() ) 169 if ( (*filterIt).name() == mFiltersCombo->currentText() )
169 break; 170 break;
170 171
171 KABC::AddressBook::Iterator it; 172 KABC::AddressBook::Iterator it;
172 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 173 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
173 if ( (*filterIt).filterAddressee( *it ) ) 174 if ( (*filterIt).filterAddressee( *it ) )
174 list.append( *it ); 175 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
176 list.append( *it );
175 } 177 }
176 } else if ( mUseCategories->isChecked() ) { 178 } else if ( mUseCategories->isChecked() ) {
177 QStringList categorieList = categories(); 179 QStringList categorieList = categories();
178 KABC::AddressBook::Iterator it; 180 KABC::AddressBook::Iterator it;
179 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 181 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
180 QStringList tmp( (*it).categories() ); 182 QStringList tmp( (*it).categories() );
181 QStringList::Iterator tmpIt; 183 QStringList::Iterator tmpIt;
182 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) 184 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
183 if ( categorieList.contains( *tmpIt ) ) { 185 if ( categorieList.contains( *tmpIt ) ) {
184 list.append( *it ); 186 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
187 list.append( *it );
185 break; 188 break;
186 } 189 }
187 } 190 }
188 } else { 191 } else {
189 // create a string list of all entries: 192 // create a string list of all entries:
190 KABC::AddressBook::Iterator it; 193 KABC::AddressBook::Iterator it;
191 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) 194 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
192 list.append( *it ); 195 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
196 list.append( *it );
193 } 197 }
194 198
195 if ( mUseSorting ) { 199 if ( mUseSorting ) {
196 list.setReverseSorting( mSortTypeCombo->currentItem() == 1 ); 200 list.setReverseSorting( mSortTypeCombo->currentItem() == 1 );
197 uint pos = mFieldCombo->currentItem(); 201 uint pos = mFieldCombo->currentItem();
198 if ( pos < mFields.count() ) 202 if ( pos < mFields.count() )
199 list.sortByField( mFields[ pos ] ); 203 list.sortByField( mFields[ pos ] );
200 } 204 }
201 205
202 return list; 206 return list;
203} 207}
204 208
205QStringList XXPortSelectDialog::categories() const 209QStringList XXPortSelectDialog::categories() const
206{ 210{
207 QStringList list; 211 QStringList list;
208 212
209 QListViewItemIterator it( mCategoriesView ); 213 QListViewItemIterator it( mCategoriesView );
210 for ( ; it.current(); ++it ) { 214 for ( ; it.current(); ++it ) {
211 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); 215 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current());
212 if ( qcli->isOn() ) 216 if ( qcli->isOn() )
213 list.append( it.current()->text( 0 ) ); 217 list.append( it.current()->text( 0 ) );
214 } 218 }
215 219
216 return list; 220 return list;
217} 221}
218 222
219void XXPortSelectDialog::filterChanged( int ) 223void XXPortSelectDialog::filterChanged( int )
220{ 224{
221 mUseFilters->setChecked( true ); 225 mUseFilters->setChecked( true );
222} 226}
223 227
224void XXPortSelectDialog::categoryClicked( QListViewItem *i ) 228void XXPortSelectDialog::categoryClicked( QListViewItem *i )
225{ 229{
226 QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); 230 QCheckListItem *qcli = static_cast<QCheckListItem*>( i );
227 if ( qcli->isOn() ) 231 if ( qcli->isOn() )
228 mUseCategories->setChecked( true ); 232 mUseCategories->setChecked( true );
229} 233}
230 234
231void XXPortSelectDialog::slotHelp() 235void XXPortSelectDialog::slotHelp()
232{ 236{
233#ifndef KAB_EMBEDDED 237#ifndef KAB_EMBEDDED
234 kapp->invokeHelp( "import-and-export" ); 238 kapp->invokeHelp( "import-and-export" );
235#else //KAB_EMBEDDED 239#else //KAB_EMBEDDED
236 qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); 240 qDebug("XXPortSelectDialog::slotHelp is not implemented yet");
237#endif //KAB_EMBEDDED 241#endif //KAB_EMBEDDED
238 242
239} 243}
240 244
241void XXPortSelectDialog::initGUI() 245void XXPortSelectDialog::initGUI()
242{ 246{
243 QFrame *page = plainPage(); 247 QFrame *page = plainPage();
244 248
245 QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(), 249 QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(),
246 KDialog::spacingHintSmall() ); 250 KDialog::spacingHintSmall() );
247 251
248 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); 252 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page );
249 topLayout->addWidget( label ); 253 topLayout->addWidget( label );
250 254
251 mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); 255 mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page );
252 mButtonGroup->setColumnLayout( 0, Qt::Vertical ); 256 mButtonGroup->setColumnLayout( 0, Qt::Vertical );
253 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); 257 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() );
254 mButtonGroup->layout()->setMargin( KDialog::marginHint() ); 258 mButtonGroup->layout()->setMargin( KDialog::marginHint() );
255 259
256 QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); 260 QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() );
257 groupLayout->setAlignment( Qt::AlignTop ); 261 groupLayout->setAlignment( Qt::AlignTop );
258 262
259 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); 263 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup );
260 mUseWholeBook->setChecked( true ); 264 mUseWholeBook->setChecked( true );
261 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); 265 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) );
262 groupLayout->addWidget( mUseWholeBook, 0, 0 ); 266 groupLayout->addWidget( mUseWholeBook, 0, 0 );
263 267
264 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); 268 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup );
265 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" 269 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n"
266 "This option is disabled if no contacts are selected." ) ); 270 "This option is disabled if no contacts are selected." ) );
267 groupLayout->addWidget( mUseSelection, 1, 0 ); 271 groupLayout->addWidget( mUseSelection, 1, 0 );
268 272
269 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); 273 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup );
270 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" 274 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n"
271 "This option is disabled if you haven't defined any filters" ) ); 275 "This option is disabled if you haven't defined any filters" ) );
272 groupLayout->addWidget( mUseFilters, 2, 0 ); 276 groupLayout->addWidget( mUseFilters, 2, 0 );
273 277
274 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); 278 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup );
275 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" 279 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n"
276 "This option is disabled if you have no categories." ) ); 280 "This option is disabled if you have no categories." ) );
277 groupLayout->addWidget( mUseCategories, 3, 0 ); 281 groupLayout->addWidget( mUseCategories, 3, 0 );
278 282
279 mFiltersCombo = new QComboBox( false, mButtonGroup ); 283 mFiltersCombo = new QComboBox( false, mButtonGroup );
280 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 284 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
281 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); 285 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) );
282 groupLayout->addWidget( mFiltersCombo, 2, 1 ); 286 groupLayout->addWidget( mFiltersCombo, 2, 1 );
283 287
284 mCategoriesView = new QListView( mButtonGroup ); 288 mCategoriesView = new QListView( mButtonGroup );
285 mCategoriesView->addColumn( "" ); 289 mCategoriesView->addColumn( "" );
286 mCategoriesView->header()->hide(); 290 mCategoriesView->header()->hide();
287 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); 291 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) );
288 groupLayout->addWidget( mCategoriesView, 3, 1 ); 292 groupLayout->addWidget( mCategoriesView, 3, 1 );