TDE personal information management applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.3KB

  1. /*
  2. This file is part of KAddressbook.
  3. Copyright (c) 2000 Hans Dijkema <kmailcvt@hum.org>
  4. Copyright (c) 2003 Helge Deller <deller@kde.org>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. As a special exception, permission is given to link this program
  17. with any edition of TQt, and distribute the resulting executable,
  18. without including the source code for TQt in the source distribution.
  19. */
  20. #include <tqfile.h>
  21. #include <kdebug.h>
  22. #include <kfiledialog.h>
  23. #include <kio/netaccess.h>
  24. #include <klocale.h>
  25. #include <kmessagebox.h>
  26. #include <kprocess.h>
  27. #include <kstandarddirs.h>
  28. #include <ktempfile.h>
  29. #include <kurl.h>
  30. #include "xxportmanager.h"
  31. #include "pab_xxport.h"
  32. K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_pab_xxport, PABXXPort )
  33. PABXXPort::PABXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name )
  34. : KAB::XXPort( ab, parent, name )
  35. {
  36. createImportAction( i18n("Import MS Exchange Personal Address Book (.PAB)") );
  37. }
  38. KABC::AddresseeList PABXXPort::importContacts( const TQString& ) const
  39. {
  40. KABC::AddresseeList addrList;
  41. TQString fileName = KFileDialog::getOpenFileName( TQDir::homeDirPath(),
  42. "*.[pP][aA][bB]|" + i18n("MS Exchange Personal Address Book Files (*.pab)"), 0 );
  43. if ( fileName.isEmpty() )
  44. return addrList;
  45. if ( !TQFile::exists( fileName ) ) {
  46. KMessageBox::sorry( parentWidget(), i18n( "<qt>Could not find a MS Exchange Personal Address Book <b>%1</b>.</qt>" ).tqarg( fileName ) );
  47. return addrList;
  48. }
  49. // pab PAB(TQFile::encodeName(file),this,info);
  50. // info->setFrom(file);
  51. // PAB.convert();
  52. return addrList;
  53. }
  54. #include "pab_xxport.moc"
  55. // vim: ts=2 sw=2 et