summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt6
-rw-r--r--kaddressbook/kabcore.cpp20
-rw-r--r--kaddressbook/kabprefs.cpp1
-rw-r--r--kaddressbook/kabprefs.h1
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp6
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h1
7 files changed, 36 insertions, 2 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 59ef12f..2e5cf50 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -6,4 +6,7 @@ KO/Pi:
Fixed a problem displaying very long allday events in agenda view in single day mode.
+KA/Pi:
+Added a config option to turn on asking before a contact is deleted.
+
********** VERSION 2.2.0 ************
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index e874b85..f369169 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -809,4 +809,10 @@
{ "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" },
{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
+{ "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" },
+{ "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
{ "","" },
{ "","" },
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d5de9cb..b9830b1 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1029,5 +1029,21 @@ void KABCore::deleteContacts()
void KABCore::deleteContacts( const QStringList &uids )
{
+
if ( uids.count() > 0 ) {
+
+ if ( KABPrefs::instance()->mAskForDelete ) {
+ int count = uids.count();
+ if ( count > 5 ) count = 5;
+ QString cNames;
+ int i;
+ for ( i = 0; i < count ; ++i ) {
+ cNames += KGlobal::formatMessage( mAddressBook->findByUid( uids[i] ).realName() ,0) + "\n";
+ }
+ if ( uids.count() > 5 )
+ cNames += i18n("...and %1 more\ncontact(s) selected").arg( uids.count() - 5 );
+ QString text = i18n( "Do you really\nwant to delete the\nsetected contact(s)?\n\n" ) + cNames ;
+ if ( KMessageBox::questionYesNo( this, text ) != KMessageBox::Yes )
+ return;
+ }
PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids );
UndoStack::instance()->push( command );
@@ -1099,5 +1115,5 @@ void KABCore::setWhoAmI()
QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) );
- if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes )
+ if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].realName() ) ) == KMessageBox::Yes )
static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] );
}
@@ -2667,5 +2683,5 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
realNameList.append((*it).realName());
preferredEmailList.append((*it).preferredEmail());
- assembledNameList.append((*it).assembledName());
+ assembledNameList.append((*it).realName());
uidList.append((*it).uid());
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index ea254b7..42d541b 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -57,4 +57,5 @@ KABPrefs::KABPrefs()
addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
#ifdef KAB_EMBEDDED
+ addItemBool("AskForDelete",&mAskForDelete,true);
addItemBool("AskForQuit",&mAskForQuit,true);
addItemBool("ToolBarHor",&mToolBarHor, true );
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 2bb173d..ddbc0c0 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -73,4 +73,5 @@ class KABPrefs : public KPimPrefs
bool mAutoSearchWithWildcard;
bool mHideSearchOnSwitch;
+ bool mAskForDelete;
QValueList<int> mExtensionsSplitter;
QValueList<int> mDetailsSplitter;
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 1b4652a..9e4db74 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -143,4 +143,7 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
boxLayout->addWidget( mMultipleViewsAtOnce );
+ mAskForDelete = new QCheckBox( i18n( "Ask before delete contact" ), vBox, "mdel" );
+ boxLayout->addWidget( mAskForDelete );
+
mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" );
boxLayout->addWidget( mAskForQuit );
@@ -186,4 +189,5 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
+ connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ),
SLOT( selectionChanged( QListViewItem* ) ) );
@@ -216,4 +220,5 @@ void KABConfigWidget::usrReadConfig()
mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce );
mAskForQuit->setChecked( prefs->mAskForQuit );
+ mAskForDelete->setChecked( prefs->mAskForDelete );
mAddresseeWidget->restoreSettings();
@@ -237,4 +242,5 @@ void KABConfigWidget::usrWriteConfig()
prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
prefs->mAskForQuit = mAskForQuit->isChecked();
+ prefs->mAskForDelete = mAskForDelete->isChecked();
mAddresseeWidget->saveSettings();
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index a172e97..f2a6b1b 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -70,4 +70,5 @@ class KABConfigWidget : public KPrefsWidget
QCheckBox *mAskForQuit;
QCheckBox *mMenuBarBox;
+ QCheckBox *mAskForDelete;
QPushButton *mConfigureButton;