author | llornkcor <llornkcor> | 2002-06-05 18:33:09 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-05 18:33:09 (UTC) |
commit | 91398d550495cb82445457b59e472a58ad0a296a (patch) (unidiff) | |
tree | 946605431ce9f600ae496c807126c281848a83b4 /core/pim | |
parent | 9bd38805d22b6687ec8918ab1f581b2a28ba637a (diff) | |
download | opie-91398d550495cb82445457b59e472a58ad0a296a.zip opie-91398d550495cb82445457b59e472a58ad0a296a.tar.gz opie-91398d550495cb82445457b59e472a58ad0a296a.tar.bz2 |
added import vcard menu entry
-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 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_FD | 21 | #define QTOPIA_INTERNAL_FD |
22 | 22 | ||
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> |
35 | #endif | 38 | #endif |
36 | 39 | ||
37 | #include <qpe/global.h> | 40 | #include <qpe/global.h> |
38 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
39 | #include <qpe/ir.h> | 42 | #include <qpe/ir.h> |
40 | #include <qpe/qpemessagebox.h> | 43 | #include <qpe/qpemessagebox.h> |
@@ -156,24 +159,32 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
156 | 159 | ||
157 | if ( Ir::supported() ) { | 160 | if ( Ir::supported() ) { |
158 | a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, | 161 | a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, |
159 | 0, this, 0 ); | 162 | 0, this, 0 ); |
160 | actionBeam = a; | 163 | actionBeam = a; |
161 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); | 164 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); |
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 | ||
174 | a = new QAction( tr( "Arrange Edit Fields"), QString::null, 0, 0 ); | 185 | a = new QAction( tr( "Arrange Edit Fields"), QString::null, 0, 0 ); |
175 | connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); | 186 | connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); |
176 | a->addTo( edit ); | 187 | a->addTo( edit ); |
177 | 188 | ||
178 | // Create Views | 189 | // Create Views |
179 | 190 | ||
@@ -268,24 +279,32 @@ void AddressbookWindow::slotSetFont( int size ) { | |||
268 | case 2: | 279 | case 2: |
269 | fontMenu->setItemChecked(0, false); | 280 | fontMenu->setItemChecked(0, false); |
270 | fontMenu->setItemChecked(1, false); | 281 | fontMenu->setItemChecked(1, false); |
271 | fontMenu->setItemChecked(2, true); | 282 | fontMenu->setItemChecked(2, true); |
272 | abList->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); | 283 | abList->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); |
273 | currentFont = new QFont (abList->font()); | 284 | currentFont = new QFont (abList->font()); |
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 ) { |
286 | // QString msg = tr("You received a vCard for\n%1.\nDo You want to add it to your\naddressbook?") | 305 | // QString msg = tr("You received a vCard for\n%1.\nDo You want to add it to your\naddressbook?") |
287 | // .arg( (*it).fullName() ); | 306 | // .arg( (*it).fullName() ); |
288 | // if ( QMessageBox::information( this, tr("received contact"), msg, QMessageBox::Ok, QMessageBox::Cancel ) == | 307 | // if ( QMessageBox::information( this, tr("received contact"), msg, QMessageBox::Ok, QMessageBox::Cancel ) == |
289 | // QMessageBox::Ok ) { | 308 | // QMessageBox::Ok ) { |
290 | abList->addEntry( *it ); | 309 | abList->addEntry( *it ); |
291 | // } | 310 | // } |
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: | |||
50 | void editPersonal(); | 50 | void editPersonal(); |
51 | void editEntry( EntryMode ); | 51 | void editEntry( EntryMode ); |
52 | void closeEvent( QCloseEvent *e ); | 52 | void closeEvent( QCloseEvent *e ); |
53 | bool save(); | 53 | bool save(); |
54 | 54 | ||
55 | public slots: | 55 | public slots: |
56 | void flush(); | 56 | void flush(); |
57 | void reload(); | 57 | void reload(); |
58 | void appMessage(const QCString &, const QByteArray &); | 58 | void appMessage(const QCString &, const QByteArray &); |
59 | void setDocument( const QString & ); | 59 | void setDocument( const QString & ); |
60 | 60 | ||
61 | private slots: | 61 | private slots: |
62 | void importvCard(); | ||
62 | void slotListNew(); | 63 | void slotListNew(); |
63 | void slotListView(); | 64 | void slotListView(); |
64 | void slotListDelete(); | 65 | void slotListDelete(); |
65 | void slotViewBack(); | 66 | void slotViewBack(); |
66 | void slotViewEdit(); | 67 | void slotViewEdit(); |
67 | void slotPersonalView(); | 68 | void slotPersonalView(); |
68 | void listIsEmpty( bool ); | 69 | void listIsEmpty( bool ); |
69 | void slotSettings(); | 70 | void slotSettings(); |
70 | void writeMail(); | 71 | void writeMail(); |
71 | void slotBeam(); | 72 | void slotBeam(); |
72 | void beamDone( Ir * ); | 73 | void beamDone( Ir * ); |
73 | void slotFind(); | 74 | 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 \ | |||
10 | SOURCES= main.cpp \ | 10 | SOURCES= main.cpp \ |
11 | addressbook.cpp \ | 11 | addressbook.cpp \ |
12 | contacteditor.cpp \ | 12 | contacteditor.cpp \ |
13 | ablabel.cpp \ | 13 | ablabel.cpp \ |
14 | abtable.cpp \ | 14 | abtable.cpp \ |
15 | addresssettings.cpp \ | 15 | addresssettings.cpp \ |
16 | picker.cpp | 16 | picker.cpp |
17 | INTERFACES= addresssettingsbase.ui | 17 | INTERFACES= addresssettingsbase.ui |
18 | 18 | ||
19 | TARGET = addressbook | 19 | TARGET = addressbook |
20 | INCLUDEPATH += $(OPIEDIR)/include | 20 | INCLUDEPATH += $(OPIEDIR)/include |
21 | DEPENDPATH+= $(OPIEDIR)/include | 21 | DEPENDPATH+= $(OPIEDIR)/include |
22 | LIBS += -lqpe | 22 | LIBS += -lqpe -lopie |
23 | 23 | ||
24 | TRANSLATIONS = ../../i18n/pt_BR/addressbook.ts | 24 | TRANSLATIONS = ../../i18n/pt_BR/addressbook.ts |
25 | TRANSLATIONS += ../../i18n/de/addressbook.ts | 25 | TRANSLATIONS += ../../i18n/de/addressbook.ts |
26 | TRANSLATIONS += ../../i18n/en/addressbook.ts | 26 | TRANSLATIONS += ../../i18n/en/addressbook.ts |
27 | TRANSLATIONS += ../../i18n/hu/addressbook.ts | 27 | TRANSLATIONS += ../../i18n/hu/addressbook.ts |
28 | TRANSLATIONS += ../../i18n/sl/addressbook.ts | 28 | TRANSLATIONS += ../../i18n/sl/addressbook.ts |
29 | TRANSLATIONS += ../../i18n/ja/addressbook.ts | 29 | TRANSLATIONS += ../../i18n/ja/addressbook.ts |
30 | TRANSLATIONS += ../../i18n/ko/addressbook.ts | 30 | TRANSLATIONS += ../../i18n/ko/addressbook.ts |
31 | TRANSLATIONS += ../../i18n/pl/addressbook.ts | 31 | TRANSLATIONS += ../../i18n/pl/addressbook.ts |
32 | TRANSLATIONS += ../../i18n/no/addressbook.ts | 32 | TRANSLATIONS += ../../i18n/no/addressbook.ts |
33 | TRANSLATIONS += ../../i18n/zh_CN/addressbook.ts | 33 | TRANSLATIONS += ../../i18n/zh_CN/addressbook.ts |
34 | TRANSLATIONS += ../../i18n/zh_TW/addressbook.ts | 34 | TRANSLATIONS += ../../i18n/zh_TW/addressbook.ts |