summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO5
-rw-r--r--core/pim/addressbook/abtable.cpp137
-rw-r--r--core/pim/addressbook/abtable.h12
-rw-r--r--core/pim/addressbook/addressbook.cpp5
-rw-r--r--core/pim/addressbook/configdlg.cpp11
-rw-r--r--core/pim/addressbook/contacteditor.cpp3
-rw-r--r--core/pim/addressbook/ocontactfields.cpp14
7 files changed, 122 insertions, 65 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO
index f62b075..906b462 100644
--- a/core/pim/addressbook/TODO
+++ b/core/pim/addressbook/TODO
@@ -1,117 +1,118 @@
1Stuff todo until OPIE 1.0 : 1Stuff todo until OPIE 1.0 :
2=========================== 2===========================
3 3
4Feature requests: 4Feature requests:
5----------------- 5-----------------
6- Dial by mobile phone by tapping the number.. 6- Dial by mobile phone by tapping the number..
7 (Maybe using gsmtool. And we may 7 (Maybe using gsmtool. And we may
8 add a library class for this) 8 add a library class for this)
9- dial with dtmfdial in case it's installed and there's no mobile 9- dial with dtmfdial in case it's installed and there's no mobile
10- 3rd column for 2. Contact 10- 3rd column for 2. Contact
11- Implementing additional Views (Phonebook, ...) 11- Implementing additional Views (Phonebook, ...)
12- Birthday & Anniversary Reminder 12- Birthday & Anniversary Reminder
13- Beaming of multiple contacts (current list/ by search or by category) 13- Beaming of multiple contacts (current list/ by search or by category)
14- Configure the letter-picker: lastname/fullname search 14- Configure the letter-picker: lastname/fullname search
15- User center of the joypad to switch back from card to listview ! 15- User center of the joypad to switch back from card to listview !
16- Cursor-UP/Down: Should additionally scroll cardview if it is too large 16- Cursor-UP/Down: Should additionally scroll cardview if it is too large
17 (behaviour should be selectable by configuration) 17 (behaviour should be selectable by configuration)
18 18
19Known Bugs: 19Known Bugs:
20----------- 20-----------
21- Email-button: A lot of problems.. :( 21- Default Email-button: A lot of problems:
22 If on second tab: The combo chooser is on the top left of the screen ! :(
22- Default Email-Button: Sometimes not hiding the textfields completely 23- Default Email-Button: Sometimes not hiding the textfields completely
23 24
24Bugs but not in addressbook: 25Bugs but not in addressbook:
25----------------------------- 26-----------------------------
26- VCARD: If umlaut (äöüß) in address, the parser gets confused.. 27- VCARD: If umlaut (äöüß) in address, the parser gets confused..
27 28
28- Exporting and reimporting of Jobtitle was reported to fail (Could not reproduce this ! (se)) 29- Exporting and reimporting of Jobtitle was reported to fail (Could not reproduce this ! (se))
29 30
30 31
31Urgent: 32Urgent:
32-------- 33--------
33ContactEditor: 34ContactEditor:
34- Contact-Editor is temporarely reenabled. Wait for replacement. 35- Contact-Editor is temporarely reenabled. Wait for replacement.
35- Redesign of Contacteditor 36- Redesign of Contacteditor
36- Category is on the wrong position after changing to personal and back to normal 37- Category is on the wrong position after changing to personal and back to normal
37 ( Temporarily workaround: Category is never deactivated.. :S ) 38 ( Temporarily workaround: Category is never deactivated.. :S )
38 39
39- Personal and Business Web-page is not editable
40 40
41Important: 41Important:
42---------- 42----------
43 43
44- If new contact is added (contacteditor closed): focus (table, card) to 44- If new contact is added (contacteditor closed): focus (table, card) to
45 this entry ! 45 this entry !
46- After search (Started with Return): KeyFocus should be on Tabelle 46- After search (Started with Return): KeyFocus should be on Tabelle
47 47
48- "What's this" should be added (Deleyed after Feature Freeze) 48- "What's this" should be added (Deleyed after Feature Freeze)
49 49
50Less important: 50Less important:
51--------------- 51---------------
52- Reload if contacts were changed externally 52- Reload if contacts were changed externally
53- The picker (alphabetical sort widget) should be 53- The picker (alphabetical sort widget) should be
54 placed verticaly or horizontally (configurable) 54 placed verticaly or horizontally (configurable)
55- Find a smart solution for activating/deactivating the "send email" event 55- Find a smart solution for activating/deactivating the "send email" event
56 56
57Should be Fixed (not absolute sure, need further validation): 57Should be Fixed (not absolute sure, need further validation):
58------------------------------------------------------------- 58-------------------------------------------------------------
59 59
60 60
61Fixed/Ready: 61Fixed/Ready:
62------- 62-------
63- Syncing: abtable not reloaded after sync. 63- Syncing: abtable not reloaded after sync.
64- Find widget should be replaced by something like 64- Find widget should be replaced by something like
65 qpdf has. 65 qpdf has.
66- Adding a configuration dialog 66- Adding a configuration dialog
67- Picker: Activated letter schould be more visible 67- Picker: Activated letter schould be more visible
68- Advanced handling of cursor keys (search..) 68- Advanced handling of cursor keys (search..)
69- Mail-Icon is missing 69- Mail-Icon is missing
70- Use opie-mail insted of qt-mail if possible. 70- Use opie-mail insted of qt-mail if possible.
71- Font menu is invisible using german translation 71- Font menu is invisible using german translation
72- Personal contact editor: Disable categories 72- Personal contact editor: Disable categories
73- "Nonenglish" translation bug has to be fixed. 73- "Nonenglish" translation bug has to be fixed.
74- contacteditor: Birthday, annyversary, ... : Use Dateselector 74- contacteditor: Birthday, annyversary, ... : Use Dateselector
75- The names of the countries are sorted by there english names, only.. 75- The names of the countries are sorted by there english names, only..
76 Even if they are translated.. :S 76 Even if they are translated.. :S
77- Cursor keys should work in detail-view (ablabel) 77- Cursor keys should work in detail-view (ablabel)
78 -> Ablabel should be removed and Abtable should be increased with 78 -> Ablabel should be removed and Abtable should be increased with
79 different views (as started by darwin zins).. 79 different views (as started by darwin zins)..
80- Use advanced database functions in abtable to decrease 80- Use advanced database functions in abtable to decrease
81 memory footprint and to make everything more easy ! 81 memory footprint and to make everything more easy !
82 (abtable should store Iterator for selected Category) 82 (abtable should store Iterator for selected Category)
83- Abtable: Configure Contact column (internally already available, 83- Abtable: Configure Contact column (internally already available,
84 need configuration) 84 need configuration)
85- Select of primary contact (see #274 on mantis) 85- Select of primary contact (see #274 on mantis)
86- Category-select does not work completely: "Unfiled" is always in listview .. 86- Category-select does not work completely: "Unfiled" is always in listview ..
87- Return from Contacteditor: Category resettet to all 87- Return from Contacteditor: Category resettet to all
88- Personal Details not working 88- Personal Details not working
89- If category changed, the letterpicker should be resetted 89- If category changed, the letterpicker should be resetted
90- There should be some icons for List and Cardview 90- There should be some icons for List and Cardview
91- If in Cardview and a category change removes all entries: 91- If in Cardview and a category change removes all entries:
92 There are already entries in Cardview after up/down 92 There are already entries in Cardview after up/down
93- Personal Details: Anniversary zeigt Fantasie-Werte 93- Personal Details: Anniversary zeigt Fantasie-Werte
94- Unfiled shown just in Category "All" and "Unfiled". 94- Unfiled shown just in Category "All" and "Unfiled".
95- After finising search and after Edit: Clear Picker 95- After finising search and after Edit: Clear Picker
96- After Edit: Table position back to edited entry. 96- After Edit: Table position back to edited entry.
97- Optimize Table Update... 97- Optimize Table Update...
98- Change MyDialog to Config 98- Change MyDialog to Config
99- Store position and state of toolbar 99- Store position and state of toolbar
100- Searchwidget closed: Selected user is jumping 100- Searchwidget closed: Selected user is jumping
101- Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) 101- Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist)
102 zu lange.. 102 zu lange..
103- VCARD: Import of Anniversary does not work correctly (currently disabled) 103- VCARD: Import of Anniversary does not work correctly (currently disabled)
104- Name order selected in "contacteditor" not used in list view. 104- Name order selected in "contacteditor" not used in list view.
105- OK-Key does not switch from Detailview (ablable) to Listview 105- OK-Key does not switch from Detailview (ablable) to Listview
106- Receiving of beams should open a dialog 106- Receiving of beams should open a dialog
107- Fix start of opie-mail 107- Fix start of opie-mail
108- Implement Button Pics 108- Implement Button Pics
109- Add a dialog to accept and optionally edit received contacts by IRDA. 109- Add a dialog to accept and optionally edit received contacts by IRDA.
110- Language not English (tested with german opie-translation): 110- Language not English (tested with german opie-translation):
111 1. Configure nicht übersetzt (alles leer). 111 1. Configure nicht übersetzt (alles leer).
112 2. Contacteditor nur teilweise übersetzt. 112 2. Contacteditor nur teilweise übersetzt.
113 3. Kategorie-Picker geht nicht. 113 3. Kategorie-Picker geht nicht.
114- Plugin for Today for Birthdays and Anniversaries 114- Plugin for Today for Birthdays and Anniversaries
115- Implement a picker/combo for the default email. 115- Implement a picker/combo for the default email.
116- Overview window cleanup needed.. 116- Overview window cleanup needed..
117- Store last settings of combo-boxes 117- Store last settings of combo-boxes
118- Personal and Business Web-page is not editable
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index aec390d..55b1ba1 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -1,412 +1,419 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) 3** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de)
4** 4**
5** This file is part of Qt Palmtop Environment. 5** This file is part of Qt Palmtop Environment.
6** 6**
7** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14** 14**
15** See http://www.trolltech.com/gpl/ for GPL licensing information. 15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16** 16**
17** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22 22
23#include <qpe/categoryselect.h> 23#include <qpe/categoryselect.h>
24#include <qpe/config.h> 24#include <qpe/config.h>
25#include <qpe/stringutil.h> 25#include <qpe/stringutil.h>
26#include <qpe/qcopenvelope_qws.h> 26#include <qpe/qcopenvelope_qws.h>
27#include <qpe/timestring.h> 27#include <qpe/timestring.h>
28#include <qpe/resource.h>
28 29
29#include <opie/orecordlist.h> 30#include <opie/orecordlist.h>
30 31
31#include <qasciidict.h> 32#include <qasciidict.h>
32#include <qdatetime.h> 33#include <qdatetime.h>
33#include <qfile.h> 34#include <qfile.h>
34#include <qregexp.h> 35#include <qregexp.h>
35#include <qmessagebox.h> 36#include <qmessagebox.h>
36 37
37#include "abtable.h" 38#include "abtable.h"
38 39
39#include <errno.h> 40#include <errno.h>
40#include <fcntl.h> 41#include <fcntl.h>
41#include <unistd.h> 42#include <unistd.h>
42#include <stdlib.h> 43#include <stdlib.h>
43 44
44#include <ctype.h> //toupper() for key hack 45#include <ctype.h> //toupper() for key hack
45 46
46/*! 47/*!
47 \class AbTableItem abtable.h 48 \class AbTableItem abtable.h
48 49
49 \brief QTableItem based class for showing a field of an entry 50 \brief QTableItem based class for showing a field of an entry
50*/ 51*/
51 52
52AbTableItem::AbTableItem( QTable *t, EditType et, const QString &s, 53AbTableItem::AbTableItem( QTable *t, EditType et, const QString &s,
53 const QString &secondSortKey) 54 const QString &secondSortKey)
54 : QTableItem( t, et, s ) 55 : QTableItem( t, et, s )
55{ 56{
56 // sortKey = s.lower() + QChar( '\0' ) + secondSortKey.lower(); 57 // sortKey = s.lower() + QChar( '\0' ) + secondSortKey.lower();
57 sortKey = Qtopia::buildSortKey( s, secondSortKey ); 58 sortKey = Qtopia::buildSortKey( s, secondSortKey );
58} 59}
59 60
60int AbTableItem::alignment() const 61int AbTableItem::alignment() const
61{ 62{
62 return AlignLeft|AlignVCenter; 63 return AlignLeft|AlignVCenter;
63} 64}
64 65
65QString AbTableItem::key() const 66QString AbTableItem::key() const
66{ 67{
67 return sortKey; 68 return sortKey;
68} 69}
69 70
70// A way to reset the item, without out doing a delete or a new... 71// A way to reset the item, without out doing a delete or a new...
71void AbTableItem::setItem( const QString &txt, const QString &secondKey ) 72void AbTableItem::setItem( const QString &txt, const QString &secondKey )
72{ 73{
73 setText( txt ); 74 setText( txt );
74 sortKey = Qtopia::buildSortKey( txt, secondKey ); 75 sortKey = Qtopia::buildSortKey( txt, secondKey );
75 76
76 // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower(); 77 // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower();
77} 78}
78 79
79/*! 80/*!
80 \class AbPickItem abtable.h 81 \class AbPickItem abtable.h
81 82
82 \brief QTableItem based class for showing slection of an entry 83 \brief QTableItem based class for showing slection of an entry
83*/ 84*/
84 85
85AbPickItem::AbPickItem( QTable *t ) : 86AbPickItem::AbPickItem( QTable *t ) :
86 QTableItem(t, WhenCurrent, "?") 87 QTableItem(t, WhenCurrent, "?")
87{ 88{
88} 89}
89 90
90QWidget *AbPickItem::createEditor() const 91QWidget *AbPickItem::createEditor() const
91{ 92{
92 QComboBox* combo = new QComboBox( table()->viewport() ); 93 QComboBox* combo = new QComboBox( table()->viewport() );
93 ( (AbPickItem*)this )->cb = combo; 94 ( (AbPickItem*)this )->cb = combo;
94 AbTable* t = static_cast<AbTable*>(table()); 95 AbTable* t = static_cast<AbTable*>(table());
95 QStringList c = t->choiceNames(); 96 QStringList c = t->choiceNames();
96 int cur = 0; 97 int cur = 0;
97 for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) { 98 for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) {
98 if ( *it == text() ) 99 if ( *it == text() )
99 cur = combo->count(); 100 cur = combo->count();
100 combo->insertItem(*it); 101 combo->insertItem(*it);
101 } 102 }
102 combo->setCurrentItem(cur); 103 combo->setCurrentItem(cur);
103 return combo; 104 return combo;
104} 105}
105 106
106void AbPickItem::setContentFromEditor( QWidget *w ) 107void AbPickItem::setContentFromEditor( QWidget *w )
107{ 108{
108 if ( w->inherits("QComboBox") ) 109 if ( w->inherits("QComboBox") )
109 setText( ( (QComboBox*)w )->currentText() ); 110 setText( ( (QComboBox*)w )->currentText() );
110 else 111 else
111 QTableItem::setContentFromEditor( w ); 112 QTableItem::setContentFromEditor( w );
112} 113}
113 114
114/*! 115/*!
115 \class AbTable abtable.h 116 \class AbTable abtable.h
116 117
117 \brief QTable based class for showing a list of entries 118 \brief QTable based class for showing a list of entries
118*/ 119*/
119 120
120AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name ) 121AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name )
121 : QTable( parent, name ), 122 : QTable( parent, name ),
122 lastSortCol( -1 ), 123 lastSortCol( -1 ),
123 asc( TRUE ), 124 asc( TRUE ),
124 intFields( order ), 125 intFields( order ),
125 enablePainting( true ), 126 enablePainting( true ),
126 columnVisible( true ), 127 columnVisible( true ),
127 countNested( 0 ) 128 countNested( 0 )
128{ 129{
129 //qWarning("C'tor start"); 130 //qWarning("C'tor start");
130 131
131 setSelectionMode( NoSelection ); 132 setSelectionMode( NoSelection );
132 init(); 133 init();
133 setSorting( TRUE ); 134 setSorting( TRUE );
134 connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), 135 connect( this, SIGNAL(clicked(int,int,int,const QPoint &)),
135 this, SLOT(itemClicked(int,int)) ); 136 this, SLOT(itemClicked(int,int)) );
136 137
137 contactList.clear(); 138 contactList.clear();
138 //qWarning("C'tor end"); 139 //qWarning("C'tor end");
139} 140}
140 141
141AbTable::~AbTable() 142AbTable::~AbTable()
142{ 143{
143} 144}
144 145
145void AbTable::init() 146void AbTable::init()
146{ 147{
147 // :SX showChar = '\0'; 148 // :SX showChar = '\0';
148 setNumRows( 0 ); 149 setNumRows( 0 );
149 setNumCols( 2 ); 150 setNumCols( 2 );
150 151
151 horizontalHeader()->setLabel( 0, tr( "Full Name" )); 152 horizontalHeader()->setLabel( 0, tr( "Full Name" ));
152 horizontalHeader()->setLabel( 1, tr( "Contact" )); 153 horizontalHeader()->setLabel( 1, tr( "Contact" ));
153 setLeftMargin( 0 ); 154 setLeftMargin( 0 );
154 verticalHeader()->hide(); 155 verticalHeader()->hide();
155 columnVisible = true; 156 columnVisible = true;
156} 157}
157 158
158void AbTable::setContacts( const OContactAccess::List& viewList ) 159void AbTable::setContacts( const OContactAccess::List& viewList )
159{ 160{
160 //qWarning("AbTable::setContacts()"); 161 //qWarning("AbTable::setContacts()");
161 162
162 clear(); 163 clear();
163 m_viewList = viewList; 164 m_viewList = viewList;
164 165
165 setSorting( false ); 166 setSorting( false );
166 setPaintingEnabled( FALSE ); 167 setPaintingEnabled( FALSE );
167 168
168 OContactAccess::List::Iterator it; 169 OContactAccess::List::Iterator it;
169 setNumRows( m_viewList.count() ); 170 setNumRows( m_viewList.count() );
170 int row = 0; 171 int row = 0;
171 for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) 172 for ( it = m_viewList.begin(); it != m_viewList.end(); ++it )
172 insertIntoTable( *it, row++ ); 173 insertIntoTable( *it, row++ );
173 174
174 setSorting( true ); 175 setSorting( true );
175 176
176 resort(); 177 resort();
177 178
178 updateVisible(); 179 updateVisible();
179 180
180 setPaintingEnabled( TRUE ); 181 setPaintingEnabled( TRUE );
181 182
182} 183}
183 184
184bool AbTable::selectContact( int UID ) 185bool AbTable::selectContact( int UID )
185{ 186{
186 //qWarning( "AbTable::selectContact( %d )", UID ); 187 //qWarning( "AbTable::selectContact( %d )", UID );
187 int rows = numRows(); 188 int rows = numRows();
188 AbTableItem *abi; 189 AbTableItem *abi;
189 OContact* foundContact = 0l; 190 OContact* foundContact = 0l;
190 bool found = false; 191 bool found = false;
191 192
192 setPaintingEnabled( FALSE ); 193 setPaintingEnabled( FALSE );
193 for ( int r = 0; r < rows; ++r ) { 194 for ( int r = 0; r < rows; ++r ) {
194 abi = static_cast<AbTableItem*>( item(r, 0) ); 195 abi = static_cast<AbTableItem*>( item(r, 0) );
195 foundContact = &contactList[abi]; 196 foundContact = &contactList[abi];
196 if ( foundContact -> uid() == UID ){ 197 if ( foundContact -> uid() == UID ){
197 ensureCellVisible( r, 0 ); 198 ensureCellVisible( r, 0 );
198 setCurrentCell( r, 0 ); 199 setCurrentCell( r, 0 );
199 found = true; 200 found = true;
200 break; 201 break;
201 } 202 }
202 } 203 }
203 204
204 if ( !found ){ 205 if ( !found ){
205 ensureCellVisible( 0,0 ); 206 ensureCellVisible( 0,0 );
206 setCurrentCell( 0, 0 ); 207 setCurrentCell( 0, 0 );
207 } 208 }
208 209
209 setPaintingEnabled( TRUE ); 210 setPaintingEnabled( TRUE );
210 211
211 return true; 212 return true;
212} 213}
213 214
214void AbTable::insertIntoTable( const OContact& cnt, int row ) 215void AbTable::insertIntoTable( const OContact& cnt, int row )
215{ 216{
216 //qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); 217 //qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row );
217 QString strName, 218 QString strName;
218 strContact; 219 ContactItem contactItem;
219 220
220 strName = findContactName( cnt ); 221 strName = findContactName( cnt );
221 strContact = findContactContact( cnt, row ); 222 contactItem = findContactContact( cnt, row );
222 223
223 AbTableItem *ati; 224 AbTableItem *ati;
224 ati = new AbTableItem( this, QTableItem::Never, strName, strContact); 225 ati = new AbTableItem( this, QTableItem::Never, strName, contactItem.value );
225 contactList.insert( ati, cnt ); 226 contactList.insert( ati, cnt );
226 setItem( row, 0, ati ); 227 setItem( row, 0, ati );
227 ati = new AbTableItem( this, QTableItem::Never, strContact, strName); 228 ati = new AbTableItem( this, QTableItem::Never, contactItem.value, strName);
229 if ( !contactItem.icon.isNull() )
230 ati->setPixmap( contactItem.icon );
228 setItem( row, 1, ati ); 231 setItem( row, 1, ati );
229 232
230 //### cannot do this; table only has two columns at this point 233 //### cannot do this; table only has two columns at this point
231 // setItem( row, 2, new AbPickItem( this ) ); 234 // setItem( row, 2, new AbPickItem( this ) );
232 235
233} 236}
234 237
235 238
236 239
237void AbTable::columnClicked( int col ) 240void AbTable::columnClicked( int col )
238{ 241{
239 if ( !sorting() ) 242 if ( !sorting() )
240 return; 243 return;
241 244
242 if ( lastSortCol == -1 ) 245 if ( lastSortCol == -1 )
243 lastSortCol = col; 246 lastSortCol = col;
244 247
245 if ( col == lastSortCol ) { 248 if ( col == lastSortCol ) {
246 asc = !asc; 249 asc = !asc;
247 } else { 250 } else {
248 lastSortCol = col; 251 lastSortCol = col;
249 asc = TRUE; 252 asc = TRUE;
250 } 253 }
251 //QMessageBox::information( this, "resort", "columnClicked" ); 254 //QMessageBox::information( this, "resort", "columnClicked" );
252 resort(); 255 resort();
253} 256}
254 257
255void AbTable::resort() 258void AbTable::resort()
256{ 259{
257 //qWarning( "void AbTable::resort()" ); 260 //qWarning( "void AbTable::resort()" );
258 setPaintingEnabled( FALSE ); 261 setPaintingEnabled( FALSE );
259 if ( sorting() ) { 262 if ( sorting() ) {
260 if ( lastSortCol == -1 ) 263 if ( lastSortCol == -1 )
261 lastSortCol = 0; 264 lastSortCol = 0;
262 sortColumn( lastSortCol, asc, TRUE ); 265 sortColumn( lastSortCol, asc, TRUE );
263 //QMessageBox::information( this, "resort", "resort" ); 266 //QMessageBox::information( this, "resort", "resort" );
264 updateVisible(); 267 updateVisible();
265 } 268 }
266 setPaintingEnabled( TRUE ); 269 setPaintingEnabled( TRUE );
267} 270}
268 271
269OContact AbTable::currentEntry() 272OContact AbTable::currentEntry()
270{ 273{
271 //qWarning( "OContact AbTable::currentEntry()" ); 274 //qWarning( "OContact AbTable::currentEntry()" );
272 OContact cnt; 275 OContact cnt;
273 AbTableItem *abItem; 276 AbTableItem *abItem;
274 abItem = static_cast<AbTableItem*>(item( currentRow(), 0 )); 277 abItem = static_cast<AbTableItem*>(item( currentRow(), 0 ));
275 if ( abItem ) { 278 if ( abItem ) {
276 cnt = contactList[abItem]; 279 cnt = contactList[abItem];
277 //cnt = contactList[currentRow()]; 280 //cnt = contactList[currentRow()];
278 } 281 }
279 return cnt; 282 return cnt;
280} 283}
281 284
282int AbTable::currentEntry_UID() 285int AbTable::currentEntry_UID()
283{ 286{
284 return ( currentEntry().uid() ); 287 return ( currentEntry().uid() );
285} 288}
286 289
287void AbTable::clear() 290void AbTable::clear()
288{ 291{
289 //qWarning( "void AbTable::clear()" ); 292 //qWarning( "void AbTable::clear()" );
290 contactList.clear(); 293 contactList.clear();
291 294
292 setPaintingEnabled( FALSE ); 295 setPaintingEnabled( FALSE );
293 for ( int r = 0; r < numRows(); ++r ) { 296 for ( int r = 0; r < numRows(); ++r ) {
294 for ( int c = 0; c < numCols(); ++c ) { 297 for ( int c = 0; c < numCols(); ++c ) {
295 if ( cellWidget( r, c ) ) 298 if ( cellWidget( r, c ) )
296 clearCellWidget( r, c ); 299 clearCellWidget( r, c );
297 clearCell( r, c ); 300 clearCell( r, c );
298 } 301 }
299 } 302 }
300 setNumRows( 0 ); 303 setNumRows( 0 );
301 setPaintingEnabled( TRUE ); 304 setPaintingEnabled( TRUE );
302} 305}
303 306
304// Refresh updates column 2 if the contactsettings changed 307// Refresh updates column 2 if the contactsettings changed
305void AbTable::refresh() 308void AbTable::refresh()
306{ 309{
307 //qWarning( "void AbTable::refresh()" ); 310 //qWarning( "void AbTable::refresh()" );
308 int rows = numRows(); 311 int rows = numRows();
309 QString value;
310 AbTableItem *abi; 312 AbTableItem *abi;
313 ContactItem contactItem;
311 314
312 setPaintingEnabled( FALSE ); 315 setPaintingEnabled( FALSE );
313 for ( int r = 0; r < rows; ++r ) { 316 for ( int r = 0; r < rows; ++r ) {
314 abi = static_cast<AbTableItem*>( item(r, 0) ); 317 abi = static_cast<AbTableItem*>( item(r, 0) );
315 value = findContactContact( contactList[abi], r ); 318 contactItem = findContactContact( contactList[abi], r );
316 static_cast<AbTableItem*>( item(r, 1) )->setItem( value, abi->text() ); 319 static_cast<AbTableItem*>( item(r, 1) )->setItem( contactItem.value, abi->text() );
320 if ( !contactItem.icon.isNull() )
321 static_cast<AbTableItem*>( item(r, 1) )->
322 setPixmap( contactItem.icon );
323
317 } 324 }
318 resort(); 325 resort();
319 setPaintingEnabled( TRUE ); 326 setPaintingEnabled( TRUE );
320} 327}
321 328
322void AbTable::keyPressEvent( QKeyEvent *e ) 329void AbTable::keyPressEvent( QKeyEvent *e )
323{ 330{
324 char key = toupper( e->ascii() ); 331 char key = toupper( e->ascii() );
325 332
326 if ( key >= 'A' && key <= 'Z' ) 333 if ( key >= 'A' && key <= 'Z' )
327 moveTo( key ); 334 moveTo( key );
328 335
329 //qWarning("Received key .."); 336 //qWarning("Received key ..");
330 switch( e->key() ) { 337 switch( e->key() ) {
331 case Qt::Key_Space: 338 case Qt::Key_Space:
332 case Qt::Key_Return: 339 case Qt::Key_Return:
333 case Qt::Key_Enter: 340 case Qt::Key_Enter:
334 emit signalSwitch(); 341 emit signalSwitch();
335 break; 342 break;
336 // case Qt::Key_Up: 343 // case Qt::Key_Up:
337 // qWarning("a"); 344 // qWarning("a");
338 // emit signalKeyUp(); 345 // emit signalKeyUp();
339 // break; 346 // break;
340 // case Qt::Key_Down: 347 // case Qt::Key_Down:
341 // qWarning("b"); 348 // qWarning("b");
342 // emit signalKeyDown(); 349 // emit signalKeyDown();
343 // break; 350 // break;
344 default: 351 default:
345 QTable::keyPressEvent( e ); 352 QTable::keyPressEvent( e );
346 } 353 }
347 354
348} 355}
349 356
350void AbTable::moveTo( char c ) 357void AbTable::moveTo( char c )
351{ 358{
352 qWarning( "void AbTable::moveTo( char c )" ); 359 qWarning( "void AbTable::moveTo( char c )" );
353 360
354 int rows = numRows(); 361 int rows = numRows();
355 QString value; 362 QString value;
356 AbTableItem *abi; 363 AbTableItem *abi;
357 int r; 364 int r;
358 if ( asc ) { 365 if ( asc ) {
359 r = 0; 366 r = 0;
360 while ( r < rows-1) { 367 while ( r < rows-1) {
361 abi = static_cast<AbTableItem*>( item(r, 0) ); 368 abi = static_cast<AbTableItem*>( item(r, 0) );
362 QChar first = abi->key()[0]; 369 QChar first = abi->key()[0];
363 //### is there a bug in QChar to char comparison??? 370 //### is there a bug in QChar to char comparison???
364 if ( first.row() || first.cell() >= c ) 371 if ( first.row() || first.cell() >= c )
365 break; 372 break;
366 r++; 373 r++;
367 } 374 }
368 } else { 375 } else {
369 //### should probably disable reverse sorting instead 376 //### should probably disable reverse sorting instead
370 r = rows - 1; 377 r = rows - 1;
371 while ( r > 0 ) { 378 while ( r > 0 ) {
372 abi = static_cast<AbTableItem*>( item(r, 0) ); 379 abi = static_cast<AbTableItem*>( item(r, 0) );
373 QChar first = abi->key()[0]; 380 QChar first = abi->key()[0];
374 //### is there a bug in QChar to char comparison??? 381 //### is there a bug in QChar to char comparison???
375 if ( first.row() || first.cell() >= c ) 382 if ( first.row() || first.cell() >= c )
376 break; 383 break;
377 r--; 384 r--;
378 } 385 }
379 } 386 }
380 setCurrentCell( r, currentColumn() ); 387 setCurrentCell( r, currentColumn() );
381} 388}
382 389
383 390
384QString AbTable::findContactName( const OContact &entry ) 391QString AbTable::findContactName( const OContact &entry )
385{ 392{
386 // We use the fileAs, then company, defaultEmail 393 // We use the fileAs, then company, defaultEmail
387 QString str; 394 QString str;
388 str = entry.fileAs(); 395 str = entry.fileAs();
389 if ( str.isEmpty() ) { 396 if ( str.isEmpty() ) {
390 str = entry.company(); 397 str = entry.company();
391 if ( str.isEmpty() ) { 398 if ( str.isEmpty() ) {
392 str = entry.defaultEmail(); 399 str = entry.defaultEmail();
393 } 400 }
394 } 401 }
395 return str; 402 return str;
396} 403}
397 404
398 405
399 406
400void AbTable::resizeRows() { 407void AbTable::resizeRows() {
401 /* 408 /*
402 if (numRows()) { 409 if (numRows()) {
403 for (int i = 0; i < numRows(); i++) { 410 for (int i = 0; i < numRows(); i++) {
404 setRowHeight( i, size ); 411 setRowHeight( i, size );
405 } 412 }
406 } 413 }
407 updateVisible(); 414 updateVisible();
408 */ 415 */
409} 416}
410 417
411 418
412void AbTable::realignTable() 419void AbTable::realignTable()
@@ -525,223 +532,249 @@ void AbTable::setChoiceSelection( const QValueList<int>& list )
525{ 532{
526 intFields = list; 533 intFields = list;
527} 534}
528 535
529QStringList AbTable::choiceSelection(int /*index*/) const 536QStringList AbTable::choiceSelection(int /*index*/) const
530{ 537{
531 QStringList r; 538 QStringList r;
532 /* ###### 539 /* ######
533 540
534 QString selname = choicenames.at(index); 541 QString selname = choicenames.at(index);
535 for (each row) { 542 for (each row) {
536 OContact *c = contactForRow(row); 543 OContact *c = contactForRow(row);
537 if ( text(row,2) == selname ) { 544 if ( text(row,2) == selname ) {
538 r.append(c->email); 545 r.append(c->email);
539 } 546 }
540 } 547 }
541 548
542 */ 549 */
543 return r; 550 return r;
544} 551}
545 552
546 553
547 554
548 555
549void AbTable::updateVisible() 556void AbTable::updateVisible()
550{ 557{
551 //qWarning("void AbTable::updateVisible()"); 558 //qWarning("void AbTable::updateVisible()");
552 559
553 int visible, 560 int visible,
554 totalRows, 561 totalRows,
555 row, 562 row,
556 selectedRow = 0; 563 selectedRow = 0;
557 564
558 visible = 0; 565 visible = 0;
559 566
560 setPaintingEnabled( FALSE ); 567 setPaintingEnabled( FALSE );
561 568
562 realignTable(); 569 realignTable();
563 570
564 totalRows = numRows(); 571 totalRows = numRows();
565 for ( row = 0; row < totalRows; row++ ) { 572 for ( row = 0; row < totalRows; row++ ) {
566 if ( rowHeight(row) == 0 ) { 573 if ( rowHeight(row) == 0 ) {
567 showRow( row ); 574 showRow( row );
568 adjustRow( row ); 575 adjustRow( row );
569 if ( isSelected( row,0 ) || isSelected( row,1 ) ) 576 if ( isSelected( row,0 ) || isSelected( row,1 ) )
570 selectedRow = row; 577 selectedRow = row;
571 } 578 }
572 visible++; 579 visible++;
573 } 580 }
574 581
575 if ( selectedRow ) 582 if ( selectedRow )
576 setCurrentCell( selectedRow, 0 ); 583 setCurrentCell( selectedRow, 0 );
577 584
578 if ( !visible ) 585 if ( !visible )
579 setCurrentCell( -1, 0 ); 586 setCurrentCell( -1, 0 );
580 587
581 setPaintingEnabled( TRUE ); 588 setPaintingEnabled( TRUE );
582 589
583 590
584} 591}
585 592
586 593
587void AbTable::setPaintingEnabled( bool e ) 594void AbTable::setPaintingEnabled( bool e )
588{ 595{
589 //qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); 596 //qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested );
590 597
591 if ( e ) { 598 if ( e ) {
592 if ( countNested > 0 ) 599 if ( countNested > 0 )
593 --countNested; 600 --countNested;
594 if ( ! countNested ){ 601 if ( ! countNested ){
595 setUpdatesEnabled( true ); 602 setUpdatesEnabled( true );
596 enablePainting = true; 603 enablePainting = true;
597 rowHeightChanged( 0 ); 604 rowHeightChanged( 0 );
598 viewport()->update(); 605 viewport()->update();
599 } 606 }
600 } else { 607 } else {
601 ++countNested; 608 ++countNested;
602 enablePainting = false; 609 enablePainting = false;
603 setUpdatesEnabled( false ); 610 setUpdatesEnabled( false );
604 } 611 }
605 //qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); 612 //qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested );
606} 613}
607 614
608void AbTable::viewportPaintEvent( QPaintEvent* e ) { 615void AbTable::viewportPaintEvent( QPaintEvent* e ) {
609 //qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); 616 //qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting);
610 if ( enablePainting ) 617 if ( enablePainting )
611 QTable::viewportPaintEvent( e ); 618 QTable::viewportPaintEvent( e );
612} 619}
613 620
614 621
615 622
616void AbTable::rowHeightChanged( int row ) 623void AbTable::rowHeightChanged( int row )
617{ 624{
618 if ( enablePainting ) 625 if ( enablePainting )
619 QTable::rowHeightChanged( row ); 626 QTable::rowHeightChanged( row );
620} 627}
621QString AbTable::findContactContact( const OContact &entry, int /* row */ ) 628ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ )
622{ 629{
623 QString value; 630
624 value = ""; 631 ContactItem item;
632
633 item.value = "";
634
625 for ( QValueList<int>::ConstIterator it = intFields.begin(); 635 for ( QValueList<int>::ConstIterator it = intFields.begin();
626 it != intFields.end(); ++it ) { 636 it != intFields.end(); ++it ) {
627 switch ( *it ) { 637 switch ( *it ) {
628 default: 638 default:
629 break; 639 break;
630 case Qtopia::Title: 640 case Qtopia::Title:
631 value = entry.title(); 641 item.value = entry.title();
632 break; 642 break;
633 case Qtopia::Suffix: 643 case Qtopia::Suffix:
634 value = entry.suffix(); 644 item.value = entry.suffix();
635 break; 645 break;
636 case Qtopia::FileAs: 646 case Qtopia::FileAs:
637 value = entry.fileAs(); 647 item.value = entry.fileAs();
638 break; 648 break;
639 case Qtopia::DefaultEmail: 649 case Qtopia::DefaultEmail:
640 value = entry.defaultEmail(); 650 item.value = entry.defaultEmail();
651 if ( !item.value.isEmpty() )
652 item.icon = Resource::loadPixmap( "addressbook/email" );
653 break;
641 case Qtopia::Emails: 654 case Qtopia::Emails:
642 value = entry.emails(); 655 item.value = entry.emails();
656 if ( !item.value.isEmpty() )
657 item.icon = Resource::loadPixmap( "addressbook/email" );
643 break; 658 break;
644 case Qtopia::HomeStreet: 659 case Qtopia::HomeStreet:
645 value = entry.homeStreet(); 660 item.value = entry.homeStreet();
646 break; 661 break;
647 case Qtopia::HomeCity: 662 case Qtopia::HomeCity:
648 value = entry.homeCity(); 663 item.value = entry.homeCity();
649 break; 664 break;
650 case Qtopia::HomeState: 665 case Qtopia::HomeState:
651 value = entry.homeState(); 666 item.value = entry.homeState();
652 break; 667 break;
653 case Qtopia::HomeZip: 668 case Qtopia::HomeZip:
654 value = entry.homeZip(); 669 item.value = entry.homeZip();
655 break; 670 break;
656 case Qtopia::HomeCountry: 671 case Qtopia::HomeCountry:
657 value = entry.homeCountry(); 672 item.value = entry.homeCountry();
658 break; 673 break;
659 case Qtopia::HomePhone: 674 case Qtopia::HomePhone:
660 value = entry.homePhone(); 675 item.value = entry.homePhone();
676 if ( !item.value.isEmpty() )
677 item.icon = Resource::loadPixmap( "addressbook/phonehome" );
661 break; 678 break;
662 case Qtopia::HomeFax: 679 case Qtopia::HomeFax:
663 value = entry.homeFax(); 680 item.value = entry.homeFax();
681 if ( !item.value.isEmpty() )
682 item.icon = Resource::loadPixmap( "addressbook/faxhome" );
664 break; 683 break;
665 case Qtopia::HomeMobile: 684 case Qtopia::HomeMobile:
666 value = entry.homeMobile(); 685 item.value = entry.homeMobile();
686 if ( !item.value.isEmpty() )
687 item.icon = Resource::loadPixmap( "addressbook/mobilehome" );
667 break; 688 break;
668 case Qtopia::HomeWebPage: 689 case Qtopia::HomeWebPage:
669 value = entry.homeWebpage(); 690 item.value = entry.homeWebpage();
691 if ( !item.value.isEmpty() )
692 item.icon = Resource::loadPixmap( "addressbook/webpagehome" );
670 break; 693 break;
671 case Qtopia::Company: 694 case Qtopia::Company:
672 value = entry.company(); 695 item.value = entry.company();
673 break; 696 break;
674 case Qtopia::BusinessCity: 697 case Qtopia::BusinessCity:
675 value = entry.businessCity(); 698 item.value = entry.businessCity();
676 break; 699 break;
677 case Qtopia::BusinessStreet: 700 case Qtopia::BusinessStreet:
678 value = entry.businessStreet(); 701 item.value = entry.businessStreet();
679 break; 702 break;
680 case Qtopia::BusinessZip: 703 case Qtopia::BusinessZip:
681 value = entry.businessZip(); 704 item.value = entry.businessZip();
682 break; 705 break;
683 case Qtopia::BusinessCountry: 706 case Qtopia::BusinessCountry:
684 value = entry.businessCountry(); 707 item.value = entry.businessCountry();
685 break; 708 break;
686 case Qtopia::BusinessWebPage: 709 case Qtopia::BusinessWebPage:
687 value = entry.businessWebpage(); 710 item.value = entry.businessWebpage();
711 if ( !item.value.isEmpty() )
712 item.icon = Resource::loadPixmap( "addressbook/webpagework" );
688 break; 713 break;
689 case Qtopia::JobTitle: 714 case Qtopia::JobTitle:
690 value = entry.jobTitle(); 715 item.value = entry.jobTitle();
691 break; 716 break;
692 case Qtopia::Department: 717 case Qtopia::Department:
693 value = entry.department(); 718 item.value = entry.department();
694 break; 719 break;
695 case Qtopia::Office: 720 case Qtopia::Office:
696 value = entry.office(); 721 item.value = entry.office();
697 break; 722 break;
698 case Qtopia::BusinessPhone: 723 case Qtopia::BusinessPhone:
699 value = entry.businessPhone(); 724 item.value = entry.businessPhone();
725 if ( !item.value.isEmpty() )
726 item.icon = Resource::loadPixmap( "addressbook/phonework" );
700 break; 727 break;
701 case Qtopia::BusinessFax: 728 case Qtopia::BusinessFax:
702 value = entry.businessFax(); 729 item.value = entry.businessFax();
730 if ( !item.value.isEmpty() )
731 item.icon = Resource::loadPixmap( "addressbook/faxwork" );
703 break; 732 break;
704 case Qtopia::BusinessMobile: 733 case Qtopia::BusinessMobile:
705 value = entry.businessMobile(); 734 item.value = entry.businessMobile();
735 if ( !item.value.isEmpty() )
736 item.icon = Resource::loadPixmap( "addressbook/mobilework" );
706 break; 737 break;
707 case Qtopia::BusinessPager: 738 case Qtopia::BusinessPager:
708 value = entry.businessPager(); 739 item.value = entry.businessPager();
709 break; 740 break;
710 case Qtopia::Profession: 741 case Qtopia::Profession:
711 value = entry.profession(); 742 item.value = entry.profession();
712 break; 743 break;
713 case Qtopia::Assistant: 744 case Qtopia::Assistant:
714 value = entry.assistant(); 745 item.value = entry.assistant();
715 break; 746 break;
716 case Qtopia::Manager: 747 case Qtopia::Manager:
717 value = entry.manager(); 748 item.value = entry.manager();
718 break; 749 break;
719 case Qtopia::Spouse: 750 case Qtopia::Spouse:
720 value = entry.spouse(); 751 item.value = entry.spouse();
721 break; 752 break;
722 case Qtopia::Gender: 753 case Qtopia::Gender:
723 value = entry.gender(); 754 item.value = entry.gender();
724 break; 755 break;
725 case Qtopia::Birthday: 756 case Qtopia::Birthday:
726 if ( ! entry.birthday().isNull() ) 757 if ( ! entry.birthday().isNull() ){
727 value = TimeString::numberDateString( entry.birthday() ); 758 item.value = TimeString::numberDateString( entry.birthday() );
759 }
728 break; 760 break;
729 case Qtopia::Anniversary: 761 case Qtopia::Anniversary:
730 if ( ! entry.anniversary().isNull() ) 762 if ( ! entry.anniversary().isNull() ){
731 value = TimeString::numberDateString( entry.anniversary() ); 763 item.value = TimeString::numberDateString( entry.anniversary() );
764 }
732 break; 765 break;
733 case Qtopia::Nickname: 766 case Qtopia::Nickname:
734 value = entry.nickname(); 767 item.value = entry.nickname();
735 break; 768 break;
736 case Qtopia::Children: 769 case Qtopia::Children:
737 value = entry.children(); 770 item.value = entry.children();
738 break; 771 break;
739 case Qtopia::Notes: 772 case Qtopia::Notes:
740 value = entry.notes(); 773 item.value = entry.notes();
741 break; 774 break;
742 } 775 }
743 if ( !value.isEmpty() ) 776 if ( !item.value.isEmpty() )
744 break; 777 break;
745 } 778 }
746 return value; 779 return item;
747} 780}
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h
index 9825665..092e86f 100644
--- a/core/pim/addressbook/abtable.h
+++ b/core/pim/addressbook/abtable.h
@@ -1,137 +1,147 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) 3** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de)
4** 4**
5** This file is part of Qt Palmtop Environment. 5** This file is part of Qt Palmtop Environment.
6** 6**
7** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14** 14**
15** See http://www.trolltech.com/gpl/ for GPL licensing information. 15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16** 16**
17** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#ifndef ABTABLE_H 22#ifndef ABTABLE_H
23#define ABTABLE_H 23#define ABTABLE_H
24 24
25#include <qpe/categories.h> 25#include <qpe/categories.h>
26#include <opie/ocontact.h> 26#include <opie/ocontact.h>
27#include <opie/ocontactaccess.h> 27#include <opie/ocontactaccess.h>
28 28
29#include <qmap.h> 29#include <qmap.h>
30#include <qtable.h> 30#include <qtable.h>
31#include <qstringlist.h> 31#include <qstringlist.h>
32#include <qcombobox.h> 32#include <qcombobox.h>
33#include <qpixmap.h>
33 34
34class AbTableItem : public QTableItem 35class AbTableItem : public QTableItem
35{ 36{
36public: 37public:
37 AbTableItem( QTable *t, EditType et, const QString &s, 38 AbTableItem( QTable *t, EditType et, const QString &s,
38 const QString &secondSortKey); 39 const QString &secondSortKey);
39 QString entryKey() const; 40 QString entryKey() const;
40 void setEntryKey( const QString & k ); 41 void setEntryKey( const QString & k );
41 virtual int alignment() const; 42 virtual int alignment() const;
42 virtual QString key() const; 43 virtual QString key() const;
43 void setItem( const QString &txt, const QString &secondKey ); 44 void setItem( const QString &txt, const QString &secondKey );
44 45
45private: 46private:
46 QString sortKey; 47 QString sortKey;
47}; 48};
48 49
50// This is a simple container, storing all contact
51// information
52class ContactItem
53{
54 public:
55 QPixmap icon;
56 QString value;
57};
58
49class AbPickItem : public QTableItem 59class AbPickItem : public QTableItem
50{ 60{
51public: 61public:
52 AbPickItem( QTable *t ); 62 AbPickItem( QTable *t );
53 63
54 QWidget *createEditor() const; 64 QWidget *createEditor() const;
55 void setContentFromEditor( QWidget *w ); 65 void setContentFromEditor( QWidget *w );
56 66
57private: 67private:
58 QGuardedPtr<QComboBox> cb; 68 QGuardedPtr<QComboBox> cb;
59}; 69};
60 70
61class AbTable : public QTable 71class AbTable : public QTable
62{ 72{
63 Q_OBJECT 73 Q_OBJECT
64 74
65public: 75public:
66 AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); 76 AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 );
67 ~AbTable(); 77 ~AbTable();
68 78
69 // Set the contacts shown in the table 79 // Set the contacts shown in the table
70 void setContacts( const OContactAccess::List& viewList ); 80 void setContacts( const OContactAccess::List& viewList );
71 // Selects a contact of a specific UID 81 // Selects a contact of a specific UID
72 bool selectContact( int UID ); 82 bool selectContact( int UID );
73 83
74 // Get the current selected entry 84 // Get the current selected entry
75 OContact currentEntry(); 85 OContact currentEntry();
76 86
77 // Get the UID of the current selected Entry 87 // Get the UID of the current selected Entry
78 int currentEntry_UID(); 88 int currentEntry_UID();
79 89
80 QString findContactName( const OContact &entry ); 90 QString findContactName( const OContact &entry );
81 91
82 void init(); 92 void init();
83 void clear(); 93 void clear();
84 void refresh(); 94 void refresh();
85 95
86 void show(); 96 void show();
87 void setPaintingEnabled( bool e ); 97 void setPaintingEnabled( bool e );
88 void viewportPaintEvent( QPaintEvent* e); 98 void viewportPaintEvent( QPaintEvent* e);
89 99
90 // addresspicker mode (What's that ? se) 100 // addresspicker mode (What's that ? se)
91 void setChoiceNames( const QStringList& list); 101 void setChoiceNames( const QStringList& list);
92 QStringList choiceNames() const; 102 QStringList choiceNames() const;
93 void setChoiceSelection( const QValueList<int>& list ); 103 void setChoiceSelection( const QValueList<int>& list );
94 QStringList choiceSelection(int index) const; 104 QStringList choiceSelection(int index) const;
95 105
96signals: 106signals:
97 void signalSwitch(); 107 void signalSwitch();
98 void signalEditor(); 108 void signalEditor();
99 void signalKeyDown(); 109 void signalKeyDown();
100 void signalKeyUp(); 110 void signalKeyUp();
101 111
102protected: 112protected:
103 virtual void keyPressEvent( QKeyEvent *e ); 113 virtual void keyPressEvent( QKeyEvent *e );
104 114
105// int rowHeight( int ) const; 115// int rowHeight( int ) const;
106// int rowPos( int row ) const; 116// int rowPos( int row ) const;
107// virtual int rowAt( int pos ) const; 117// virtual int rowAt( int pos ) const;
108 118
109 119
110protected slots: 120protected slots:
111 void moveTo( char ); 121 void moveTo( char );
112 virtual void columnClicked( int col ); 122 virtual void columnClicked( int col );
113 void itemClicked(int,int col); 123 void itemClicked(int,int col);
114 void rowHeightChanged( int row ); 124 void rowHeightChanged( int row );
115 125
116private: 126private:
117 void insertIntoTable( const OContact &cnt, int row ); 127 void insertIntoTable( const OContact &cnt, int row );
118 QString findContactContact( const OContact &entry, int row ); 128 ContactItem findContactContact( const OContact &entry, int row );
119 void fitColumns(); 129 void fitColumns();
120 void resizeRows(); 130 void resizeRows();
121 void realignTable(); 131 void realignTable();
122 void resort(); 132 void resort();
123 void updateVisible(); 133 void updateVisible();
124 134
125 int lastSortCol; 135 int lastSortCol;
126 bool asc; 136 bool asc;
127 QMap<AbTableItem*, OContact> contactList; 137 QMap<AbTableItem*, OContact> contactList;
128 QValueList<int> intFields; 138 QValueList<int> intFields;
129 QStringList choicenames; 139 QStringList choicenames;
130 bool enablePainting; 140 bool enablePainting;
131 bool columnVisible; 141 bool columnVisible;
132 int countNested; 142 int countNested;
133 143
134 OContactAccess::List m_viewList; 144 OContactAccess::List m_viewList;
135 145
136}; 146};
137#endif // ABTABLE_H 147#endif // ABTABLE_H
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index ad8315d..881b839 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -108,206 +108,207 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
108 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
109 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); 109 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) );
110 m_tableViewButton->setToggleAction( true ); 110 m_tableViewButton->setToggleAction( true );
111 m_tableViewButton->addTo( listTools ); 111 m_tableViewButton->addTo( listTools );
112 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 ); 112 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 );
113 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) ); 113 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) );
114 m_cardViewButton->setToggleAction( true ); 114 m_cardViewButton->setToggleAction( true );
115 m_cardViewButton->addTo( listTools ); 115 m_cardViewButton->addTo( listTools );
116 116
117 listTools->addSeparator(); 117 listTools->addSeparator();
118 118
119 // Other Buttons 119 // Other Buttons
120 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 120 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null,
121 0, this, 0 ); 121 0, this, 0 );
122 actionNew = a; 122 actionNew = a;
123 connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) ); 123 connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) );
124 a->addTo( edit ); 124 a->addTo( edit );
125 a->addTo( listTools ); 125 a->addTo( listTools );
126 126
127 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 127 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
128 0, this, 0 ); 128 0, this, 0 );
129 actionEdit = a; 129 actionEdit = a;
130 connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); 130 connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) );
131 a->addTo( edit ); 131 a->addTo( edit );
132 a->addTo( listTools ); 132 a->addTo( listTools );
133 133
134 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 134 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
135 0, this, 0 ); 135 0, this, 0 );
136 actionTrash = a; 136 actionTrash = a;
137 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); 137 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) );
138 a->addTo( edit ); 138 a->addTo( edit );
139 a->addTo( listTools ); 139 a->addTo( listTools );
140 140
141 141
142 // make it possible to go directly to businesscard via qcop call 142 // make it possible to go directly to businesscard via qcop call
143 //#if defined(Q_WS_QWS) // Why this ? (se) 143 //#if defined(Q_WS_QWS) // Why this ? (se)
144#if !defined(QT_NO_COP) 144#if !defined(QT_NO_COP)
145 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); 145 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this );
146 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), 146 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
147 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); 147 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
148#endif 148#endif
149 // #endif 149 // #endif
150 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), 150 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ),
151 QString::null, 0, this, 0 ); 151 QString::null, 0, this, 0 );
152 actionFind = a; 152 actionFind = a;
153 connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); 153 connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) );
154 a->addTo( edit ); 154 a->addTo( edit );
155 a->addTo( listTools ); 155 a->addTo( listTools );
156 156
157 // Much better search widget, taken from QTReader.. (se) 157 // Much better search widget, taken from QTReader.. (se)
158 searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); 158 searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE );
159 searchBar->setHorizontalStretchable( TRUE ); 159 searchBar->setHorizontalStretchable( TRUE );
160 searchBar->hide(); 160 searchBar->hide();
161 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 161 searchEdit = new QLineEdit( searchBar, "searchEdit" );
162 162
163 // QFont f("unifont", 16 /*, QFont::Bold*/); 163 // QFont f("unifont", 16 /*, QFont::Bold*/);
164 // searchEdit->setFont( f ); 164 // searchEdit->setFont( f );
165 165
166 searchBar->setStretchableWidget( searchEdit ); 166 searchBar->setStretchableWidget( searchEdit );
167 connect( searchEdit, SIGNAL( returnPressed( ) ), 167 connect( searchEdit, SIGNAL( returnPressed( ) ),
168 this, SLOT( slotFind( ) ) ); 168 this, SLOT( slotFind( ) ) );
169 169
170 a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); 170 a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
171 connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); 171 connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
172 a->addTo( searchBar ); 172 a->addTo( searchBar );
173 173
174 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 174 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
175 connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); 175 connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) );
176 a->addTo( searchBar ); 176 a->addTo( searchBar );
177 177
178 a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), 178 a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ),
179 QString::null, 0, this, 0 ); 179 QString::null, 0, this, 0 );
180 //a->setEnabled( FALSE ); we got support for it now :) zecke 180 //a->setEnabled( FALSE ); we got support for it now :) zecke
181 actionMail = a; 181 actionMail = a;
182 connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) ); 182 connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) );
183 a->addTo( edit ); 183 a->addTo( edit );
184 a->addTo( listTools ); 184 a->addTo( listTools );
185 185
186 if ( Ir::supported() ) { 186 if ( Ir::supported() ) {
187 a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, 187 a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null,
188 0, this, 0 ); 188 0, this, 0 );
189 actionBeam = a; 189 actionBeam = a;
190 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); 190 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
191 a->addTo( edit ); 191 a->addTo( edit );
192 a->addTo( listTools ); 192 a->addTo( listTools );
193 } 193 }
194 194
195 edit->insertSeparator(); 195 edit->insertSeparator();
196 196
197 a = new QAction( tr("Import vCard"), QString::null, 0, 0); 197 a = new QAction( tr("Import vCard"), QString::null, 0, 0);
198 actionPersonal = a; 198 actionPersonal = a;
199 connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); 199 connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) );
200 a->addTo( edit ); 200 a->addTo( edit );
201 201
202 edit->insertSeparator(); 202 edit->insertSeparator();
203 203
204 a = new QAction( tr("My Personal Details"), QString::null, 0, 0, 0, TRUE ); 204 a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ),
205 QString::null, 0, this, 0 );
205 actionPersonal = a; 206 actionPersonal = a;
206 connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); 207 connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) );
207 a->addTo( edit ); 208 a->addTo( edit );
208 209
209 210
210#ifdef __DEBUG_RELEASE 211#ifdef __DEBUG_RELEASE
211 // Remove this function for public Release ! This is only 212 // Remove this function for public Release ! This is only
212 // for debug purposes .. 213 // for debug purposes ..
213 a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); 214 a = new QAction( tr( "Save all Data"), QString::null, 0, 0 );
214 connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); 215 connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) );
215 a->addTo( edit ); 216 a->addTo( edit );
216#endif 217#endif
217 a = new QAction( tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, 218 a = new QAction( tr( "Config" ), Resource::loadPixmap( "addressbook/configure" ), QString::null,
218 0, this, 0 ); 219 0, this, 0 );
219 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); 220 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) );
220 a->addTo( edit ); 221 a->addTo( edit );
221 222
222 // Create Views 223 // Create Views
223 listContainer = new QWidget( this ); 224 listContainer = new QWidget( this );
224 QVBoxLayout *vb = new QVBoxLayout( listContainer ); 225 QVBoxLayout *vb = new QVBoxLayout( listContainer );
225 226
226 m_abView = new AbView( listContainer, m_config.orderList() ); 227 m_abView = new AbView( listContainer, m_config.orderList() );
227 vb->addWidget( m_abView ); 228 vb->addWidget( m_abView );
228 // abList->setHScrollBarMode( QScrollView::AlwaysOff ); 229 // abList->setHScrollBarMode( QScrollView::AlwaysOff );
229 connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), 230 connect( m_abView, SIGNAL( signalViewSwitched ( int ) ),
230 this, SLOT( slotViewSwitched( int ) ) ); 231 this, SLOT( slotViewSwitched( int ) ) );
231 232
232 233
233 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); 234 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
234 235
235 m_abView->load(); 236 m_abView->load();
236 237
237 // Letter Picker 238 // Letter Picker
238 pLabel = new LetterPicker( listContainer ); 239 pLabel = new LetterPicker( listContainer );
239 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 240 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
240 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); 241 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) );
241 242
242 vb->addWidget( pLabel ); 243 vb->addWidget( pLabel );
243 244
244 // Category Menu 245 // Category Menu
245 catMenu = new QPopupMenu( this ); 246 catMenu = new QPopupMenu( this );
246 catMenu->setCheckable( TRUE ); 247 catMenu->setCheckable( TRUE );
247 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); 248 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
248 populateCategories(); 249 populateCategories();
249 mbList->insertItem( tr("View"), catMenu ); 250 mbList->insertItem( tr("View"), catMenu );
250 251
251 defaultFont = new QFont( m_abView->font() ); 252 defaultFont = new QFont( m_abView->font() );
252 slotSetFont(m_config.fontSize()); 253 slotSetFont(m_config.fontSize());
253 m_curFontSize = m_config.fontSize(); 254 m_curFontSize = m_config.fontSize();
254 255
255 setCentralWidget(listContainer); 256 setCentralWidget(listContainer);
256 257
257 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 258 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
258 259
259 260
260 isLoading = false; 261 isLoading = false;
261} 262}
262 263
263 264
264void AddressbookWindow::slotConfig() 265void AddressbookWindow::slotConfig()
265{ 266{
266 ConfigDlg* dlg = new ConfigDlg( this, "Config" ); 267 ConfigDlg* dlg = new ConfigDlg( this, "Config" );
267 dlg -> setConfig( m_config ); 268 dlg -> setConfig( m_config );
268 dlg -> showMaximized(); 269 dlg -> showMaximized();
269 if ( dlg -> exec() ) { 270 if ( dlg -> exec() ) {
270 qWarning ("Config Dialog accepted!"); 271 qWarning ("Config Dialog accepted!");
271 m_config = dlg -> getConfig(); 272 m_config = dlg -> getConfig();
272 if ( m_curFontSize != m_config.fontSize() ){ 273 if ( m_curFontSize != m_config.fontSize() ){
273 qWarning("Font was changed!"); 274 qWarning("Font was changed!");
274 m_curFontSize = m_config.fontSize(); 275 m_curFontSize = m_config.fontSize();
275 emit slotSetFont( m_curFontSize ); 276 emit slotSetFont( m_curFontSize );
276 } 277 }
277 m_abView -> setListOrder( m_config.orderList() ); 278 m_abView -> setListOrder( m_config.orderList() );
278 } 279 }
279 280
280 delete dlg; 281 delete dlg;
281} 282}
282 283
283 284
284void AddressbookWindow::slotSetFont( int size ) 285void AddressbookWindow::slotSetFont( int size )
285{ 286{
286 qWarning("void AddressbookWindow::slotSetFont( %d )", size); 287 qWarning("void AddressbookWindow::slotSetFont( %d )", size);
287 288
288 if (size > 2 || size < 0) 289 if (size > 2 || size < 0)
289 size = 1; 290 size = 1;
290 291
291 m_config.setFontSize( size ); 292 m_config.setFontSize( size );
292 293
293 QFont *currentFont; 294 QFont *currentFont;
294 295
295 switch (size) { 296 switch (size) {
296 case 0: 297 case 0:
297 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); 298 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) );
298 currentFont = new QFont (m_abView->font()); 299 currentFont = new QFont (m_abView->font());
299 // abList->resizeRows(currentFont->pixelSize() + 7); :SX 300 // abList->resizeRows(currentFont->pixelSize() + 7); :SX
300 // abList->resizeRows(); 301 // abList->resizeRows();
301 break; 302 break;
302 case 1: 303 case 1:
303 m_abView->setFont( *defaultFont ); 304 m_abView->setFont( *defaultFont );
304 currentFont = new QFont (m_abView->font()); 305 currentFont = new QFont (m_abView->font());
305 // // abList->resizeRows(currentFont->pixelSize() + 7); 306 // // abList->resizeRows(currentFont->pixelSize() + 7);
306 // abList->resizeRows(); 307 // abList->resizeRows();
307 break; 308 break;
308 case 2: 309 case 2:
309 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); 310 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) );
310 currentFont = new QFont (m_abView->font()); 311 currentFont = new QFont (m_abView->font());
311 // //abList->resizeRows(currentFont->pixelSize() + 7); 312 // //abList->resizeRows(currentFont->pixelSize() + 7);
312 // abList->resizeRows(); 313 // abList->resizeRows();
313 break; 314 break;
diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp
index afba688..f5c0c5b 100644
--- a/core/pim/addressbook/configdlg.cpp
+++ b/core/pim/addressbook/configdlg.cpp
@@ -1,115 +1,126 @@
1#include "configdlg.h" 1#include "configdlg.h"
2#include "ocontactfields.h" 2#include "ocontactfields.h"
3
3#include <qcheckbox.h> 4#include <qcheckbox.h>
4#include <qradiobutton.h> 5#include <qradiobutton.h>
5#include <qlistbox.h> 6#include <qlistbox.h>
6#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qiconset.h>
9
10#include <qpe/resource.h>
7 11
8#include <opie/ocontact.h> 12#include <opie/ocontact.h>
9 13
10ConfigDlg::ConfigDlg( QWidget *parent, const char *name): 14ConfigDlg::ConfigDlg( QWidget *parent, const char *name):
11 ConfigDlg_Base(parent, name, true ) 15 ConfigDlg_Base(parent, name, true )
12{ 16{
13 contFields = OContactFields::trfields(); 17 contFields = OContactFields::trfields();
14 18
15 // We add all Fields into the Listbox 19 // We add all Fields into the Listbox
16 for (uint i=0; i < contFields.count(); i++) { 20 for (uint i=0; i < contFields.count(); i++) {
17 allFieldListBox->insertItem( contFields[i] ); 21 allFieldListBox->insertItem( contFields[i] );
18 } 22 }
19 23
24 // Set Pics to Buttons and Tabs
25 m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) );
26 m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) );
27 m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) );
28 m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) );
29
30
20 // Get the translation maps between Field ID and translated strings 31 // Get the translation maps between Field ID and translated strings
21 m_mapStrToID = OContactFields::trFieldsToId(); 32 m_mapStrToID = OContactFields::trFieldsToId();
22 m_mapIDToStr = OContactFields::idToTrFields(); 33 m_mapIDToStr = OContactFields::idToTrFields();
23 34
24 connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); 35 connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) );
25 connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); 36 connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) );
26 connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); 37 connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) );
27 connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); 38 connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) );
28} 39}
29 40
30void ConfigDlg::slotItemUp() 41void ConfigDlg::slotItemUp()
31{ 42{
32 qWarning( "void ConfigDlg::slotItemUp()" ); 43 qWarning( "void ConfigDlg::slotItemUp()" );
33 44
34 int i = fieldListBox->currentItem(); 45 int i = fieldListBox->currentItem();
35 if ( i > 0 ) { 46 if ( i > 0 ) {
36 QString item = fieldListBox->currentText(); 47 QString item = fieldListBox->currentText();
37 fieldListBox->removeItem( i ); 48 fieldListBox->removeItem( i );
38 fieldListBox->insertItem( item, i-1 ); 49 fieldListBox->insertItem( item, i-1 );
39 fieldListBox->setCurrentItem( i-1 ); 50 fieldListBox->setCurrentItem( i-1 );
40 } 51 }
41 52
42} 53}
43 54
44void ConfigDlg::slotItemDown() 55void ConfigDlg::slotItemDown()
45{ 56{
46 qWarning( "void ConfigDlg::slotItemDown()" ); 57 qWarning( "void ConfigDlg::slotItemDown()" );
47 58
48 int i = fieldListBox->currentItem(); 59 int i = fieldListBox->currentItem();
49 if ( i < (int)fieldListBox->count() - 1 ) { 60 if ( i < (int)fieldListBox->count() - 1 ) {
50 QString item = fieldListBox->currentText(); 61 QString item = fieldListBox->currentText();
51 fieldListBox->removeItem( i ); 62 fieldListBox->removeItem( i );
52 fieldListBox->insertItem( item, i+1 ); 63 fieldListBox->insertItem( item, i+1 );
53 fieldListBox->setCurrentItem( i+1 ); 64 fieldListBox->setCurrentItem( i+1 );
54 } 65 }
55} 66}
56 67
57void ConfigDlg::slotItemAdd() 68void ConfigDlg::slotItemAdd()
58{ 69{
59 qWarning( "void ConfigDlg::slotItemAdd()" ); 70 qWarning( "void ConfigDlg::slotItemAdd()" );
60 71
61 int i = allFieldListBox->currentItem(); 72 int i = allFieldListBox->currentItem();
62 if ( i > 0 ) { 73 if ( i > 0 ) {
63 QString item = allFieldListBox->currentText(); 74 QString item = allFieldListBox->currentText();
64 qWarning("ADding %s", item.latin1()); 75 qWarning("ADding %s", item.latin1());
65 fieldListBox->insertItem( item ); 76 fieldListBox->insertItem( item );
66 } 77 }
67} 78}
68 79
69void ConfigDlg::slotItemRemove() 80void ConfigDlg::slotItemRemove()
70{ 81{
71 qWarning( "void ConfigDlg::slotItemRemove()" ); 82 qWarning( "void ConfigDlg::slotItemRemove()" );
72 83
73 int i = fieldListBox->currentItem(); 84 int i = fieldListBox->currentItem();
74 if ( i > 0 ) { 85 if ( i > 0 ) {
75 fieldListBox->removeItem( i ); 86 fieldListBox->removeItem( i );
76 } 87 }
77} 88}
78 89
79void ConfigDlg::setConfig( const AbConfig& cnf ) 90void ConfigDlg::setConfig( const AbConfig& cnf )
80{ 91{
81 m_config = cnf; 92 m_config = cnf;
82 93
83 m_useRegExp->setChecked( m_config.useRegExp() ); 94 m_useRegExp->setChecked( m_config.useRegExp() );
84 m_useWildCard->setChecked( m_config.useWildCards() ); 95 m_useWildCard->setChecked( m_config.useWildCards() );
85 m_useQtMail->setChecked( m_config.useQtMail() ); 96 m_useQtMail->setChecked( m_config.useQtMail() );
86 m_useOpieMail->setChecked( m_config.useOpieMail() ); 97 m_useOpieMail->setChecked( m_config.useOpieMail() );
87 m_useCaseSensitive->setChecked( m_config.beCaseSensitive() ); 98 m_useCaseSensitive->setChecked( m_config.beCaseSensitive() );
88 99
89 switch( m_config.fontSize() ){ 100 switch( m_config.fontSize() ){
90 case 0: 101 case 0:
91 m_smallFont->setChecked( true ); 102 m_smallFont->setChecked( true );
92 m_normalFont->setChecked( false ); 103 m_normalFont->setChecked( false );
93 m_largeFont->setChecked( false ); 104 m_largeFont->setChecked( false );
94 break; 105 break;
95 case 1: 106 case 1:
96 m_smallFont->setChecked( false ); 107 m_smallFont->setChecked( false );
97 m_normalFont->setChecked( true ); 108 m_normalFont->setChecked( true );
98 m_largeFont->setChecked( false ); 109 m_largeFont->setChecked( false );
99 break; 110 break;
100 case 2: 111 case 2:
101 m_smallFont->setChecked( false ); 112 m_smallFont->setChecked( false );
102 m_normalFont->setChecked( false ); 113 m_normalFont->setChecked( false );
103 m_largeFont->setChecked( true ); 114 m_largeFont->setChecked( true );
104 break; 115 break;
105 } 116 }
106 117
107 for( uint i = 0; i < m_config.orderList().count(); i++ ) { 118 for( uint i = 0; i < m_config.orderList().count(); i++ ) {
108 fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] ); 119 fieldListBox -> insertItem ( m_mapIDToStr[ m_config.orderList()[i] ] );
109 } 120 }
110 121
111 122
112} 123}
113 124
114AbConfig ConfigDlg::getConfig() 125AbConfig ConfigDlg::getConfig()
115{ 126{
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 9efb8c0..97573af 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -455,196 +455,195 @@ void ContactEditor::init() {
455 455
456 cmbCountry->setMaximumWidth( 135 ); 456 cmbCountry->setMaximumWidth( 135 );
457 457
458 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); 458 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 );
459 459
460 cmbChooserField4 = new QComboBox( FALSE, container ); 460 cmbChooserField4 = new QComboBox( FALSE, container );
461 cmbChooserField4->setMaximumWidth( 90 ); 461 cmbChooserField4->setMaximumWidth( 90 );
462 gl->addWidget( cmbChooserField4, 6, 0 ); 462 gl->addWidget( cmbChooserField4, 6, 0 );
463 txtChooserField4 = new QLineEdit( container ); 463 txtChooserField4 = new QLineEdit( container );
464 gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); 464 gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 );
465 465
466 QSpacerItem *space = new QSpacerItem(1,1, 466 QSpacerItem *space = new QSpacerItem(1,1,
467 QSizePolicy::Maximum, 467 QSizePolicy::Maximum,
468 QSizePolicy::MinimumExpanding ); 468 QSizePolicy::MinimumExpanding );
469 gl->addItem( space, 7, 0 ); 469 gl->addItem( space, 7, 0 );
470 470
471 tabMain->insertTab( tabViewport, tr( "Address" ) ); 471 tabMain->insertTab( tabViewport, tr( "Address" ) );
472 472
473 tabViewport = new QWidget ( tabMain ); 473 tabViewport = new QWidget ( tabMain );
474 474
475 vb = new QVBoxLayout( tabViewport ); 475 vb = new QVBoxLayout( tabViewport );
476 476
477 svDetails = new QScrollView( tabViewport ); 477 svDetails = new QScrollView( tabViewport );
478 vb->addWidget( svDetails, 0, 0 ); 478 vb->addWidget( svDetails, 0, 0 );
479 svDetails->setResizePolicy( QScrollView::AutoOneFit ); 479 svDetails->setResizePolicy( QScrollView::AutoOneFit );
480 svDetails->setFrameStyle( QFrame::NoFrame ); 480 svDetails->setFrameStyle( QFrame::NoFrame );
481 481
482 container = new QWidget( svDetails->viewport() ); 482 container = new QWidget( svDetails->viewport() );
483 svDetails->addChild( container ); 483 svDetails->addChild( container );
484 484
485 gl = new QGridLayout( container, 1, 2, 2, 4 ); 485 gl = new QGridLayout( container, 1, 2, 2, 4 );
486 486
487 int counter = 0; 487 int counter = 0;
488 488
489 // Birthday 489 // Birthday
490 QHBox* hBox = new QHBox( container ); 490 QHBox* hBox = new QHBox( container );
491 l = new QLabel( tr("Birthday"), container ); 491 l = new QLabel( tr("Birthday"), container );
492 gl->addWidget( l, counter, 0 ); 492 gl->addWidget( l, counter, 0 );
493 493
494 QPopupMenu* m1 = new QPopupMenu( container ); 494 QPopupMenu* m1 = new QPopupMenu( container );
495 birthdayPicker = new DateBookMonth( m1, 0, TRUE ); 495 birthdayPicker = new DateBookMonth( m1, 0, TRUE );
496 m1->insertItem( birthdayPicker ); 496 m1->insertItem( birthdayPicker );
497 497
498 birthdayButton= new QToolButton( hBox, "buttonStart" ); 498 birthdayButton= new QToolButton( hBox, "buttonStart" );
499 birthdayButton->setPopup( m1 ); 499 birthdayButton->setPopup( m1 );
500 birthdayButton->setPopupDelay(0); 500 birthdayButton->setPopupDelay(0);
501 501
502 QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), 502 QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ),
503 tr( "Delete" ), 503 tr( "Delete" ),
504 hBox, 0 ); 504 hBox, 0 );
505 505
506 gl->addWidget( hBox, counter , 1 ); 506 gl->addWidget( hBox, counter , 1 );
507 507
508 connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), 508 connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ),
509 this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); 509 this, SLOT( slotBirthdayDateChanged( int, int, int ) ) );
510 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); 510 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) );
511 511
512 ++counter; 512 ++counter;
513 513
514 // Anniversary 514 // Anniversary
515 hBox = new QHBox( container ); 515 hBox = new QHBox( container );
516 l = new QLabel( tr("Anniversary"), container ); 516 l = new QLabel( tr("Anniversary"), container );
517 gl->addWidget( l, counter, 0 ); 517 gl->addWidget( l, counter, 0 );
518 518
519 m1 = new QPopupMenu( container ); 519 m1 = new QPopupMenu( container );
520 anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); 520 anniversaryPicker = new DateBookMonth( m1, 0, TRUE );
521 m1->insertItem( anniversaryPicker ); 521 m1->insertItem( anniversaryPicker );
522 522
523 anniversaryButton= new QToolButton( hBox, "buttonStart" ); 523 anniversaryButton= new QToolButton( hBox, "buttonStart" );
524 anniversaryButton->setPopup( m1 ); 524 anniversaryButton->setPopup( m1 );
525 anniversaryButton->setPopupDelay(0); 525 anniversaryButton->setPopupDelay(0);
526 526
527 deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), 527 deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ),
528 tr( "Delete" ), 528 tr( "Delete" ),
529 hBox, 0 ); 529 hBox, 0 );
530 gl->addWidget( hBox, counter , 1 ); 530 gl->addWidget( hBox, counter , 1 );
531 531
532 connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), 532 connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ),
533 this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); 533 this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) );
534 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); 534 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) );
535 535
536 ++counter; 536 ++counter;
537 537
538 // Gender 538 // Gender
539 l = new QLabel( tr("Gender"), container ); 539 l = new QLabel( tr("Gender"), container );
540 gl->addWidget( l, counter, 0 ); 540 gl->addWidget( l, counter, 0 );
541 cmbGender = new QComboBox( container ); 541 cmbGender = new QComboBox( container );
542 cmbGender->insertItem( "", 0 ); 542 cmbGender->insertItem( "", 0 );
543 cmbGender->insertItem( tr("Male"), 1); 543 cmbGender->insertItem( tr("Male"), 1);
544 cmbGender->insertItem( tr("Female"), 2); 544 cmbGender->insertItem( tr("Female"), 2);
545 gl->addWidget( cmbGender, counter, 1 ); 545 gl->addWidget( cmbGender, counter, 1 );
546 546
547 ++counter; 547 ++counter;
548 548
549 // Create Labels and lineedit fields for every dynamic entry 549 // Create Labels and lineedit fields for every dynamic entry
550 QStringList::ConstIterator it = slDynamicEntries.begin(); 550 QStringList::ConstIterator it = slDynamicEntries.begin();
551 QStringList::ConstIterator trit = trlDynamicEntries.begin();
552 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); 551 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId();
553 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); 552 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields();
554 for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { 553 for (i = counter; it != slDynamicEntries.end(); i++, ++it ) {
555 554
556 if (((*it) == "Anniversary") || 555 if (((*it) == "Anniversary") ||
557 ((*it) == "Birthday")|| ((*it) == "Gender")) continue; 556 ((*it) == "Birthday")|| ((*it) == "Gender")) continue;
558 557
559 l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); 558 l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container );
560 listName.append( l ); 559 listName.append( l );
561 gl->addWidget( l, i, 0 ); 560 gl->addWidget( l, i, 0 );
562 QLineEdit *e = new QLineEdit( container ); 561 QLineEdit *e = new QLineEdit( container );
563 listValue.append( e ); 562 listValue.append( e );
564 gl->addWidget( e, i, 1); 563 gl->addWidget( e, i, 1);
565 } 564 }
566 // Fill labels with names.. 565 // Fill labels with names..
567 //loadFields(); 566 //loadFields();
568 567
569 568
570 tabMain->insertTab( tabViewport, tr( "Details" ) ); 569 tabMain->insertTab( tabViewport, tr( "Details" ) );
571 570
572 dlgNote = new QDialog( this, "Note Dialog", TRUE ); 571 dlgNote = new QDialog( this, "Note Dialog", TRUE );
573 dlgNote->setCaption( tr("Enter Note") ); 572 dlgNote->setCaption( tr("Enter Note") );
574 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); 573 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote );
575 txtNote = new QMultiLineEdit( dlgNote ); 574 txtNote = new QMultiLineEdit( dlgNote );
576 vbNote->addWidget( txtNote ); 575 vbNote->addWidget( txtNote );
577 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); 576 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) );
578 577
579 dlgName = new QDialog( this, "Name Dialog", TRUE ); 578 dlgName = new QDialog( this, "Name Dialog", TRUE );
580 dlgName->setCaption( tr("Edit Name") ); 579 dlgName->setCaption( tr("Edit Name") );
581 gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); 580 gl = new QGridLayout( dlgName, 5, 2, 2, 3 );
582 581
583 l = new QLabel( tr("First Name"), dlgName ); 582 l = new QLabel( tr("First Name"), dlgName );
584 gl->addWidget( l, 0, 0 ); 583 gl->addWidget( l, 0, 0 );
585 txtFirstName = new QLineEdit( dlgName ); 584 txtFirstName = new QLineEdit( dlgName );
586 gl->addWidget( txtFirstName, 0, 1 ); 585 gl->addWidget( txtFirstName, 0, 1 );
587 586
588 l = new QLabel( tr("Middle Name"), dlgName ); 587 l = new QLabel( tr("Middle Name"), dlgName );
589 gl->addWidget( l, 1, 0 ); 588 gl->addWidget( l, 1, 0 );
590 txtMiddleName = new QLineEdit( dlgName ); 589 txtMiddleName = new QLineEdit( dlgName );
591 gl->addWidget( txtMiddleName, 1, 1 ); 590 gl->addWidget( txtMiddleName, 1, 1 );
592 591
593 l = new QLabel( tr("Last Name"), dlgName ); 592 l = new QLabel( tr("Last Name"), dlgName );
594 gl->addWidget( l, 2, 0 ); 593 gl->addWidget( l, 2, 0 );
595 txtLastName = new QLineEdit( dlgName ); 594 txtLastName = new QLineEdit( dlgName );
596 gl->addWidget( txtLastName, 2, 1 ); 595 gl->addWidget( txtLastName, 2, 1 );
597 596
598 l = new QLabel( tr("Suffix"), dlgName ); 597 l = new QLabel( tr("Suffix"), dlgName );
599 gl->addWidget( l, 3, 0 ); 598 gl->addWidget( l, 3, 0 );
600 txtSuffix = new QLineEdit( dlgName ); 599 txtSuffix = new QLineEdit( dlgName );
601 gl->addWidget( txtSuffix, 3, 1 ); 600 gl->addWidget( txtSuffix, 3, 1 );
602 space = new QSpacerItem(1,1, 601 space = new QSpacerItem(1,1,
603 QSizePolicy::Maximum, 602 QSizePolicy::Maximum,
604 QSizePolicy::MinimumExpanding ); 603 QSizePolicy::MinimumExpanding );
605 gl->addItem( space, 4, 0 ); 604 gl->addItem( space, 4, 0 );
606 605
607 cmbChooserField1->insertStringList( trlChooserNames ); 606 cmbChooserField1->insertStringList( trlChooserNames );
608 cmbChooserField2->insertStringList( trlChooserNames ); 607 cmbChooserField2->insertStringList( trlChooserNames );
609 cmbChooserField3->insertStringList( trlChooserNames ); 608 cmbChooserField3->insertStringList( trlChooserNames );
610 cmbChooserField4->insertStringList( trlChooserNames ); 609 cmbChooserField4->insertStringList( trlChooserNames );
611 610
612 cmbChooserField1->setCurrentItem( 0 ); 611 cmbChooserField1->setCurrentItem( 0 );
613 cmbChooserField2->setCurrentItem( 1 ); 612 cmbChooserField2->setCurrentItem( 1 );
614 cmbChooserField3->setCurrentItem( 2 ); 613 cmbChooserField3->setCurrentItem( 2 );
615 614
616 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); 615 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) );
617 616
618 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); 617 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) );
619 618
620 connect( txtChooserField1, SIGNAL(textChanged(const QString &)), 619 connect( txtChooserField1, SIGNAL(textChanged(const QString &)),
621 this, SLOT(slotChooser1Change(const QString &)) ); 620 this, SLOT(slotChooser1Change(const QString &)) );
622 connect( txtChooserField2, SIGNAL(textChanged(const QString &)), 621 connect( txtChooserField2, SIGNAL(textChanged(const QString &)),
623 this, SLOT(slotChooser2Change(const QString &)) ); 622 this, SLOT(slotChooser2Change(const QString &)) );
624 connect( txtChooserField3, SIGNAL(textChanged(const QString &)), 623 connect( txtChooserField3, SIGNAL(textChanged(const QString &)),
625 this, SLOT(slotChooser3Change(const QString &)) ); 624 this, SLOT(slotChooser3Change(const QString &)) );
626 connect( txtChooserField4, SIGNAL(textChanged(const QString &)), 625 connect( txtChooserField4, SIGNAL(textChanged(const QString &)),
627 this, SLOT(slotChooser4Change(const QString &)) ); 626 this, SLOT(slotChooser4Change(const QString &)) );
628 connect( txtAddress, SIGNAL(textChanged(const QString &)), 627 connect( txtAddress, SIGNAL(textChanged(const QString &)),
629 this, SLOT(slotAddressChange(const QString &)) ); 628 this, SLOT(slotAddressChange(const QString &)) );
630 connect( txtCity, SIGNAL(textChanged(const QString &)), 629 connect( txtCity, SIGNAL(textChanged(const QString &)),
631 this, SLOT(slotCityChange(const QString &)) ); 630 this, SLOT(slotCityChange(const QString &)) );
632 connect( txtState, SIGNAL(textChanged(const QString &)), 631 connect( txtState, SIGNAL(textChanged(const QString &)),
633 this, SLOT(slotStateChange(const QString &)) ); 632 this, SLOT(slotStateChange(const QString &)) );
634 connect( txtZip, SIGNAL(textChanged(const QString &)), 633 connect( txtZip, SIGNAL(textChanged(const QString &)),
635 this, SLOT(slotZipChange(const QString &)) ); 634 this, SLOT(slotZipChange(const QString &)) );
636 connect( cmbCountry, SIGNAL(textChanged(const QString &)), 635 connect( cmbCountry, SIGNAL(textChanged(const QString &)),
637 this, SLOT(slotCountryChange(const QString &)) ); 636 this, SLOT(slotCountryChange(const QString &)) );
638 connect( cmbCountry, SIGNAL(activated(const QString &)), 637 connect( cmbCountry, SIGNAL(activated(const QString &)),
639 this, SLOT(slotCountryChange(const QString &)) ); 638 this, SLOT(slotCountryChange(const QString &)) );
640 connect( cmbChooserField1, SIGNAL(activated(int)), 639 connect( cmbChooserField1, SIGNAL(activated(int)),
641 this, SLOT(slotCmbChooser1Change(int)) ); 640 this, SLOT(slotCmbChooser1Change(int)) );
642 connect( cmbChooserField2, SIGNAL(activated(int)), 641 connect( cmbChooserField2, SIGNAL(activated(int)),
643 this, SLOT(slotCmbChooser2Change(int)) ); 642 this, SLOT(slotCmbChooser2Change(int)) );
644 connect( cmbChooserField3, SIGNAL(activated(int)), 643 connect( cmbChooserField3, SIGNAL(activated(int)),
645 this, SLOT(slotCmbChooser3Change(int)) ); 644 this, SLOT(slotCmbChooser3Change(int)) );
646 connect( cmbChooserField4, SIGNAL(activated(int)), 645 connect( cmbChooserField4, SIGNAL(activated(int)),
647 this, SLOT(slotCmbChooser4Change(int)) ); 646 this, SLOT(slotCmbChooser4Change(int)) );
648 connect( cmbAddress, SIGNAL(activated(int)), 647 connect( cmbAddress, SIGNAL(activated(int)),
649 this, SLOT(slotAddressTypeChange(int)) ); 648 this, SLOT(slotAddressTypeChange(int)) );
650 649
diff --git a/core/pim/addressbook/ocontactfields.cpp b/core/pim/addressbook/ocontactfields.cpp
index 18b68c4..ffb88e8 100644
--- a/core/pim/addressbook/ocontactfields.cpp
+++ b/core/pim/addressbook/ocontactfields.cpp
@@ -1,293 +1,295 @@
1 1
2#include "ocontactfields.h" 2#include "ocontactfields.h"
3 3
4#include <qstringlist.h> 4#include <qstringlist.h>
5#include <qobject.h> 5#include <qobject.h>
6 6
7// We should use our own enum in the future .. 7// We should use our own enum in the future ..
8#include <qpe/recordfields.h> 8#include <qpe/recordfields.h>
9#include <qpe/config.h> 9#include <qpe/config.h>
10#include <opie/ocontact.h> 10#include <opie/ocontact.h>
11 11
12/*! 12/*!
13 \internal 13 \internal
14 Returns a list of details field names for a contact. 14 Returns a list of details field names for a contact.
15*/ 15*/
16QStringList OContactFields::untrdetailsfields( bool sorted ) 16QStringList OContactFields::untrdetailsfields( bool sorted )
17{ 17{
18 QStringList list; 18 QStringList list;
19 QMap<int, QString> mapIdToStr = idToUntrFields(); 19 QMap<int, QString> mapIdToStr = idToUntrFields();
20 20
21 list.append( mapIdToStr[ Qtopia::Office ] ); 21 list.append( mapIdToStr[ Qtopia::Office ] );
22 list.append( mapIdToStr[ Qtopia::Profession ] ); 22 list.append( mapIdToStr[ Qtopia::Profession ] );
23 list.append( mapIdToStr[ Qtopia::Assistant ] ); 23 list.append( mapIdToStr[ Qtopia::Assistant ] );
24 list.append( mapIdToStr[ Qtopia::Manager ] ); 24 list.append( mapIdToStr[ Qtopia::Manager ] );
25 25
26 list.append( mapIdToStr[ Qtopia::Spouse ] ); 26 list.append( mapIdToStr[ Qtopia::Spouse ] );
27 list.append( mapIdToStr[ Qtopia::Gender ] ); 27 list.append( mapIdToStr[ Qtopia::Gender ] );
28 list.append( mapIdToStr[ Qtopia::Birthday ] ); 28 list.append( mapIdToStr[ Qtopia::Birthday ] );
29 list.append( mapIdToStr[ Qtopia::Anniversary ] ); 29 list.append( mapIdToStr[ Qtopia::Anniversary ] );
30 list.append( mapIdToStr[ Qtopia::Nickname ] ); 30 list.append( mapIdToStr[ Qtopia::Nickname ] );
31 list.append( mapIdToStr[ Qtopia::Children ] ); 31 list.append( mapIdToStr[ Qtopia::Children ] );
32 32
33 if (sorted) list.sort(); 33 if (sorted) list.sort();
34 return list; 34 return list;
35} 35}
36 36
37/*! 37/*!
38 \internal 38 \internal
39 Returns a translated list of details field names for a contact. 39 Returns a translated list of details field names for a contact.
40*/ 40*/
41QStringList OContactFields::trdetailsfields( bool sorted ) 41QStringList OContactFields::trdetailsfields( bool sorted )
42{ 42{
43 QStringList list; 43 QStringList list;
44 QMap<int, QString> mapIdToStr = idToTrFields(); 44 QMap<int, QString> mapIdToStr = idToTrFields();
45 45
46 list.append( mapIdToStr[Qtopia::Office] ); 46 list.append( mapIdToStr[Qtopia::Office] );
47 list.append( mapIdToStr[Qtopia::Profession] ); 47 list.append( mapIdToStr[Qtopia::Profession] );
48 list.append( mapIdToStr[Qtopia::Assistant] ); 48 list.append( mapIdToStr[Qtopia::Assistant] );
49 list.append( mapIdToStr[Qtopia::Manager] ); 49 list.append( mapIdToStr[Qtopia::Manager] );
50 50
51 list.append( mapIdToStr[Qtopia::Spouse] ); 51 list.append( mapIdToStr[Qtopia::Spouse] );
52 list.append( mapIdToStr[Qtopia::Gender] ); 52 list.append( mapIdToStr[Qtopia::Gender] );
53 list.append( mapIdToStr[Qtopia::Birthday] ); 53 list.append( mapIdToStr[Qtopia::Birthday] );
54 list.append( mapIdToStr[Qtopia::Anniversary] ); 54 list.append( mapIdToStr[Qtopia::Anniversary] );
55 list.append( mapIdToStr[Qtopia::Nickname] ); 55 list.append( mapIdToStr[Qtopia::Nickname] );
56 list.append( mapIdToStr[Qtopia::Children] ); 56 list.append( mapIdToStr[Qtopia::Children] );
57 57
58 if (sorted) list.sort(); 58 if (sorted) list.sort();
59 return list; 59 return list;
60} 60}
61 61
62 62
63/*! 63/*!
64 \internal 64 \internal
65 Returns a translated list of phone field names for a contact. 65 Returns a translated list of phone field names for a contact.
66*/ 66*/
67QStringList OContactFields::trphonefields( bool sorted ) 67QStringList OContactFields::trphonefields( bool sorted )
68{ 68{
69 QStringList list; 69 QStringList list;
70 QMap<int, QString> mapIdToStr = idToTrFields(); 70 QMap<int, QString> mapIdToStr = idToTrFields();
71 71
72 list.append( mapIdToStr[Qtopia::BusinessPhone] ); 72 list.append( mapIdToStr[Qtopia::BusinessPhone] );
73 list.append( mapIdToStr[Qtopia::BusinessFax] ); 73 list.append( mapIdToStr[Qtopia::BusinessFax] );
74 list.append( mapIdToStr[Qtopia::BusinessMobile] ); 74 list.append( mapIdToStr[Qtopia::BusinessMobile] );
75 list.append( mapIdToStr[Qtopia::BusinessPager] );
76 list.append( mapIdToStr[Qtopia::BusinessWebPage] );
75 77
76 list.append( mapIdToStr[Qtopia::DefaultEmail] ); 78 list.append( mapIdToStr[Qtopia::DefaultEmail] );
77 list.append( mapIdToStr[Qtopia::Emails] ); 79 list.append( mapIdToStr[Qtopia::Emails] );
78 80
79 list.append( mapIdToStr[Qtopia::HomePhone] ); 81 list.append( mapIdToStr[Qtopia::HomePhone] );
80 list.append( mapIdToStr[Qtopia::HomeFax] ); 82 list.append( mapIdToStr[Qtopia::HomeFax] );
81 list.append( mapIdToStr[Qtopia::HomeMobile] ); 83 list.append( mapIdToStr[Qtopia::HomeMobile] );
84 // list.append( mapIdToStr[Qtopia::HomePager] );
85 list.append( mapIdToStr[Qtopia::HomeWebPage] );
82 86
83 if (sorted) list.sort(); 87 if (sorted) list.sort();
84 88
85 return list; 89 return list;
86} 90}
87 91
88 92
89/*! 93/*!
90 \internal 94 \internal
91 Returns a list of phone field names for a contact. 95 Returns a list of phone field names for a contact.
92*/ 96*/
93QStringList OContactFields::untrphonefields( bool sorted ) 97QStringList OContactFields::untrphonefields( bool sorted )
94{ 98{
95 QStringList list; 99 QStringList list;
96 QMap<int, QString> mapIdToStr = idToUntrFields(); 100 QMap<int, QString> mapIdToStr = idToUntrFields();
97 101
98 list.append( mapIdToStr[ Qtopia::BusinessPhone ] ); 102 list.append( mapIdToStr[ Qtopia::BusinessPhone ] );
99 list.append( mapIdToStr[ Qtopia::BusinessFax ] ); 103 list.append( mapIdToStr[ Qtopia::BusinessFax ] );
100 list.append( mapIdToStr[ Qtopia::BusinessMobile ] ); 104 list.append( mapIdToStr[ Qtopia::BusinessMobile ] );
105 list.append( mapIdToStr[ Qtopia::BusinessPager ] );
106 list.append( mapIdToStr[ Qtopia::BusinessWebPage ] );
101 107
102 list.append( mapIdToStr[ Qtopia::DefaultEmail ] ); 108 list.append( mapIdToStr[ Qtopia::DefaultEmail ] );
103 list.append( mapIdToStr[ Qtopia::Emails ] ); 109 list.append( mapIdToStr[ Qtopia::Emails ] );
104 110
105 list.append( mapIdToStr[ Qtopia::HomePhone ] ); 111 list.append( mapIdToStr[ Qtopia::HomePhone ] );
106 list.append( mapIdToStr[ Qtopia::HomeFax ] ); 112 list.append( mapIdToStr[ Qtopia::HomeFax ] );
107 list.append( mapIdToStr[ Qtopia::HomeMobile ] ); 113 list.append( mapIdToStr[ Qtopia::HomeMobile ] );
114 //list.append( mapIdToStr[Qtopia::HomePager] );
115 list.append( mapIdToStr[Qtopia::HomeWebPage] );
108 116
109 if (sorted) list.sort(); 117 if (sorted) list.sort();
110 118
111 return list; 119 return list;
112} 120}
113 121
114 122
115/*! 123/*!
116 \internal 124 \internal
117 Returns a translated list of field names for a contact. 125 Returns a translated list of field names for a contact.
118*/ 126*/
119QStringList OContactFields::trfields( bool sorted ) 127QStringList OContactFields::trfields( bool sorted )
120{ 128{
121 QStringList list; 129 QStringList list;
122 QMap<int, QString> mapIdToStr = idToTrFields(); 130 QMap<int, QString> mapIdToStr = idToTrFields();
123 131
124 list.append( mapIdToStr[Qtopia::Title]); 132 list.append( mapIdToStr[Qtopia::Title]);
125 list.append( mapIdToStr[Qtopia::FirstName] ); 133 list.append( mapIdToStr[Qtopia::FirstName] );
126 list.append( mapIdToStr[Qtopia::MiddleName] ); 134 list.append( mapIdToStr[Qtopia::MiddleName] );
127 list.append( mapIdToStr[Qtopia::LastName] ); 135 list.append( mapIdToStr[Qtopia::LastName] );
128 list.append( mapIdToStr[Qtopia::Suffix] ); 136 list.append( mapIdToStr[Qtopia::Suffix] );
129 list.append( mapIdToStr[Qtopia::FileAs] ); 137 list.append( mapIdToStr[Qtopia::FileAs] );
130 138
131 list.append( mapIdToStr[Qtopia::JobTitle] ); 139 list.append( mapIdToStr[Qtopia::JobTitle] );
132 list.append( mapIdToStr[Qtopia::Department] ); 140 list.append( mapIdToStr[Qtopia::Department] );
133 list.append( mapIdToStr[Qtopia::Company] ); 141 list.append( mapIdToStr[Qtopia::Company] );
134 142
135 list += trphonefields( sorted ); 143 list += trphonefields( sorted );
136 144
137 list.append( mapIdToStr[Qtopia::BusinessStreet] ); 145 list.append( mapIdToStr[Qtopia::BusinessStreet] );
138 list.append( mapIdToStr[Qtopia::BusinessCity] ); 146 list.append( mapIdToStr[Qtopia::BusinessCity] );
139 list.append( mapIdToStr[Qtopia::BusinessState] ); 147 list.append( mapIdToStr[Qtopia::BusinessState] );
140 list.append( mapIdToStr[Qtopia::BusinessZip] ); 148 list.append( mapIdToStr[Qtopia::BusinessZip] );
141 list.append( mapIdToStr[Qtopia::BusinessCountry] ); 149 list.append( mapIdToStr[Qtopia::BusinessCountry] );
142 list.append( mapIdToStr[Qtopia::BusinessPager] );
143 list.append( mapIdToStr[Qtopia::BusinessWebPage] );
144 150
145 list.append( mapIdToStr[Qtopia::HomeStreet] ); 151 list.append( mapIdToStr[Qtopia::HomeStreet] );
146 list.append( mapIdToStr[Qtopia::HomeCity] ); 152 list.append( mapIdToStr[Qtopia::HomeCity] );
147 list.append( mapIdToStr[Qtopia::HomeState] ); 153 list.append( mapIdToStr[Qtopia::HomeState] );
148 list.append( mapIdToStr[Qtopia::HomeZip] ); 154 list.append( mapIdToStr[Qtopia::HomeZip] );
149 list.append( mapIdToStr[Qtopia::HomeCountry] ); 155 list.append( mapIdToStr[Qtopia::HomeCountry] );
150 list.append( mapIdToStr[Qtopia::HomeWebPage] );
151 156
152 list += trdetailsfields( sorted ); 157 list += trdetailsfields( sorted );
153 158
154 list.append( mapIdToStr[Qtopia::Notes] ); 159 list.append( mapIdToStr[Qtopia::Notes] );
155 list.append( mapIdToStr[Qtopia::Groups] ); 160 list.append( mapIdToStr[Qtopia::Groups] );
156 161
157 if (sorted) list.sort(); 162 if (sorted) list.sort();
158 163
159 return list; 164 return list;
160} 165}
161 166
162/*! 167/*!
163 \internal 168 \internal
164 Returns an untranslated list of field names for a contact. 169 Returns an untranslated list of field names for a contact.
165*/ 170*/
166QStringList OContactFields::untrfields( bool sorted ) 171QStringList OContactFields::untrfields( bool sorted )
167{ 172{
168 QStringList list; 173 QStringList list;
169 QMap<int, QString> mapIdToStr = idToUntrFields(); 174 QMap<int, QString> mapIdToStr = idToUntrFields();
170 175
171 list.append( mapIdToStr[ Qtopia::Title ] ); 176 list.append( mapIdToStr[ Qtopia::Title ] );
172 list.append( mapIdToStr[ Qtopia::FirstName ] ); 177 list.append( mapIdToStr[ Qtopia::FirstName ] );
173 list.append( mapIdToStr[ Qtopia::MiddleName ] ); 178 list.append( mapIdToStr[ Qtopia::MiddleName ] );
174 list.append( mapIdToStr[ Qtopia::LastName ] ); 179 list.append( mapIdToStr[ Qtopia::LastName ] );
175 list.append( mapIdToStr[ Qtopia::Suffix ] ); 180 list.append( mapIdToStr[ Qtopia::Suffix ] );
176 list.append( mapIdToStr[ Qtopia::FileAs ] ); 181 list.append( mapIdToStr[ Qtopia::FileAs ] );
177 182
178 list.append( mapIdToStr[ Qtopia::JobTitle ] ); 183 list.append( mapIdToStr[ Qtopia::JobTitle ] );
179 list.append( mapIdToStr[ Qtopia::Department ] ); 184 list.append( mapIdToStr[ Qtopia::Department ] );
180 list.append( mapIdToStr[ Qtopia::Company ] ); 185 list.append( mapIdToStr[ Qtopia::Company ] );
181 186
182 list += untrphonefields( sorted ); 187 list += untrphonefields( sorted );
183 188
184 list.append( mapIdToStr[ Qtopia::BusinessStreet ] ); 189 list.append( mapIdToStr[ Qtopia::BusinessStreet ] );
185 list.append( mapIdToStr[ Qtopia::BusinessCity ] ); 190 list.append( mapIdToStr[ Qtopia::BusinessCity ] );
186 list.append( mapIdToStr[ Qtopia::BusinessState ] ); 191 list.append( mapIdToStr[ Qtopia::BusinessState ] );
187 list.append( mapIdToStr[ Qtopia::BusinessZip ] ); 192 list.append( mapIdToStr[ Qtopia::BusinessZip ] );
188 list.append( mapIdToStr[ Qtopia::BusinessCountry ] ); 193 list.append( mapIdToStr[ Qtopia::BusinessCountry ] );
189 list.append( mapIdToStr[ Qtopia::BusinessPager ] );
190 list.append( mapIdToStr[ Qtopia::BusinessWebPage ] );
191 194
192 list.append( mapIdToStr[ Qtopia::HomeStreet ] ); 195 list.append( mapIdToStr[ Qtopia::HomeStreet ] );
193 list.append( mapIdToStr[ Qtopia::HomeCity ] ); 196 list.append( mapIdToStr[ Qtopia::HomeCity ] );
194 list.append( mapIdToStr[ Qtopia::HomeState ] ); 197 list.append( mapIdToStr[ Qtopia::HomeState ] );
195 list.append( mapIdToStr[ Qtopia::HomeZip ] ); 198 list.append( mapIdToStr[ Qtopia::HomeZip ] );
196 list.append( mapIdToStr[ Qtopia::HomeCountry ] ); 199 list.append( mapIdToStr[ Qtopia::HomeCountry ] );
197 list.append( mapIdToStr[ Qtopia::HomeWebPage] );
198 200
199 list += untrdetailsfields( sorted ); 201 list += untrdetailsfields( sorted );
200 202
201 list.append( mapIdToStr[ Qtopia::Notes ] ); 203 list.append( mapIdToStr[ Qtopia::Notes ] );
202 list.append( mapIdToStr[ Qtopia::Groups ] ); 204 list.append( mapIdToStr[ Qtopia::Groups ] );
203 205
204 if (sorted) list.sort(); 206 if (sorted) list.sort();
205 207
206 return list; 208 return list;
207} 209}
208QMap<int, QString> OContactFields::idToTrFields() 210QMap<int, QString> OContactFields::idToTrFields()
209{ 211{
210 QMap<int, QString> ret_map; 212 QMap<int, QString> ret_map;
211 213
212 ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") ); 214 ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") );
213 ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) ); 215 ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) );
214 ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) ); 216 ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) );
215 ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) ); 217 ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) );
216 ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" )); 218 ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" ));
217 ret_map.insert( Qtopia::FileAs, QObject::tr( "File As" ) ); 219 ret_map.insert( Qtopia::FileAs, QObject::tr( "File As" ) );
218 220
219 ret_map.insert( Qtopia::JobTitle, QObject::tr( "Job Title" ) ); 221 ret_map.insert( Qtopia::JobTitle, QObject::tr( "Job Title" ) );
220 ret_map.insert( Qtopia::Department, QObject::tr( "Department" ) ); 222 ret_map.insert( Qtopia::Department, QObject::tr( "Department" ) );
221 ret_map.insert( Qtopia::Company, QObject::tr( "Company" ) ); 223 ret_map.insert( Qtopia::Company, QObject::tr( "Company" ) );
222 ret_map.insert( Qtopia::BusinessPhone, QObject::tr( "Business Phone" ) ); 224 ret_map.insert( Qtopia::BusinessPhone, QObject::tr( "Business Phone" ) );
223 ret_map.insert( Qtopia::BusinessFax, QObject::tr( "Business Fax" ) ); 225 ret_map.insert( Qtopia::BusinessFax, QObject::tr( "Business Fax" ) );
224 ret_map.insert( Qtopia::BusinessMobile, QObject::tr( "Business Mobile" )); 226 ret_map.insert( Qtopia::BusinessMobile, QObject::tr( "Business Mobile" ));
225 227
226 // email 228 // email
227 ret_map.insert( Qtopia::DefaultEmail, QObject::tr( "Default Email" ) ); 229 ret_map.insert( Qtopia::DefaultEmail, QObject::tr( "Default Email" ) );
228 ret_map.insert( Qtopia::Emails, QObject::tr( "Emails" ) ); 230 ret_map.insert( Qtopia::Emails, QObject::tr( "Emails" ) );
229 231
230 ret_map.insert( Qtopia::HomePhone, QObject::tr( "Home Phone" ) ); 232 ret_map.insert( Qtopia::HomePhone, QObject::tr( "Home Phone" ) );
231 ret_map.insert( Qtopia::HomeFax, QObject::tr( "Home Fax" ) ); 233 ret_map.insert( Qtopia::HomeFax, QObject::tr( "Home Fax" ) );
232 ret_map.insert( Qtopia::HomeMobile, QObject::tr( "Home Mobile" ) ); 234 ret_map.insert( Qtopia::HomeMobile, QObject::tr( "Home Mobile" ) );
233 235
234 // business 236 // business
235 ret_map.insert( Qtopia::BusinessStreet, QObject::tr( "Business Street" ) ); 237 ret_map.insert( Qtopia::BusinessStreet, QObject::tr( "Business Street" ) );
236 ret_map.insert( Qtopia::BusinessCity, QObject::tr( "Business City" ) ); 238 ret_map.insert( Qtopia::BusinessCity, QObject::tr( "Business City" ) );
237 ret_map.insert( Qtopia::BusinessState, QObject::tr( "Business State" ) ); 239 ret_map.insert( Qtopia::BusinessState, QObject::tr( "Business State" ) );
238 ret_map.insert( Qtopia::BusinessZip, QObject::tr( "Business Zip" ) ); 240 ret_map.insert( Qtopia::BusinessZip, QObject::tr( "Business Zip" ) );
239 ret_map.insert( Qtopia::BusinessCountry, QObject::tr( "Business Country" ) ); 241 ret_map.insert( Qtopia::BusinessCountry, QObject::tr( "Business Country" ) );
240 ret_map.insert( Qtopia::BusinessPager, QObject::tr( "Business Pager" ) ); 242 ret_map.insert( Qtopia::BusinessPager, QObject::tr( "Business Pager" ) );
241 ret_map.insert( Qtopia::BusinessWebPage, QObject::tr( "Business WebPage" ) ); 243 ret_map.insert( Qtopia::BusinessWebPage, QObject::tr( "Business WebPage" ) );
242 244
243 ret_map.insert( Qtopia::Office, QObject::tr( "Office" ) ); 245 ret_map.insert( Qtopia::Office, QObject::tr( "Office" ) );
244 ret_map.insert( Qtopia::Profession, QObject::tr( "Profession" ) ); 246 ret_map.insert( Qtopia::Profession, QObject::tr( "Profession" ) );
245 ret_map.insert( Qtopia::Assistant, QObject::tr( "Assistant" ) ); 247 ret_map.insert( Qtopia::Assistant, QObject::tr( "Assistant" ) );
246 ret_map.insert( Qtopia::Manager, QObject::tr( "Manager" ) ); 248 ret_map.insert( Qtopia::Manager, QObject::tr( "Manager" ) );
247 249
248 // home 250 // home
249 ret_map.insert( Qtopia::HomeStreet, QObject::tr( "Home Street" ) ); 251 ret_map.insert( Qtopia::HomeStreet, QObject::tr( "Home Street" ) );
250 ret_map.insert( Qtopia::HomeCity, QObject::tr( "Home City" ) ); 252 ret_map.insert( Qtopia::HomeCity, QObject::tr( "Home City" ) );
251 ret_map.insert( Qtopia::HomeState, QObject::tr( "Home State" ) ); 253 ret_map.insert( Qtopia::HomeState, QObject::tr( "Home State" ) );
252 ret_map.insert( Qtopia::HomeZip, QObject::tr( "Home Zip" ) ); 254 ret_map.insert( Qtopia::HomeZip, QObject::tr( "Home Zip" ) );
253 ret_map.insert( Qtopia::HomeCountry, QObject::tr( "Home Country" ) ); 255 ret_map.insert( Qtopia::HomeCountry, QObject::tr( "Home Country" ) );
254 ret_map.insert( Qtopia::HomeWebPage, QObject::tr( "Home Web Page" ) ); 256 ret_map.insert( Qtopia::HomeWebPage, QObject::tr( "Home Web Page" ) );
255 257
256 //personal 258 //personal
257 ret_map.insert( Qtopia::Spouse, QObject::tr( "Spouse" ) ); 259 ret_map.insert( Qtopia::Spouse, QObject::tr( "Spouse" ) );
258 ret_map.insert( Qtopia::Gender, QObject::tr( "Gender" ) ); 260 ret_map.insert( Qtopia::Gender, QObject::tr( "Gender" ) );
259 ret_map.insert( Qtopia::Birthday, QObject::tr( "Birthday" ) ); 261 ret_map.insert( Qtopia::Birthday, QObject::tr( "Birthday" ) );
260 ret_map.insert( Qtopia::Anniversary, QObject::tr( "Anniversary" ) ); 262 ret_map.insert( Qtopia::Anniversary, QObject::tr( "Anniversary" ) );
261 ret_map.insert( Qtopia::Nickname, QObject::tr( "Nickname" ) ); 263 ret_map.insert( Qtopia::Nickname, QObject::tr( "Nickname" ) );
262 ret_map.insert( Qtopia::Children, QObject::tr( "Children" ) ); 264 ret_map.insert( Qtopia::Children, QObject::tr( "Children" ) );
263 265
264 // other 266 // other
265 ret_map.insert( Qtopia::Notes, QObject::tr( "Notes" ) ); 267 ret_map.insert( Qtopia::Notes, QObject::tr( "Notes" ) );
266 268
267 269
268 return ret_map; 270 return ret_map;
269} 271}
270 272
271QMap<int, QString> OContactFields::idToUntrFields() 273QMap<int, QString> OContactFields::idToUntrFields()
272{ 274{
273 QMap<int, QString> ret_map; 275 QMap<int, QString> ret_map;
274 276
275 ret_map.insert( Qtopia::Title, "Name Title" ); 277 ret_map.insert( Qtopia::Title, "Name Title" );
276 ret_map.insert( Qtopia::FirstName, "First Name" ); 278 ret_map.insert( Qtopia::FirstName, "First Name" );
277 ret_map.insert( Qtopia::MiddleName, "Middle Name" ); 279 ret_map.insert( Qtopia::MiddleName, "Middle Name" );
278 ret_map.insert( Qtopia::LastName, "Last Name" ); 280 ret_map.insert( Qtopia::LastName, "Last Name" );
279 ret_map.insert( Qtopia::Suffix, "Suffix" ); 281 ret_map.insert( Qtopia::Suffix, "Suffix" );
280 ret_map.insert( Qtopia::FileAs, "File As" ); 282 ret_map.insert( Qtopia::FileAs, "File As" );
281 283
282 ret_map.insert( Qtopia::JobTitle, "Job Title" ); 284 ret_map.insert( Qtopia::JobTitle, "Job Title" );
283 ret_map.insert( Qtopia::Department, "Department" ); 285 ret_map.insert( Qtopia::Department, "Department" );
284 ret_map.insert( Qtopia::Company, "Company" ); 286 ret_map.insert( Qtopia::Company, "Company" );
285 ret_map.insert( Qtopia::BusinessPhone, "Business Phone" ); 287 ret_map.insert( Qtopia::BusinessPhone, "Business Phone" );
286 ret_map.insert( Qtopia::BusinessFax, "Business Fax" ); 288 ret_map.insert( Qtopia::BusinessFax, "Business Fax" );
287 ret_map.insert( Qtopia::BusinessMobile, "Business Mobile" ); 289 ret_map.insert( Qtopia::BusinessMobile, "Business Mobile" );
288 290
289 // email 291 // email
290 ret_map.insert( Qtopia::DefaultEmail, "Default Email" ); 292 ret_map.insert( Qtopia::DefaultEmail, "Default Email" );
291 ret_map.insert( Qtopia::Emails, "Emails" ); 293 ret_map.insert( Qtopia::Emails, "Emails" );
292 294
293 ret_map.insert( Qtopia::HomePhone, "Home Phone" ); 295 ret_map.insert( Qtopia::HomePhone, "Home Phone" );