pab_xxport.cpp
00001 /* 00002 This file is part of KAddressbook. 00003 Copyright (c) 2000 Hans Dijkema <kmailcvt@hum.org> 00004 Copyright (c) 2003 Helge Deller <deller@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 00025 #include <tqfile.h> 00026 00027 #include <kdebug.h> 00028 #include <kfiledialog.h> 00029 #include <kio/netaccess.h> 00030 #include <klocale.h> 00031 #include <kmessagebox.h> 00032 #include <kprocess.h> 00033 #include <kstandarddirs.h> 00034 #include <ktempfile.h> 00035 #include <kurl.h> 00036 00037 #include "xxportmanager.h" 00038 00039 #include "pab_xxport.h" 00040 00041 K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_pab_xxport, PABXXPort ) 00042 00043 PABXXPort::PABXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) 00044 : KAB::XXPort( ab, parent, name ) 00045 { 00046 createImportAction( i18n("Import MS Exchange Personal Address Book (.PAB)") ); 00047 } 00048 00049 KABC::AddresseeList PABXXPort::importContacts( const TQString& ) const 00050 { 00051 KABC::AddresseeList addrList; 00052 00053 TQString fileName = KFileDialog::getOpenFileName( TQDir::homeDirPath(), 00054 "*.[pP][aA][bB]|" + i18n("MS Exchange Personal Address Book Files (*.pab)"), 0 ); 00055 if ( fileName.isEmpty() ) 00056 return addrList; 00057 if ( !TQFile::exists( fileName ) ) { 00058 KMessageBox::sorry( parentWidget(), i18n( "<qt>Could not find a MS Exchange Personal Address Book <b>%1</b>.</qt>" ).arg( fileName ) ); 00059 return addrList; 00060 } 00061 00062 // pab PAB(TQFile::encodeName(file),this,info); 00063 // info->setFrom(file); 00064 // PAB.convert(); 00065 00066 return addrList; 00067 } 00068 00069 #include "pab_xxport.moc" 00070 00071 // vim: ts=2 sw=2 et