Diffstat (limited to 'kaddressbook/emaileditwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kaddressbook/emaileditwidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kaddressbook/emaileditwidget.cpp b/kaddressbook/emaileditwidget.cpp index 0e01b02..e72face 100644 --- a/kaddressbook/emaileditwidget.cpp +++ b/kaddressbook/emaileditwidget.cpp | |||
@@ -168,84 +168,86 @@ EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent, | |||
168 | 168 | ||
169 | mRemoveButton = new QPushButton( i18n( "Remove" ), page ); | 169 | mRemoveButton = new QPushButton( i18n( "Remove" ), page ); |
170 | connect( mRemoveButton, SIGNAL( clicked() ), SLOT( remove() ) ); | 170 | connect( mRemoveButton, SIGNAL( clicked() ), SLOT( remove() ) ); |
171 | topLayout->addWidget( mRemoveButton, 2, 2 ); | 171 | topLayout->addWidget( mRemoveButton, 2, 2 ); |
172 | 172 | ||
173 | mStandardButton = new QPushButton( i18n( "Set Standard" ), page ); | 173 | mStandardButton = new QPushButton( i18n( "Set Standard" ), page ); |
174 | connect( mStandardButton, SIGNAL( clicked() ), SLOT( standard() ) ); | 174 | connect( mStandardButton, SIGNAL( clicked() ), SLOT( standard() ) ); |
175 | topLayout->addWidget( mStandardButton, 3, 2 ); | 175 | topLayout->addWidget( mStandardButton, 3, 2 ); |
176 | 176 | ||
177 | topLayout->activate(); | 177 | topLayout->activate(); |
178 | QStringList items = list; | 178 | QStringList items = list; |
179 | 179 | ||
180 | qDebug("EmailEditDialog::EmailEditDialog has to be changed (lowPrio)"); | 180 | qDebug("EmailEditDialog::EmailEditDialog has to be changed (lowPrio)"); |
181 | //US must be fixed !!! | 181 | //US must be fixed !!! |
182 | /* | 182 | /* |
183 | if ( items.remove( "" ) > 0 ) | 183 | if ( items.remove( "" ) > 0 ) |
184 | mChanged = true; | 184 | mChanged = true; |
185 | else | 185 | else |
186 | mChanged = false; | 186 | mChanged = false; |
187 | */ | 187 | */ |
188 | 188 | ||
189 | mEmailListBox->insertStringList( items ); | 189 | mEmailListBox->insertStringList( items ); |
190 | // set default state | 190 | // set default state |
191 | selectionChanged( -1 ); | 191 | selectionChanged( -1 ); |
192 | mEmailEdit->setFocus(); | ||
192 | 193 | ||
193 | #ifndef KAB_EMBEDDED | 194 | #ifndef KAB_EMBEDDED |
194 | KAcceleratorManager::manage( this ); | 195 | KAcceleratorManager::manage( this ); |
195 | #else //KAB_EMBEDDED | 196 | #else //KAB_EMBEDDED |
196 | //US qDebug("EmailEditDialog::EmailEditDialog has to be changed"); | 197 | //US qDebug("EmailEditDialog::EmailEditDialog has to be changed"); |
197 | #endif //KAB_EMBEDDED | 198 | #endif //KAB_EMBEDDED |
198 | 199 | ||
199 | } | 200 | } |
200 | 201 | ||
201 | EmailEditDialog::~EmailEditDialog() | 202 | EmailEditDialog::~EmailEditDialog() |
202 | { | 203 | { |
203 | } | 204 | } |
204 | 205 | ||
205 | QStringList EmailEditDialog::emails() const | 206 | QStringList EmailEditDialog::emails() const |
206 | { | 207 | { |
207 | QStringList emails; | 208 | QStringList emails; |
208 | 209 | ||
209 | for ( uint i = 0; i < mEmailListBox->count(); ++i ) | 210 | for ( uint i = 0; i < mEmailListBox->count(); ++i ) |
210 | emails << mEmailListBox->text( i ); | 211 | emails << mEmailListBox->text( i ); |
211 | 212 | ||
212 | return emails; | 213 | return emails; |
213 | } | 214 | } |
214 | 215 | ||
215 | void EmailEditDialog::add() | 216 | void EmailEditDialog::add() |
216 | { | 217 | { |
217 | mEmailListBox->insertItem( mEmailEdit->text() ); | 218 | mEmailListBox->insertItem( mEmailEdit->text() ); |
218 | 219 | ||
219 | mEmailEdit->clear(); | 220 | mEmailEdit->clear(); |
220 | mEmailEdit->setFocus(); | 221 | mEmailEdit->setFocus(); |
221 | 222 | ||
222 | mChanged = true; | 223 | mChanged = true; |
223 | } | 224 | } |
224 | 225 | ||
225 | void EmailEditDialog::edit() | 226 | void EmailEditDialog::edit() |
226 | { | 227 | { |
227 | mEmailEdit->setText( mEmailListBox->currentText() ); | 228 | mEmailEdit->setText( mEmailListBox->currentText() ); |
229 | mEmailListBox->removeItem( mEmailListBox->currentItem() ); | ||
228 | mEmailEdit->setFocus(); | 230 | mEmailEdit->setFocus(); |
229 | } | 231 | } |
230 | 232 | ||
231 | void EmailEditDialog::remove() | 233 | void EmailEditDialog::remove() |
232 | { | 234 | { |
233 | QString address = mEmailListBox->currentText(); | 235 | QString address = mEmailListBox->currentText(); |
234 | 236 | ||
235 | QString text = i18n( "<qt>Are you sure that you want to remove the email address <b>%1</b>?</qt>" ).arg( address ); | 237 | QString text = i18n( "<qt>Are you sure that you want to remove the email address <b>%1</b>?</qt>" ).arg( address ); |
236 | QString caption = i18n( "Confirm Remove" ); | 238 | QString caption = i18n( "Confirm Remove" ); |
237 | 239 | ||
238 | if ( KMessageBox::questionYesNo( this, text, caption ) == KMessageBox::Yes ) { | 240 | if ( KMessageBox::questionYesNo( this, text, caption ) == KMessageBox::Yes ) { |
239 | mEmailListBox->removeItem( mEmailListBox->currentItem() ); | 241 | mEmailListBox->removeItem( mEmailListBox->currentItem() ); |
240 | mChanged = true; | 242 | mChanged = true; |
241 | } | 243 | } |
242 | } | 244 | } |
243 | 245 | ||
244 | bool EmailEditDialog::changed() const | 246 | bool EmailEditDialog::changed() const |
245 | { | 247 | { |
246 | return mChanged; | 248 | return mChanged; |
247 | } | 249 | } |
248 | 250 | ||
249 | void EmailEditDialog::standard() | 251 | void EmailEditDialog::standard() |
250 | { | 252 | { |
251 | QString text = mEmailListBox->currentText(); | 253 | QString text = mEmailListBox->currentText(); |