summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt7
-rw-r--r--kaddressbook/xxportmanager.cpp47
-rw-r--r--kaddressbook/xxportmanager.h3
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
@@ -539,97 +539,96 @@
{ "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " },
{ "Manage new Categories","Verwalte neue Kategorien" },
{ "Add to category list","Füge zur Kategorieliste hinzu" },
{ "Remove from addressees","Entferne von den Kontakten" },
{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" },
{ "A&dd","Hinzufügen" },
{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." },
{ "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" },
{ "Export to mobile phone!","Exportiere auf das Handy!" },
{ "Export to phone options","Export ans Handy Optionen" },
{ "Writing to phone...","Sende Daten ans Handy..." },
{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" },
{ "Retry","Nochmal versuchen" },
{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" },
{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" },
{ "Error exporting to phone!","Fehler beim Export auf das Handy!" },
{ "&Print View","Drucke Ansicht" },
{ "&Print Details","Drucke Details" },
{ "Beam v&Card(s)...","Beame v&Card(s)..." },
{ "Set formatted name...","Setze formatierten Namen..." },
{ "Kde Sync HowTo","Kde Sync HowTo" },
{ "Multi Sync HowTo","Multi Sync HowTo" },
{ "&Beam","&Beame" },
{ "Edit Email Addresses","Editiere Email Adressen" },
{ "Email address:","Email Adresse:" },
{ "Change","Ändere" },
{ "Set Standard","Setze Standard" },
{ "New Contact","Neuer Contact" },
{ "Undo %1","Rückgängig %1" },
{ "Redo","Wiederholen" },
{ "Saving ... please wait! ","Am Speichern ... bitte warten! " },
{ "CSV Import Dialog","CSV Import Dialog" },
{ "File to import:","Datei zum Import:" },
{ "Delimiter","Trennzeichen" },
{ "Comma","Komma" },
{ "Semicolon","Semikolon" },
{ "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..." },
{ "Error exporting to phone","Fehler beim Export aufs Handy" },
{ "contacts successfully exported.","Kontakte erfolgreich exportiert." },
{ "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?" },
{ "Set formatted name","Setze formatierten Namen" },
{ "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." },
{ "Set formatted name to:","Setze formatierten Name auf:" },
{ "Simple: James Bond","Einfach: James Bond" },
{ "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" },
{ "Reverse: Bond, James","Umgekehrt: Bond, James" },
{ "Organization: MI6","Organisation: MI6" },
{ "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." },
{ "Select contact list","Selektiere Kontakt Liste" },
{ "Changing contact #%1","Ändere Kontakt #%1" },
{ "Refreshing view...","Lade Ansicht neu..." },
{ "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" },
{ "Removing voice...","Entferne voice..." },
{ "Remove voice completed!","Entferne voice beendet!" },
{ "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" },
{ "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" },
{ "Setting categories completed!","Setzen der Kategorien beendet!" },
{ "OK","OK" },
{ "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." },
{ "Processing contact #%1","Bearbeite Kontakt #%1" },
{ " categories added to list! "," Kategorien zur Liste hinzugefügt! " },
{ "%1: %2","%1: %2" },
{ "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" },
{ "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" },
{ "Cut","Ausschneiden" },
{ "Paste","Einfügen" },
{ "Delete","Löschen" },
{ "Choose...","Wähle..." },
{ "Add View","Ansicht hinzufügen" },
{ "View name:","Ansicht Name:" },
{ "View Type","Typ der Ansicht" },
{ "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." },
{ "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." },
@@ -765,57 +764,57 @@
{ " days"," Tage" },
{ "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." },
{ "Backup Failed!","Backup Problem!" },
{ "Try again now","Versuche jetzt nochmal" },
{ "Try again later","Versuche später nochmal" },
{ "Try again tomorrow","Versuche morgen nochmal" },
{ "Disable backup","Schalte Backup ab" },
{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
{ "Choose action","Wähle Aktion" },
{ "&Configure KA/Pi...","Konfiguriere KA/Pi..." },
{ "Global Settings...","Globale Einstellungen..." },
{ "Spouse","Ehegatte" },
{ "Notes","Notizen" },
{ "Messanger","Messanger" },
{ "Assistant","Assistent" },
{ "Manager","Manager" },
{ "Secrecy","Sichtbar" },
{ "male","männlich" },
{ "female","weiblich" },
{ "Hide!","Verbergen!" },
{ "Show!","Anzeigen!" },
{ "Details","Details" },
{ "Search:","Suche:" },
{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
{ "Pi-Sync Error","Pi-Sync Fehler" },
{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
{ "Receiving file from remote...","Empfange entfernte Datei..." },
{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
{ "Writing back file ...","Schreibe Datei zurück..." },
{ "Sending back file ...","Sende Datei zurück..." },
{ "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" },
{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
{ "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" },
{ "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" },
-{ "","" },
-{ "","" },
-{ "","" },
+{ "%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
@@ -79,164 +79,185 @@ XXPortManager::XXPortManager( KABCore *core, QObject *parent, const char *name )
XXPortManager::~XXPortManager()
{
}
void XXPortManager::restoreSettings()
{
}
void XXPortManager::saveSettings()
{
}
void XXPortManager::importVCard( const KURL &url )
{
importVCard( url, false );
}
void XXPortManager::importVCard( const KURL &url, bool showPreview )
{
importURL = url;
mShowPreview = showPreview;
slotImport( "vcard", "<empty>" );
mShowPreview = false;
importURL = KURL();
}
void XXPortManager::importVCard( const QString &vCard, bool showPreview )
{
importData = vCard;
mShowPreview = showPreview;
slotImport( "vcard", "<empty>" );
mShowPreview = false;
importData = "";
}
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() )
- continue;
+ connect( &dlg, SIGNAL( closeClicked() ), this, SLOT ( noPreview()) );
+ if ( !dlg.exec() ) {
+ if ( mShowPreview )
+ continue;
+ }
}
(*it).setResource( resource );
- // We use a PwNewCommand so the user can undo it.
- PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it );
- UndoStack::instance()->push( command );
- RedoStack::instance()->clear();
+ 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();
else
return;
if ( !obj->exportContacts( addrList, data ) )
KMessageBox::error( mCore, i18n( "Unable to export contacts." ) );
else
KMessageBox::information( mCore, i18n( "contacts successfully exported." ) );
}
void XXPortManager::loadPlugins()
{
mXXPortObjects.clear();
#ifndef KAB_EMBEDDED
KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/XXPort" );
KTrader::OfferList::ConstIterator it;
for ( it = plugins.begin(); it != plugins.end(); ++it ) {
if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) )
continue;
KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() );
if ( !factory ) {
kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl;
continue;
}
XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
if ( !xxportFactory ) {
kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl;
continue;
}
#else //KAB_EMBEDDED
QList<XXPortFactory> factorylist;
factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport()));
factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport()));
factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport()));
//US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport()));
factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport()));
factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport()));
QListIterator<XXPortFactory> it(factorylist);
for ( ; it.current(); ++it )
{
XXPortFactory *xxportFactory = it.current();
#endif //KAB_EMBEDDED
XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore );
if ( obj ) {
mCore->addGUIClient( obj );
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
@@ -18,62 +18,63 @@
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#ifndef XXPORTMANAGER_H
#define XXPORTMANAGER_H
#include <qdict.h>
#include <qobject.h>
#include <kurl.h>
#include "xxportobject.h"
class KABCore;
class XXPortManager : public QObject
{
Q_OBJECT
public:
XXPortManager( KABCore *core, QObject *parent, const char *name = 0 );
~XXPortManager();
void restoreSettings();
void saveSettings();
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:
+ 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;
};
#endif