-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 7 | ||||
-rw-r--r-- | kaddressbook/xxportmanager.cpp | 47 | ||||
-rw-r--r-- | kaddressbook/xxportmanager.h | 3 |
3 files changed, 39 insertions, 18 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 | |||
@@ -571,33 +571,32 @@ | |||
571 | { "File to import:","Datei zum Import:" }, | 571 | { "File to import:","Datei zum Import:" }, |
572 | { "Delimiter","Trennzeichen" }, | 572 | { "Delimiter","Trennzeichen" }, |
573 | { "Comma","Komma" }, | 573 | { "Comma","Komma" }, |
574 | { "Semicolon","Semikolon" }, | 574 | { "Semicolon","Semikolon" }, |
575 | { "Tabulator","Tabulator" }, | 575 | { "Tabulator","Tabulator" }, |
576 | { "Space","Leerzeichen" }, | 576 | { "Space","Leerzeichen" }, |
577 | { "1","1" }, | 577 | { "1","1" }, |
578 | { """,""" }, | 578 | { """,""" }, |
579 | { "'","'" }, | 579 | { "'","'" }, |
580 | { "Start at line:","Beginne mit Zeile:" }, | 580 | { "Start at line:","Beginne mit Zeile:" }, |
581 | { "Textquote:","Textquote:" }, | 581 | { "Textquote:","Textquote:" }, |
582 | { "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" }, | 582 | { "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" }, |
583 | { "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" }, | 583 | { "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" }, |
584 | { "Override previously imported entries?","Überschreibe bereits importierte Einträge?" }, | 584 | { "Override previously imported entries?","Überschreibe bereits importierte Einträge?" }, |
585 | { "Select vCard to Import","Selektiere zu importierende vCard" }, | 585 | { "Select vCard to Import","Selektiere zu importierende vCard" }, |
586 | { "Information","Information" }, | 586 | { "Information","Information" }, |
587 | { "contacts successfully imported.","Kontakte erfolgreich importiert." }, | ||
588 | { "Import xml file","Importiere xml Datei" }, | 587 | { "Import xml file","Importiere xml Datei" }, |
589 | { "Choose contact selection","Wähle Kontakt Auswahl" }, | 588 | { "Choose contact selection","Wähle Kontakt Auswahl" }, |
590 | { "Select the entire address book","Wähle das ganze Adressbuch" }, | 589 | { "Select the entire address book","Wähle das ganze Adressbuch" }, |
591 | { "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." }, | 590 | { "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." }, |
592 | { "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." }, | 591 | { "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." }, |
593 | { "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." }, | 592 | { "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." }, |
594 | { "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." }, | 593 | { "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." }, |
595 | { "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." }, | 594 | { "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." }, |
596 | { "I/O device: ","I/O device: " }, | 595 | { "I/O device: ","I/O device: " }, |
597 | { "Connection: ","Connection: " }, | 596 | { "Connection: ","Connection: " }, |
598 | { "Model(opt.): ","Model(opt.): " }, | 597 | { "Model(opt.): ","Model(opt.): " }, |
599 | { "Exporting to phone...","Exportiere aufs Handy..." }, | 598 | { "Exporting to phone...","Exportiere aufs Handy..." }, |
600 | { "Error exporting to phone","Fehler beim Export aufs Handy" }, | 599 | { "Error exporting to phone","Fehler beim Export aufs Handy" }, |
601 | { "contacts successfully exported.","Kontakte erfolgreich exportiert." }, | 600 | { "contacts successfully exported.","Kontakte erfolgreich exportiert." }, |
602 | { "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, | 601 | { "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, |
603 | { "Set formatted name","Setze formatierten Namen" }, | 602 | { "Set formatted name","Setze formatierten Namen" }, |
@@ -797,25 +796,25 @@ | |||
797 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, | 796 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, |
798 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, | 797 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, |
799 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, | 798 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, |
800 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, | 799 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, |
801 | { "Receiving file from remote...","Empfange entfernte Datei..." }, | 800 | { "Receiving file from remote...","Empfange entfernte Datei..." }, |
802 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, | 801 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, |
803 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, | 802 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, |
804 | { "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" }, | 803 | { "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" }, |
805 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, | 804 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, |
806 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, | 805 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, |
807 | { "Writing back file ...","Schreibe Datei zurück..." }, | 806 | { "Writing back file ...","Schreibe Datei zurück..." }, |
808 | { "Sending back file ...","Sende Datei zurück..." }, | 807 | { "Sending back file ...","Sende Datei zurück..." }, |
809 | { "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" }, | 808 | { "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" }, |
810 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, | 809 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, |
811 | { "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" }, | 810 | { "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" }, |
812 | { "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" }, | 811 | { "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" }, |
813 | { "","" }, | 812 | { "%1 contacts\nsuccessfully\nimported.","%1 Kontakte\nerfolgreich\nimportiert." }, |
814 | { "","" }, | 813 | { "Import this contact?","Importiere diesen Kontakt?" }, |
815 | { "","" }, | 814 | { "Import all!","Importiere alle!" }, |
816 | { "","" }, | 815 | { "","" }, |
817 | { "","" }, | 816 | { "","" }, |
818 | { "","" }, | 817 | { "","" }, |
819 | { "","" }, | 818 | { "","" }, |
820 | { "","" }, | 819 | { "","" }, |
821 | { "","" }, \ No newline at end of file | 820 | { "","" }, \ 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 | |||
@@ -111,56 +111,73 @@ void XXPortManager::importVCard( const QString &vCard, bool showPreview ) | |||
111 | importData = ""; | 111 | importData = ""; |
112 | } | 112 | } |
113 | 113 | ||
114 | void XXPortManager::slotImport( const QString &identifier, const QString &data ) | 114 | void XXPortManager::slotImport( const QString &identifier, const QString &data ) |
115 | { | 115 | { |
116 | XXPortObject *obj = mXXPortObjects[ identifier ]; | 116 | XXPortObject *obj = mXXPortObjects[ identifier ]; |
117 | if ( !obj ) { | 117 | if ( !obj ) { |
118 | KMessageBox::error( mCore, i18n( "<qt>No import plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); | 118 | KMessageBox::error( mCore, i18n( "<qt>No import plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); |
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | 121 | ||
122 | KABC::Resource *resource = mCore->requestResource( mCore ); | 122 | KABC::Resource *resource = mCore->requestResource( mCore ); |
123 | if ( !resource ) | 123 | if ( !resource ) |
124 | return; | 124 | return; |
125 | 125 | ||
126 | KABC::AddresseeList list = obj->importContacts( data ); | 126 | KABC::AddresseeList list = obj->importContacts( data ); |
127 | bool useUndo = ( list.count() < 25 ); | ||
128 | #ifdef DESKTOP_VERSION | ||
129 | useUndo = true; | ||
130 | #endif | ||
131 | mShowPreview = true; | ||
127 | KABC::AddresseeList::Iterator it; | 132 | KABC::AddresseeList::Iterator it; |
128 | bool imported = false; | 133 | bool imported = false; |
134 | int count = 0; | ||
129 | for ( it = list.begin(); it != list.end(); ++it ) { | 135 | for ( it = list.begin(); it != list.end(); ++it ) { |
130 | if ( mShowPreview ) { | 136 | if ( mShowPreview ) { |
131 | PreviewDialog dlg( *it, mCore ); | 137 | PreviewDialog dlg( *it, mCore ); |
132 | if ( !dlg.exec() ) | 138 | connect( &dlg, SIGNAL( closeClicked() ), this, SLOT ( noPreview()) ); |
133 | continue; | 139 | if ( !dlg.exec() ) { |
140 | if ( mShowPreview ) | ||
141 | continue; | ||
142 | } | ||
134 | } | 143 | } |
135 | 144 | ||
136 | (*it).setResource( resource ); | 145 | (*it).setResource( resource ); |
137 | // We use a PwNewCommand so the user can undo it. | 146 | if ( useUndo ) { |
138 | PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); | 147 | // We use a PwNewCommand so the user can undo it. |
139 | UndoStack::instance()->push( command ); | 148 | PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); |
140 | RedoStack::instance()->clear(); | 149 | UndoStack::instance()->push( command ); |
150 | RedoStack::instance()->clear(); | ||
151 | } else { | ||
152 | ++count; | ||
153 | mCore->addressBook()->insertAddressee( (*it), true, true ); | ||
154 | } | ||
141 | imported = true; | 155 | imported = true; |
142 | } | 156 | } |
143 | 157 | ||
144 | if ( imported ) { | 158 | if ( imported ) { |
145 | KMessageBox::information( mCore, i18n( "contacts successfully imported." ) ); | 159 | KMessageBox::information( mCore, i18n( "%1 contacts\nsuccessfully\nimported.").arg( count) ); |
146 | 160 | ||
147 | emit modified(); | 161 | emit modified(); |
148 | } | 162 | } |
149 | } | 163 | } |
150 | 164 | void XXPortManager::noPreview() | |
165 | { | ||
166 | mShowPreview = false; | ||
167 | } | ||
151 | void XXPortManager::slotExport( const QString &identifier, const QString &data ) | 168 | void XXPortManager::slotExport( const QString &identifier, const QString &data ) |
152 | { | 169 | { |
153 | XXPortObject *obj = mXXPortObjects[ identifier ]; | 170 | XXPortObject *obj = mXXPortObjects[ identifier ]; |
154 | if ( !obj ) { | 171 | if ( !obj ) { |
155 | KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); | 172 | KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); |
156 | return; | 173 | return; |
157 | } | 174 | } |
158 | 175 | ||
159 | KABC::AddresseeList addrList; | 176 | KABC::AddresseeList addrList; |
160 | XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore ); | 177 | XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore ); |
161 | if ( dlg.exec() ) | 178 | if ( dlg.exec() ) |
162 | addrList = dlg.contacts(); | 179 | addrList = dlg.contacts(); |
163 | else | 180 | else |
164 | return; | 181 | return; |
165 | if ( !obj->exportContacts( addrList, data ) ) | 182 | if ( !obj->exportContacts( addrList, data ) ) |
166 | KMessageBox::error( mCore, i18n( "Unable to export contacts." ) ); | 183 | KMessageBox::error( mCore, i18n( "Unable to export contacts." ) ); |
@@ -209,34 +226,38 @@ void XXPortManager::loadPlugins() | |||
209 | 226 | ||
210 | XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); | 227 | XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); |
211 | if ( obj ) { | 228 | if ( obj ) { |
212 | mCore->addGUIClient( obj ); | 229 | mCore->addGUIClient( obj ); |
213 | mXXPortObjects.insert( obj->identifier(), obj ); | 230 | mXXPortObjects.insert( obj->identifier(), obj ); |
214 | connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), | 231 | connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), |
215 | this, SLOT( slotExport( const QString&, const QString& ) ) ); | 232 | this, SLOT( slotExport( const QString&, const QString& ) ) ); |
216 | connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), | 233 | connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), |
217 | this, SLOT( slotImport( const QString&, const QString& ) ) ); | 234 | this, SLOT( slotImport( const QString&, const QString& ) ) ); |
218 | } | 235 | } |
219 | } | 236 | } |
220 | } | 237 | } |
221 | 238 | ||
222 | 239 | ||
223 | PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, | 240 | PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, |
224 | const char *name ) | 241 | const char *name ) |
225 | : KDialogBase( Plain, i18n( "Contact Preview" ), Ok | Cancel, Ok, parent, | 242 | : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent, |
226 | name, true, true ) | 243 | name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) |
227 | { | 244 | { |
228 | QWidget *page = plainPage(); | 245 | QWidget *page = plainPage(); |
229 | QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); | 246 | QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); |
247 | connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); | ||
248 | connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); | ||
230 | 249 | ||
231 | KABC::AddresseeView *view = new KABC::AddresseeView( page ); | 250 | KABC::AddresseeView *view = new KABC::AddresseeView( page ); |
232 | view->setAddressee( addr ); | 251 | view->setAddressee( addr ); |
233 | |||
234 | layout->addWidget( view ); | 252 | layout->addWidget( view ); |
235 | 253 | #ifdef DESKTOP_VERSION | |
236 | resize( 400, 300 ); | 254 | resize( 640, 480 ); |
255 | #else | ||
256 | showMaximized(); | ||
257 | #endif | ||
237 | } | 258 | } |
238 | 259 | ||
239 | #ifndef KAB_EMBEDDED | 260 | #ifndef KAB_EMBEDDED |
240 | #include "xxportmanager.moc" | 261 | #include "xxportmanager.moc" |
241 | #endif //KAB_EMBEDDED | 262 | #endif //KAB_EMBEDDED |
242 | 263 | ||
diff --git a/kaddressbook/xxportmanager.h b/kaddressbook/xxportmanager.h index f8436ed..e801d9b 100644 --- a/kaddressbook/xxportmanager.h +++ b/kaddressbook/xxportmanager.h | |||
@@ -50,30 +50,31 @@ class XXPortManager : public QObject | |||
50 | ~XXPortManager(); | 50 | ~XXPortManager(); |
51 | 51 | ||
52 | void restoreSettings(); | 52 | void restoreSettings(); |
53 | void saveSettings(); | 53 | void saveSettings(); |
54 | 54 | ||
55 | static KURL importURL; | 55 | static KURL importURL; |
56 | static QString importData; | 56 | static QString importData; |
57 | 57 | ||
58 | public slots: | 58 | public slots: |
59 | void importVCard( const KURL &url ); | 59 | void importVCard( const KURL &url ); |
60 | void importVCard( const KURL &url, bool showPreview ); | 60 | void importVCard( const KURL &url, bool showPreview ); |
61 | void importVCard( const QString &vCard, bool showPreview ); | 61 | void importVCard( const QString &vCard, bool showPreview ); |
62 | 62 | ||
63 | signals: | 63 | signals: |
64 | void modified(); | 64 | void modified(); |
65 | 65 | ||
66 | protected slots: | 66 | protected slots: |
67 | void noPreview(); | ||
67 | void slotImport( const QString&, const QString& ); | 68 | void slotImport( const QString&, const QString& ); |
68 | void slotExport( const QString&, const QString& ); | 69 | void slotExport( const QString&, const QString& ); |
69 | 70 | ||
70 | private: | 71 | private: |
71 | void loadPlugins(); | 72 | void loadPlugins(); |
72 | 73 | ||
73 | QDict<XXPortObject> mXXPortObjects; | 74 | QDict<XXPortObject> mXXPortObjects; |
74 | 75 | ||
75 | KABCore *mCore; | 76 | KABCore *mCore; |
76 | bool mShowPreview; | 77 | bool mShowPreview; |
77 | }; | 78 | }; |
78 | 79 | ||
79 | #endif | 80 | #endif |