Diffstat (limited to 'kaddressbook/kcmconfigs/addresseewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kcmconfigs/addresseewidget.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp index 0f3c353..f84b2ba 100644 --- a/kaddressbook/kcmconfigs/addresseewidget.cpp +++ b/kaddressbook/kcmconfigs/addresseewidget.cpp | |||
@@ -37,49 +37,49 @@ | |||
37 | #include <kstandarddirs.h> | 37 | #include <kstandarddirs.h> |
38 | 38 | ||
39 | #include "addresseewidget.h" | 39 | #include "addresseewidget.h" |
40 | 40 | ||
41 | NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, | 41 | NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, |
42 | const char *name ) | 42 | const char *name ) |
43 | : QWidget( parent, name ) | 43 | : QWidget( parent, name ) |
44 | { | 44 | { |
45 | if (KGlobal::getOrientation() == KGlobal::Portrait) | 45 | if (KGlobal::getOrientation() == KGlobal::Portrait) |
46 | { | 46 | { |
47 | QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), | 47 | QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), |
48 | KDialog::spacingHintSmall() ); | 48 | KDialog::spacingHintSmall() ); |
49 | 49 | ||
50 | QLabel *label = new QLabel( i18n( title ), this ); | 50 | QLabel *label = new QLabel( i18n( title ), this ); |
51 | layout->addWidget( label, 0, 1 ); | 51 | layout->addWidget( label, 0, 1 ); |
52 | 52 | ||
53 | mBox = new QListBox( this ); | 53 | mBox = new QListBox( this ); |
54 | mBox->setMaximumSize(70, 70); | 54 | mBox->setMaximumSize(70, 70); |
55 | layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); | 55 | layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); |
56 | 56 | ||
57 | KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); | 57 | KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); |
58 | mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); | 58 | mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); |
59 | mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); | 59 | mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); |
60 | bbox->layout(); | 60 | bbox->layout(); |
61 | layout->addMultiCellWidget( bbox, 0, 2, 2,2); | 61 | layout->addMultiCellWidget( bbox, 0, 1, 2,2); |
62 | 62 | ||
63 | mEdit = new KLineEdit( this ); | 63 | mEdit = new KLineEdit( this ); |
64 | layout->addWidget( mEdit, 1, 1 ); | 64 | layout->addWidget( mEdit, 1, 1 ); |
65 | //mEdit->setMinimumWidth(50); | 65 | //mEdit->setMinimumWidth(50); |
66 | 66 | ||
67 | // layout->addWidget( group ); | 67 | // layout->addWidget( group ); |
68 | 68 | ||
69 | } | 69 | } |
70 | else | 70 | else |
71 | { | 71 | { |
72 | QHBoxLayout *layout = new QHBoxLayout( this ); | 72 | QHBoxLayout *layout = new QHBoxLayout( this ); |
73 | 73 | ||
74 | QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); | 74 | QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); |
75 | QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, | 75 | QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, |
76 | KDialog::spacingHint() ); | 76 | KDialog::spacingHint() ); |
77 | 77 | ||
78 | mBox = new QListBox( group ); | 78 | mBox = new QListBox( group ); |
79 | 79 | ||
80 | groupLayout->addWidget( mBox, 0, 0 ); | 80 | groupLayout->addWidget( mBox, 0, 0 ); |
81 | 81 | ||
82 | KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); | 82 | KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); |
83 | mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); | 83 | mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); |
84 | mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) ); | 84 | mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) ); |
85 | bbox->layout(); | 85 | bbox->layout(); |
@@ -140,60 +140,66 @@ void NamePartWidget::remove() | |||
140 | selectionChanged( 0 ); | 140 | selectionChanged( 0 ); |
141 | 141 | ||
142 | emit modified(); | 142 | emit modified(); |
143 | } | 143 | } |
144 | 144 | ||
145 | void NamePartWidget::selectionChanged( QListBoxItem *item ) | 145 | void NamePartWidget::selectionChanged( QListBoxItem *item ) |
146 | { | 146 | { |
147 | mRemoveButton->setEnabled( item != 0 ); | 147 | mRemoveButton->setEnabled( item != 0 ); |
148 | } | 148 | } |
149 | 149 | ||
150 | void NamePartWidget::textChanged( const QString& text ) | 150 | void NamePartWidget::textChanged( const QString& text ) |
151 | { | 151 | { |
152 | mAddButton->setEnabled( !text.isEmpty() ); | 152 | mAddButton->setEnabled( !text.isEmpty() ); |
153 | } | 153 | } |
154 | 154 | ||
155 | 155 | ||
156 | AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) | 156 | AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) |
157 | : QWidget( parent, name ) | 157 | : QWidget( parent, name ) |
158 | { | 158 | { |
159 | QGridLayout *layout; | 159 | QGridLayout *layout; |
160 | 160 | ||
161 | mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); | 161 | mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); |
162 | mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); | 162 | mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); |
163 | mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); | 163 | mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); |
164 | QLabel *label = new QLabel( i18n( "Default formatted name:" ), this ); | 164 | QString dfn; |
165 | if (QApplication::desktop()->width() > 320 ) | ||
166 | dfn = i18n( "Default formatted name:" ); | ||
167 | else | ||
168 | dfn = i18n( "Def. formatted name:" ); | ||
169 | |||
170 | QLabel *label = new QLabel( dfn, this ); | ||
165 | 171 | ||
166 | mFormattedNameCombo = new KComboBox( this ); | 172 | mFormattedNameCombo = new KComboBox( this ); |
167 | mFormattedNameCombo->insertItem( i18n( "Empty" ) ); | 173 | mFormattedNameCombo->insertItem( i18n( "Empty" ) ); |
168 | mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); | 174 | mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); |
169 | mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); | 175 | mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); |
170 | mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); | 176 | mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); |
171 | 177 | ||
172 | if (KGlobal::getOrientation() == KGlobal::Portrait) | 178 | if (KGlobal::getOrientation() == KGlobal::Portrait) |
173 | { | 179 | { |
174 | layout = new QGridLayout( this, 4, 2, KDialog::marginHint(), | 180 | layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), |
175 | KDialog::spacingHint() ); | 181 | KDialog::spacingHintSmall() ); |
176 | 182 | ||
177 | layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); | 183 | layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); |
178 | layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); | 184 | layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); |
179 | layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); | 185 | layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); |
180 | layout->addWidget( label, 3, 0 ); | 186 | layout->addWidget( label, 3, 0 ); |
181 | layout->addWidget( mFormattedNameCombo, 3, 1 ); | 187 | layout->addWidget( mFormattedNameCombo, 3, 1 ); |
182 | 188 | ||
183 | } | 189 | } |
184 | else | 190 | else |
185 | { | 191 | { |
186 | layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), | 192 | layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), |
187 | KDialog::spacingHint() ); | 193 | KDialog::spacingHint() ); |
188 | 194 | ||
189 | layout->addWidget( mPrefix, 0, 0 ); | 195 | layout->addWidget( mPrefix, 0, 0 ); |
190 | layout->addWidget( mInclusion, 0, 1 ); | 196 | layout->addWidget( mInclusion, 0, 1 ); |
191 | layout->addWidget( mSuffix, 0, 2 ); | 197 | layout->addWidget( mSuffix, 0, 2 ); |
192 | layout->addWidget( label, 1, 0 ); | 198 | layout->addWidget( label, 1, 0 ); |
193 | layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); | 199 | layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); |
194 | } | 200 | } |
195 | 201 | ||
196 | connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); | 202 | connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); |
197 | connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); | 203 | connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); |
198 | connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); | 204 | connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); |
199 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) ); | 205 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) ); |