-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 7 | ||||
-rw-r--r-- | kaddressbook/xxportmanager.cpp | 37 | ||||
-rw-r--r-- | kaddressbook/xxportmanager.h | 1 |
3 files changed, 33 insertions, 12 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index f369169..293aaea 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt @@ -575,25 +575,24 @@ { "Tabulator","Tabulator" },
{ "Space","Leerzeichen" },
{ "1","1" },
{ """,""" },
{ "'","'" },
{ "Start at line:","Beginne mit Zeile:" },
{ "Textquote:","Textquote:" },
{ "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" },
{ "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" },
{ "Override previously imported entries?","Überschreibe bereits importierte Einträge?" },
{ "Select vCard to Import","Selektiere zu importierende vCard" },
{ "Information","Information" },
-{ "contacts successfully imported.","Kontakte erfolgreich importiert." },
{ "Import xml file","Importiere xml Datei" },
{ "Choose contact selection","Wähle Kontakt Auswahl" },
{ "Select the entire address book","Wähle das ganze Adressbuch" },
{ "Only contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","Nur in KA/Pi selektierte Kontate.\nDiese Option ist nicht verfügbar\nwhen keine Kontakte selektiert sind." },
{ "Only contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","Nur Kontakte die auf den Filter zutreffen.\nDiese Option ist nicht verfügbar, wenn keine Filter definiert sind." },
{ "Only contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","Nur Kontakte die Mitglieder der Kategirien sind,\die links selektiert sind.\nDiese Option ist nicht verfügbar, wenn es keine Kategirien gibt." },
{ "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." },
{ "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." },
{ "I/O device: ","I/O device: " },
{ "Connection: ","Connection: " },
{ "Model(opt.): ","Model(opt.): " },
{ "Exporting to phone...","Exportiere aufs Handy..." },
@@ -801,21 +800,21 @@ { "Receiving file from remote...","Empfange entfernte Datei..." },
{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
{ "Writing back file ...","Schreibe Datei zurück..." },
{ "Sending back file ...","Sende Datei zurück..." },
{ "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" },
{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
{ "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" },
{ "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" },
-{ "","" },
-{ "","" },
-{ "","" },
+{ "%1 contacts\nsuccessfully\nimported.","%1 Kontakte\nerfolgreich\nimportiert." },
+{ "Import this contact?","Importiere diesen Kontakt?" },
+{ "Import all!","Importiere alle!" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
\ No newline at end of file diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 89a2626..7cb67ed 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp @@ -115,48 +115,65 @@ void XXPortManager::slotImport( const QString &identifier, const QString &data ) { XXPortObject *obj = mXXPortObjects[ identifier ]; if ( !obj ) { KMessageBox::error( mCore, i18n( "<qt>No import plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); return; } KABC::Resource *resource = mCore->requestResource( mCore ); if ( !resource ) return; KABC::AddresseeList list = obj->importContacts( data ); + bool useUndo = ( list.count() < 25 ); +#ifdef DESKTOP_VERSION + useUndo = true; +#endif + mShowPreview = true; KABC::AddresseeList::Iterator it; bool imported = false; + int count = 0; for ( it = list.begin(); it != list.end(); ++it ) { if ( mShowPreview ) { PreviewDialog dlg( *it, mCore ); - if ( !dlg.exec() ) + connect( &dlg, SIGNAL( closeClicked() ), this, SLOT ( noPreview()) ); + if ( !dlg.exec() ) { + if ( mShowPreview ) continue; } + } (*it).setResource( resource ); + if ( useUndo ) { // We use a PwNewCommand so the user can undo it. PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); UndoStack::instance()->push( command ); RedoStack::instance()->clear(); + } else { + ++count; + mCore->addressBook()->insertAddressee( (*it), true, true ); + } imported = true; } if ( imported ) { - KMessageBox::information( mCore, i18n( "contacts successfully imported." ) ); + KMessageBox::information( mCore, i18n( "%1 contacts\nsuccessfully\nimported.").arg( count) ); emit modified(); } } - +void XXPortManager::noPreview() +{ + mShowPreview = false; +} void XXPortManager::slotExport( const QString &identifier, const QString &data ) { XXPortObject *obj = mXXPortObjects[ identifier ]; if ( !obj ) { KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); return; } KABC::AddresseeList addrList; XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore ); if ( dlg.exec() ) addrList = dlg.contacts(); @@ -213,30 +230,34 @@ void XXPortManager::loadPlugins() mXXPortObjects.insert( obj->identifier(), obj ); connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), this, SLOT( slotExport( const QString&, const QString& ) ) ); connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), this, SLOT( slotImport( const QString&, const QString& ) ) ); } } } PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, const char *name ) - : KDialogBase( Plain, i18n( "Contact Preview" ), Ok | Cancel, Ok, parent, - name, true, true ) + : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent, + name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) { QWidget *page = plainPage(); QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); + connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); + connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); KABC::AddresseeView *view = new KABC::AddresseeView( page ); view->setAddressee( addr ); - layout->addWidget( view ); - - resize( 400, 300 ); +#ifdef DESKTOP_VERSION + resize( 640, 480 ); +#else + showMaximized(); +#endif } #ifndef KAB_EMBEDDED #include "xxportmanager.moc" #endif //KAB_EMBEDDED diff --git a/kaddressbook/xxportmanager.h b/kaddressbook/xxportmanager.h index f8436ed..e801d9b 100644 --- a/kaddressbook/xxportmanager.h +++ b/kaddressbook/xxportmanager.h @@ -55,24 +55,25 @@ class XXPortManager : public QObject static KURL importURL; static QString importData; public slots: void importVCard( const KURL &url ); void importVCard( const KURL &url, bool showPreview ); void importVCard( const QString &vCard, bool showPreview ); signals: void modified(); protected slots: + void noPreview(); void slotImport( const QString&, const QString& ); void slotExport( const QString&, const QString& ); private: void loadPlugins(); QDict<XXPortObject> mXXPortObjects; KABCore *mCore; bool mShowPreview; }; |