Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 4313998..a95db03 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -1,510 +1,514 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qhbox.h> | 25 | #include <q3hbox.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qlistbox.h> | 28 | #include <q3listbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qtabwidget.h> | 30 | #include <qtabwidget.h> |
31 | #include <qapplication.h> | 31 | #include <qapplication.h> |
32 | 32 | ||
33 | #ifndef KAB_EMBEDDED | 33 | #ifndef KAB_EMBEDDED |
34 | #include <qtextedit.h> | 34 | #include <q3textedit.h> |
35 | //Added by qt3to4: | ||
36 | #include <Q3GridLayout> | ||
37 | #include <Q3PopupMenu> | ||
38 | #include <Q3VBoxLayout> | ||
35 | 39 | ||
36 | #include <kaccelmanager.h> | 40 | #include <kaccelmanager.h> |
37 | #include "keywidget.h" | 41 | #include "keywidget.h" |
38 | #include "soundwidget.h" | 42 | #include "soundwidget.h" |
39 | 43 | ||
40 | #else //KAB_EMBEDDED | 44 | #else //KAB_EMBEDDED |
41 | #include <qmultilineedit.h> | 45 | #include <q3multilineedit.h> |
42 | #endif //KAB_EMBEDDED | 46 | #endif //KAB_EMBEDDED |
43 | 47 | ||
44 | 48 | ||
45 | #include "keywidget.h" | 49 | #include "keywidget.h" |
46 | #include "geowidget.h" | 50 | #include "geowidget.h" |
47 | #include "imagewidget.h" | 51 | #include "imagewidget.h" |
48 | #include "nameeditdialog.h" | 52 | #include "nameeditdialog.h" |
49 | #include "phoneeditwidget.h" | 53 | #include "phoneeditwidget.h" |
50 | #include "secrecywidget.h" | 54 | #include "secrecywidget.h" |
51 | 55 | ||
52 | 56 | ||
53 | #include <qtoolbutton.h> | 57 | #include <qtoolbutton.h> |
54 | #include <qtooltip.h> | 58 | #include <qtooltip.h> |
55 | 59 | ||
56 | #include <kapplication.h> | 60 | #include <kapplication.h> |
57 | #include <kconfig.h> | 61 | #include <kconfig.h> |
58 | #include <kcombobox.h> | 62 | #include <kcombobox.h> |
59 | #include <kdebug.h> | 63 | #include <kdebug.h> |
60 | #include <kdialogbase.h> | 64 | #include <kdialogbase.h> |
61 | #include <kglobal.h> | 65 | #include <kglobal.h> |
62 | #include <kiconloader.h> | 66 | #include <kiconloader.h> |
63 | #include <klineedit.h> | 67 | #include <klineedit.h> |
64 | #include <klocale.h> | 68 | #include <klocale.h> |
65 | #include <kmessagebox.h> | 69 | #include <kmessagebox.h> |
66 | #include <kseparator.h> | 70 | #include <kseparator.h> |
67 | #include <ksqueezedtextlabel.h> | 71 | #include <ksqueezedtextlabel.h> |
68 | 72 | ||
69 | #include <libkdepim/categoryeditdialog.h> | 73 | #include <libkdepim/categoryeditdialog.h> |
70 | #include <libkdepim/categoryselectdialog.h> | 74 | #include <libkdepim/categoryselectdialog.h> |
71 | 75 | ||
72 | #include <libkdepim/kdateedit.h> | 76 | #include <libkdepim/kdateedit.h> |
73 | 77 | ||
74 | #include "addresseditwidget.h" | 78 | #include "addresseditwidget.h" |
75 | #include "emaileditwidget.h" | 79 | #include "emaileditwidget.h" |
76 | #include "kabcore.h" | 80 | #include "kabcore.h" |
77 | #include "kabprefs.h" | 81 | #include "kabprefs.h" |
78 | 82 | ||
79 | #include "addresseeeditorwidget.h" | 83 | #include "addresseeeditorwidget.h" |
80 | 84 | ||
81 | 85 | ||
82 | 86 | ||
83 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, | 87 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, |
84 | QWidget *parent, const char *name ) | 88 | QWidget *parent, const char *name ) |
85 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), | 89 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), |
86 | mBlockSignals( false ) | 90 | mBlockSignals( false ) |
87 | { | 91 | { |
88 | 92 | ||
89 | mAConfig = AddresseeConfig::instance(); | 93 | mAConfig = AddresseeConfig::instance(); |
90 | 94 | ||
91 | mFormattedNameType = NameEditDialog::CustomName; | 95 | mFormattedNameType = NameEditDialog::CustomName; |
92 | initGUI(); | 96 | initGUI(); |
93 | mCategoryDialog = 0; | 97 | mCategoryDialog = 0; |
94 | mCategoryEditDialog = 0; | 98 | mCategoryEditDialog = 0; |
95 | 99 | ||
96 | // Load the empty addressee as defaults | 100 | // Load the empty addressee as defaults |
97 | load(); | 101 | load(); |
98 | 102 | ||
99 | mDirty = false; | 103 | mDirty = false; |
100 | } | 104 | } |
101 | 105 | ||
102 | AddresseeEditorWidget::~AddresseeEditorWidget() | 106 | AddresseeEditorWidget::~AddresseeEditorWidget() |
103 | { | 107 | { |
104 | kdDebug(5720) << "~AddresseeEditorWidget()" << endl; | 108 | kdDebug(5720) << "~AddresseeEditorWidget()" << endl; |
105 | } | 109 | } |
106 | 110 | ||
107 | void AddresseeEditorWidget::contactsSelectionChanged() | 111 | void AddresseeEditorWidget::contactsSelectionChanged() |
108 | { | 112 | { |
109 | KABC::Addressee::List list = selectedContacts(); | 113 | KABC::Addressee::List list = selectedContacts(); |
110 | 114 | ||
111 | mAddressee = list[ 0 ]; | 115 | mAddressee = list[ 0 ]; |
112 | load(); | 116 | load(); |
113 | } | 117 | } |
114 | 118 | ||
115 | void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) | 119 | void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) |
116 | { | 120 | { |
117 | mAddressee = addr; | 121 | mAddressee = addr; |
118 | load(); | 122 | load(); |
119 | } | 123 | } |
120 | 124 | ||
121 | const KABC::Addressee &AddresseeEditorWidget::addressee() | 125 | const KABC::Addressee &AddresseeEditorWidget::addressee() |
122 | { | 126 | { |
123 | return mAddressee; | 127 | return mAddressee; |
124 | } | 128 | } |
125 | 129 | ||
126 | void AddresseeEditorWidget::textChanged( const QString& ) | 130 | void AddresseeEditorWidget::textChanged( const QString& ) |
127 | { | 131 | { |
128 | emitModified(); | 132 | emitModified(); |
129 | } | 133 | } |
130 | 134 | ||
131 | void AddresseeEditorWidget::initGUI() | 135 | void AddresseeEditorWidget::initGUI() |
132 | { | 136 | { |
133 | QVBoxLayout *layout = new QVBoxLayout( this ); | 137 | Q3VBoxLayout *layout = new Q3VBoxLayout( this ); |
134 | 138 | ||
135 | mTabWidget = new QTabWidget( this ); | 139 | mTabWidget = new QTabWidget( this ); |
136 | layout->addWidget( mTabWidget ); | 140 | layout->addWidget( mTabWidget ); |
137 | 141 | ||
138 | setupTab1(); | 142 | setupTab1(); |
139 | setupTab1_1(); | 143 | setupTab1_1(); |
140 | setupTab2(); | 144 | setupTab2(); |
141 | setupTab2_1(); | 145 | setupTab2_1(); |
142 | setupTab3(); | 146 | setupTab3(); |
143 | setupTab3_1(); | 147 | setupTab3_1(); |
144 | 148 | ||
145 | mNameEdit->setFocus(); | 149 | mNameEdit->setFocus(); |
146 | 150 | ||
147 | connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), | 151 | connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), |
148 | SLOT( pageChanged(QWidget*) ) ); | 152 | SLOT( pageChanged(QWidget*) ) ); |
149 | } | 153 | } |
150 | 154 | ||
151 | void AddresseeEditorWidget::setupTab1() | 155 | void AddresseeEditorWidget::setupTab1() |
152 | { | 156 | { |
153 | // This is the General tab | 157 | // This is the General tab |
154 | QWidget *tab1 = new QWidget( mTabWidget ); | 158 | QWidget *tab1 = new QWidget( mTabWidget ); |
155 | 159 | ||
156 | //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); | 160 | //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); |
157 | bool horLayout = false; | 161 | bool horLayout = false; |
158 | int maxCol = 1; | 162 | int maxCol = 1; |
159 | if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { | 163 | if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { |
160 | horLayout = true; | 164 | horLayout = true; |
161 | maxCol = 3; | 165 | maxCol = 3; |
162 | } | 166 | } |
163 | QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol ); | 167 | Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol ); |
164 | 168 | ||
165 | layout->setMargin( KDialogBase::marginHintSmall() ); | 169 | layout->setMargin( KDialogBase::marginHintSmall() ); |
166 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 170 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
167 | 171 | ||
168 | QLabel *label; | 172 | QLabel *label; |
169 | KSeparator* bar; | 173 | KSeparator* bar; |
170 | QPushButton *button; | 174 | QPushButton *button; |
171 | 175 | ||
172 | ////////////////////////////////// | 176 | ////////////////////////////////// |
173 | // Upper left group (person info) | 177 | // Upper left group (person info) |
174 | 178 | ||
175 | // Person icon | 179 | // Person icon |
176 | /* LR | 180 | /* LR |
177 | label = new QLabel( tab1 ); | 181 | label = new QLabel( tab1 ); |
178 | //US ambiguous call. Add one more parameter | 182 | //US ambiguous call. Add one more parameter |
179 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 183 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
180 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 184 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
181 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 185 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
182 | */ | 186 | */ |
183 | // First name | 187 | // First name |
184 | button = new QPushButton( i18n( "Name..." ), tab1 ); | 188 | button = new QPushButton( i18n( "Name..." ), tab1 ); |
185 | //US QToolTip::add( button, i18n( "Edit the contact's name" ) ); | 189 | //US QToolTip::add( button, i18n( "Edit the contact's name" ) ); |
186 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); | 190 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); |
187 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), | 191 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), |
188 | SLOT( nameTextChanged( const QString& ) ) ); | 192 | SLOT( nameTextChanged( const QString& ) ) ); |
189 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); | 193 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); |
190 | 194 | ||
191 | mNameLabel = new KSqueezedTextLabel( tab1 ); | 195 | mNameLabel = new KSqueezedTextLabel( tab1 ); |
192 | mNameLabel->hide(); | 196 | mNameLabel->hide(); |
193 | 197 | ||
194 | layout->addWidget( button, 0, 0 ); | 198 | layout->addWidget( button, 0, 0 ); |
195 | layout->addWidget( mNameEdit, 0, 1 ); | 199 | layout->addWidget( mNameEdit, 0, 1 ); |
196 | layout->addWidget( mNameLabel, 0, 1 ); | 200 | layout->addWidget( mNameLabel, 0, 1 ); |
197 | 201 | ||
198 | button = new QPushButton( i18n( "Role:" ), tab1 ); | 202 | button = new QPushButton( i18n( "Role:" ), tab1 ); |
199 | connect( button, SIGNAL( clicked() ), SLOT( setRole2FN() ) ); | 203 | connect( button, SIGNAL( clicked() ), SLOT( setRole2FN() ) ); |
200 | //label = new QLabel( i18n( "Role:" ), tab1 ); | 204 | //label = new QLabel( i18n( "Role:" ), tab1 ); |
201 | mRoleEdit = new KLineEdit( tab1 ); | 205 | mRoleEdit = new KLineEdit( tab1 ); |
202 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), | 206 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), |
203 | SLOT( textChanged( const QString& ) ) ); | 207 | SLOT( textChanged( const QString& ) ) ); |
204 | //label->setBuddy( mRoleEdit ); | 208 | //label->setBuddy( mRoleEdit ); |
205 | if ( horLayout ) { | 209 | if ( horLayout ) { |
206 | layout->addWidget( button, 0, 2 ); | 210 | layout->addWidget( button, 0, 2 ); |
207 | layout->addWidget( mRoleEdit, 0, 3 ); | 211 | layout->addWidget( mRoleEdit, 0, 3 ); |
208 | 212 | ||
209 | } else { | 213 | } else { |
210 | layout->addWidget( button, 1, 0 ); | 214 | layout->addWidget( button, 1, 0 ); |
211 | layout->addWidget( mRoleEdit, 1, 1 ); | 215 | layout->addWidget( mRoleEdit, 1, 1 ); |
212 | } | 216 | } |
213 | // Organization | 217 | // Organization |
214 | button = new QPushButton( i18n( "Organization:" ), tab1 ); | 218 | button = new QPushButton( i18n( "Organization:" ), tab1 ); |
215 | connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) ); | 219 | connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) ); |
216 | //label = new QLabel( i18n( "Organization:" ), tab1 ); | 220 | //label = new QLabel( i18n( "Organization:" ), tab1 ); |
217 | mOrgEdit = new KLineEdit( tab1 ); | 221 | mOrgEdit = new KLineEdit( tab1 ); |
218 | //label->setBuddy( mOrgEdit ); | 222 | //label->setBuddy( mOrgEdit ); |
219 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), | 223 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), |
220 | SLOT( textChanged( const QString& ) ) ); | 224 | SLOT( textChanged( const QString& ) ) ); |
221 | if ( horLayout ) { | 225 | if ( horLayout ) { |
222 | layout->addWidget( button, 1, 2 ); | 226 | layout->addWidget( button, 1, 2 ); |
223 | layout->addWidget( mOrgEdit, 1, 3 ); | 227 | layout->addWidget( mOrgEdit, 1, 3 ); |
224 | 228 | ||
225 | } else { | 229 | } else { |
226 | layout->addWidget( button, 2, 0 ); | 230 | layout->addWidget( button, 2, 0 ); |
227 | layout->addWidget( mOrgEdit, 2, 1 ); | 231 | layout->addWidget( mOrgEdit, 2, 1 ); |
228 | } | 232 | } |
229 | 233 | ||
230 | // File as (formatted name) | 234 | // File as (formatted name) |
231 | label = new QLabel( i18n( "Format.n.:" ), tab1 ); | 235 | label = new QLabel( i18n( "Format.n.:" ), tab1 ); |
232 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); | 236 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); |
233 | if ( horLayout ) { | 237 | if ( horLayout ) { |
234 | layout->addWidget( label, 1,0 ); | 238 | layout->addWidget( label, 1,0 ); |
235 | layout->addWidget( mFormattedNameLabel, 1, 1 ); | 239 | layout->addWidget( mFormattedNameLabel, 1, 1 ); |
236 | } else { | 240 | } else { |
237 | layout->addWidget( label, 3, 0 ); | 241 | layout->addWidget( label, 3, 0 ); |
238 | layout->addWidget( mFormattedNameLabel, 3, 1 ); | 242 | layout->addWidget( mFormattedNameLabel, 3, 1 ); |
239 | } | 243 | } |
240 | /* LR | 244 | /* LR |
241 | // Left hand separator. This separator doesn't go all the way | 245 | // Left hand separator. This separator doesn't go all the way |
242 | // across so the dialog still flows from top to bottom | 246 | // across so the dialog still flows from top to bottom |
243 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 247 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
244 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); | 248 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); |
245 | */ | 249 | */ |
246 | ////////////////////////////////////// | 250 | ////////////////////////////////////// |
247 | 251 | ||
248 | /* LR | 252 | /* LR |
249 | // Phone numbers (upper right) | 253 | // Phone numbers (upper right) |
250 | label = new QLabel( tab1 ); | 254 | label = new QLabel( tab1 ); |
251 | //US loadIcon call is ambiguous. Add one more parameter | 255 | //US loadIcon call is ambiguous. Add one more parameter |
252 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); | 256 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); |
253 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); | 257 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); |
254 | //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); | 258 | //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); |
255 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); | 259 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); |
256 | */ | 260 | */ |
257 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); | 261 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); |
258 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 262 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
259 | //US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); | 263 | //US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); |
260 | int iii; | 264 | int iii; |
261 | #ifndef DESKTOP_VERSION | 265 | #ifndef DESKTOP_VERSION |
262 | iii = 7; | 266 | iii = 7; |
263 | #else | 267 | #else |
264 | iii = 8; | 268 | iii = 8; |
265 | #endif | 269 | #endif |
266 | layout->addMultiCellWidget( mPhoneEditWidget, 5-maxCol, 5-maxCol+4, 0, maxCol ); | 270 | layout->addMultiCellWidget( mPhoneEditWidget, 5-maxCol, 5-maxCol+4, 0, maxCol ); |
267 | iii = 6-maxCol+4; | 271 | iii = 6-maxCol+4; |
268 | /* LR | 272 | /* LR |
269 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 273 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
270 | //US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); | 274 | //US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); |
271 | layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); | 275 | layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); |
272 | */ | 276 | */ |
273 | /*US | 277 | /*US |
274 | ////////////////////////////////////// | 278 | ////////////////////////////////////// |
275 | // Addresses (lower left) | 279 | // Addresses (lower left) |
276 | label = new QLabel( tab1 ); | 280 | label = new QLabel( tab1 ); |
277 | //US loadIcon call is ambiguous. Add one more parameter | 281 | //US loadIcon call is ambiguous. Add one more parameter |
278 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); | 282 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); |
279 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); | 283 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); |
280 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); | 284 | layout->addMultiCellWidget( label, 5, 6, 0, 0 ); |
281 | 285 | ||
282 | mAddressEditWidget = new AddressEditWidget( tab1 ); | 286 | mAddressEditWidget = new AddressEditWidget( tab1 ); |
283 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 287 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
284 | layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); | 288 | layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); |
285 | 289 | ||
286 | ////////////////////////////////////// | 290 | ////////////////////////////////////// |
287 | // Email / Web (lower right) | 291 | // Email / Web (lower right) |
288 | label = new QLabel( tab1 ); | 292 | label = new QLabel( tab1 ); |
289 | //US loadIcon call is ambiguous. Add one more parameter | 293 | //US loadIcon call is ambiguous. Add one more parameter |
290 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); | 294 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); |
291 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); | 295 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); |
292 | layout->addMultiCellWidget( label, 5, 6, 3, 3 ); | 296 | layout->addMultiCellWidget( label, 5, 6, 3, 3 ); |
293 | 297 | ||
294 | mEmailWidget = new EmailEditWidget( tab1 ); | 298 | mEmailWidget = new EmailEditWidget( tab1 ); |
295 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 299 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
296 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); | 300 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); |
297 | 301 | ||
298 | // add the separator | 302 | // add the separator |
299 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 303 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
300 | layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); | 304 | layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); |
301 | 305 | ||
302 | label = new QLabel( tab1 ); | 306 | label = new QLabel( tab1 ); |
303 | //US loadIcon call is ambiguous. Add one more parameter | 307 | //US loadIcon call is ambiguous. Add one more parameter |
304 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); | 308 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); |
305 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); | 309 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); |
306 | layout->addMultiCellWidget( label, 8, 9, 3, 3 ); | 310 | layout->addMultiCellWidget( label, 8, 9, 3, 3 ); |
307 | 311 | ||
308 | label = new QLabel( i18n( "URL:" ), tab1 ); | 312 | label = new QLabel( i18n( "URL:" ), tab1 ); |
309 | mURLEdit = new KLineEdit( tab1 ); | 313 | mURLEdit = new KLineEdit( tab1 ); |
310 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), | 314 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), |
311 | SLOT( textChanged( const QString& ) ) ); | 315 | SLOT( textChanged( const QString& ) ) ); |
312 | label->setBuddy( mURLEdit ); | 316 | label->setBuddy( mURLEdit ); |
313 | layout->addWidget( label, 8, 4 ); | 317 | layout->addWidget( label, 8, 4 ); |
314 | layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); | 318 | layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); |
315 | 319 | ||
316 | label = new QLabel( i18n( "&IM address:" ), tab1 ); | 320 | label = new QLabel( i18n( "&IM address:" ), tab1 ); |
317 | mIMAddressEdit = new KLineEdit( tab1 ); | 321 | mIMAddressEdit = new KLineEdit( tab1 ); |
318 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), | 322 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), |
319 | SLOT( textChanged( const QString& ) ) ); | 323 | SLOT( textChanged( const QString& ) ) ); |
320 | label->setBuddy( mIMAddressEdit ); | 324 | label->setBuddy( mIMAddressEdit ); |
321 | layout->addWidget( label, 9, 4 ); | 325 | layout->addWidget( label, 9, 4 ); |
322 | layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); | 326 | layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); |
323 | 327 | ||
324 | layout->addColSpacing( 6, 50 ); | 328 | layout->addColSpacing( 6, 50 ); |
325 | 329 | ||
326 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 330 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
327 | layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); | 331 | layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); |
328 | */ | 332 | */ |
329 | /////////////////////////////////////// | 333 | /////////////////////////////////////// |
330 | QHBox *categoryBox = new QHBox( tab1 ,"cato"); | 334 | Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato"); |
331 | categoryBox->setSpacing( KDialogBase::spacingHint() ); | 335 | categoryBox->setSpacing( KDialogBase::spacingHint() ); |
332 | categoryBox->setMargin( KDialogBase::marginHintSmall() ); | 336 | categoryBox->setMargin( KDialogBase::marginHintSmall() ); |
333 | 337 | ||
334 | // Categories | 338 | // Categories |
335 | button = new QPushButton( i18n( "Categories" )+":", categoryBox ); | 339 | button = new QPushButton( i18n( "Categories" )+":", categoryBox ); |
336 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); | 340 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); |
337 | 341 | ||
338 | mCategoryEdit = new QPushButton ( categoryBox ); | 342 | mCategoryEdit = new QPushButton ( categoryBox ); |
339 | mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); | 343 | mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); |
340 | mCatPopup = new QPopupMenu ( categoryBox ); | 344 | mCatPopup = new Q3PopupMenu ( categoryBox ); |
341 | mCategoryEdit->setPopup( mCatPopup ); | 345 | mCategoryEdit->setPopup( mCatPopup ); |
342 | connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); | 346 | connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); |
343 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); | 347 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); |
344 | //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), | 348 | //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), |
345 | // SLOT( textChanged( const QString& ) ) ); | 349 | // SLOT( textChanged( const QString& ) ) ); |
346 | 350 | ||
347 | mSecrecyWidget = new SecrecyWidget( categoryBox ); | 351 | mSecrecyWidget = new SecrecyWidget( categoryBox ); |
348 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 352 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
349 | 353 | ||
350 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); | 354 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); |
351 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol ); | 355 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol ); |
352 | 356 | ||
353 | // Build the layout and add to the tab widget | 357 | // Build the layout and add to the tab widget |
354 | layout->activate(); // required | 358 | layout->activate(); // required |
355 | 359 | ||
356 | mTabWidget->addTab( tab1, i18n( "&General" ) ); | 360 | mTabWidget->addTab( tab1, i18n( "&General" ) ); |
357 | } | 361 | } |
358 | 362 | ||
359 | void AddresseeEditorWidget::showCatPopup() | 363 | void AddresseeEditorWidget::showCatPopup() |
360 | { | 364 | { |
361 | mCatPopup->clear(); | 365 | mCatPopup->clear(); |
362 | QStringList checkedCategories = QStringList::split (",", mCategoryEdit->text()); | 366 | QStringList checkedCategories = QStringList::split (",", mCategoryEdit->text()); |
363 | int index = 0; | 367 | int index = 0; |
364 | for (QStringList::Iterator it = KABPrefs::instance()->mCustomCategories.begin (); | 368 | for (QStringList::Iterator it = KABPrefs::instance()->mCustomCategories.begin (); |
365 | it != KABPrefs::instance()->mCustomCategories.end (); | 369 | it != KABPrefs::instance()->mCustomCategories.end (); |
366 | ++it) { | 370 | ++it) { |
367 | mCatPopup->insertItem (*it, index ); | 371 | mCatPopup->insertItem (*it, index ); |
368 | //mCategory[index] = *it; | 372 | //mCategory[index] = *it; |
369 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); | 373 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); |
370 | ++index; | 374 | ++index; |
371 | } | 375 | } |
372 | } | 376 | } |
373 | void AddresseeEditorWidget::selectedCatPopup( int index ) | 377 | void AddresseeEditorWidget::selectedCatPopup( int index ) |
374 | { | 378 | { |
375 | QStringList categories = QStringList::split (",", mCategoryEdit->text()); | 379 | QStringList categories = QStringList::split (",", mCategoryEdit->text()); |
376 | QString colcat = categories.first(); | 380 | QString colcat = categories.first(); |
377 | if (categories.find ( KABPrefs::instance()->mCustomCategories[index]) != categories.end ()) | 381 | if (categories.find ( KABPrefs::instance()->mCustomCategories[index]) != categories.end ()) |
378 | categories.remove (KABPrefs::instance()->mCustomCategories[index]); | 382 | categories.remove (KABPrefs::instance()->mCustomCategories[index]); |
379 | else | 383 | else |
380 | categories.insert (categories.end(), KABPrefs::instance()->mCustomCategories[index]); | 384 | categories.insert (categories.end(), KABPrefs::instance()->mCustomCategories[index]); |
381 | categories.sort (); | 385 | categories.sort (); |
382 | if ( !colcat.isEmpty() ) { | 386 | if ( !colcat.isEmpty() ) { |
383 | if ( categories.find ( colcat ) != categories.end () ) { | 387 | if ( categories.find ( colcat ) != categories.end () ) { |
384 | categories.remove( colcat ); | 388 | categories.remove( colcat ); |
385 | categories.prepend( colcat ); | 389 | categories.prepend( colcat ); |
386 | } | 390 | } |
387 | } | 391 | } |
388 | mCategoryEdit->setText( categories.join(",") ); | 392 | mCategoryEdit->setText( categories.join(",") ); |
389 | emitModified(); | 393 | emitModified(); |
390 | } | 394 | } |
391 | void AddresseeEditorWidget::setRole2FN() | 395 | void AddresseeEditorWidget::setRole2FN() |
392 | { | 396 | { |
393 | if ( mRoleEdit->text().isEmpty() ) return; | 397 | if ( mRoleEdit->text().isEmpty() ) return; |
394 | mFormattedNameType = NameEditDialog::CustomName; | 398 | mFormattedNameType = NameEditDialog::CustomName; |
395 | mAddressee.setFormattedName( mRoleEdit->text() ); | 399 | mAddressee.setFormattedName( mRoleEdit->text() ); |
396 | mFormattedNameLabel->setText( mRoleEdit->text() ); | 400 | mFormattedNameLabel->setText( mRoleEdit->text() ); |
397 | emitModified(); | 401 | emitModified(); |
398 | } | 402 | } |
399 | void AddresseeEditorWidget::setCompany2FN() | 403 | void AddresseeEditorWidget::setCompany2FN() |
400 | { | 404 | { |
401 | if ( mOrgEdit->text().isEmpty() ) return; | 405 | if ( mOrgEdit->text().isEmpty() ) return; |
402 | mFormattedNameType = NameEditDialog::CustomName; | 406 | mFormattedNameType = NameEditDialog::CustomName; |
403 | mAddressee.setFormattedName( mOrgEdit->text() ); | 407 | mAddressee.setFormattedName( mOrgEdit->text() ); |
404 | mFormattedNameLabel->setText( mOrgEdit->text() ); | 408 | mFormattedNameLabel->setText( mOrgEdit->text() ); |
405 | emitModified(); | 409 | emitModified(); |
406 | } | 410 | } |
407 | 411 | ||
408 | void AddresseeEditorWidget::setupTab1_1() | 412 | void AddresseeEditorWidget::setupTab1_1() |
409 | { | 413 | { |
410 | // This is the Address tab | 414 | // This is the Address tab |
411 | QWidget *tab1_1 = new QWidget( mTabWidget ); | 415 | QWidget *tab1_1 = new QWidget( mTabWidget ); |
412 | 416 | ||
413 | //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); | 417 | //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); |
414 | QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); | 418 | Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 ); |
415 | layout->setMargin( KDialogBase::marginHintSmall() ); | 419 | layout->setMargin( KDialogBase::marginHintSmall() ); |
416 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 420 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
417 | 421 | ||
418 | QLabel *label; | 422 | QLabel *label; |
419 | KSeparator* bar; | 423 | KSeparator* bar; |
420 | QPushButton *button; | 424 | QPushButton *button; |
421 | 425 | ||
422 | /*US | 426 | /*US |
423 | ////////////////////////////////// | 427 | ////////////////////////////////// |
424 | // Upper left group (person info) | 428 | // Upper left group (person info) |
425 | 429 | ||
426 | // Person icon | 430 | // Person icon |
427 | label = new QLabel( tab1 ); | 431 | label = new QLabel( tab1 ); |
428 | //US ambiguous call. Add one more parameter | 432 | //US ambiguous call. Add one more parameter |
429 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 433 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
430 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 434 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
431 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 435 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
432 | 436 | ||
433 | // First name | 437 | // First name |
434 | button = new QPushButton( i18n( "Name..." ), tab1 ); | 438 | button = new QPushButton( i18n( "Name..." ), tab1 ); |
435 | QToolTip::add( button, i18n( "Edit the contact's name" ) ); | 439 | QToolTip::add( button, i18n( "Edit the contact's name" ) ); |
436 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); | 440 | mNameEdit = new KLineEdit( tab1, "mNameEdit" ); |
437 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), | 441 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), |
438 | SLOT( nameTextChanged( const QString& ) ) ); | 442 | SLOT( nameTextChanged( const QString& ) ) ); |
439 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); | 443 | connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); |
440 | 444 | ||
441 | #ifndef KAB_EMBEDDED | 445 | #ifndef KAB_EMBEDDED |
442 | mNameLabel = new KSqueezedTextLabel( tab1 ); | 446 | mNameLabel = new KSqueezedTextLabel( tab1 ); |
443 | mNameLabel->hide(); | 447 | mNameLabel->hide(); |
444 | #else //KAB_EMBEDDED | 448 | #else //KAB_EMBEDDED |
445 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 449 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
446 | #endif //KAB_EMBEDDED | 450 | #endif //KAB_EMBEDDED |
447 | 451 | ||
448 | layout->addWidget( button, 0, 1 ); | 452 | layout->addWidget( button, 0, 1 ); |
449 | layout->addWidget( mNameEdit, 0, 2 ); | 453 | layout->addWidget( mNameEdit, 0, 2 ); |
450 | 454 | ||
451 | #ifndef KAB_EMBEDDED | 455 | #ifndef KAB_EMBEDDED |
452 | layout->addWidget( mNameLabel, 0, 2 ); | 456 | layout->addWidget( mNameLabel, 0, 2 ); |
453 | #else //KAB_EMBEDDED | 457 | #else //KAB_EMBEDDED |
454 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 458 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
455 | #endif //KAB_EMBEDDED | 459 | #endif //KAB_EMBEDDED |
456 | 460 | ||
457 | label = new QLabel( i18n( "Role:" ), tab1 ); | 461 | label = new QLabel( i18n( "Role:" ), tab1 ); |
458 | mRoleEdit = new KLineEdit( tab1 ); | 462 | mRoleEdit = new KLineEdit( tab1 ); |
459 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), | 463 | connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), |
460 | SLOT( textChanged( const QString& ) ) ); | 464 | SLOT( textChanged( const QString& ) ) ); |
461 | label->setBuddy( mRoleEdit ); | 465 | label->setBuddy( mRoleEdit ); |
462 | layout->addWidget( label, 1, 1 ); | 466 | layout->addWidget( label, 1, 1 ); |
463 | layout->addWidget( mRoleEdit, 1, 2 ); | 467 | layout->addWidget( mRoleEdit, 1, 2 ); |
464 | 468 | ||
465 | // Organization | 469 | // Organization |
466 | label = new QLabel( i18n( "Organization:" ), tab1 ); | 470 | label = new QLabel( i18n( "Organization:" ), tab1 ); |
467 | mOrgEdit = new KLineEdit( tab1 ); | 471 | mOrgEdit = new KLineEdit( tab1 ); |
468 | label->setBuddy( mOrgEdit ); | 472 | label->setBuddy( mOrgEdit ); |
469 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), | 473 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), |
470 | SLOT( textChanged( const QString& ) ) ); | 474 | SLOT( textChanged( const QString& ) ) ); |
471 | layout->addWidget( label, 2, 1 ); | 475 | layout->addWidget( label, 2, 1 ); |
472 | layout->addWidget( mOrgEdit, 2, 2 ); | 476 | layout->addWidget( mOrgEdit, 2, 2 ); |
473 | 477 | ||
474 | // File as (formatted name) | 478 | // File as (formatted name) |
475 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); | 479 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); |
476 | #ifndef KAB_EMBEDDED | 480 | #ifndef KAB_EMBEDDED |
477 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); | 481 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); |
478 | #else //KAB_EMBEDDED | 482 | #else //KAB_EMBEDDED |
479 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 483 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
480 | #endif //KAB_EMBEDDED | 484 | #endif //KAB_EMBEDDED |
481 | layout->addWidget( label, 3, 1 ); | 485 | layout->addWidget( label, 3, 1 ); |
482 | #ifndef KAB_EMBEDDED | 486 | #ifndef KAB_EMBEDDED |
483 | layout->addWidget( mFormattedNameLabel, 3, 2 ); | 487 | layout->addWidget( mFormattedNameLabel, 3, 2 ); |
484 | #else //KAB_EMBEDDED | 488 | #else //KAB_EMBEDDED |
485 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | 489 | qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); |
486 | #endif //KAB_EMBEDDED | 490 | #endif //KAB_EMBEDDED |
487 | 491 | ||
488 | // Left hand separator. This separator doesn't go all the way | 492 | // Left hand separator. This separator doesn't go all the way |
489 | // across so the dialog still flows from top to bottom | 493 | // across so the dialog still flows from top to bottom |
490 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 494 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
491 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); | 495 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); |
492 | 496 | ||
493 | ////////////////////////////////////// | 497 | ////////////////////////////////////// |
494 | // Phone numbers (upper right) | 498 | // Phone numbers (upper right) |
495 | label = new QLabel( tab1 ); | 499 | label = new QLabel( tab1 ); |
496 | //US loadIcon call is ambiguous. Add one more parameter | 500 | //US loadIcon call is ambiguous. Add one more parameter |
497 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); | 501 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); |
498 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); | 502 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); |
499 | layout->addMultiCellWidget( label, 0, 1, 3, 3 ); | 503 | layout->addMultiCellWidget( label, 0, 1, 3, 3 ); |
500 | 504 | ||
501 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); | 505 | mPhoneEditWidget = new PhoneEditWidget( tab1 ); |
502 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 506 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
503 | layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); | 507 | layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); |
504 | 508 | ||
505 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 509 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
506 | layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); | 510 | layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); |
507 | */ | 511 | */ |
508 | ////////////////////////////////////// | 512 | ////////////////////////////////////// |
509 | // Addresses (lower left) | 513 | // Addresses (lower left) |
510 | /* LR | 514 | /* LR |
@@ -519,586 +523,586 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); | |||
519 | mAddressEditWidget = new AddressEditWidget( tab1_1 ); | 523 | mAddressEditWidget = new AddressEditWidget( tab1_1 ); |
520 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 524 | connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
521 | //US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); | 525 | //US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); |
522 | layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 ); | 526 | layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 ); |
523 | 527 | ||
524 | //US | 528 | //US |
525 | /* LR | 529 | /* LR |
526 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); | 530 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); |
527 | layout->addMultiCellWidget( bar, 5, 5, 0, 3 ); | 531 | layout->addMultiCellWidget( bar, 5, 5, 0, 3 ); |
528 | */ | 532 | */ |
529 | 533 | ||
530 | ////////////////////////////////////// | 534 | ////////////////////////////////////// |
531 | // Email / Web (lower right) | 535 | // Email / Web (lower right) |
532 | /* LR | 536 | /* LR |
533 | label = new QLabel( tab1_1 ); | 537 | label = new QLabel( tab1_1 ); |
534 | //US loadIcon call is ambiguous. Add one more parameter | 538 | //US loadIcon call is ambiguous. Add one more parameter |
535 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); | 539 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); |
536 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); | 540 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); |
537 | //US layout->addMultiCellWidget( label, 5, 6, 3, 3 ); | 541 | //US layout->addMultiCellWidget( label, 5, 6, 3, 3 ); |
538 | layout->addMultiCellWidget( label, 6, 7, 0, 0 ); | 542 | layout->addMultiCellWidget( label, 6, 7, 0, 0 ); |
539 | */ | 543 | */ |
540 | mEmailWidget = new EmailEditWidget( tab1_1 ); | 544 | mEmailWidget = new EmailEditWidget( tab1_1 ); |
541 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 545 | connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
542 | //US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); | 546 | //US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); |
543 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 ); | 547 | layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 ); |
544 | 548 | ||
545 | /* LR | 549 | /* LR |
546 | // add the separator | 550 | // add the separator |
547 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); | 551 | bar = new KSeparator( KSeparator::HLine, tab1_1 ); |
548 | //US layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); | 552 | //US layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); |
549 | layout->addMultiCellWidget( bar, 8, 8, 0, 3 ); | 553 | layout->addMultiCellWidget( bar, 8, 8, 0, 3 ); |
550 | 554 | ||
551 | label = new QLabel( tab1_1 ); | 555 | label = new QLabel( tab1_1 ); |
552 | //US loadIcon call is ambiguous. Add one more parameter | 556 | //US loadIcon call is ambiguous. Add one more parameter |
553 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); | 557 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); |
554 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); | 558 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); |
555 | //US layout->addMultiCellWidget( label, 8, 9, 3, 3 ); | 559 | //US layout->addMultiCellWidget( label, 8, 9, 3, 3 ); |
556 | layout->addMultiCellWidget( label, 9, 10, 0, 0 ); | 560 | layout->addMultiCellWidget( label, 9, 10, 0, 0 ); |
557 | */ | 561 | */ |
558 | label = new QLabel( i18n( "URL:" ), tab1_1 ); | 562 | label = new QLabel( i18n( "URL:" ), tab1_1 ); |
559 | mURLEdit = new KLineEdit( tab1_1 ); | 563 | mURLEdit = new KLineEdit( tab1_1 ); |
560 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), | 564 | connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), |
561 | SLOT( textChanged( const QString& ) ) ); | 565 | SLOT( textChanged( const QString& ) ) ); |
562 | label->setBuddy( mURLEdit ); | 566 | label->setBuddy( mURLEdit ); |
563 | //US layout->addWidget( label, 8, 4 ); | 567 | //US layout->addWidget( label, 8, 4 ); |
564 | layout->addWidget( label, 7,0 ); | 568 | layout->addWidget( label, 7,0 ); |
565 | //US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); | 569 | //US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); |
566 | layout->addWidget( mURLEdit, 7, 1); | 570 | layout->addWidget( mURLEdit, 7, 1); |
567 | 571 | ||
568 | label = new QLabel( i18n( "&IM address:" ), tab1_1 ); | 572 | label = new QLabel( i18n( "&IM address:" ), tab1_1 ); |
569 | mIMAddressEdit = new KLineEdit( tab1_1 ); | 573 | mIMAddressEdit = new KLineEdit( tab1_1 ); |
570 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), | 574 | connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), |
571 | SLOT( textChanged( const QString& ) ) ); | 575 | SLOT( textChanged( const QString& ) ) ); |
572 | label->setBuddy( mIMAddressEdit ); | 576 | label->setBuddy( mIMAddressEdit ); |
573 | //US layout->addWidget( label, 9, 4 ); | 577 | //US layout->addWidget( label, 9, 4 ); |
574 | layout->addWidget( label, 8, 0 ); | 578 | layout->addWidget( label, 8, 0 ); |
575 | //US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); | 579 | //US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); |
576 | layout->addWidget( mIMAddressEdit, 8,1 ); | 580 | layout->addWidget( mIMAddressEdit, 8,1 ); |
577 | 581 | ||
578 | //US layout->addColSpacing( 6, 50 ); | 582 | //US layout->addColSpacing( 6, 50 ); |
579 | 583 | ||
580 | //US bar = new KSeparator( KSeparator::HLine, tab1_1 ); | 584 | //US bar = new KSeparator( KSeparator::HLine, tab1_1 ); |
581 | //US layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); | 585 | //US layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); |
582 | 586 | ||
583 | /*US | 587 | /*US |
584 | /////////////////////////////////////// | 588 | /////////////////////////////////////// |
585 | QHBox *categoryBox = new QHBox( tab1 ); | 589 | QHBox *categoryBox = new QHBox( tab1 ); |
586 | categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); | 590 | categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); |
587 | 591 | ||
588 | // Categories | 592 | // Categories |
589 | button = new QPushButton( i18n( "Categories" ), categoryBox ); | 593 | button = new QPushButton( i18n( "Categories" ), categoryBox ); |
590 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); | 594 | connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); |
591 | 595 | ||
592 | mCategoryEdit = new KLineEdit( categoryBox ); | 596 | mCategoryEdit = new KLineEdit( categoryBox ); |
593 | mCategoryEdit->setReadOnly( true ); | 597 | mCategoryEdit->setReadOnly( true ); |
594 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), | 598 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), |
595 | SLOT( textChanged( const QString& ) ) ); | 599 | SLOT( textChanged( const QString& ) ) ); |
596 | 600 | ||
597 | mSecrecyWidget = new SecrecyWidget( categoryBox ); | 601 | mSecrecyWidget = new SecrecyWidget( categoryBox ); |
598 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 602 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
599 | 603 | ||
600 | layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); | 604 | layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); |
601 | */ | 605 | */ |
602 | // Build the layout and add to the tab widget | 606 | // Build the layout and add to the tab widget |
603 | layout->activate(); // required | 607 | layout->activate(); // required |
604 | 608 | ||
605 | mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); | 609 | mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); |
606 | } | 610 | } |
607 | 611 | ||
608 | 612 | ||
609 | 613 | ||
610 | void AddresseeEditorWidget::setupTab2() | 614 | void AddresseeEditorWidget::setupTab2() |
611 | { | 615 | { |
612 | // This is the Details tab | 616 | // This is the Details tab |
613 | QWidget *tab2 = new QWidget( mTabWidget ); | 617 | QWidget *tab2 = new QWidget( mTabWidget ); |
614 | 618 | ||
615 | QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); | 619 | Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 ); |
616 | layout->setMargin( KDialogBase::marginHintSmall() ); | 620 | layout->setMargin( KDialogBase::marginHintSmall() ); |
617 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 621 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
618 | 622 | ||
619 | QLabel *label; | 623 | QLabel *label; |
620 | KSeparator* bar; | 624 | KSeparator* bar; |
621 | 625 | ||
622 | /////////////////////// | 626 | /////////////////////// |
623 | // Office info | 627 | // Office info |
624 | 628 | ||
625 | // Department | 629 | // Department |
626 | label = new QLabel( tab2 ); | 630 | label = new QLabel( tab2 ); |
627 | //US loadIcon call is ambiguous. Add one more parameter | 631 | //US loadIcon call is ambiguous. Add one more parameter |
628 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); | 632 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); |
629 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); | 633 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); |
630 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 634 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
631 | 635 | ||
632 | label = new QLabel( i18n( "Department:" ), tab2 ); | 636 | label = new QLabel( i18n( "Department:" ), tab2 ); |
633 | layout->addWidget( label, 0, 1 ); | 637 | layout->addWidget( label, 0, 1 ); |
634 | mDepartmentEdit = new KLineEdit( tab2 ); | 638 | mDepartmentEdit = new KLineEdit( tab2 ); |
635 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), | 639 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), |
636 | SLOT( textChanged( const QString& ) ) ); | 640 | SLOT( textChanged( const QString& ) ) ); |
637 | label->setBuddy( mDepartmentEdit ); | 641 | label->setBuddy( mDepartmentEdit ); |
638 | layout->addWidget( mDepartmentEdit, 0, 2 ); | 642 | layout->addWidget( mDepartmentEdit, 0, 2 ); |
639 | 643 | ||
640 | label = new QLabel( i18n( "Office:" ), tab2 ); | 644 | label = new QLabel( i18n( "Office:" ), tab2 ); |
641 | layout->addWidget( label, 1, 1 ); | 645 | layout->addWidget( label, 1, 1 ); |
642 | mOfficeEdit = new KLineEdit( tab2 ); | 646 | mOfficeEdit = new KLineEdit( tab2 ); |
643 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), | 647 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), |
644 | SLOT( textChanged( const QString& ) ) ); | 648 | SLOT( textChanged( const QString& ) ) ); |
645 | label->setBuddy( mOfficeEdit ); | 649 | label->setBuddy( mOfficeEdit ); |
646 | layout->addWidget( mOfficeEdit, 1, 2 ); | 650 | layout->addWidget( mOfficeEdit, 1, 2 ); |
647 | 651 | ||
648 | label = new QLabel( i18n( "Profession:" ), tab2 ); | 652 | label = new QLabel( i18n( "Profession:" ), tab2 ); |
649 | layout->addWidget( label, 2, 1 ); | 653 | layout->addWidget( label, 2, 1 ); |
650 | mProfessionEdit = new KLineEdit( tab2 ); | 654 | mProfessionEdit = new KLineEdit( tab2 ); |
651 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), | 655 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), |
652 | SLOT( textChanged( const QString& ) ) ); | 656 | SLOT( textChanged( const QString& ) ) ); |
653 | label->setBuddy( mProfessionEdit ); | 657 | label->setBuddy( mProfessionEdit ); |
654 | layout->addWidget( mProfessionEdit, 2, 2 ); | 658 | layout->addWidget( mProfessionEdit, 2, 2 ); |
655 | 659 | ||
656 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); | 660 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); |
657 | //US layout->addWidget( label, 0, 3 ); | 661 | //US layout->addWidget( label, 0, 3 ); |
658 | layout->addWidget( label, 3, 1 ); | 662 | layout->addWidget( label, 3, 1 ); |
659 | mManagerEdit = new KLineEdit( tab2 ); | 663 | mManagerEdit = new KLineEdit( tab2 ); |
660 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), | 664 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), |
661 | SLOT( textChanged( const QString& ) ) ); | 665 | SLOT( textChanged( const QString& ) ) ); |
662 | label->setBuddy( mManagerEdit ); | 666 | label->setBuddy( mManagerEdit ); |
663 | //US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); | 667 | //US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); |
664 | layout->addWidget( mManagerEdit, 3, 2 ); | 668 | layout->addWidget( mManagerEdit, 3, 2 ); |
665 | 669 | ||
666 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); | 670 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); |
667 | //US layout->addWidget( label, 1, 3 ); | 671 | //US layout->addWidget( label, 1, 3 ); |
668 | layout->addWidget( label, 4, 1 ); | 672 | layout->addWidget( label, 4, 1 ); |
669 | mAssistantEdit = new KLineEdit( tab2 ); | 673 | mAssistantEdit = new KLineEdit( tab2 ); |
670 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), | 674 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), |
671 | SLOT( textChanged( const QString& ) ) ); | 675 | SLOT( textChanged( const QString& ) ) ); |
672 | label->setBuddy( mAssistantEdit ); | 676 | label->setBuddy( mAssistantEdit ); |
673 | //US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); | 677 | //US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); |
674 | layout->addWidget( mAssistantEdit, 4, 2 ); | 678 | layout->addWidget( mAssistantEdit, 4, 2 ); |
675 | 679 | ||
676 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 680 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
677 | //US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); | 681 | //US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); |
678 | layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); | 682 | layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); |
679 | 683 | ||
680 | ///////////////////////////////////////////////// | 684 | ///////////////////////////////////////////////// |
681 | // Personal info | 685 | // Personal info |
682 | 686 | ||
683 | //label = new QLabel( tab2 ); | 687 | //label = new QLabel( tab2 ); |
684 | //US loadIcon call is ambiguous. Add one more parameter | 688 | //US loadIcon call is ambiguous. Add one more parameter |
685 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 689 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
686 | //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 690 | //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
687 | //US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); | 691 | //US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); |
688 | //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); | 692 | //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); |
689 | 693 | ||
690 | 694 | ||
691 | int iii = 6; | 695 | int iii = 6; |
692 | 696 | ||
693 | if ( QApplication::desktop()->width() == 640 ) { | 697 | if ( QApplication::desktop()->width() == 640 ) { |
694 | QHBox * nbox = new QHBox ( tab2 ); | 698 | Q3HBox * nbox = new Q3HBox ( tab2 ); |
695 | label = new QLabel( i18n( "Nick name:" )+" ", nbox ); | 699 | label = new QLabel( i18n( "Nick name:" )+" ", nbox ); |
696 | mNicknameEdit = new KLineEdit( nbox ); | 700 | mNicknameEdit = new KLineEdit( nbox ); |
697 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), | 701 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), |
698 | SLOT( textChanged( const QString& ) ) ); | 702 | SLOT( textChanged( const QString& ) ) ); |
699 | label->setBuddy( mNicknameEdit ); | 703 | label->setBuddy( mNicknameEdit ); |
700 | 704 | ||
701 | label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); | 705 | label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); |
702 | mSpouseEdit = new KLineEdit( nbox ); | 706 | mSpouseEdit = new KLineEdit( nbox ); |
703 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), | 707 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), |
704 | SLOT( textChanged( const QString& ) ) ); | 708 | SLOT( textChanged( const QString& ) ) ); |
705 | label->setBuddy( mSpouseEdit ); | 709 | label->setBuddy( mSpouseEdit ); |
706 | layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); | 710 | layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); |
707 | ++iii; | 711 | ++iii; |
708 | 712 | ||
709 | } else { | 713 | } else { |
710 | label = new QLabel( i18n( "Nick name:" ), tab2 ); | 714 | label = new QLabel( i18n( "Nick name:" ), tab2 ); |
711 | layout->addWidget( label, iii, 1 ); | 715 | layout->addWidget( label, iii, 1 ); |
712 | mNicknameEdit = new KLineEdit( tab2 ); | 716 | mNicknameEdit = new KLineEdit( tab2 ); |
713 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), | 717 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), |
714 | SLOT( textChanged( const QString& ) ) ); | 718 | SLOT( textChanged( const QString& ) ) ); |
715 | label->setBuddy( mNicknameEdit ); | 719 | label->setBuddy( mNicknameEdit ); |
716 | layout->addWidget( mNicknameEdit, iii, 2 ); | 720 | layout->addWidget( mNicknameEdit, iii, 2 ); |
717 | ++iii; | 721 | ++iii; |
718 | 722 | ||
719 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); | 723 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); |
720 | layout->addWidget( label, iii, 1 ); | 724 | layout->addWidget( label, iii, 1 ); |
721 | mSpouseEdit = new KLineEdit( tab2 ); | 725 | mSpouseEdit = new KLineEdit( tab2 ); |
722 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), | 726 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), |
723 | SLOT( textChanged( const QString& ) ) ); | 727 | SLOT( textChanged( const QString& ) ) ); |
724 | label->setBuddy( mSpouseEdit ); | 728 | label->setBuddy( mSpouseEdit ); |
725 | layout->addWidget( mSpouseEdit, iii, 2 ); | 729 | layout->addWidget( mSpouseEdit, iii, 2 ); |
726 | ++iii; | 730 | ++iii; |
727 | } | 731 | } |
728 | 732 | ||
729 | label = new QLabel( i18n( "Children's names:" ), tab2 ); | 733 | label = new QLabel( i18n( "Children's names:" ), tab2 ); |
730 | layout->addWidget( label, iii, 1 ); | 734 | layout->addWidget( label, iii, 1 ); |
731 | mChildEdit = new KLineEdit( tab2 ); | 735 | mChildEdit = new KLineEdit( tab2 ); |
732 | connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), | 736 | connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), |
733 | SLOT( textChanged( const QString& ) ) ); | 737 | SLOT( textChanged( const QString& ) ) ); |
734 | label->setBuddy( mChildEdit ); | 738 | label->setBuddy( mChildEdit ); |
735 | layout->addWidget( mChildEdit, iii, 2 ); | 739 | layout->addWidget( mChildEdit, iii, 2 ); |
736 | ++iii; | 740 | ++iii; |
737 | if ( QApplication::desktop()->width() == 640 ) { | 741 | if ( QApplication::desktop()->width() == 640 ) { |
738 | QHBox * nbox = new QHBox ( tab2 ); | 742 | Q3HBox * nbox = new Q3HBox ( tab2 ); |
739 | label = new QLabel( i18n( "Birthday:" )+" ", nbox ); | 743 | label = new QLabel( i18n( "Birthday:" )+" ", nbox ); |
740 | mBirthdayPicker = new KDateEdit( nbox ); | 744 | mBirthdayPicker = new KDateEdit( nbox ); |
741 | //mBirthdayPicker->toggleDateFormat(); | 745 | //mBirthdayPicker->toggleDateFormat(); |
742 | mBirthdayPicker->setHandleInvalid( true ); | 746 | mBirthdayPicker->setHandleInvalid( true ); |
743 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), | 747 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), |
744 | SLOT( dateChanged( QDate ) ) ); | 748 | SLOT( dateChanged( QDate ) ) ); |
745 | 749 | ||
746 | label->setBuddy( mBirthdayPicker ); | 750 | label->setBuddy( mBirthdayPicker ); |
747 | 751 | ||
748 | label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); | 752 | label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); |
749 | mAnniversaryPicker = new KDateEdit( nbox ); | 753 | mAnniversaryPicker = new KDateEdit( nbox ); |
750 | mAnniversaryPicker->setHandleInvalid( true ); | 754 | mAnniversaryPicker->setHandleInvalid( true ); |
751 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), | 755 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), |
752 | SLOT( dateChanged( QDate ) ) ); | 756 | SLOT( dateChanged( QDate ) ) ); |
753 | 757 | ||
754 | label->setBuddy( mAnniversaryPicker ); | 758 | label->setBuddy( mAnniversaryPicker ); |
755 | layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); | 759 | layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); |
756 | ++iii; | 760 | ++iii; |
757 | 761 | ||
758 | } else { | 762 | } else { |
759 | 763 | ||
760 | label = new QLabel( i18n( "Birthday:" ), tab2 ); | 764 | label = new QLabel( i18n( "Birthday:" ), tab2 ); |
761 | layout->addWidget( label, iii, 1 ); | 765 | layout->addWidget( label, iii, 1 ); |
762 | mBirthdayPicker = new KDateEdit( tab2 ); | 766 | mBirthdayPicker = new KDateEdit( tab2 ); |
763 | //mBirthdayPicker->toggleDateFormat(); | 767 | //mBirthdayPicker->toggleDateFormat(); |
764 | mBirthdayPicker->setHandleInvalid( true ); | 768 | mBirthdayPicker->setHandleInvalid( true ); |
765 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), | 769 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), |
766 | SLOT( dateChanged( QDate ) ) ); | 770 | SLOT( dateChanged( QDate ) ) ); |
767 | 771 | ||
768 | label->setBuddy( mBirthdayPicker ); | 772 | label->setBuddy( mBirthdayPicker ); |
769 | layout->addWidget( mBirthdayPicker, iii, 2 ); | 773 | layout->addWidget( mBirthdayPicker, iii, 2 ); |
770 | ++iii; | 774 | ++iii; |
771 | 775 | ||
772 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); | 776 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); |
773 | layout->addWidget( label, iii, 1 ); | 777 | layout->addWidget( label, iii, 1 ); |
774 | mAnniversaryPicker = new KDateEdit( tab2 ); | 778 | mAnniversaryPicker = new KDateEdit( tab2 ); |
775 | mAnniversaryPicker->setHandleInvalid( true ); | 779 | mAnniversaryPicker->setHandleInvalid( true ); |
776 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), | 780 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), |
777 | SLOT( dateChanged( QDate ) ) ); | 781 | SLOT( dateChanged( QDate ) ) ); |
778 | 782 | ||
779 | label->setBuddy( mAnniversaryPicker ); | 783 | label->setBuddy( mAnniversaryPicker ); |
780 | layout->addWidget( mAnniversaryPicker, iii, 2 ); | 784 | layout->addWidget( mAnniversaryPicker, iii, 2 ); |
781 | ++iii; | 785 | ++iii; |
782 | 786 | ||
783 | } | 787 | } |
784 | 788 | ||
785 | label = new QLabel( i18n( "Gender:" ), tab2 ); | 789 | label = new QLabel( i18n( "Gender:" ), tab2 ); |
786 | layout->addWidget( label, iii, 1 ); | 790 | layout->addWidget( label, iii, 1 ); |
787 | mGenderBox = new QComboBox ( tab2 ); | 791 | mGenderBox = new QComboBox ( tab2 ); |
788 | mGenderBox->insertItem ( i18n( "ALIEN (undefined)" )); | 792 | mGenderBox->insertItem ( i18n( "ALIEN (undefined)" )); |
789 | mGenderBox->insertItem ( i18n( "female" )); | 793 | mGenderBox->insertItem ( i18n( "female" )); |
790 | mGenderBox->insertItem ( i18n( "male" )); | 794 | mGenderBox->insertItem ( i18n( "male" )); |
791 | connect( mGenderBox, SIGNAL( activated ( const QString & ) ), | 795 | connect( mGenderBox, SIGNAL( activated ( const QString & ) ), |
792 | SLOT( textChanged( const QString& ) ) ); | 796 | SLOT( textChanged( const QString& ) ) ); |
793 | label->setBuddy( mGenderBox ); | 797 | label->setBuddy( mGenderBox ); |
794 | layout->addWidget( mGenderBox, iii, 2 ); | 798 | layout->addWidget( mGenderBox, iii, 2 ); |
795 | ++iii; | 799 | ++iii; |
796 | // Build the layout and add to the tab widget | 800 | // Build the layout and add to the tab widget |
797 | layout->activate(); // required | 801 | layout->activate(); // required |
798 | 802 | ||
799 | mTabWidget->addTab( tab2, i18n( "&Details" ) ); | 803 | mTabWidget->addTab( tab2, i18n( "&Details" ) ); |
800 | } | 804 | } |
801 | 805 | ||
802 | void AddresseeEditorWidget::setupTab2_1() | 806 | void AddresseeEditorWidget::setupTab2_1() |
803 | { | 807 | { |
804 | // This is the Details tab | 808 | // This is the Details tab |
805 | QWidget *tab2_2 = new QWidget( mTabWidget ); | 809 | QWidget *tab2_2 = new QWidget( mTabWidget ); |
806 | 810 | ||
807 | QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); | 811 | Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 ); |
808 | layout->setMargin( KDialogBase::marginHintSmall() ); | 812 | layout->setMargin( KDialogBase::marginHintSmall() ); |
809 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 813 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
810 | 814 | ||
811 | QLabel *label; | 815 | QLabel *label; |
812 | KSeparator* bar; | 816 | KSeparator* bar; |
813 | 817 | ||
814 | /*US | 818 | /*US |
815 | /////////////////////// | 819 | /////////////////////// |
816 | // Office info | 820 | // Office info |
817 | 821 | ||
818 | // Department | 822 | // Department |
819 | label = new QLabel( tab2 ); | 823 | label = new QLabel( tab2 ); |
820 | //US loadIcon call is ambiguous. Add one more parameter | 824 | //US loadIcon call is ambiguous. Add one more parameter |
821 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); | 825 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); |
822 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); | 826 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); |
823 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); | 827 | layout->addMultiCellWidget( label, 0, 1, 0, 0 ); |
824 | 828 | ||
825 | label = new QLabel( i18n( "Department:" ), tab2 ); | 829 | label = new QLabel( i18n( "Department:" ), tab2 ); |
826 | layout->addWidget( label, 0, 1 ); | 830 | layout->addWidget( label, 0, 1 ); |
827 | mDepartmentEdit = new KLineEdit( tab2 ); | 831 | mDepartmentEdit = new KLineEdit( tab2 ); |
828 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), | 832 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), |
829 | SLOT( textChanged( const QString& ) ) ); | 833 | SLOT( textChanged( const QString& ) ) ); |
830 | label->setBuddy( mDepartmentEdit ); | 834 | label->setBuddy( mDepartmentEdit ); |
831 | layout->addWidget( mDepartmentEdit, 0, 2 ); | 835 | layout->addWidget( mDepartmentEdit, 0, 2 ); |
832 | 836 | ||
833 | label = new QLabel( i18n( "Office:" ), tab2 ); | 837 | label = new QLabel( i18n( "Office:" ), tab2 ); |
834 | layout->addWidget( label, 1, 1 ); | 838 | layout->addWidget( label, 1, 1 ); |
835 | mOfficeEdit = new KLineEdit( tab2 ); | 839 | mOfficeEdit = new KLineEdit( tab2 ); |
836 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), | 840 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), |
837 | SLOT( textChanged( const QString& ) ) ); | 841 | SLOT( textChanged( const QString& ) ) ); |
838 | label->setBuddy( mOfficeEdit ); | 842 | label->setBuddy( mOfficeEdit ); |
839 | layout->addWidget( mOfficeEdit, 1, 2 ); | 843 | layout->addWidget( mOfficeEdit, 1, 2 ); |
840 | 844 | ||
841 | label = new QLabel( i18n( "Profession:" ), tab2 ); | 845 | label = new QLabel( i18n( "Profession:" ), tab2 ); |
842 | layout->addWidget( label, 2, 1 ); | 846 | layout->addWidget( label, 2, 1 ); |
843 | mProfessionEdit = new KLineEdit( tab2 ); | 847 | mProfessionEdit = new KLineEdit( tab2 ); |
844 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), | 848 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), |
845 | SLOT( textChanged( const QString& ) ) ); | 849 | SLOT( textChanged( const QString& ) ) ); |
846 | label->setBuddy( mProfessionEdit ); | 850 | label->setBuddy( mProfessionEdit ); |
847 | layout->addWidget( mProfessionEdit, 2, 2 ); | 851 | layout->addWidget( mProfessionEdit, 2, 2 ); |
848 | 852 | ||
849 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); | 853 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); |
850 | layout->addWidget( label, 0, 3 ); | 854 | layout->addWidget( label, 0, 3 ); |
851 | mManagerEdit = new KLineEdit( tab2 ); | 855 | mManagerEdit = new KLineEdit( tab2 ); |
852 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), | 856 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), |
853 | SLOT( textChanged( const QString& ) ) ); | 857 | SLOT( textChanged( const QString& ) ) ); |
854 | label->setBuddy( mManagerEdit ); | 858 | label->setBuddy( mManagerEdit ); |
855 | layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); | 859 | layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); |
856 | 860 | ||
857 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); | 861 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); |
858 | layout->addWidget( label, 1, 3 ); | 862 | layout->addWidget( label, 1, 3 ); |
859 | mAssistantEdit = new KLineEdit( tab2 ); | 863 | mAssistantEdit = new KLineEdit( tab2 ); |
860 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), | 864 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), |
861 | SLOT( textChanged( const QString& ) ) ); | 865 | SLOT( textChanged( const QString& ) ) ); |
862 | label->setBuddy( mAssistantEdit ); | 866 | label->setBuddy( mAssistantEdit ); |
863 | layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); | 867 | layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); |
864 | 868 | ||
865 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 869 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
866 | layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); | 870 | layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); |
867 | 871 | ||
868 | ///////////////////////////////////////////////// | 872 | ///////////////////////////////////////////////// |
869 | // Personal info | 873 | // Personal info |
870 | 874 | ||
871 | label = new QLabel( tab2 ); | 875 | label = new QLabel( tab2 ); |
872 | //US loadIcon call is ambiguous. Add one more parameter | 876 | //US loadIcon call is ambiguous. Add one more parameter |
873 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 877 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
874 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 878 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
875 | layout->addMultiCellWidget( label, 4, 5, 0, 0 ); | 879 | layout->addMultiCellWidget( label, 4, 5, 0, 0 ); |
876 | 880 | ||
877 | label = new QLabel( i18n( "Nick name:" ), tab2 ); | 881 | label = new QLabel( i18n( "Nick name:" ), tab2 ); |
878 | layout->addWidget( label, 4, 1 ); | 882 | layout->addWidget( label, 4, 1 ); |
879 | mNicknameEdit = new KLineEdit( tab2 ); | 883 | mNicknameEdit = new KLineEdit( tab2 ); |
880 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), | 884 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), |
881 | SLOT( textChanged( const QString& ) ) ); | 885 | SLOT( textChanged( const QString& ) ) ); |
882 | label->setBuddy( mNicknameEdit ); | 886 | label->setBuddy( mNicknameEdit ); |
883 | layout->addWidget( mNicknameEdit, 4, 2 ); | 887 | layout->addWidget( mNicknameEdit, 4, 2 ); |
884 | 888 | ||
885 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); | 889 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); |
886 | layout->addWidget( label, 5, 1 ); | 890 | layout->addWidget( label, 5, 1 ); |
887 | mSpouseEdit = new KLineEdit( tab2 ); | 891 | mSpouseEdit = new KLineEdit( tab2 ); |
888 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), | 892 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), |
889 | SLOT( textChanged( const QString& ) ) ); | 893 | SLOT( textChanged( const QString& ) ) ); |
890 | label->setBuddy( mSpouseEdit ); | 894 | label->setBuddy( mSpouseEdit ); |
891 | layout->addWidget( mSpouseEdit, 5, 2 ); | 895 | layout->addWidget( mSpouseEdit, 5, 2 ); |
892 | 896 | ||
893 | label = new QLabel( i18n( "Birthday:" ), tab2 ); | 897 | label = new QLabel( i18n( "Birthday:" ), tab2 ); |
894 | layout->addWidget( label, 4, 3 ); | 898 | layout->addWidget( label, 4, 3 ); |
895 | mBirthdayPicker = new KDateEdit( tab2 ); | 899 | mBirthdayPicker = new KDateEdit( tab2 ); |
896 | mBirthdayPicker->setHandleInvalid( true ); | 900 | mBirthdayPicker->setHandleInvalid( true ); |
897 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), | 901 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), |
898 | SLOT( dateChanged( QDate ) ) ); | 902 | SLOT( dateChanged( QDate ) ) ); |
899 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), | 903 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), |
900 | SLOT( invalidDate() ) ); | 904 | SLOT( invalidDate() ) ); |
901 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), | 905 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), |
902 | SLOT( emitModified() ) ); | 906 | SLOT( emitModified() ) ); |
903 | label->setBuddy( mBirthdayPicker ); | 907 | label->setBuddy( mBirthdayPicker ); |
904 | layout->addWidget( mBirthdayPicker, 4, 4 ); | 908 | layout->addWidget( mBirthdayPicker, 4, 4 ); |
905 | 909 | ||
906 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); | 910 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); |
907 | layout->addWidget( label, 5, 3 ); | 911 | layout->addWidget( label, 5, 3 ); |
908 | mAnniversaryPicker = new KDateEdit( tab2 ); | 912 | mAnniversaryPicker = new KDateEdit( tab2 ); |
909 | mAnniversaryPicker->setHandleInvalid( true ); | 913 | mAnniversaryPicker->setHandleInvalid( true ); |
910 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), | 914 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), |
911 | SLOT( dateChanged( QDate ) ) ); | 915 | SLOT( dateChanged( QDate ) ) ); |
912 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), | 916 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), |
913 | SLOT( invalidDate() ) ); | 917 | SLOT( invalidDate() ) ); |
914 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), | 918 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), |
915 | SLOT( emitModified() ) ); | 919 | SLOT( emitModified() ) ); |
916 | label->setBuddy( mAnniversaryPicker ); | 920 | label->setBuddy( mAnniversaryPicker ); |
917 | layout->addWidget( mAnniversaryPicker, 5, 4 ); | 921 | layout->addWidget( mAnniversaryPicker, 5, 4 ); |
918 | 922 | ||
919 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 923 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
920 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); | 924 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); |
921 | */ | 925 | */ |
922 | ////////////////////////////////////// | 926 | ////////////////////////////////////// |
923 | // Notes | 927 | // Notes |
924 | label = new QLabel( i18n( "Note:" ), tab2_2 ); | 928 | label = new QLabel( i18n( "Note:" ), tab2_2 ); |
925 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); | 929 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); |
926 | //US layout->addWidget( label, 7, 0 ); | 930 | //US layout->addWidget( label, 7, 0 ); |
927 | layout->addWidget( label, 0, 0 ); | 931 | layout->addWidget( label, 0, 0 ); |
928 | #ifndef KAB_EMBEDDED | 932 | #ifndef KAB_EMBEDDED |
929 | mNoteEdit = new QTextEdit( tab2_2 ); | 933 | mNoteEdit = new Q3TextEdit( tab2_2 ); |
930 | mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); | 934 | mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth ); |
931 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 935 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
932 | #else //KAB_EMBEDDED | 936 | #else //KAB_EMBEDDED |
933 | mNoteEdit = new QMultiLineEdit( tab2_2 ); | 937 | mNoteEdit = new Q3MultiLineEdit( tab2_2 ); |
934 | mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); | 938 | mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth ); |
935 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 939 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
936 | #endif //KAB_EMBEDDED | 940 | #endif //KAB_EMBEDDED |
937 | 941 | ||
938 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); | 942 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); |
939 | label->setBuddy( mNoteEdit ); | 943 | label->setBuddy( mNoteEdit ); |
940 | //US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); | 944 | //US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); |
941 | layout->addWidget( mNoteEdit, 1, 0); | 945 | layout->addWidget( mNoteEdit, 1, 0); |
942 | 946 | ||
943 | // Build the layout and add to the tab widget | 947 | // Build the layout and add to the tab widget |
944 | layout->activate(); // required | 948 | layout->activate(); // required |
945 | 949 | ||
946 | mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); | 950 | mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); |
947 | } | 951 | } |
948 | 952 | ||
949 | 953 | ||
950 | 954 | ||
951 | void AddresseeEditorWidget::setupTab3() | 955 | void AddresseeEditorWidget::setupTab3() |
952 | { | 956 | { |
953 | // This is the Misc tab | 957 | // This is the Misc tab |
954 | QWidget *tab3 = new QWidget( mTabWidget ); | 958 | QWidget *tab3 = new QWidget( mTabWidget ); |
955 | 959 | ||
956 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); | 960 | Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 ); |
957 | layout->setMargin( KDialogBase::marginHintSmall() ); | 961 | layout->setMargin( KDialogBase::marginHintSmall() ); |
958 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 962 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
959 | //US layout->setColStretch( 2, 1 ); | 963 | //US layout->setColStretch( 2, 1 ); |
960 | 964 | ||
961 | ////////////////////////////////////// | 965 | ////////////////////////////////////// |
962 | // Geo | 966 | // Geo |
963 | mGeoWidget = new GeoWidget( tab3 ); | 967 | mGeoWidget = new GeoWidget( tab3 ); |
964 | // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); | 968 | // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); |
965 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 969 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
966 | layout->addWidget( mGeoWidget, 0, 0 ); | 970 | layout->addWidget( mGeoWidget, 0, 0 ); |
967 | /*US | 971 | /*US |
968 | ////////////////////////////////////// | 972 | ////////////////////////////////////// |
969 | // Sound | 973 | // Sound |
970 | #ifndef KAB_EMBEDDED | 974 | #ifndef KAB_EMBEDDED |
971 | mSoundWidget = new SoundWidget( tab3 ); | 975 | mSoundWidget = new SoundWidget( tab3 ); |
972 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); | 976 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); |
973 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 977 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
974 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); | 978 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); |
975 | #else //KAB_EMBEDDED | 979 | #else //KAB_EMBEDDED |
976 | qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); | 980 | qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); |
977 | #endif //KAB_EMBEDDED | 981 | #endif //KAB_EMBEDDED |
978 | 982 | ||
979 | ////////////////////////////////////// | 983 | ////////////////////////////////////// |
980 | // Images | 984 | // Images |
981 | mImageWidget = new ImageWidget( tab3 ); | 985 | mImageWidget = new ImageWidget( tab3 ); |
982 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); | 986 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); |
983 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 987 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
984 | layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); | 988 | layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); |
985 | */ | 989 | */ |
986 | //US | 990 | //US |
987 | /* | 991 | /* |
988 | KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); | 992 | KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); |
989 | layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); | 993 | layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); |
990 | */ | 994 | */ |
991 | ////////////////////////////////////// | 995 | ////////////////////////////////////// |
992 | // Keys | 996 | // Keys |
993 | mKeyWidget = new KeyWidget( tab3 ); | 997 | mKeyWidget = new KeyWidget( tab3 ); |
994 | //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); | 998 | //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); |
995 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 999 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
996 | //US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); | 1000 | //US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); |
997 | layout->addWidget( mKeyWidget, 1, 0 ); | 1001 | layout->addWidget( mKeyWidget, 1, 0 ); |
998 | 1002 | ||
999 | mTabWidget->addTab( tab3, i18n( "&Misc" ) ); | 1003 | mTabWidget->addTab( tab3, i18n( "&Misc" ) ); |
1000 | } | 1004 | } |
1001 | 1005 | ||
1002 | void AddresseeEditorWidget::setupTab3_1() | 1006 | void AddresseeEditorWidget::setupTab3_1() |
1003 | { | 1007 | { |
1004 | // This is the Misc tab | 1008 | // This is the Misc tab |
1005 | QWidget *tab3 = new QWidget( mTabWidget ); | 1009 | QWidget *tab3 = new QWidget( mTabWidget ); |
1006 | 1010 | ||
1007 | //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); | 1011 | //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); |
1008 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); | 1012 | Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 ); |
1009 | layout->setMargin( KDialogBase::marginHint() ); | 1013 | layout->setMargin( KDialogBase::marginHint() ); |
1010 | layout->setSpacing( KDialogBase::spacingHint() ); | 1014 | layout->setSpacing( KDialogBase::spacingHint() ); |
1011 | //US layout->setColStretch( 2, 1 ); | 1015 | //US layout->setColStretch( 2, 1 ); |
1012 | 1016 | ||
1013 | /*US | 1017 | /*US |
1014 | ////////////////////////////////////// | 1018 | ////////////////////////////////////// |
1015 | // Geo | 1019 | // Geo |
1016 | mGeoWidget = new GeoWidget( tab3 ); | 1020 | mGeoWidget = new GeoWidget( tab3 ); |
1017 | mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); | 1021 | mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); |
1018 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 1022 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
1019 | layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); | 1023 | layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); |
1020 | */ | 1024 | */ |
1021 | ////////////////////////////////////// | 1025 | ////////////////////////////////////// |
1022 | // Sound | 1026 | // Sound |
1023 | #ifndef KAB_EMBEDDED | 1027 | #ifndef KAB_EMBEDDED |
1024 | mSoundWidget = new SoundWidget( tab3 ); | 1028 | mSoundWidget = new SoundWidget( tab3 ); |
1025 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); | 1029 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); |
1026 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 1030 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
1027 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); | 1031 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); |
1028 | #else //KAB_EMBEDDED | 1032 | #else //KAB_EMBEDDED |
1029 | //US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); | 1033 | //US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); |
1030 | #endif //KAB_EMBEDDED | 1034 | #endif //KAB_EMBEDDED |
1031 | 1035 | ||
1032 | ////////////////////////////////////// | 1036 | ////////////////////////////////////// |
1033 | // Images | 1037 | // Images |
1034 | mImageWidget = new ImageWidget( tab3 ); | 1038 | mImageWidget = new ImageWidget( tab3 ); |
1035 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); | 1039 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); |
1036 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 1040 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
1037 | layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); | 1041 | layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); |
1038 | /*US | 1042 | /*US |
1039 | ////////////////////////////////////// | 1043 | ////////////////////////////////////// |
1040 | // Keys | 1044 | // Keys |
1041 | mKeyWidget = new KeyWidget( tab3 ); | 1045 | mKeyWidget = new KeyWidget( tab3 ); |
1042 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); | 1046 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); |
1043 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 1047 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
1044 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); | 1048 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); |
1045 | */ | 1049 | */ |
1046 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); | 1050 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); |
1047 | } | 1051 | } |
1048 | 1052 | ||
1049 | 1053 | ||
1050 | void AddresseeEditorWidget::load() | 1054 | void AddresseeEditorWidget::load() |
1051 | { | 1055 | { |
1052 | 1056 | ||
1053 | // Block signals in case anything tries to emit modified | 1057 | // Block signals in case anything tries to emit modified |
1054 | // CS: This doesn't seem to work. | 1058 | // CS: This doesn't seem to work. |
1055 | bool block = signalsBlocked(); | 1059 | bool block = signalsBlocked(); |
1056 | blockSignals( true ); | 1060 | blockSignals( true ); |
1057 | mBlockSignals = true; // used for internal signal blocking | 1061 | mBlockSignals = true; // used for internal signal blocking |
1058 | 1062 | ||
1059 | mNameEdit->setText( mAddressee.assembledName() ); | 1063 | mNameEdit->setText( mAddressee.assembledName() ); |
1060 | 1064 | ||
1061 | if ( mAddressee.formattedName().isEmpty() ) { | 1065 | if ( mAddressee.formattedName().isEmpty() ) { |
1062 | //US KConfig config( "kaddressbookrc" ); | 1066 | //US KConfig config( "kaddressbookrc" ); |
1063 | KConfig config( locateLocal("config", "kabcrc") ); | 1067 | KConfig config( locateLocal("config", "kabcrc") ); |
1064 | config.setGroup( "General" ); | 1068 | config.setGroup( "General" ); |
1065 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); | 1069 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); |
1066 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 1070 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
1067 | } else {; | 1071 | } else {; |
1068 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) | 1072 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) |
1069 | mFormattedNameType = NameEditDialog::SimpleName; | 1073 | mFormattedNameType = NameEditDialog::SimpleName; |
1070 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) | 1074 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) |
1071 | mFormattedNameType = NameEditDialog::FullName; | 1075 | mFormattedNameType = NameEditDialog::FullName; |
1072 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) | 1076 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) |
1073 | mFormattedNameType = NameEditDialog::ReverseName; | 1077 | mFormattedNameType = NameEditDialog::ReverseName; |
1074 | else | 1078 | else |
1075 | mFormattedNameType = NameEditDialog::CustomName; | 1079 | mFormattedNameType = NameEditDialog::CustomName; |
1076 | } | 1080 | } |
1077 | 1081 | ||
1078 | mFormattedNameLabel->setText( mAddressee.formattedName() ); | 1082 | mFormattedNameLabel->setText( mAddressee.formattedName() ); |
1079 | 1083 | ||
1080 | mAConfig->setUid( mAddressee.uid() ); | 1084 | mAConfig->setUid( mAddressee.uid() ); |
1081 | if ( mAConfig->automaticNameParsing() ) { | 1085 | if ( mAConfig->automaticNameParsing() ) { |
1082 | mNameLabel->hide(); | 1086 | mNameLabel->hide(); |
1083 | mNameEdit->show(); | 1087 | mNameEdit->show(); |
1084 | } else { | 1088 | } else { |
1085 | mNameEdit->hide(); | 1089 | mNameEdit->hide(); |
1086 | mNameLabel->setText( mNameEdit->text() ); | 1090 | mNameLabel->setText( mNameEdit->text() ); |
1087 | mNameLabel->show(); | 1091 | mNameLabel->show(); |
1088 | } | 1092 | } |
1089 | 1093 | ||
1090 | mRoleEdit->setText( mAddressee.role() ); | 1094 | mRoleEdit->setText( mAddressee.role() ); |
1091 | mOrgEdit->setText( mAddressee.organization() ); | 1095 | mOrgEdit->setText( mAddressee.organization() ); |
1092 | 1096 | ||
1093 | //US mURLEdit->setURL( mAddressee.url().url() ); | 1097 | //US mURLEdit->setURL( mAddressee.url().url() ); |
1094 | mURLEdit->setText( mAddressee.url().prettyURL() ); | 1098 | mURLEdit->setText( mAddressee.url().prettyURL() ); |
1095 | //US?? mURLEdit->home( false ); | 1099 | //US?? mURLEdit->home( false ); |
1096 | 1100 | ||
1097 | // mNoteEdit->setText( mAddressee.note() ); | 1101 | // mNoteEdit->setText( mAddressee.note() ); |
1098 | mNoteEdit->setText( mAddressee.note() ); | 1102 | mNoteEdit->setText( mAddressee.note() ); |
1099 | mEmailWidget->setEmails( mAddressee.emails() ); | 1103 | mEmailWidget->setEmails( mAddressee.emails() ); |
1100 | mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); | 1104 | mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); |
1101 | mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); | 1105 | mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); |
1102 | mBirthdayPicker->setDate( mAddressee.birthday().date() ); | 1106 | mBirthdayPicker->setDate( mAddressee.birthday().date() ); |
1103 | 1107 | ||
1104 | //US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( | 1108 | //US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( |
@@ -1337,99 +1341,99 @@ void AddresseeEditorWidget::nameButtonClicked() | |||
1337 | mAddressee.setFormattedName( dialog.customFormattedName() ); | 1341 | mAddressee.setFormattedName( dialog.customFormattedName() ); |
1338 | } | 1342 | } |
1339 | // Update the name edit. | 1343 | // Update the name edit. |
1340 | bool block = mNameEdit->signalsBlocked(); | 1344 | bool block = mNameEdit->signalsBlocked(); |
1341 | mNameEdit->blockSignals( true ); | 1345 | mNameEdit->blockSignals( true ); |
1342 | mNameEdit->setText( mAddressee.assembledName() ); | 1346 | mNameEdit->setText( mAddressee.assembledName() ); |
1343 | mNameEdit->blockSignals( block ); | 1347 | mNameEdit->blockSignals( block ); |
1344 | 1348 | ||
1345 | // Update the combo box. | 1349 | // Update the combo box. |
1346 | nameBoxChanged(); | 1350 | nameBoxChanged(); |
1347 | 1351 | ||
1348 | emitModified(); | 1352 | emitModified(); |
1349 | } | 1353 | } |
1350 | } | 1354 | } |
1351 | } | 1355 | } |
1352 | 1356 | ||
1353 | void AddresseeEditorWidget::categoryButtonClicked() | 1357 | void AddresseeEditorWidget::categoryButtonClicked() |
1354 | { | 1358 | { |
1355 | // Show the category dialog | 1359 | // Show the category dialog |
1356 | if ( mCategoryDialog == 0 ) { | 1360 | if ( mCategoryDialog == 0 ) { |
1357 | mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); | 1361 | mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); |
1358 | connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), | 1362 | connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), |
1359 | SLOT(categoriesSelected( const QStringList& ) ) ); | 1363 | SLOT(categoriesSelected( const QStringList& ) ) ); |
1360 | connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); | 1364 | connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); |
1361 | } | 1365 | } |
1362 | 1366 | ||
1363 | mCategoryDialog->setCategories(); | 1367 | mCategoryDialog->setCategories(); |
1364 | mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); | 1368 | mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); |
1365 | mCategoryDialog->show(); | 1369 | mCategoryDialog->show(); |
1366 | mCategoryDialog->raise(); | 1370 | mCategoryDialog->raise(); |
1367 | } | 1371 | } |
1368 | 1372 | ||
1369 | void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) | 1373 | void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) |
1370 | { | 1374 | { |
1371 | mCategoryEdit->setText( list.join( "," ) ); | 1375 | mCategoryEdit->setText( list.join( "," ) ); |
1372 | } | 1376 | } |
1373 | 1377 | ||
1374 | void AddresseeEditorWidget::editCategories() | 1378 | void AddresseeEditorWidget::editCategories() |
1375 | { | 1379 | { |
1376 | if ( mCategoryEditDialog == 0 ) { | 1380 | if ( mCategoryEditDialog == 0 ) { |
1377 | mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); | 1381 | mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); |
1378 | connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), | 1382 | connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), |
1379 | SLOT( categoryButtonClicked() ) ); | 1383 | SLOT( categoryButtonClicked() ) ); |
1380 | } | 1384 | } |
1381 | 1385 | ||
1382 | mCategoryEditDialog->show(); | 1386 | mCategoryEditDialog->show(); |
1383 | mCategoryEditDialog->raise(); | 1387 | mCategoryEditDialog->raise(); |
1384 | } | 1388 | } |
1385 | 1389 | ||
1386 | void AddresseeEditorWidget::emitModified() | 1390 | void AddresseeEditorWidget::emitModified() |
1387 | { | 1391 | { |
1388 | mDirty = true; | 1392 | mDirty = true; |
1389 | 1393 | ||
1390 | KABC::Addressee::List list; | 1394 | KABC::Addressee::List list; |
1391 | 1395 | ||
1392 | if ( mIsExtension && !mBlockSignals ) { | 1396 | if ( mIsExtension && !mBlockSignals ) { |
1393 | save(); | 1397 | save(); |
1394 | list.append( mAddressee ); | 1398 | list.append( mAddressee ); |
1395 | } | 1399 | } |
1396 | 1400 | ||
1397 | emit modified( list ); | 1401 | emit modified( list ); |
1398 | } | 1402 | } |
1399 | 1403 | ||
1400 | void AddresseeEditorWidget::dateChanged( QDate ) | 1404 | void AddresseeEditorWidget::dateChanged( QDate ) |
1401 | { | 1405 | { |
1402 | emitModified(); | 1406 | emitModified(); |
1403 | } | 1407 | } |
1404 | 1408 | ||
1405 | //US invalid dates are handdled by the KDateEdit widget itself | 1409 | //US invalid dates are handdled by the KDateEdit widget itself |
1406 | void AddresseeEditorWidget::invalidDate() | 1410 | void AddresseeEditorWidget::invalidDate() |
1407 | { | 1411 | { |
1408 | KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); | 1412 | KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); |
1409 | } | 1413 | } |
1410 | 1414 | ||
1411 | 1415 | ||
1412 | void AddresseeEditorWidget::pageChanged( QWidget *wdg ) | 1416 | void AddresseeEditorWidget::pageChanged( QWidget *wdg ) |
1413 | { | 1417 | { |
1414 | #ifndef KAB_EMBEDDED | 1418 | #ifndef KAB_EMBEDDED |
1415 | if ( wdg ) | 1419 | if ( wdg ) |
1416 | KAcceleratorManager::manage( wdg ); | 1420 | KAcceleratorManager::manage( wdg ); |
1417 | #else //KAB_EMBEDDED | 1421 | #else //KAB_EMBEDDED |
1418 | //US | 1422 | //US |
1419 | #endif //KAB_EMBEDDED | 1423 | #endif //KAB_EMBEDDED |
1420 | 1424 | ||
1421 | } | 1425 | } |
1422 | 1426 | ||
1423 | QString AddresseeEditorWidget::title() const | 1427 | QString AddresseeEditorWidget::title() const |
1424 | { | 1428 | { |
1425 | return i18n( "Contact Editor" ); | 1429 | return i18n( "Contact Editor" ); |
1426 | } | 1430 | } |
1427 | 1431 | ||
1428 | QString AddresseeEditorWidget::identifier() const | 1432 | QString AddresseeEditorWidget::identifier() const |
1429 | { | 1433 | { |
1430 | return i18n( "contact_editor" ); | 1434 | return i18n( "contact_editor" ); |
1431 | } | 1435 | } |
1432 | 1436 | ||
1433 | #ifndef KAB_EMBEDDED | 1437 | #ifndef KAB_EMBEDDED_ |
1434 | #include "addresseeeditorwidget.moc" | 1438 | #include "moc_addresseeeditorwidget.cpp" |
1435 | #endif //KAB_EMBEDDED | 1439 | #endif //KAB_EMBEDDED |