Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 19 |
1 files changed, 19 insertions, 0 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 @@ | |||
23 | #include "contacteditor.h" | 23 | #include "contacteditor.h" |
24 | #include "ablabel.h" | 24 | #include "ablabel.h" |
25 | #include "abtable.h" | 25 | #include "abtable.h" |
26 | #include "addresssettings.h" | 26 | #include "addresssettings.h" |
27 | #include "addressbook.h" | 27 | #include "addressbook.h" |
28 | 28 | ||
29 | |||
30 | #include <opie/ofileselector.h> | ||
31 | #include <opie/ofiledialog.h> | ||
29 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
30 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
31 | #include <qpe/contact.h> | 34 | #include <qpe/contact.h> |
32 | 35 | ||
33 | #ifndef MAKE_FOR_SHARP_ROM | 36 | #ifndef MAKE_FOR_SHARP_ROM |
34 | #include <qpe/finddialog.h> | 37 | #include <qpe/finddialog.h> |
@@ -162,12 +165,20 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
162 | a->addTo( edit ); | 165 | a->addTo( edit ); |
163 | a->addTo( listTools ); | 166 | a->addTo( listTools ); |
164 | } | 167 | } |
165 | 168 | ||
166 | edit->insertSeparator(); | 169 | edit->insertSeparator(); |
167 | 170 | ||
171 | a = new QAction( tr("Import vCard"), QString::null, 0, 0, 0, TRUE ); | ||
172 | actionPersonal = a; | ||
173 | connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); | ||
174 | a->addTo( edit ); | ||
175 | |||
176 | |||
177 | edit->insertSeparator(); | ||
178 | |||
168 | a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); | 179 | a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); |
169 | actionPersonal = a; | 180 | actionPersonal = a; |
170 | connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); | 181 | connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); |
171 | a->addTo( edit ); | 182 | a->addTo( edit ); |
172 | 183 | ||
173 | 184 | ||
@@ -274,12 +285,20 @@ void AddressbookWindow::slotSetFont( int size ) { | |||
274 | abList->resizeRows(currentFont->pixelSize() + 7); | 285 | abList->resizeRows(currentFont->pixelSize() + 7); |
275 | break; | 286 | break; |
276 | } | 287 | } |
277 | } | 288 | } |
278 | 289 | ||
279 | 290 | ||
291 | |||
292 | void AddressbookWindow::importvCard() { | ||
293 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | ||
294 | if(!str.isEmpty() ) | ||
295 | setDocument((const QString&) str ); | ||
296 | |||
297 | } | ||
298 | |||
280 | void AddressbookWindow::setDocument( const QString &filename ) | 299 | void AddressbookWindow::setDocument( const QString &filename ) |
281 | { | 300 | { |
282 | if ( filename.find(".vcf") != int(filename.length()) - 4 ) return; | 301 | if ( filename.find(".vcf") != int(filename.length()) - 4 ) return; |
283 | 302 | ||
284 | QValueList<Contact> cl = Contact::readVCard( filename ); | 303 | QValueList<Contact> cl = Contact::readVCard( filename ); |
285 | for( QValueList<Contact>::Iterator it = cl.begin(); it != cl.end(); ++it ) { | 304 | for( QValueList<Contact>::Iterator it = cl.begin(); it != cl.end(); ++it ) { |