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
@@ -1,24 +1,27 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.2.1 ************
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 ************
New stable release!
Fixed some minor usability problems.
Added writing of next alarm to a file for usage on pdaXrom.
*************************************
You can find the complete changelog
from version 1.7.7 to 2.2.0
in the source package or on
http://www.pi-sync.net/html/changelog.html
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
@@ -787,29 +787,35 @@
{ "Details","Details" },
{ "Search:","Suche:" },
{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
{ "Pi-Sync Error","Pi-Sync Fehler" },
{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
{ "Receiving file from remote...","Empfange entfernte Datei..." },
{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
{ "Writing back file ...","Schreibe Datei zurück..." },
{ "Sending back file ...","Sende Datei zurück..." },
{ "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" },
+{ "","" },
+{ "","" },
+{ "","" },
+{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" }, \ No newline at end of file
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d5de9cb..b9830b1 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1007,49 +1007,65 @@ void KABCore::beamDone( Ir *ir )
void KABCore::browse( const QString& url )
{
#ifndef KAB_EMBEDDED
kapp->invokeBrowser( url );
#else //KAB_EMBEDDED
qDebug("KABCore::browse must be fixed");
#endif //KAB_EMBEDDED
}
void KABCore::selectAllContacts()
{
mViewManager->setSelected( QString::null, true );
}
void KABCore::deleteContacts()
{
QStringList uidList = mViewManager->selectedUids();
deleteContacts( uidList );
}
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 );
RedoStack::instance()->clear();
// now if we deleted anything, refresh
setContactSelected( QString::null );
setModified( true );
}
}
void KABCore::copyContacts()
{
KABC::Addressee::List addrList = mViewManager->selectedAddressees();
QString clipText = AddresseeUtil::addresseesToClipboard( addrList );
kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl;
QClipboard *cb = QApplication::clipboard();
cb->setText( clipText );
}
void KABCore::cutContacts()
{
@@ -1077,49 +1093,49 @@ void KABCore::pasteContacts()
void KABCore::pasteContacts( KABC::Addressee::List &list )
{
KABC::Resource *resource = requestResource( this );
KABC::Addressee::List::Iterator it;
for ( it = list.begin(); it != list.end(); ++it )
(*it).setResource( resource );
PwPasteCommand *command = new PwPasteCommand( this, list );
UndoStack::instance()->push( command );
RedoStack::instance()->clear();
setModified( true );
}
void KABCore::setWhoAmI()
{
KABC::Addressee::List addrList = mViewManager->selectedAddressees();
if ( addrList.count() > 1 ) {
KMessageBox::sorry( this, i18n( "Please select only one contact." ) );
return;
}
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 ] );
}
void KABCore::editCategories()
{
KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true );
dlg.exec();
}
void KABCore::setCategories()
{
QStringList uids;
XXPortSelectDialog dlgx( this, false, this );
if ( dlgx.exec() )
uids = dlgx.uids();
else
return;
if ( uids.isEmpty() )
return;
// qDebug("count %d ", uids.count());
KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true );
if ( !dlg.exec() ) {
message( i18n("Setting categories cancelled") );
@@ -2645,49 +2661,49 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
QString formattedbday;
for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
{
if ( ! bar.isVisible() )
return;
bar.setProgress( count++ );
qApp->processEvents();
bday = (*it).birthday().date();
anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
if ( bday.isValid() || !anni.isEmpty())
{
if (bday.isValid())
formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
else
formattedbday = "NOTVALID";
if (anni.isEmpty())
anni = "INVALID";
birthdayList.append(formattedbday);
anniversaryList.append(anni); //should be ISODate
realNameList.append((*it).realName());
preferredEmailList.append((*it).preferredEmail());
- assembledNameList.append((*it).assembledName());
+ assembledNameList.append((*it).realName());
uidList.append((*it).uid());
//qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
}
}
bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
}
/* this method will be called through the QCop interface from other apps to show details of a contact.
*/
void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
{
//qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
QString foundUid = QString::null;
if ( ! uid.isEmpty() ) {
Addressee adrr = mAddressBook->findByUid( uid );
if ( !adrr.isEmpty() ) {
foundUid = uid;
}
if ( email == "sendbacklist" ) {
//qDebug("ssssssssssssssssssssssend ");
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index ea254b7..42d541b 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -35,48 +35,49 @@
#include <klocale.h>
#include <kstaticdeleter.h>
#include <kglobalsettings.h>
//US#include <kdebug.h> // defines kdDebug()
#include "kabprefs.h"
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#endif
KABPrefs *KABPrefs::sInstance = 0;
static KStaticDeleter<KABPrefs> staticDeleterAB;
KABPrefs::KABPrefs()
: KPimPrefs("kaddressbookrc")
{
KPrefs::setCurrentGroup( "Views" );
addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
KPrefs::setCurrentGroup( "General" );
addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
#ifdef KAB_EMBEDDED
+ addItemBool("AskForDelete",&mAskForDelete,true);
addItemBool("AskForQuit",&mAskForQuit,true);
addItemBool("ToolBarHor",&mToolBarHor, true );
addItemBool("ToolBarUp",&mToolBarUp, false );
addItemBool("SearchWithReturn",&mSearchWithReturn, false );
addItemBool("AutoSearchWithWildcard",&mAutoSearchWithWildcard, false );
addItemBool("HideSearchOnSwitch",&mHideSearchOnSwitch, false );
addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont());
#endif //KAB_EMBEDDED
KPrefs::setCurrentGroup( "MainWindow" );
bool m_visible = false;
#ifdef DESKTOP_VERSION
m_visible = true;
#endif
addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible );
addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
addItemIntList( "DetailsSplitter", &mDetailsSplitter );
addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 2bb173d..ddbc0c0 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -51,48 +51,49 @@ class KABPrefs : public KPimPrefs
bool mToolBarUp;
bool mAskForQuit;
/** Set preferences to default values */
// void usrSetDefaults();
/** Read preferences from config file */
// void usrReadConfig();
/** Write preferences to config file */
// void usrWriteConfig();
#endif //KAB_EMBEDDED
void usrReadConfig();
// GUI
bool mFullMenuBarVisible;
bool mJumpButtonBarVisible;
bool mDetailsPageVisible;
bool mMultipleViewsAtOnce;
bool mSearchWithReturn;
bool mAutoSearchWithWildcard;
bool mHideSearchOnSwitch;
+ bool mAskForDelete;
QValueList<int> mExtensionsSplitter;
QValueList<int> mDetailsSplitter;
// Extensions stuff
int mCurrentExtension;
QStringList mActiveExtensions;
// Views stuff
QString mCurrentView;
QStringList mViewNames;
// Filter
int mCurrentFilter;
void setCategoryDefaults();
QFont mDetailsFont;
private:
KABPrefs();
static KABPrefs *sInstance;
};
#endif
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
@@ -121,142 +121,148 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
boxLayout->setAlignment( Qt::AlignTop );
boxLayout->setMargin(KDialog::marginHintSmall() );
boxLayout->setSpacing( KDialog::spacingHintSmall() );
mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
boxLayout->addWidget( mMenuBarBox );
mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
boxLayout->addWidget( mSearchReturnBox );
mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" );
boxLayout->addWidget( mAutoSearchWithWildcardBox);
mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" );
boxLayout->addWidget( mHideSearchOnSwitchBox );
#ifdef DESKTOP_VERSION
mHideSearchOnSwitchBox->hide();
#endif
mViewsSingleClickBox = new QCheckBox( i18n( "Show edit dialog on single click" ), vBox, "msingle" );
boxLayout->addWidget( mViewsSingleClickBox );
mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new contacts" ), vBox, "mparse" );
boxLayout->addWidget( mNameParsing );
mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
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 );
layout->addWidget( vBox );
tabWidget->addTab( generalPage, i18n( "General" ) );
// Extension page
QWidget *extensionPage = new QWidget( this );
QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(),
KDialog::spacingHintSmall() );
//extensions groupbox
QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage );
boxLayout = new QVBoxLayout( groupBox->layout() );
boxLayout->setAlignment( Qt::AlignTop );
boxLayout->setMargin(KDialog::marginHintSmall());
boxLayout->setSpacing(KDialog::spacingHintSmall());
groupBox->layout()->setMargin(1) ;
groupBox->layout()->setSpacing(0);
mExtensionView = new KListView( groupBox );
mExtensionView->setAllColumnsShowFocus( true );
mExtensionView->addColumn( i18n( "Name" ) );
mExtensionView->addColumn( i18n( "Description" ) );
//mExtensionView->setMaximumHeight(80);
boxLayout->addWidget( mExtensionView );
mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox );
mConfigureButton->setEnabled( false );
boxLayout->addWidget( mConfigureButton );
extensionLayout->addWidget( groupBox );
connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
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* ) ) );
connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ),
SLOT( itemClicked( QListViewItem* ) ) );
connect( mConfigureButton, SIGNAL( clicked() ),
SLOT( configureExtension() ) );
tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
// Addressee page
mAddresseeWidget = new AddresseeWidget( this );
tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
}
void KABConfigWidget::usrReadConfig()
{
KABPrefs* prefs = KABPrefs::instance();
bool blocked = signalsBlocked();
blockSignals( true );
mMenuBarBox->setChecked( prefs->mFullMenuBarVisible);
mNameParsing->setChecked( prefs->mAutomaticNameParsing );
mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
mSearchReturnBox->setChecked( prefs->mSearchWithReturn );
mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard );
mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch );
mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce );
mAskForQuit->setChecked( prefs->mAskForQuit );
+ mAskForDelete->setChecked( prefs->mAskForDelete );
mAddresseeWidget->restoreSettings();
restoreExtensionSettings();
blockSignals( blocked );
}
void KABConfigWidget::usrWriteConfig()
{
KABPrefs* prefs = KABPrefs::instance();
prefs->mFullMenuBarVisible = mMenuBarBox->isChecked();
prefs->mAutomaticNameParsing = mNameParsing->isChecked();
prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
prefs->mSearchWithReturn = mSearchReturnBox->isChecked();
prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked();
prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked();
prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
prefs->mAskForQuit = mAskForQuit->isChecked();
+ prefs->mAskForDelete = mAskForDelete->isChecked();
mAddresseeWidget->saveSettings();
saveExtensionSettings();
}
void KABConfigWidget::restoreExtensionSettings()
{
QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
mExtensionView->clear();
#ifndef KAB_EMBEDDED
KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" );
KTrader::OfferList::ConstIterator it;
for ( it = plugins.begin(); it != plugins.end(); ++it ) {
if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) )
continue;
ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() );
item->setService( *it );
if ( activeExtensions.contains( item->factory()->identifier() ) )
item->setOn( true );
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
@@ -48,30 +48,31 @@ class KABConfigWidget : public KPrefsWidget
virtual void usrReadConfig();
/** Implement this to write custom configuration widgets. */
virtual void usrWriteConfig();
private slots:
void configureExtension();
void selectionChanged( QListViewItem* );
void itemClicked( QListViewItem* );
private:
void restoreExtensionSettings();
void saveExtensionSettings();
KListView *mExtensionView;
QCheckBox *mSearchReturnBox;
QCheckBox *mNameParsing;
QCheckBox *mViewsSingleClickBox;
QCheckBox *mAutoSearchWithWildcardBox;
QCheckBox *mHideSearchOnSwitchBox;
QCheckBox *mMultipleViewsAtOnce;
QCheckBox *mAskForQuit;
QCheckBox *mMenuBarBox;
+ QCheckBox *mAskForDelete;
QPushButton *mConfigureButton;
AddresseeWidget *mAddresseeWidget;
};
#endif