-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 @@ -23,12 +23,15 @@ #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> @@ -162,12 +165,20 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, 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 ); @@ -274,12 +285,20 @@ void AddressbookWindow::slotSetFont( int size ) { 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 ) { 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 @@ -56,12 +56,13 @@ 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(); 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 @@ -16,13 +16,13 @@ SOURCES = main.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 |