summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/contacteditor.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 8acf570..534666d 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -18,16 +18,17 @@
18 * is made to operate exactly in interface with the exception of name. 18 * is made to operate exactly in interface with the exception of name.
19 * 19 *
20 */ 20 */
21 21
22#include "contacteditor.h" 22#include "contacteditor.h"
23 23
24#include <opie2/opimcontact.h>
25
24#include <qpe/categoryselect.h> 26#include <qpe/categoryselect.h>
25#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
26#include <qpe/qpedialog.h> 28#include <qpe/qpedialog.h>
27#include <opie/ocontact.h>
28#include <qpe/resource.h> 29#include <qpe/resource.h>
29 30
30#include <qlabel.h> 31#include <qlabel.h>
31#include <qtabwidget.h> 32#include <qtabwidget.h>
32#include <qlayout.h> 33#include <qlayout.h>
33#include <qlineedit.h> 34#include <qlineedit.h>
@@ -48,13 +49,13 @@ void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
48 QString &strAll ); 49 QString &strAll );
49 50
50// helper convert from file format to comma delimited... 51// helper convert from file format to comma delimited...
51void parseEmailTo( const QString &strDefaultEmail, 52void parseEmailTo( const QString &strDefaultEmail,
52 const QString &strOtherEmail, QString &strBack ); 53 const QString &strOtherEmail, QString &strBack );
53 54
54 ContactEditor::ContactEditor(const OContact &entry, 55 ContactEditor::ContactEditor(const Opie::OPimContact &entry,
55 QWidget *parent, 56 QWidget *parent,
56 const char *name, 57 const char *name,
57 WFlags ) 58 WFlags )
58 : QDialog( parent, name, TRUE, WStyle_ContextHelp ), 59 : QDialog( parent, name, TRUE, WStyle_ContextHelp ),
59 defaultEmailChooserPosition( -1 ), 60 defaultEmailChooserPosition( -1 ),
60 m_personalView ( false ), 61 m_personalView ( false ),
@@ -84,27 +85,27 @@ void ContactEditor::init() {
84 85
85 for (i = 0; i <= 6; i++) { 86 for (i = 0; i <= 6; i++) {
86 slHomeAddress.append( "" ); 87 slHomeAddress.append( "" );
87 slBusinessAddress.append( "" ); 88 slBusinessAddress.append( "" );
88 } 89 }
89 90
90 trlChooserNames = OContactFields::trphonefields( false ); 91 trlChooserNames = Opie::OPimContactFields::trphonefields( false );
91 slChooserNames = OContactFields::untrphonefields( false ); 92 slChooserNames = Opie::OPimContactFields::untrphonefields( false );
92 slDynamicEntries = OContactFields::untrdetailsfields( false ); 93 slDynamicEntries = Opie::OPimContactFields::untrdetailsfields( false );
93 trlDynamicEntries = OContactFields::trdetailsfields( false ); 94 trlDynamicEntries = Opie::OPimContactFields::trdetailsfields( false );
94 95
95 // Ok, we have to remove elements from the list of dynamic entries 96 // Ok, we have to remove elements from the list of dynamic entries
96 // which are now stored in special (not dynamic) widgets.. 97 // which are now stored in special (not dynamic) widgets..
97 // Otherwise we will get problems with field assignments! (se) 98 // Otherwise we will get problems with field assignments! (se)
98 slDynamicEntries.remove("Anniversary"); 99 slDynamicEntries.remove("Anniversary");
99 slDynamicEntries.remove("Birthday"); 100 slDynamicEntries.remove("Birthday");
100 slDynamicEntries.remove("Gender"); 101 slDynamicEntries.remove("Gender");
101 102
102 // The same with translated fields.. But I will 103 // The same with translated fields.. But I will
103 // use the translation map to avoid mismatches.. 104 // use the translation map to avoid mismatches..
104 QMap<int, QString> translMap = OContactFields::idToTrFields(); 105 QMap<int, QString> translMap = Opie::OPimContactFields::idToTrFields();
105 trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); 106 trlDynamicEntries.remove( translMap[Qtopia::Anniversary] );
106 trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); 107 trlDynamicEntries.remove( translMap[Qtopia::Birthday] );
107 trlDynamicEntries.remove( translMap[Qtopia::Gender] ); 108 trlDynamicEntries.remove( translMap[Qtopia::Gender] );
108 109
109 // Last Check to be sure.. 110 // Last Check to be sure..
110 assert( slDynamicEntries.count() == trlDynamicEntries.count() ); 111 assert( slDynamicEntries.count() == trlDynamicEntries.count() );
@@ -575,14 +576,14 @@ void ContactEditor::init() {
575 gl->addWidget( cmbGender, counter, 1 ); 576 gl->addWidget( cmbGender, counter, 1 );
576 577
577 ++counter; 578 ++counter;
578 579
579 // Create Labels and lineedit fields for every dynamic entry 580 // Create Labels and lineedit fields for every dynamic entry
580 QStringList::ConstIterator it = slDynamicEntries.begin(); 581 QStringList::ConstIterator it = slDynamicEntries.begin();
581 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); 582 QMap<QString, int> mapStrToID = Opie::OPimContactFields::untrFieldsToId();
582 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); 583 QMap<int, QString> mapIdToStr = Opie::OPimContactFields::idToTrFields();
583 for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { 584 for (i = counter; it != slDynamicEntries.end(); i++, ++it ) {
584 585
585 if (((*it) == "Anniversary") || 586 if (((*it) == "Anniversary") ||
586 ((*it) == "Birthday")|| ((*it) == "Gender")) continue; 587 ((*it) == "Birthday")|| ((*it) == "Gender")) continue;
587 588
588 l = new QLabel( mapIdToStr[mapStrToID[*it]], container ); 589 l = new QLabel( mapIdToStr[mapStrToID[*it]], container );
@@ -1247,13 +1248,13 @@ void ContactEditor::cleanupFields() {
1247 txtTmp->setText(""); 1248 txtTmp->setText("");
1248 txtTmp = cmbFileAs->lineEdit(); 1249 txtTmp = cmbFileAs->lineEdit();
1249 txtTmp->setText(""); 1250 txtTmp->setText("");
1250 1251
1251} 1252}
1252 1253
1253void ContactEditor::setEntry( const OContact &entry ) { 1254void ContactEditor::setEntry( const Opie::OPimContact &entry ) {
1254 1255
1255 initializing = true; 1256 initializing = true;
1256 1257
1257 // Cleanup and activate the general Page .. 1258 // Cleanup and activate the general Page ..
1258 cleanupFields(); 1259 cleanupFields();
1259 tabMain->setCurrentPage( 0 ); 1260 tabMain->setCurrentPage( 0 );