-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 19 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 1 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.pro | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 8229212..86d1760 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -17,24 +17,27 @@ ** not clear to you. ** **********************************************************************/ #define QTOPIA_INTERNAL_FD #include "contacteditor.h" #include "ablabel.h" #include "abtable.h" #include "addresssettings.h" #include "addressbook.h" + +#include <opie/ofileselector.h> +#include <opie/ofiledialog.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/contact.h> #ifndef MAKE_FOR_SHARP_ROM #include <qpe/finddialog.h> #endif #include <qpe/global.h> #include <qpe/resource.h> #include <qpe/ir.h> #include <qpe/qpemessagebox.h> @@ -156,24 +159,32 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, if ( Ir::supported() ) { a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); actionBeam = a; connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); a->addTo( edit ); a->addTo( listTools ); } edit->insertSeparator(); + a = new QAction( tr("Import vCard"), QString::null, 0, 0, 0, TRUE ); + actionPersonal = a; + connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); + a->addTo( edit ); + + + edit->insertSeparator(); + a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); actionPersonal = a; connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); a->addTo( edit ); a = new QAction( tr( "Arrange Edit Fields"), QString::null, 0, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); a->addTo( edit ); // Create Views @@ -268,24 +279,32 @@ void AddressbookWindow::slotSetFont( int size ) { case 2: fontMenu->setItemChecked(0, false); fontMenu->setItemChecked(1, false); fontMenu->setItemChecked(2, true); abList->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); currentFont = new QFont (abList->font()); abList->resizeRows(currentFont->pixelSize() + 7); break; } } + +void AddressbookWindow::importvCard() { + QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); + if(!str.isEmpty() ) + setDocument((const QString&) str ); + +} + void AddressbookWindow::setDocument( const QString &filename ) { if ( filename.find(".vcf") != int(filename.length()) - 4 ) return; QValueList<Contact> cl = Contact::readVCard( filename ); for( QValueList<Contact>::Iterator it = cl.begin(); it != cl.end(); ++it ) { // QString msg = tr("You received a vCard for\n%1.\nDo You want to add it to your\naddressbook?") // .arg( (*it).fullName() ); // if ( QMessageBox::information( this, tr("received contact"), msg, QMessageBox::Ok, QMessageBox::Cancel ) == // QMessageBox::Ok ) { abList->addEntry( *it ); // } diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index 476c971..da43731 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h @@ -50,24 +50,25 @@ protected: void editPersonal(); void editEntry( EntryMode ); void closeEvent( QCloseEvent *e ); bool save(); public slots: void flush(); void reload(); void appMessage(const QCString &, const QByteArray &); void setDocument( const QString & ); private slots: + void importvCard(); void slotListNew(); void slotListView(); void slotListDelete(); void slotViewBack(); void slotViewEdit(); void slotPersonalView(); void listIsEmpty( bool ); void slotSettings(); void writeMail(); void slotBeam(); void beamDone( Ir * ); void slotFind(); diff --git a/core/pim/addressbook/addressbook.pro b/core/pim/addressbook/addressbook.pro index 0d65c74..428af2b 100644 --- a/core/pim/addressbook/addressbook.pro +++ b/core/pim/addressbook/addressbook.pro @@ -10,25 +10,25 @@ HEADERS = addressbook.h \ SOURCES = main.cpp \ addressbook.cpp \ contacteditor.cpp \ ablabel.cpp \ abtable.cpp \ addresssettings.cpp \ picker.cpp INTERFACES = addresssettingsbase.ui TARGET = addressbook INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopie TRANSLATIONS = ../../i18n/pt_BR/addressbook.ts TRANSLATIONS += ../../i18n/de/addressbook.ts TRANSLATIONS += ../../i18n/en/addressbook.ts TRANSLATIONS += ../../i18n/hu/addressbook.ts TRANSLATIONS += ../../i18n/sl/addressbook.ts TRANSLATIONS += ../../i18n/ja/addressbook.ts TRANSLATIONS += ../../i18n/ko/addressbook.ts TRANSLATIONS += ../../i18n/pl/addressbook.ts TRANSLATIONS += ../../i18n/no/addressbook.ts TRANSLATIONS += ../../i18n/zh_CN/addressbook.ts TRANSLATIONS += ../../i18n/zh_TW/addressbook.ts |