27 #include <tdefiledialog.h>
28 #include <tdeio/netaccess.h>
29 #include <tdelocale.h>
30 #include <tdemessagebox.h>
31 #include <tdeprocess.h>
32 #include <kstandarddirs.h>
33 #include <tdetempfile.h>
36 #include "xxportmanager.h"
38 #include "kde2_xxport.h"
40 K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_kde2_xxport, KDE2XXPort )
42 KDE2XXPort::KDE2XXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name )
43 : KAB::XXPort( ab, parent, name )
45 createImportAction( i18n( "Import KDE 2 Addressbook..." ) );
48 TDEABC::AddresseeList KDE2XXPort::importContacts( const TQString& ) const
50 TQString fileName = locateLocal( "data", "tdeabc/std.vcf" );
51 if ( !TQFile::exists( fileName ) ) {
52 KMessageBox::sorry( parentWidget(), i18n( "<qt>Could not find a KDE 2 address book <b>%1</b>.</qt>" ).arg( fileName ) );
53 return TDEABC::AddresseeList();
56 int result = KMessageBox::questionYesNoCancel( parentWidget(),
57 i18n( "Override previously imported entries?" ),
58 i18n( "Import KDE 2 Addressbook" ), i18n( "Import"), i18n( "Do Not Import") );
60 if ( !result ) return TDEABC::AddresseeList();
64 if ( result == KMessageBox::Yes ) {
65 proc << "tdeab2tdeabc";
67 } else if ( result == KMessageBox::No )
68 proc << "tdeab2tdeabc";
70 kdDebug(5720) << "KAddressBook::importKDE2(): Unknow return value." << endl;
71 return TDEABC::AddresseeList();
73 proc.start( TDEProcess::Block );
75 addressBook()->load();
77 return TDEABC::AddresseeList();
80 #include "kde2_xxport.moc"
|