diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /kaddressbook | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook')
70 files changed, 611 insertions, 218 deletions
diff --git a/kaddressbook/addresseeeditorextension.cpp b/kaddressbook/addresseeeditorextension.cpp index 3f7fc175e..5c1ddcec6 100644 --- a/kaddressbook/addresseeeditorextension.cpp +++ b/kaddressbook/addresseeeditorextension.cpp @@ -22,6 +22,7 @@ */ #include <tqlayout.h> +#include <tqtimer.h> #include <klocale.h> @@ -52,17 +53,22 @@ AddresseeEditorExtension::~AddresseeEditorExtension() void AddresseeEditorExtension::contactsSelectionChanged() { const KABC::Addressee::List selectedAddressees = selectedContacts(); - KABC::Addressee::List addressees; - + KABC::Addressee::List modifiedAddress; if ( mAddresseeEditor->dirty() ) { mAddresseeEditor->save(); addressees.append( mAddresseeEditor->addressee() ); - emit modified( addressees ); + modifiedAddress = addressees; + TQTimer::singleShot(0, this, TQT_SLOT(emitModifiedAddresses())); } mAddresseeEditor->setAddressee( selectedAddressees[ 0 ] ); } +void AddresseeEditorExtension::emitModifiedAddresses() +{ + emit modified( addressees ); +} + TQString AddresseeEditorExtension::title() const { return i18n( "Contact Editor" ); diff --git a/kaddressbook/addresseeeditorextension.h b/kaddressbook/addresseeeditorextension.h index ff4e3d657..d3368248a 100644 --- a/kaddressbook/addresseeeditorextension.h +++ b/kaddressbook/addresseeeditorextension.h @@ -50,10 +50,12 @@ class AddresseeEditorExtension : public KAB::ExtensionWidget This method should be reimplemented and return a unique identifier. */ virtual TQString identifier() const; - + private slots: + void emitModifiedAddresses(); private: AddresseeEditorBase *mAddresseeEditor; bool mDirty; + KABC::Addressee::List addressees; }; #endif diff --git a/kaddressbook/addresseeutil.cpp b/kaddressbook/addresseeutil.cpp index d564a9cb1..7e5980176 100644 --- a/kaddressbook/addresseeutil.cpp +++ b/kaddressbook/addresseeutil.cpp @@ -29,6 +29,21 @@ #include "addresseeutil.h" +#if defined(KABC_VCARD_ENCODING_FIX) +TQByteArray AddresseeUtil::addresseesToClipboard( const KABC::Addressee::List &list ) +{ + KABC::VCardConverter converter; + + return converter.createVCardsRaw( list ); +} + +KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const TQByteArray &data ) +{ + KABC::VCardConverter converter; + + return converter.parseVCardsRaw( data.data() ); +} +#else TQString AddresseeUtil::addresseesToClipboard( const KABC::Addressee::List &list ) { KABC::VCardConverter converter; @@ -42,6 +57,7 @@ KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const TQString &data return converter.parseVCards( data ); } +#endif TQString AddresseeUtil::addresseesToEmails( const KABC::Addressee::List &addrList ) { diff --git a/kaddressbook/addresseeutil.h b/kaddressbook/addresseeutil.h index 31d750e3f..5bcac3136 100644 --- a/kaddressbook/addresseeutil.h +++ b/kaddressbook/addresseeutil.h @@ -26,6 +26,7 @@ #include <tqstring.h> #include <kabc/addressee.h> +#include <kabc/vcardparser.h> // for KABC_VCARD_ENCODING_FIX define /** This class provides some utility methods for transposing an @@ -43,15 +44,23 @@ class AddresseeUtil /** Same as above function, except that an entire list of KABC::Addressee objects will be converted to vCard and put in the string. - */ + */ +#if defined(KABC_VCARD_ENCODING_FIX) + static TQByteArray addresseesToClipboard( const KABC::Addressee::List &addrList ); +#else static TQString addresseesToClipboard( const KABC::Addressee::List &addrList ); +#endif /** Convert a string from the clipboard into a list of addressee objects. If the clipboard text was not a valid vcard, an empty list will be returned. */ +#if defined(KABC_VCARD_ENCODING_FIX) + static KABC::Addressee::List clipboardToAddressees( const TQByteArray &clipboard ); +#else static KABC::Addressee::List clipboardToAddressees( const TQString &clipboard ); +#endif /** Converts the list of addressee objects into a list of email addresses. diff --git a/kaddressbook/common/kaddressbook.kcfg b/kaddressbook/common/kaddressbook.kcfg index 37e6ff0a6..d0a48c251 100644 --- a/kaddressbook/common/kaddressbook.kcfg +++ b/kaddressbook/common/kaddressbook.kcfg @@ -57,7 +57,7 @@ <entry type="Bool" name="ContactListAboveExtensions"> <default>true</default> <whatsthis>If true, the contact list will be placed above the extensions on the left (distribution list editor etc.) instead of in the middle of the main window</whatsthis> - + </entry> </group> diff --git a/kaddressbook/csv-templates/kaddressbook.desktop b/kaddressbook/csv-templates/kaddressbook.desktop index a5b9c4066..505f3c549 100644 --- a/kaddressbook/csv-templates/kaddressbook.desktop +++ b/kaddressbook/csv-templates/kaddressbook.desktop @@ -19,7 +19,6 @@ Name[hi]=केडीईएड्रेसबुक (केडीई 3.1) Name[hr]=KAdressBook (KDE 3.1) Name[hu]=Címjegyzék (KDE 3.1) Name[it]=Rubrica indirizzi (KDE 3.1) -Name[ka]=წიგნაკი (KDE 3.1) Name[mk]=КАдресар (KDE 3.1) Name[nb]=Adressebok (KDE 3.1) Name[nds]=KAdressbook (KDE 3.1) diff --git a/kaddressbook/csv-templates/yahoo.desktop b/kaddressbook/csv-templates/yahoo.desktop index b365365c8..43b771c85 100644 --- a/kaddressbook/csv-templates/yahoo.desktop +++ b/kaddressbook/csv-templates/yahoo.desktop @@ -32,7 +32,6 @@ Name[hu]=Yahoo! címjegyzék Name[is]=Yahoo! póstfangaskrá Name[it]=Rubrica indirizzi Yahoo! Name[ja]=Yahoo! アドレス帳 -Name[ka]=წიგნაკი Yahoo! Name[kk]=Yahoo! адрестік кітапшасы Name[km]=សៀវភៅអាសយដ្ឋានរបស់យ៉ាហ៊ូ Name[ko]=Yahoo! 주소록 @@ -58,8 +57,7 @@ Name[ta]=யாஹூ! முகவரிப் புத்தகம் Name[tg]=Китоби адресии Yahoo! Name[tr]=Yahoo! Adres Defteri Name[uk]=Адресна книга Yahoo -Name[uz]=Yahoo! manzillar daftari -Name[uz@cyrillic]=Yahoo! манзиллар дафтари +Name[uz]=Yahoo! манзиллар дафтари Name[zh_CN]=Yahoo! 地址簿 Name[zh_TW]=Yahoo! 通訊錄 diff --git a/kaddressbook/customfieldswidget.cpp b/kaddressbook/customfieldswidget.cpp index 4fc41819c..c9f4d8610 100644 --- a/kaddressbook/customfieldswidget.cpp +++ b/kaddressbook/customfieldswidget.cpp @@ -289,6 +289,33 @@ void FieldWidget::loadContact( KABC::Addressee *addr ) } } +void FieldWidget::setReadOnly( bool readOnly ) +{ + FieldRecordList::ConstIterator it; + for ( it = mFieldList.begin(); it != mFieldList.end(); ++it ) { + TQString value; + if ( (*it).mWidget->isA( "TQLineEdit" ) ) { + TQLineEdit *wdg = static_cast<TQLineEdit*>( (*it).mWidget ); + wdg->setReadOnly(readOnly); + } else if ( (*it).mWidget->isA( "TQSpinBox" ) ) { + TQSpinBox *wdg = static_cast<TQSpinBox*>( (*it).mWidget ); + wdg->setEnabled( !readOnly ); + } else if ( (*it).mWidget->isA( "TQCheckBox" ) ) { + TQCheckBox *wdg = static_cast<TQCheckBox*>( (*it).mWidget ); + wdg->setEnabled( !readOnly ); + } else if ( (*it).mWidget->isA( "TQDateEdit" ) ) { + TQDateEdit *wdg = static_cast<TQDateEdit*>( (*it).mWidget ); + wdg->setEnabled( !readOnly ); + } else if ( (*it).mWidget->isA( "TQTimeEdit" ) ) { + TQTimeEdit *wdg = static_cast<TQTimeEdit*>( (*it).mWidget ); + wdg->setEnabled( !readOnly ); + } else if ( (*it).mWidget->isA( "TQDateTimeEdit" ) ) { + TQDateTimeEdit *wdg = static_cast<TQDateTimeEdit*>( (*it).mWidget ); + wdg->setEnabled( !readOnly ); + } + } +} + void FieldWidget::storeContact( KABC::Addressee *addr ) { FieldRecordList::ConstIterator it; @@ -390,6 +417,7 @@ void CustomFieldsWidget::setReadOnly( bool readOnly ) { mAddButton->setEnabled( !readOnly ); mRemoveButton->setEnabled( !readOnly && !mFieldWidget->fields().isEmpty() ); + mFieldWidget->setReadOnly( readOnly ); } void CustomFieldsWidget::addField() diff --git a/kaddressbook/dcopaddressbook.desktop b/kaddressbook/dcopaddressbook.desktop index 50ee3455d..feea50c0e 100644 --- a/kaddressbook/dcopaddressbook.desktop +++ b/kaddressbook/dcopaddressbook.desktop @@ -28,7 +28,6 @@ Comment[hu]=Címjegyzék DCOP-felülettel Comment[is]=Vistfangaskrá með DCOP tengingu Comment[it]=Rubrica indirizzi con un'interfaccia DCOP Comment[ja]=DCOP インターフェースを持つアドレス帳 -Comment[ka]=წიგნაკი DCOP-ის ინტერფეისით Comment[kk]=DCOP интерфейсті адрестік кітапшасы Comment[km]=សៀវភៅអាសយដ្ឋានដែលមានចំណុចប្រទាក់ DCOP Comment[ko]=DCOP 인터페이스를 사용하는 주소록 @@ -54,7 +53,6 @@ Comment[ta]=முகவரிப்புத்தகத்துடன் DCOP Comment[tg]=Китоби адрес бо интерфейси DCOP Comment[tr]=DCOP Arayüzü Olan Adres Defteri Comment[uk]=Адресна книга з інтерфейсом DCOP -Comment[uz]=DCOP interfeysli manzillar daftari -Comment[uz@cyrillic]=DCOP интерфейсли манзиллар дафтари +Comment[uz]=DCOP интерфейсли манзиллар дафтари Comment[zh_CN]=具有 DCOP 接口的地址簿 Comment[zh_TW]=有 DCOP 介面的通訊錄 diff --git a/kaddressbook/distributionlisteditor.cpp b/kaddressbook/distributionlisteditor.cpp index 1b379b4a1..c088978f3 100644 --- a/kaddressbook/distributionlisteditor.cpp +++ b/kaddressbook/distributionlisteditor.cpp @@ -28,10 +28,11 @@ #include <libemailfunctions/email.h> #include <kabc/addressbook.h> +#include <kabc/resource.h> #include <kapplication.h> #include <kdialogbase.h> -#include <kglobal.h> +#include <kglobal.h> #include <kiconloader.h> #include <klineedit.h> #include <klocale.h> @@ -41,6 +42,7 @@ #include <tqlayout.h> #include <tqsignalmapper.h> #include <tqtoolbutton.h> +#include <tqguardedptr.h> class KPIM::DistributionListEditor::EditorWidgetPrivate { @@ -55,6 +57,7 @@ public: TQWidget* memberListWidget; TQVBoxLayout* addresseeLayout; TQValueList<KPIM::DistributionListEditor::Line*> addressees; + TQGuardedPtr<KABC::Resource> resource; KPIM::DistributionList distributionList; KPIM::DistributionListEditor::Line* addLineForEntry( const KPIM::DistributionList::Entry& entry ); int lastLineId; @@ -94,7 +97,7 @@ void KPIM::DistributionListEditor::Line::setEntry( const KPIM::DistributionList: { m_uid = entry.addressee.uid(); m_initialText = entry.addressee.fullEmail( entry.email ); - m_lineEdit->setText( m_initialText ); + m_lineEdit->setText( m_initialText ); } KABC::Addressee KPIM::DistributionListEditor::Line::findAddressee( const TQString& name, const TQString& email ) const @@ -105,7 +108,7 @@ KABC::Addressee KPIM::DistributionListEditor::Line::findAddressee( const TQStrin typedef KABC::Addressee::List List; const List byEmail = m_addressBook->findByEmail( email ); if ( !byEmail.isEmpty() ) - { + { const List::ConstIterator end = byEmail.end(); for ( List::ConstIterator it = byEmail.begin(); it != end; ++it ) { @@ -138,7 +141,7 @@ KPIM::DistributionList::Entry KPIM::DistributionListEditor::Line::entry() const res.addressee = addr; } if ( res.addressee.isEmpty() ) - res.addressee = findAddressee( name, email ); + res.addressee = findAddressee( name, email ); res.email = res.addressee.preferredEmail() != email ? email : TQString(); return res; } @@ -146,18 +149,19 @@ KPIM::DistributionList::Entry KPIM::DistributionListEditor::Line::entry() const KPIM::DistributionListEditor::LineEdit::LineEdit( TQWidget* parent ) : KPIM::AddresseeLineEdit( parent ) { + allowDistributionLists( false ); } -KPIM::DistributionListEditor::EditorWidget::EditorWidget( KABC::AddressBook* book, TQWidget* parent ) +KPIM::DistributionListEditor::EditorWidget::EditorWidget( KABC::AddressBook* book, TQWidget* parent ) : KDialogBase( parent, /*name=*/0, /*modal=*/ true, /*caption=*/TQString(), KDialogBase::Ok|KDialogBase::Cancel ), d( new DistributionListEditor::EditorWidgetPrivate ) { d->addressBook = book; Q_ASSERT( d->addressBook ); d->lastLineId = 0; d->mapper = new TQSignalMapper( this ); - connect( d->mapper, TQT_SIGNAL( mapped( int ) ), - this, TQT_SLOT( lineTextChanged( int ) ) ); + connect( d->mapper, TQT_SIGNAL( mapped( int ) ), + this, TQT_SLOT( lineTextChanged( int ) ) ); setCaption( i18n( "Edit Distribution List" ) ); TQWidget* main = new TQWidget( this ); TQVBoxLayout* mainLayout = new TQVBoxLayout( main ); @@ -192,12 +196,12 @@ KPIM::DistributionListEditor::EditorWidget::EditorWidget( KABC::AddressBook* boo memberLayout->addStretch(); d->scrollView->addChild( d->memberListWidget ); d->scrollView->setResizePolicy( TQScrollView::AutoOneFit ); - + setMainWidget( main ); KPIM::DistributionListEditor::Line* const last = d->addLineForEntry( KPIM::DistributionList::Entry() ); const TQSize hint = sizeHint(); - resize( hint.width() * 1.5, hint.height() ); + resize( hint.width() * 3L/2, hint.height() ); } KPIM::DistributionListEditor::EditorWidget::~EditorWidget() @@ -217,6 +221,7 @@ void KPIM::DistributionListEditor::EditorWidget::setDistributionList( const KPIM { d->distListUid = list.uid(); d->nameLineEdit->setText( list.name() ); + d->resource = list.resource(); using KPIM::DistributionListEditor::Line; typedef TQValueList<Line*>::ConstIterator ListIterator; @@ -238,12 +243,12 @@ void KPIM::DistributionListEditor::EditorWidget::setDistributionList( const KPIM } KPIM::DistributionListEditor::Line* KPIM::DistributionListEditor::EditorWidgetPrivate::addLineForEntry( const KPIM::DistributionList::Entry& entry ) -{ +{ KPIM::DistributionListEditor::Line* line = new KPIM::DistributionListEditor::Line( addressBook, memberListWidget ); line->setEntry( entry ); addresseeLayout->addWidget( line ); addressees.append( line ); - TQObject::connect( line, TQT_SIGNAL( textChanged() ), + TQObject::connect( line, TQT_SIGNAL( textChanged() ), mapper, TQT_SLOT( map() ) ); mapper->setMapping( line, ++lastLineId ); line->setShown( true ); @@ -256,23 +261,39 @@ void KPIM::DistributionListEditor::EditorWidget::slotOk() const KPIM::DistributionList existing = KPIM::DistributionList::findByName( d->addressBook, name ); if ( !existing.isEmpty() && existing.uid() != d->distListUid ) { - KMessageBox::error( this, i18n( "A distribution list with the name %1 already exists. Please choose another name." ).arg( name ), i18n( "Name in Use" ) ); + KMessageBox::error( this, i18n( "A distribution list with the name %1 already exists. Please choose another name." ).arg( name ), i18n( "Name in Use" ) ); + return; + } + + KABC::Ticket *ticket = d->resource->requestSaveTicket(); + if ( !ticket ) { + kdWarning(5720) << "Unable to get save ticket!" << endl; return; } KPIM::DistributionList list; list.setUid( d->distListUid.isNull() ? KApplication::randomString( 10 ) :d->distListUid ); list.setName( name ); + list.setResource( d->resource ); typedef TQValueList<KPIM::DistributionListEditor::Line*>::ConstIterator ListIterator; for ( ListIterator it = d->addressees.begin(), end = d->addressees.end(); it != end; ++it ) - { + { const KPIM::DistributionList::Entry entry = (*it)->entry(); if ( entry.addressee.isEmpty() ) continue; list.insertEntry( entry.addressee, entry.email ); } d->distributionList = list; - accept(); + + d->addressBook->insertAddressee( d->distributionList ); + if ( !d->resource->save( ticket ) ) { + kdWarning(5720) << "Unable to save dist list!" << endl; + } + d->resource->releaseSaveTicket( ticket ); + + if ( !KPIM::DistributionList::findByName( d->addressBook, name ).isEmpty() ) { + accept(); + } } KPIM::DistributionList KPIM::DistributionListEditor::EditorWidget::distributionList() const diff --git a/kaddressbook/editors/cryptosettings.desktop b/kaddressbook/editors/cryptosettings.desktop index 90ea108b7..4baaa54ae 100644 --- a/kaddressbook/editors/cryptosettings.desktop +++ b/kaddressbook/editors/cryptosettings.desktop @@ -24,7 +24,6 @@ Name[hu]=Titkosítási beállítások Name[is]=Stillingar dulritunar Name[it]=Preferenze crittografia Name[ja]=暗号の設定 -Name[ka]=დაშიფრვის პარამეტრები Name[kk]=Шифрлау параметрлері Name[km]=ចំណង់ចំណូលចិត្ត Crypto Name[ko]=암호화 설정 diff --git a/kaddressbook/editors/imaddresseditor.desktop b/kaddressbook/editors/imaddresseditor.desktop index 64dc74425..bb6b341c4 100644 --- a/kaddressbook/editors/imaddresseditor.desktop +++ b/kaddressbook/editors/imaddresseditor.desktop @@ -21,7 +21,6 @@ Name[hu]=Azonnali üzenetküldés (IM) Name[is]=Skilaboðaforrit Name[it]=Messaggistica istantanea Name[ja]=インスタントメッセージ -Name[ka]=მყისიერი შეტყობინებები Name[kk]=Лезде хабарласу Name[km]=ផ្ញើសារបន្ទាន់ Name[ko]=인스턴트 페시징 @@ -45,8 +44,7 @@ Name[ta]=உடனடி செய்தி பரிமாற்றம் Name[tg]=Хизматгоҳи мубодилаи иттилоот Name[tr]=Hızlı Mesajlaşma Name[uk]=Миттєвий зв'язок -Name[uz]=Xabar almashish -Name[uz@cyrillic]=Хабар алмашиш +Name[uz]=Хабар алмашиш Name[zh_CN]=即时通讯 Name[zh_TW]=即時通訊 Comment=Instant Messaging Address Editor @@ -72,7 +70,6 @@ Comment[hu]=IM-címszerkesztő Comment[is]=Vistfangaritill fyrir skilaboðaforrit Comment[it]=Editor degli indirizzi per messaggi istantanei Comment[ja]=インスタントメッセージのアドレスを編集 -Comment[ka]=მყისიერი შეტყობინებების წიგნაკის რედაქტორი Comment[kk]=Лезде хабарласу адрестер өңдегіші Comment[km]=កម្មវិធីនិពន្ធអាសយដ្ឋានដើម្បីផ្ញើសារបន្ទាន់ Comment[ko]=인스턴트 메시징 주소 편집기 diff --git a/kaddressbook/editors/imeditorwidget.cpp b/kaddressbook/editors/imeditorwidget.cpp index 0da0feb03..ad84505c2 100644 --- a/kaddressbook/editors/imeditorwidget.cpp +++ b/kaddressbook/editors/imeditorwidget.cpp @@ -362,6 +362,8 @@ void IMEditorWidget::slotAdd() void IMEditorWidget::slotEdit() { + if( mReadOnly ) + return; TQListViewItemIterator it( mWidget->lvAddresses, TQListViewItemIterator::Selected ); // Just edit the first one selected. diff --git a/kaddressbook/editors/kaddressbookimprotocol.desktop b/kaddressbook/editors/kaddressbookimprotocol.desktop index 80a6f89aa..ad4eda6c4 100644 --- a/kaddressbook/editors/kaddressbookimprotocol.desktop +++ b/kaddressbook/editors/kaddressbookimprotocol.desktop @@ -25,7 +25,6 @@ Name[hu]=KAddressbook azonnali üzenetküldési protokoll Name[is]=KAddressbook skilaboðaforritið Name[it]=KAddressbook protocollo messaggistica istantanea Name[ja]=KAddressbook インスタントメッセージプロトコル -Name[ka]=KDE ოქმი მყისიერი შეტყობინებებისათვისწიგნაკითვის Name[kk]=KAddressbook лезде хабарласу протоколы Name[km]=ពិធីការផ្ញើសារបន្ទាន់របស់ KAddressbook Name[ko]=KAddressbook 인스턴트 메시징 프로토콜 diff --git a/kaddressbook/editors/protocols/aimprotocol.desktop b/kaddressbook/editors/protocols/aimprotocol.desktop index e17be1f67..a29098d8d 100644 --- a/kaddressbook/editors/protocols/aimprotocol.desktop +++ b/kaddressbook/editors/protocols/aimprotocol.desktop @@ -29,7 +29,6 @@ Comment[hu]=AIM protokoll Comment[is]=AIM samskiptamátinn Comment[it]=Protocollo AIM Comment[ja]=AIM プロトコル -Comment[ka]=AIM ოქმი Comment[kk]=AIM протоколы Comment[km]=ពិធីការ AIM Comment[ko]=AIM 프로토콜 diff --git a/kaddressbook/editors/protocols/gaduprotocol.desktop b/kaddressbook/editors/protocols/gaduprotocol.desktop index 96ee6e9ee..9ccea3c52 100644 --- a/kaddressbook/editors/protocols/gaduprotocol.desktop +++ b/kaddressbook/editors/protocols/gaduprotocol.desktop @@ -30,7 +30,6 @@ Comment[hu]=Gadu-Gadu protokoll Comment[is]=Gadu-Gadu samskiptamátinn Comment[it]=Protocollo Gadu-Gadu Comment[ja]=Gadu-Gadu プロトコル -Comment[ka]=Gadu-Gadu ოქმი Comment[kk]=Gadu-Gadu протоколы Comment[km]=ពិធីការ Gadu-Gadu Comment[lt]=Gadu-Gadu protokolas diff --git a/kaddressbook/editors/protocols/groupwiseprotocol.desktop b/kaddressbook/editors/protocols/groupwiseprotocol.desktop index 0ee40fd2e..0fc2cce0f 100644 --- a/kaddressbook/editors/protocols/groupwiseprotocol.desktop +++ b/kaddressbook/editors/protocols/groupwiseprotocol.desktop @@ -18,7 +18,6 @@ Comment[fy]=Novell GroupWise-messenger Comment[he]=מסנג'ר של Novell GroupWise Comment[is]=Novell GroupWise Samskiptatólið Comment[ja]=Novell GroupWise メッセンジャー -Comment[ka]= Novell GroupWise მყისიერი შეტყობინებების მაცნე Comment[kk]=Novell GroupWise хабарласу Comment[km]=កម្មវិធីផ្ញើសាររបស់ណូវែល - GroupWise Comment[lt]=Novell GroupWise momentinių žinučių klientas diff --git a/kaddressbook/editors/protocols/icqprotocol.desktop b/kaddressbook/editors/protocols/icqprotocol.desktop index e071238ed..be9fff528 100644 --- a/kaddressbook/editors/protocols/icqprotocol.desktop +++ b/kaddressbook/editors/protocols/icqprotocol.desktop @@ -29,7 +29,6 @@ Comment[hu]=ICQ protokoll Comment[is]=ICQ samskiptamátinn Comment[it]=Protocollo ICQ Comment[ja]=ICQ プロトコル -Comment[ka]=ICQ ოქმი Comment[kk]=ICQ протоколы Comment[km]=ពិធីការ ICQ Comment[lt]=ICQ protokolas diff --git a/kaddressbook/editors/protocols/ircprotocol.desktop b/kaddressbook/editors/protocols/ircprotocol.desktop index 78f19447b..40f73a367 100644 --- a/kaddressbook/editors/protocols/ircprotocol.desktop +++ b/kaddressbook/editors/protocols/ircprotocol.desktop @@ -9,7 +9,6 @@ Comment[fa]=گپ بازپخش اینترنت Comment[hu]=IRC (Internet Relay Chat) Comment[is]=Internet spjall Comment[ja]=インターネットリレーチャット -Comment[ka]=IRC Comment[kk]=Internet Relay Chat хабарласу Comment[km]=ជជែកកំសាន្តតាមអ៊ីនធឺណិត Comment[lt]=Estafetinis Interneto pokalbis diff --git a/kaddressbook/editors/protocols/jabberprotocol.desktop b/kaddressbook/editors/protocols/jabberprotocol.desktop index 94b7271b7..b34f88093 100644 --- a/kaddressbook/editors/protocols/jabberprotocol.desktop +++ b/kaddressbook/editors/protocols/jabberprotocol.desktop @@ -30,7 +30,6 @@ Comment[hu]=Jabber protokoll Comment[is]=Jabber samskiptamátinn Comment[it]=Protocollo Jabber Comment[ja]=Jabber プロトコル -Comment[ka]=Jabber ოქმი Comment[kk]=Jabber протоколы Comment[km]=ពិធីការ Jabber Comment[lt]=Jabber protokolas diff --git a/kaddressbook/editors/protocols/meanwhileprotocol.desktop b/kaddressbook/editors/protocols/meanwhileprotocol.desktop index 7442cd04d..23e9fe3d8 100644 --- a/kaddressbook/editors/protocols/meanwhileprotocol.desktop +++ b/kaddressbook/editors/protocols/meanwhileprotocol.desktop @@ -29,7 +29,6 @@ Comment[hu]=Meanwhile protokoll Comment[is]=Meanwhile samskiptamátinn Comment[it]=Protocollo Meanwhile Comment[ja]=Meanwhile プロトコル -Comment[ka]=Meanwhile ოქმი Comment[kk]=Meanwhile протоколы Comment[km]=ពិធីការ Meanwhile Comment[lt]=Meanwhile protokolas diff --git a/kaddressbook/editors/protocols/msnprotocol.desktop b/kaddressbook/editors/protocols/msnprotocol.desktop index 58504fd71..1256278a5 100644 --- a/kaddressbook/editors/protocols/msnprotocol.desktop +++ b/kaddressbook/editors/protocols/msnprotocol.desktop @@ -12,7 +12,6 @@ Comment[fa]=پیامرسان MSN Comment[fr]=Messagerie MSN Comment[is]=MSN spjallforritið Comment[ja]=MSN メッセンジャー -Comment[ka]=MSN შიკრიკი Comment[km]=កម្មវិធីផ្ញើសារ MSN Comment[nds]=MSN-Kortnarichtenmaker Comment[ne]=एमएसएन म्यासेन्जर @@ -25,7 +24,6 @@ Name[cy]=Negesydd MSN Name[eo]=MSN Mesaĝilo Name[fa]=پیامرسان MSN Name[ja]=MSN メッセンジャー -Name[ka]=MSN შიკრიკი Name[km]=កម្មវិធីផ្ញើសារ MSN Name[nds]=MSN-Kortnarichtenmaker Name[ne]=एमएसएन म्यासेन्जर diff --git a/kaddressbook/editors/protocols/skypeprotocol.desktop b/kaddressbook/editors/protocols/skypeprotocol.desktop index 60ac34060..a5c67fc47 100644 --- a/kaddressbook/editors/protocols/skypeprotocol.desktop +++ b/kaddressbook/editors/protocols/skypeprotocol.desktop @@ -24,7 +24,6 @@ Comment[hu]=Skype internetes telefon Comment[is]=Skype Internet sími Comment[it]=Telefonia internet Skype Comment[ja]=Skype インターネット電話 -Comment[ka]=Skype ინტერნეტ ტელეფონი Comment[kk]=Skype Интернет телефониясы Comment[km]=ទូរស័ព្ទតាមអ៊ីនធឺណិតដោយប្រើ Skype Comment[lt]=Skype Interneto telefonija diff --git a/kaddressbook/editors/protocols/smsprotocol.desktop b/kaddressbook/editors/protocols/smsprotocol.desktop index 30b50a1ea..38710e837 100644 --- a/kaddressbook/editors/protocols/smsprotocol.desktop +++ b/kaddressbook/editors/protocols/smsprotocol.desktop @@ -29,7 +29,6 @@ Comment[hu]=SMS protokoll Comment[is]=SMS samskiptamátinn Comment[it]=Protocollo SMS Comment[ja]=SMS プロトコル -Comment[ka]= SMS ოქმი Comment[kk]=SMS протоколы Comment[km]=ពិធីការសេវាសារខ្លីៗ Comment[lt]=SMS protokolas diff --git a/kaddressbook/editors/protocols/yahooprotocol.desktop b/kaddressbook/editors/protocols/yahooprotocol.desktop index c3055472e..8064f772f 100644 --- a/kaddressbook/editors/protocols/yahooprotocol.desktop +++ b/kaddressbook/editors/protocols/yahooprotocol.desktop @@ -30,7 +30,6 @@ Comment[hu]=Yahoo protokoll Comment[is]=Yahoo samskiptamátinn Comment[it]=Protocollo Yahoo Comment[ja]=Yahoo プロトコル -Comment[ka]=Yahoo ოქმი Comment[kk]=Yahoo протоколы Comment[km]=ពិធីការយ៉ាហ៊ូ Comment[lt]=Yahoo protokolas diff --git a/kaddressbook/features/distributionlist.desktop b/kaddressbook/features/distributionlist.desktop index b05d7b5e8..844a48961 100644 --- a/kaddressbook/features/distributionlist.desktop +++ b/kaddressbook/features/distributionlist.desktop @@ -27,7 +27,6 @@ Name[hu]=KAB címlista bővítőmodul Name[is]=Íforrit fyrir KAB dreifilista Name[it]=Plugin lista di distribuzione KAB Name[ja]=KAB 配布リストプラグイン -Name[ka]=KAB დისტრიბუციის სიის მოდული Name[kk]=KAB тарату тізімінің плагин модулі Name[km]=កម្មវិធីជំនួយបញ្ជីចែកចាយរបស់ KAB Name[lt]=KAB platinimo sąrašo priedas @@ -51,8 +50,7 @@ Name[ta]=KABயின் பகிர்ந்தளித்தல் பட் Name[tg]=Рӯйхати ба ҳар тараф мефиристодагӣ Name[tr]=KAB Dağıtım Listesi Eklentisi Name[uk]=Втулок списку розповсюдження KAB -Name[uz]=Tarqatish roʻyxat plagini -Name[uz@cyrillic]=Тарқатиш рўйхат плагини +Name[uz]=Тарқатиш рўйхат плагини Name[zh_CN]=KAB 分发列表插件 Comment=Plugin for managing distribution lists Comment[af]=Inprop module vir die bestuur van verspreiding lyste @@ -82,7 +80,6 @@ Comment[hu]=Bővítőmodul címlisták kezeléséhez Comment[is]=Íforrit til að sjá um dreifilista Comment[it]=Plugin per gestire liste di distribuzione Comment[ja]=配布リスト管理用プラグイン -Comment[ka]=სადისტრიბუციო სიათა მართვის მოდული Comment[kk]=Тарату тізімімен айналысу плагин модулі Comment[km]=កម្មវិធីជំនួយដើម្បីគ្រប់គ្រងបញ្ជីចែកចាយ Comment[lt]=Priedas platinimo sąrašų tvarkymui @@ -107,8 +104,7 @@ Comment[ta]=பகிர்தல் பட்டியல் நிர்வக Comment[tg]=Кор бо рӯйхати ба ҳар тараф мефиристодагӣ Comment[tr]=Dağıtım listelerini yönetmek için eklenti Comment[uk]=Втулок для керування списками розповсюдження -Comment[uz]=Tarqatish roʻyxatlarni boshqarish uchu plagin -Comment[uz@cyrillic]=Тарқатиш рўйхатларни бошқариш учу плагин +Comment[uz]=Тарқатиш рўйхатларни бошқариш учу плагин Comment[zh_CN]=管理分发列表的插件 Comment[zh_TW]=管理分配清單外掛程式 Type=Service diff --git a/kaddressbook/features/distributionlistng.desktop b/kaddressbook/features/distributionlistng.desktop index 84d7070bb..e805a91a7 100644 --- a/kaddressbook/features/distributionlistng.desktop +++ b/kaddressbook/features/distributionlistng.desktop @@ -6,22 +6,16 @@ Name[ca]=Endollable de la propera generació de la llista de distribució KAB Name[da]=Næste generations-plugin til KAB-Distribution-liste Name[de]=Verteilerlisten-Modul für neues Adressbuch Name[el]=Πρόσθετο επόμενης γενιάς λίστας διανομής του KAB -Name[es]=Complemento de nueva generación KAB para listas de distribución Name[et]=KAB postiloendi järgmise põlvkonna plugin -Name[fr]=Module de liste de diffusion nouvelle génération pour KAB -Name[is]=Næstu kynslóðar íforrit fyrir KAB dreifilista Name[it]=Plugin lista di distribuzione KAB di nuova generazione Name[ja]=KAB 配布リスト次世代プラグイン -Name[km]=កម្មវិធីជំនួយជំនាន់ក្រោយរបស់បញ្ជីចែកចាយ KAB Name[nds]=Verbetert Verdeellist-Moduul för KAdressbook Name[nl]=Plugin voor KAB Distributielijst (Nieuwe Generatie) Name[pl]=Wtyczka KAB do obsługi list wysyłkowych -Name[ru]=Списки рассылки (новая версия) Name[sk]=KAB plugin distribučného zoznamu ďaľšej generácie Name[sr]=Прикључак KAB-а наредне генерације за дистрибуционе листе Name[sr@Latn]=Priključak KAB-a naredne generacije za distribucione liste Name[sv]=Adressbokens nästa generation insticksprogram för distributionslistor -Name[tr]=KAB Dağıtım Listesi Sonraki Kuşak Eklentisi Name[zh_CN]=KAB 分发列表生成插件 Name[zh_TW]=KAB 分派清單下一代外掛程式 Comment=Plugin for managing distribution lists @@ -52,7 +46,6 @@ Comment[hu]=Bővítőmodul címlisták kezeléséhez Comment[is]=Íforrit til að sjá um dreifilista Comment[it]=Plugin per gestire liste di distribuzione Comment[ja]=配布リスト管理用プラグイン -Comment[ka]=სადისტრიბუციო სიათა მართვის მოდული Comment[kk]=Тарату тізімімен айналысу плагин модулі Comment[km]=កម្មវិធីជំនួយដើម្បីគ្រប់គ្រងបញ្ជីចែកចាយ Comment[lt]=Priedas platinimo sąrašų tvarkymui @@ -77,8 +70,7 @@ Comment[ta]=பகிர்தல் பட்டியல் நிர்வக Comment[tg]=Кор бо рӯйхати ба ҳар тараф мефиристодагӣ Comment[tr]=Dağıtım listelerini yönetmek için eklenti Comment[uk]=Втулок для керування списками розповсюдження -Comment[uz]=Tarqatish roʻyxatlarni boshqarish uchu plagin -Comment[uz@cyrillic]=Тарқатиш рўйхатларни бошқариш учу плагин +Comment[uz]=Тарқатиш рўйхатларни бошқариш учу плагин Comment[zh_CN]=管理分发列表的插件 Comment[zh_TW]=管理分配清單外掛程式 Type=Service diff --git a/kaddressbook/features/distributionlistngwidget.cpp b/kaddressbook/features/distributionlistngwidget.cpp index 08ef3e4cd..4ca4e365e 100644 --- a/kaddressbook/features/distributionlistngwidget.cpp +++ b/kaddressbook/features/distributionlistngwidget.cpp @@ -71,12 +71,11 @@ void KAB::DistributionListNg::ListBox::dropEvent( TQDropEvent *event ) if ( !item || index( item ) == 0 ) return; - TQString vcards; - if ( !KVCardDrag::decode( event, vcards ) ) + KABC::Addressee::List list; + if ( !KVCardDrag::decode( event, list ) ) return; - KABC::VCardConverter converter; - emit dropped( item->text(), converter.parseVCards( vcards ) ); + emit dropped( item->text(), list ); } namespace KAB { @@ -154,6 +153,7 @@ KAB::DistributionListNg::MainWidget::MainWidget( KAB::Core *core, TQWidget *pare this, TQT_SLOT( contactsDropped( const TQString &, const KABC::Addressee::List & ) ) ); connect( mListBox, TQT_SIGNAL( highlighted( int ) ), this, TQT_SLOT( itemSelected( int ) ) ); + connect( mListBox, TQT_SIGNAL(doubleClicked(TQListBoxItem*)), TQT_SLOT(editSelectedDistributionList()) ); layout->addWidget( mListBox ); connect( core, TQT_SIGNAL( contactsUpdated() ), @@ -172,7 +172,7 @@ void KAB::DistributionListNg::MainWidget::contextMenuRequested( TQListBoxItem *i { TQGuardedPtr<KPopupMenu> menu = new KPopupMenu( this ); menu->insertItem( i18n( "New Distribution List..." ), core(), TQT_SLOT( newDistributionList() ) ); - if ( item ) + if ( item && ( item->text() !=i18n( "All Contacts" ) ) ) { menu->insertItem( i18n( "Edit..." ), this, TQT_SLOT( editSelectedDistributionList() ) ); menu->insertItem( i18n( "Delete" ), this, TQT_SLOT( deleteSelectedDistributionList() ) ); diff --git a/kaddressbook/features/resourceselection.cpp b/kaddressbook/features/resourceselection.cpp index d6edba25e..59a3c1ee6 100644 --- a/kaddressbook/features/resourceselection.cpp +++ b/kaddressbook/features/resourceselection.cpp @@ -251,7 +251,6 @@ void ResourceSelection::add() return; } - resource->setResourceName( i18n( "%1 address book" ).arg( type ) ); resource->setAddressBook(core()->addressBook()); KRES::ConfigDialog dlg( this, TQString( "contact" ), resource ); @@ -262,6 +261,7 @@ void ResourceSelection::add() mLastResource = resource->identifier(); updateView(); + currentChanged(mListView->currentItem() ); } else { delete resource; resource = 0; @@ -309,6 +309,7 @@ void ResourceSelection::remove() core()->addressBook()->emitAddressBookChanged(); updateView(); + currentChanged(mListView->currentItem() ); } void ResourceSelection::currentChanged( TQListViewItem *item ) diff --git a/kaddressbook/features/resourceselection.desktop b/kaddressbook/features/resourceselection.desktop index 4879e939f..b1f336988 100644 --- a/kaddressbook/features/resourceselection.desktop +++ b/kaddressbook/features/resourceselection.desktop @@ -26,7 +26,6 @@ Name[hu]=Címjegyzékkezelő bővítőmodul Name[is]=Umsjónaríforrit vistfangaflettis Name[it]=Plugin per gestire rubriche indirizzi Name[ja]=アドレス帳管理プラグイン -Name[ka]=წიგნაკის მართვის მოდული Name[kk]=Адрестік кітапшамен айналысу плагин модулі Name[km]=កម្មវិធីជំនួយការគ្រប់គ្រងសៀវភៅអាសយដ្ឋាន Name[lt]=Adresų knygelės tvarkymo priedas @@ -78,7 +77,6 @@ Comment[hu]=Bővítőmodul címjegyzékek kezeléséhez Comment[is]=Íforrit til að sjá um vistfangaskrár Comment[it]=Plugin per gestire rubriche indirizzi Comment[ja]=アドレス帳管理用プラグイン -Comment[ka]=წიგნაკის მართვის მოდული Comment[kk]=Адрестік кітапшамен айналысу плагин модулі Comment[km]=កម្មវិធីជំនួយដើម្បីគ្រប់គ្រងសៀវភៅអាសយដ្ឋាន Comment[lt]=Priedas adresų knygelių tvarkymui diff --git a/kaddressbook/freebusywidget.cpp b/kaddressbook/freebusywidget.cpp index 9bda32491..096c1d583 100644 --- a/kaddressbook/freebusywidget.cpp +++ b/kaddressbook/freebusywidget.cpp @@ -68,6 +68,11 @@ void FreeBusyWidget::storeContact( KABC::Addressee *addr ) KCal::FreeBusyUrlStore::self()->writeUrl( addr->preferredEmail(), mURL->url() ); KCal::FreeBusyUrlStore::self()->sync(); + if ( mURL->url().isEmpty() ) { + addr->removeCustom( "KADDRESSBOOK", "FreeBusyURL" ); + } else { + addr->insertCustom( "KADDRESSBOOK", "FreeBusyURL", mURL->url() ); + } } void FreeBusyWidget::setReadOnly( bool readOnly ) diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index ddacc2cd1..7d8ac8f51 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp @@ -222,6 +222,8 @@ void ImageButton::contextMenuEvent( TQContextMenuEvent *event ) void ImageButton::load() { + if ( mReadOnly ) + return; KURL url = KFileDialog::getOpenURL( TQString(), KImageIO::pattern(), this ); if ( url.isValid() ) { if ( mImageLoader ) { diff --git a/kaddressbook/interfaces/kaddressbook_contacteditorwidget.desktop b/kaddressbook/interfaces/kaddressbook_contacteditorwidget.desktop index bb646e78c..e8159d594 100644 --- a/kaddressbook/interfaces/kaddressbook_contacteditorwidget.desktop +++ b/kaddressbook/interfaces/kaddressbook_contacteditorwidget.desktop @@ -24,7 +24,6 @@ Comment[hu]=KAddressBook névjegyszerkesztő bővítőmodul Comment[is]=KAddressbook tengiliðaritils íforrit Comment[it]=Plugin editor dei contatti di KAddressbook Comment[ja]=KAddressbook 連絡先エディタ ウィジェット プラグイン -Comment[ka]= KDE-ს წიგნაკის კონტაქტთა რედაქტირების ელემენტის მოდული Comment[kk]=Адрестік кітапшаның контактты өңдеу модулі Comment[km]=កម្មវិធីជំនួយធាតុក្រាហ្វិកកម្មវិធីនិពន្ធទំនាក់ទំនងរបស់ KAddressBook Comment[lt]=KAddressBook kontaktų redaktoriaus valdiklių priedas diff --git a/kaddressbook/interfaces/kaddressbook_extension.desktop b/kaddressbook/interfaces/kaddressbook_extension.desktop index 55be3b71e..0bf353967 100644 --- a/kaddressbook/interfaces/kaddressbook_extension.desktop +++ b/kaddressbook/interfaces/kaddressbook_extension.desktop @@ -27,7 +27,6 @@ Comment[hu]=KAddressBook kiegészítő modul Comment[is]=KAddressbook viðbótar íforrit Comment[it]=Plugin estensione di KAddressbook Comment[ja]=KAddressbook 拡張プラグイン -Comment[ka]=KDE წიგნაკის გაფართოების მოდული Comment[kk]=KAddressBook кеңейту модулі Comment[km]=កម្មវិធីជំនួយផ្នែកបន្ថែមរបស់ KAddressBook Comment[lt]=KAddressBook praplėtimo priedas diff --git a/kaddressbook/interfaces/kaddressbook_xxport.desktop b/kaddressbook/interfaces/kaddressbook_xxport.desktop index fb2b03d0d..3d9e5503e 100644 --- a/kaddressbook/interfaces/kaddressbook_xxport.desktop +++ b/kaddressbook/interfaces/kaddressbook_xxport.desktop @@ -28,7 +28,6 @@ Comment[hu]=KAddressBook importálási/exportálási bővítőmodul Comment[is]=KAddressbook flytja inn/út íforrit Comment[it]=Plugin importa/esporta di KAddressbook Comment[ja]=KAddressbook インポート/エクスポートプラグイン -Comment[ka]=წიგნაკის იმპორტ/ექსპორტის მოდული Comment[kk]=KAddressBook импорт/экспорт модулі Comment[km]=កម្មវិធីជំនួយនាំចូល/នាំចេញរបស់ KAddressBook Comment[lt]=KAddressBook importo/eksporto priedas @@ -52,8 +51,7 @@ Comment[ta]=கேமுகவரிப்புத்தகம் ஏற்ற Comment[tg]=Содирот ва воридоти китоби адрес Comment[tr]=KAdresDefteri Al/Gönder Eklentisi Comment[uk]=Втулок імпорту/експорту адресної книги KAddressBook -Comment[uz]=Manzillar daftari uchun import/eksport plagini -Comment[uz@cyrillic]=Манзиллар дафтари учун импорт/экспорт плагини +Comment[uz]=Манзиллар дафтари учун импорт/экспорт плагини Comment[zh_CN]=KAddressBook 导入/导出插件 Comment[zh_TW]=KAddressBook 匯入/匯出外掛程式 diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 427cb79ab..7951cded0 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -34,6 +34,8 @@ #include <tqwidgetstack.h> #include <tqregexp.h> #include <tqvbox.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kabc/addresseelist.h> #include <kabc/errorhandler.h> @@ -277,7 +279,23 @@ KABC::Resource *KABCore::requestResource( TQWidget *parent ) KABC::Resource *resource; while ( ( resource = resIt.current() ) != 0 ) { ++resIt; - if ( !resource->readOnly() ) { + bool writable = false; + if ( resource->inherits( "KPIM::ResourceABC" ) ) { + KPIM::ResourceABC *resAbc = static_cast<KPIM::ResourceABC *>( resource ); + const TQStringList subresources = resAbc->subresources(); + for ( TQStringList::ConstIterator it = subresources.begin(); it != subresources.end(); ++it ) { + if ( resAbc->subresourceActive(*it) && resAbc->subresourceWritable(*it) ) { + writable = true; + break; + } + } + } else { + if ( !resource->readOnly() ) { + writable = true; + } + } + + if ( writable ) { KRES::Resource *res = resource; // downcast kresResources.append( res ); } @@ -401,7 +419,7 @@ void KABCore::setContactSelected( const TQString &uid ) mActionDelete->setEnabled( someSelected && writable ); // the "edit" dialog doubles as the details dialog and it knows when the addressee is read-only // (### this does not make much sense from the user perspective!) - mActionEditAddressee->setEnabled( singleSelected ); + mActionEditAddressee->setEnabled( singleSelected && !mExtensionManager->isQuickEditVisible()); mActionCopyAddresseeTo->setEnabled( someSelected && moreThanOneResource ); mActionMoveAddresseeTo->setEnabled( someSelected && moreThanOneResource && writable ); mActionMail->setEnabled( someSelected ); @@ -413,9 +431,18 @@ void KABCore::setContactSelected( const TQString &uid ) if ( mReadWrite ) { QClipboard *cb = TQApplication::clipboard(); +#if defined(KABC_VCARD_ENCODING_FIX) + const TQMimeSource *data = cb->data( QClipboard::Clipboard ); + list = AddresseeUtil::clipboardToAddressees( data->encodedData( "text/x-vcard" ) ); +#else list = AddresseeUtil::clipboardToAddressees( cb->text() ); +#endif mActionPaste->setEnabled( !list.isEmpty() ); } +#ifdef KDEPIM_NEW_DISTRLISTS + mAddDistListButton->setEnabled( writable ); + mRemoveDistListButton->setEnabled( someSelected && writable ); +#endif } void KABCore::sendMail() @@ -495,10 +522,20 @@ void KABCore::deleteContacts( const TQStringList &uids ) ++it; } - if ( KMessageBox::warningContinueCancelList( mWidget, i18n( "Do you really want to delete this contact?", - "Do you really want to delete these %n contacts?", uids.count() ), - names, TQString::null, KStdGuiItem::del() ) == KMessageBox::Cancel ) + if ( KMessageBox::warningContinueCancelList( + mWidget, + i18n( "<qt>" + "Do you really want to delete this contact from your addressbook?<br>" + "<b>Note:</b>The contact will be also removed from all distribution lists." + "</qt>", + "<qt>" + "Do you really want to delete these %n contacts from your addressbook?<br>" + "<b>Note:</b>The contacts will be also removed from all distribution lists." + "</qt>", + uids.count() ), + names, TQString::null, KStdGuiItem::del() ) == KMessageBox::Cancel ) { return; + } DeleteCommand *command = new DeleteCommand( mAddressBook, uids ); mCommandHistory->addCommand( command ); @@ -513,12 +550,15 @@ void KABCore::copyContacts() { KABC::Addressee::List addrList = mViewManager->selectedAddressees(); +#if defined(KABC_VCARD_ENCODING_FIX) + TQByteArray clipText = AddresseeUtil::addresseesToClipboard( addrList ); + QClipboard *cb = TQApplication::clipboard(); + cb->setText( TQString::fromUtf8( clipText.data() ) ); +#else TQString clipText = AddresseeUtil::addresseesToClipboard( addrList ); - - kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; - QClipboard *cb = TQApplication::clipboard(); cb->setText( clipText ); +#endif } void KABCore::cutContacts() @@ -536,9 +576,12 @@ void KABCore::cutContacts() void KABCore::pasteContacts() { QClipboard *cb = TQApplication::clipboard(); - +#if defined(KABC_VCARD_ENCODING_FIX) + const TQMimeSource *data = cb->data( QClipboard::Clipboard ); + KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( data->encodedData( "text/x-vcard" ) ); +#else KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); - +#endif pasteContacts( list ); } @@ -667,6 +710,10 @@ void KABCore::contactModified( const KABC::Addressee &addr ) void KABCore::newDistributionList() { #ifdef KDEPIM_NEW_DISTRLISTS + KABC::Resource *resource = requestResource( mWidget ); + if ( !resource ) + return; + TQString name = i18n( "New Distribution List" ); const KPIM::DistributionList distList = KPIM::DistributionList::findByName( addressBook(), name ); if ( !distList.isEmpty() ) { @@ -680,6 +727,7 @@ void KABCore::newDistributionList() KPIM::DistributionList list; list.setUid( KApplication::randomString( 10 ) ); list.setName( name ); + list.setResource( resource ); editDistributionList( list ); #endif } @@ -827,27 +875,14 @@ void KABCore::storeContactIn( const TQString &uid, bool copy /*false*/ ) if ( !resource ) return; - KABLock::self( mAddressBook )->lock( resource ); - TQStringList::Iterator it( uidList.begin() ); - const TQStringList::Iterator endIt( uidList.end() ); - while ( it != endIt ) { - KABC::Addressee addr = mAddressBook->findByUid( *it++ ); - if ( !addr.isEmpty() ) { - KABC::Addressee newAddr( addr ); - // We need to set a new uid, otherwise the insert below is - // ignored. This is bad for syncing, but unavoidable, afaiks - newAddr.setUid( KApplication::randomString( 10 ) ); - newAddr.setResource( resource ); - addressBook()->insertAddressee( newAddr ); - const bool inserted = addressBook()->find( newAddr ) != addressBook()->end(); - if ( !copy && inserted ) { - KABLock::self( mAddressBook )->lock( addr.resource() ); - addressBook()->removeAddressee( addr ); - KABLock::self( mAddressBook )->unlock( addr.resource() ); - } - } + if ( copy ) { + CopyToCommand *command = new CopyToCommand( mAddressBook, uidList, resource ); + mCommandHistory->addCommand( command ); + } + else { + MoveToCommand *command = new MoveToCommand( this, uidList, resource ); + mCommandHistory->addCommand( command ); } - KABLock::self( mAddressBook )->unlock( resource ); addressBookChanged(); setModified( true ); @@ -1201,19 +1236,30 @@ void KABCore::initGUI() buttonLayout->setSpacing( KDialog::spacingHint() ); buttonLayout->addStretch( 1 ); - KPushButton *addDistListButton = new KPushButton( mDistListButtonWidget ); - addDistListButton->setText( i18n( "Add" ) ); - connect( addDistListButton, TQT_SIGNAL( clicked() ), + mAddDistListButton = new KPushButton( mDistListButtonWidget ); + mAddDistListButton->setEnabled( false ); + mAddDistListButton->setText( i18n( "Add" ) ); + TQToolTip::add( mAddDistListButton, i18n( "Add contacts to the distribution list" ) ); + TQWhatsThis::add( mAddDistListButton, + i18n( "Click this button if you want to add more contacts to " + "the current distribution list. You will be shown a dialog that allows " + "to enter a list of existing contacts to this distribution list." ) ); + connect( mAddDistListButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( editSelectedDistributionList() ) ); - buttonLayout->addWidget( addDistListButton ); + buttonLayout->addWidget( mAddDistListButton ); mDistListButtonWidget->setShown( false ); viewLayout->addWidget( mDistListButtonWidget ); - KPushButton *removeDistListButton = new KPushButton( mDistListButtonWidget ); - removeDistListButton->setText( i18n( "Remove" ) ); - connect( removeDistListButton, TQT_SIGNAL( clicked() ), + mRemoveDistListButton = new KPushButton( mDistListButtonWidget ); + mRemoveDistListButton->setEnabled( false ); + mRemoveDistListButton->setText( i18n( "Remove" ) ); + TQToolTip::add( mRemoveDistListButton, i18n( "Remove contacts from the distribution list" ) ); + TQWhatsThis::add( mRemoveDistListButton, + i18n( "Click this button if you want to remove the selected contacts from " + "the current distribution list." ) ); + connect( mRemoveDistListButton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeSelectedContactsFromDistList() ) ); - buttonLayout->addWidget( removeDistListButton ); + buttonLayout->addWidget( mRemoveDistListButton ); #endif mFilterSelectionWidget = new FilterSelectionWidget( searchTB , "kde toolbar widget" ); @@ -1566,8 +1612,42 @@ void KABCore::removeSelectedContactsFromDistList() const TQStringList uids = selectedUIDs(); if ( uids.isEmpty() ) return; - for ( TQStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { - dist.removeEntry ( *it ); + + TQStringList names; + TQStringList::ConstIterator it = uids.begin(); + const TQStringList::ConstIterator endIt( uids.end() ); + while ( it != endIt ) { + KABC::Addressee addr = mAddressBook->findByUid( *it ); + names.append( addr.realName().isEmpty() ? addr.preferredEmail() : addr.realName() ); + ++it; + } + + if ( KMessageBox::warningContinueCancelList( + mWidget, + i18n( "<qt>" + "Do you really want to remove this contact from the %1 distribution list?<br>" + "<b>Note:</b>The contact will be not be removed from your addressbook nor from " + "any other distribution list." + "</qt>", + "<qt>" + "Do you really want to remove these %n contacts from the %1 distribution list?<br>" + "<b>Note:</b>The contacts will be not be removed from your addressbook nor from " + "any other distribution list." + "</qt>", + uids.count() ).arg( mSelectedDistributionList ), + names, TQString::null, KStdGuiItem::del() ) == KMessageBox::Cancel ) { + return; + } + + for ( TQStringList::ConstIterator uidIt = uids.begin(); uidIt != uids.end(); ++uidIt ) { + typedef KPIM::DistributionList::Entry::List EntryList; + const EntryList entries = dist.entries( addressBook() ); + for ( EntryList::ConstIterator it = entries.begin(); it != entries.end(); ++it ) { + if ( (*it).addressee.uid() == (*uidIt) ) { + dist.removeEntry( (*it).addressee, (*it).email ); + break; + } + } } addressBook()->insertAddressee( dist ); setModified(); @@ -1631,7 +1711,6 @@ void KABCore::editDistributionList( const KPIM::DistributionList &dist ) if ( dlg->exec() == TQDialog::Accepted && dlg ) { const KPIM::DistributionList newDist = dlg->distributionList(); if ( newDist != dist ) { - addressBook()->insertAddressee( newDist ); setModified(); } } @@ -1648,15 +1727,21 @@ void KABCore::setSelectedDistributionList( const TQString &name ) { mSelectedDistributionList = name; mSearchManager->setSelectedDistributionList( name ); - mViewHeaderLabel->setText( name.isNull() ? i18n( "Contacts" ) : i18n( "Distribution List: %1" ).arg( name ) ); + mViewHeaderLabel->setText( name.isNull() ? + i18n( "Contacts" ) : + i18n( "Distribution List: %1" ).arg( name ) ); mDistListButtonWidget->setShown( !mSelectedDistributionList.isNull() ); if ( !name.isNull() ) { mDetailsStack->raiseWidget( mDistListEntryView ); + if ( selectedUIDs().isEmpty() ) { + mViewManager->setFirstSelected( true ); + } const TQStringList selectedUids = selectedUIDs(); showDistributionListEntry( selectedUids.isEmpty() ? TQString() : selectedUids.first() ); + } else { + mDetailsStack->raiseWidget( mExtensionManager->activeDetailsWidget() ? + mExtensionManager->activeDetailsWidget() : mDetailsWidget ); } - else - mDetailsStack->raiseWidget( mExtensionManager->activeDetailsWidget() ? mExtensionManager->activeDetailsWidget() : mDetailsWidget ); } TQStringList KABCore::distributionListNames() const diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index ac2975106..2e6fded32 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -24,6 +24,8 @@ #ifndef KABCORE_H #define KABCORE_H +#include <config.h> // FOR KDEPIM_NEW_DISTRLISTS + #include <kabc/field.h> #include <tqdict.h> @@ -48,6 +50,7 @@ class KAboutData; class KAction; class KActionCollection; class KConfig; +class KPushButton; class KStatusBar; class KToggleAction; class KXMLGUIClient; @@ -157,7 +160,7 @@ class KDE_EXPORT KABCore : public KAB::Core /** sets the distribution list to display. If null, the regular - address book is to be displayed. + address book is to be displayed. */ virtual void setSelectedDistributionList( const TQString &name ); #endif @@ -308,7 +311,7 @@ class KDE_EXPORT KABCore : public KAB::Core */ virtual void newContact(); - /** + /** DCOP METHOD: Opens distribution list editor to create a new distribution list */ virtual void newDistributionList(); @@ -347,7 +350,7 @@ class KDE_EXPORT KABCore : public KAB::Core * If the adding to the new resource is successfull, the contact is * removed from the old one, unless the Copy flag is given. */ void storeContactIn( const TQString &uid = TQString::null, bool copy = false ); - + /** * Lets the user chose a different resource for the selected contacts and * copies it there. @@ -421,7 +424,7 @@ class KDE_EXPORT KABCore : public KAB::Core void removeSelectedContactsFromDistList(); void editSelectedDistributionList(); - void sendMailToDistributionList( const TQString &id ); + void sendMailToDistributionList( const TQString &id ); private: void initGUI(); @@ -443,6 +446,8 @@ class KDE_EXPORT KABCore : public KAB::Core #ifdef KDEPIM_NEW_DISTRLISTS TQString mSelectedDistributionList; + KPushButton *mAddDistListButton; + KPushButton *mRemoveDistListButton; TQWidget *mDistListButtonWidget; #endif diff --git a/kaddressbook/kabtools.cpp b/kaddressbook/kabtools.cpp index ba3b886f0..7e6b5c9cd 100644 --- a/kaddressbook/kabtools.cpp +++ b/kaddressbook/kabtools.cpp @@ -80,12 +80,15 @@ void KABTools::mailVCards( const TQStringList &uids, KABC::AddressBook *ab ) KABC::VCardConverter converter; KABC::Addressee::List list; list.append( addressee ); +#if defined(KABC_VCARD_ENCODING_FIX) + const TQCString vcard = converter.createVCardsRaw( list, KABC::VCardConverter::v3_0 ); + file.writeBlock( vcard, vcard.length() ); +#else TQString vcard = converter.createVCards( list, KABC::VCardConverter::v3_0 ); - TQTextStream t( &file ); t.setEncoding( TQTextStream::UnicodeUTF8 ); t << vcard; - +#endif file.close(); KURL url( path ); diff --git a/kaddressbook/kaddressbook.desktop b/kaddressbook/kaddressbook.desktop index 92a1ee73a..a636c7760 100644 --- a/kaddressbook/kaddressbook.desktop +++ b/kaddressbook/kaddressbook.desktop @@ -42,7 +42,6 @@ GenericName[hu]=Címjegyzékkezelő GenericName[is]=Vistfangastjóri GenericName[it]=Gestore degli indirizzi GenericName[ja]=アドレスマネージャ -GenericName[ka]=წიგნაკის მმართველი GenericName[kk]=Адрестік кітапшасы GenericName[km]=កម្មវិធីគ្រប់គ្រងអាសយដ្ឋាន GenericName[lt]=Adresų tvarkyklė diff --git a/kaddressbook/kaddressbook_view.desktop b/kaddressbook/kaddressbook_view.desktop index 05e445e39..ffd4e8d5c 100644 --- a/kaddressbook/kaddressbook_view.desktop +++ b/kaddressbook/kaddressbook_view.desktop @@ -28,7 +28,6 @@ Comment[hu]=KAddressBook nézeti bővítőmodul Comment[is]=KAddressbook birtingar íforrit Comment[it]=Plugin visualizzazione di KAddressbook Comment[ja]=Addressbook ビュープラグイン -Comment[ka]= KDE წიგნაკის ჩვენების მოდული Comment[kk]=Адрестік кітапшасын қарау модулі Comment[km]=កម្មវិធីជំនួយទិដ្ឋភាពរបស់ KAddressBook Comment[lt]=KAddressBook peržiūros priedas diff --git a/kaddressbook/kcmconfigs/kabconfig.desktop b/kaddressbook/kcmconfigs/kabconfig.desktop index 17a0b1b5a..f5e5d450d 100644 --- a/kaddressbook/kcmconfigs/kabconfig.desktop +++ b/kaddressbook/kcmconfigs/kabconfig.desktop @@ -36,7 +36,6 @@ Name[hu]=Általános Name[is]=Almennt Name[it]=Generale Name[ja]=全般 -Name[ka]=ზოგადი Name[kk]=Жалпы Name[km]=ទូទៅ Name[lt]=Bendras @@ -62,8 +61,7 @@ Name[ta]=பொதுவான Name[th]=ทั่วไป Name[tr]=Genel Name[uk]=Загальні -Name[uz]=Umumiy -Name[uz@cyrillic]=Умумий +Name[uz]=Умумий Name[zh_CN]=常规 Comment=Configure the Address Book Comment[af]=Stel die adres boek op @@ -94,7 +92,6 @@ Comment[hu]=A címjegyzék beállítása Comment[is]=Stilla vistfangaskrána Comment[it]=Configura la rubrica indirizzi Comment[ja]=アドレス帳設定 -Comment[ka]=წიგნაკის კონფიგურაცია Comment[kk]=Адрестік кітапшаны баптау Comment[km]=កំណត់រចនាសម្ព័ន្ធសៀវភៅអាសយដ្ឋាន Comment[lt]=Konfigūruoti adresų knygelę @@ -120,8 +117,7 @@ Comment[ta]=கேமுகவரிப்புத்தகத்தை கட Comment[tg]=Танзимоти китоби адрес Comment[tr]=Adres Defterini Yapılandır Comment[uk]=Налаштування адресної книги -Comment[uz]=Manzillar daftarini moslash -Comment[uz@cyrillic]=Манзиллар дафтарини мослаш +Comment[uz]=Манзиллар дафтарини мослаш Comment[zh_CN]=配置地址簿 Comment[zh_TW]=設定通訊錄 Keywords=kaddressbook, configure, settings @@ -151,7 +147,6 @@ Keywords[hu]=kaddressbook, konfigurálás, beállítások Keywords[is]=kaddressbook, stillingar, stilla Keywords[it]=kaddressbook, configura, impostazioni Keywords[ja]=kaddressbook 設定 -Keywords[ka]=kaddressbook,კონფიგურაცია, პარამეტრები Keywords[km]=kaddressbook,កំណត់រចនាសម្ព័ន្ធ,ការកំណត់ Keywords[lt]=kaddressbook, configure, settings, konfigūravimas, nustatymai Keywords[mk]=kaddressbook, configure, settings, КАдресар, конфигурирање, конфигурација, поставување @@ -175,6 +170,5 @@ Keywords[ta]=கேமுகவரிப்புத்தகம்,கட்ட Keywords[tg]=kaddressbook,китоби адрес,танзимот Keywords[tr]=kadresdefteri, yapılandırma, ayarlar Keywords[uk]=kaddressbook, налаштування, параметри -Keywords[uz]=kaddressbook, moslash, moslamalar, manzillar daftari -Keywords[uz@cyrillic]=kaddressbook, мослаш, мосламалар, манзиллар дафтари +Keywords[uz]=kaddressbook, мослаш, мосламалар, манзиллар дафтари Keywords[zh_CN]=kaddressbook, configure, settings, 配置, 设置 diff --git a/kaddressbook/kcmconfigs/kabcustomfields.desktop b/kaddressbook/kcmconfigs/kabcustomfields.desktop index f0b7cf1ff..c2d97c0f8 100644 --- a/kaddressbook/kcmconfigs/kabcustomfields.desktop +++ b/kaddressbook/kcmconfigs/kabcustomfields.desktop @@ -37,7 +37,6 @@ Name[hu]=Egyéni lapok Name[is]=Sérsniðnar síður Name[it]=Pagine personalizzate Name[ja]=カスタムページ -Name[ka]=სამომხმარებლო გვერდები Name[kk]=Қосымша парақтар Name[km]=ទំព័រផ្ទាល់ខ្លួន Name[lt]=Pasirinkti puslapiai @@ -89,7 +88,6 @@ Comment[hu]=Az egyéni lapok beállítása Comment[is]=Stilla sérsniðnu síðurnar Comment[it]=Configura le pagine personalizzate Comment[ja]=カスタムページの設定 -Comment[ka]=სამომხმარებლო გვერდების კონფიგურაცია Comment[kk]=Қосымша парақтарды баптау Comment[km]=កំណត់រចនាសម្ព័ន្ធទំព័រផ្ទាល់ខ្លួន Comment[lt]=Konfigūruoti darbastalių skaičių ir pavadinimus @@ -137,7 +135,6 @@ Keywords[hu]=kaddressbook, beállítás, beállítások, egyéni mezők Keywords[is]=kaddressbook, stillingar, stilla, sérsniðnir reitir Keywords[it]=kaddressbook, configura, impostazioni, campi personalizzati Keywords[ja]=kaddressbook、設定、設定,カスタムフィールド -Keywords[ka]=kaddressbook,კონფიგურაცია,პარამეტრები,სამომხმარებლო ველები Keywords[km]=kaddressbook,កំណត់រចនាសម្ព័ន្ធ,ការកំណត់,វាលផ្ទាល់ខ្លួន Keywords[lt]=kaddressbook, configure, settings, custom fields, pasirinkti laukai,konfigūruoti, nustatymai Keywords[mk]=kaddressbook, configure, settings, custom fields, КАдресар, конфигурација, конфигурирање, сопствени полиња diff --git a/kaddressbook/kcmconfigs/kabldapconfig.desktop b/kaddressbook/kcmconfigs/kabldapconfig.desktop index a13645a98..2d29acdf0 100644 --- a/kaddressbook/kcmconfigs/kabldapconfig.desktop +++ b/kaddressbook/kcmconfigs/kabldapconfig.desktop @@ -38,7 +38,6 @@ Name[hu]=LDAP-lekérdezés Name[is]=LDAP uppfletting Name[it]=Ricerca LDAP Name[ja]=LDAP 検索 -Name[ka]= ძებნა LDAP-ში Name[kk]=LDAP іздеу Name[km]=ស្វែងរក LDAP Name[lt]=LDAP paieška @@ -89,7 +88,6 @@ Comment[hu]=A címjegyzék LDAP-beállításainak megváltoztatása Comment[is]=Breyta LDAP stillingum vistfangaskráarinnar Comment[it]=Configurare le impostazioni LDAP della rubrica indirizzi Comment[ja]=アドレス帳 LDAP 設定 -Comment[ka]=LDAP წიგნაკის პარამეტრების კონფიგურაცია Comment[kk]=Адрестік кітапшаның LDAP параметрлерін баптау Comment[km]=កំណត់រចនាសម្ព័ន្ធការកំណត់ LDAP របស់សៀវភៅអាសយដ្ឋាន Comment[lt]=Konfigūruoti adresų knygelės LDAP nustatymus @@ -113,8 +111,7 @@ Comment[ta]=கேமுகவரிபுத்தகத்தை உருவ Comment[tg]=Танзимоти серверҳои LDAP-и китоби адрес Comment[tr]=Adres Defteri LDAP Ayarlarını Yapılandır Comment[uk]=Налаштування параметрів LDAP для адресної книги -Comment[uz]=LDAP manzillar daftarini moslash -Comment[uz@cyrillic]=LDAP манзиллар дафтарини мослаш +Comment[uz]=LDAP манзиллар дафтарини мослаш Comment[zh_CN]=配置地址簿 LDAP 设置 Comment[zh_TW]=設定通訊錄 LDAP 設定 Keywords=kaddressbook, configure, settings, LDAP @@ -142,7 +139,6 @@ Keywords[hu]=kaddressbook, konfiguráció, beállítások, LDAP Keywords[is]=kaddressbook, stillingar, stilla, LDAP Keywords[it]=kaddressbook, configura, impostazioni, LDAP Keywords[ja]=kaddressbook LDAP 設定 -Keywords[ka]=kaddressbook,კონფიგურაცია,პარამეტრები, LDAP Keywords[km]=kaddressbook,កំណត់រចនាសម្ព័ន្ធ,ការកំណត់,LDAP Keywords[lt]=kaddressbook, configure, settings, LDAP, nustatymai, konfigūruoti Keywords[mk]=kaddressbook, configure, settings, LDAP, кадресар, конфигурација, конфигурирање, поставувања @@ -166,6 +162,5 @@ Keywords[ta]=கேமுகவரிபுத்தகம்,கட்டமை Keywords[tg]=kaddressbook, configure, settings, LDAP, китоби адрес, танзимот Keywords[tr]=adres defteri,yapılandırma,ayarlar,LDAP Keywords[uk]=kaddressbook, налаштування, параметри, LDAP -Keywords[uz]=kaddressbook, moslash, moslamalar, manzillar daftari, LDAP -Keywords[uz@cyrillic]=kaddressbook, мослаш, мосламалар, манзиллар дафтари, LDAP +Keywords[uz]=kaddressbook, мослаш, мосламалар, манзиллар дафтари, LDAP Keywords[zh_CN]=kaddressbook, configure, settings, LDAP, 配置, 设置 diff --git a/kaddressbook/ldapsearchdialog.cpp b/kaddressbook/ldapsearchdialog.cpp index fc99562d4..c42ff6693 100644 --- a/kaddressbook/ldapsearchdialog.cpp +++ b/kaddressbook/ldapsearchdialog.cpp @@ -576,7 +576,14 @@ KABC::Addressee::List LDAPSearchDialog::importContactsUnlessTheyExist( const TQV addr.setNote( i18n( "arguments are host name, datetime", "Imported from LDAP directory %1 on %2" ).arg( d->itemToServer[cli], KGlobal::locale()->formatDateTime( now ) ) ); addr.setResource( resource ); mCore->addressBook()->insertAddressee( addr ); - importedAddrs.append( addr.fullEmail() ); + TQString displayString; + if ( !addr.fullEmail().isEmpty() ) { + displayString = addr.fullEmail(); + } + else { + displayString = addr.formattedName(); + } + importedAddrs.append( displayString ); localAddrs.append( addr ); } else { localAddrs.append( existing.first() ); @@ -595,14 +602,15 @@ KABC::Addressee::List LDAPSearchDialog::importContactsUnlessTheyExist( const TQV void LDAPSearchDialog::slotUser2() { #ifdef KDEPIM_NEW_DISTRLISTS - KABC::Resource *resource = mCore->requestResource( this ); - if ( !resource ) return; - const TQValueList<ContactListItem*> selectedItems = d->selectedItems( mResultListView ); if ( selectedItems.isEmpty() ) { KMessageBox::information( this, i18n( "Please select the contacts you want to add to the distribution list." ), i18n( "No Contacts Selected" ) ); return; } + + KABC::Resource *resource = mCore->requestResource( this ); + if ( !resource ) return; + KPIM::DistributionList dist = selectDistributionList(); if ( dist.isEmpty() ) return; @@ -628,6 +636,8 @@ void LDAPSearchDialog::slotUser1() KABC::Resource *resource = mCore->requestResource( this ); if ( !resource ) return; const TQValueList<ContactListItem*> selectedItems = d->selectedItems( mResultListView ); + if( selectedItems.isEmpty() ) + return; importContactsUnlessTheyExist( selectedItems, resource ); } diff --git a/kaddressbook/searchmanager.cpp b/kaddressbook/searchmanager.cpp index 0cd23b5a1..374a1af5b 100644 --- a/kaddressbook/searchmanager.cpp +++ b/kaddressbook/searchmanager.cpp @@ -20,6 +20,7 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ +#include <config.h> // FOR KDEPIM_NEW_DISTRLISTS #include <kabc/addresseelist.h> #include <kdeversion.h> diff --git a/kaddressbook/thumbnailcreator/ldifvcardcreator.cpp b/kaddressbook/thumbnailcreator/ldifvcardcreator.cpp index 0ed562e18..3de0220f0 100644 --- a/kaddressbook/thumbnailcreator/ldifvcardcreator.cpp +++ b/kaddressbook/thumbnailcreator/ldifvcardcreator.cpp @@ -75,7 +75,13 @@ bool VCard_LDIFCreator::readContents( const TQString &path ) text.truncate(0); // read the file +#if defined(KABC_VCARD_ENCODING_FIX) + const TQByteArray data = file.readAll(); + const TQString contents( data ); + const TQCString contentsRaw( data.data(), data.size() ); +#else TQString contents = file.readAll(); +#endif file.close(); // convert the file contents to a KABC::Addressee address @@ -83,7 +89,11 @@ bool VCard_LDIFCreator::readContents( const TQString &path ) KABC::Addressee addr; KABC::VCardConverter converter; +#if defined(KABC_VCARD_ENCODING_FIX) + addrList = converter.parseVCardsRaw( contentsRaw ); +#else addrList = converter.parseVCards( contents ); +#endif if ( addrList.count() == 0 ) if ( !KABC::LDIFConverter::LDIFToAddressee( contents, addrList ) ) return false; diff --git a/kaddressbook/thumbnailcreator/ldifvcardcreator.h b/kaddressbook/thumbnailcreator/ldifvcardcreator.h index 7b5cface5..2de6c7b41 100644 --- a/kaddressbook/thumbnailcreator/ldifvcardcreator.h +++ b/kaddressbook/thumbnailcreator/ldifvcardcreator.h @@ -23,6 +23,7 @@ #include <tqpixmap.h> #include <kio/thumbcreator.h> +#include <kabc/vcardparser.h> // for KABC_VCARD_ENCODING_FIX define class KPixmapSplitter; diff --git a/kaddressbook/thumbnailcreator/ldifvcardthumbnail.desktop b/kaddressbook/thumbnailcreator/ldifvcardthumbnail.desktop index 2eb63ab57..90d73eac3 100644 --- a/kaddressbook/thumbnailcreator/ldifvcardthumbnail.desktop +++ b/kaddressbook/thumbnailcreator/ldifvcardthumbnail.desktop @@ -25,7 +25,6 @@ Name[hu]=Elektronikus névjegykártyák Name[is]=Skrár með rafrænum nafnspjöldum Name[it]=Biglietto da visita elettronico Name[ja]=電子ビジネスカードファイル -Name[ka]=ელექტრონული სავიზიტო ბარათების ფაილები Name[kk]=Электрондық визитка файлдары Name[km]=ឯកសារនាមប័ណ្ណអេឡិចត្រូនិច Name[lt]=Elektroninės verslo kortelės bylos diff --git a/kaddressbook/undocmds.cpp b/kaddressbook/undocmds.cpp index ee9895951..0f6e555d4 100644 --- a/kaddressbook/undocmds.cpp +++ b/kaddressbook/undocmds.cpp @@ -28,6 +28,8 @@ #include <klocale.h> #include <kapplication.h> +#include <kabc/resource.h> + #include "addresseeutil.h" #include "addresseeconfig.h" #include "core.h" @@ -35,6 +37,16 @@ #include "undocmds.h" +bool Command::resourceExist( KABC::Resource *resource ) +{ + TQPtrList<KABC::Resource> lst = addressBook()->resources(); + for ( Resource *res = lst.first(); res; res = lst.next() ) { + if ( res == resource ) + return true; + } + return false; +} + DeleteCommand::DeleteCommand( KABC::AddressBook *addressBook, const TQStringList &uidList) : Command( addressBook ), mUIDList( uidList ) @@ -57,7 +69,8 @@ void DeleteCommand::unexecute() lock()->lock( (*it).resource() ); for ( it = mAddresseeList.begin(); it != endIt; ++it ) { - addressBook()->insertAddressee( *it ); + if ( resourceExist( ( *it ).resource() ) ) + addressBook()->insertAddressee( *it ); lock()->unlock( (*it).resource() ); } @@ -81,7 +94,8 @@ void DeleteCommand::execute() KABC::Addressee::List::ConstIterator addrIt; const KABC::Addressee::List::ConstIterator addrEndIt( mAddresseeList.end() ); for ( addrIt = mAddresseeList.begin(); addrIt != addrEndIt; ++addrIt ) { - addressBook()->removeAddressee( *addrIt ); + if ( resourceExist( ( *addrIt ).resource() ) ) + addressBook()->removeAddressee( *addrIt ); lock()->unlock( (*addrIt).resource() ); } } @@ -107,7 +121,8 @@ void PasteCommand::unexecute() lock()->lock( (*it).resource() ); for ( it = mAddresseeList.begin(); it != endIt; ++it ) { - addressBook()->removeAddressee( *it ); + if ( resourceExist( ( *it ).resource() ) ) + addressBook()->removeAddressee( *it ); lock()->unlock( (*it).resource() ); } } @@ -126,20 +141,19 @@ void PasteCommand::execute() KABC::Addressee::List::Iterator it; const KABC::Addressee::List::Iterator endIt( mAddresseeList.end() ); for ( it = mAddresseeList.begin(); it != endIt; ++it ) { - /** - We have to set a new uid for the contact, otherwise insertAddressee() - ignore it. - */ - (*it).setUid( KApplication::randomString( 10 ) ); - uids.append( (*it).uid() ); - addressBook()->insertAddressee( *it ); + if ( resourceExist( ( *it ).resource() ) ) { + + /** + We have to set a new uid for the contact, otherwise insertAddressee() + ignore it. + */ + (*it).setUid( KApplication::randomString( 10 ) ); + uids.append( (*it).uid() ); + addressBook()->insertAddressee( *it ); + } lock()->unlock( (*it).resource() ); } - TQStringList::ConstIterator uidIt; - const TQStringList::ConstIterator uidEndIt( uids.end() ); - for ( uidIt = uids.begin(); uidIt != uidEndIt; ++uidIt ) - mCore->editContact( *uidIt ); } @@ -163,7 +177,8 @@ void NewCommand::unexecute() lock()->lock( (*it).resource() ); for ( it = mAddresseeList.begin(); it != endIt; ++it ) { - addressBook()->removeAddressee( *it ); + if ( resourceExist( ( *it ).resource() ) ) + addressBook()->removeAddressee( *it ); lock()->unlock( (*it).resource() ); } } @@ -178,7 +193,8 @@ void NewCommand::execute() lock()->lock( (*it).resource() ); for ( it = mAddresseeList.begin(); it != endIt; ++it ) { - addressBook()->insertAddressee( *it ); + if ( resourceExist( ( *it ).resource() ) ) + addressBook()->insertAddressee( *it ); lock()->unlock( (*it).resource() ); } } @@ -199,16 +215,22 @@ TQString EditCommand::name() const void EditCommand::unexecute() { - lock()->lock( mOldAddressee.resource() ); - addressBook()->insertAddressee( mOldAddressee ); - lock()->unlock( mOldAddressee.resource() ); + if ( resourceExist( mOldAddressee.resource() ) ) + { + lock()->lock( mOldAddressee.resource() ); + addressBook()->insertAddressee( mOldAddressee ); + lock()->unlock( mOldAddressee.resource() ); + } } void EditCommand::execute() { - lock()->lock( mNewAddressee.resource() ); - addressBook()->insertAddressee( mNewAddressee ); - lock()->unlock( mNewAddressee.resource() ); + if ( resourceExist( mNewAddressee.resource() ) ) + { + lock()->lock( mNewAddressee.resource() ); + addressBook()->insertAddressee( mNewAddressee ); + lock()->unlock( mNewAddressee.resource() ); + } } @@ -232,7 +254,8 @@ void CutCommand::unexecute() lock()->lock( (*it).resource() ); for ( it = mAddresseeList.begin(); it != endIt; ++it ) { - addressBook()->insertAddressee( *it ); + if ( resourceExist( ( *it ).resource() ) ) + addressBook()->insertAddressee( *it ); lock()->unlock( (*it).resource() ); } @@ -258,7 +281,8 @@ void CutCommand::execute() KABC::Addressee::List::ConstIterator addrIt; const KABC::Addressee::List::ConstIterator addrEndIt( mAddresseeList.end() ); for ( addrIt = mAddresseeList.begin(); addrIt != addrEndIt; ++addrIt ) { - addressBook()->removeAddressee( *addrIt ); + if ( resourceExist( ( *addrIt ).resource() ) ) + addressBook()->removeAddressee( *addrIt ); lock()->unlock( addr.resource() ); } @@ -268,5 +292,115 @@ void CutCommand::execute() QClipboard *cb = TQApplication::clipboard(); mOldText = cb->text(); kapp->processEvents(); +#if defined(KABC_VCARD_ENCODING_FIX) + cb->setText( TQString::fromUtf8( mClipText.data() ) ); +#else cb->setText( mClipText ); +#endif +} + +CopyToCommand::CopyToCommand( KABC::AddressBook *addressBook, const TQStringList &uidList, + KABC::Resource *resource ) + : Command( addressBook ), mUIDList( uidList ), mResource( resource ) +{ +} + +TQString CopyToCommand::name() const +{ + return i18n( "Copy Contact To", "Copy %n Contacts To", mUIDList.count() ); +} + +void CopyToCommand::unexecute() +{ + KABC::Addressee::List::ConstIterator it; + const KABC::Addressee::List::ConstIterator endIt( mAddresseeList.end() ); + //For copy : just remove it from the "copied to" resource. + // lock resources + for ( it = mAddresseeList.begin(); it != endIt; ++it ) + lock()->lock( (*it).resource() ); + + for ( it = mAddresseeList.begin(); it != endIt; ++it ) { + if ( resourceExist( ( *it ).resource() ) ) + addressBook()->removeAddressee( *it ); + lock()->unlock( (*it).resource() ); + } +} + +void CopyToCommand::execute() +{ + KABLock::self( addressBook() )->lock( mResource ); + TQStringList::Iterator it( mUIDList.begin() ); + const TQStringList::Iterator endIt( mUIDList.end() ); + while ( it != endIt ) { + KABC::Addressee addr = addressBook()->findByUid( *it++ ); + if ( !addr.isEmpty() ) { + KABC::Addressee newAddr( addr ); + // We need to set a new uid, otherwise the insert below is + // ignored. This is bad for syncing, but unavoidable, afaiks + newAddr.setUid( KApplication::randomString( 10 ) ); + newAddr.setResource( mResource ); + if ( resourceExist( newAddr.resource() ) ) + addressBook()->insertAddressee( newAddr ); + mAddresseeList.append( newAddr ); + } + } + KABLock::self( addressBook() )->unlock( mResource ); + +} + +MoveToCommand::MoveToCommand( KAB::Core *core, const TQStringList &uidList, + KABC::Resource *resource ) + : Command( core->addressBook() ), mUIDList( uidList ), mResource( resource ), mCore( core ) +{ +} + +TQString MoveToCommand::name() const +{ + return i18n( "Move Contact To", "Move %n Contacts To", mUIDList.count() ); +} + +void MoveToCommand::unexecute() +{ + //For move : remove it from the "copied to" resource and insert it back to "copied from" resource. + KABC::Resource *resource = mCore->requestResource( mCore->widget() ); + if ( !resource ) + return; + moveContactTo( resource ); +} + +void MoveToCommand::execute() +{ + moveContactTo( mResource ); +} + +void MoveToCommand::moveContactTo( KABC::Resource *resource ) +{ + KABLock::self( addressBook() )->lock( resource ); + TQStringList::Iterator it( mUIDList.begin() ); + const TQStringList::Iterator endIt( mUIDList.end() ); + while ( it != endIt ) { + KABC::Addressee addr = addressBook()->findByUid( *it++ ); + if ( !addr.isEmpty() ) { + KABC::Addressee newAddr( addr ); + // We need to set a new uid, otherwise the insert below is + // ignored. This is bad for syncing, but unavoidable, afaiks + TQString uid = KApplication::randomString( 10 ); + newAddr.setUid( uid ); + newAddr.setResource( resource ); + if ( resourceExist( newAddr.resource() ) ) + addressBook()->insertAddressee( newAddr ); + mAddresseeList.append( newAddr ); + mUIDList.append( uid ); + const bool inserted = addressBook()->find( newAddr ) != addressBook()->end(); + if ( inserted ) { + if ( resourceExist( addr.resource() ) ) { + KABLock::self( addressBook() )->lock( addr.resource() ); + addressBook()->removeAddressee( addr ); + KABLock::self( addressBook() )->unlock( addr.resource() ); + } + } + } + } + KABLock::self( addressBook() )->unlock( resource ); + } diff --git a/kaddressbook/undocmds.h b/kaddressbook/undocmds.h index 192a4e80b..43f6aae99 100644 --- a/kaddressbook/undocmds.h +++ b/kaddressbook/undocmds.h @@ -32,6 +32,8 @@ #include <kabc/addressbook.h> #include <kabc/addressee.h> +#include <kabc/vcardparser.h> // for KABC_VCARD_ENCODING_FIX define + #include <kcommand.h> #include "kablock.h" @@ -48,9 +50,9 @@ class Command : public KCommand protected: KABC::AddressBook *addressBook() const { return mAddressBook; } KABLock *lock() const { return KABLock::self( mAddressBook ); } - + bool resourceExist( KABC::Resource *resource ); private: - KABC::AddressBook *mAddressBook; + KABC::AddressBook* mAddressBook; }; class DeleteCommand : public Command @@ -94,7 +96,11 @@ class CutCommand : public Command private: KABC::Addressee::List mAddresseeList; TQStringList mUIDList; +#if defined(KABC_VCARD_ENCODING_FIX) + TQByteArray mClipText; +#else TQString mClipText; +#endif TQString mOldText; }; @@ -127,4 +133,37 @@ class EditCommand : public Command KABC::Addressee mNewAddressee; }; +class CopyToCommand : public Command +{ + public: + CopyToCommand( KABC::AddressBook *addressBook, const TQStringList &uidList, + KABC::Resource *resource ); + + virtual TQString name() const; + virtual void unexecute(); + virtual void execute(); + + private: + KABC::Addressee::List mAddresseeList; + TQStringList mUIDList; + KABC::Resource *mResource; +}; + +class MoveToCommand : public Command +{ + public: + MoveToCommand( KAB::Core *core, const TQStringList &uidList, + KABC::Resource *resource ); + + virtual TQString name() const; + virtual void unexecute(); + virtual void execute(); + void moveContactTo( KABC::Resource *resource ); + + private: + KABC::Addressee::List mAddresseeList; + TQStringList mUIDList; + KABC::Resource *mResource; + KAB::Core *mCore; +}; #endif diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 4e4cd5a65..5dab74e25 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -419,7 +419,7 @@ void ViewManager::dropped( TQDropEvent *e ) if ( e->source() == this ) return; - TQString clipText, vcards; + KABC::Addressee::List list; KURL::List urls; if ( KURLDrag::decode( e, urls) ) { @@ -433,10 +433,7 @@ void ViewManager::dropped( TQDropEvent *e ) } } else if ( c == 1 ) emit urlDropped( *it ); - } else if ( KVCardDrag::decode( e, vcards ) ) { - KABC::VCardConverter converter; - - const KABC::Addressee::List list = converter.parseVCards( vcards ); + } else if ( KVCardDrag::decode( e, list ) ) { KABC::Addressee::List::ConstIterator it; for ( it = list.begin(); it != list.end(); ++it ) { KABC::Addressee a = mCore->addressBook()->findByUid( (*it).uid() ); @@ -467,7 +464,11 @@ void ViewManager::startDrag() KMultipleDrag *drag = new KMultipleDrag( this ); KABC::VCardConverter converter; +#if defined(KABC_VCARD_ENCODING_FIX) + TQCString vcards = converter.createVCardsRaw( addrList ); +#else TQString vcards = converter.createVCards( addrList ); +#endif // Best text representation is given by textdrag, so it must be first drag->addDragObject( new TQTextDrag( AddresseeUtil::addresseesToEmails( addrList ), this ) ); @@ -484,7 +485,11 @@ void ViewManager::startDrag() TQFile tempFile( tempDir.name() + "/" + fileName ); if ( tempFile.open( IO_WriteOnly ) ) { +#if defined(KABC_VCARD_ENCODING_FIX) + tempFile.writeBlock( vcards, vcards.length() ); +#else tempFile.writeBlock( vcards.utf8() ); +#endif tempFile.close(); KURLDrag *urlDrag = new KURLDrag( KURL( tempFile.name() ), this ); diff --git a/kaddressbook/views/cardview.desktop b/kaddressbook/views/cardview.desktop index cb8d35cb0..7dfe4152d 100644 --- a/kaddressbook/views/cardview.desktop +++ b/kaddressbook/views/cardview.desktop @@ -28,7 +28,6 @@ Name[hu]=Kártyanézet Name[is]=Spjaldsýn Name[it]=Vista scheda Name[ja]=カードビュー -Name[ka]=ბარათების ჩვენება Name[kk]=Визитка Name[km]=ទិដ្ឋភាពកាត Name[lt]=Kortelės vaizdas diff --git a/kaddressbook/views/iconview.desktop b/kaddressbook/views/iconview.desktop index 59853a70e..4e99a5c5b 100644 --- a/kaddressbook/views/iconview.desktop +++ b/kaddressbook/views/iconview.desktop @@ -32,7 +32,6 @@ Name[id]=Tampilan Ikon Name[is]=Táknmyndasýn Name[it]=Vista a icone Name[ja]=アイコンビュー -Name[ka]=ხატულების ჩვენება Name[kk]=Таңбаша Name[km]=ទិដ្ឋភាពរូបតំណាង Name[lt]=Rodyti piktogramas @@ -63,8 +62,7 @@ Name[tg]=Ишоротҳо Name[th]=มุมมองแบบไอคอน Name[tr]=Simge Görünümü Name[uk]=Вигляд піктограмами -Name[uz]=Nishoncha koʻrinishida -Name[uz@cyrillic]=Нишонча кўринишида +Name[uz]=Нишонча кўринишида Name[ven]=Mbonalelo ya aikhono Name[vi]=Xem icon Name[xh]=Imboniselo ye Icon diff --git a/kaddressbook/views/tableview.desktop b/kaddressbook/views/tableview.desktop index b07b2a19c..71856c965 100644 --- a/kaddressbook/views/tableview.desktop +++ b/kaddressbook/views/tableview.desktop @@ -28,7 +28,6 @@ Name[hu]=Táblázatos nézet Name[is]=Töflusýn Name[it]=Vista tabella Name[ja]=テーブルビュー -Name[ka]=ცხრილი Name[kk]=Кесте Name[km]=ទិដ្ឋភាពតារាង Name[lt]=Lentelės vaizdas @@ -55,8 +54,7 @@ Name[ta]=அட்டவணை காட்சி Name[tg]=Ҷадвал Name[tr]=Tablo Görünümü Name[uk]=Вигляд таблицею -Name[uz]=Jadval koʻrinishida -Name[uz@cyrillic]=Жадвал кўринишида +Name[uz]=Жадвал кўринишида Name[zh_CN]=表格视图 Name[zh_TW]=表格檢視 Type=Service diff --git a/kaddressbook/xxport/bookmark_xxport.desktop b/kaddressbook/xxport/bookmark_xxport.desktop index 54d337162..186d1378e 100644 --- a/kaddressbook/xxport/bookmark_xxport.desktop +++ b/kaddressbook/xxport/bookmark_xxport.desktop @@ -24,7 +24,6 @@ Name[hi]=केएबी पसंदीदा XXपोर्ट प्लग Name[hu]=KAB könyvjelzőkezelő XXPort bővítőmodul Name[is]=Íforrit fyrir KAB XXPort bókarmerki Name[ja]=KAB ブックマーク インポート/エクスポートプラグイン -Name[ka]=KAB სანიშნეების ექსპორტის მოდული Name[kk]=Бетбелгіні экспорт ету Name[km]=កម្មវិធីជំនួយ KAB Bookmark XXPort Name[lt]=KAB žymelių XXPort priedas @@ -72,7 +71,6 @@ Comment[hu]=Bővítőmodul webcímek exportáláshoz, könyvjelzőként Comment[is]=Íforrit til að skrá vefföng tengiliða sem bókarmerki Comment[it]=Plugin per esportare come segnalibro gli indirizzi web dei contatti Comment[ja]=連絡先のウェブアドレスをブックマークとしてエクスポートするプラグイン -Comment[ka]= კონტაქტების ვებ-მისამართების სანიშნეებად ექსპორტის მოდული Comment[kk]=Контакттың веб адрестерін бетбелгіге экспорттау модулі Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចេញអាសយដ្ឋានបណ្ដាញរបស់ទំនាក់ទំនង ជាចំណាំ Comment[lt]=Priedas skirtas žiniatinklio adresų kontaktuose eksportavimui į žymeles diff --git a/kaddressbook/xxport/csv_xxport.cpp b/kaddressbook/xxport/csv_xxport.cpp index fa4be2c9b..b1ee94047 100644 --- a/kaddressbook/xxport/csv_xxport.cpp +++ b/kaddressbook/xxport/csv_xxport.cpp @@ -49,6 +49,11 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& if ( url.isEmpty() ) return true; + if( TQFileInfo(url.path()).exists() ) { + if(KMessageBox::questionYesNo( parentWidget(), i18n("Do you want to overwrite file \"%1\"").arg( url.path()) ) == KMessageBox::No) + return false; + } + if ( !url.isLocalFile() ) { KTempFile tmpFile; if ( tmpFile.status() != 0 ) { diff --git a/kaddressbook/xxport/csv_xxport.desktop b/kaddressbook/xxport/csv_xxport.desktop index de6a51c42..9031c2226 100644 --- a/kaddressbook/xxport/csv_xxport.desktop +++ b/kaddressbook/xxport/csv_xxport.desktop @@ -24,7 +24,6 @@ Name[hi]=केएबी सीएसवी XXपोर्ट प्लगइन Name[hu]=KAB XXPort bővítőmodul Name[is]=Íforrit fyrir KAV CSV XXPort Name[ja]=KAB CSV インポート/エクスポートプラグイン -Name[ka]=KAB CSV ექსპორტის მოდული Name[kk]=CSV файлды экспорт/импорт ету Name[km]=កម្មវិធីជំនួយ KAB CSV XXPort Name[lt]=KAB CSV XXPort priedas @@ -71,7 +70,6 @@ Comment[hu]=Bővítőmodul névjegyek importálásához/exportálásához, CSV f Comment[is]=Íforrit til að flytja tengiliði inn og út í CSV sniði Comment[it]=Plugin per importare ed esportare contatti in formato CSV Comment[ja]=CSV フォーマットで連絡先をインポート/エクスポートするプラグイン -Comment[ka]=კონტაქტების CSV ფორმატით იმპორტ/ექსპორტის მოდული Comment[kk]=Контакттарды CSV пішіміне экспорт/импорт ету модулі Comment[km]=កម្មវិធី ជំនួយដើម្បីនាំចូល និងនាំចេញទំនាក់ទំនងក្នុងទ្រង់ទ្រាយជា CSV ។ Comment[lt]=Priedas, skirtas kontaktų eksportui ir importui CSV formatu diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp index cfcac0fec..bbcd74d2a 100644 --- a/kaddressbook/xxport/csvimportdialog.cpp +++ b/kaddressbook/xxport/csvimportdialog.cpp @@ -857,6 +857,10 @@ void CSVImportDialog::saveTemplate() if ( !fileName.contains( ".desktop" ) ) fileName += ".desktop"; + if( TQFileInfo(fileName).exists() ) { + if(KMessageBox::questionYesNo( this, i18n("Do you want to overwrite file \"%1\"").arg(fileName) ) == KMessageBox::No) + return; + } TQString name = KInputDialog::getText( i18n( "Template Name" ), i18n( "Please enter a name for the template:" ) ); if ( name.isEmpty() ) diff --git a/kaddressbook/xxport/eudora_xxport.desktop b/kaddressbook/xxport/eudora_xxport.desktop index a075f3f83..10adbfa7e 100644 --- a/kaddressbook/xxport/eudora_xxport.desktop +++ b/kaddressbook/xxport/eudora_xxport.desktop @@ -24,7 +24,6 @@ Name[hi]=केएबी यूडोरा XXपोर्ट प्लगइन Name[hu]=KAB Eudora XXPort bővítőmodul Name[is]=Íforrit fyrir KAB Eudora XXPort Name[ja]=KAB Eudora インポート/エクスポートプラグイン -Name[ka]= KAB Eudora-სთან ექსპორტის მოდული Name[kk]=Eudora-ға экспорт/импорт ету Name[km]=កម្មវិធីជំនួយ KAB Eudora XXPort Name[lt]=KAB Eudora XXPort priedas @@ -72,7 +71,6 @@ Comment[hu]=Bővítőmodul Eudora névjegyek importálásához/exportálásához Comment[is]=Íforrit til að flytja inn og út Eudora tengiliði Comment[it]=Plugin importare ed esportare contatti Eudora Comment[ja]=Eudora の連絡先をインポート/エクスポートするプラグイン -Comment[ka]=Eudora-ს კონტაქტების იმპორტ/ექსპორტის მოდული Comment[kk]=Eudora контакттарды экспорт/импорт ету модулі Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចូល និងនាំចេញទំនាក់ទំនងរបស់ Eudora Comment[lt]=Priedas Eudora kontaktų importui ir eksportui diff --git a/kaddressbook/xxport/gnokii_xxport.desktop b/kaddressbook/xxport/gnokii_xxport.desktop index c937a7d70..e6152fd73 100644 --- a/kaddressbook/xxport/gnokii_xxport.desktop +++ b/kaddressbook/xxport/gnokii_xxport.desktop @@ -24,7 +24,6 @@ Name[hu]=KAB mobiltelefon XXPort bővítőmodul Name[is]=Íforrit fyrir KAB farsíma XXPort Name[it]=Plugin KAB telefono cellulare XXPort Name[ja]=KAB 携帯電話インポート/エクスポートプラグイン -Name[ka]=KAB მობილურ ტელეფონთან ექსპორტის მოდული Name[kk]=Қалта телефонға экспорт/импорт ету Name[km]=កម្មវិធីជំនួយ KAB Mobile Phone XXPort Name[lt]=KAB mobilaus telefono XXPort priedas @@ -72,7 +71,6 @@ Comment[hu]=Mobiltelefonos bővítőmodul címbejegyzések importálásához/exp Comment[is]=Íforrit til að færa tengilið milli póstfangaskrár og farsíma Comment[it]=Plugin per importare ed esportare voci della rubrica da un telefono cellulare Comment[ja]=アドレス帳のエントリをインポート/エクスポートする携帯電話用プラグイン -Comment[ka]=მობილური ტელეფონის მოდული წიგნაკის ელემენტების იმპორტ/ექსპორტისათვის Comment[kk]=Қалта телефонға адр. кітапша жазуын экспорт/импорт ету модулі Comment[km]=កម្មវិធីជំនួយទូរស័ព្ទចល័តដើម្បីនាំចូល និងនាំចេញធាតុសៀវភៅអាសយដ្ឋាន Comment[lt]=Priedas skirtas importuoti ir eksportuoti adresų knygelės įrašus į mobiliuosius telefonus diff --git a/kaddressbook/xxport/kde2_xxport.cpp b/kaddressbook/xxport/kde2_xxport.cpp index 8e754b39c..92a311023 100644 --- a/kaddressbook/xxport/kde2_xxport.cpp +++ b/kaddressbook/xxport/kde2_xxport.cpp @@ -66,9 +66,10 @@ KABC::AddresseeList KDE2XXPort::importContacts( const TQString& ) const proc << "--override"; } else if ( result == KMessageBox::No ) proc << "kab2kabc"; - else + else { kdDebug(5720) << "KAddressBook::importKDE2(): Unknow return value." << endl; - + return KABC::AddresseeList(); + } proc.start( KProcess::Block ); addressBook()->load(); diff --git a/kaddressbook/xxport/kde2_xxport.desktop b/kaddressbook/xxport/kde2_xxport.desktop index f2c20026c..d47d108f5 100644 --- a/kaddressbook/xxport/kde2_xxport.desktop +++ b/kaddressbook/xxport/kde2_xxport.desktop @@ -25,7 +25,6 @@ Name[hi]=केएबी केडीई2 XXपोर्ट प्लगइन Name[hu]=KAB KDE2 XXPort bővítőmodul Name[is]=Íforrit fyrir KAB KDE2 XXPort Name[ja]=KAB KDE2 インポート/プラグイン -Name[ka]=KAB KDE2-ს ექსპორტის მოდული Name[kk]=KDE2 пішімінен импорт ету Name[km]=កម្មវិធីជំនួយ KAB KDE2 XXPort Name[lt]=KAB KDE2 XXPort priedas @@ -73,7 +72,6 @@ Comment[hu]=Bővítőmodul KDE2-es címjegyzék importálásához Comment[is]=Íforrit til að færa inn gömlu KDE2 vistfangaskrána Comment[it]=Plugin per importare le vecchie voci della rubrica di KDE2 Comment[ja]=古い KDE 2 アドレス帳をインポートするプラグイン -Comment[ka]=ძველი KDE2-ს წიგნაკის იმპორტის მოდული Comment[kk]=Ескі KDE2 адр.кітапшасынан импорт ету модулі Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចូលសៀវភៅអាសយដ្ឋាន KDE 2 ចាស់ៗ Comment[lt]=Priedas senosios KDE 2 adresų knygelės importui @@ -97,8 +95,7 @@ Comment[ta]=பழைய KDE 2 கேமுகவரிபுத்தகத் Comment[tg]=Модул барои воридоти файлҳои китобиадресии KDE2 Comment[tr]=KDE 2 adres defteri bilgilerini alma eklentisi Comment[uk]=Втулок для імпорту адресної книги старого формату часів KDE 2 -Comment[uz]=Eski KDE 2 manzillar daftarini import qilish uchun plagin -Comment[uz@cyrillic]=Эски KDE 2 манзиллар дафтарини импорт қилиш учун плагин +Comment[uz]=Эски KDE 2 манзиллар дафтарини импорт қилиш учун плагин Comment[zh_CN]=导入旧的 KDE 2 地址簿的插件 Comment[zh_TW]=匯入舊的 KDE2 通訊錄的外掛程式 Type=Service diff --git a/kaddressbook/xxport/ldif_xxport.cpp b/kaddressbook/xxport/ldif_xxport.cpp index d632d449b..92143c7e2 100644 --- a/kaddressbook/xxport/ldif_xxport.cpp +++ b/kaddressbook/xxport/ldif_xxport.cpp @@ -96,6 +96,12 @@ bool LDIFXXPort::exportContacts( const KABC::AddresseeList &list, const TQString if ( url.isEmpty() ) return true; + if( TQFileInfo(url.path()).exists() ) { + if(KMessageBox::questionYesNo( parentWidget(), i18n("Do you want to overwrite file \"%1\"").arg( url.path()) ) == KMessageBox::No) + return false; + } + + if ( !url.isLocalFile() ) { KTempFile tmpFile; if ( tmpFile.status() != 0 ) { diff --git a/kaddressbook/xxport/ldif_xxport.desktop b/kaddressbook/xxport/ldif_xxport.desktop index abdc10958..1274b4d86 100644 --- a/kaddressbook/xxport/ldif_xxport.desktop +++ b/kaddressbook/xxport/ldif_xxport.desktop @@ -25,7 +25,6 @@ Name[hi]=केएबी एलडीआईएफ XXपोर्ट प्लग Name[hu]=KAB LDIF XXPort bővítőmodul Name[is]=Íforrit fyrir KAB LDIF XXPort Name[ja]=KAB LDIF インポート/エクスポートプラグイン -Name[ka]=KAB LDIF-ის ექსპორტის მოდული Name[kk]=LDIF пішіміне экспорт/импорт ету Name[km]=កម្មវិធីជំនួយ KAB LDIF XXPort Name[lt]=KAB LDIF XXPort priedas @@ -74,7 +73,6 @@ Comment[hu]=Bővítőmodul Netscape és Mozilla LDIF formátumú névjegyek impo Comment[is]=Íforrit sem flytur flytja inn eða út tengiliði í Netscape og Mozilla LDIF sniði Comment[it]=Plugin per importare ed esportare contatti in formato Netscape e Mozilla LDIF Comment[ja]=Netscape と Mozilla の LDIF フォーマットで連絡先をインポート/エクスポートするプラグイン -Comment[ka]= Netscape-სა და Mozilla-ს კონტაქტების იმპორტ/ექსპორტის მოდული LDIF ფორმატით Comment[kk]=Netscape пен Mozilla LDIF пішіміне экспорт/импорт ету модулі Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចូល និងនាំចេញទំនាក់ទំនងក្នុងទ្រង់ទ្រាយជា Netscape និង Mozilla LDIF Comment[lt]=Priedas, skirtas kontaktų importavimui ir eksportavimui Netscape ir Mozilla LDIFF formatu diff --git a/kaddressbook/xxport/opera_xxport.desktop b/kaddressbook/xxport/opera_xxport.desktop index ddbcff7bf..c1d3c2002 100644 --- a/kaddressbook/xxport/opera_xxport.desktop +++ b/kaddressbook/xxport/opera_xxport.desktop @@ -24,7 +24,6 @@ Name[hi]=केएबी ऑपेरा XXपोर्ट प्लगइन Name[hu]=KAB Opera XXPort bővítőmodul Name[is]=Íforrit fyrir KAP Opera XXPort Name[ja]=KAB Opera インポート/エクスポートプラグイン -Name[ka]=KAB Opera-ს ექსპორტის მოდული Name[kk]=Opera пішіміне экспорт/импорт ету Name[km]=កម្មវិធីជំនួយ KAB Opera XXPort Name[lt]=KAB Opera XXPort priedas @@ -72,7 +71,6 @@ Comment[hu]=Bővítőmodul Opera névjegyek importálásához Comment[is]=Íforrit til flytja inn eða út Opera tengiliði Comment[it]=Plugin per importare contatti da Opera Comment[ja]=Opera の連絡先をインポートするプラグイン -Comment[ka]=Opera-ს კონტაქტების იმპორტის მოდული Comment[kk]=Opera контактарын экспорт/импорт ету модулі Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចូលទំនាក់ទំនងរបស់ Opera Comment[lt]=Priedas Opera kontaktų importui diff --git a/kaddressbook/xxport/pab_xxport.desktop b/kaddressbook/xxport/pab_xxport.desktop index e35ad24d4..c0af8e3d6 100644 --- a/kaddressbook/xxport/pab_xxport.desktop +++ b/kaddressbook/xxport/pab_xxport.desktop @@ -23,7 +23,6 @@ Name[hi]=केएबी एमएस एक्सचेंज निजी प Name[hu]=KAB XXPort bővítőmodul MS Exchange személyes címjegyzékekhez Name[is]=Íforrit fyrir KAB MS Exchange Personal Addressbook XXPort Name[ja]=KAB MS Exchange パーソナルアドレス帳インポート/エクスポートプラグイン -Name[ka]= MS Exchange-ის პერსონალური წიგნაკის ექსპორტის მოდული Name[kk]=MS Exchange адрестік кітапшасына экспорт/импорт ету Name[km]=កម្មវិធីជំនួយ KAB MS Exchange Personal Addressbook XXPort Name[lt]=KAB MS Exchange asmeninės adresų knygelės XXPort priedas @@ -72,7 +71,6 @@ Comment[hu]=Bővítőmodul MS Exchange személyes címjegyzékek importálásáh Comment[is]=Íforrit til að flytja tengiliði í eða úr MS Exchange Personal Address Book Comment[it]=Plugin per importare rubriche personali da MS Exchange Comment[ja]=MS Exchange パーソナルアドレス帳をインポートするプラグイン -Comment[ka]=MS Exchange-ის პერსონალური წიგნაკის იმპორტის მოდული Comment[kk]=MS Exchange адрестік кітапшасына экспорт/импорт ету модулі Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចូលសៀវភៅអាសយដ្ឋានផ្ទាល់ខ្លួនរបស់ MS Exchange Comment[lt]=Priedas leidžiantis importuoti MS Exchange asmenines adresų knygeles diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index 85cf8c763..1dfc9bcc4 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp @@ -118,9 +118,15 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS return true; if ( data == "v21" ) +#if defined(KABC_VCARD_ENCODING_FIX) + ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v2_1 ) ); + else + ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v3_0 ) ); +#else ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v2_1 ) ); else ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v3_0 ) ); +#endif } else { TQString msg = i18n( "You have selected a list of contacts, shall they be " "exported to several files?" ); @@ -151,10 +157,15 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS tmpList.append( *it ); if ( data == "v21" ) +#if defined(KABC_VCARD_ENCODING_FIX) + tmpOk = doExport( url, converter.createVCardsRaw( tmpList, KABC::VCardConverter::v2_1 ) ); + else + tmpOk = doExport( url, converter.createVCardsRaw( tmpList, KABC::VCardConverter::v3_0 ) ); +#else tmpOk = doExport( url, converter.createVCards( tmpList, KABC::VCardConverter::v2_1 ) ); else tmpOk = doExport( url, converter.createVCards( tmpList, KABC::VCardConverter::v3_0 ) ); - +#endif ok = ok && tmpOk; } break; @@ -166,9 +177,15 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS return true; if ( data == "v21" ) +#if defined(KABC_VCARD_ENCODING_FIX) + ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v2_1 ) ); + else + ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v3_0 ) ); +#else ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v2_1 ) ); else ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v3_0 ) ); +#endif } } } @@ -182,9 +199,14 @@ KABC::AddresseeList VCardXXPort::importContacts( const TQString& ) const KABC::AddresseeList addrList; KURL::List urls; - if ( !XXPortManager::importData.isEmpty() ) + if ( !XXPortManager::importData.isEmpty() ) { +#if defined(KABC_VCARD_ENCODING_FIX) + TQCString data = XXPortManager::importData.ascii(); + addrList = parseVCard( data ); +#else addrList = parseVCard( XXPortManager::importData ); - else { +#endif + } else { if ( XXPortManager::importURL.isEmpty() ) urls = KFileDialog::getOpenURLs( TQString::null, "*.vcf|vCards", parentWidget(), i18n( "Select vCard to Import" ) ); @@ -203,11 +225,28 @@ KABC::AddresseeList VCardXXPort::importContacts( const TQString& ) const TQFile file( fileName ); if ( file.open( IO_ReadOnly ) ) { +#if defined(KABC_VCARD_ENCODING_FIX) + TQByteArray data = file.readAll(); + file.close(); + if ( data.size() > 0 ) + addrList += parseVCard( data ); +#else TQByteArray rawData = file.readAll(); file.close(); - if ( rawData.size() > 0 ) - addrList += parseVCard( rawData ); - + if ( rawData.size() > 0 ) { + + TQString vCardText; + + // With version 3.0, vCards are encoded with UTF-8 by default. Otherwise, use fromLatin1() + // and hope that are fields are encoded correctly. + if ( TQString::fromLatin1( rawData ).lower().contains( "version:3.0" ) ) { + vCardText = TQString::fromUtf8( rawData ); + } else { + vCardText = TQString::fromLatin1( rawData ); + } + addrList += parseVCard( vCardText ); + } +#endif KIO::NetAccess::removeTempFile( fileName ); } else { TQString text = i18n( "<qt>When trying to read the vCard, there was an error opening the file '%1': %2</qt>" ); @@ -243,6 +282,29 @@ KABC::AddresseeList VCardXXPort::importContacts( const TQString& ) const return addrList; } +#if defined(KABC_VCARD_ENCODING_FIX) +KABC::AddresseeList VCardXXPort::parseVCard( const TQByteArray &data ) const +{ + KABC::VCardConverter converter; + + return converter.parseVCardsRaw( data.data() ); +} + +bool VCardXXPort::doExport( const KURL &url, const TQByteArray &data ) +{ + if( TQFileInfo(url.path()).exists() ) { + if(KMessageBox::questionYesNo( parentWidget(), i18n("Do you want to overwrite file \"%1\"").arg( url.path()) ) == KMessageBox::No) + return false; + } + KTempFile tmpFile; + tmpFile.setAutoDelete( true ); + + tmpFile.file()->writeBlock( data.data(), data.size() ); + tmpFile.close(); + + return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); +} +#else KABC::AddresseeList VCardXXPort::parseVCard( const TQString &data ) const { KABC::VCardConverter converter; @@ -252,6 +314,10 @@ KABC::AddresseeList VCardXXPort::parseVCard( const TQString &data ) const bool VCardXXPort::doExport( const KURL &url, const TQString &data ) { + if( TQFileInfo(url.path()).exists() ) { + if(KMessageBox::questionYesNo( parentWidget(), i18n("Do you want to overwrite file \"%1\"").arg( url.path()) ) == KMessageBox::No) + return false; + } KTempFile tmpFile; tmpFile.setAutoDelete( true ); @@ -263,6 +329,7 @@ bool VCardXXPort::doExport( const KURL &url, const TQString &data ) return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); } +#endif KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addrList ) { diff --git a/kaddressbook/xxport/vcard_xxport.desktop b/kaddressbook/xxport/vcard_xxport.desktop index d0a0146a2..0745d5a52 100644 --- a/kaddressbook/xxport/vcard_xxport.desktop +++ b/kaddressbook/xxport/vcard_xxport.desktop @@ -25,7 +25,6 @@ Name[hi]=केएबी वी-कार्डXXपोर्ट प्लगइ Name[hu]=KAB vCard XXPort bővítőmodul Name[is]=Íforrit fyrir KAB vCard XXPort Name[ja]=KAB vCazrd インポート/エクスポートプラグイン -Name[ka]=KAB vCard ექსპორტის მოდული Name[kk]=vCard-ты экспорт/импорт ету Name[km]=កម្មវិធីជំនួយ KAB vCard XXPort Name[lt]=KAB vCard XXPort priedas @@ -74,7 +73,6 @@ Comment[hu]=Bővítőmodul vCard névjegyek importálásához/exportálásához Comment[is]=Íforrit til að flytja inn eða út tengiliði í vCard sniði Comment[it]=Plugin per importare ed esportare contatti in formato vCard Comment[ja]=vCard フォーマットで連絡先をインポート/エクスポートするプラグイン -Comment[ka]=კონტაქტების vCard-ის ფორმატით იმპორტ/ექსპორტის მოდული Comment[kk]=vCard пішіміне экспорт/импорт ету модулі Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចូល និងនាំចេញទំនាក់ទំនងក្នុងទ្រង់ទ្រាយជា vCard Comment[lt]=Įskiepis kontaktų importavimui ir eksportavimui vCard formatu diff --git a/kaddressbook/xxport/vcard_xxport.h b/kaddressbook/xxport/vcard_xxport.h index 8208e23c6..191d37a39 100644 --- a/kaddressbook/xxport/vcard_xxport.h +++ b/kaddressbook/xxport/vcard_xxport.h @@ -25,6 +25,7 @@ #define VCARD_XXPORT_H #include <xxport.h> +#include <kabc/vcardparser.h> // for KABC_VCARD_ENCODING_FIX define class VCardXXPort : public KAB::XXPort { @@ -40,8 +41,13 @@ class VCardXXPort : public KAB::XXPort KABC::AddresseeList importContacts( const TQString &data ) const; private: - KABC::AddresseeList parseVCard( const TQString &data ) const; - bool doExport( const KURL &url, const TQString &data ); +#if defined(KABC_VCARD_ENCODING_FIX) + KABC::AddresseeList parseVCard( const TQByteArray &data ) const; + bool doExport( const KURL &url, const TQByteArray &data ); +#else + KABC::AddresseeList parseVCard( const TQString &data ) const; + bool doExport( const KURL &url, const TQString &data ); +#endif void addKey( KABC::Addressee &addr, KABC::Key::Types type ); KABC::AddresseeList filterContacts( const KABC::AddresseeList& ); diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index c46855c47..aee87fd46 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp @@ -39,7 +39,7 @@ #include "xxportmanager.h" KURL XXPortManager::importURL = KURL(); -TQString XXPortManager::importData = TQString::null; +TQString XXPortManager::importData = TQString(); XXPortManager::XXPortManager( KAB::Core *core, TQObject *parent, const char *name ) : TQObject( parent, name ), mCore( core ) |