summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-12 20:20:56 (UTC)
committer zautrix <zautrix>2004-10-12 20:20:56 (UTC)
commit4a3a203c0f95f7d53a784c785004f8c4452c0154 (patch) (unidiff)
treecc91865a5ef2fa010a391ab1c2dd8c9af6f5be5b
parent77e3a7bc670f4c9b7eb5a5d6652a7986ea196533 (diff)
downloadkdepimpi-4a3a203c0f95f7d53a784c785004f8c4452c0154.zip
kdepimpi-4a3a203c0f95f7d53a784c785004f8c4452c0154.tar.gz
kdepimpi-4a3a203c0f95f7d53a784c785004f8c4452c0154.tar.bz2
layout bugfixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addresseeview.cpp1
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp7
2 files changed, 1 insertions, 7 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index af149a0..0564e85 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -13,193 +13,192 @@
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 39
40 40
41#include "externalapphandler.h" 41#include "externalapphandler.h"
42#include "addresseeview.h" 42#include "addresseeview.h"
43 43
44 44
45//US #ifndef DESKTOP_VERSION 45//US #ifndef DESKTOP_VERSION
46//US #include <qtopia/qcopenvelope_qws.h> 46//US #include <qtopia/qcopenvelope_qws.h>
47//US #include <qpe/qpeapplication.h> 47//US #include <qpe/qpeapplication.h>
48//US #endif 48//US #endif
49 49
50//US static int kphoneInstalled = 0; 50//US static int kphoneInstalled = 0;
51 51
52using namespace KPIM; 52using namespace KPIM;
53 53
54AddresseeView::AddresseeView( QWidget *parent, const char *name ) 54AddresseeView::AddresseeView( QWidget *parent, const char *name )
55//US : KTextBrowser( parent, name ) 55//US : KTextBrowser( parent, name )
56 : QTextBrowser( parent, name ) 56 : QTextBrowser( parent, name )
57 57
58 58
59{ 59{
60//US setWrapPolicy( QTextEdit::AtWordBoundary ); 60//US setWrapPolicy( QTextEdit::AtWordBoundary );
61 setLinkUnderline( false ); 61 setLinkUnderline( false );
62 // setVScrollBarMode( QScrollView::AlwaysOff ); 62 // setVScrollBarMode( QScrollView::AlwaysOff );
63 //setHScrollBarMode( QScrollView::AlwaysOff ); 63 //setHScrollBarMode( QScrollView::AlwaysOff );
64 64
65//US QStyleSheet *sheet = styleSheet(); 65//US QStyleSheet *sheet = styleSheet();
66//US QStyleSheetItem *link = sheet->item( "a" ); 66//US QStyleSheetItem *link = sheet->item( "a" );
67//US link->setColor( KGlobalSettings::linkColor() ); 67//US link->setColor( KGlobalSettings::linkColor() );
68 68
69} 69}
70 70
71void AddresseeView::setSource(const QString& n) 71void AddresseeView::setSource(const QString& n)
72{ 72{
73 //qDebug("********AddresseeView::setSource %s", n.latin1()); 73 //qDebug("********AddresseeView::setSource %s", n.latin1());
74 74
75 if ( n.left( 6 ) == "mailto" ) 75 if ( n.left( 6 ) == "mailto" )
76 ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); 76 ExternalAppHandler::instance()->mailToOneContact( n.mid(7) );
77 else if ( n.left( 7 ) == "phoneto" ) 77 else if ( n.left( 7 ) == "phoneto" )
78 ExternalAppHandler::instance()->callByPhone( n.mid(8) ); 78 ExternalAppHandler::instance()->callByPhone( n.mid(8) );
79 else if ( n.left( 5 ) == "faxto" ) 79 else if ( n.left( 5 ) == "faxto" )
80 ExternalAppHandler::instance()->callByFax( n.mid(6) ); 80 ExternalAppHandler::instance()->callByFax( n.mid(6) );
81 else if ( n.left( 5 ) == "smsto" ) 81 else if ( n.left( 5 ) == "smsto" )
82 ExternalAppHandler::instance()->callBySMS( n.mid(6) ); 82 ExternalAppHandler::instance()->callBySMS( n.mid(6) );
83 else if ( n.left( 7 ) == "pagerto" ) 83 else if ( n.left( 7 ) == "pagerto" )
84 ExternalAppHandler::instance()->callByPager( n.mid(8) ); 84 ExternalAppHandler::instance()->callByPager( n.mid(8) );
85 else if ( n.left( 5 ) == "sipto" ) 85 else if ( n.left( 5 ) == "sipto" )
86 ExternalAppHandler::instance()->callBySIP( n.mid(6) ); 86 ExternalAppHandler::instance()->callBySIP( n.mid(6) );
87 87
88} 88}
89void AddresseeView::setAddressee( const KABC::Addressee& addr ) 89void AddresseeView::setAddressee( const KABC::Addressee& addr )
90{ 90{
91 ExternalAppHandler* eah = ExternalAppHandler::instance(); 91 ExternalAppHandler* eah = ExternalAppHandler::instance();
92 bool kemailAvail = eah->isEmailAppAvailable(); 92 bool kemailAvail = eah->isEmailAppAvailable();
93 93
94 94
95 95
96 mAddressee = addr; 96 mAddressee = addr;
97 // clear view 97 // clear view
98 setText( QString::null ); 98 setText( QString::null );
99 99
100 if ( mAddressee.isEmpty() ) 100 if ( mAddressee.isEmpty() )
101 return; 101 return;
102 102
103 QString name = ( mAddressee.assembledName().isEmpty() ? 103 QString name = ( mAddressee.assembledName().isEmpty() ?
104 mAddressee.formattedName() : mAddressee.assembledName() ); 104 mAddressee.formattedName() : mAddressee.assembledName() );
105 105
106 QString dynamicPart; 106 QString dynamicPart;
107 107
108 dynamicPart += getPhoneNumbers( true ); 108 dynamicPart += getPhoneNumbers( true );
109 qDebug("dynamic preferred %s ",dynamicPart.latin1() );
110 QStringList emails = mAddressee.emails(); 109 QStringList emails = mAddressee.emails();
111 QStringList::ConstIterator emailIt; 110 QStringList::ConstIterator emailIt;
112 QString type = i18n( "Email" ); 111 QString type = i18n( "Email" );
113 emailIt = emails.begin(); 112 emailIt = emails.begin();
114 if ( emailIt != emails.end() ) { 113 if ( emailIt != emails.end() ) {
115 if ( kemailAvail ) { 114 if ( kemailAvail ) {
116 dynamicPart += QString( 115 dynamicPart += QString(
117 "<tr><td align=\"right\"><b>%1</b></td>" 116 "<tr><td align=\"right\"><b>%1</b></td>"
118 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) 117 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" )
119 .arg( type ) 118 .arg( type )
120 .arg( name ) 119 .arg( name )
121 .arg( *emailIt ) 120 .arg( *emailIt )
122 .arg( *emailIt ); 121 .arg( *emailIt );
123 ++emailIt; 122 ++emailIt;
124 } else { 123 } else {
125 dynamicPart += QString( 124 dynamicPart += QString(
126 "<tr><td align=\"right\"><b>%1</b></td>" 125 "<tr><td align=\"right\"><b>%1</b></td>"
127 "<td align=\"left\">%2</td></tr>" ) 126 "<td align=\"left\">%2</td></tr>" )
128 .arg( type ) 127 .arg( type )
129 .arg( *emailIt ); 128 .arg( *emailIt );
130 ++emailIt; 129 ++emailIt;
131 } 130 }
132 } 131 }
133 if ( mAddressee.birthday().date().isValid() ) { 132 if ( mAddressee.birthday().date().isValid() ) {
134 dynamicPart += QString( 133 dynamicPart += QString(
135 "<tr><td align=\"right\"><b>%1</b></td>" 134 "<tr><td align=\"right\"><b>%1</b></td>"
136 "<td align=\"left\">%2</td></tr>" ) 135 "<td align=\"left\">%2</td></tr>" )
137 .arg( i18n ("Birthday") ) 136 .arg( i18n ("Birthday") )
138 .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) ); 137 .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) );
139 } 138 }
140 dynamicPart += getPhoneNumbers( false ); 139 dynamicPart += getPhoneNumbers( false );
141 140
142 for ( ; emailIt != emails.end(); ++emailIt ) { 141 for ( ; emailIt != emails.end(); ++emailIt ) {
143 if ( kemailAvail ) { 142 if ( kemailAvail ) {
144 dynamicPart += QString( 143 dynamicPart += QString(
145 "<tr><td align=\"right\"><b>%1</b></td>" 144 "<tr><td align=\"right\"><b>%1</b></td>"
146 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) 145 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" )
147 .arg( type ) 146 .arg( type )
148 .arg( name ) 147 .arg( name )
149 .arg( *emailIt ) 148 .arg( *emailIt )
150 .arg( *emailIt ); 149 .arg( *emailIt );
151 } else { 150 } else {
152 dynamicPart += QString( 151 dynamicPart += QString(
153 "<tr><td align=\"right\"><b>%1</b></td>" 152 "<tr><td align=\"right\"><b>%1</b></td>"
154 "<td align=\"left\">%2</td></tr>" ) 153 "<td align=\"left\">%2</td></tr>" )
155 .arg( type ) 154 .arg( type )
156 .arg( *emailIt ); 155 .arg( *emailIt );
157 } 156 }
158 } 157 }
159 158
160 if ( !mAddressee.url().url().isEmpty() ) { 159 if ( !mAddressee.url().url().isEmpty() ) {
161 dynamicPart += QString( 160 dynamicPart += QString(
162 "<tr><td align=\"right\"><b>%1</b></td>" 161 "<tr><td align=\"right\"><b>%1</b></td>"
163 "<td align=\"left\">%2</td></tr>" ) 162 "<td align=\"left\">%2</td></tr>" )
164 .arg( i18n( "Homepage" ) ) 163 .arg( i18n( "Homepage" ) )
165//US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) ); 164//US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) );
166 .arg( mAddressee.url().url() ); 165 .arg( mAddressee.url().url() );
167 //qDebug("AddresseeView::setAddressee has to be verified."); 166 //qDebug("AddresseeView::setAddressee has to be verified.");
168 } 167 }
169 168
170 KABC::Address::List addresses = mAddressee.addresses(); 169 KABC::Address::List addresses = mAddressee.addresses();
171 KABC::Address::List::ConstIterator addrIt; 170 KABC::Address::List::ConstIterator addrIt;
172 for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) { 171 for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) {
173 if ( true /*(*addrIt).label().isEmpty()*/ ) { 172 if ( true /*(*addrIt).label().isEmpty()*/ ) {
174 QString formattedAddress = (*addrIt).formattedAddress().stripWhiteSpace(); 173 QString formattedAddress = (*addrIt).formattedAddress().stripWhiteSpace();
175//US formattedAddress = formattedAddress.replace( '\n', "<br>" ); 174//US formattedAddress = formattedAddress.replace( '\n', "<br>" );
176 //qDebug("adresss %s ",formattedAddress.latin1() ); 175 //qDebug("adresss %s ",formattedAddress.latin1() );
177 formattedAddress = formattedAddress.replace( QRegExp("\n"), "<br>" ); 176 formattedAddress = formattedAddress.replace( QRegExp("\n"), "<br>" );
178 //qDebug("AddresseeView::setAddressee has to be verified."); 177 //qDebug("AddresseeView::setAddressee has to be verified.");
179 178
180 dynamicPart += QString( 179 dynamicPart += QString(
181 "<tr><td align=\"right\"><b>%1</b></td>" 180 "<tr><td align=\"right\"><b>%1</b></td>"
182 "<td align=\"left\">%2</td></tr>" ) 181 "<td align=\"left\">%2</td></tr>" )
183 .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) 182 .arg( KABC::Address::typeLabel( (*addrIt).type() ) )
184 .arg( formattedAddress ); 183 .arg( formattedAddress );
185 } else { 184 } else {
186 185
187 dynamicPart += QString( 186 dynamicPart += QString(
188 "<tr><td align=\"right\"><b>%1</b></td>" 187 "<tr><td align=\"right\"><b>%1</b></td>"
189 "<td align=\"left\">%2</td></tr>" ) 188 "<td align=\"left\">%2</td></tr>" )
190 .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) 189 .arg( KABC::Address::typeLabel( (*addrIt).type() ) )
191//US .arg( (*addrIt).label().replace( '\n', "<br>" ) ); 190//US .arg( (*addrIt).label().replace( '\n', "<br>" ) );
192 .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ ); 191 .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ );
193 192
194 } 193 }
195 } 194 }
196 195
197 QString notes; 196 QString notes;
198 if ( !mAddressee.note().isEmpty() ) { 197 if ( !mAddressee.note().isEmpty() ) {
199 notes = QString( 198 notes = QString(
200 "<tr>" 199 "<tr>"
201 "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label 200 "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label
202 "<td align=\"left\">%2</td>" // note 201 "<td align=\"left\">%2</td>" // note
203 "</tr>" ).arg( i18n( "Notes" ) ) 202 "</tr>" ).arg( i18n( "Notes" ) )
204//US .arg( mAddressee.note().replace( '\n', "<br>" ) ); 203//US .arg( mAddressee.note().replace( '\n', "<br>" ) );
205 .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); 204 .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) );
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 50b6b6d..4db0a20 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -207,193 +207,193 @@ void AddresseeEditorWidget::setupTab1()
207 207
208 // File as (formatted name) 208 // File as (formatted name)
209 label = new QLabel( i18n( "Formatted name:" ), tab1 ); 209 label = new QLabel( i18n( "Formatted name:" ), tab1 );
210 mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); 210 mFormattedNameLabel = new KSqueezedTextLabel( tab1 );
211 layout->addWidget( label, 3, 0 ); 211 layout->addWidget( label, 3, 0 );
212 layout->addWidget( mFormattedNameLabel, 3, 1 ); 212 layout->addWidget( mFormattedNameLabel, 3, 1 );
213 /* LR 213 /* LR
214 // Left hand separator. This separator doesn't go all the way 214 // Left hand separator. This separator doesn't go all the way
215 // across so the dialog still flows from top to bottom 215 // across so the dialog still flows from top to bottom
216 bar = new KSeparator( KSeparator::HLine, tab1 ); 216 bar = new KSeparator( KSeparator::HLine, tab1 );
217 layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); 217 layout->addMultiCellWidget( bar, 4, 4, 0, 2 );
218 */ 218 */
219 ////////////////////////////////////// 219 //////////////////////////////////////
220 220
221 /* LR 221 /* LR
222 // Phone numbers (upper right) 222 // Phone numbers (upper right)
223 label = new QLabel( tab1 ); 223 label = new QLabel( tab1 );
224//US loadIcon call is ambiguous. Add one more parameter 224//US loadIcon call is ambiguous. Add one more parameter
225//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); 225//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
226 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 226 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
227//US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 227//US layout->addMultiCellWidget( label, 0, 1, 3, 3 );
228 layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 228 layout->addMultiCellWidget( label, 5, 6, 0, 0 );
229 */ 229 */
230 mPhoneEditWidget = new PhoneEditWidget( tab1 ); 230 mPhoneEditWidget = new PhoneEditWidget( tab1 );
231 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 231 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
232//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); 232//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 );
233 int iii; 233 int iii;
234#ifndef DESKTOP_VERSION 234#ifndef DESKTOP_VERSION
235 iii = 7; 235 iii = 7;
236#else 236#else
237 iii = 8; 237 iii = 8;
238#endif 238#endif
239 layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 ); 239 layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 );
240 ++iii; 240 ++iii;
241 /* LR 241 /* LR
242 bar = new KSeparator( KSeparator::HLine, tab1 ); 242 bar = new KSeparator( KSeparator::HLine, tab1 );
243//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); 243//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 );
244 layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); 244 layout->addMultiCellWidget( bar, 9, 9, 0, 2 );
245 */ 245 */
246/*US 246/*US
247 ////////////////////////////////////// 247 //////////////////////////////////////
248 // Addresses (lower left) 248 // Addresses (lower left)
249 label = new QLabel( tab1 ); 249 label = new QLabel( tab1 );
250//US loadIcon call is ambiguous. Add one more parameter 250//US loadIcon call is ambiguous. Add one more parameter
251//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); 251//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) );
252 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 252 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );
253 layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 253 layout->addMultiCellWidget( label, 5, 6, 0, 0 );
254 254
255 mAddressEditWidget = new AddressEditWidget( tab1 ); 255 mAddressEditWidget = new AddressEditWidget( tab1 );
256 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 256 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
257 layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); 257 layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 );
258 258
259 ////////////////////////////////////// 259 //////////////////////////////////////
260 // Email / Web (lower right) 260 // Email / Web (lower right)
261 label = new QLabel( tab1 ); 261 label = new QLabel( tab1 );
262//US loadIcon call is ambiguous. Add one more parameter 262//US loadIcon call is ambiguous. Add one more parameter
263//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); 263//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) );
264 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); 264 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) );
265 layout->addMultiCellWidget( label, 5, 6, 3, 3 ); 265 layout->addMultiCellWidget( label, 5, 6, 3, 3 );
266 266
267 mEmailWidget = new EmailEditWidget( tab1 ); 267 mEmailWidget = new EmailEditWidget( tab1 );
268 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 268 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
269 layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); 269 layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 );
270 270
271 // add the separator 271 // add the separator
272 bar = new KSeparator( KSeparator::HLine, tab1 ); 272 bar = new KSeparator( KSeparator::HLine, tab1 );
273 layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); 273 layout->addMultiCellWidget( bar, 7, 7, 3, 6 );
274 274
275 label = new QLabel( tab1 ); 275 label = new QLabel( tab1 );
276//US loadIcon call is ambiguous. Add one more parameter 276//US loadIcon call is ambiguous. Add one more parameter
277//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); 277//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) );
278 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); 278 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) );
279 layout->addMultiCellWidget( label, 8, 9, 3, 3 ); 279 layout->addMultiCellWidget( label, 8, 9, 3, 3 );
280 280
281 label = new QLabel( i18n( "URL:" ), tab1 ); 281 label = new QLabel( i18n( "URL:" ), tab1 );
282 mURLEdit = new KLineEdit( tab1 ); 282 mURLEdit = new KLineEdit( tab1 );
283 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), 283 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ),
284 SLOT( textChanged( const QString& ) ) ); 284 SLOT( textChanged( const QString& ) ) );
285 label->setBuddy( mURLEdit ); 285 label->setBuddy( mURLEdit );
286 layout->addWidget( label, 8, 4 ); 286 layout->addWidget( label, 8, 4 );
287 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); 287 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
288 288
289 label = new QLabel( i18n( "&IM address:" ), tab1 ); 289 label = new QLabel( i18n( "&IM address:" ), tab1 );
290 mIMAddressEdit = new KLineEdit( tab1 ); 290 mIMAddressEdit = new KLineEdit( tab1 );
291 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 291 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
292 SLOT( textChanged( const QString& ) ) ); 292 SLOT( textChanged( const QString& ) ) );
293 label->setBuddy( mIMAddressEdit ); 293 label->setBuddy( mIMAddressEdit );
294 layout->addWidget( label, 9, 4 ); 294 layout->addWidget( label, 9, 4 );
295 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 295 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
296 296
297 layout->addColSpacing( 6, 50 ); 297 layout->addColSpacing( 6, 50 );
298 298
299 bar = new KSeparator( KSeparator::HLine, tab1 ); 299 bar = new KSeparator( KSeparator::HLine, tab1 );
300 layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 300 layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
301*/ 301*/
302 /////////////////////////////////////// 302 ///////////////////////////////////////
303 QHBox *categoryBox = new QHBox( tab1 ); 303 QHBox *categoryBox = new QHBox( tab1 ,"cato");
304 categoryBox->setSpacing( KDialogBase::spacingHint() ); 304 categoryBox->setSpacing( KDialogBase::spacingHint() );
305 categoryBox->setMargin( KDialogBase::marginHintSmall() ); 305 categoryBox->setMargin( KDialogBase::marginHintSmall() );
306 306
307 // Categories 307 // Categories
308 button = new QPushButton( i18n( "Categories" ), categoryBox ); 308 button = new QPushButton( i18n( "Categories" ), categoryBox );
309 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 309 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
310 310
311 mCategoryEdit = new KLineEdit( categoryBox ); 311 mCategoryEdit = new KLineEdit( categoryBox );
312 mCategoryEdit->setReadOnly( true ); 312 mCategoryEdit->setReadOnly( true );
313 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 313 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
314 SLOT( textChanged( const QString& ) ) ); 314 SLOT( textChanged( const QString& ) ) );
315 315
316 mSecrecyWidget = new SecrecyWidget( categoryBox ); 316 mSecrecyWidget = new SecrecyWidget( categoryBox );
317 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 317 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
318 318
319//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 319//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
320 layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); 320 layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 );
321 321
322 // Build the layout and add to the tab widget 322 // Build the layout and add to the tab widget
323 layout->activate(); // required 323 layout->activate(); // required
324 324
325 mTabWidget->addTab( tab1, i18n( "&General" ) ); 325 mTabWidget->addTab( tab1, i18n( "&General" ) );
326} 326}
327 327
328 328
329void AddresseeEditorWidget::setupTab1_1() 329void AddresseeEditorWidget::setupTab1_1()
330{ 330{
331 // This is the Address tab 331 // This is the Address tab
332 QWidget *tab1_1 = new QWidget( mTabWidget ); 332 QWidget *tab1_1 = new QWidget( mTabWidget );
333 333
334//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); 334//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
335 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); 335 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 );
336 layout->setMargin( KDialogBase::marginHintSmall() ); 336 layout->setMargin( KDialogBase::marginHintSmall() );
337 layout->setSpacing( KDialogBase::spacingHintSmall() ); 337 layout->setSpacing( KDialogBase::spacingHintSmall() );
338 338
339 QLabel *label; 339 QLabel *label;
340 KSeparator* bar; 340 KSeparator* bar;
341 QPushButton *button; 341 QPushButton *button;
342 342
343/*US 343/*US
344 ////////////////////////////////// 344 //////////////////////////////////
345 // Upper left group (person info) 345 // Upper left group (person info)
346 346
347 // Person icon 347 // Person icon
348 label = new QLabel( tab1 ); 348 label = new QLabel( tab1 );
349//US ambiguous call. Add one more parameter 349//US ambiguous call. Add one more parameter
350//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 350//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
351 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 351 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
352 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 352 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
353 353
354 // First name 354 // First name
355 button = new QPushButton( i18n( "Name..." ), tab1 ); 355 button = new QPushButton( i18n( "Name..." ), tab1 );
356 QToolTip::add( button, i18n( "Edit the contact's name" ) ); 356 QToolTip::add( button, i18n( "Edit the contact's name" ) );
357 mNameEdit = new KLineEdit( tab1, "mNameEdit" ); 357 mNameEdit = new KLineEdit( tab1, "mNameEdit" );
358 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 358 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
359 SLOT( nameTextChanged( const QString& ) ) ); 359 SLOT( nameTextChanged( const QString& ) ) );
360 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); 360 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) );
361 361
362#ifndef KAB_EMBEDDED 362#ifndef KAB_EMBEDDED
363 mNameLabel = new KSqueezedTextLabel( tab1 ); 363 mNameLabel = new KSqueezedTextLabel( tab1 );
364 mNameLabel->hide(); 364 mNameLabel->hide();
365#else //KAB_EMBEDDED 365#else //KAB_EMBEDDED
366qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 366qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
367#endif //KAB_EMBEDDED 367#endif //KAB_EMBEDDED
368 368
369 layout->addWidget( button, 0, 1 ); 369 layout->addWidget( button, 0, 1 );
370 layout->addWidget( mNameEdit, 0, 2 ); 370 layout->addWidget( mNameEdit, 0, 2 );
371 371
372#ifndef KAB_EMBEDDED 372#ifndef KAB_EMBEDDED
373 layout->addWidget( mNameLabel, 0, 2 ); 373 layout->addWidget( mNameLabel, 0, 2 );
374#else //KAB_EMBEDDED 374#else //KAB_EMBEDDED
375qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 375qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
376#endif //KAB_EMBEDDED 376#endif //KAB_EMBEDDED
377 377
378 label = new QLabel( i18n( "Role:" ), tab1 ); 378 label = new QLabel( i18n( "Role:" ), tab1 );
379 mRoleEdit = new KLineEdit( tab1 ); 379 mRoleEdit = new KLineEdit( tab1 );
380 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), 380 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ),
381 SLOT( textChanged( const QString& ) ) ); 381 SLOT( textChanged( const QString& ) ) );
382 label->setBuddy( mRoleEdit ); 382 label->setBuddy( mRoleEdit );
383 layout->addWidget( label, 1, 1 ); 383 layout->addWidget( label, 1, 1 );
384 layout->addWidget( mRoleEdit, 1, 2 ); 384 layout->addWidget( mRoleEdit, 1, 2 );
385 385
386 // Organization 386 // Organization
387 label = new QLabel( i18n( "Organization:" ), tab1 ); 387 label = new QLabel( i18n( "Organization:" ), tab1 );
388 mOrgEdit = new KLineEdit( tab1 ); 388 mOrgEdit = new KLineEdit( tab1 );
389 label->setBuddy( mOrgEdit ); 389 label->setBuddy( mOrgEdit );
390 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), 390 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ),
391 SLOT( textChanged( const QString& ) ) ); 391 SLOT( textChanged( const QString& ) ) );
392 layout->addWidget( label, 2, 1 ); 392 layout->addWidget( label, 2, 1 );
393 layout->addWidget( mOrgEdit, 2, 2 ); 393 layout->addWidget( mOrgEdit, 2, 2 );
394 394
395 // File as (formatted name) 395 // File as (formatted name)
396 label = new QLabel( i18n( "Formatted name:" ), tab1 ); 396 label = new QLabel( i18n( "Formatted name:" ), tab1 );
397#ifndef KAB_EMBEDDED 397#ifndef KAB_EMBEDDED
398 mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); 398 mFormattedNameLabel = new KSqueezedTextLabel( tab1 );
399#else //KAB_EMBEDDED 399#else //KAB_EMBEDDED
@@ -521,250 +521,245 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
521 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 521 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
522*/ 522*/
523 // Build the layout and add to the tab widget 523 // Build the layout and add to the tab widget
524 layout->activate(); // required 524 layout->activate(); // required
525 525
526 mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); 526 mTabWidget->addTab( tab1_1, i18n( "&Address" ) );
527} 527}
528 528
529 529
530 530
531void AddresseeEditorWidget::setupTab2() 531void AddresseeEditorWidget::setupTab2()
532{ 532{
533 // This is the Details tab 533 // This is the Details tab
534 QWidget *tab2 = new QWidget( mTabWidget ); 534 QWidget *tab2 = new QWidget( mTabWidget );
535 535
536 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 536 QGridLayout *layout = new QGridLayout( tab2, 8, 3 );
537 layout->setMargin( KDialogBase::marginHintSmall() ); 537 layout->setMargin( KDialogBase::marginHintSmall() );
538 layout->setSpacing( KDialogBase::spacingHintSmall() ); 538 layout->setSpacing( KDialogBase::spacingHintSmall() );
539 539
540 QLabel *label; 540 QLabel *label;
541 KSeparator* bar; 541 KSeparator* bar;
542 542
543 /////////////////////// 543 ///////////////////////
544 // Office info 544 // Office info
545 545
546 // Department 546 // Department
547 label = new QLabel( tab2 ); 547 label = new QLabel( tab2 );
548//US loadIcon call is ambiguous. Add one more parameter 548//US loadIcon call is ambiguous. Add one more parameter
549//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 549//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
550 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 550 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
551 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 551 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
552 552
553 label = new QLabel( i18n( "Department:" ), tab2 ); 553 label = new QLabel( i18n( "Department:" ), tab2 );
554 layout->addWidget( label, 0, 1 ); 554 layout->addWidget( label, 0, 1 );
555 mDepartmentEdit = new KLineEdit( tab2 ); 555 mDepartmentEdit = new KLineEdit( tab2 );
556 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 556 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
557 SLOT( textChanged( const QString& ) ) ); 557 SLOT( textChanged( const QString& ) ) );
558 label->setBuddy( mDepartmentEdit ); 558 label->setBuddy( mDepartmentEdit );
559 layout->addWidget( mDepartmentEdit, 0, 2 ); 559 layout->addWidget( mDepartmentEdit, 0, 2 );
560 560
561 label = new QLabel( i18n( "Office:" ), tab2 ); 561 label = new QLabel( i18n( "Office:" ), tab2 );
562 layout->addWidget( label, 1, 1 ); 562 layout->addWidget( label, 1, 1 );
563 mOfficeEdit = new KLineEdit( tab2 ); 563 mOfficeEdit = new KLineEdit( tab2 );
564 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 564 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
565 SLOT( textChanged( const QString& ) ) ); 565 SLOT( textChanged( const QString& ) ) );
566 label->setBuddy( mOfficeEdit ); 566 label->setBuddy( mOfficeEdit );
567 layout->addWidget( mOfficeEdit, 1, 2 ); 567 layout->addWidget( mOfficeEdit, 1, 2 );
568 568
569 label = new QLabel( i18n( "Profession:" ), tab2 ); 569 label = new QLabel( i18n( "Profession:" ), tab2 );
570 layout->addWidget( label, 2, 1 ); 570 layout->addWidget( label, 2, 1 );
571 mProfessionEdit = new KLineEdit( tab2 ); 571 mProfessionEdit = new KLineEdit( tab2 );
572 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 572 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),
573 SLOT( textChanged( const QString& ) ) ); 573 SLOT( textChanged( const QString& ) ) );
574 label->setBuddy( mProfessionEdit ); 574 label->setBuddy( mProfessionEdit );
575 layout->addWidget( mProfessionEdit, 2, 2 ); 575 layout->addWidget( mProfessionEdit, 2, 2 );
576 576
577 label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); 577 label = new QLabel( i18n( "Manager\'s name:" ), tab2 );
578//US layout->addWidget( label, 0, 3 ); 578//US layout->addWidget( label, 0, 3 );
579 layout->addWidget( label, 3, 1 ); 579 layout->addWidget( label, 3, 1 );
580 mManagerEdit = new KLineEdit( tab2 ); 580 mManagerEdit = new KLineEdit( tab2 );
581 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), 581 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ),
582 SLOT( textChanged( const QString& ) ) ); 582 SLOT( textChanged( const QString& ) ) );
583 label->setBuddy( mManagerEdit ); 583 label->setBuddy( mManagerEdit );
584//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 584//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
585 layout->addWidget( mManagerEdit, 3, 2 ); 585 layout->addWidget( mManagerEdit, 3, 2 );
586 586
587 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 587 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
588//US layout->addWidget( label, 1, 3 ); 588//US layout->addWidget( label, 1, 3 );
589 layout->addWidget( label, 4, 1 ); 589 layout->addWidget( label, 4, 1 );
590 mAssistantEdit = new KLineEdit( tab2 ); 590 mAssistantEdit = new KLineEdit( tab2 );
591 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 591 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
592 SLOT( textChanged( const QString& ) ) ); 592 SLOT( textChanged( const QString& ) ) );
593 label->setBuddy( mAssistantEdit ); 593 label->setBuddy( mAssistantEdit );
594//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 594//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
595 layout->addWidget( mAssistantEdit, 4, 2 ); 595 layout->addWidget( mAssistantEdit, 4, 2 );
596 596
597 bar = new KSeparator( KSeparator::HLine, tab2 ); 597 bar = new KSeparator( KSeparator::HLine, tab2 );
598//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 598//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
599 layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); 599 layout->addMultiCellWidget( bar, 5, 5, 0, 2 );
600 600
601 ///////////////////////////////////////////////// 601 /////////////////////////////////////////////////
602 // Personal info 602 // Personal info
603 603
604 //label = new QLabel( tab2 ); 604 //label = new QLabel( tab2 );
605//US loadIcon call is ambiguous. Add one more parameter 605//US loadIcon call is ambiguous. Add one more parameter
606//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 606//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
607 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 607 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
608//US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 608//US layout->addMultiCellWidget( label, 4, 5, 0, 0 );
609 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 609 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
610 610
611 611
612 int iii = 6; 612 int iii = 6;
613 613
614 if ( QApplication::desktop()->width() == 640 ) { 614 if ( QApplication::desktop()->width() == 640 ) {
615 QHBox * nbox = new QHBox ( tab2 ); 615 QHBox * nbox = new QHBox ( tab2 );
616 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 616 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
617 layout->addWidget( label, iii, 1 );
618 mNicknameEdit = new KLineEdit( nbox ); 617 mNicknameEdit = new KLineEdit( nbox );
619 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 618 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
620 SLOT( textChanged( const QString& ) ) ); 619 SLOT( textChanged( const QString& ) ) );
621 label->setBuddy( mNicknameEdit ); 620 label->setBuddy( mNicknameEdit );
622 621
623 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); 622 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox );
624 layout->addWidget( label, iii, 1 );
625 mSpouseEdit = new KLineEdit( nbox ); 623 mSpouseEdit = new KLineEdit( nbox );
626 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 624 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
627 SLOT( textChanged( const QString& ) ) ); 625 SLOT( textChanged( const QString& ) ) );
628 label->setBuddy( mSpouseEdit ); 626 label->setBuddy( mSpouseEdit );
629 layout->addWidget( mSpouseEdit, iii, 2 );
630 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 627 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
631 ++iii; 628 ++iii;
632 629
633 } else { 630 } else {
634 label = new QLabel( i18n( "Nick name:" ), tab2 ); 631 label = new QLabel( i18n( "Nick name:" ), tab2 );
635 layout->addWidget( label, iii, 1 ); 632 layout->addWidget( label, iii, 1 );
636 mNicknameEdit = new KLineEdit( tab2 ); 633 mNicknameEdit = new KLineEdit( tab2 );
637 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 634 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
638 SLOT( textChanged( const QString& ) ) ); 635 SLOT( textChanged( const QString& ) ) );
639 label->setBuddy( mNicknameEdit ); 636 label->setBuddy( mNicknameEdit );
640 layout->addWidget( mNicknameEdit, iii, 2 ); 637 layout->addWidget( mNicknameEdit, iii, 2 );
641 ++iii; 638 ++iii;
642 639
643 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 640 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
644 layout->addWidget( label, iii, 1 ); 641 layout->addWidget( label, iii, 1 );
645 mSpouseEdit = new KLineEdit( tab2 ); 642 mSpouseEdit = new KLineEdit( tab2 );
646 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 643 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
647 SLOT( textChanged( const QString& ) ) ); 644 SLOT( textChanged( const QString& ) ) );
648 label->setBuddy( mSpouseEdit ); 645 label->setBuddy( mSpouseEdit );
649 layout->addWidget( mSpouseEdit, iii, 2 ); 646 layout->addWidget( mSpouseEdit, iii, 2 );
650 ++iii; 647 ++iii;
651 } 648 }
652 649
653 label = new QLabel( i18n( "Children's names:" ), tab2 ); 650 label = new QLabel( i18n( "Children's names:" ), tab2 );
654 layout->addWidget( label, iii, 1 ); 651 layout->addWidget( label, iii, 1 );
655 mChildEdit = new KLineEdit( tab2 ); 652 mChildEdit = new KLineEdit( tab2 );
656 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 653 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
657 SLOT( textChanged( const QString& ) ) ); 654 SLOT( textChanged( const QString& ) ) );
658 label->setBuddy( mChildEdit ); 655 label->setBuddy( mChildEdit );
659 layout->addWidget( mChildEdit, iii, 2 ); 656 layout->addWidget( mChildEdit, iii, 2 );
660 ++iii; 657 ++iii;
661 if ( QApplication::desktop()->width() == 640 ) { 658 if ( QApplication::desktop()->width() == 640 ) {
662 QHBox * nbox = new QHBox ( tab2 ); 659 QHBox * nbox = new QHBox ( tab2 );
663 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 660 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
664 layout->addWidget( label, iii, 1 );
665 mBirthdayPicker = new KDateEdit( nbox ); 661 mBirthdayPicker = new KDateEdit( nbox );
666 mBirthdayPicker->toggleDateFormat(); 662 mBirthdayPicker->toggleDateFormat();
667 mBirthdayPicker->setHandleInvalid( true ); 663 mBirthdayPicker->setHandleInvalid( true );
668 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 664 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
669 SLOT( dateChanged( QDate ) ) ); 665 SLOT( dateChanged( QDate ) ) );
670 666
671 label->setBuddy( mBirthdayPicker ); 667 label->setBuddy( mBirthdayPicker );
672 668
673 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); 669 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
674 layout->addWidget( label, iii, 1 );
675 mAnniversaryPicker = new KDateEdit( nbox ); 670 mAnniversaryPicker = new KDateEdit( nbox );
676 mAnniversaryPicker->setHandleInvalid( true ); 671 mAnniversaryPicker->setHandleInvalid( true );
677 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 672 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
678 SLOT( dateChanged( QDate ) ) ); 673 SLOT( dateChanged( QDate ) ) );
679 674
680 label->setBuddy( mAnniversaryPicker ); 675 label->setBuddy( mAnniversaryPicker );
681 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 676 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
682 ++iii; 677 ++iii;
683 678
684 } else { 679 } else {
685 680
686 label = new QLabel( i18n( "Birthday:" ), tab2 ); 681 label = new QLabel( i18n( "Birthday:" ), tab2 );
687 layout->addWidget( label, iii, 1 ); 682 layout->addWidget( label, iii, 1 );
688 mBirthdayPicker = new KDateEdit( tab2 ); 683 mBirthdayPicker = new KDateEdit( tab2 );
689 mBirthdayPicker->toggleDateFormat(); 684 mBirthdayPicker->toggleDateFormat();
690 mBirthdayPicker->setHandleInvalid( true ); 685 mBirthdayPicker->setHandleInvalid( true );
691 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 686 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
692 SLOT( dateChanged( QDate ) ) ); 687 SLOT( dateChanged( QDate ) ) );
693 688
694 label->setBuddy( mBirthdayPicker ); 689 label->setBuddy( mBirthdayPicker );
695 layout->addWidget( mBirthdayPicker, iii, 2 ); 690 layout->addWidget( mBirthdayPicker, iii, 2 );
696 ++iii; 691 ++iii;
697 692
698 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 693 label = new QLabel( i18n( "Anniversary:" ), tab2 );
699 layout->addWidget( label, iii, 1 ); 694 layout->addWidget( label, iii, 1 );
700 mAnniversaryPicker = new KDateEdit( tab2 ); 695 mAnniversaryPicker = new KDateEdit( tab2 );
701 mAnniversaryPicker->setHandleInvalid( true ); 696 mAnniversaryPicker->setHandleInvalid( true );
702 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 697 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
703 SLOT( dateChanged( QDate ) ) ); 698 SLOT( dateChanged( QDate ) ) );
704 699
705 label->setBuddy( mAnniversaryPicker ); 700 label->setBuddy( mAnniversaryPicker );
706 layout->addWidget( mAnniversaryPicker, iii, 2 ); 701 layout->addWidget( mAnniversaryPicker, iii, 2 );
707 ++iii; 702 ++iii;
708 703
709 } 704 }
710 705
711 label = new QLabel( i18n( "Gender:" ), tab2 ); 706 label = new QLabel( i18n( "Gender:" ), tab2 );
712 layout->addWidget( label, iii, 1 ); 707 layout->addWidget( label, iii, 1 );
713 mGenderBox = new QComboBox ( tab2 ); 708 mGenderBox = new QComboBox ( tab2 );
714 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" )); 709 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" ));
715 mGenderBox->insertItem ( i18n( "female" )); 710 mGenderBox->insertItem ( i18n( "female" ));
716 mGenderBox->insertItem ( i18n( "male" )); 711 mGenderBox->insertItem ( i18n( "male" ));
717 connect( mGenderBox, SIGNAL( activated ( const QString & ) ), 712 connect( mGenderBox, SIGNAL( activated ( const QString & ) ),
718 SLOT( textChanged( const QString& ) ) ); 713 SLOT( textChanged( const QString& ) ) );
719 label->setBuddy( mGenderBox ); 714 label->setBuddy( mGenderBox );
720 layout->addWidget( mGenderBox, iii, 2 ); 715 layout->addWidget( mGenderBox, iii, 2 );
721 ++iii; 716 ++iii;
722 // Build the layout and add to the tab widget 717 // Build the layout and add to the tab widget
723 layout->activate(); // required 718 layout->activate(); // required
724 719
725 mTabWidget->addTab( tab2, i18n( "&Details" ) ); 720 mTabWidget->addTab( tab2, i18n( "&Details" ) );
726} 721}
727 722
728void AddresseeEditorWidget::setupTab2_1() 723void AddresseeEditorWidget::setupTab2_1()
729{ 724{
730 // This is the Details tab 725 // This is the Details tab
731 QWidget *tab2_2 = new QWidget( mTabWidget ); 726 QWidget *tab2_2 = new QWidget( mTabWidget );
732 727
733 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 728 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 );
734 layout->setMargin( KDialogBase::marginHintSmall() ); 729 layout->setMargin( KDialogBase::marginHintSmall() );
735 layout->setSpacing( KDialogBase::spacingHintSmall() ); 730 layout->setSpacing( KDialogBase::spacingHintSmall() );
736 731
737 QLabel *label; 732 QLabel *label;
738 KSeparator* bar; 733 KSeparator* bar;
739 734
740/*US 735/*US
741 /////////////////////// 736 ///////////////////////
742 // Office info 737 // Office info
743 738
744 // Department 739 // Department
745 label = new QLabel( tab2 ); 740 label = new QLabel( tab2 );
746//US loadIcon call is ambiguous. Add one more parameter 741//US loadIcon call is ambiguous. Add one more parameter
747//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 742//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
748 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 743 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
749 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 744 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
750 745
751 label = new QLabel( i18n( "Department:" ), tab2 ); 746 label = new QLabel( i18n( "Department:" ), tab2 );
752 layout->addWidget( label, 0, 1 ); 747 layout->addWidget( label, 0, 1 );
753 mDepartmentEdit = new KLineEdit( tab2 ); 748 mDepartmentEdit = new KLineEdit( tab2 );
754 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 749 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
755 SLOT( textChanged( const QString& ) ) ); 750 SLOT( textChanged( const QString& ) ) );
756 label->setBuddy( mDepartmentEdit ); 751 label->setBuddy( mDepartmentEdit );
757 layout->addWidget( mDepartmentEdit, 0, 2 ); 752 layout->addWidget( mDepartmentEdit, 0, 2 );
758 753
759 label = new QLabel( i18n( "Office:" ), tab2 ); 754 label = new QLabel( i18n( "Office:" ), tab2 );
760 layout->addWidget( label, 1, 1 ); 755 layout->addWidget( label, 1, 1 );
761 mOfficeEdit = new KLineEdit( tab2 ); 756 mOfficeEdit = new KLineEdit( tab2 );
762 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 757 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
763 SLOT( textChanged( const QString& ) ) ); 758 SLOT( textChanged( const QString& ) ) );
764 label->setBuddy( mOfficeEdit ); 759 label->setBuddy( mOfficeEdit );
765 layout->addWidget( mOfficeEdit, 1, 2 ); 760 layout->addWidget( mOfficeEdit, 1, 2 );
766 761
767 label = new QLabel( i18n( "Profession:" ), tab2 ); 762 label = new QLabel( i18n( "Profession:" ), tab2 );
768 layout->addWidget( label, 2, 1 ); 763 layout->addWidget( label, 2, 1 );
769 mProfessionEdit = new KLineEdit( tab2 ); 764 mProfessionEdit = new KLineEdit( tab2 );
770 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 765 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),