-rw-r--r-- | kaddressbook/viewconfigurefieldspage.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/kaddressbook/viewconfigurefieldspage.cpp b/kaddressbook/viewconfigurefieldspage.cpp index 2c827eb..5daae1a 100644 --- a/kaddressbook/viewconfigurefieldspage.cpp +++ b/kaddressbook/viewconfigurefieldspage.cpp | |||
@@ -32,12 +32,13 @@ | |||
32 | 32 | ||
33 | #include <kiconloader.h> | 33 | #include <kiconloader.h> |
34 | #include <kdialog.h> | 34 | #include <kdialog.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | 36 | ||
37 | #include <qtoolbutton.h> | 37 | #include <qtoolbutton.h> |
38 | #include <qapplication.h> | ||
38 | #include <qlabel.h> | 39 | #include <qlabel.h> |
39 | #include <qlistbox.h> | 40 | #include <qlistbox.h> |
40 | #include <qlayout.h> | 41 | #include <qlayout.h> |
41 | 42 | ||
42 | #include "viewconfigurefieldspage.h" | 43 | #include "viewconfigurefieldspage.h" |
43 | 44 | ||
@@ -216,51 +217,56 @@ void ViewConfigureFieldsPage::initGUI() | |||
216 | bool orientation = 1; | 217 | bool orientation = 1; |
217 | 218 | ||
218 | 219 | ||
219 | setCaption( i18n("Select Fields to Display") ); | 220 | setCaption( i18n("Select Fields to Display") ); |
220 | 221 | ||
221 | QGridLayout *gl = 0; | 222 | QGridLayout *gl = 0; |
222 | |||
223 | if (orientation == 0) | 223 | if (orientation == 0) |
224 | gl = new QGridLayout( this , 6, 4, 0, KDialog::spacingHint() ); | 224 | gl = new QGridLayout( this , 6, 4, 0, KDialog::spacingHint() ); |
225 | else | 225 | else |
226 | gl = new QGridLayout( this , 4, 6, 0, KDialog::spacingHint() ); | 226 | gl = new QGridLayout( this , 4, 6, 0, KDialog::spacingHint() ); |
227 | 227 | ||
228 | #ifndef KAB_EMBEDDED | 228 | #ifndef KAB_EMBEDDED |
229 | mCategoryCombo = new KComboBox( false, this ); | 229 | mCategoryCombo = new KComboBox( false, this ); |
230 | #else //KAB_EMBEDDED | 230 | #else //KAB_EMBEDDED |
231 | mCategoryCombo = new QComboBox( false, this ); | 231 | mCategoryCombo = new QComboBox( false, this ); |
232 | #endif //KAB_EMBEDDED | 232 | #endif //KAB_EMBEDDED |
233 | 233 | if ( QApplication::desktop()->width() < 320 ) | |
234 | mCategoryCombo->setMaximumWidth( 70 ); | ||
234 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::All ) ); | 235 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::All ) ); |
235 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Frequent ) ); | 236 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Frequent ) ); |
236 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Address ) ); | 237 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Address ) ); |
237 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Email ) ); | 238 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Email ) ); |
238 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Personal ) ); | 239 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Personal ) ); |
239 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Organization ) ); | 240 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::Organization ) ); |
240 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::CustomCategory ) ); | 241 | mCategoryCombo->insertItem( KABC::Field::categoryLabel( KABC::Field::CustomCategory ) ); |
241 | connect( mCategoryCombo, SIGNAL( activated(int) ), SLOT( slotShowFields(int) ) ); | 242 | connect( mCategoryCombo, SIGNAL( activated(int) ), SLOT( slotShowFields(int) ) ); |
242 | gl->addWidget( mCategoryCombo, 0, 0 ); | 243 | gl->addWidget( mCategoryCombo, 0, 0 ); |
243 | 244 | ||
244 | QLabel *label = new QLabel( i18n( "&Selected fields:" ), this ); | 245 | QLabel *label = new QLabel( i18n( "&Selected\nfields:" ), this ); |
245 | if (orientation == 0) | 246 | if (orientation == 0) |
246 | gl->addWidget( label, 0, 2 ); | 247 | gl->addWidget( label, 0, 2 ); |
247 | else | 248 | else |
248 | gl->addWidget( label, 2, 0 ); | 249 | gl->addWidget( label, 2, 0 ); |
249 | 250 | ||
250 | 251 | ||
251 | mUnSelectedBox = new QListBox( this ); | 252 | mUnSelectedBox = new QListBox( this ); |
252 | mUnSelectedBox->setSelectionMode( QListBox::Extended ); | 253 | mUnSelectedBox->setSelectionMode( QListBox::Extended ); |
253 | mUnSelectedBox->setMinimumHeight( 100 ); | 254 | mUnSelectedBox->setMinimumHeight( 80 ); |
254 | if (orientation == 0) | 255 | if (orientation == 0) |
255 | gl->addWidget( mUnSelectedBox, 1, 0 ); | 256 | gl->addWidget( mUnSelectedBox, 1, 0 ); |
256 | else | 257 | else |
257 | gl->addWidget( mUnSelectedBox, 0, 1 ); | 258 | gl->addWidget( mUnSelectedBox, 0, 1 ); |
258 | 259 | ||
259 | mSelectedBox = new QListBox( this ); | 260 | mSelectedBox = new QListBox( this ); |
261 | //if ( QApplication::desktop()->width() < 320 ) { | ||
262 | // mUnSelectedBox->setMaximumWidth( 134 ); | ||
263 | // mSelectedBox->setMaximumWidth( 134 ); | ||
264 | //} | ||
260 | mSelectedBox->setSelectionMode( QListBox::Extended ); | 265 | mSelectedBox->setSelectionMode( QListBox::Extended ); |
266 | mSelectedBox->setMinimumHeight( 80 ); | ||
261 | label->setBuddy( mSelectedBox ); | 267 | label->setBuddy( mSelectedBox ); |
262 | if (orientation == 0) | 268 | if (orientation == 0) |
263 | gl->addWidget( mSelectedBox, 1, 2 ); | 269 | gl->addWidget( mSelectedBox, 1, 2 ); |
264 | else | 270 | else |
265 | gl->addWidget( mSelectedBox, 2, 1 ); | 271 | gl->addWidget( mSelectedBox, 2, 1 ); |
266 | 272 | ||
@@ -322,16 +328,16 @@ void ViewConfigureFieldsPage::initGUI() | |||
322 | QSize sizeHint = mUnSelectedBox->sizeHint(); | 328 | QSize sizeHint = mUnSelectedBox->sizeHint(); |
323 | 329 | ||
324 | // make sure we fill the list with all items, so that we can | 330 | // make sure we fill the list with all items, so that we can |
325 | // get the maxItemWidth we need to not truncate the view | 331 | // get the maxItemWidth we need to not truncate the view |
326 | slotShowFields( 0 ); | 332 | slotShowFields( 0 ); |
327 | 333 | ||
328 | sizeHint = sizeHint.expandedTo( mSelectedBox->sizeHint() ); | 334 | //sizeHint = sizeHint.expandedTo( mSelectedBox->sizeHint() ); |
329 | sizeHint.setWidth( mUnSelectedBox->maxItemWidth() ); | 335 | //sizeHint.setWidth( mUnSelectedBox->maxItemWidth() ); |
330 | mUnSelectedBox->setMinimumSize( sizeHint ); | 336 | // mUnSelectedBox->setMinimumSize( sizeHint ); |
331 | mSelectedBox->setMinimumSize( sizeHint ); | 337 | //mSelectedBox->setMinimumSize( sizeHint ); |
332 | 338 | ||
333 | gl->activate(); | 339 | gl->activate(); |
334 | 340 | ||
335 | connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); | 341 | connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); |
336 | connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); | 342 | connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); |
337 | connect( mSelectedBox, SIGNAL( currentChanged( QListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); | 343 | connect( mSelectedBox, SIGNAL( currentChanged( QListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); |