summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index dbbf7fe..50b6b6d 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -1,1348 +1,1349 @@
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 <qhbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistbox.h> 28#include <qlistbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qtabwidget.h> 30#include <qtabwidget.h>
31#include <qapplication.h>
31 32
32#ifndef KAB_EMBEDDED 33#ifndef KAB_EMBEDDED
33#include <qtextedit.h> 34#include <qtextedit.h>
34 35
35#include <kaccelmanager.h> 36#include <kaccelmanager.h>
36#include "keywidget.h" 37#include "keywidget.h"
37#include "soundwidget.h" 38#include "soundwidget.h"
38 39
39#else //KAB_EMBEDDED 40#else //KAB_EMBEDDED
40#include <qmultilineedit.h> 41#include <qmultilineedit.h>
41#endif //KAB_EMBEDDED 42#endif //KAB_EMBEDDED
42 43
43 44
44#include "keywidget.h" 45#include "keywidget.h"
45#include "geowidget.h" 46#include "geowidget.h"
46#include "imagewidget.h" 47#include "imagewidget.h"
47#include "nameeditdialog.h" 48#include "nameeditdialog.h"
48#include "phoneeditwidget.h" 49#include "phoneeditwidget.h"
49#include "secrecywidget.h" 50#include "secrecywidget.h"
50 51
51 52
52#include <qtoolbutton.h> 53#include <qtoolbutton.h>
53#include <qtooltip.h> 54#include <qtooltip.h>
54 55
55#include <kapplication.h> 56#include <kapplication.h>
56#include <kconfig.h> 57#include <kconfig.h>
57#include <kcombobox.h> 58#include <kcombobox.h>
58#include <kdebug.h> 59#include <kdebug.h>
59#include <kdialogbase.h> 60#include <kdialogbase.h>
60#include <kglobal.h> 61#include <kglobal.h>
61#include <kiconloader.h> 62#include <kiconloader.h>
62#include <klineedit.h> 63#include <klineedit.h>
63#include <klocale.h> 64#include <klocale.h>
64#include <kmessagebox.h> 65#include <kmessagebox.h>
65#include <kseparator.h> 66#include <kseparator.h>
66#include <ksqueezedtextlabel.h> 67#include <ksqueezedtextlabel.h>
67 68
68#include <libkdepim/categoryeditdialog.h> 69#include <libkdepim/categoryeditdialog.h>
69#include <libkdepim/categoryselectdialog.h> 70#include <libkdepim/categoryselectdialog.h>
70 71
71#include <libkdepim/kdateedit.h> 72#include <libkdepim/kdateedit.h>
72 73
73#include "addresseditwidget.h" 74#include "addresseditwidget.h"
74#include "emaileditwidget.h" 75#include "emaileditwidget.h"
75#include "kabcore.h" 76#include "kabcore.h"
76#include "kabprefs.h" 77#include "kabprefs.h"
77 78
78#include "addresseeeditorwidget.h" 79#include "addresseeeditorwidget.h"
79 80
80 81
81 82
82AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, 83AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension,
83 QWidget *parent, const char *name ) 84 QWidget *parent, const char *name )
84 : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), 85 : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ),
85 mBlockSignals( false ) 86 mBlockSignals( false )
86{ 87{
87 88
88 mAConfig = AddresseeConfig::instance(); 89 mAConfig = AddresseeConfig::instance();
89 90
90 mFormattedNameType = NameEditDialog::CustomName; 91 mFormattedNameType = NameEditDialog::CustomName;
91 initGUI(); 92 initGUI();
92 mCategoryDialog = 0; 93 mCategoryDialog = 0;
93 mCategoryEditDialog = 0; 94 mCategoryEditDialog = 0;
94 95
95 // Load the empty addressee as defaults 96 // Load the empty addressee as defaults
96 load(); 97 load();
97 98
98 mDirty = false; 99 mDirty = false;
99} 100}
100 101
101AddresseeEditorWidget::~AddresseeEditorWidget() 102AddresseeEditorWidget::~AddresseeEditorWidget()
102{ 103{
103 kdDebug(5720) << "~AddresseeEditorWidget()" << endl; 104 kdDebug(5720) << "~AddresseeEditorWidget()" << endl;
104} 105}
105 106
106void AddresseeEditorWidget::contactsSelectionChanged() 107void AddresseeEditorWidget::contactsSelectionChanged()
107{ 108{
108 KABC::Addressee::List list = selectedContacts(); 109 KABC::Addressee::List list = selectedContacts();
109 110
110 mAddressee = list[ 0 ]; 111 mAddressee = list[ 0 ];
111 load(); 112 load();
112} 113}
113 114
114void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) 115void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr )
115{ 116{
116 mAddressee = addr; 117 mAddressee = addr;
117 load(); 118 load();
118} 119}
119 120
120const KABC::Addressee &AddresseeEditorWidget::addressee() 121const KABC::Addressee &AddresseeEditorWidget::addressee()
121{ 122{
122 return mAddressee; 123 return mAddressee;
123} 124}
124 125
125void AddresseeEditorWidget::textChanged( const QString& ) 126void AddresseeEditorWidget::textChanged( const QString& )
126{ 127{
127 emitModified(); 128 emitModified();
128} 129}
129 130
130void AddresseeEditorWidget::initGUI() 131void AddresseeEditorWidget::initGUI()
131{ 132{
132 QVBoxLayout *layout = new QVBoxLayout( this ); 133 QVBoxLayout *layout = new QVBoxLayout( this );
133 134
134 mTabWidget = new QTabWidget( this ); 135 mTabWidget = new QTabWidget( this );
135 layout->addWidget( mTabWidget ); 136 layout->addWidget( mTabWidget );
136 137
137 setupTab1(); 138 setupTab1();
138 setupTab1_1(); 139 setupTab1_1();
139 setupTab2(); 140 setupTab2();
140 setupTab2_1(); 141 setupTab2_1();
141 setupTab3(); 142 setupTab3();
142 setupTab3_1(); 143 setupTab3_1();
143 144
144 mNameEdit->setFocus(); 145 mNameEdit->setFocus();
145 146
146 connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), 147 connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ),
147 SLOT( pageChanged(QWidget*) ) ); 148 SLOT( pageChanged(QWidget*) ) );
148} 149}
149 150
150void AddresseeEditorWidget::setupTab1() 151void AddresseeEditorWidget::setupTab1()
151{ 152{
152 // This is the General tab 153 // This is the General tab
153 QWidget *tab1 = new QWidget( mTabWidget ); 154 QWidget *tab1 = new QWidget( mTabWidget );
154 155
155//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); 156//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 );
156 QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); 157 QGridLayout *layout = new QGridLayout( tab1, 7, 1 );
157 layout->setMargin( KDialogBase::marginHintSmall() ); 158 layout->setMargin( KDialogBase::marginHintSmall() );
158 layout->setSpacing( KDialogBase::spacingHintSmall() ); 159 layout->setSpacing( KDialogBase::spacingHintSmall() );
159 160
160 QLabel *label; 161 QLabel *label;
161 KSeparator* bar; 162 KSeparator* bar;
162 QPushButton *button; 163 QPushButton *button;
163 164
164 ////////////////////////////////// 165 //////////////////////////////////
165 // Upper left group (person info) 166 // Upper left group (person info)
166 167
167 // Person icon 168 // Person icon
168 /* LR 169 /* LR
169 label = new QLabel( tab1 ); 170 label = new QLabel( tab1 );
170//US ambiguous call. Add one more parameter 171//US ambiguous call. Add one more parameter
171//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 172//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
172 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 173 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
173 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 174 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
174 */ 175 */
175 // First name 176 // First name
176 button = new QPushButton( i18n( "Name..." ), tab1 ); 177 button = new QPushButton( i18n( "Name..." ), tab1 );
177//US QToolTip::add( button, i18n( "Edit the contact's name" ) ); 178//US QToolTip::add( button, i18n( "Edit the contact's name" ) );
178 mNameEdit = new KLineEdit( tab1, "mNameEdit" ); 179 mNameEdit = new KLineEdit( tab1, "mNameEdit" );
179 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 180 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
180 SLOT( nameTextChanged( const QString& ) ) ); 181 SLOT( nameTextChanged( const QString& ) ) );
181 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); 182 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) );
182 183
183 mNameLabel = new KSqueezedTextLabel( tab1 ); 184 mNameLabel = new KSqueezedTextLabel( tab1 );
184 mNameLabel->hide(); 185 mNameLabel->hide();
185 186
186 layout->addWidget( button, 0, 0 ); 187 layout->addWidget( button, 0, 0 );
187 layout->addWidget( mNameEdit, 0, 1 ); 188 layout->addWidget( mNameEdit, 0, 1 );
188 layout->addWidget( mNameLabel, 0, 1 ); 189 layout->addWidget( mNameLabel, 0, 1 );
189 190
190 label = new QLabel( i18n( "Role:" ), tab1 ); 191 label = new QLabel( i18n( "Role:" ), tab1 );
191 mRoleEdit = new KLineEdit( tab1 ); 192 mRoleEdit = new KLineEdit( tab1 );
192 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), 193 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ),
193 SLOT( textChanged( const QString& ) ) ); 194 SLOT( textChanged( const QString& ) ) );
194 label->setBuddy( mRoleEdit ); 195 label->setBuddy( mRoleEdit );
195 layout->addWidget( label, 1, 0 ); 196 layout->addWidget( label, 1, 0 );
196 layout->addWidget( mRoleEdit, 1, 1 ); 197 layout->addWidget( mRoleEdit, 1, 1 );
197 198
198 // Organization 199 // Organization
199 label = new QLabel( i18n( "Organization:" ), tab1 ); 200 label = new QLabel( i18n( "Organization:" ), tab1 );
200 mOrgEdit = new KLineEdit( tab1 ); 201 mOrgEdit = new KLineEdit( tab1 );
201 label->setBuddy( mOrgEdit ); 202 label->setBuddy( mOrgEdit );
202 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), 203 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ),
203 SLOT( textChanged( const QString& ) ) ); 204 SLOT( textChanged( const QString& ) ) );
204 layout->addWidget( label, 2, 0 ); 205 layout->addWidget( label, 2, 0 );
205 layout->addWidget( mOrgEdit, 2, 1 ); 206 layout->addWidget( mOrgEdit, 2, 1 );
206 207
207 // File as (formatted name) 208 // File as (formatted name)
208 label = new QLabel( i18n( "Formatted name:" ), tab1 ); 209 label = new QLabel( i18n( "Formatted name:" ), tab1 );
209 mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); 210 mFormattedNameLabel = new KSqueezedTextLabel( tab1 );
210 layout->addWidget( label, 3, 0 ); 211 layout->addWidget( label, 3, 0 );
211 layout->addWidget( mFormattedNameLabel, 3, 1 ); 212 layout->addWidget( mFormattedNameLabel, 3, 1 );
212 /* LR 213 /* LR
213 // Left hand separator. This separator doesn't go all the way 214 // Left hand separator. This separator doesn't go all the way
214 // across so the dialog still flows from top to bottom 215 // across so the dialog still flows from top to bottom
215 bar = new KSeparator( KSeparator::HLine, tab1 ); 216 bar = new KSeparator( KSeparator::HLine, tab1 );
216 layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); 217 layout->addMultiCellWidget( bar, 4, 4, 0, 2 );
217 */ 218 */
218 ////////////////////////////////////// 219 //////////////////////////////////////
219 220
220 /* LR 221 /* LR
221 // Phone numbers (upper right) 222 // Phone numbers (upper right)
222 label = new QLabel( tab1 ); 223 label = new QLabel( tab1 );
223//US loadIcon call is ambiguous. Add one more parameter 224//US loadIcon call is ambiguous. Add one more parameter
224//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); 225//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
225 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 226 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
226//US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 227//US layout->addMultiCellWidget( label, 0, 1, 3, 3 );
227 layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 228 layout->addMultiCellWidget( label, 5, 6, 0, 0 );
228 */ 229 */
229 mPhoneEditWidget = new PhoneEditWidget( tab1 ); 230 mPhoneEditWidget = new PhoneEditWidget( tab1 );
230 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 231 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
231//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); 232//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 );
232 int iii; 233 int iii;
233#ifndef DESKTOP_VERSION 234#ifndef DESKTOP_VERSION
234 iii = 7; 235 iii = 7;
235#else 236#else
236 iii = 8; 237 iii = 8;
237#endif 238#endif
238 layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 ); 239 layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 );
239 ++iii; 240 ++iii;
240 /* LR 241 /* LR
241 bar = new KSeparator( KSeparator::HLine, tab1 ); 242 bar = new KSeparator( KSeparator::HLine, tab1 );
242//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); 243//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 );
243 layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); 244 layout->addMultiCellWidget( bar, 9, 9, 0, 2 );
244 */ 245 */
245/*US 246/*US
246 ////////////////////////////////////// 247 //////////////////////////////////////
247 // Addresses (lower left) 248 // Addresses (lower left)
248 label = new QLabel( tab1 ); 249 label = new QLabel( tab1 );
249//US loadIcon call is ambiguous. Add one more parameter 250//US loadIcon call is ambiguous. Add one more parameter
250//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); 251//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) );
251 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 252 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );
252 layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 253 layout->addMultiCellWidget( label, 5, 6, 0, 0 );
253 254
254 mAddressEditWidget = new AddressEditWidget( tab1 ); 255 mAddressEditWidget = new AddressEditWidget( tab1 );
255 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 256 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
256 layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); 257 layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 );
257 258
258 ////////////////////////////////////// 259 //////////////////////////////////////
259 // Email / Web (lower right) 260 // Email / Web (lower right)
260 label = new QLabel( tab1 ); 261 label = new QLabel( tab1 );
261//US loadIcon call is ambiguous. Add one more parameter 262//US loadIcon call is ambiguous. Add one more parameter
262//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); 263//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) );
263 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); 264 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) );
264 layout->addMultiCellWidget( label, 5, 6, 3, 3 ); 265 layout->addMultiCellWidget( label, 5, 6, 3, 3 );
265 266
266 mEmailWidget = new EmailEditWidget( tab1 ); 267 mEmailWidget = new EmailEditWidget( tab1 );
267 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 268 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
268 layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); 269 layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 );
269 270
270 // add the separator 271 // add the separator
271 bar = new KSeparator( KSeparator::HLine, tab1 ); 272 bar = new KSeparator( KSeparator::HLine, tab1 );
272 layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); 273 layout->addMultiCellWidget( bar, 7, 7, 3, 6 );
273 274
274 label = new QLabel( tab1 ); 275 label = new QLabel( tab1 );
275//US loadIcon call is ambiguous. Add one more parameter 276//US loadIcon call is ambiguous. Add one more parameter
276//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); 277//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) );
277 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); 278 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) );
278 layout->addMultiCellWidget( label, 8, 9, 3, 3 ); 279 layout->addMultiCellWidget( label, 8, 9, 3, 3 );
279 280
280 label = new QLabel( i18n( "URL:" ), tab1 ); 281 label = new QLabel( i18n( "URL:" ), tab1 );
281 mURLEdit = new KLineEdit( tab1 ); 282 mURLEdit = new KLineEdit( tab1 );
282 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), 283 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ),
283 SLOT( textChanged( const QString& ) ) ); 284 SLOT( textChanged( const QString& ) ) );
284 label->setBuddy( mURLEdit ); 285 label->setBuddy( mURLEdit );
285 layout->addWidget( label, 8, 4 ); 286 layout->addWidget( label, 8, 4 );
286 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); 287 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
287 288
288 label = new QLabel( i18n( "&IM address:" ), tab1 ); 289 label = new QLabel( i18n( "&IM address:" ), tab1 );
289 mIMAddressEdit = new KLineEdit( tab1 ); 290 mIMAddressEdit = new KLineEdit( tab1 );
290 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 291 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
291 SLOT( textChanged( const QString& ) ) ); 292 SLOT( textChanged( const QString& ) ) );
292 label->setBuddy( mIMAddressEdit ); 293 label->setBuddy( mIMAddressEdit );
293 layout->addWidget( label, 9, 4 ); 294 layout->addWidget( label, 9, 4 );
294 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 295 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
295 296
296 layout->addColSpacing( 6, 50 ); 297 layout->addColSpacing( 6, 50 );
297 298
298 bar = new KSeparator( KSeparator::HLine, tab1 ); 299 bar = new KSeparator( KSeparator::HLine, tab1 );
299 layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 300 layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
300*/ 301*/
301 /////////////////////////////////////// 302 ///////////////////////////////////////
302 QHBox *categoryBox = new QHBox( tab1 ); 303 QHBox *categoryBox = new QHBox( tab1 );
303 categoryBox->setSpacing( KDialogBase::spacingHint() ); 304 categoryBox->setSpacing( KDialogBase::spacingHint() );
304 categoryBox->setMargin( KDialogBase::marginHintSmall() ); 305 categoryBox->setMargin( KDialogBase::marginHintSmall() );
305 306
306 // Categories 307 // Categories
307 button = new QPushButton( i18n( "Categories" ), categoryBox ); 308 button = new QPushButton( i18n( "Categories" ), categoryBox );
308 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 309 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
309 310
310 mCategoryEdit = new KLineEdit( categoryBox ); 311 mCategoryEdit = new KLineEdit( categoryBox );
311 mCategoryEdit->setReadOnly( true ); 312 mCategoryEdit->setReadOnly( true );
312 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 313 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
313 SLOT( textChanged( const QString& ) ) ); 314 SLOT( textChanged( const QString& ) ) );
314 315
315 mSecrecyWidget = new SecrecyWidget( categoryBox ); 316 mSecrecyWidget = new SecrecyWidget( categoryBox );
316 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 317 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
317 318
318//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 319//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
319 layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); 320 layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 );
320 321
321 // Build the layout and add to the tab widget 322 // Build the layout and add to the tab widget
322 layout->activate(); // required 323 layout->activate(); // required
323 324
324 mTabWidget->addTab( tab1, i18n( "&General" ) ); 325 mTabWidget->addTab( tab1, i18n( "&General" ) );
325} 326}
326 327
327 328
328void AddresseeEditorWidget::setupTab1_1() 329void AddresseeEditorWidget::setupTab1_1()
329{ 330{
330 // This is the Address tab 331 // This is the Address tab
331 QWidget *tab1_1 = new QWidget( mTabWidget ); 332 QWidget *tab1_1 = new QWidget( mTabWidget );
332 333
333//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); 334//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
334 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); 335 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 );
335 layout->setMargin( KDialogBase::marginHintSmall() ); 336 layout->setMargin( KDialogBase::marginHintSmall() );
336 layout->setSpacing( KDialogBase::spacingHintSmall() ); 337 layout->setSpacing( KDialogBase::spacingHintSmall() );
337 338
338 QLabel *label; 339 QLabel *label;
339 KSeparator* bar; 340 KSeparator* bar;
340 QPushButton *button; 341 QPushButton *button;
341 342
342/*US 343/*US
343 ////////////////////////////////// 344 //////////////////////////////////
344 // Upper left group (person info) 345 // Upper left group (person info)
345 346
346 // Person icon 347 // Person icon
347 label = new QLabel( tab1 ); 348 label = new QLabel( tab1 );
348//US ambiguous call. Add one more parameter 349//US ambiguous call. Add one more parameter
349//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 350//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
350 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 351 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
351 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 352 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
352 353
353 // First name 354 // First name
354 button = new QPushButton( i18n( "Name..." ), tab1 ); 355 button = new QPushButton( i18n( "Name..." ), tab1 );
355 QToolTip::add( button, i18n( "Edit the contact's name" ) ); 356 QToolTip::add( button, i18n( "Edit the contact's name" ) );
356 mNameEdit = new KLineEdit( tab1, "mNameEdit" ); 357 mNameEdit = new KLineEdit( tab1, "mNameEdit" );
357 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 358 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
358 SLOT( nameTextChanged( const QString& ) ) ); 359 SLOT( nameTextChanged( const QString& ) ) );
359 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); 360 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) );
360 361
361#ifndef KAB_EMBEDDED 362#ifndef KAB_EMBEDDED
362 mNameLabel = new KSqueezedTextLabel( tab1 ); 363 mNameLabel = new KSqueezedTextLabel( tab1 );
363 mNameLabel->hide(); 364 mNameLabel->hide();
364#else //KAB_EMBEDDED 365#else //KAB_EMBEDDED
365qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 366qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
366#endif //KAB_EMBEDDED 367#endif //KAB_EMBEDDED
367 368
368 layout->addWidget( button, 0, 1 ); 369 layout->addWidget( button, 0, 1 );
369 layout->addWidget( mNameEdit, 0, 2 ); 370 layout->addWidget( mNameEdit, 0, 2 );
370 371
371#ifndef KAB_EMBEDDED 372#ifndef KAB_EMBEDDED
372 layout->addWidget( mNameLabel, 0, 2 ); 373 layout->addWidget( mNameLabel, 0, 2 );
373#else //KAB_EMBEDDED 374#else //KAB_EMBEDDED
374qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 375qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
375#endif //KAB_EMBEDDED 376#endif //KAB_EMBEDDED
376 377
377 label = new QLabel( i18n( "Role:" ), tab1 ); 378 label = new QLabel( i18n( "Role:" ), tab1 );
378 mRoleEdit = new KLineEdit( tab1 ); 379 mRoleEdit = new KLineEdit( tab1 );
379 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), 380 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ),
380 SLOT( textChanged( const QString& ) ) ); 381 SLOT( textChanged( const QString& ) ) );
381 label->setBuddy( mRoleEdit ); 382 label->setBuddy( mRoleEdit );
382 layout->addWidget( label, 1, 1 ); 383 layout->addWidget( label, 1, 1 );
383 layout->addWidget( mRoleEdit, 1, 2 ); 384 layout->addWidget( mRoleEdit, 1, 2 );
384 385
385 // Organization 386 // Organization
386 label = new QLabel( i18n( "Organization:" ), tab1 ); 387 label = new QLabel( i18n( "Organization:" ), tab1 );
387 mOrgEdit = new KLineEdit( tab1 ); 388 mOrgEdit = new KLineEdit( tab1 );
388 label->setBuddy( mOrgEdit ); 389 label->setBuddy( mOrgEdit );
389 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), 390 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ),
390 SLOT( textChanged( const QString& ) ) ); 391 SLOT( textChanged( const QString& ) ) );
391 layout->addWidget( label, 2, 1 ); 392 layout->addWidget( label, 2, 1 );
392 layout->addWidget( mOrgEdit, 2, 2 ); 393 layout->addWidget( mOrgEdit, 2, 2 );
393 394
394 // File as (formatted name) 395 // File as (formatted name)
395 label = new QLabel( i18n( "Formatted name:" ), tab1 ); 396 label = new QLabel( i18n( "Formatted name:" ), tab1 );
396#ifndef KAB_EMBEDDED 397#ifndef KAB_EMBEDDED
397 mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); 398 mFormattedNameLabel = new KSqueezedTextLabel( tab1 );
398#else //KAB_EMBEDDED 399#else //KAB_EMBEDDED
399qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 400qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
400#endif //KAB_EMBEDDED 401#endif //KAB_EMBEDDED
401 layout->addWidget( label, 3, 1 ); 402 layout->addWidget( label, 3, 1 );
402#ifndef KAB_EMBEDDED 403#ifndef KAB_EMBEDDED
403 layout->addWidget( mFormattedNameLabel, 3, 2 ); 404 layout->addWidget( mFormattedNameLabel, 3, 2 );
404#else //KAB_EMBEDDED 405#else //KAB_EMBEDDED
405qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 406qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
406#endif //KAB_EMBEDDED 407#endif //KAB_EMBEDDED
407 408
408 // Left hand separator. This separator doesn't go all the way 409 // Left hand separator. This separator doesn't go all the way
409 // across so the dialog still flows from top to bottom 410 // across so the dialog still flows from top to bottom
410 bar = new KSeparator( KSeparator::HLine, tab1 ); 411 bar = new KSeparator( KSeparator::HLine, tab1 );
411 layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); 412 layout->addMultiCellWidget( bar, 4, 4, 0, 2 );
412 413
413 ////////////////////////////////////// 414 //////////////////////////////////////
414 // Phone numbers (upper right) 415 // Phone numbers (upper right)
415 label = new QLabel( tab1 ); 416 label = new QLabel( tab1 );
416//US loadIcon call is ambiguous. Add one more parameter 417//US loadIcon call is ambiguous. Add one more parameter
417//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); 418//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
418 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 419 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
419 layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 420 layout->addMultiCellWidget( label, 0, 1, 3, 3 );
420 421
421 mPhoneEditWidget = new PhoneEditWidget( tab1 ); 422 mPhoneEditWidget = new PhoneEditWidget( tab1 );
422 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 423 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
423 layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); 424 layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 );
424 425
425 bar = new KSeparator( KSeparator::HLine, tab1 ); 426 bar = new KSeparator( KSeparator::HLine, tab1 );
426 layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); 427 layout->addMultiCellWidget( bar, 4, 4, 3, 6 );
427*/ 428*/
428 ////////////////////////////////////// 429 //////////////////////////////////////
429 // Addresses (lower left) 430 // Addresses (lower left)
430 /* LR 431 /* LR
431 label = new QLabel( tab1_1 ); 432 label = new QLabel( tab1_1 );
432//US loadIcon call is ambiguous. Add one more parameter 433//US loadIcon call is ambiguous. Add one more parameter
433//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); 434//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) );
434 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 435 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );
435//US layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 436//US layout->addMultiCellWidget( label, 5, 6, 0, 0 );
436 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 437 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
437 */ 438 */
438 439
439 mAddressEditWidget = new AddressEditWidget( tab1_1 ); 440 mAddressEditWidget = new AddressEditWidget( tab1_1 );
440 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 441 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
441//US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); 442//US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 );
442 layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 ); 443 layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 );
443 444
444//US 445//US
445/* LR 446/* LR
446 bar = new KSeparator( KSeparator::HLine, tab1_1 ); 447 bar = new KSeparator( KSeparator::HLine, tab1_1 );
447 layout->addMultiCellWidget( bar, 5, 5, 0, 3 ); 448 layout->addMultiCellWidget( bar, 5, 5, 0, 3 );
448*/ 449*/
449 450
450 ////////////////////////////////////// 451 //////////////////////////////////////
451 // Email / Web (lower right) 452 // Email / Web (lower right)
452 /* LR 453 /* LR
453 label = new QLabel( tab1_1 ); 454 label = new QLabel( tab1_1 );
454//US loadIcon call is ambiguous. Add one more parameter 455//US loadIcon call is ambiguous. Add one more parameter
455//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); 456//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) );
456 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); 457 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) );
457//US layout->addMultiCellWidget( label, 5, 6, 3, 3 ); 458//US layout->addMultiCellWidget( label, 5, 6, 3, 3 );
458 layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 459 layout->addMultiCellWidget( label, 6, 7, 0, 0 );
459 */ 460 */
460 mEmailWidget = new EmailEditWidget( tab1_1 ); 461 mEmailWidget = new EmailEditWidget( tab1_1 );
461 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 462 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
462//US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); 463//US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 );
463 layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 ); 464 layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 );
464 465
465 /* LR 466 /* LR
466 // add the separator 467 // add the separator
467 bar = new KSeparator( KSeparator::HLine, tab1_1 ); 468 bar = new KSeparator( KSeparator::HLine, tab1_1 );
468//US layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); 469//US layout->addMultiCellWidget( bar, 7, 7, 3, 6 );
469 layout->addMultiCellWidget( bar, 8, 8, 0, 3 ); 470 layout->addMultiCellWidget( bar, 8, 8, 0, 3 );
470 471
471 label = new QLabel( tab1_1 ); 472 label = new QLabel( tab1_1 );
472//US loadIcon call is ambiguous. Add one more parameter 473//US loadIcon call is ambiguous. Add one more parameter
473//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); 474//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) );
474 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); 475 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) );
475//US layout->addMultiCellWidget( label, 8, 9, 3, 3 ); 476//US layout->addMultiCellWidget( label, 8, 9, 3, 3 );
476 layout->addMultiCellWidget( label, 9, 10, 0, 0 ); 477 layout->addMultiCellWidget( label, 9, 10, 0, 0 );
477 */ 478 */
478 label = new QLabel( i18n( "URL:" ), tab1_1 ); 479 label = new QLabel( i18n( "URL:" ), tab1_1 );
479 mURLEdit = new KLineEdit( tab1_1 ); 480 mURLEdit = new KLineEdit( tab1_1 );
480 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), 481 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ),
481 SLOT( textChanged( const QString& ) ) ); 482 SLOT( textChanged( const QString& ) ) );
482 label->setBuddy( mURLEdit ); 483 label->setBuddy( mURLEdit );
483//US layout->addWidget( label, 8, 4 ); 484//US layout->addWidget( label, 8, 4 );
484 layout->addWidget( label, 7,0 ); 485 layout->addWidget( label, 7,0 );
485//US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); 486//US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
486 layout->addWidget( mURLEdit, 7, 1); 487 layout->addWidget( mURLEdit, 7, 1);
487 488
488 label = new QLabel( i18n( "&IM address:" ), tab1_1 ); 489 label = new QLabel( i18n( "&IM address:" ), tab1_1 );
489 mIMAddressEdit = new KLineEdit( tab1_1 ); 490 mIMAddressEdit = new KLineEdit( tab1_1 );
490 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 491 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
491 SLOT( textChanged( const QString& ) ) ); 492 SLOT( textChanged( const QString& ) ) );
492 label->setBuddy( mIMAddressEdit ); 493 label->setBuddy( mIMAddressEdit );
493//US layout->addWidget( label, 9, 4 ); 494//US layout->addWidget( label, 9, 4 );
494 layout->addWidget( label, 8, 0 ); 495 layout->addWidget( label, 8, 0 );
495//US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 496//US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
496 layout->addWidget( mIMAddressEdit, 8,1 ); 497 layout->addWidget( mIMAddressEdit, 8,1 );
497 498
498//US layout->addColSpacing( 6, 50 ); 499//US layout->addColSpacing( 6, 50 );
499 500
500//US bar = new KSeparator( KSeparator::HLine, tab1_1 ); 501//US bar = new KSeparator( KSeparator::HLine, tab1_1 );
501//US layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 502//US layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
502 503
503/*US 504/*US
504 /////////////////////////////////////// 505 ///////////////////////////////////////
505 QHBox *categoryBox = new QHBox( tab1 ); 506 QHBox *categoryBox = new QHBox( tab1 );
506 categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); 507 categoryBox->setSpacing( KDialogBase::spacingHintSmall() );
507 508
508 // Categories 509 // Categories
509 button = new QPushButton( i18n( "Categories" ), categoryBox ); 510 button = new QPushButton( i18n( "Categories" ), categoryBox );
510 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 511 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
511 512
512 mCategoryEdit = new KLineEdit( categoryBox ); 513 mCategoryEdit = new KLineEdit( categoryBox );
513 mCategoryEdit->setReadOnly( true ); 514 mCategoryEdit->setReadOnly( true );
514 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 515 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
515 SLOT( textChanged( const QString& ) ) ); 516 SLOT( textChanged( const QString& ) ) );
516 517
517 mSecrecyWidget = new SecrecyWidget( categoryBox ); 518 mSecrecyWidget = new SecrecyWidget( categoryBox );
518 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 519 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
519 520
520 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 521 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
521*/ 522*/
522 // Build the layout and add to the tab widget 523 // Build the layout and add to the tab widget
523 layout->activate(); // required 524 layout->activate(); // required
524 525
525 mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); 526 mTabWidget->addTab( tab1_1, i18n( "&Address" ) );
526} 527}
527 528
528 529
529 530
530void AddresseeEditorWidget::setupTab2() 531void AddresseeEditorWidget::setupTab2()
531{ 532{
532 // This is the Details tab 533 // This is the Details tab
533 QWidget *tab2 = new QWidget( mTabWidget ); 534 QWidget *tab2 = new QWidget( mTabWidget );
534 535
535 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 536 QGridLayout *layout = new QGridLayout( tab2, 8, 3 );
536 layout->setMargin( KDialogBase::marginHintSmall() ); 537 layout->setMargin( KDialogBase::marginHintSmall() );
537 layout->setSpacing( KDialogBase::spacingHintSmall() ); 538 layout->setSpacing( KDialogBase::spacingHintSmall() );
538 539
539 QLabel *label; 540 QLabel *label;
540 KSeparator* bar; 541 KSeparator* bar;
541 542
542 /////////////////////// 543 ///////////////////////
543 // Office info 544 // Office info
544 545
545 // Department 546 // Department
546 label = new QLabel( tab2 ); 547 label = new QLabel( tab2 );
547//US loadIcon call is ambiguous. Add one more parameter 548//US loadIcon call is ambiguous. Add one more parameter
548//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 549//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
549 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 550 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
550 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 551 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
551 552
552 label = new QLabel( i18n( "Department:" ), tab2 ); 553 label = new QLabel( i18n( "Department:" ), tab2 );
553 layout->addWidget( label, 0, 1 ); 554 layout->addWidget( label, 0, 1 );
554 mDepartmentEdit = new KLineEdit( tab2 ); 555 mDepartmentEdit = new KLineEdit( tab2 );
555 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 556 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
556 SLOT( textChanged( const QString& ) ) ); 557 SLOT( textChanged( const QString& ) ) );
557 label->setBuddy( mDepartmentEdit ); 558 label->setBuddy( mDepartmentEdit );
558 layout->addWidget( mDepartmentEdit, 0, 2 ); 559 layout->addWidget( mDepartmentEdit, 0, 2 );
559 560
560 label = new QLabel( i18n( "Office:" ), tab2 ); 561 label = new QLabel( i18n( "Office:" ), tab2 );
561 layout->addWidget( label, 1, 1 ); 562 layout->addWidget( label, 1, 1 );
562 mOfficeEdit = new KLineEdit( tab2 ); 563 mOfficeEdit = new KLineEdit( tab2 );
563 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 564 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
564 SLOT( textChanged( const QString& ) ) ); 565 SLOT( textChanged( const QString& ) ) );
565 label->setBuddy( mOfficeEdit ); 566 label->setBuddy( mOfficeEdit );
566 layout->addWidget( mOfficeEdit, 1, 2 ); 567 layout->addWidget( mOfficeEdit, 1, 2 );
567 568
568 label = new QLabel( i18n( "Profession:" ), tab2 ); 569 label = new QLabel( i18n( "Profession:" ), tab2 );
569 layout->addWidget( label, 2, 1 ); 570 layout->addWidget( label, 2, 1 );
570 mProfessionEdit = new KLineEdit( tab2 ); 571 mProfessionEdit = new KLineEdit( tab2 );
571 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 572 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),
572 SLOT( textChanged( const QString& ) ) ); 573 SLOT( textChanged( const QString& ) ) );
573 label->setBuddy( mProfessionEdit ); 574 label->setBuddy( mProfessionEdit );
574 layout->addWidget( mProfessionEdit, 2, 2 ); 575 layout->addWidget( mProfessionEdit, 2, 2 );
575 576
576 label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); 577 label = new QLabel( i18n( "Manager\'s name:" ), tab2 );
577//US layout->addWidget( label, 0, 3 ); 578//US layout->addWidget( label, 0, 3 );
578 layout->addWidget( label, 3, 1 ); 579 layout->addWidget( label, 3, 1 );
579 mManagerEdit = new KLineEdit( tab2 ); 580 mManagerEdit = new KLineEdit( tab2 );
580 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), 581 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ),
581 SLOT( textChanged( const QString& ) ) ); 582 SLOT( textChanged( const QString& ) ) );
582 label->setBuddy( mManagerEdit ); 583 label->setBuddy( mManagerEdit );
583//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 584//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
584 layout->addWidget( mManagerEdit, 3, 2 ); 585 layout->addWidget( mManagerEdit, 3, 2 );
585 586
586 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 587 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
587//US layout->addWidget( label, 1, 3 ); 588//US layout->addWidget( label, 1, 3 );
588 layout->addWidget( label, 4, 1 ); 589 layout->addWidget( label, 4, 1 );
589 mAssistantEdit = new KLineEdit( tab2 ); 590 mAssistantEdit = new KLineEdit( tab2 );
590 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 591 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
591 SLOT( textChanged( const QString& ) ) ); 592 SLOT( textChanged( const QString& ) ) );
592 label->setBuddy( mAssistantEdit ); 593 label->setBuddy( mAssistantEdit );
593//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 594//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
594 layout->addWidget( mAssistantEdit, 4, 2 ); 595 layout->addWidget( mAssistantEdit, 4, 2 );
595 596
596 bar = new KSeparator( KSeparator::HLine, tab2 ); 597 bar = new KSeparator( KSeparator::HLine, tab2 );
597//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 598//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
598 layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); 599 layout->addMultiCellWidget( bar, 5, 5, 0, 2 );
599 600
600 ///////////////////////////////////////////////// 601 /////////////////////////////////////////////////
601 // Personal info 602 // Personal info
602 603
603 //label = new QLabel( tab2 ); 604 //label = new QLabel( tab2 );
604//US loadIcon call is ambiguous. Add one more parameter 605//US loadIcon call is ambiguous. Add one more parameter
605//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 606//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
606 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 607 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
607//US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 608//US layout->addMultiCellWidget( label, 4, 5, 0, 0 );
608 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 609 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
609 610
610 611
611 int iii = 6; 612 int iii = 6;
612 613
613 if ( QApplication::desktop()->width() == 640 ) { 614 if ( QApplication::desktop()->width() == 640 ) {
614 QHBox * nbox = new QHBox ( tab2 ); 615 QHBox * nbox = new QHBox ( tab2 );
615 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 616 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
616 layout->addWidget( label, iii, 1 ); 617 layout->addWidget( label, iii, 1 );
617 mNicknameEdit = new KLineEdit( nbox ); 618 mNicknameEdit = new KLineEdit( nbox );
618 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 619 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
619 SLOT( textChanged( const QString& ) ) ); 620 SLOT( textChanged( const QString& ) ) );
620 label->setBuddy( mNicknameEdit ); 621 label->setBuddy( mNicknameEdit );
621 622
622 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); 623 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox );
623 layout->addWidget( label, iii, 1 ); 624 layout->addWidget( label, iii, 1 );
624 mSpouseEdit = new KLineEdit( nbox ); 625 mSpouseEdit = new KLineEdit( nbox );
625 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 626 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
626 SLOT( textChanged( const QString& ) ) ); 627 SLOT( textChanged( const QString& ) ) );
627 label->setBuddy( mSpouseEdit ); 628 label->setBuddy( mSpouseEdit );
628 layout->addWidget( mSpouseEdit, iii, 2 ); 629 layout->addWidget( mSpouseEdit, iii, 2 );
629 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 630 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
630 ++iii; 631 ++iii;
631 632
632 } else { 633 } else {
633 label = new QLabel( i18n( "Nick name:" ), tab2 ); 634 label = new QLabel( i18n( "Nick name:" ), tab2 );
634 layout->addWidget( label, iii, 1 ); 635 layout->addWidget( label, iii, 1 );
635 mNicknameEdit = new KLineEdit( tab2 ); 636 mNicknameEdit = new KLineEdit( tab2 );
636 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 637 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
637 SLOT( textChanged( const QString& ) ) ); 638 SLOT( textChanged( const QString& ) ) );
638 label->setBuddy( mNicknameEdit ); 639 label->setBuddy( mNicknameEdit );
639 layout->addWidget( mNicknameEdit, iii, 2 ); 640 layout->addWidget( mNicknameEdit, iii, 2 );
640 ++iii; 641 ++iii;
641 642
642 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 643 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
643 layout->addWidget( label, iii, 1 ); 644 layout->addWidget( label, iii, 1 );
644 mSpouseEdit = new KLineEdit( tab2 ); 645 mSpouseEdit = new KLineEdit( tab2 );
645 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 646 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
646 SLOT( textChanged( const QString& ) ) ); 647 SLOT( textChanged( const QString& ) ) );
647 label->setBuddy( mSpouseEdit ); 648 label->setBuddy( mSpouseEdit );
648 layout->addWidget( mSpouseEdit, iii, 2 ); 649 layout->addWidget( mSpouseEdit, iii, 2 );
649 ++iii; 650 ++iii;
650 } 651 }
651 652
652 label = new QLabel( i18n( "Children's names:" ), tab2 ); 653 label = new QLabel( i18n( "Children's names:" ), tab2 );
653 layout->addWidget( label, iii, 1 ); 654 layout->addWidget( label, iii, 1 );
654 mChildEdit = new KLineEdit( tab2 ); 655 mChildEdit = new KLineEdit( tab2 );
655 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 656 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
656 SLOT( textChanged( const QString& ) ) ); 657 SLOT( textChanged( const QString& ) ) );
657 label->setBuddy( mChildEdit ); 658 label->setBuddy( mChildEdit );
658 layout->addWidget( mChildEdit, iii, 2 ); 659 layout->addWidget( mChildEdit, iii, 2 );
659 ++iii; 660 ++iii;
660 if ( QApplication::desktop()->width() == 640 ) { 661 if ( QApplication::desktop()->width() == 640 ) {
661 QHBox * nbox = new QHBox ( tab2 ); 662 QHBox * nbox = new QHBox ( tab2 );
662 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 663 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
663 layout->addWidget( label, iii, 1 ); 664 layout->addWidget( label, iii, 1 );
664 mBirthdayPicker = new KDateEdit( nbox ); 665 mBirthdayPicker = new KDateEdit( nbox );
665 mBirthdayPicker->toggleDateFormat(); 666 mBirthdayPicker->toggleDateFormat();
666 mBirthdayPicker->setHandleInvalid( true ); 667 mBirthdayPicker->setHandleInvalid( true );
667 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 668 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
668 SLOT( dateChanged( QDate ) ) ); 669 SLOT( dateChanged( QDate ) ) );
669 670
670 label->setBuddy( mBirthdayPicker ); 671 label->setBuddy( mBirthdayPicker );
671 672
672 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); 673 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
673 layout->addWidget( label, iii, 1 ); 674 layout->addWidget( label, iii, 1 );
674 mAnniversaryPicker = new KDateEdit( nbox ); 675 mAnniversaryPicker = new KDateEdit( nbox );
675 mAnniversaryPicker->setHandleInvalid( true ); 676 mAnniversaryPicker->setHandleInvalid( true );
676 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 677 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
677 SLOT( dateChanged( QDate ) ) ); 678 SLOT( dateChanged( QDate ) ) );
678 679
679 label->setBuddy( mAnniversaryPicker ); 680 label->setBuddy( mAnniversaryPicker );
680 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 681 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
681 ++iii; 682 ++iii;
682 683
683 } else { 684 } else {
684 685
685 label = new QLabel( i18n( "Birthday:" ), tab2 ); 686 label = new QLabel( i18n( "Birthday:" ), tab2 );
686 layout->addWidget( label, iii, 1 ); 687 layout->addWidget( label, iii, 1 );
687 mBirthdayPicker = new KDateEdit( tab2 ); 688 mBirthdayPicker = new KDateEdit( tab2 );
688 mBirthdayPicker->toggleDateFormat(); 689 mBirthdayPicker->toggleDateFormat();
689 mBirthdayPicker->setHandleInvalid( true ); 690 mBirthdayPicker->setHandleInvalid( true );
690 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 691 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
691 SLOT( dateChanged( QDate ) ) ); 692 SLOT( dateChanged( QDate ) ) );
692 693
693 label->setBuddy( mBirthdayPicker ); 694 label->setBuddy( mBirthdayPicker );
694 layout->addWidget( mBirthdayPicker, iii, 2 ); 695 layout->addWidget( mBirthdayPicker, iii, 2 );
695 ++iii; 696 ++iii;
696 697
697 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 698 label = new QLabel( i18n( "Anniversary:" ), tab2 );
698 layout->addWidget( label, iii, 1 ); 699 layout->addWidget( label, iii, 1 );
699 mAnniversaryPicker = new KDateEdit( tab2 ); 700 mAnniversaryPicker = new KDateEdit( tab2 );
700 mAnniversaryPicker->setHandleInvalid( true ); 701 mAnniversaryPicker->setHandleInvalid( true );
701 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 702 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
702 SLOT( dateChanged( QDate ) ) ); 703 SLOT( dateChanged( QDate ) ) );
703 704
704 label->setBuddy( mAnniversaryPicker ); 705 label->setBuddy( mAnniversaryPicker );
705 layout->addWidget( mAnniversaryPicker, iii, 2 ); 706 layout->addWidget( mAnniversaryPicker, iii, 2 );
706 ++iii; 707 ++iii;
707 708
708 } 709 }
709 710
710 label = new QLabel( i18n( "Gender:" ), tab2 ); 711 label = new QLabel( i18n( "Gender:" ), tab2 );
711 layout->addWidget( label, iii, 1 ); 712 layout->addWidget( label, iii, 1 );
712 mGenderBox = new QComboBox ( tab2 ); 713 mGenderBox = new QComboBox ( tab2 );
713 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" )); 714 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" ));
714 mGenderBox->insertItem ( i18n( "female" )); 715 mGenderBox->insertItem ( i18n( "female" ));
715 mGenderBox->insertItem ( i18n( "male" )); 716 mGenderBox->insertItem ( i18n( "male" ));
716 connect( mGenderBox, SIGNAL( activated ( const QString & ) ), 717 connect( mGenderBox, SIGNAL( activated ( const QString & ) ),
717 SLOT( textChanged( const QString& ) ) ); 718 SLOT( textChanged( const QString& ) ) );
718 label->setBuddy( mGenderBox ); 719 label->setBuddy( mGenderBox );
719 layout->addWidget( mGenderBox, iii, 2 ); 720 layout->addWidget( mGenderBox, iii, 2 );
720 ++iii; 721 ++iii;
721 // Build the layout and add to the tab widget 722 // Build the layout and add to the tab widget
722 layout->activate(); // required 723 layout->activate(); // required
723 724
724 mTabWidget->addTab( tab2, i18n( "&Details" ) ); 725 mTabWidget->addTab( tab2, i18n( "&Details" ) );
725} 726}
726 727
727void AddresseeEditorWidget::setupTab2_1() 728void AddresseeEditorWidget::setupTab2_1()
728{ 729{
729 // This is the Details tab 730 // This is the Details tab
730 QWidget *tab2_2 = new QWidget( mTabWidget ); 731 QWidget *tab2_2 = new QWidget( mTabWidget );
731 732
732 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 733 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 );
733 layout->setMargin( KDialogBase::marginHintSmall() ); 734 layout->setMargin( KDialogBase::marginHintSmall() );
734 layout->setSpacing( KDialogBase::spacingHintSmall() ); 735 layout->setSpacing( KDialogBase::spacingHintSmall() );
735 736
736 QLabel *label; 737 QLabel *label;
737 KSeparator* bar; 738 KSeparator* bar;
738 739
739/*US 740/*US
740 /////////////////////// 741 ///////////////////////
741 // Office info 742 // Office info
742 743
743 // Department 744 // Department
744 label = new QLabel( tab2 ); 745 label = new QLabel( tab2 );
745//US loadIcon call is ambiguous. Add one more parameter 746//US loadIcon call is ambiguous. Add one more parameter
746//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 747//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
747 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 748 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
748 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 749 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
749 750
750 label = new QLabel( i18n( "Department:" ), tab2 ); 751 label = new QLabel( i18n( "Department:" ), tab2 );
751 layout->addWidget( label, 0, 1 ); 752 layout->addWidget( label, 0, 1 );
752 mDepartmentEdit = new KLineEdit( tab2 ); 753 mDepartmentEdit = new KLineEdit( tab2 );
753 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 754 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
754 SLOT( textChanged( const QString& ) ) ); 755 SLOT( textChanged( const QString& ) ) );
755 label->setBuddy( mDepartmentEdit ); 756 label->setBuddy( mDepartmentEdit );
756 layout->addWidget( mDepartmentEdit, 0, 2 ); 757 layout->addWidget( mDepartmentEdit, 0, 2 );
757 758
758 label = new QLabel( i18n( "Office:" ), tab2 ); 759 label = new QLabel( i18n( "Office:" ), tab2 );
759 layout->addWidget( label, 1, 1 ); 760 layout->addWidget( label, 1, 1 );
760 mOfficeEdit = new KLineEdit( tab2 ); 761 mOfficeEdit = new KLineEdit( tab2 );
761 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 762 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
762 SLOT( textChanged( const QString& ) ) ); 763 SLOT( textChanged( const QString& ) ) );
763 label->setBuddy( mOfficeEdit ); 764 label->setBuddy( mOfficeEdit );
764 layout->addWidget( mOfficeEdit, 1, 2 ); 765 layout->addWidget( mOfficeEdit, 1, 2 );
765 766
766 label = new QLabel( i18n( "Profession:" ), tab2 ); 767 label = new QLabel( i18n( "Profession:" ), tab2 );
767 layout->addWidget( label, 2, 1 ); 768 layout->addWidget( label, 2, 1 );
768 mProfessionEdit = new KLineEdit( tab2 ); 769 mProfessionEdit = new KLineEdit( tab2 );
769 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 770 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),
770 SLOT( textChanged( const QString& ) ) ); 771 SLOT( textChanged( const QString& ) ) );
771 label->setBuddy( mProfessionEdit ); 772 label->setBuddy( mProfessionEdit );
772 layout->addWidget( mProfessionEdit, 2, 2 ); 773 layout->addWidget( mProfessionEdit, 2, 2 );
773 774
774 label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); 775 label = new QLabel( i18n( "Manager\'s name:" ), tab2 );
775 layout->addWidget( label, 0, 3 ); 776 layout->addWidget( label, 0, 3 );
776 mManagerEdit = new KLineEdit( tab2 ); 777 mManagerEdit = new KLineEdit( tab2 );
777 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), 778 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ),
778 SLOT( textChanged( const QString& ) ) ); 779 SLOT( textChanged( const QString& ) ) );
779 label->setBuddy( mManagerEdit ); 780 label->setBuddy( mManagerEdit );
780 layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 781 layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
781 782
782 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 783 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
783 layout->addWidget( label, 1, 3 ); 784 layout->addWidget( label, 1, 3 );
784 mAssistantEdit = new KLineEdit( tab2 ); 785 mAssistantEdit = new KLineEdit( tab2 );
785 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 786 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
786 SLOT( textChanged( const QString& ) ) ); 787 SLOT( textChanged( const QString& ) ) );
787 label->setBuddy( mAssistantEdit ); 788 label->setBuddy( mAssistantEdit );
788 layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 789 layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
789 790
790 bar = new KSeparator( KSeparator::HLine, tab2 ); 791 bar = new KSeparator( KSeparator::HLine, tab2 );
791 layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 792 layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
792 793
793 ///////////////////////////////////////////////// 794 /////////////////////////////////////////////////
794 // Personal info 795 // Personal info
795 796
796 label = new QLabel( tab2 ); 797 label = new QLabel( tab2 );
797//US loadIcon call is ambiguous. Add one more parameter 798//US loadIcon call is ambiguous. Add one more parameter
798//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 799//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
799 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 800 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
800 layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 801 layout->addMultiCellWidget( label, 4, 5, 0, 0 );
801 802
802 label = new QLabel( i18n( "Nick name:" ), tab2 ); 803 label = new QLabel( i18n( "Nick name:" ), tab2 );
803 layout->addWidget( label, 4, 1 ); 804 layout->addWidget( label, 4, 1 );
804 mNicknameEdit = new KLineEdit( tab2 ); 805 mNicknameEdit = new KLineEdit( tab2 );
805 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 806 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
806 SLOT( textChanged( const QString& ) ) ); 807 SLOT( textChanged( const QString& ) ) );
807 label->setBuddy( mNicknameEdit ); 808 label->setBuddy( mNicknameEdit );
808 layout->addWidget( mNicknameEdit, 4, 2 ); 809 layout->addWidget( mNicknameEdit, 4, 2 );
809 810
810 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 811 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
811 layout->addWidget( label, 5, 1 ); 812 layout->addWidget( label, 5, 1 );
812 mSpouseEdit = new KLineEdit( tab2 ); 813 mSpouseEdit = new KLineEdit( tab2 );
813 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 814 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
814 SLOT( textChanged( const QString& ) ) ); 815 SLOT( textChanged( const QString& ) ) );
815 label->setBuddy( mSpouseEdit ); 816 label->setBuddy( mSpouseEdit );
816 layout->addWidget( mSpouseEdit, 5, 2 ); 817 layout->addWidget( mSpouseEdit, 5, 2 );
817 818
818 label = new QLabel( i18n( "Birthday:" ), tab2 ); 819 label = new QLabel( i18n( "Birthday:" ), tab2 );
819 layout->addWidget( label, 4, 3 ); 820 layout->addWidget( label, 4, 3 );
820 mBirthdayPicker = new KDateEdit( tab2 ); 821 mBirthdayPicker = new KDateEdit( tab2 );
821 mBirthdayPicker->setHandleInvalid( true ); 822 mBirthdayPicker->setHandleInvalid( true );
822 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 823 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
823 SLOT( dateChanged( QDate ) ) ); 824 SLOT( dateChanged( QDate ) ) );
824 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), 825 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ),
825 SLOT( invalidDate() ) ); 826 SLOT( invalidDate() ) );
826 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), 827 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ),
827 SLOT( emitModified() ) ); 828 SLOT( emitModified() ) );
828 label->setBuddy( mBirthdayPicker ); 829 label->setBuddy( mBirthdayPicker );
829 layout->addWidget( mBirthdayPicker, 4, 4 ); 830 layout->addWidget( mBirthdayPicker, 4, 4 );
830 831
831 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 832 label = new QLabel( i18n( "Anniversary:" ), tab2 );
832 layout->addWidget( label, 5, 3 ); 833 layout->addWidget( label, 5, 3 );
833 mAnniversaryPicker = new KDateEdit( tab2 ); 834 mAnniversaryPicker = new KDateEdit( tab2 );
834 mAnniversaryPicker->setHandleInvalid( true ); 835 mAnniversaryPicker->setHandleInvalid( true );
835 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 836 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
836 SLOT( dateChanged( QDate ) ) ); 837 SLOT( dateChanged( QDate ) ) );
837 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), 838 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ),
838 SLOT( invalidDate() ) ); 839 SLOT( invalidDate() ) );
839 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), 840 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ),
840 SLOT( emitModified() ) ); 841 SLOT( emitModified() ) );
841 label->setBuddy( mAnniversaryPicker ); 842 label->setBuddy( mAnniversaryPicker );
842 layout->addWidget( mAnniversaryPicker, 5, 4 ); 843 layout->addWidget( mAnniversaryPicker, 5, 4 );
843 844
844 bar = new KSeparator( KSeparator::HLine, tab2 ); 845 bar = new KSeparator( KSeparator::HLine, tab2 );
845 layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); 846 layout->addMultiCellWidget( bar, 6, 6, 0, 5 );
846*/ 847*/
847 ////////////////////////////////////// 848 //////////////////////////////////////
848 // Notes 849 // Notes
849 label = new QLabel( i18n( "Note:" ), tab2_2 ); 850 label = new QLabel( i18n( "Note:" ), tab2_2 );
850 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 851 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
851//US layout->addWidget( label, 7, 0 ); 852//US layout->addWidget( label, 7, 0 );
852 layout->addWidget( label, 0, 0 ); 853 layout->addWidget( label, 0, 0 );
853#ifndef KAB_EMBEDDED 854#ifndef KAB_EMBEDDED
854 mNoteEdit = new QTextEdit( tab2_2 ); 855 mNoteEdit = new QTextEdit( tab2_2 );
855 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); 856 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth );
856 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 857 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
857#else //KAB_EMBEDDED 858#else //KAB_EMBEDDED
858 mNoteEdit = new QMultiLineEdit( tab2_2 ); 859 mNoteEdit = new QMultiLineEdit( tab2_2 );
859 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); 860 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth );
860 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 861 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
861#endif //KAB_EMBEDDED 862#endif //KAB_EMBEDDED
862 863
863 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); 864 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
864 label->setBuddy( mNoteEdit ); 865 label->setBuddy( mNoteEdit );
865//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); 866//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
866 layout->addWidget( mNoteEdit, 1, 0); 867 layout->addWidget( mNoteEdit, 1, 0);
867 868
868 // Build the layout and add to the tab widget 869 // Build the layout and add to the tab widget
869 layout->activate(); // required 870 layout->activate(); // required
870 871
871 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); 872 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) );
872} 873}
873 874
874 875
875 876
876void AddresseeEditorWidget::setupTab3() 877void AddresseeEditorWidget::setupTab3()
877{ 878{
878 // This is the Misc tab 879 // This is the Misc tab
879 QWidget *tab3 = new QWidget( mTabWidget ); 880 QWidget *tab3 = new QWidget( mTabWidget );
880 881
881 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 882 QGridLayout *layout = new QGridLayout( tab3, 1, 1 );
882 layout->setMargin( KDialogBase::marginHintSmall() ); 883 layout->setMargin( KDialogBase::marginHintSmall() );
883 layout->setSpacing( KDialogBase::spacingHintSmall() ); 884 layout->setSpacing( KDialogBase::spacingHintSmall() );
884//US layout->setColStretch( 2, 1 ); 885//US layout->setColStretch( 2, 1 );
885 886
886 ////////////////////////////////////// 887 //////////////////////////////////////
887 // Geo 888 // Geo
888 mGeoWidget = new GeoWidget( tab3 ); 889 mGeoWidget = new GeoWidget( tab3 );
889 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 890 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
890 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 891 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
891 layout->addWidget( mGeoWidget, 0, 0 ); 892 layout->addWidget( mGeoWidget, 0, 0 );
892/*US 893/*US
893 ////////////////////////////////////// 894 //////////////////////////////////////
894 // Sound 895 // Sound
895#ifndef KAB_EMBEDDED 896#ifndef KAB_EMBEDDED
896 mSoundWidget = new SoundWidget( tab3 ); 897 mSoundWidget = new SoundWidget( tab3 );
897 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 898 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
898 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 899 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
899 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 900 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
900#else //KAB_EMBEDDED 901#else //KAB_EMBEDDED
901qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 902qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
902#endif //KAB_EMBEDDED 903#endif //KAB_EMBEDDED
903 904
904 ////////////////////////////////////// 905 //////////////////////////////////////
905 // Images 906 // Images
906 mImageWidget = new ImageWidget( tab3 ); 907 mImageWidget = new ImageWidget( tab3 );
907 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 908 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
908 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 909 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
909 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); 910 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop );
910*/ 911*/
911//US 912//US
912/* 913/*
913 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); 914 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 );
914 layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); 915 layout->addMultiCellWidget( bar, 1, 1, 0, 0 );
915*/ 916*/
916 ////////////////////////////////////// 917 //////////////////////////////////////
917 // Keys 918 // Keys
918 mKeyWidget = new KeyWidget( tab3 ); 919 mKeyWidget = new KeyWidget( tab3 );
919 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); 920 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
920 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 921 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
921//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 922//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
922 layout->addWidget( mKeyWidget, 1, 0 ); 923 layout->addWidget( mKeyWidget, 1, 0 );
923 924
924 mTabWidget->addTab( tab3, i18n( "&Misc" ) ); 925 mTabWidget->addTab( tab3, i18n( "&Misc" ) );
925} 926}
926 927
927void AddresseeEditorWidget::setupTab3_1() 928void AddresseeEditorWidget::setupTab3_1()
928{ 929{
929 // This is the Misc tab 930 // This is the Misc tab
930 QWidget *tab3 = new QWidget( mTabWidget ); 931 QWidget *tab3 = new QWidget( mTabWidget );
931 932
932//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); 933//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
933 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 934 QGridLayout *layout = new QGridLayout( tab3, 1, 1 );
934 layout->setMargin( KDialogBase::marginHint() ); 935 layout->setMargin( KDialogBase::marginHint() );
935 layout->setSpacing( KDialogBase::spacingHint() ); 936 layout->setSpacing( KDialogBase::spacingHint() );
936//US layout->setColStretch( 2, 1 ); 937//US layout->setColStretch( 2, 1 );
937 938
938/*US 939/*US
939 ////////////////////////////////////// 940 //////////////////////////////////////
940 // Geo 941 // Geo
941 mGeoWidget = new GeoWidget( tab3 ); 942 mGeoWidget = new GeoWidget( tab3 );
942 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 943 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
943 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 944 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
944 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); 945 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop );
945*/ 946*/
946 ////////////////////////////////////// 947 //////////////////////////////////////
947 // Sound 948 // Sound
948#ifndef KAB_EMBEDDED 949#ifndef KAB_EMBEDDED
949 mSoundWidget = new SoundWidget( tab3 ); 950 mSoundWidget = new SoundWidget( tab3 );
950 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 951 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
951 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 952 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
952 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 953 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
953#else //KAB_EMBEDDED 954#else //KAB_EMBEDDED
954//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 955//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
955#endif //KAB_EMBEDDED 956#endif //KAB_EMBEDDED
956 957
957 ////////////////////////////////////// 958 //////////////////////////////////////
958 // Images 959 // Images
959 mImageWidget = new ImageWidget( tab3 ); 960 mImageWidget = new ImageWidget( tab3 );
960 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 961 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
961 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 962 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
962 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); 963 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop );
963/*US 964/*US
964 ////////////////////////////////////// 965 //////////////////////////////////////
965 // Keys 966 // Keys
966 mKeyWidget = new KeyWidget( tab3 ); 967 mKeyWidget = new KeyWidget( tab3 );
967 mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); 968 mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
968 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 969 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
969 layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 970 layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
970*/ 971*/
971 mTabWidget->addTab( tab3, i18n( "&Images" ) ); 972 mTabWidget->addTab( tab3, i18n( "&Images" ) );
972} 973}
973 974
974 975
975void AddresseeEditorWidget::load() 976void AddresseeEditorWidget::load()
976{ 977{
977 978
978 // Block signals in case anything tries to emit modified 979 // Block signals in case anything tries to emit modified
979 // CS: This doesn't seem to work. 980 // CS: This doesn't seem to work.
980 bool block = signalsBlocked(); 981 bool block = signalsBlocked();
981 blockSignals( true ); 982 blockSignals( true );
982 mBlockSignals = true; // used for internal signal blocking 983 mBlockSignals = true; // used for internal signal blocking
983 984
984 mNameEdit->setText( mAddressee.assembledName() ); 985 mNameEdit->setText( mAddressee.assembledName() );
985 986
986 if ( mAddressee.formattedName().isEmpty() ) { 987 if ( mAddressee.formattedName().isEmpty() ) {
987//US KConfig config( "kaddressbookrc" ); 988//US KConfig config( "kaddressbookrc" );
988 KConfig config( locateLocal("config", "kaddressbookrc") ); 989 KConfig config( locateLocal("config", "kaddressbookrc") );
989 config.setGroup( "General" ); 990 config.setGroup( "General" );
990 mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); 991 mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 );
991 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 992 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
992 } else { 993 } else {
993 if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) 994 if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) )
994 mFormattedNameType = NameEditDialog::SimpleName; 995 mFormattedNameType = NameEditDialog::SimpleName;
995 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) 996 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) )
996 mFormattedNameType = NameEditDialog::FullName; 997 mFormattedNameType = NameEditDialog::FullName;
997 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) 998 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) )
998 mFormattedNameType = NameEditDialog::ReverseName; 999 mFormattedNameType = NameEditDialog::ReverseName;
999 else 1000 else
1000 mFormattedNameType = NameEditDialog::CustomName; 1001 mFormattedNameType = NameEditDialog::CustomName;
1001 } 1002 }
1002 1003
1003 mFormattedNameLabel->setText( mAddressee.formattedName() ); 1004 mFormattedNameLabel->setText( mAddressee.formattedName() );
1004 1005
1005 mRoleEdit->setText( mAddressee.role() ); 1006 mRoleEdit->setText( mAddressee.role() );
1006 mOrgEdit->setText( mAddressee.organization() ); 1007 mOrgEdit->setText( mAddressee.organization() );
1007 1008
1008//US mURLEdit->setURL( mAddressee.url().url() ); 1009//US mURLEdit->setURL( mAddressee.url().url() );
1009 mURLEdit->setText( mAddressee.url().prettyURL() ); 1010 mURLEdit->setText( mAddressee.url().prettyURL() );
1010//US?? mURLEdit->home( false ); 1011//US?? mURLEdit->home( false );
1011 1012
1012 // mNoteEdit->setText( mAddressee.note() ); 1013 // mNoteEdit->setText( mAddressee.note() );
1013 mNoteEdit->setText( mAddressee.note() ); 1014 mNoteEdit->setText( mAddressee.note() );
1014 mEmailWidget->setEmails( mAddressee.emails() ); 1015 mEmailWidget->setEmails( mAddressee.emails() );
1015 mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); 1016 mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() );
1016 mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); 1017 mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() );
1017 mBirthdayPicker->setDate( mAddressee.birthday().date() ); 1018 mBirthdayPicker->setDate( mAddressee.birthday().date() );
1018 1019
1019//US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( 1020//US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom(
1020//US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) ); 1021//US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) );
1021 QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), 1022 QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
1022 "%Y-%m-%d"); // = Qt::ISODate 1023 "%Y-%m-%d"); // = Qt::ISODate
1023 mAnniversaryPicker->setDate( dt ); 1024 mAnniversaryPicker->setDate( dt );
1024 1025
1025 1026
1026 mNicknameEdit->setText( mAddressee.nickName() ); 1027 mNicknameEdit->setText( mAddressee.nickName() );
1027 mCategoryEdit->setText( mAddressee.categories().join( "," ) ); 1028 mCategoryEdit->setText( mAddressee.categories().join( "," ) );
1028 1029
1029 mGeoWidget->setGeo( mAddressee.geo() ); 1030 mGeoWidget->setGeo( mAddressee.geo() );
1030 mImageWidget->setPhoto( mAddressee.photo() ); 1031 mImageWidget->setPhoto( mAddressee.photo() );
1031 mImageWidget->setLogo( mAddressee.logo() ); 1032 mImageWidget->setLogo( mAddressee.logo() );
1032 mKeyWidget->setKeys( mAddressee.keys() ); 1033 mKeyWidget->setKeys( mAddressee.keys() );
1033 mSecrecyWidget->setSecrecy( mAddressee.secrecy() ); 1034 mSecrecyWidget->setSecrecy( mAddressee.secrecy() );
1034#ifndef KAB_EMBEDDED 1035#ifndef KAB_EMBEDDED
1035 mSoundWidget->setSound( mAddressee.sound() ); 1036 mSoundWidget->setSound( mAddressee.sound() );
1036#else //KAB_EMBEDDED 1037#else //KAB_EMBEDDED
1037//US qDebug("AddresseeEditorWidget::load has to be changed 2"); 1038//US qDebug("AddresseeEditorWidget::load has to be changed 2");
1038#endif //KAB_EMBEDDED 1039#endif //KAB_EMBEDDED
1039 1040
1040 // Load customs 1041 // Load customs
1041 mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) ); 1042 mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) );
1042 mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) ); 1043 mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) );
1043 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) ); 1044 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) );
1044 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); 1045 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) );
1045 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); 1046 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) );
1046 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); 1047 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) );
1047 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); 1048 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) );
1048 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); 1049 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) );
1049 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); 1050 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" );
1050 if ( gen == "female" ) 1051 if ( gen == "female" )
1051 mGenderBox->setCurrentItem ( 1 ); 1052 mGenderBox->setCurrentItem ( 1 );
1052 else if ( gen == "male" ) 1053 else if ( gen == "male" )
1053 mGenderBox->setCurrentItem ( 2 ); 1054 mGenderBox->setCurrentItem ( 2 );
1054 else 1055 else
1055 mGenderBox->setCurrentItem ( 0 ); 1056 mGenderBox->setCurrentItem ( 0 );
1056 blockSignals( block ); 1057 blockSignals( block );
1057 mBlockSignals = false; 1058 mBlockSignals = false;
1058 1059
1059 mDirty = false; 1060 mDirty = false;
1060} 1061}
1061 1062
1062void AddresseeEditorWidget::save() 1063void AddresseeEditorWidget::save()
1063{ 1064{
1064 if ( !dirty() ) { 1065 if ( !dirty() ) {
1065 return; 1066 return;
1066 } 1067 }
1067 1068
1068 mAddressee.setRole( mRoleEdit->text() ); 1069 mAddressee.setRole( mRoleEdit->text() );
1069 mAddressee.setOrganization( mOrgEdit->text() ); 1070 mAddressee.setOrganization( mOrgEdit->text() );
1070 mAddressee.setUrl( KURL( mURLEdit->text() ) ); 1071 mAddressee.setUrl( KURL( mURLEdit->text() ) );
1071 mAddressee.setNote( mNoteEdit->text() ); 1072 mAddressee.setNote( mNoteEdit->text() );
1072 if ( mBirthdayPicker->inputIsValid() ) { 1073 if ( mBirthdayPicker->inputIsValid() ) {
1073 QDate da = mBirthdayPicker->date(); 1074 QDate da = mBirthdayPicker->date();
1074 if ( da > QDate::currentDate() ) 1075 if ( da > QDate::currentDate() )
1075 da.setYMD(da.year()-100, da.month(), da.day() ); 1076 da.setYMD(da.year()-100, da.month(), da.day() );
1076 mAddressee.setBirthday( QDateTime( da ) ); 1077 mAddressee.setBirthday( QDateTime( da ) );
1077 qDebug("bday %s ",da.toString().latin1()); 1078 qDebug("bday %s ",da.toString().latin1());
1078 } 1079 }
1079 else { 1080 else {
1080 mAddressee.setBirthday( QDateTime() ); 1081 mAddressee.setBirthday( QDateTime() );
1081 mBirthdayPicker->clear(); 1082 mBirthdayPicker->clear();
1082 } 1083 }
1083 mAddressee.setNickName( mNicknameEdit->text() ); 1084 mAddressee.setNickName( mNicknameEdit->text() );
1084 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); 1085 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) );
1085 1086
1086 mAddressee.setGeo( mGeoWidget->geo() ); 1087 mAddressee.setGeo( mGeoWidget->geo() );
1087 mAddressee.setPhoto( mImageWidget->photo() ); 1088 mAddressee.setPhoto( mImageWidget->photo() );
1088 mAddressee.setLogo( mImageWidget->logo() ); 1089 mAddressee.setLogo( mImageWidget->logo() );
1089 mAddressee.setKeys( mKeyWidget->keys() ); 1090 mAddressee.setKeys( mKeyWidget->keys() );
1090#ifndef KAB_EMBEDDED 1091#ifndef KAB_EMBEDDED
1091 mAddressee.setSound( mSoundWidget->sound() ); 1092 mAddressee.setSound( mSoundWidget->sound() );
1092#else //KAB_EMBEDDED 1093#else //KAB_EMBEDDED
1093//US qDebug("AddresseeEditorWidget::save sound not supported"); 1094//US qDebug("AddresseeEditorWidget::save sound not supported");
1094#endif //KAB_EMBEDDED 1095#endif //KAB_EMBEDDED
1095 mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); 1096 mAddressee.setSecrecy( mSecrecyWidget->secrecy() );
1096 1097
1097 // save custom fields 1098 // save custom fields
1098 mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); 1099 mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() );
1099 mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); 1100 mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() );
1100 mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() ); 1101 mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() );
1101 mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); 1102 mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() );
1102 mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); 1103 mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() );
1103 mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); 1104 mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() );
1104 mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); 1105 mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() );
1105 mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); 1106 mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() );
1106 if ( mAnniversaryPicker->inputIsValid() ) { 1107 if ( mAnniversaryPicker->inputIsValid() ) {
1107 QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); 1108 QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate);
1108 mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); 1109 mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
1109 } 1110 }
1110 else { 1111 else {
1111 mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); 1112 mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" );
1112 mAnniversaryPicker->clear(); 1113 mAnniversaryPicker->clear();
1113 } 1114 }
1114 int gen = mGenderBox->currentItem (); 1115 int gen = mGenderBox->currentItem ();
1115 if ( gen == 1 ) 1116 if ( gen == 1 )
1116 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); 1117 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female");
1117 else if ( gen == 2 ) 1118 else if ( gen == 2 )
1118 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); 1119 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
1119 else 1120 else
1120 mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" ); 1121 mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" );
1121 1122
1122 // Save the email addresses 1123 // Save the email addresses
1123 QStringList emails = mAddressee.emails(); 1124 QStringList emails = mAddressee.emails();
1124 QStringList::Iterator iter; 1125 QStringList::Iterator iter;
1125 for ( iter = emails.begin(); iter != emails.end(); ++iter ) 1126 for ( iter = emails.begin(); iter != emails.end(); ++iter )
1126 mAddressee.removeEmail( *iter ); 1127 mAddressee.removeEmail( *iter );
1127 1128
1128 emails = mEmailWidget->emails(); 1129 emails = mEmailWidget->emails();
1129 bool first = true; 1130 bool first = true;
1130 for ( iter = emails.begin(); iter != emails.end(); ++iter ) { 1131 for ( iter = emails.begin(); iter != emails.end(); ++iter ) {
1131 mAddressee.insertEmail( *iter, first ); 1132 mAddressee.insertEmail( *iter, first );
1132 first = false; 1133 first = false;
1133 } 1134 }
1134 1135
1135 // Save the phone numbers 1136 // Save the phone numbers
1136 KABC::PhoneNumber::List phoneNumbers; 1137 KABC::PhoneNumber::List phoneNumbers;
1137 KABC::PhoneNumber::List::Iterator phoneIter; 1138 KABC::PhoneNumber::List::Iterator phoneIter;
1138 phoneNumbers = mAddressee.phoneNumbers(); 1139 phoneNumbers = mAddressee.phoneNumbers();
1139 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); 1140 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
1140 ++phoneIter ) 1141 ++phoneIter )
1141 mAddressee.removePhoneNumber( *phoneIter ); 1142 mAddressee.removePhoneNumber( *phoneIter );
1142 1143
1143 phoneNumbers = mPhoneEditWidget->phoneNumbers(); 1144 phoneNumbers = mPhoneEditWidget->phoneNumbers();
1144 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); 1145 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
1145 ++phoneIter ) 1146 ++phoneIter )
1146 mAddressee.insertPhoneNumber( *phoneIter ); 1147 mAddressee.insertPhoneNumber( *phoneIter );
1147 1148
1148 // Save the addresses 1149 // Save the addresses
1149 KABC::Address::List addresses; 1150 KABC::Address::List addresses;
1150 KABC::Address::List::Iterator addressIter; 1151 KABC::Address::List::Iterator addressIter;
1151 addresses = mAddressee.addresses(); 1152 addresses = mAddressee.addresses();
1152 for ( addressIter = addresses.begin(); addressIter != addresses.end(); 1153 for ( addressIter = addresses.begin(); addressIter != addresses.end();
1153 ++addressIter ) 1154 ++addressIter )
1154 mAddressee.removeAddress( *addressIter ); 1155 mAddressee.removeAddress( *addressIter );
1155 1156
1156 addresses = mAddressEditWidget->addresses(); 1157 addresses = mAddressEditWidget->addresses();
1157 for ( addressIter = addresses.begin(); addressIter != addresses.end(); 1158 for ( addressIter = addresses.begin(); addressIter != addresses.end();
1158 ++addressIter ) 1159 ++addressIter )
1159 mAddressee.insertAddress( *addressIter ); 1160 mAddressee.insertAddress( *addressIter );
1160 mDirty = false; 1161 mDirty = false;
1161} 1162}
1162 1163
1163bool AddresseeEditorWidget::dirty() 1164bool AddresseeEditorWidget::dirty()
1164{ 1165{
1165 1166
1166 if ( ! mDirty ) { 1167 if ( ! mDirty ) {
1167 if ( mBirthdayPicker->inputIsValid() ) { 1168 if ( mBirthdayPicker->inputIsValid() ) {
1168 QDate da = mBirthdayPicker->date(); 1169 QDate da = mBirthdayPicker->date();
1169 if ( !(da == mAddressee.birthday().date())) 1170 if ( !(da == mAddressee.birthday().date()))
1170 mDirty = true; 1171 mDirty = true;
1171 } 1172 }
1172 else { 1173 else {
1173 mBirthdayPicker->clear(); 1174 mBirthdayPicker->clear();
1174 } 1175 }
1175 if ( mAnniversaryPicker->inputIsValid() ) { 1176 if ( mAnniversaryPicker->inputIsValid() ) {
1176 QDate da = mAnniversaryPicker->date(); 1177 QDate da = mAnniversaryPicker->date();
1177 if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), 1178 if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
1178 "%Y-%m-%d")) 1179 "%Y-%m-%d"))
1179 mDirty = true; 1180 mDirty = true;
1180 } 1181 }
1181 else { 1182 else {
1182 mAnniversaryPicker->clear(); 1183 mAnniversaryPicker->clear();
1183 } 1184 }
1184 } 1185 }
1185 return mDirty; 1186 return mDirty;
1186} 1187}
1187 1188
1188void AddresseeEditorWidget::nameTextChanged( const QString &text ) 1189void AddresseeEditorWidget::nameTextChanged( const QString &text )
1189{ 1190{
1190 // use the addressee class to parse the name for us 1191 // use the addressee class to parse the name for us
1191 mAConfig->setUid( mAddressee.uid() ); 1192 mAConfig->setUid( mAddressee.uid() );
1192 if ( mAConfig->automaticNameParsing() ) { 1193 if ( mAConfig->automaticNameParsing() ) {
1193 if ( !mAddressee.formattedName().isEmpty() ) { 1194 if ( !mAddressee.formattedName().isEmpty() ) {
1194 QString fn = mAddressee.formattedName(); 1195 QString fn = mAddressee.formattedName();
1195 mAddressee.setNameFromString( text ); 1196 mAddressee.setNameFromString( text );
1196 mAddressee.setFormattedName( fn ); 1197 mAddressee.setFormattedName( fn );
1197 } else { 1198 } else {
1198 // use extra addressee to avoid a formatted name assignment 1199 // use extra addressee to avoid a formatted name assignment
1199 Addressee addr; 1200 Addressee addr;
1200 addr.setNameFromString( text ); 1201 addr.setNameFromString( text );
1201 mAddressee.setPrefix( addr.prefix() ); 1202 mAddressee.setPrefix( addr.prefix() );
1202 mAddressee.setGivenName( addr.givenName() ); 1203 mAddressee.setGivenName( addr.givenName() );
1203 mAddressee.setAdditionalName( addr.additionalName() ); 1204 mAddressee.setAdditionalName( addr.additionalName() );
1204 mAddressee.setFamilyName( addr.familyName() ); 1205 mAddressee.setFamilyName( addr.familyName() );
1205 mAddressee.setSuffix( addr.suffix() ); 1206 mAddressee.setSuffix( addr.suffix() );
1206 } 1207 }
1207 } 1208 }
1208 1209
1209 nameBoxChanged(); 1210 nameBoxChanged();
1210 1211
1211 emitModified(); 1212 emitModified();
1212} 1213}
1213 1214
1214void AddresseeEditorWidget::nameBoxChanged() 1215void AddresseeEditorWidget::nameBoxChanged()
1215{ 1216{
1216 KABC::Addressee addr; 1217 KABC::Addressee addr;
1217 mAConfig->setUid( mAddressee.uid() ); 1218 mAConfig->setUid( mAddressee.uid() );
1218 if ( mAConfig->automaticNameParsing() ) { 1219 if ( mAConfig->automaticNameParsing() ) {
1219 addr.setNameFromString( mNameEdit->text() ); 1220 addr.setNameFromString( mNameEdit->text() );
1220 mNameLabel->hide(); 1221 mNameLabel->hide();
1221 mNameEdit->show(); 1222 mNameEdit->show();
1222 } else { 1223 } else {
1223 addr = mAddressee; 1224 addr = mAddressee;
1224 mNameEdit->hide(); 1225 mNameEdit->hide();
1225 mNameLabel->setText( mNameEdit->text() ); 1226 mNameLabel->setText( mNameEdit->text() );
1226 mNameLabel->show(); 1227 mNameLabel->show();
1227 } 1228 }
1228 1229
1229 if ( mFormattedNameType != NameEditDialog::CustomName ) { 1230 if ( mFormattedNameType != NameEditDialog::CustomName ) {
1230 mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 1231 mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
1231 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 1232 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
1232 } 1233 }
1233} 1234}
1234 1235
1235void AddresseeEditorWidget::nameButtonClicked() 1236void AddresseeEditorWidget::nameButtonClicked()
1236{ 1237{
1237 // show the name dialog. 1238 // show the name dialog.
1238 NameEditDialog dialog( mAddressee, mFormattedNameType, this ); 1239 NameEditDialog dialog( mAddressee, mFormattedNameType, this );
1239 1240
1240 if ( KApplication::execDialog( &dialog) ) { 1241 if ( KApplication::execDialog( &dialog) ) {
1241 if ( dialog.changed() ) { 1242 if ( dialog.changed() ) {
1242 mAddressee.setFamilyName( dialog.familyName() ); 1243 mAddressee.setFamilyName( dialog.familyName() );
1243 mAddressee.setGivenName( dialog.givenName() ); 1244 mAddressee.setGivenName( dialog.givenName() );
1244 mAddressee.setPrefix( dialog.prefix() ); 1245 mAddressee.setPrefix( dialog.prefix() );
1245 mAddressee.setSuffix( dialog.suffix() ); 1246 mAddressee.setSuffix( dialog.suffix() );
1246 mAddressee.setAdditionalName( dialog.additionalName() ); 1247 mAddressee.setAdditionalName( dialog.additionalName() );
1247 mFormattedNameType = dialog.formattedNameType(); 1248 mFormattedNameType = dialog.formattedNameType();
1248 if ( mFormattedNameType == NameEditDialog::CustomName ) { 1249 if ( mFormattedNameType == NameEditDialog::CustomName ) {
1249 mFormattedNameLabel->setText( dialog.customFormattedName() ); 1250 mFormattedNameLabel->setText( dialog.customFormattedName() );
1250 mAddressee.setFormattedName( dialog.customFormattedName() ); 1251 mAddressee.setFormattedName( dialog.customFormattedName() );
1251 } 1252 }
1252 // Update the name edit. 1253 // Update the name edit.
1253 bool block = mNameEdit->signalsBlocked(); 1254 bool block = mNameEdit->signalsBlocked();
1254 mNameEdit->blockSignals( true ); 1255 mNameEdit->blockSignals( true );
1255 mNameEdit->setText( mAddressee.assembledName() ); 1256 mNameEdit->setText( mAddressee.assembledName() );
1256 mNameEdit->blockSignals( block ); 1257 mNameEdit->blockSignals( block );
1257 1258
1258 // Update the combo box. 1259 // Update the combo box.
1259 nameBoxChanged(); 1260 nameBoxChanged();
1260 1261
1261 emitModified(); 1262 emitModified();
1262 } 1263 }
1263 } 1264 }
1264} 1265}
1265 1266
1266void AddresseeEditorWidget::categoryButtonClicked() 1267void AddresseeEditorWidget::categoryButtonClicked()
1267{ 1268{
1268 // Show the category dialog 1269 // Show the category dialog
1269 if ( mCategoryDialog == 0 ) { 1270 if ( mCategoryDialog == 0 ) {
1270 mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); 1271 mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this );
1271 connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), 1272 connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ),
1272 SLOT(categoriesSelected( const QStringList& ) ) ); 1273 SLOT(categoriesSelected( const QStringList& ) ) );
1273 connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); 1274 connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) );
1274 } 1275 }
1275 1276
1276 mCategoryDialog->setCategories(); 1277 mCategoryDialog->setCategories();
1277 mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); 1278 mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) );
1278 mCategoryDialog->show(); 1279 mCategoryDialog->show();
1279 mCategoryDialog->raise(); 1280 mCategoryDialog->raise();
1280} 1281}
1281 1282
1282void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) 1283void AddresseeEditorWidget::categoriesSelected( const QStringList &list )
1283{ 1284{
1284 mCategoryEdit->setText( list.join( "," ) ); 1285 mCategoryEdit->setText( list.join( "," ) );
1285} 1286}
1286 1287
1287void AddresseeEditorWidget::editCategories() 1288void AddresseeEditorWidget::editCategories()
1288{ 1289{
1289 if ( mCategoryEditDialog == 0 ) { 1290 if ( mCategoryEditDialog == 0 ) {
1290 mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); 1291 mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this );
1291 connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), 1292 connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ),
1292 SLOT( categoryButtonClicked() ) ); 1293 SLOT( categoryButtonClicked() ) );
1293 } 1294 }
1294 1295
1295 mCategoryEditDialog->show(); 1296 mCategoryEditDialog->show();
1296 mCategoryEditDialog->raise(); 1297 mCategoryEditDialog->raise();
1297} 1298}
1298 1299
1299void AddresseeEditorWidget::emitModified() 1300void AddresseeEditorWidget::emitModified()
1300{ 1301{
1301 mDirty = true; 1302 mDirty = true;
1302 1303
1303 KABC::Addressee::List list; 1304 KABC::Addressee::List list;
1304 1305
1305 if ( mIsExtension && !mBlockSignals ) { 1306 if ( mIsExtension && !mBlockSignals ) {
1306 save(); 1307 save();
1307 list.append( mAddressee ); 1308 list.append( mAddressee );
1308 } 1309 }
1309 1310
1310 emit modified( list ); 1311 emit modified( list );
1311} 1312}
1312 1313
1313void AddresseeEditorWidget::dateChanged( QDate ) 1314void AddresseeEditorWidget::dateChanged( QDate )
1314{ 1315{
1315 emitModified(); 1316 emitModified();
1316} 1317}
1317 1318
1318//US invalid dates are handdled by the KDateEdit widget itself 1319//US invalid dates are handdled by the KDateEdit widget itself
1319void AddresseeEditorWidget::invalidDate() 1320void AddresseeEditorWidget::invalidDate()
1320{ 1321{
1321 KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); 1322 KMessageBox::sorry( this, i18n( "You must specify a valid date" ) );
1322} 1323}
1323 1324
1324 1325
1325void AddresseeEditorWidget::pageChanged( QWidget *wdg ) 1326void AddresseeEditorWidget::pageChanged( QWidget *wdg )
1326{ 1327{
1327#ifndef KAB_EMBEDDED 1328#ifndef KAB_EMBEDDED
1328 if ( wdg ) 1329 if ( wdg )
1329 KAcceleratorManager::manage( wdg ); 1330 KAcceleratorManager::manage( wdg );
1330#else //KAB_EMBEDDED 1331#else //KAB_EMBEDDED
1331//US 1332//US
1332#endif //KAB_EMBEDDED 1333#endif //KAB_EMBEDDED
1333 1334
1334} 1335}
1335 1336
1336QString AddresseeEditorWidget::title() const 1337QString AddresseeEditorWidget::title() const
1337{ 1338{
1338 return i18n( "Contact Editor" ); 1339 return i18n( "Contact Editor" );
1339} 1340}
1340 1341
1341QString AddresseeEditorWidget::identifier() const 1342QString AddresseeEditorWidget::identifier() const
1342{ 1343{
1343 return i18n( "contact_editor" ); 1344 return i18n( "contact_editor" );
1344} 1345}
1345 1346
1346#ifndef KAB_EMBEDDED 1347#ifndef KAB_EMBEDDED
1347#include "addresseeeditorwidget.moc" 1348#include "addresseeeditorwidget.moc"
1348#endif //KAB_EMBEDDED 1349#endif //KAB_EMBEDDED