Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 310d628..9814cd5 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -149,17 +149,24 @@ void AddresseeEditorWidget::initGUI() | |||
149 | } | 149 | } |
150 | 150 | ||
151 | void AddresseeEditorWidget::setupTab1() | 151 | void 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 | QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); | 157 | bool horLayout = false; |
158 | int maxCol = 1; | ||
159 | if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { | ||
160 | horLayout = true; | ||
161 | maxCol = 3; | ||
162 | } | ||
163 | QGridLayout *layout = new QGridLayout( tab1, 8-maxCol, maxCol ); | ||
164 | |||
158 | layout->setMargin( KDialogBase::marginHintSmall() ); | 165 | layout->setMargin( KDialogBase::marginHintSmall() ); |
159 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 166 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
160 | 167 | ||
161 | QLabel *label; | 168 | QLabel *label; |
162 | KSeparator* bar; | 169 | KSeparator* bar; |
163 | QPushButton *button; | 170 | QPushButton *button; |
164 | 171 | ||
165 | ////////////////////////////////// | 172 | ////////////////////////////////// |
@@ -201,24 +208,35 @@ void AddresseeEditorWidget::setupTab1() | |||
201 | // Organization | 208 | // Organization |
202 | button = new QPushButton( i18n( "Organization:" ), tab1 ); | 209 | button = new QPushButton( i18n( "Organization:" ), tab1 ); |
203 | connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) ); | 210 | connect( button, SIGNAL( clicked() ), SLOT( setCompany2FN() ) ); |
204 | //label = new QLabel( i18n( "Organization:" ), tab1 ); | 211 | //label = new QLabel( i18n( "Organization:" ), tab1 ); |
205 | mOrgEdit = new KLineEdit( tab1 ); | 212 | mOrgEdit = new KLineEdit( tab1 ); |
206 | //label->setBuddy( mOrgEdit ); | 213 | //label->setBuddy( mOrgEdit ); |
207 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), | 214 | connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), |
208 | SLOT( textChanged( const QString& ) ) ); | 215 | SLOT( textChanged( const QString& ) ) ); |
209 | layout->addWidget( button, 2, 0 ); | 216 | if ( horLayout ) { |
210 | layout->addWidget( mOrgEdit, 2, 1 ); | 217 | layout->addWidget( button, 1, 2 ); |
218 | layout->addWidget( mOrgEdit, 1, 3 ); | ||
219 | |||
220 | } else { | ||
221 | layout->addWidget( button, 2, 0 ); | ||
222 | layout->addWidget( mOrgEdit, 2, 1 ); | ||
223 | } | ||
211 | 224 | ||
212 | // File as (formatted name) | 225 | // File as (formatted name) |
213 | label = new QLabel( i18n( "Formatted name:" ), tab1 ); | 226 | label = new QLabel( i18n( "Format.n.:" ), tab1 ); |
214 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); | 227 | mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); |
215 | layout->addWidget( label, 3, 0 ); | 228 | if ( horLayout ) { |
216 | layout->addWidget( mFormattedNameLabel, 3, 1 ); | 229 | layout->addWidget( label, 0,2 ); |
230 | layout->addWidget( mFormattedNameLabel, 0, 3 ); | ||
231 | } else { | ||
232 | layout->addWidget( label, 3, 0 ); | ||
233 | layout->addWidget( mFormattedNameLabel, 3, 1 ); | ||
234 | } | ||
217 | /* LR | 235 | /* LR |
218 | // Left hand separator. This separator doesn't go all the way | 236 | // Left hand separator. This separator doesn't go all the way |
219 | // across so the dialog still flows from top to bottom | 237 | // across so the dialog still flows from top to bottom |
220 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 238 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
221 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); | 239 | layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); |
222 | */ | 240 | */ |
223 | ////////////////////////////////////// | 241 | ////////////////////////////////////// |
224 | 242 | ||
@@ -235,17 +253,17 @@ void AddresseeEditorWidget::setupTab1() | |||
235 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); | 253 | connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); |
236 | //US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); | 254 | //US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); |
237 | int iii; | 255 | int iii; |
238 | #ifndef DESKTOP_VERSION | 256 | #ifndef DESKTOP_VERSION |
239 | iii = 7; | 257 | iii = 7; |
240 | #else | 258 | #else |
241 | iii = 8; | 259 | iii = 8; |
242 | #endif | 260 | #endif |
243 | layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 ); | 261 | layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, maxCol ); |
244 | ++iii; | 262 | ++iii; |
245 | /* LR | 263 | /* LR |
246 | bar = new KSeparator( KSeparator::HLine, tab1 ); | 264 | bar = new KSeparator( KSeparator::HLine, tab1 ); |
247 | //US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); | 265 | //US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); |
248 | layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); | 266 | layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); |
249 | */ | 267 | */ |
250 | /*US | 268 | /*US |
251 | ////////////////////////////////////// | 269 | ////////////////////////////////////// |
@@ -316,17 +334,17 @@ void AddresseeEditorWidget::setupTab1() | |||
316 | mCategoryEdit->setReadOnly( true ); | 334 | mCategoryEdit->setReadOnly( true ); |
317 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), | 335 | connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), |
318 | SLOT( textChanged( const QString& ) ) ); | 336 | SLOT( textChanged( const QString& ) ) ); |
319 | 337 | ||
320 | mSecrecyWidget = new SecrecyWidget( categoryBox ); | 338 | mSecrecyWidget = new SecrecyWidget( categoryBox ); |
321 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 339 | connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
322 | 340 | ||
323 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); | 341 | //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); |
324 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); | 342 | layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol ); |
325 | 343 | ||
326 | // Build the layout and add to the tab widget | 344 | // Build the layout and add to the tab widget |
327 | layout->activate(); // required | 345 | layout->activate(); // required |
328 | 346 | ||
329 | mTabWidget->addTab( tab1, i18n( "&General" ) ); | 347 | mTabWidget->addTab( tab1, i18n( "&General" ) ); |
330 | } | 348 | } |
331 | 349 | ||
332 | void AddresseeEditorWidget::setRole2FN() | 350 | void AddresseeEditorWidget::setRole2FN() |