author | eilers <eilers> | 2003-04-02 14:22:18 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-04-02 14:22:18 (UTC) |
commit | f0d3ff51dde49f994783827051464920529024af (patch) (side-by-side diff) | |
tree | 7d306530f14d020a85b332482fa549e8006f3148 | |
parent | 617523539b2ac77a97db427ba218b5951267410d (diff) | |
download | opie-f0d3ff51dde49f994783827051464920529024af.zip opie-f0d3ff51dde49f994783827051464920529024af.tar.gz opie-f0d3ff51dde49f994783827051464920529024af.tar.bz2 |
Fix bug #791 (Misbehaviour of contacteditor: The main tab is active for every new
entry)
Export to VCard added.
Edit:Save removed (Was just for testing purposes)
-rw-r--r-- | core/pim/addressbook/TODO | 8 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 30 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.h | 5 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 2 | ||||
-rw-r--r-- | core/pim/addressbook/version.h | 2 |
5 files changed, 38 insertions, 9 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index da9b9c2..a3cffa7 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO @@ -14,3 +14,3 @@ Feature requests: - Configure the letter-picker: lastname/fullname search -- User center of the joypad to switch back from card to listview ! +- Optionally put scrollbars left. @@ -19,7 +19,2 @@ Known Bugs: -Bugs but not in addressbook: ------------------------------ -- VCARD: If umlaut (äöüß) in address, the parser gets confused.. - - Urgent: @@ -116 +111,2 @@ Fixed/Ready: (behaviour should be selectable by configuration) +- User center of the joypad to switch back from card to listview ! diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index a5bf19b..89a3312 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -211,2 +211,8 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, + a = new QAction( tr("Export vCard"), Resource::loadPixmap( "addressbook/fileexport"), QString::null, + 0, this, 0); + actionPersonal = a; + connect( a, SIGNAL( activated() ), this, SLOT( exportvCard() ) ); + a->addTo( edit ); + edit->insertSeparator(); @@ -333,2 +339,26 @@ void AddressbookWindow::importvCard() { } +void AddressbookWindow::exportvCard() +{ + qWarning(" void AddressbookWindow::exportvCard()"); + QString filename = OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); + if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ + qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 ); + OContact curCont = m_abView->currentEntry(); + if ( !curCont.isEmpty() ){ + OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, + filename ); + OContactAccess* access = new OContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); + if ( access ){ + access->add( curCont ); + access->save(); + } + delete access; + }else + QMessageBox::critical( 0, "Export VCard", + QString( tr( "You have to select a contact !") ) ); + + }else + QMessageBox::critical( 0, "Export VCard", + QString( tr( "You have to set a filename !") ) ); +} diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h index 69fe2f8..f7a560a 100644 --- a/core/pim/addressbook/addressbook.h +++ b/core/pim/addressbook/addressbook.h @@ -23,3 +23,3 @@ // Remove this for OPIE releae 1.0 ! -#define __DEBUG_RELEASE +// #define __DEBUG_RELEASE @@ -67,3 +67,3 @@ public slots: #ifdef __DEBUG_RELEASE - void slotSave(); + // void slotSave(); #endif @@ -72,2 +72,3 @@ private slots: void importvCard(); + void exportvCard(); void slotListNew(); diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index df97b85..f33ee0a 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -1258,3 +1258,5 @@ void ContactEditor::setEntry( const OContact &entry ) { + // Cleanup and activate the general Page .. cleanupFields(); + tabMain->setCurrentPage( 0 ); diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index d590a86..c0465b5 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h @@ -5,3 +5,3 @@ #define SUBVERSION "9" -#define PATCHVERSION "3" +#define PATCHVERSION "4" |