summaryrefslogtreecommitdiffabout
path: root/kaddressbook/addresseeeditorwidget.cpp
Unidiff
Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 966efa5..c4083a9 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -151,25 +151,25 @@ void AddresseeEditorWidget::initGUI()
151void AddresseeEditorWidget::setupTab1() 151void AddresseeEditorWidget::setupTab1()
152{ 152{
153 // This is the General tab 153 // This is the General tab
154 QWidget *tab1 = new QWidget( mTabWidget ); 154 QWidget *tab1 = new QWidget( mTabWidget );
155 155
156//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); 156//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 );
157 bool horLayout = false; 157 bool horLayout = false;
158 int maxCol = 1; 158 int maxCol = 1;
159 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { 159 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) {
160 horLayout = true; 160 horLayout = true;
161 maxCol = 3; 161 maxCol = 3;
162 } 162 }
163 QGridLayout *layout = new QGridLayout( tab1, 8-maxCol, maxCol ); 163 QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol );
164 164
165 layout->setMargin( KDialogBase::marginHintSmall() ); 165 layout->setMargin( KDialogBase::marginHintSmall() );
166 layout->setSpacing( KDialogBase::spacingHintSmall() ); 166 layout->setSpacing( KDialogBase::spacingHintSmall() );
167 167
168 QLabel *label; 168 QLabel *label;
169 KSeparator* bar; 169 KSeparator* bar;
170 QPushButton *button; 170 QPushButton *button;
171 171
172 ////////////////////////////////// 172 //////////////////////////////////
173 // Upper left group (person info) 173 // Upper left group (person info)
174 174
175 // Person icon 175 // Person icon
@@ -193,50 +193,55 @@ void AddresseeEditorWidget::setupTab1()
193 193
194 layout->addWidget( button, 0, 0 ); 194 layout->addWidget( button, 0, 0 );
195 layout->addWidget( mNameEdit, 0, 1 ); 195 layout->addWidget( mNameEdit, 0, 1 );
196 layout->addWidget( mNameLabel, 0, 1 ); 196 layout->addWidget( mNameLabel, 0, 1 );
197 197
198 button = new QPushButton( i18n( "Role:" ), tab1 ); 198 button = new QPushButton( i18n( "Role:" ), tab1 );
199 connect( button, SIGNAL( clicked() ), SLOT( setRole2FN() ) ); 199 connect( button, SIGNAL( clicked() ), SLOT( setRole2FN() ) );
200 //label = new QLabel( i18n( "Role:" ), tab1 ); 200 //label = new QLabel( i18n( "Role:" ), tab1 );
201 mRoleEdit = new KLineEdit( tab1 ); 201 mRoleEdit = new KLineEdit( tab1 );
202 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), 202 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ),
203 SLOT( textChanged( const QString& ) ) ); 203 SLOT( textChanged( const QString& ) ) );
204 //label->setBuddy( mRoleEdit ); 204 //label->setBuddy( mRoleEdit );
205 layout->addWidget( button, 1, 0 ); 205 if ( horLayout ) {
206 layout->addWidget( mRoleEdit, 1, 1 ); 206 layout->addWidget( button, 0, 2 );
207 207 layout->addWidget( mRoleEdit, 0, 3 );
208
209 } else {
210 layout->addWidget( button, 1, 0 );
211 layout->addWidget( mRoleEdit, 1, 1 );
212 }
208 // Organization 213 // Organization
209 button = new QPushButton( i18n( "Organization:" ), tab1 ); 214 button = new QPushButton( i18n( "Organization:" ), tab1 );
210 connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) ); 215 connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) );
211 //label = new QLabel( i18n( "Organization:" ), tab1 ); 216 //label = new QLabel( i18n( "Organization:" ), tab1 );
212 mOrgEdit = new KLineEdit( tab1 ); 217 mOrgEdit = new KLineEdit( tab1 );
213 //label->setBuddy( mOrgEdit ); 218 //label->setBuddy( mOrgEdit );
214 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), 219 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ),
215 SLOT( textChanged( const QString& ) ) ); 220 SLOT( textChanged( const QString& ) ) );
216 if ( horLayout ) { 221 if ( horLayout ) {
217 layout->addWidget( button, 1, 2 ); 222 layout->addWidget( button, 1, 2 );
218 layout->addWidget( mOrgEdit, 1, 3 ); 223 layout->addWidget( mOrgEdit, 1, 3 );
219 224
220 } else { 225 } else {
221 layout->addWidget( button, 2, 0 ); 226 layout->addWidget( button, 2, 0 );
222 layout->addWidget( mOrgEdit, 2, 1 ); 227 layout->addWidget( mOrgEdit, 2, 1 );
223 } 228 }
224 229
225 // File as (formatted name) 230 // File as (formatted name)
226 label = new QLabel( i18n( "Format.n.:" ), tab1 ); 231 label = new QLabel( i18n( "Format.n.:" ), tab1 );
227 mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); 232 mFormattedNameLabel = new KSqueezedTextLabel( tab1 );
228 if ( horLayout ) { 233 if ( horLayout ) {
229 layout->addWidget( label, 0,2 ); 234 layout->addWidget( label, 1,0 );
230 layout->addWidget( mFormattedNameLabel, 0, 3 ); 235 layout->addWidget( mFormattedNameLabel, 1, 1 );
231 } else { 236 } else {
232 layout->addWidget( label, 3, 0 ); 237 layout->addWidget( label, 3, 0 );
233 layout->addWidget( mFormattedNameLabel, 3, 1 ); 238 layout->addWidget( mFormattedNameLabel, 3, 1 );
234 } 239 }
235 /* LR 240 /* LR
236 // Left hand separator. This separator doesn't go all the way 241 // Left hand separator. This separator doesn't go all the way
237 // across so the dialog still flows from top to bottom 242 // across so the dialog still flows from top to bottom
238 bar = new KSeparator( KSeparator::HLine, tab1 ); 243 bar = new KSeparator( KSeparator::HLine, tab1 );
239 layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); 244 layout->addMultiCellWidget( bar, 4, 4, 0, 2 );
240 */ 245 */
241 ////////////////////////////////////// 246 //////////////////////////////////////
242 247
@@ -249,26 +254,26 @@ void AddresseeEditorWidget::setupTab1()
249//US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 254//US layout->addMultiCellWidget( label, 0, 1, 3, 3 );
250 layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 255 layout->addMultiCellWidget( label, 5, 6, 0, 0 );
251 */ 256 */
252 mPhoneEditWidget = new PhoneEditWidget( tab1 ); 257 mPhoneEditWidget = new PhoneEditWidget( tab1 );
253 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 258 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
254//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); 259//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 );
255 int iii; 260 int iii;
256#ifndef DESKTOP_VERSION 261#ifndef DESKTOP_VERSION
257 iii = 7; 262 iii = 7;
258#else 263#else
259 iii = 8; 264 iii = 8;
260#endif 265#endif
261 layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, maxCol ); 266 layout->addMultiCellWidget( mPhoneEditWidget, 5-maxCol, 5-maxCol+4, 0, maxCol );
262 ++iii; 267 iii = 6-maxCol+4;
263 /* LR 268 /* LR
264 bar = new KSeparator( KSeparator::HLine, tab1 ); 269 bar = new KSeparator( KSeparator::HLine, tab1 );
265//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); 270//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 );
266 layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); 271 layout->addMultiCellWidget( bar, 9, 9, 0, 2 );
267 */ 272 */
268/*US 273/*US
269 ////////////////////////////////////// 274 //////////////////////////////////////
270 // Addresses (lower left) 275 // Addresses (lower left)
271 label = new QLabel( tab1 ); 276 label = new QLabel( tab1 );
272//US loadIcon call is ambiguous. Add one more parameter 277//US loadIcon call is ambiguous. Add one more parameter
273//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); 278//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) );
274 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 279 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );