summaryrefslogtreecommitdiffabout
path: root/kaddressbook/addresseeeditorwidget.cpp
Unidiff
Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp46
1 files changed, 25 insertions, 21 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 4313998..a95db03 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -1,73 +1,77 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qhbox.h> 25#include <q3hbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistbox.h> 28#include <q3listbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qtabwidget.h> 30#include <qtabwidget.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#ifndef KAB_EMBEDDED 33#ifndef KAB_EMBEDDED
34#include <qtextedit.h> 34#include <q3textedit.h>
35//Added by qt3to4:
36#include <Q3GridLayout>
37#include <Q3PopupMenu>
38#include <Q3VBoxLayout>
35 39
36#include <kaccelmanager.h> 40#include <kaccelmanager.h>
37#include "keywidget.h" 41#include "keywidget.h"
38#include "soundwidget.h" 42#include "soundwidget.h"
39 43
40#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
41#include <qmultilineedit.h> 45#include <q3multilineedit.h>
42#endif //KAB_EMBEDDED 46#endif //KAB_EMBEDDED
43 47
44 48
45#include "keywidget.h" 49#include "keywidget.h"
46#include "geowidget.h" 50#include "geowidget.h"
47#include "imagewidget.h" 51#include "imagewidget.h"
48#include "nameeditdialog.h" 52#include "nameeditdialog.h"
49#include "phoneeditwidget.h" 53#include "phoneeditwidget.h"
50#include "secrecywidget.h" 54#include "secrecywidget.h"
51 55
52 56
53#include <qtoolbutton.h> 57#include <qtoolbutton.h>
54#include <qtooltip.h> 58#include <qtooltip.h>
55 59
56#include <kapplication.h> 60#include <kapplication.h>
57#include <kconfig.h> 61#include <kconfig.h>
58#include <kcombobox.h> 62#include <kcombobox.h>
59#include <kdebug.h> 63#include <kdebug.h>
60#include <kdialogbase.h> 64#include <kdialogbase.h>
61#include <kglobal.h> 65#include <kglobal.h>
62#include <kiconloader.h> 66#include <kiconloader.h>
63#include <klineedit.h> 67#include <klineedit.h>
64#include <klocale.h> 68#include <klocale.h>
65#include <kmessagebox.h> 69#include <kmessagebox.h>
66#include <kseparator.h> 70#include <kseparator.h>
67#include <ksqueezedtextlabel.h> 71#include <ksqueezedtextlabel.h>
68 72
69#include <libkdepim/categoryeditdialog.h> 73#include <libkdepim/categoryeditdialog.h>
70#include <libkdepim/categoryselectdialog.h> 74#include <libkdepim/categoryselectdialog.h>
71 75
72#include <libkdepim/kdateedit.h> 76#include <libkdepim/kdateedit.h>
73 77
@@ -101,95 +105,95 @@ AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension,
101 105
102AddresseeEditorWidget::~AddresseeEditorWidget() 106AddresseeEditorWidget::~AddresseeEditorWidget()
103{ 107{
104 kdDebug(5720) << "~AddresseeEditorWidget()" << endl; 108 kdDebug(5720) << "~AddresseeEditorWidget()" << endl;
105} 109}
106 110
107void AddresseeEditorWidget::contactsSelectionChanged() 111void AddresseeEditorWidget::contactsSelectionChanged()
108{ 112{
109 KABC::Addressee::List list = selectedContacts(); 113 KABC::Addressee::List list = selectedContacts();
110 114
111 mAddressee = list[ 0 ]; 115 mAddressee = list[ 0 ];
112 load(); 116 load();
113} 117}
114 118
115void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) 119void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr )
116{ 120{
117 mAddressee = addr; 121 mAddressee = addr;
118 load(); 122 load();
119} 123}
120 124
121const KABC::Addressee &AddresseeEditorWidget::addressee() 125const KABC::Addressee &AddresseeEditorWidget::addressee()
122{ 126{
123 return mAddressee; 127 return mAddressee;
124} 128}
125 129
126void AddresseeEditorWidget::textChanged( const QString& ) 130void AddresseeEditorWidget::textChanged( const QString& )
127{ 131{
128 emitModified(); 132 emitModified();
129} 133}
130 134
131void AddresseeEditorWidget::initGUI() 135void AddresseeEditorWidget::initGUI()
132{ 136{
133 QVBoxLayout *layout = new QVBoxLayout( this ); 137 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
134 138
135 mTabWidget = new QTabWidget( this ); 139 mTabWidget = new QTabWidget( this );
136 layout->addWidget( mTabWidget ); 140 layout->addWidget( mTabWidget );
137 141
138 setupTab1(); 142 setupTab1();
139 setupTab1_1(); 143 setupTab1_1();
140 setupTab2(); 144 setupTab2();
141 setupTab2_1(); 145 setupTab2_1();
142 setupTab3(); 146 setupTab3();
143 setupTab3_1(); 147 setupTab3_1();
144 148
145 mNameEdit->setFocus(); 149 mNameEdit->setFocus();
146 150
147 connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), 151 connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ),
148 SLOT( pageChanged(QWidget*) ) ); 152 SLOT( pageChanged(QWidget*) ) );
149} 153}
150 154
151void AddresseeEditorWidget::setupTab1() 155void AddresseeEditorWidget::setupTab1()
152{ 156{
153 // This is the General tab 157 // This is the General tab
154 QWidget *tab1 = new QWidget( mTabWidget ); 158 QWidget *tab1 = new QWidget( mTabWidget );
155 159
156//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); 160//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 );
157 bool horLayout = false; 161 bool horLayout = false;
158 int maxCol = 1; 162 int maxCol = 1;
159 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { 163 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) {
160 horLayout = true; 164 horLayout = true;
161 maxCol = 3; 165 maxCol = 3;
162 } 166 }
163 QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol ); 167 Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol );
164 168
165 layout->setMargin( KDialogBase::marginHintSmall() ); 169 layout->setMargin( KDialogBase::marginHintSmall() );
166 layout->setSpacing( KDialogBase::spacingHintSmall() ); 170 layout->setSpacing( KDialogBase::spacingHintSmall() );
167 171
168 QLabel *label; 172 QLabel *label;
169 KSeparator* bar; 173 KSeparator* bar;
170 QPushButton *button; 174 QPushButton *button;
171 175
172 ////////////////////////////////// 176 //////////////////////////////////
173 // Upper left group (person info) 177 // Upper left group (person info)
174 178
175 // Person icon 179 // Person icon
176 /* LR 180 /* LR
177 label = new QLabel( tab1 ); 181 label = new QLabel( tab1 );
178//US ambiguous call. Add one more parameter 182//US ambiguous call. Add one more parameter
179//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 183//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
180 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 184 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
181 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 185 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
182 */ 186 */
183 // First name 187 // First name
184 button = new QPushButton( i18n( "Name..." ), tab1 ); 188 button = new QPushButton( i18n( "Name..." ), tab1 );
185//US QToolTip::add( button, i18n( "Edit the contact's name" ) ); 189//US QToolTip::add( button, i18n( "Edit the contact's name" ) );
186 mNameEdit = new KLineEdit( tab1, "mNameEdit" ); 190 mNameEdit = new KLineEdit( tab1, "mNameEdit" );
187 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 191 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
188 SLOT( nameTextChanged( const QString& ) ) ); 192 SLOT( nameTextChanged( const QString& ) ) );
189 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); 193 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) );
190 194
191 mNameLabel = new KSqueezedTextLabel( tab1 ); 195 mNameLabel = new KSqueezedTextLabel( tab1 );
192 mNameLabel->hide(); 196 mNameLabel->hide();
193 197
194 layout->addWidget( button, 0, 0 ); 198 layout->addWidget( button, 0, 0 );
195 layout->addWidget( mNameEdit, 0, 1 ); 199 layout->addWidget( mNameEdit, 0, 1 );
@@ -298,75 +302,75 @@ void AddresseeEditorWidget::setupTab1()
298 // add the separator 302 // add the separator
299 bar = new KSeparator( KSeparator::HLine, tab1 ); 303 bar = new KSeparator( KSeparator::HLine, tab1 );
300 layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); 304 layout->addMultiCellWidget( bar, 7, 7, 3, 6 );
301 305
302 label = new QLabel( tab1 ); 306 label = new QLabel( tab1 );
303//US loadIcon call is ambiguous. Add one more parameter 307//US loadIcon call is ambiguous. Add one more parameter
304//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); 308//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) );
305 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); 309 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) );
306 layout->addMultiCellWidget( label, 8, 9, 3, 3 ); 310 layout->addMultiCellWidget( label, 8, 9, 3, 3 );
307 311
308 label = new QLabel( i18n( "URL:" ), tab1 ); 312 label = new QLabel( i18n( "URL:" ), tab1 );
309 mURLEdit = new KLineEdit( tab1 ); 313 mURLEdit = new KLineEdit( tab1 );
310 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), 314 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ),
311 SLOT( textChanged( const QString& ) ) ); 315 SLOT( textChanged( const QString& ) ) );
312 label->setBuddy( mURLEdit ); 316 label->setBuddy( mURLEdit );
313 layout->addWidget( label, 8, 4 ); 317 layout->addWidget( label, 8, 4 );
314 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); 318 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
315 319
316 label = new QLabel( i18n( "&IM address:" ), tab1 ); 320 label = new QLabel( i18n( "&IM address:" ), tab1 );
317 mIMAddressEdit = new KLineEdit( tab1 ); 321 mIMAddressEdit = new KLineEdit( tab1 );
318 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 322 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
319 SLOT( textChanged( const QString& ) ) ); 323 SLOT( textChanged( const QString& ) ) );
320 label->setBuddy( mIMAddressEdit ); 324 label->setBuddy( mIMAddressEdit );
321 layout->addWidget( label, 9, 4 ); 325 layout->addWidget( label, 9, 4 );
322 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 326 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
323 327
324 layout->addColSpacing( 6, 50 ); 328 layout->addColSpacing( 6, 50 );
325 329
326 bar = new KSeparator( KSeparator::HLine, tab1 ); 330 bar = new KSeparator( KSeparator::HLine, tab1 );
327 layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 331 layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
328*/ 332*/
329 /////////////////////////////////////// 333 ///////////////////////////////////////
330 QHBox *categoryBox = new QHBox( tab1 ,"cato"); 334 Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato");
331 categoryBox->setSpacing( KDialogBase::spacingHint() ); 335 categoryBox->setSpacing( KDialogBase::spacingHint() );
332 categoryBox->setMargin( KDialogBase::marginHintSmall() ); 336 categoryBox->setMargin( KDialogBase::marginHintSmall() );
333 337
334 // Categories 338 // Categories
335 button = new QPushButton( i18n( "Categories" )+":", categoryBox ); 339 button = new QPushButton( i18n( "Categories" )+":", categoryBox );
336 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 340 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
337 341
338 mCategoryEdit = new QPushButton ( categoryBox ); 342 mCategoryEdit = new QPushButton ( categoryBox );
339 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); 343 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
340 mCatPopup = new QPopupMenu ( categoryBox ); 344 mCatPopup = new Q3PopupMenu ( categoryBox );
341 mCategoryEdit->setPopup( mCatPopup ); 345 mCategoryEdit->setPopup( mCatPopup );
342 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 346 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
343 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 347 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
344 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 348 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
345 // SLOT( textChanged( const QString& ) ) ); 349 // SLOT( textChanged( const QString& ) ) );
346 350
347 mSecrecyWidget = new SecrecyWidget( categoryBox ); 351 mSecrecyWidget = new SecrecyWidget( categoryBox );
348 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 352 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
349 353
350//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 354//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
351 layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol ); 355 layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol );
352 356
353 // Build the layout and add to the tab widget 357 // Build the layout and add to the tab widget
354 layout->activate(); // required 358 layout->activate(); // required
355 359
356 mTabWidget->addTab( tab1, i18n( "&General" ) ); 360 mTabWidget->addTab( tab1, i18n( "&General" ) );
357} 361}
358 362
359void AddresseeEditorWidget::showCatPopup() 363void AddresseeEditorWidget::showCatPopup()
360{ 364{
361 mCatPopup->clear(); 365 mCatPopup->clear();
362 QStringList checkedCategories = QStringList::split (",", mCategoryEdit->text()); 366 QStringList checkedCategories = QStringList::split (",", mCategoryEdit->text());
363 int index = 0; 367 int index = 0;
364 for (QStringList::Iterator it = KABPrefs::instance()->mCustomCategories.begin (); 368 for (QStringList::Iterator it = KABPrefs::instance()->mCustomCategories.begin ();
365 it != KABPrefs::instance()->mCustomCategories.end (); 369 it != KABPrefs::instance()->mCustomCategories.end ();
366 ++it) { 370 ++it) {
367 mCatPopup->insertItem (*it, index ); 371 mCatPopup->insertItem (*it, index );
368 //mCategory[index] = *it; 372 //mCategory[index] = *it;
369 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); 373 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true);
370 ++index; 374 ++index;
371 } 375 }
372} 376}
@@ -382,65 +386,65 @@ void AddresseeEditorWidget::selectedCatPopup( int index )
382 if ( !colcat.isEmpty() ) { 386 if ( !colcat.isEmpty() ) {
383 if ( categories.find ( colcat ) != categories.end () ) { 387 if ( categories.find ( colcat ) != categories.end () ) {
384 categories.remove( colcat ); 388 categories.remove( colcat );
385 categories.prepend( colcat ); 389 categories.prepend( colcat );
386 } 390 }
387 } 391 }
388 mCategoryEdit->setText( categories.join(",") ); 392 mCategoryEdit->setText( categories.join(",") );
389 emitModified(); 393 emitModified();
390} 394}
391void AddresseeEditorWidget::setRole2FN() 395void AddresseeEditorWidget::setRole2FN()
392{ 396{
393 if ( mRoleEdit->text().isEmpty() ) return; 397 if ( mRoleEdit->text().isEmpty() ) return;
394 mFormattedNameType = NameEditDialog::CustomName; 398 mFormattedNameType = NameEditDialog::CustomName;
395 mAddressee.setFormattedName( mRoleEdit->text() ); 399 mAddressee.setFormattedName( mRoleEdit->text() );
396 mFormattedNameLabel->setText( mRoleEdit->text() ); 400 mFormattedNameLabel->setText( mRoleEdit->text() );
397 emitModified(); 401 emitModified();
398} 402}
399void AddresseeEditorWidget::setCompany2FN() 403void AddresseeEditorWidget::setCompany2FN()
400{ 404{
401 if ( mOrgEdit->text().isEmpty() ) return; 405 if ( mOrgEdit->text().isEmpty() ) return;
402 mFormattedNameType = NameEditDialog::CustomName; 406 mFormattedNameType = NameEditDialog::CustomName;
403 mAddressee.setFormattedName( mOrgEdit->text() ); 407 mAddressee.setFormattedName( mOrgEdit->text() );
404 mFormattedNameLabel->setText( mOrgEdit->text() ); 408 mFormattedNameLabel->setText( mOrgEdit->text() );
405 emitModified(); 409 emitModified();
406} 410}
407 411
408void AddresseeEditorWidget::setupTab1_1() 412void AddresseeEditorWidget::setupTab1_1()
409{ 413{
410 // This is the Address tab 414 // This is the Address tab
411 QWidget *tab1_1 = new QWidget( mTabWidget ); 415 QWidget *tab1_1 = new QWidget( mTabWidget );
412 416
413//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); 417//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
414 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); 418 Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 );
415 layout->setMargin( KDialogBase::marginHintSmall() ); 419 layout->setMargin( KDialogBase::marginHintSmall() );
416 layout->setSpacing( KDialogBase::spacingHintSmall() ); 420 layout->setSpacing( KDialogBase::spacingHintSmall() );
417 421
418 QLabel *label; 422 QLabel *label;
419 KSeparator* bar; 423 KSeparator* bar;
420 QPushButton *button; 424 QPushButton *button;
421 425
422/*US 426/*US
423 ////////////////////////////////// 427 //////////////////////////////////
424 // Upper left group (person info) 428 // Upper left group (person info)
425 429
426 // Person icon 430 // Person icon
427 label = new QLabel( tab1 ); 431 label = new QLabel( tab1 );
428//US ambiguous call. Add one more parameter 432//US ambiguous call. Add one more parameter
429//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 433//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
430 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 434 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
431 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 435 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
432 436
433 // First name 437 // First name
434 button = new QPushButton( i18n( "Name..." ), tab1 ); 438 button = new QPushButton( i18n( "Name..." ), tab1 );
435 QToolTip::add( button, i18n( "Edit the contact's name" ) ); 439 QToolTip::add( button, i18n( "Edit the contact's name" ) );
436 mNameEdit = new KLineEdit( tab1, "mNameEdit" ); 440 mNameEdit = new KLineEdit( tab1, "mNameEdit" );
437 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 441 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
438 SLOT( nameTextChanged( const QString& ) ) ); 442 SLOT( nameTextChanged( const QString& ) ) );
439 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); 443 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) );
440 444
441#ifndef KAB_EMBEDDED 445#ifndef KAB_EMBEDDED
442 mNameLabel = new KSqueezedTextLabel( tab1 ); 446 mNameLabel = new KSqueezedTextLabel( tab1 );
443 mNameLabel->hide(); 447 mNameLabel->hide();
444#else //KAB_EMBEDDED 448#else //KAB_EMBEDDED
445qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 449qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
446#endif //KAB_EMBEDDED 450#endif //KAB_EMBEDDED
@@ -583,65 +587,65 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
583/*US 587/*US
584 /////////////////////////////////////// 588 ///////////////////////////////////////
585 QHBox *categoryBox = new QHBox( tab1 ); 589 QHBox *categoryBox = new QHBox( tab1 );
586 categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); 590 categoryBox->setSpacing( KDialogBase::spacingHintSmall() );
587 591
588 // Categories 592 // Categories
589 button = new QPushButton( i18n( "Categories" ), categoryBox ); 593 button = new QPushButton( i18n( "Categories" ), categoryBox );
590 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 594 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
591 595
592 mCategoryEdit = new KLineEdit( categoryBox ); 596 mCategoryEdit = new KLineEdit( categoryBox );
593 mCategoryEdit->setReadOnly( true ); 597 mCategoryEdit->setReadOnly( true );
594 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 598 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
595 SLOT( textChanged( const QString& ) ) ); 599 SLOT( textChanged( const QString& ) ) );
596 600
597 mSecrecyWidget = new SecrecyWidget( categoryBox ); 601 mSecrecyWidget = new SecrecyWidget( categoryBox );
598 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 602 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
599 603
600 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 604 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
601*/ 605*/
602 // Build the layout and add to the tab widget 606 // Build the layout and add to the tab widget
603 layout->activate(); // required 607 layout->activate(); // required
604 608
605 mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); 609 mTabWidget->addTab( tab1_1, i18n( "&Address" ) );
606} 610}
607 611
608 612
609 613
610void AddresseeEditorWidget::setupTab2() 614void AddresseeEditorWidget::setupTab2()
611{ 615{
612 // This is the Details tab 616 // This is the Details tab
613 QWidget *tab2 = new QWidget( mTabWidget ); 617 QWidget *tab2 = new QWidget( mTabWidget );
614 618
615 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 619 Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 );
616 layout->setMargin( KDialogBase::marginHintSmall() ); 620 layout->setMargin( KDialogBase::marginHintSmall() );
617 layout->setSpacing( KDialogBase::spacingHintSmall() ); 621 layout->setSpacing( KDialogBase::spacingHintSmall() );
618 622
619 QLabel *label; 623 QLabel *label;
620 KSeparator* bar; 624 KSeparator* bar;
621 625
622 /////////////////////// 626 ///////////////////////
623 // Office info 627 // Office info
624 628
625 // Department 629 // Department
626 label = new QLabel( tab2 ); 630 label = new QLabel( tab2 );
627//US loadIcon call is ambiguous. Add one more parameter 631//US loadIcon call is ambiguous. Add one more parameter
628//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 632//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
629 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 633 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
630 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 634 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
631 635
632 label = new QLabel( i18n( "Department:" ), tab2 ); 636 label = new QLabel( i18n( "Department:" ), tab2 );
633 layout->addWidget( label, 0, 1 ); 637 layout->addWidget( label, 0, 1 );
634 mDepartmentEdit = new KLineEdit( tab2 ); 638 mDepartmentEdit = new KLineEdit( tab2 );
635 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 639 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
636 SLOT( textChanged( const QString& ) ) ); 640 SLOT( textChanged( const QString& ) ) );
637 label->setBuddy( mDepartmentEdit ); 641 label->setBuddy( mDepartmentEdit );
638 layout->addWidget( mDepartmentEdit, 0, 2 ); 642 layout->addWidget( mDepartmentEdit, 0, 2 );
639 643
640 label = new QLabel( i18n( "Office:" ), tab2 ); 644 label = new QLabel( i18n( "Office:" ), tab2 );
641 layout->addWidget( label, 1, 1 ); 645 layout->addWidget( label, 1, 1 );
642 mOfficeEdit = new KLineEdit( tab2 ); 646 mOfficeEdit = new KLineEdit( tab2 );
643 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 647 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
644 SLOT( textChanged( const QString& ) ) ); 648 SLOT( textChanged( const QString& ) ) );
645 label->setBuddy( mOfficeEdit ); 649 label->setBuddy( mOfficeEdit );
646 layout->addWidget( mOfficeEdit, 1, 2 ); 650 layout->addWidget( mOfficeEdit, 1, 2 );
647 651
@@ -662,109 +666,109 @@ void AddresseeEditorWidget::setupTab2()
662 label->setBuddy( mManagerEdit ); 666 label->setBuddy( mManagerEdit );
663//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 667//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
664 layout->addWidget( mManagerEdit, 3, 2 ); 668 layout->addWidget( mManagerEdit, 3, 2 );
665 669
666 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 670 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
667//US layout->addWidget( label, 1, 3 ); 671//US layout->addWidget( label, 1, 3 );
668 layout->addWidget( label, 4, 1 ); 672 layout->addWidget( label, 4, 1 );
669 mAssistantEdit = new KLineEdit( tab2 ); 673 mAssistantEdit = new KLineEdit( tab2 );
670 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 674 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
671 SLOT( textChanged( const QString& ) ) ); 675 SLOT( textChanged( const QString& ) ) );
672 label->setBuddy( mAssistantEdit ); 676 label->setBuddy( mAssistantEdit );
673//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 677//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
674 layout->addWidget( mAssistantEdit, 4, 2 ); 678 layout->addWidget( mAssistantEdit, 4, 2 );
675 679
676 bar = new KSeparator( KSeparator::HLine, tab2 ); 680 bar = new KSeparator( KSeparator::HLine, tab2 );
677//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 681//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
678 layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); 682 layout->addMultiCellWidget( bar, 5, 5, 0, 2 );
679 683
680 ///////////////////////////////////////////////// 684 /////////////////////////////////////////////////
681 // Personal info 685 // Personal info
682 686
683 //label = new QLabel( tab2 ); 687 //label = new QLabel( tab2 );
684//US loadIcon call is ambiguous. Add one more parameter 688//US loadIcon call is ambiguous. Add one more parameter
685//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 689//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
686 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 690 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
687//US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 691//US layout->addMultiCellWidget( label, 4, 5, 0, 0 );
688 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 692 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
689 693
690 694
691 int iii = 6; 695 int iii = 6;
692 696
693 if ( QApplication::desktop()->width() == 640 ) { 697 if ( QApplication::desktop()->width() == 640 ) {
694 QHBox * nbox = new QHBox ( tab2 ); 698 Q3HBox * nbox = new Q3HBox ( tab2 );
695 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 699 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
696 mNicknameEdit = new KLineEdit( nbox ); 700 mNicknameEdit = new KLineEdit( nbox );
697 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 701 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
698 SLOT( textChanged( const QString& ) ) ); 702 SLOT( textChanged( const QString& ) ) );
699 label->setBuddy( mNicknameEdit ); 703 label->setBuddy( mNicknameEdit );
700 704
701 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); 705 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox );
702 mSpouseEdit = new KLineEdit( nbox ); 706 mSpouseEdit = new KLineEdit( nbox );
703 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 707 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
704 SLOT( textChanged( const QString& ) ) ); 708 SLOT( textChanged( const QString& ) ) );
705 label->setBuddy( mSpouseEdit ); 709 label->setBuddy( mSpouseEdit );
706 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 710 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
707 ++iii; 711 ++iii;
708 712
709 } else { 713 } else {
710 label = new QLabel( i18n( "Nick name:" ), tab2 ); 714 label = new QLabel( i18n( "Nick name:" ), tab2 );
711 layout->addWidget( label, iii, 1 ); 715 layout->addWidget( label, iii, 1 );
712 mNicknameEdit = new KLineEdit( tab2 ); 716 mNicknameEdit = new KLineEdit( tab2 );
713 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 717 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
714 SLOT( textChanged( const QString& ) ) ); 718 SLOT( textChanged( const QString& ) ) );
715 label->setBuddy( mNicknameEdit ); 719 label->setBuddy( mNicknameEdit );
716 layout->addWidget( mNicknameEdit, iii, 2 ); 720 layout->addWidget( mNicknameEdit, iii, 2 );
717 ++iii; 721 ++iii;
718 722
719 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 723 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
720 layout->addWidget( label, iii, 1 ); 724 layout->addWidget( label, iii, 1 );
721 mSpouseEdit = new KLineEdit( tab2 ); 725 mSpouseEdit = new KLineEdit( tab2 );
722 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 726 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
723 SLOT( textChanged( const QString& ) ) ); 727 SLOT( textChanged( const QString& ) ) );
724 label->setBuddy( mSpouseEdit ); 728 label->setBuddy( mSpouseEdit );
725 layout->addWidget( mSpouseEdit, iii, 2 ); 729 layout->addWidget( mSpouseEdit, iii, 2 );
726 ++iii; 730 ++iii;
727 } 731 }
728 732
729 label = new QLabel( i18n( "Children's names:" ), tab2 ); 733 label = new QLabel( i18n( "Children's names:" ), tab2 );
730 layout->addWidget( label, iii, 1 ); 734 layout->addWidget( label, iii, 1 );
731 mChildEdit = new KLineEdit( tab2 ); 735 mChildEdit = new KLineEdit( tab2 );
732 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 736 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
733 SLOT( textChanged( const QString& ) ) ); 737 SLOT( textChanged( const QString& ) ) );
734 label->setBuddy( mChildEdit ); 738 label->setBuddy( mChildEdit );
735 layout->addWidget( mChildEdit, iii, 2 ); 739 layout->addWidget( mChildEdit, iii, 2 );
736 ++iii; 740 ++iii;
737 if ( QApplication::desktop()->width() == 640 ) { 741 if ( QApplication::desktop()->width() == 640 ) {
738 QHBox * nbox = new QHBox ( tab2 ); 742 Q3HBox * nbox = new Q3HBox ( tab2 );
739 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 743 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
740 mBirthdayPicker = new KDateEdit( nbox ); 744 mBirthdayPicker = new KDateEdit( nbox );
741 //mBirthdayPicker->toggleDateFormat(); 745 //mBirthdayPicker->toggleDateFormat();
742 mBirthdayPicker->setHandleInvalid( true ); 746 mBirthdayPicker->setHandleInvalid( true );
743 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 747 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
744 SLOT( dateChanged( QDate ) ) ); 748 SLOT( dateChanged( QDate ) ) );
745 749
746 label->setBuddy( mBirthdayPicker ); 750 label->setBuddy( mBirthdayPicker );
747 751
748 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); 752 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
749 mAnniversaryPicker = new KDateEdit( nbox ); 753 mAnniversaryPicker = new KDateEdit( nbox );
750 mAnniversaryPicker->setHandleInvalid( true ); 754 mAnniversaryPicker->setHandleInvalid( true );
751 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 755 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
752 SLOT( dateChanged( QDate ) ) ); 756 SLOT( dateChanged( QDate ) ) );
753 757
754 label->setBuddy( mAnniversaryPicker ); 758 label->setBuddy( mAnniversaryPicker );
755 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 759 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
756 ++iii; 760 ++iii;
757 761
758 } else { 762 } else {
759 763
760 label = new QLabel( i18n( "Birthday:" ), tab2 ); 764 label = new QLabel( i18n( "Birthday:" ), tab2 );
761 layout->addWidget( label, iii, 1 ); 765 layout->addWidget( label, iii, 1 );
762 mBirthdayPicker = new KDateEdit( tab2 ); 766 mBirthdayPicker = new KDateEdit( tab2 );
763 //mBirthdayPicker->toggleDateFormat(); 767 //mBirthdayPicker->toggleDateFormat();
764 mBirthdayPicker->setHandleInvalid( true ); 768 mBirthdayPicker->setHandleInvalid( true );
765 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 769 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
766 SLOT( dateChanged( QDate ) ) ); 770 SLOT( dateChanged( QDate ) ) );
767 771
768 label->setBuddy( mBirthdayPicker ); 772 label->setBuddy( mBirthdayPicker );
769 layout->addWidget( mBirthdayPicker, iii, 2 ); 773 layout->addWidget( mBirthdayPicker, iii, 2 );
770 ++iii; 774 ++iii;
@@ -775,65 +779,65 @@ void AddresseeEditorWidget::setupTab2()
775 mAnniversaryPicker->setHandleInvalid( true ); 779 mAnniversaryPicker->setHandleInvalid( true );
776 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 780 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
777 SLOT( dateChanged( QDate ) ) ); 781 SLOT( dateChanged( QDate ) ) );
778 782
779 label->setBuddy( mAnniversaryPicker ); 783 label->setBuddy( mAnniversaryPicker );
780 layout->addWidget( mAnniversaryPicker, iii, 2 ); 784 layout->addWidget( mAnniversaryPicker, iii, 2 );
781 ++iii; 785 ++iii;
782 786
783 } 787 }
784 788
785 label = new QLabel( i18n( "Gender:" ), tab2 ); 789 label = new QLabel( i18n( "Gender:" ), tab2 );
786 layout->addWidget( label, iii, 1 ); 790 layout->addWidget( label, iii, 1 );
787 mGenderBox = new QComboBox ( tab2 ); 791 mGenderBox = new QComboBox ( tab2 );
788 mGenderBox->insertItem ( i18n( "ALIEN (undefined)" )); 792 mGenderBox->insertItem ( i18n( "ALIEN (undefined)" ));
789 mGenderBox->insertItem ( i18n( "female" )); 793 mGenderBox->insertItem ( i18n( "female" ));
790 mGenderBox->insertItem ( i18n( "male" )); 794 mGenderBox->insertItem ( i18n( "male" ));
791 connect( mGenderBox, SIGNAL( activated ( const QString & ) ), 795 connect( mGenderBox, SIGNAL( activated ( const QString & ) ),
792 SLOT( textChanged( const QString& ) ) ); 796 SLOT( textChanged( const QString& ) ) );
793 label->setBuddy( mGenderBox ); 797 label->setBuddy( mGenderBox );
794 layout->addWidget( mGenderBox, iii, 2 ); 798 layout->addWidget( mGenderBox, iii, 2 );
795 ++iii; 799 ++iii;
796 // Build the layout and add to the tab widget 800 // Build the layout and add to the tab widget
797 layout->activate(); // required 801 layout->activate(); // required
798 802
799 mTabWidget->addTab( tab2, i18n( "&Details" ) ); 803 mTabWidget->addTab( tab2, i18n( "&Details" ) );
800} 804}
801 805
802void AddresseeEditorWidget::setupTab2_1() 806void AddresseeEditorWidget::setupTab2_1()
803{ 807{
804 // This is the Details tab 808 // This is the Details tab
805 QWidget *tab2_2 = new QWidget( mTabWidget ); 809 QWidget *tab2_2 = new QWidget( mTabWidget );
806 810
807 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 811 Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 );
808 layout->setMargin( KDialogBase::marginHintSmall() ); 812 layout->setMargin( KDialogBase::marginHintSmall() );
809 layout->setSpacing( KDialogBase::spacingHintSmall() ); 813 layout->setSpacing( KDialogBase::spacingHintSmall() );
810 814
811 QLabel *label; 815 QLabel *label;
812 KSeparator* bar; 816 KSeparator* bar;
813 817
814/*US 818/*US
815 /////////////////////// 819 ///////////////////////
816 // Office info 820 // Office info
817 821
818 // Department 822 // Department
819 label = new QLabel( tab2 ); 823 label = new QLabel( tab2 );
820//US loadIcon call is ambiguous. Add one more parameter 824//US loadIcon call is ambiguous. Add one more parameter
821//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 825//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
822 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 826 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
823 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 827 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
824 828
825 label = new QLabel( i18n( "Department:" ), tab2 ); 829 label = new QLabel( i18n( "Department:" ), tab2 );
826 layout->addWidget( label, 0, 1 ); 830 layout->addWidget( label, 0, 1 );
827 mDepartmentEdit = new KLineEdit( tab2 ); 831 mDepartmentEdit = new KLineEdit( tab2 );
828 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 832 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
829 SLOT( textChanged( const QString& ) ) ); 833 SLOT( textChanged( const QString& ) ) );
830 label->setBuddy( mDepartmentEdit ); 834 label->setBuddy( mDepartmentEdit );
831 layout->addWidget( mDepartmentEdit, 0, 2 ); 835 layout->addWidget( mDepartmentEdit, 0, 2 );
832 836
833 label = new QLabel( i18n( "Office:" ), tab2 ); 837 label = new QLabel( i18n( "Office:" ), tab2 );
834 layout->addWidget( label, 1, 1 ); 838 layout->addWidget( label, 1, 1 );
835 mOfficeEdit = new KLineEdit( tab2 ); 839 mOfficeEdit = new KLineEdit( tab2 );
836 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 840 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
837 SLOT( textChanged( const QString& ) ) ); 841 SLOT( textChanged( const QString& ) ) );
838 label->setBuddy( mOfficeEdit ); 842 label->setBuddy( mOfficeEdit );
839 layout->addWidget( mOfficeEdit, 1, 2 ); 843 layout->addWidget( mOfficeEdit, 1, 2 );
@@ -897,144 +901,144 @@ void AddresseeEditorWidget::setupTab2_1()
897 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 901 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
898 SLOT( dateChanged( QDate ) ) ); 902 SLOT( dateChanged( QDate ) ) );
899 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), 903 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ),
900 SLOT( invalidDate() ) ); 904 SLOT( invalidDate() ) );
901 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), 905 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ),
902 SLOT( emitModified() ) ); 906 SLOT( emitModified() ) );
903 label->setBuddy( mBirthdayPicker ); 907 label->setBuddy( mBirthdayPicker );
904 layout->addWidget( mBirthdayPicker, 4, 4 ); 908 layout->addWidget( mBirthdayPicker, 4, 4 );
905 909
906 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 910 label = new QLabel( i18n( "Anniversary:" ), tab2 );
907 layout->addWidget( label, 5, 3 ); 911 layout->addWidget( label, 5, 3 );
908 mAnniversaryPicker = new KDateEdit( tab2 ); 912 mAnniversaryPicker = new KDateEdit( tab2 );
909 mAnniversaryPicker->setHandleInvalid( true ); 913 mAnniversaryPicker->setHandleInvalid( true );
910 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 914 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
911 SLOT( dateChanged( QDate ) ) ); 915 SLOT( dateChanged( QDate ) ) );
912 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), 916 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ),
913 SLOT( invalidDate() ) ); 917 SLOT( invalidDate() ) );
914 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), 918 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ),
915 SLOT( emitModified() ) ); 919 SLOT( emitModified() ) );
916 label->setBuddy( mAnniversaryPicker ); 920 label->setBuddy( mAnniversaryPicker );
917 layout->addWidget( mAnniversaryPicker, 5, 4 ); 921 layout->addWidget( mAnniversaryPicker, 5, 4 );
918 922
919 bar = new KSeparator( KSeparator::HLine, tab2 ); 923 bar = new KSeparator( KSeparator::HLine, tab2 );
920 layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); 924 layout->addMultiCellWidget( bar, 6, 6, 0, 5 );
921*/ 925*/
922 ////////////////////////////////////// 926 //////////////////////////////////////
923 // Notes 927 // Notes
924 label = new QLabel( i18n( "Note:" ), tab2_2 ); 928 label = new QLabel( i18n( "Note:" ), tab2_2 );
925 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 929 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
926//US layout->addWidget( label, 7, 0 ); 930//US layout->addWidget( label, 7, 0 );
927 layout->addWidget( label, 0, 0 ); 931 layout->addWidget( label, 0, 0 );
928#ifndef KAB_EMBEDDED 932#ifndef KAB_EMBEDDED
929 mNoteEdit = new QTextEdit( tab2_2 ); 933 mNoteEdit = new Q3TextEdit( tab2_2 );
930 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); 934 mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth );
931 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
932#else //KAB_EMBEDDED 936#else //KAB_EMBEDDED
933 mNoteEdit = new QMultiLineEdit( tab2_2 ); 937 mNoteEdit = new Q3MultiLineEdit( tab2_2 );
934 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); 938 mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth );
935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 939 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
936#endif //KAB_EMBEDDED 940#endif //KAB_EMBEDDED
937 941
938 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); 942 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
939 label->setBuddy( mNoteEdit ); 943 label->setBuddy( mNoteEdit );
940//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); 944//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
941 layout->addWidget( mNoteEdit, 1, 0); 945 layout->addWidget( mNoteEdit, 1, 0);
942 946
943 // Build the layout and add to the tab widget 947 // Build the layout and add to the tab widget
944 layout->activate(); // required 948 layout->activate(); // required
945 949
946 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); 950 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) );
947} 951}
948 952
949 953
950 954
951void AddresseeEditorWidget::setupTab3() 955void AddresseeEditorWidget::setupTab3()
952{ 956{
953 // This is the Misc tab 957 // This is the Misc tab
954 QWidget *tab3 = new QWidget( mTabWidget ); 958 QWidget *tab3 = new QWidget( mTabWidget );
955 959
956 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 960 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
957 layout->setMargin( KDialogBase::marginHintSmall() ); 961 layout->setMargin( KDialogBase::marginHintSmall() );
958 layout->setSpacing( KDialogBase::spacingHintSmall() ); 962 layout->setSpacing( KDialogBase::spacingHintSmall() );
959//US layout->setColStretch( 2, 1 ); 963//US layout->setColStretch( 2, 1 );
960 964
961 ////////////////////////////////////// 965 //////////////////////////////////////
962 // Geo 966 // Geo
963 mGeoWidget = new GeoWidget( tab3 ); 967 mGeoWidget = new GeoWidget( tab3 );
964 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 968 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
965 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 969 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
966 layout->addWidget( mGeoWidget, 0, 0 ); 970 layout->addWidget( mGeoWidget, 0, 0 );
967/*US 971/*US
968 ////////////////////////////////////// 972 //////////////////////////////////////
969 // Sound 973 // Sound
970#ifndef KAB_EMBEDDED 974#ifndef KAB_EMBEDDED
971 mSoundWidget = new SoundWidget( tab3 ); 975 mSoundWidget = new SoundWidget( tab3 );
972 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 976 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
973 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 977 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
974 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 978 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
975#else //KAB_EMBEDDED 979#else //KAB_EMBEDDED
976qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 980qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
977#endif //KAB_EMBEDDED 981#endif //KAB_EMBEDDED
978 982
979 ////////////////////////////////////// 983 //////////////////////////////////////
980 // Images 984 // Images
981 mImageWidget = new ImageWidget( tab3 ); 985 mImageWidget = new ImageWidget( tab3 );
982 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 986 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
983 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 987 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
984 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); 988 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop );
985*/ 989*/
986//US 990//US
987/* 991/*
988 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); 992 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 );
989 layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); 993 layout->addMultiCellWidget( bar, 1, 1, 0, 0 );
990*/ 994*/
991 ////////////////////////////////////// 995 //////////////////////////////////////
992 // Keys 996 // Keys
993 mKeyWidget = new KeyWidget( tab3 ); 997 mKeyWidget = new KeyWidget( tab3 );
994 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); 998 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
995 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 999 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
996//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 1000//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
997 layout->addWidget( mKeyWidget, 1, 0 ); 1001 layout->addWidget( mKeyWidget, 1, 0 );
998 1002
999 mTabWidget->addTab( tab3, i18n( "&Misc" ) ); 1003 mTabWidget->addTab( tab3, i18n( "&Misc" ) );
1000} 1004}
1001 1005
1002void AddresseeEditorWidget::setupTab3_1() 1006void AddresseeEditorWidget::setupTab3_1()
1003{ 1007{
1004 // This is the Misc tab 1008 // This is the Misc tab
1005 QWidget *tab3 = new QWidget( mTabWidget ); 1009 QWidget *tab3 = new QWidget( mTabWidget );
1006 1010
1007//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); 1011//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
1008 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 1012 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
1009 layout->setMargin( KDialogBase::marginHint() ); 1013 layout->setMargin( KDialogBase::marginHint() );
1010 layout->setSpacing( KDialogBase::spacingHint() ); 1014 layout->setSpacing( KDialogBase::spacingHint() );
1011//US layout->setColStretch( 2, 1 ); 1015//US layout->setColStretch( 2, 1 );
1012 1016
1013/*US 1017/*US
1014 ////////////////////////////////////// 1018 //////////////////////////////////////
1015 // Geo 1019 // Geo
1016 mGeoWidget = new GeoWidget( tab3 ); 1020 mGeoWidget = new GeoWidget( tab3 );
1017 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 1021 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
1018 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 1022 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
1019 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); 1023 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop );
1020*/ 1024*/
1021 ////////////////////////////////////// 1025 //////////////////////////////////////
1022 // Sound 1026 // Sound
1023#ifndef KAB_EMBEDDED 1027#ifndef KAB_EMBEDDED
1024 mSoundWidget = new SoundWidget( tab3 ); 1028 mSoundWidget = new SoundWidget( tab3 );
1025 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 1029 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
1026 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 1030 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
1027 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 1031 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
1028#else //KAB_EMBEDDED 1032#else //KAB_EMBEDDED
1029//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 1033//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
1030#endif //KAB_EMBEDDED 1034#endif //KAB_EMBEDDED
1031 1035
1032 ////////////////////////////////////// 1036 //////////////////////////////////////
1033 // Images 1037 // Images
1034 mImageWidget = new ImageWidget( tab3 ); 1038 mImageWidget = new ImageWidget( tab3 );
1035 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 1039 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
1036 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 1040 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
1037 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); 1041 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop );
1038/*US 1042/*US
1039 ////////////////////////////////////// 1043 //////////////////////////////////////
1040 // Keys 1044 // Keys
@@ -1401,35 +1405,35 @@ void AddresseeEditorWidget::dateChanged( QDate )
1401{ 1405{
1402 emitModified(); 1406 emitModified();
1403} 1407}
1404 1408
1405//US invalid dates are handdled by the KDateEdit widget itself 1409//US invalid dates are handdled by the KDateEdit widget itself
1406void AddresseeEditorWidget::invalidDate() 1410void AddresseeEditorWidget::invalidDate()
1407{ 1411{
1408 KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); 1412 KMessageBox::sorry( this, i18n( "You must specify a valid date" ) );
1409} 1413}
1410 1414
1411 1415
1412void AddresseeEditorWidget::pageChanged( QWidget *wdg ) 1416void AddresseeEditorWidget::pageChanged( QWidget *wdg )
1413{ 1417{
1414#ifndef KAB_EMBEDDED 1418#ifndef KAB_EMBEDDED
1415 if ( wdg ) 1419 if ( wdg )
1416 KAcceleratorManager::manage( wdg ); 1420 KAcceleratorManager::manage( wdg );
1417#else //KAB_EMBEDDED 1421#else //KAB_EMBEDDED
1418//US 1422//US
1419#endif //KAB_EMBEDDED 1423#endif //KAB_EMBEDDED
1420 1424
1421} 1425}
1422 1426
1423QString AddresseeEditorWidget::title() const 1427QString AddresseeEditorWidget::title() const
1424{ 1428{
1425 return i18n( "Contact Editor" ); 1429 return i18n( "Contact Editor" );
1426} 1430}
1427 1431
1428QString AddresseeEditorWidget::identifier() const 1432QString AddresseeEditorWidget::identifier() const
1429{ 1433{
1430 return i18n( "contact_editor" ); 1434 return i18n( "contact_editor" );
1431} 1435}
1432 1436
1433#ifndef KAB_EMBEDDED 1437#ifndef KAB_EMBEDDED_
1434#include "addresseeeditorwidget.moc" 1438#include "moc_addresseeeditorwidget.cpp"
1435#endif //KAB_EMBEDDED 1439#endif //KAB_EMBEDDED