Summary: | Saving a new contact group doesn't close dialog immediately | ||
---|---|---|---|
Product: | [Unmaintained] KAddressbook Mobile | Reporter: | Bjoern Ricks <bjoern.ricks> |
Component: | general | Assignee: | Ludwig Reiter <ludwig.reiter> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | aheinecke, andreas.holzammer |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Windows CE | ||
OS: | Microsoft Windows CE | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | screenshots |
Description
Bjoern Ricks
2011-01-18 16:06:09 UTC
Created attachment 56194 [details]
screenshots
(In reply to comment #1) > Created an attachment (id=56194) [details] > screenshots whoops wrong bug report. commit 629f2adb85b881d46af3531f9a51d10fd167dae4 branch master Author: Tobias Koenig <tokoe@kde.org> Date: Wed Jan 19 17:10:17 2011 +0100 Disable 'Save' buttons after click Since the ContactEditor and ContactGroupEditor might need some time to finish saving, we should prevent the user from clicking save multiple times, otherwise the contact (group) is created multiple times as well. BUG: 263554 diff --git a/mobile/contacts/editorcontactgroup.cpp b/mobile/contacts/editorcontactgroup.cpp index cac0f4a..0f38c5c 100644 --- a/mobile/contacts/editorcontactgroup.cpp +++ b/mobile/contacts/editorcontactgroup.cpp @@ -110,6 +110,11 @@ class EditorContactGroup::Private mUi.launchAccountWizardButton->setVisible( !available ); } + void disableSaveButton() + { + mUi.saveButton->setEnabled( false ); + } + private: void addRows( int newRowCount ); }; @@ -227,6 +232,7 @@ EditorContactGroup::EditorContactGroup( QWidget *parent ) connect( d->mUi.addRecipientButton, SIGNAL( clicked() ), SLOT( addRecipientClicked() ) ); connect( d->mUi.cancelButton, SIGNAL( clicked() ), SIGNAL( cancelClicked() ) ); + connect( d->mUi.saveButton, SIGNAL( clicked() ), SLOT( disableSaveButton() ) ); // prevent double clicks connect( d->mUi.saveButton, SIGNAL( clicked() ), SIGNAL( saveClicked() ) ); connect( d->mUi.collectionSelector, SIGNAL( currentChanged( Akonadi::Collection ) ), SIGNAL( collectionChanged( Akonadi::Collection ) ) ); diff --git a/mobile/contacts/editorcontactgroup.h b/mobile/contacts/editorcontactgroup.h index 156d84f..b147ba3 100644 --- a/mobile/contacts/editorcontactgroup.h +++ b/mobile/contacts/editorcontactgroup.h @@ -67,6 +67,7 @@ class EditorContactGroup : public QWidget Q_PRIVATE_SLOT( d, void fetchResult( KJob* ) ) Q_PRIVATE_SLOT( d, void clearRecipientClicked() ) Q_PRIVATE_SLOT( d, void availableCollectionsChanged() ) + Q_PRIVATE_SLOT( d, void disableSaveButton() ) }; #endif diff --git a/mobile/contacts/editorgeneral.cpp b/mobile/contacts/editorgeneral.cpp index 99ff880..bfe3677 100644 --- a/mobile/contacts/editorgeneral.cpp +++ b/mobile/contacts/editorgeneral.cpp @@ -125,6 +125,11 @@ class EditorGeneral::Private mUi.launchAccountWizardButton->setVisible( !available ); } + void disableSaveButton() + { + mUi.saveButton->setEnabled( false ); + } + private: void addEmailRows( int newRowCount ); void addPhoneRows( int newRowCount ); @@ -341,6 +346,7 @@ EditorGeneral::EditorGeneral( QWidget *parent ) connect( d->mUi.addPhoneButton, SIGNAL( clicked() ), SLOT( addPhoneClicked() ) ); + connect( d->mUi.saveButton, SIGNAL( clicked() ), SLOT( disableSaveButton() ) ); // prevent double clicks connect( d->mUi.saveButton, SIGNAL( clicked() ), SIGNAL( saveClicked() ) ); connect( d->mUi.cancelButton, SIGNAL( clicked() ), SIGNAL( cancelClicked() ) ); connect( d->mUi.collectionSelector, SIGNAL( currentChanged( Akonadi::Collection ) ), diff --git a/mobile/contacts/editorgeneral.h b/mobile/contacts/editorgeneral.h index 781c057..c01c8a9 100644 --- a/mobile/contacts/editorgeneral.h +++ b/mobile/contacts/editorgeneral.h @@ -66,6 +66,7 @@ class EditorGeneral : public EditorBase Q_PRIVATE_SLOT( d, void clearEmailClicked() ) Q_PRIVATE_SLOT( d, void clearPhoneClicked() ) Q_PRIVATE_SLOT( d, void availableCollectionsChanged() ) + Q_PRIVATE_SLOT( d, void disableSaveButton() ) }; #endif |