summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO3
-rw-r--r--core/pim/addressbook/abtable.cpp2
-rw-r--r--core/pim/addressbook/contacteditor.cpp84
3 files changed, 63 insertions, 26 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO
index 83e3c6b..a4fc29a 100644
--- a/core/pim/addressbook/TODO
+++ b/core/pim/addressbook/TODO
@@ -1,16 +1,19 @@
1Stuff todo: 1Stuff todo:
2 2
3Urgent: 3Urgent:
4- "Nonenglish" translation bug has to be fixed. 4- "Nonenglish" translation bug has to be fixed.
5 5
6Important: 6Important:
7 7
8- Finishing of new View functions (List, Phonebook...) 8- Finishing of new View functions (List, Phonebook...)
9- Reload if contacts were changed externally 9- Reload if contacts were changed externally
10- "What's this" should be added
11- The names of the countries are sorted by there english names, only..
12 Even if they are translated.. :S
10 13
11Less important: 14Less important:
12 15
13- Find widget should be replaced by something like 16- Find widget should be replaced by something like
14 qpdf has. 17 qpdf has.
15- The picker (alphabetical sort widget) should be 18- The picker (alphabetical sort widget) should be
16 placed verticaly or horizontally (configurable) \ No newline at end of file 19 placed verticaly or horizontally (configurable) \ No newline at end of file
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 08c6d0a..70c070f 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -1,325 +1,325 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qt Palmtop Environment. 4** This file is part of Qt Palmtop Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#define QTOPIA_INTERNAL_CONTACT_MRE 21#define QTOPIA_INTERNAL_CONTACT_MRE
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 27
28#include <opie/orecordlist.h> 28#include <opie/orecordlist.h>
29 29
30#include <qasciidict.h> 30#include <qasciidict.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qregexp.h> 33#include <qregexp.h>
34#include <qmessagebox.h> 34#include <qmessagebox.h>
35 35
36#include "abtable.h" 36#include "abtable.h"
37 37
38#include <errno.h> 38#include <errno.h>
39#include <fcntl.h> 39#include <fcntl.h>
40#include <unistd.h> 40#include <unistd.h>
41#include <stdlib.h> 41#include <stdlib.h>
42 42
43#include <ctype.h> //toupper() for key hack 43#include <ctype.h> //toupper() for key hack
44 44
45static bool contactCompare( const OContact &cnt, const QRegExp &r, int category ); 45static bool contactCompare( const OContact &cnt, const QRegExp &r, int category );
46 46
47 47
48/*! 48/*!
49 \class AbTableItem abtable.h 49 \class AbTableItem abtable.h
50 50
51 \brief QTableItem based class for showing a field of an entry 51 \brief QTableItem based class for showing a field of an entry
52*/ 52*/
53 53
54AbTableItem::AbTableItem( QTable *t, EditType et, const QString &s, 54AbTableItem::AbTableItem( QTable *t, EditType et, const QString &s,
55 const QString &secondSortKey) 55 const QString &secondSortKey)
56 : QTableItem( t, et, s ) 56 : QTableItem( t, et, s )
57{ 57{
58 // sortKey = s.lower() + QChar( '\0' ) + secondSortKey.lower(); 58 // sortKey = s.lower() + QChar( '\0' ) + secondSortKey.lower();
59 sortKey = Qtopia::buildSortKey( s, secondSortKey ); 59 sortKey = Qtopia::buildSortKey( s, secondSortKey );
60} 60}
61 61
62int AbTableItem::alignment() const 62int AbTableItem::alignment() const
63{ 63{
64 return AlignLeft|AlignVCenter; 64 return AlignLeft|AlignVCenter;
65} 65}
66 66
67QString AbTableItem::key() const 67QString AbTableItem::key() const
68{ 68{
69 return sortKey; 69 return sortKey;
70} 70}
71 71
72// A way to reset the item, without out doing a delete or a new... 72// A way to reset the item, without out doing a delete or a new...
73void AbTableItem::setItem( const QString &txt, const QString &secondKey ) 73void AbTableItem::setItem( const QString &txt, const QString &secondKey )
74{ 74{
75 setText( txt ); 75 setText( txt );
76 sortKey = Qtopia::buildSortKey( txt, secondKey ); 76 sortKey = Qtopia::buildSortKey( txt, secondKey );
77 77
78 // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower(); 78 // sortKey = txt.lower() + QChar( '\0' ) + secondKey.lower();
79} 79}
80 80
81/*! 81/*!
82 \class AbPickItem abtable.h 82 \class AbPickItem abtable.h
83 83
84 \brief QTableItem based class for showing slection of an entry 84 \brief QTableItem based class for showing slection of an entry
85*/ 85*/
86 86
87AbPickItem::AbPickItem( QTable *t ) : 87AbPickItem::AbPickItem( QTable *t ) :
88 QTableItem(t, WhenCurrent, "?") 88 QTableItem(t, WhenCurrent, "?")
89{ 89{
90} 90}
91 91
92QWidget *AbPickItem::createEditor() const 92QWidget *AbPickItem::createEditor() const
93{ 93{
94 QComboBox* combo = new QComboBox( table()->viewport() ); 94 QComboBox* combo = new QComboBox( table()->viewport() );
95 ( (AbPickItem*)this )->cb = combo; 95 ( (AbPickItem*)this )->cb = combo;
96 AbTable* t = static_cast<AbTable*>(table()); 96 AbTable* t = static_cast<AbTable*>(table());
97 QStringList c = t->choiceNames(); 97 QStringList c = t->choiceNames();
98 int cur = 0; 98 int cur = 0;
99 for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) { 99 for (QStringList::ConstIterator it = c.begin(); it!=c.end(); ++it) {
100 if ( *it == text() ) 100 if ( *it == text() )
101 cur = combo->count(); 101 cur = combo->count();
102 combo->insertItem(*it); 102 combo->insertItem(*it);
103 } 103 }
104 combo->setCurrentItem(cur); 104 combo->setCurrentItem(cur);
105 return combo; 105 return combo;
106} 106}
107 107
108void AbPickItem::setContentFromEditor( QWidget *w ) 108void AbPickItem::setContentFromEditor( QWidget *w )
109{ 109{
110 if ( w->inherits("QComboBox") ) 110 if ( w->inherits("QComboBox") )
111 setText( ( (QComboBox*)w )->currentText() ); 111 setText( ( (QComboBox*)w )->currentText() );
112 else 112 else
113 QTableItem::setContentFromEditor( w ); 113 QTableItem::setContentFromEditor( w );
114} 114}
115 115
116/*! 116/*!
117 \class AbTable abtable.h 117 \class AbTable abtable.h
118 118
119 \brief QTable based class for showing a list of entries 119 \brief QTable based class for showing a list of entries
120*/ 120*/
121 121
122AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *name ) 122AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *name )
123 // #ifdef QT_QTABLE_NOHEADER_CONSTRUCTOR 123 // #ifdef QT_QTABLE_NOHEADER_CONSTRUCTOR
124 // : QTable( 0, 0, parent, name, TRUE ), 124 // : QTable( 0, 0, parent, name, TRUE ),
125 // #else 125 // #else
126 : QTable( parent, name ), 126 : QTable( parent, name ),
127 // #endif 127 // #endif
128 lastSortCol( -1 ), 128 lastSortCol( -1 ),
129 asc( TRUE ), 129 asc( TRUE ),
130 intFields( order ), 130 intFields( order ),
131 currFindRow( -2 ), 131 currFindRow( -2 ),
132 mCat( 0 ), 132 mCat( 0 ),
133 m_contactdb ("addressbook") 133 m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. !
134{ 134{
135 mCat.load( categoryFileName() ); 135 mCat.load( categoryFileName() );
136 setSelectionMode( NoSelection ); 136 setSelectionMode( NoSelection );
137 init(); 137 init();
138 setSorting( TRUE ); 138 setSorting( TRUE );
139 connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), 139 connect( this, SIGNAL(clicked(int,int,int,const QPoint &)),
140 this, SLOT(itemClicked(int,int)) ); 140 this, SLOT(itemClicked(int,int)) );
141} 141}
142 142
143AbTable::~AbTable() 143AbTable::~AbTable()
144{ 144{
145} 145}
146 146
147void AbTable::init() 147void AbTable::init()
148{ 148{
149 showChar = '\0'; 149 showChar = '\0';
150 setNumRows( 0 ); 150 setNumRows( 0 );
151 setNumCols( 2 ); 151 setNumCols( 2 );
152 152
153 horizontalHeader()->setLabel( 0, tr( "Full Name" )); 153 horizontalHeader()->setLabel( 0, tr( "Full Name" ));
154 horizontalHeader()->setLabel( 1, tr( "Contact" )); 154 horizontalHeader()->setLabel( 1, tr( "Contact" ));
155 setLeftMargin( 0 ); 155 setLeftMargin( 0 );
156 verticalHeader()->hide(); 156 verticalHeader()->hide();
157 columnVisible = true; 157 columnVisible = true;
158} 158}
159 159
160void AbTable::columnClicked( int col ) 160void AbTable::columnClicked( int col )
161{ 161{
162 if ( !sorting() ) 162 if ( !sorting() )
163 return; 163 return;
164 164
165 if ( lastSortCol == -1 ) 165 if ( lastSortCol == -1 )
166 lastSortCol = col; 166 lastSortCol = col;
167 167
168 if ( col == lastSortCol ) { 168 if ( col == lastSortCol ) {
169 asc = !asc; 169 asc = !asc;
170 } else { 170 } else {
171 lastSortCol = col; 171 lastSortCol = col;
172 asc = TRUE; 172 asc = TRUE;
173 } 173 }
174 //QMessageBox::information( this, "resort", "columnClicked" ); 174 //QMessageBox::information( this, "resort", "columnClicked" );
175 resort(); 175 resort();
176} 176}
177 177
178void AbTable::resort() 178void AbTable::resort()
179{ 179{
180 if ( sorting() ) { 180 if ( sorting() ) {
181 if ( lastSortCol == -1 ) 181 if ( lastSortCol == -1 )
182 lastSortCol = 0; 182 lastSortCol = 0;
183 sortColumn( lastSortCol, asc, TRUE ); 183 sortColumn( lastSortCol, asc, TRUE );
184 //QMessageBox::information( this, "resort", "resort" ); 184 //QMessageBox::information( this, "resort", "resort" );
185 updateVisible(); 185 updateVisible();
186 } 186 }
187} 187}
188 188
189OContact AbTable::currentEntry() 189OContact AbTable::currentEntry()
190{ 190{
191 OContact cnt; 191 OContact cnt;
192 AbTableItem *abItem; 192 AbTableItem *abItem;
193 abItem = static_cast<AbTableItem*>(item( currentRow(), 0 )); 193 abItem = static_cast<AbTableItem*>(item( currentRow(), 0 ));
194 if ( abItem ) { 194 if ( abItem ) {
195 cnt = contactList[abItem]; 195 cnt = contactList[abItem];
196 //cnt = contactList[currentRow()]; 196 //cnt = contactList[currentRow()];
197 } 197 }
198 return cnt; 198 return cnt;
199} 199}
200 200
201void AbTable::replaceCurrentEntry( const OContact &newContact ) 201void AbTable::replaceCurrentEntry( const OContact &newContact )
202{ 202{
203 int row = currentRow(); 203 int row = currentRow();
204 updateVisible(); 204 updateVisible();
205 205
206 journalFreeReplace( newContact, row ); 206 journalFreeReplace( newContact, row );
207 207
208} 208}
209 209
210void AbTable::deleteCurrentEntry() 210void AbTable::deleteCurrentEntry()
211{ 211{
212 int row = currentRow(); 212 int row = currentRow();
213 213
214 // a little wasteful, but it ensure's there is only one place 214 // a little wasteful, but it ensure's there is only one place
215 // where we delete. 215 // where we delete.
216 journalFreeRemove( row ); 216 journalFreeRemove( row );
217 updateVisible(); 217 updateVisible();
218 218
219 if ( numRows() == 0 ) 219 if ( numRows() == 0 )
220 emit empty( TRUE ); 220 emit empty( TRUE );
221 221
222} 222}
223 223
224void AbTable::clear() 224void AbTable::clear()
225{ 225{
226 contactList.clear(); 226 contactList.clear();
227 for ( int r = 0; r < numRows(); ++r ) { 227 for ( int r = 0; r < numRows(); ++r ) {
228 for ( int c = 0; c < numCols(); ++c ) { 228 for ( int c = 0; c < numCols(); ++c ) {
229 if ( cellWidget( r, c ) ) 229 if ( cellWidget( r, c ) )
230 clearCellWidget( r, c ); 230 clearCellWidget( r, c );
231 clearCell( r, c ); 231 clearCell( r, c );
232 } 232 }
233 } 233 }
234 setNumRows( 0 ); 234 setNumRows( 0 );
235} 235}
236 236
237void AbTable::refresh() 237void AbTable::refresh()
238{ 238{
239 int rows = numRows(); 239 int rows = numRows();
240 QString value; 240 QString value;
241 AbTableItem *abi; 241 AbTableItem *abi;
242 242
243 // hide columns so no flashing ? 243 // hide columns so no flashing ?
244 if ( showBk == "Cards" ) { 244 if ( showBk == "Cards" ) {
245 hideColumn(0); 245 hideColumn(0);
246 hideColumn(1); 246 hideColumn(1);
247 } 247 }
248 for ( int r = 0; r < rows; ++r ) { 248 for ( int r = 0; r < rows; ++r ) {
249 abi = static_cast<AbTableItem*>( item(r, 0) ); 249 abi = static_cast<AbTableItem*>( item(r, 0) );
250 value = findContactContact( contactList[abi], r ); 250 value = findContactContact( contactList[abi], r );
251 static_cast<AbTableItem*>( item(r, 1) )->setItem( value, abi->text() ); 251 static_cast<AbTableItem*>( item(r, 1) )->setItem( value, abi->text() );
252 } 252 }
253 resort(); 253 resort();
254} 254}
255 255
256void AbTable::keyPressEvent( QKeyEvent *e ) 256void AbTable::keyPressEvent( QKeyEvent *e )
257{ 257{
258 char key = toupper( e->ascii() ); 258 char key = toupper( e->ascii() );
259 259
260 if ( key >= 'A' && key <= 'Z' ) 260 if ( key >= 'A' && key <= 'Z' )
261 moveTo( key ); 261 moveTo( key );
262 262
263 switch( e->key() ) { 263 switch( e->key() ) {
264 case Qt::Key_Space: 264 case Qt::Key_Space:
265 case Qt::Key_Return: 265 case Qt::Key_Return:
266 case Qt::Key_Enter: 266 case Qt::Key_Enter:
267 emit details(); 267 emit details();
268 break; 268 break;
269 default: 269 default:
270 QTable::keyPressEvent( e ); 270 QTable::keyPressEvent( e );
271 } 271 }
272} 272}
273 273
274void AbTable::moveTo( char c ) 274void AbTable::moveTo( char c )
275{ 275{
276 276
277 int rows = numRows(); 277 int rows = numRows();
278 QString value; 278 QString value;
279 AbTableItem *abi; 279 AbTableItem *abi;
280 int r; 280 int r;
281 if ( asc ) { 281 if ( asc ) {
282 r = 0; 282 r = 0;
283 while ( r < rows-1) { 283 while ( r < rows-1) {
284 abi = static_cast<AbTableItem*>( item(r, 0) ); 284 abi = static_cast<AbTableItem*>( item(r, 0) );
285 QChar first = abi->key()[0]; 285 QChar first = abi->key()[0];
286 //### is there a bug in QChar to char comparison??? 286 //### is there a bug in QChar to char comparison???
287 if ( first.row() || first.cell() >= c ) 287 if ( first.row() || first.cell() >= c )
288 break; 288 break;
289 r++; 289 r++;
290 } 290 }
291 } else { 291 } else {
292 //### should probably disable reverse sorting instead 292 //### should probably disable reverse sorting instead
293 r = rows - 1; 293 r = rows - 1;
294 while ( r > 0 ) { 294 while ( r > 0 ) {
295 abi = static_cast<AbTableItem*>( item(r, 0) ); 295 abi = static_cast<AbTableItem*>( item(r, 0) );
296 QChar first = abi->key()[0]; 296 QChar first = abi->key()[0];
297 //### is there a bug in QChar to char comparison??? 297 //### is there a bug in QChar to char comparison???
298 if ( first.row() || first.cell() >= c ) 298 if ( first.row() || first.cell() >= c )
299 break; 299 break;
300 r--; 300 r--;
301 } 301 }
302 } 302 }
303 setCurrentCell( r, currentColumn() ); 303 setCurrentCell( r, currentColumn() );
304} 304}
305 305
306 306
307QString AbTable::findContactName( const OContact &entry ) 307QString AbTable::findContactName( const OContact &entry )
308{ 308{
309 // We use the fileAs, then company, defaultEmail 309 // We use the fileAs, then company, defaultEmail
310 QString str; 310 QString str;
311 str = entry.fileAs(); 311 str = entry.fileAs();
312 if ( str.isEmpty() ) { 312 if ( str.isEmpty() ) {
313 str = entry.company(); 313 str = entry.company();
314 if ( str.isEmpty() ) { 314 if ( str.isEmpty() ) {
315 str = entry.defaultEmail(); 315 str = entry.defaultEmail();
316 } 316 }
317 } 317 }
318 return str; 318 return str;
319} 319}
320 320
321QString AbTable::findContactContact( const OContact &entry, int /* row */ ) 321QString AbTable::findContactContact( const OContact &entry, int /* row */ )
322{ 322{
323 QString value; 323 QString value;
324 value = ""; 324 value = "";
325 for ( QValueList<int>::ConstIterator it = intFields->begin(); 325 for ( QValueList<int>::ConstIterator it = intFields->begin();
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index bae3a2b..e7f2ebd 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -151,1624 +151,1658 @@ void ContactEditor::init() {
151 151
152 if ( (*it) == "Business Mobile" ) { 152 if ( (*it) == "Business Mobile" ) {
153 trlChooserNames.append( tr( "Business Mobile" ) ); 153 trlChooserNames.append( tr( "Business Mobile" ) );
154 slChooserNames.append( *it ); 154 slChooserNames.append( *it );
155 slChooserValues.append( "" ); 155 slChooserValues.append( "" );
156 //slDynamicEntries->remove( it ); 156 //slDynamicEntries->remove( it );
157 continue; 157 continue;
158 } 158 }
159 159
160 if ( (*it) == "Home Mobile" ) { 160 if ( (*it) == "Home Mobile" ) {
161 trlChooserNames.append( tr( "Home Mobile" ) ); 161 trlChooserNames.append( tr( "Home Mobile" ) );
162 slChooserNames.append( *it ); 162 slChooserNames.append( *it );
163 slChooserValues.append( "" ); 163 slChooserValues.append( "" );
164 //slDynamicEntries->remove( it ); 164 //slDynamicEntries->remove( it );
165 continue; 165 continue;
166 } 166 }
167 167
168 168
169 if ( (*it) == "Business WebPage" ) { 169 if ( (*it) == "Business WebPage" ) {
170 trlChooserNames.append( tr( "Business WebPage" ) ); 170 trlChooserNames.append( tr( "Business WebPage" ) );
171 slChooserNames.append( *it ); 171 slChooserNames.append( *it );
172 slChooserValues.append( "" ); 172 slChooserValues.append( "" );
173 //slDynamicEntries->remove( it ); 173 //slDynamicEntries->remove( it );
174 continue; 174 continue;
175 } 175 }
176 176
177 if ( (*it) == "Home Web Page" ) { 177 if ( (*it) == "Home Web Page" ) {
178 trlChooserNames.append( tr( "Home Web Page" ) ); 178 trlChooserNames.append( tr( "Home Web Page" ) );
179 slChooserNames.append( *it ); 179 slChooserNames.append( *it );
180 slChooserValues.append( "" ); 180 slChooserValues.append( "" );
181 //slDynamicEntries->remove( it ); 181 //slDynamicEntries->remove( it );
182 continue; 182 continue;
183 } 183 }
184 184
185 if ( (*it) == "Business Pager" ) { 185 if ( (*it) == "Business Pager" ) {
186 trlChooserNames.append( tr( "Business Pager" ) ); 186 trlChooserNames.append( tr( "Business Pager" ) );
187 slChooserNames.append( *it ); 187 slChooserNames.append( *it );
188 slChooserValues.append( "" ); 188 slChooserValues.append( "" );
189 //slDynamicEntries->remove( it ); 189 //slDynamicEntries->remove( it );
190 continue; 190 continue;
191 } 191 }
192 192
193 if ( *it == "Default Email" ) { 193 if ( *it == "Default Email" ) {
194 trlChooserNames.append( tr( "Default Email" ) ); 194 trlChooserNames.append( tr( "Default Email" ) );
195 slChooserNames.append( *it ); 195 slChooserNames.append( *it );
196 slChooserValues.append( "" ); 196 slChooserValues.append( "" );
197 //slDynamicEntries->remove( it ); 197 //slDynamicEntries->remove( it );
198 continue; 198 continue;
199 } 199 }
200 200
201 if ( *it == "Emails" ) { 201 if ( *it == "Emails" ) {
202 trlChooserNames.append( tr( "Emails" ) ); 202 trlChooserNames.append( tr( "Emails" ) );
203 slChooserNames.append( *it ); 203 slChooserNames.append( *it );
204 slChooserValues.append( "" ); 204 slChooserValues.append( "" );
205 //slDynamicEntries->remove( it ); 205 //slDynamicEntries->remove( it );
206 continue; 206 continue;
207 } 207 }
208 208
209 if ( *it == "Name Title" || *it == "First Name" || *it == "Middle Name" || *it == "Last Name" || *it == "File As" || *it == "Default Email" || *it == "Emails" || *it == "Groups" ) 209 if ( *it == "Name Title" || *it == "First Name" || *it == "Middle Name" || *it == "Last Name" || *it == "File As" || *it == "Default Email" || *it == "Emails" || *it == "Groups" )
210 continue; 210 continue;
211 211
212 if ( *it == "Name Title" ) { 212 if ( *it == "Name Title" ) {
213 //slDynamicEntries->remove( it ); 213 //slDynamicEntries->remove( it );
214 continue; 214 continue;
215 } 215 }
216 216
217 if ( *it == "First Name" ) { 217 if ( *it == "First Name" ) {
218 //slDynamicEntries->remove( it ); 218 //slDynamicEntries->remove( it );
219 continue; 219 continue;
220 } 220 }
221 221
222 if ( *it == "Middle Name" ) { 222 if ( *it == "Middle Name" ) {
223 //slDynamicEntries->remove( it ); 223 //slDynamicEntries->remove( it );
224 continue; 224 continue;
225 } 225 }
226 226
227 if ( *it == "Last Name" ) { 227 if ( *it == "Last Name" ) {
228 //slDynamicEntries->remove( it ); 228 //slDynamicEntries->remove( it );
229 continue; 229 continue;
230 } 230 }
231 231
232 if ( *it == "Suffix" ) { 232 if ( *it == "Suffix" ) {
233 //slDynamicEntries->remove( it ); 233 //slDynamicEntries->remove( it );
234 continue; 234 continue;
235 } 235 }
236 236
237 if ( *it == "File As" ) { 237 if ( *it == "File As" ) {
238 //slDynamicEntries->remove( it ); 238 //slDynamicEntries->remove( it );
239 continue; 239 continue;
240 } 240 }
241 241
242 if ( *it == "Gender" ) { 242 if ( *it == "Gender" ) {
243 hasGender = TRUE; 243 hasGender = TRUE;
244 //slDynamicEntries->remove( it ); 244 //slDynamicEntries->remove( it );
245 continue; 245 continue;
246 } 246 }
247 247
248 if ( *it == "Job Title" ) { 248 if ( *it == "Job Title" ) {
249 hasTitle = TRUE; 249 hasTitle = TRUE;
250 //slDynamicEntries->remove( it ); 250 //slDynamicEntries->remove( it );
251 continue; 251 continue;
252 } 252 }
253 253
254 if ( ( *it == "Company") || (*it == "Organization" ) ) { 254 if ( ( *it == "Company") || (*it == "Organization" ) ) {
255 hasCompany = TRUE; 255 hasCompany = TRUE;
256 //slDynamicEntries->remove( it ); 256 //slDynamicEntries->remove( it );
257 continue; 257 continue;
258 } 258 }
259 259
260 if ( *it == "Notes" ) { 260 if ( *it == "Notes" ) {
261 hasNotes = TRUE; 261 hasNotes = TRUE;
262 //slDynamicEntries->remove( it ); 262 //slDynamicEntries->remove( it );
263 continue; 263 continue;
264 } 264 }
265 265
266 if ( *it == "Groups" ) { 266 if ( *it == "Groups" ) {
267 //slDynamicEntries->remove( it ); 267 //slDynamicEntries->remove( it );
268 continue; 268 continue;
269 } 269 }
270 270
271 if ( (*it) == "Business Street" ) { 271 if ( (*it) == "Business Street" ) {
272 hasStreet = TRUE; 272 hasStreet = TRUE;
273 //slDynamicEntries->remove( it ); 273 //slDynamicEntries->remove( it );
274 continue; 274 continue;
275 } 275 }
276 276
277 if ( (*it) == "Home Street" ) { 277 if ( (*it) == "Home Street" ) {
278 hasStreet = TRUE; 278 hasStreet = TRUE;
279 //slDynamicEntries->remove( it ); 279 //slDynamicEntries->remove( it );
280 continue; 280 continue;
281 } 281 }
282/* 282/*
283 if ( (*it).right( 8 ) == tr( "Street 2" ) ) { 283 if ( (*it).right( 8 ) == tr( "Street 2" ) ) {
284 hasStreet2 = TRUE; 284 hasStreet2 = TRUE;
285 //slDynamicEntries->remove( it ); 285 //slDynamicEntries->remove( it );
286 continue; 286 continue;
287 } 287 }
288 288
289 if ( (*it).right( 8 ) == tr( "P.O. Box" ) ) { 289 if ( (*it).right( 8 ) == tr( "P.O. Box" ) ) {
290 hasPOBox = TRUE; 290 hasPOBox = TRUE;
291 //slDynamicEntries->remove( it ); 291 //slDynamicEntries->remove( it );
292 continue; 292 continue;
293 } */ 293 } */
294 294
295 if ( (*it) == "Business City" ) { 295 if ( (*it) == "Business City" ) {
296 hasCity = TRUE; 296 hasCity = TRUE;
297 //slDynamicEntries->remove( it ); 297 //slDynamicEntries->remove( it );
298 continue; 298 continue;
299 } 299 }
300 300
301 if ( (*it) == "Business State" ) { 301 if ( (*it) == "Business State" ) {
302 hasState = TRUE; 302 hasState = TRUE;
303 //slDynamicEntries->remove( it ); 303 //slDynamicEntries->remove( it );
304 continue; 304 continue;
305 } 305 }
306 306
307 if ( (*it) == "Business Zip" ) { 307 if ( (*it) == "Business Zip" ) {
308 hasZip = TRUE; 308 hasZip = TRUE;
309 //slDynamicEntries->remove( it ); 309 //slDynamicEntries->remove( it );
310 continue; 310 continue;
311 } 311 }
312 312
313 if ( (*it) == "Business Country" ) { 313 if ( (*it) == "Business Country" ) {
314 hasCountry = TRUE; 314 hasCountry = TRUE;
315 //slDynamicEntries->remove( it ); 315 //slDynamicEntries->remove( it );
316 continue; 316 continue;
317 } 317 }
318 318
319 if ( (*it) == "Home City" ) { 319 if ( (*it) == "Home City" ) {
320 hasCity = TRUE; 320 hasCity = TRUE;
321 //slDynamicEntries->remove( it ); 321 //slDynamicEntries->remove( it );
322 continue; 322 continue;
323 } 323 }
324 324
325 if ( (*it) == "Home State" ) { 325 if ( (*it) == "Home State" ) {
326 hasState = TRUE; 326 hasState = TRUE;
327 //slDynamicEntries->remove( it ); 327 //slDynamicEntries->remove( it );
328 continue; 328 continue;
329 } 329 }
330 330
331 if ( (*it) == "Home Zip" ) { 331 if ( (*it) == "Home Zip" ) {
332 hasZip = TRUE; 332 hasZip = TRUE;
333 //slDynamicEntries->remove( it ); 333 //slDynamicEntries->remove( it );
334 continue; 334 continue;
335 } 335 }
336 336
337 if ( (*it) == "Home Country" ) { 337 if ( (*it) == "Home Country" ) {
338 hasCountry = TRUE; 338 hasCountry = TRUE;
339 //slDynamicEntries->remove( it ); 339 //slDynamicEntries->remove( it );
340 continue; 340 continue;
341 } 341 }
342 342
343
344 slDynamicEntries.append( *it ); 343 slDynamicEntries.append( *it );
345 } 344 }
346 } 345 }
347 346
348 QVBoxLayout *vb = new QVBoxLayout( this ); 347 QVBoxLayout *vb = new QVBoxLayout( this );
349 348
350 tabMain = new QTabWidget( this ); 349 tabMain = new QTabWidget( this );
351 vb->addWidget( tabMain ); 350 vb->addWidget( tabMain );
352 351
353 QWidget *tabViewport = new QWidget ( tabMain ); 352 QWidget *tabViewport = new QWidget ( tabMain );
354 353
355 vb = new QVBoxLayout( tabViewport ); 354 vb = new QVBoxLayout( tabViewport );
356 355
357 svGeneral = new QScrollView( tabViewport ); 356 svGeneral = new QScrollView( tabViewport );
358 vb->addWidget( svGeneral, 0, 0 ); 357 vb->addWidget( svGeneral, 0, 0 );
359 svGeneral->setResizePolicy( QScrollView::AutoOneFit ); 358 svGeneral->setResizePolicy( QScrollView::AutoOneFit );
360 svGeneral->setFrameStyle( QFrame::NoFrame ); 359 svGeneral->setFrameStyle( QFrame::NoFrame );
361 360
362 QWidget *container = new QWidget( svGeneral->viewport() ); 361 QWidget *container = new QWidget( svGeneral->viewport() );
363 svGeneral->addChild( container ); 362 svGeneral->addChild( container );
364 363
365 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); 364 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 );
366 gl->setResizeMode( QLayout::FreeResize ); 365 gl->setResizeMode( QLayout::FreeResize );
367 366
368 btnFullName = new QPushButton( tr( "Full Name..." ), container ); 367 btnFullName = new QPushButton( tr( "Full Name..." ), container );
369 gl->addWidget( btnFullName, 0, 0 ); 368 gl->addWidget( btnFullName, 0, 0 );
370 txtFullName = new QLineEdit( container ); 369 txtFullName = new QLineEdit( container );
371 gl->addWidget( txtFullName, 0, 1 ); 370 gl->addWidget( txtFullName, 0, 1 );
372 371
373 QLabel *l = new QLabel( tr( "Job Title" ), container ); 372 QLabel *l = new QLabel( tr( "Job Title" ), container );
374 gl->addWidget( l, 1, 0 ); 373 gl->addWidget( l, 1, 0 );
375 txtJobTitle = new QLineEdit( container ); 374 txtJobTitle = new QLineEdit( container );
376 gl->addWidget( txtJobTitle, 1, 1 ); 375 gl->addWidget( txtJobTitle, 1, 1 );
377 376
378 l = new QLabel( tr( "Organization" ), container ); 377 l = new QLabel( tr( "Organization" ), container );
379 gl->addWidget( l, 2, 0 ); 378 gl->addWidget( l, 2, 0 );
380 txtOrganization = new QLineEdit( container ); 379 txtOrganization = new QLineEdit( container );
381 gl->addWidget( txtOrganization, 2, 1 ); 380 gl->addWidget( txtOrganization, 2, 1 );
382 381
383 cmbChooserField1 = new QComboBox( FALSE, container ); 382 cmbChooserField1 = new QComboBox( FALSE, container );
384 cmbChooserField1->setMaximumWidth( 90 ); 383 cmbChooserField1->setMaximumWidth( 90 );
385 gl->addWidget( cmbChooserField1, 3, 0 ); 384 gl->addWidget( cmbChooserField1, 3, 0 );
386 txtChooserField1 = new QLineEdit( container ); 385 txtChooserField1 = new QLineEdit( container );
387 gl->addWidget( txtChooserField1, 3, 1 ); 386 gl->addWidget( txtChooserField1, 3, 1 );
388 387
389 cmbChooserField2 = new QComboBox( FALSE, container ); 388 cmbChooserField2 = new QComboBox( FALSE, container );
390 cmbChooserField2->setMaximumWidth( 90 ); 389 cmbChooserField2->setMaximumWidth( 90 );
391 gl->addWidget( cmbChooserField2, 4, 0 ); 390 gl->addWidget( cmbChooserField2, 4, 0 );
392 txtChooserField2 = new QLineEdit( container ); 391 txtChooserField2 = new QLineEdit( container );
393 gl->addWidget( txtChooserField2, 4, 1 ); 392 gl->addWidget( txtChooserField2, 4, 1 );
394 393
395 cmbChooserField3 = new QComboBox( FALSE, container ); 394 cmbChooserField3 = new QComboBox( FALSE, container );
396 cmbChooserField3->setMaximumWidth( 90 ); 395 cmbChooserField3->setMaximumWidth( 90 );
397 gl->addWidget( cmbChooserField3, 5, 0 ); 396 gl->addWidget( cmbChooserField3, 5, 0 );
398 txtChooserField3 = new QLineEdit( container ); 397 txtChooserField3 = new QLineEdit( container );
399 gl->addWidget( txtChooserField3, 5, 1 ); 398 gl->addWidget( txtChooserField3, 5, 1 );
400 399
401 l = new QLabel( tr( "File As" ), container ); 400 l = new QLabel( tr( "File As" ), container );
402 gl->addWidget( l, 6, 0 ); 401 gl->addWidget( l, 6, 0 );
403 cmbFileAs = new QComboBox( TRUE, container ); 402 cmbFileAs = new QComboBox( TRUE, container );
404 gl->addWidget( cmbFileAs, 6, 1 ); 403 gl->addWidget( cmbFileAs, 6, 1 );
405 404
406 l = new QLabel( tr( "Category" ), container ); 405 l = new QLabel( tr( "Category" ), container );
407 gl->addWidget( l, 7, 0 ); 406 gl->addWidget( l, 7, 0 );
408 cmbCat = new CategorySelect( container ); 407 cmbCat = new CategorySelect( container );
409 gl->addWidget( cmbCat, 7, 1 ); 408 gl->addWidget( cmbCat, 7, 1 );
410 409
411 btnNote = new QPushButton( tr( "Notes..." ), container ); 410 btnNote = new QPushButton( tr( "Notes..." ), container );
412 gl->addWidget( btnNote, 8, 1 ); 411 gl->addWidget( btnNote, 8, 1 );
413 412
414 tabMain->insertTab( tabViewport, tr( "General" ) ); 413 tabMain->insertTab( tabViewport, tr( "General" ) );
415 414
416 tabViewport = new QWidget ( tabMain ); 415 tabViewport = new QWidget ( tabMain );
417 416
418 vb = new QVBoxLayout( tabViewport ); 417 vb = new QVBoxLayout( tabViewport );
419 418
420 svAddress = new QScrollView( tabViewport ); 419 svAddress = new QScrollView( tabViewport );
421 vb->addWidget( svAddress, 0, 0 ); 420 vb->addWidget( svAddress, 0, 0 );
422 svAddress->setResizePolicy( QScrollView::AutoOneFit ); 421 svAddress->setResizePolicy( QScrollView::AutoOneFit );
423 svAddress->setFrameStyle( QFrame::NoFrame ); 422 svAddress->setFrameStyle( QFrame::NoFrame );
424 423
425 container = new QWidget( svAddress->viewport() ); 424 container = new QWidget( svAddress->viewport() );
426 svAddress->addChild( container ); 425 svAddress->addChild( container );
427 426
428 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem 427 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem
429 428
430 cmbAddress = new QComboBox( FALSE, container ); 429 cmbAddress = new QComboBox( FALSE, container );
431 cmbAddress->insertItem( tr( "Business" ) ); 430 cmbAddress->insertItem( tr( "Business" ) );
432 cmbAddress->insertItem( tr( "Home" ) ); 431 cmbAddress->insertItem( tr( "Home" ) );
433 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); 432 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 );
434 433
435 l = new QLabel( tr( "Address" ), container ); 434 l = new QLabel( tr( "Address" ), container );
436 gl->addWidget( l, 1, 0 ); 435 gl->addWidget( l, 1, 0 );
437 txtAddress = new QLineEdit( container ); 436 txtAddress = new QLineEdit( container );
438 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); 437 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 );
439/* 438/*
440 l = new QLabel( tr( "Address 2" ), container ); 439 l = new QLabel( tr( "Address 2" ), container );
441 gl->addWidget( l, 2, 0 ); 440 gl->addWidget( l, 2, 0 );
442 txtAddress2 = new QLineEdit( container ); 441 txtAddress2 = new QLineEdit( container );
443 gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 ); 442 gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 );
444 443
445 l = new QLabel( tr( "P.O. Box" ), container ); 444 l = new QLabel( tr( "P.O. Box" ), container );
446 gl->addWidget( l, 3, 0 ); 445 gl->addWidget( l, 3, 0 );
447 txtPOBox = new QLineEdit( container ); 446 txtPOBox = new QLineEdit( container );
448 gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 ); 447 gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 );
449*/ 448*/
450 l = new QLabel( tr( "City" ), container ); 449 l = new QLabel( tr( "City" ), container );
451 gl->addWidget( l, 2, 0 ); 450 gl->addWidget( l, 2, 0 );
452 txtCity = new QLineEdit( container ); 451 txtCity = new QLineEdit( container );
453 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); 452 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 );
454 453
455 l = new QLabel( tr( "State" ), container ); 454 l = new QLabel( tr( "State" ), container );
456 gl->addWidget( l, 3, 0 ); 455 gl->addWidget( l, 3, 0 );
457 txtState = new QLineEdit( container ); 456 txtState = new QLineEdit( container );
458 gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); 457 gl->addMultiCellWidget( txtState, 3, 3, 1, 2 );
459 458
460 l = new QLabel( tr( "Zip Code" ), container ); 459 l = new QLabel( tr( "Zip Code" ), container );
461 gl->addWidget( l, 4, 0 ); 460 gl->addWidget( l, 4, 0 );
462 txtZip = new QLineEdit( container ); 461 txtZip = new QLineEdit( container );
463 gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); 462 gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 );
464 463
465 l = new QLabel( tr( "Country" ), container ); 464 l = new QLabel( tr( "Country" ), container );
466 gl->addWidget( l, 5, 0 ); 465 gl->addWidget( l, 5, 0 );
467 cmbCountry = new QComboBox( TRUE, container ); 466 cmbCountry = new QComboBox( TRUE, container );
468 cmbCountry->insertItem( tr( "" ) ); 467 cmbCountry->insertItem( tr( "" ) );
469 cmbCountry->insertItem( tr ( "United States" ) ); 468 cmbCountry->insertItem( tr ( "United States" ) );
470 cmbCountry->insertItem( tr ( "United Kingdom" ) ); 469 cmbCountry->insertItem( tr ( "United Kingdom" ) );
471 cmbCountry->insertItem( tr ( "Afganistan" ) ); 470 cmbCountry->insertItem( tr ( "Afganistan" ) );
472 cmbCountry->insertItem( tr ( "Albania" ) ); 471 cmbCountry->insertItem( tr ( "Albania" ) );
473 cmbCountry->insertItem( tr ( "Algeria" ) ); 472 cmbCountry->insertItem( tr ( "Algeria" ) );
474 cmbCountry->insertItem( tr ( "American Samoa" ) ); 473 cmbCountry->insertItem( tr ( "American Samoa" ) );
475 cmbCountry->insertItem( tr ( "Andorra" ) ); 474 cmbCountry->insertItem( tr ( "Andorra" ) );
476 cmbCountry->insertItem( tr ( "Angola" ) ); 475 cmbCountry->insertItem( tr ( "Angola" ) );
477 cmbCountry->insertItem( tr ( "Anguilla" ) ); 476 cmbCountry->insertItem( tr ( "Anguilla" ) );
478 cmbCountry->insertItem( tr ( "Antartica" ) ); 477 cmbCountry->insertItem( tr ( "Antartica" ) );
479 cmbCountry->insertItem( tr ( "Argentina" ) ); 478 cmbCountry->insertItem( tr ( "Argentina" ) );
480 cmbCountry->insertItem( tr ( "Armania" ) ); 479 cmbCountry->insertItem( tr ( "Armania" ) );
481 cmbCountry->insertItem( tr ( "Aruba" ) ); 480 cmbCountry->insertItem( tr ( "Aruba" ) );
482 cmbCountry->insertItem( tr ( "Australia" ) ); 481 cmbCountry->insertItem( tr ( "Australia" ) );
483 cmbCountry->insertItem( tr ( "Austria" ) ); 482 cmbCountry->insertItem( tr ( "Austria" ) );
484 cmbCountry->insertItem( tr ( "Azerbaijan" ) ); 483 cmbCountry->insertItem( tr ( "Azerbaijan" ) );
485 cmbCountry->insertItem( tr ( "Bahamas" ) ); 484 cmbCountry->insertItem( tr ( "Bahamas" ) );
486 cmbCountry->insertItem( tr ( "Bahrain" ) ); 485 cmbCountry->insertItem( tr ( "Bahrain" ) );
487 cmbCountry->insertItem( tr ( "Bangladesh" ) ); 486 cmbCountry->insertItem( tr ( "Bangladesh" ) );
488 cmbCountry->insertItem( tr ( "Barbados" ) ); 487 cmbCountry->insertItem( tr ( "Barbados" ) );
489 cmbCountry->insertItem( tr ( "Belarus" ) ); 488 cmbCountry->insertItem( tr ( "Belarus" ) );
490 cmbCountry->insertItem( tr ( "Belgium" ) ); 489 cmbCountry->insertItem( tr ( "Belgium" ) );
491 cmbCountry->insertItem( tr ( "Belize" ) ); 490 cmbCountry->insertItem( tr ( "Belize" ) );
492 cmbCountry->insertItem( tr ( "Benin" ) ); 491 cmbCountry->insertItem( tr ( "Benin" ) );
493 cmbCountry->insertItem( tr ( "Bermuda" ) ); 492 cmbCountry->insertItem( tr ( "Bermuda" ) );
494 cmbCountry->insertItem( tr ( "Bhutan" ) ); 493 cmbCountry->insertItem( tr ( "Bhutan" ) );
495 cmbCountry->insertItem( tr ( "Boliva" ) ); 494 cmbCountry->insertItem( tr ( "Boliva" ) );
496 cmbCountry->insertItem( tr ( "Botswana" ) ); 495 cmbCountry->insertItem( tr ( "Botswana" ) );
497 cmbCountry->insertItem( tr ( "Bouvet Island" ) ); 496 cmbCountry->insertItem( tr ( "Bouvet Island" ) );
498 cmbCountry->insertItem( tr ( "Brazil" ) ); 497 cmbCountry->insertItem( tr ( "Brazil" ) );
499 cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); 498 cmbCountry->insertItem( tr ( "Brunei Darussalam" ) );
500 cmbCountry->insertItem( tr ( "Bulgaria" ) ); 499 cmbCountry->insertItem( tr ( "Bulgaria" ) );
501 cmbCountry->insertItem( tr ( "Burkina Faso" ) ); 500 cmbCountry->insertItem( tr ( "Burkina Faso" ) );
502 cmbCountry->insertItem( tr ( "Burundi" ) ); 501 cmbCountry->insertItem( tr ( "Burundi" ) );
503 cmbCountry->insertItem( tr ( "Cambodia" ) ); 502 cmbCountry->insertItem( tr ( "Cambodia" ) );
504 cmbCountry->insertItem( tr ( "Camaroon" ) ); 503 cmbCountry->insertItem( tr ( "Camaroon" ) );
505 cmbCountry->insertItem( tr ( "Canada" ) ); 504 cmbCountry->insertItem( tr ( "Canada" ) );
506 cmbCountry->insertItem( tr ( "Cape Verde" ) ); 505 cmbCountry->insertItem( tr ( "Cape Verde" ) );
507 cmbCountry->insertItem( tr ( "Cayman Islands" ) ); 506 cmbCountry->insertItem( tr ( "Cayman Islands" ) );
508 cmbCountry->insertItem( tr ( "Chad" ) ); 507 cmbCountry->insertItem( tr ( "Chad" ) );
509 cmbCountry->insertItem( tr ( "Chile" ) ); 508 cmbCountry->insertItem( tr ( "Chile" ) );
510 cmbCountry->insertItem( tr ( "China" ) ); 509 cmbCountry->insertItem( tr ( "China" ) );
511 cmbCountry->insertItem( tr ( "Christmas Island" ) ); 510 cmbCountry->insertItem( tr ( "Christmas Island" ) );
512 cmbCountry->insertItem( tr ( "Colombia" ) ); 511 cmbCountry->insertItem( tr ( "Colombia" ) );
513 cmbCountry->insertItem( tr ( "Comoros" ) ); 512 cmbCountry->insertItem( tr ( "Comoros" ) );
514 cmbCountry->insertItem( tr ( "Congo" ) ); 513 cmbCountry->insertItem( tr ( "Congo" ) );
515 cmbCountry->insertItem( tr ( "Cook Island" ) ); 514 cmbCountry->insertItem( tr ( "Cook Island" ) );
516 cmbCountry->insertItem( tr ( "Costa Rica" ) ); 515 cmbCountry->insertItem( tr ( "Costa Rica" ) );
517 cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); 516 cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) );
518 cmbCountry->insertItem( tr ( "Croatia" ) ); 517 cmbCountry->insertItem( tr ( "Croatia" ) );
519 cmbCountry->insertItem( tr ( "Cuba" ) ); 518 cmbCountry->insertItem( tr ( "Cuba" ) );
520 cmbCountry->insertItem( tr ( "Cyprus" ) ); 519 cmbCountry->insertItem( tr ( "Cyprus" ) );
521 cmbCountry->insertItem( tr ( "Czech Republic" ) ); 520 cmbCountry->insertItem( tr ( "Czech Republic" ) );
522 cmbCountry->insertItem( tr ( "Denmark" ) ); 521 cmbCountry->insertItem( tr ( "Denmark" ) );
523 cmbCountry->insertItem( tr ( "Djibouti" ) ); 522 cmbCountry->insertItem( tr ( "Djibouti" ) );
524 cmbCountry->insertItem( tr ( "Dominica" ) ); 523 cmbCountry->insertItem( tr ( "Dominica" ) );
525 cmbCountry->insertItem( tr ( "Dominican Republic" ) ); 524 cmbCountry->insertItem( tr ( "Dominican Republic" ) );
526 cmbCountry->insertItem( tr ( "East Timor" ) ); 525 cmbCountry->insertItem( tr ( "East Timor" ) );
527 cmbCountry->insertItem( tr ( "Ecuador" ) ); 526 cmbCountry->insertItem( tr ( "Ecuador" ) );
528 cmbCountry->insertItem( tr ( "Egypt" ) ); 527 cmbCountry->insertItem( tr ( "Egypt" ) );
529 cmbCountry->insertItem( tr ( "El Salvador" ) ); 528 cmbCountry->insertItem( tr ( "El Salvador" ) );
530 cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); 529 cmbCountry->insertItem( tr ( "Equatorial Guinea" ) );
531 cmbCountry->insertItem( tr ( "Eritrea" ) ); 530 cmbCountry->insertItem( tr ( "Eritrea" ) );
532 cmbCountry->insertItem( tr ( "Estonia" ) ); 531 cmbCountry->insertItem( tr ( "Estonia" ) );
533 cmbCountry->insertItem( tr ( "Ethiopia" ) ); 532 cmbCountry->insertItem( tr ( "Ethiopia" ) );
534 cmbCountry->insertItem( tr ( "Falkland Islands" ) ); 533 cmbCountry->insertItem( tr ( "Falkland Islands" ) );
535 cmbCountry->insertItem( tr ( "Faroe Islands" ) ); 534 cmbCountry->insertItem( tr ( "Faroe Islands" ) );
536 cmbCountry->insertItem( tr ( "Fiji" ) ); 535 cmbCountry->insertItem( tr ( "Fiji" ) );
537 cmbCountry->insertItem( tr ( "Finland" ) ); 536 cmbCountry->insertItem( tr ( "Finland" ) );
538 cmbCountry->insertItem( tr ( "France" ) ); 537 cmbCountry->insertItem( tr ( "France" ) );
539 cmbCountry->insertItem( tr ( "French Guiana" ) ); 538 cmbCountry->insertItem( tr ( "French Guiana" ) );
540 cmbCountry->insertItem( tr ( "French Polynesia" ) ); 539 cmbCountry->insertItem( tr ( "French Polynesia" ) );
541 cmbCountry->insertItem( tr ( "Gabon" ) ); 540 cmbCountry->insertItem( tr ( "Gabon" ) );
542 cmbCountry->insertItem( tr ( "Gambia" ) ); 541 cmbCountry->insertItem( tr ( "Gambia" ) );
543 cmbCountry->insertItem( tr ( "Georgia" ) ); 542 cmbCountry->insertItem( tr ( "Georgia" ) );
544 cmbCountry->insertItem( tr ( "Germany" ) ); 543 cmbCountry->insertItem( tr ( "Germany" ) );
545 cmbCountry->insertItem( tr ( "Gahna" ) ); 544 cmbCountry->insertItem( tr ( "Gahna" ) );
546 cmbCountry->insertItem( tr ( "Gibraltar" ) ); 545 cmbCountry->insertItem( tr ( "Gibraltar" ) );
547 cmbCountry->insertItem( tr ( "Greece" ) ); 546 cmbCountry->insertItem( tr ( "Greece" ) );
548 cmbCountry->insertItem( tr ( "Greenland" ) ); 547 cmbCountry->insertItem( tr ( "Greenland" ) );
549 cmbCountry->insertItem( tr ( "Grenada" ) ); 548 cmbCountry->insertItem( tr ( "Grenada" ) );
550 cmbCountry->insertItem( tr ( "Guadelupe" ) ); 549 cmbCountry->insertItem( tr ( "Guadelupe" ) );
551 cmbCountry->insertItem( tr ( "Guam" ) ); 550 cmbCountry->insertItem( tr ( "Guam" ) );
552 cmbCountry->insertItem( tr ( "Guatemala" ) ); 551 cmbCountry->insertItem( tr ( "Guatemala" ) );
553 cmbCountry->insertItem( tr ( "Guinea" ) ); 552 cmbCountry->insertItem( tr ( "Guinea" ) );
554 cmbCountry->insertItem( tr ( "Guinea-bissau" ) ); 553 cmbCountry->insertItem( tr ( "Guinea-bissau" ) );
555 cmbCountry->insertItem( tr ( "Guyana" ) ); 554 cmbCountry->insertItem( tr ( "Guyana" ) );
556 cmbCountry->insertItem( tr ( "Haiti" ) ); 555 cmbCountry->insertItem( tr ( "Haiti" ) );
557 cmbCountry->insertItem( tr ( "Holy See" ) ); 556 cmbCountry->insertItem( tr ( "Holy See" ) );
558 cmbCountry->insertItem( tr ( "Honduras" ) ); 557 cmbCountry->insertItem( tr ( "Honduras" ) );
559 cmbCountry->insertItem( tr ( "Hong Kong" ) ); 558 cmbCountry->insertItem( tr ( "Hong Kong" ) );
560 cmbCountry->insertItem( tr ( "Hungary" ) ); 559 cmbCountry->insertItem( tr ( "Hungary" ) );
561 cmbCountry->insertItem( tr ( "Iceland" ) ); 560 cmbCountry->insertItem( tr ( "Iceland" ) );
562 cmbCountry->insertItem( tr ( "India" ) ); 561 cmbCountry->insertItem( tr ( "India" ) );
563 cmbCountry->insertItem( tr ( "Indonesia" ) ); 562 cmbCountry->insertItem( tr ( "Indonesia" ) );
564 cmbCountry->insertItem( tr ( "Ireland" ) ); 563 cmbCountry->insertItem( tr ( "Ireland" ) );
565 cmbCountry->insertItem( tr ( "Israel" ) ); 564 cmbCountry->insertItem( tr ( "Israel" ) );
566 cmbCountry->insertItem( tr ( "Italy" ) ); 565 cmbCountry->insertItem( tr ( "Italy" ) );
567 cmbCountry->insertItem( tr ( "Jamacia" ) ); 566 cmbCountry->insertItem( tr ( "Jamacia" ) );
568 cmbCountry->insertItem( tr ( "Japan" ) ); 567 cmbCountry->insertItem( tr ( "Japan" ) );
569 cmbCountry->insertItem( tr ( "Jordan" ) ); 568 cmbCountry->insertItem( tr ( "Jordan" ) );
570 cmbCountry->insertItem( tr ( "Kazakhstan" ) ); 569 cmbCountry->insertItem( tr ( "Kazakhstan" ) );
571 cmbCountry->insertItem( tr ( "Kenya" ) ); 570 cmbCountry->insertItem( tr ( "Kenya" ) );
572 cmbCountry->insertItem( tr ( "Kribati" ) ); 571 cmbCountry->insertItem( tr ( "Kribati" ) );
573 cmbCountry->insertItem( tr ( "Korea" ) ); 572 cmbCountry->insertItem( tr ( "Korea" ) );
574 cmbCountry->insertItem( tr ( "Kuwait" ) ); 573 cmbCountry->insertItem( tr ( "Kuwait" ) );
575 cmbCountry->insertItem( tr ( "Kyrgystan" ) ); 574 cmbCountry->insertItem( tr ( "Kyrgystan" ) );
576 cmbCountry->insertItem( tr ( "Laos" ) ); 575 cmbCountry->insertItem( tr ( "Laos" ) );
577 cmbCountry->insertItem( tr ( "Latvia" ) ); 576 cmbCountry->insertItem( tr ( "Latvia" ) );
578 cmbCountry->insertItem( tr ( "Lebanon" ) ); 577 cmbCountry->insertItem( tr ( "Lebanon" ) );
579 cmbCountry->insertItem( tr ( "Lesotho" ) ); 578 cmbCountry->insertItem( tr ( "Lesotho" ) );
580 cmbCountry->insertItem( tr ( "Liberia" ) ); 579 cmbCountry->insertItem( tr ( "Liberia" ) );
581 cmbCountry->insertItem( tr ( "Liechtenstein" ) ); 580 cmbCountry->insertItem( tr ( "Liechtenstein" ) );
582 cmbCountry->insertItem( tr ( "Lithuania" ) ); 581 cmbCountry->insertItem( tr ( "Lithuania" ) );
583 cmbCountry->insertItem( tr ( "Luxembourg" ) ); 582 cmbCountry->insertItem( tr ( "Luxembourg" ) );
584 cmbCountry->insertItem( tr ( "Macau" ) ); 583 cmbCountry->insertItem( tr ( "Macau" ) );
585 cmbCountry->insertItem( tr ( "Macedonia" ) ); 584 cmbCountry->insertItem( tr ( "Macedonia" ) );
586 cmbCountry->insertItem( tr ( "Madagascar" ) ); 585 cmbCountry->insertItem( tr ( "Madagascar" ) );
587 cmbCountry->insertItem( tr ( "Malawi" ) ); 586 cmbCountry->insertItem( tr ( "Malawi" ) );
588 cmbCountry->insertItem( tr ( "Malaysia" ) ); 587 cmbCountry->insertItem( tr ( "Malaysia" ) );
589 cmbCountry->insertItem( tr ( "Maldives" ) ); 588 cmbCountry->insertItem( tr ( "Maldives" ) );
590 cmbCountry->insertItem( tr ( "Mali" ) ); 589 cmbCountry->insertItem( tr ( "Mali" ) );
591 cmbCountry->insertItem( tr ( "Malta" ) ); 590 cmbCountry->insertItem( tr ( "Malta" ) );
592 cmbCountry->insertItem( tr ( "Martinique" ) ); 591 cmbCountry->insertItem( tr ( "Martinique" ) );
593 cmbCountry->insertItem( tr ( "Mauritania" ) ); 592 cmbCountry->insertItem( tr ( "Mauritania" ) );
594 cmbCountry->insertItem( tr ( "Mauritius" ) ); 593 cmbCountry->insertItem( tr ( "Mauritius" ) );
595 cmbCountry->insertItem( tr ( "Mayotte" ) ); 594 cmbCountry->insertItem( tr ( "Mayotte" ) );
596 cmbCountry->insertItem( tr ( "Mexico" ) ); 595 cmbCountry->insertItem( tr ( "Mexico" ) );
597 cmbCountry->insertItem( tr ( "Micronesia" ) ); 596 cmbCountry->insertItem( tr ( "Micronesia" ) );
598 cmbCountry->insertItem( tr ( "Moldova" ) ); 597 cmbCountry->insertItem( tr ( "Moldova" ) );
599 cmbCountry->insertItem( tr ( "Monaco" ) ); 598 cmbCountry->insertItem( tr ( "Monaco" ) );
600 cmbCountry->insertItem( tr ( "Mongolia" ) ); 599 cmbCountry->insertItem( tr ( "Mongolia" ) );
601 cmbCountry->insertItem( tr ( "Montserrat" ) ); 600 cmbCountry->insertItem( tr ( "Montserrat" ) );
602 cmbCountry->insertItem( tr ( "Morocco" ) ); 601 cmbCountry->insertItem( tr ( "Morocco" ) );
603 cmbCountry->insertItem( tr ( "Mozambique" ) ); 602 cmbCountry->insertItem( tr ( "Mozambique" ) );
604 cmbCountry->insertItem( tr ( "Myanmar" ) ); 603 cmbCountry->insertItem( tr ( "Myanmar" ) );
605 cmbCountry->insertItem( tr ( "Namibia" ) ); 604 cmbCountry->insertItem( tr ( "Namibia" ) );
606 cmbCountry->insertItem( tr ( "Nauru" ) ); 605 cmbCountry->insertItem( tr ( "Nauru" ) );
607 cmbCountry->insertItem( tr ( "Nepal" ) ); 606 cmbCountry->insertItem( tr ( "Nepal" ) );
608 cmbCountry->insertItem( tr ( "Netherlands" ) ); 607 cmbCountry->insertItem( tr ( "Netherlands" ) );
609 cmbCountry->insertItem( tr ( "New Caledonia" ) ); 608 cmbCountry->insertItem( tr ( "New Caledonia" ) );
610 cmbCountry->insertItem( tr ( "New Zealand" ) ); 609 cmbCountry->insertItem( tr ( "New Zealand" ) );
611 cmbCountry->insertItem( tr ( "Nicaragua" ) ); 610 cmbCountry->insertItem( tr ( "Nicaragua" ) );
612 cmbCountry->insertItem( tr ( "Niger" ) ); 611 cmbCountry->insertItem( tr ( "Niger" ) );
613 cmbCountry->insertItem( tr ( "Nigeria" ) ); 612 cmbCountry->insertItem( tr ( "Nigeria" ) );
614 cmbCountry->insertItem( tr ( "Niue" ) ); 613 cmbCountry->insertItem( tr ( "Niue" ) );
615 cmbCountry->insertItem( tr ( "Norway" ) ); 614 cmbCountry->insertItem( tr ( "Norway" ) );
616 cmbCountry->insertItem( tr ( "Oman" ) ); 615 cmbCountry->insertItem( tr ( "Oman" ) );
617 cmbCountry->insertItem( tr ( "Pakistan" ) ); 616 cmbCountry->insertItem( tr ( "Pakistan" ) );
618 cmbCountry->insertItem( tr ( "Palau" ) ); 617 cmbCountry->insertItem( tr ( "Palau" ) );
619 cmbCountry->insertItem( tr ( "Palestinian Territory" ) ); 618 cmbCountry->insertItem( tr ( "Palestinian Territory" ) );
620 cmbCountry->insertItem( tr ( "Panama" ) ); 619 cmbCountry->insertItem( tr ( "Panama" ) );
621 cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); 620 cmbCountry->insertItem( tr ( "Papua New Guinea" ) );
622 cmbCountry->insertItem( tr ( "Paraguay" ) ); 621 cmbCountry->insertItem( tr ( "Paraguay" ) );
623 cmbCountry->insertItem( tr ( "Peru" ) ); 622 cmbCountry->insertItem( tr ( "Peru" ) );
624 cmbCountry->insertItem( tr ( "Philippines" ) ); 623 cmbCountry->insertItem( tr ( "Philippines" ) );
625 cmbCountry->insertItem( tr ( "Pitcairn" ) ); 624 cmbCountry->insertItem( tr ( "Pitcairn" ) );
626 cmbCountry->insertItem( tr ( "Poland" ) ); 625 cmbCountry->insertItem( tr ( "Poland" ) );
627 cmbCountry->insertItem( tr ( "Portugal" ) ); 626 cmbCountry->insertItem( tr ( "Portugal" ) );
628 cmbCountry->insertItem( tr ( "Puerto Rico" ) ); 627 cmbCountry->insertItem( tr ( "Puerto Rico" ) );
629 cmbCountry->insertItem( tr ( "Qatar" ) ); 628 cmbCountry->insertItem( tr ( "Qatar" ) );
630 cmbCountry->insertItem( tr ( "Reunion" ) ); 629 cmbCountry->insertItem( tr ( "Reunion" ) );
631 cmbCountry->insertItem( tr ( "Romania" ) ); 630 cmbCountry->insertItem( tr ( "Romania" ) );
632 cmbCountry->insertItem( tr ( "Russia" ) ); 631 cmbCountry->insertItem( tr ( "Russia" ) );
633 cmbCountry->insertItem( tr ( "Rwanda" ) ); 632 cmbCountry->insertItem( tr ( "Rwanda" ) );
634 cmbCountry->insertItem( tr ( "Saint Lucia" ) ); 633 cmbCountry->insertItem( tr ( "Saint Lucia" ) );
635 cmbCountry->insertItem( tr ( "Samoa" ) ); 634 cmbCountry->insertItem( tr ( "Samoa" ) );
636 cmbCountry->insertItem( tr ( "San Marino" ) ); 635 cmbCountry->insertItem( tr ( "San Marino" ) );
637 cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); 636 cmbCountry->insertItem( tr ( "Saudi Arabia" ) );
638 cmbCountry->insertItem( tr ( "Senegal" ) ); 637 cmbCountry->insertItem( tr ( "Senegal" ) );
639 cmbCountry->insertItem( tr ( "Seychelles" ) ); 638 cmbCountry->insertItem( tr ( "Seychelles" ) );
640 cmbCountry->insertItem( tr ( "Sierra Leone" ) ); 639 cmbCountry->insertItem( tr ( "Sierra Leone" ) );
641 cmbCountry->insertItem( tr ( "Singapore" ) ); 640 cmbCountry->insertItem( tr ( "Singapore" ) );
642 cmbCountry->insertItem( tr ( "Slovakia" ) ); 641 cmbCountry->insertItem( tr ( "Slovakia" ) );
643 cmbCountry->insertItem( tr ( "Slovenia" ) ); 642 cmbCountry->insertItem( tr ( "Slovenia" ) );
644 cmbCountry->insertItem( tr ( "Solomon Islands" ) ); 643 cmbCountry->insertItem( tr ( "Solomon Islands" ) );
645 cmbCountry->insertItem( tr ( "Somalia" ) ); 644 cmbCountry->insertItem( tr ( "Somalia" ) );
646 cmbCountry->insertItem( tr ( "South Africa" ) ); 645 cmbCountry->insertItem( tr ( "South Africa" ) );
647 cmbCountry->insertItem( tr ( "Spain" ) ); 646 cmbCountry->insertItem( tr ( "Spain" ) );
648 cmbCountry->insertItem( tr ( "Sri Lanka" ) ); 647 cmbCountry->insertItem( tr ( "Sri Lanka" ) );
649 cmbCountry->insertItem( tr ( "St. Helena" ) ); 648 cmbCountry->insertItem( tr ( "St. Helena" ) );
650 cmbCountry->insertItem( tr ( "Sudan" ) ); 649 cmbCountry->insertItem( tr ( "Sudan" ) );
651 cmbCountry->insertItem( tr ( "Suriname" ) ); 650 cmbCountry->insertItem( tr ( "Suriname" ) );
652 cmbCountry->insertItem( tr ( "Swaziland" ) ); 651 cmbCountry->insertItem( tr ( "Swaziland" ) );
653 cmbCountry->insertItem( tr ( "Sweden" ) ); 652 cmbCountry->insertItem( tr ( "Sweden" ) );
654 cmbCountry->insertItem( tr ( "Switzerland" ) ); 653 cmbCountry->insertItem( tr ( "Switzerland" ) );
655 cmbCountry->insertItem( tr ( "Taiwan" ) ); 654 cmbCountry->insertItem( tr ( "Taiwan" ) );
656 cmbCountry->insertItem( tr ( "Tajikistan" ) ); 655 cmbCountry->insertItem( tr ( "Tajikistan" ) );
657 cmbCountry->insertItem( tr ( "Tanzania" ) ); 656 cmbCountry->insertItem( tr ( "Tanzania" ) );
658 cmbCountry->insertItem( tr ( "Thailand" ) ); 657 cmbCountry->insertItem( tr ( "Thailand" ) );
659 cmbCountry->insertItem( tr ( "Togo" ) ); 658 cmbCountry->insertItem( tr ( "Togo" ) );
660 cmbCountry->insertItem( tr ( "Tokelau" ) ); 659 cmbCountry->insertItem( tr ( "Tokelau" ) );
661 cmbCountry->insertItem( tr ( "Tonga" ) ); 660 cmbCountry->insertItem( tr ( "Tonga" ) );
662 cmbCountry->insertItem( tr ( "Tunisia" ) ); 661 cmbCountry->insertItem( tr ( "Tunisia" ) );
663 cmbCountry->insertItem( tr ( "Turkey" ) ); 662 cmbCountry->insertItem( tr ( "Turkey" ) );
664 cmbCountry->insertItem( tr ( "Turkmenistan" ) ); 663 cmbCountry->insertItem( tr ( "Turkmenistan" ) );
665 cmbCountry->insertItem( tr ( "Tuvalu" ) ); 664 cmbCountry->insertItem( tr ( "Tuvalu" ) );
666 cmbCountry->insertItem( tr ( "Uganda" ) ); 665 cmbCountry->insertItem( tr ( "Uganda" ) );
667 cmbCountry->insertItem( tr ( "Ukraine" ) ); 666 cmbCountry->insertItem( tr ( "Ukraine" ) );
668 cmbCountry->insertItem( tr ( "Uruguay" ) ); 667 cmbCountry->insertItem( tr ( "Uruguay" ) );
669 cmbCountry->insertItem( tr ( "Uzbekistan" ) ); 668 cmbCountry->insertItem( tr ( "Uzbekistan" ) );
670 cmbCountry->insertItem( tr ( "Vanuatu" ) ); 669 cmbCountry->insertItem( tr ( "Vanuatu" ) );
671 cmbCountry->insertItem( tr ( "Venezuela" ) ); 670 cmbCountry->insertItem( tr ( "Venezuela" ) );
672 cmbCountry->insertItem( tr ( "Viet Nam" ) ); 671 cmbCountry->insertItem( tr ( "Viet Nam" ) );
673 cmbCountry->insertItem( tr ( "Virgin Islands" ) ); 672 cmbCountry->insertItem( tr ( "Virgin Islands" ) );
674 cmbCountry->insertItem( tr ( "Western Sahara" ) ); 673 cmbCountry->insertItem( tr ( "Western Sahara" ) );
675 cmbCountry->insertItem( tr ( "Yemen" ) ); 674 cmbCountry->insertItem( tr ( "Yemen" ) );
676 cmbCountry->insertItem( tr ( "Yugoslavia" ) ); 675 cmbCountry->insertItem( tr ( "Yugoslavia" ) );
677 cmbCountry->insertItem( tr ( "Zambia" ) ); 676 cmbCountry->insertItem( tr ( "Zambia" ) );
678 cmbCountry->insertItem( tr ( "Zimbabwe" ) ); 677 cmbCountry->insertItem( tr ( "Zimbabwe" ) );
679 678
680 cmbCountry->setMaximumWidth( 135 ); 679 cmbCountry->setMaximumWidth( 135 );
681 680
682 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); 681 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 );
683 682
684 cmbChooserField4 = new QComboBox( FALSE, container ); 683 cmbChooserField4 = new QComboBox( FALSE, container );
685 cmbChooserField4->setMaximumWidth( 90 ); 684 cmbChooserField4->setMaximumWidth( 90 );
686 gl->addWidget( cmbChooserField4, 6, 0 ); 685 gl->addWidget( cmbChooserField4, 6, 0 );
687 txtChooserField4 = new QLineEdit( container ); 686 txtChooserField4 = new QLineEdit( container );
688 gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); 687 gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 );
689 688
690 QSpacerItem *space = new QSpacerItem(1,1, 689 QSpacerItem *space = new QSpacerItem(1,1,
691 QSizePolicy::Maximum, 690 QSizePolicy::Maximum,
692 QSizePolicy::MinimumExpanding ); 691 QSizePolicy::MinimumExpanding );
693 gl->addItem( space, 7, 0 ); 692 gl->addItem( space, 7, 0 );
694 693
695 tabMain->insertTab( tabViewport, tr( "Address" ) ); 694 tabMain->insertTab( tabViewport, tr( "Address" ) );
696 695
697 tabViewport = new QWidget ( tabMain ); 696 tabViewport = new QWidget ( tabMain );
698 697
699 vb = new QVBoxLayout( tabViewport ); 698 vb = new QVBoxLayout( tabViewport );
700 699
701 svDetails = new QScrollView( tabViewport ); 700 svDetails = new QScrollView( tabViewport );
702 vb->addWidget( svDetails, 0, 0 ); 701 vb->addWidget( svDetails, 0, 0 );
703 svDetails->setResizePolicy( QScrollView::AutoOneFit ); 702 svDetails->setResizePolicy( QScrollView::AutoOneFit );
704 svDetails->setFrameStyle( QFrame::NoFrame ); 703 svDetails->setFrameStyle( QFrame::NoFrame );
705 704
706 container = new QWidget( svDetails->viewport() ); 705 container = new QWidget( svDetails->viewport() );
707 svDetails->addChild( container ); 706 svDetails->addChild( container );
708 707
709 gl = new QGridLayout( container, 1, 2, 2, 4 ); 708 gl = new QGridLayout( container, 1, 2, 2, 4 );
710 709
710 // Create Labels and lineedit fields for every dynamic entry
711 QStringList::ConstIterator it = slDynamicEntries.begin(); 711 QStringList::ConstIterator it = slDynamicEntries.begin();
712 for (i = 0; it != slDynamicEntries.end(); i++, ++it) { 712 for (i = 0; it != slDynamicEntries.end(); i++, ++it) {
713 l = new QLabel( *it, container ); 713 l = new QLabel( QString::null , container );
714 listName.append( l ); 714 listName.append( l );
715 gl->addWidget( l, i, 0 ); 715 gl->addWidget( l, i, 0 );
716 QLineEdit *e = new QLineEdit( container ); 716 QLineEdit *e = new QLineEdit( container );
717 listValue.append( e ); 717 listValue.append( e );
718 gl->addWidget( e, i, 1); 718 gl->addWidget( e, i, 1);
719 } 719 }
720 // Fill labels with names..
721 loadFields();
720 722
721 l = new QLabel( tr("Gender"), container ); 723 l = new QLabel( tr("Gender"), container );
722 gl->addWidget( l, slDynamicEntries.count(), 0 ); 724 gl->addWidget( l, slDynamicEntries.count(), 0 );
723 cmbGender = new QComboBox( container ); 725 cmbGender = new QComboBox( container );
724 cmbGender->insertItem( "", 0 ); 726 cmbGender->insertItem( "", 0 );
725 cmbGender->insertItem( tr("Male"), 1); 727 cmbGender->insertItem( tr("Male"), 1);
726 cmbGender->insertItem( tr("Female"), 2); 728 cmbGender->insertItem( tr("Female"), 2);
727 gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); 729 gl->addWidget( cmbGender, slDynamicEntries.count(), 1 );
728 730
729 tabMain->insertTab( tabViewport, tr( "Details" ) ); 731 tabMain->insertTab( tabViewport, tr( "Details" ) );
730 732
731 dlgNote = new QDialog( this, "Note Dialog", TRUE ); 733 dlgNote = new QDialog( this, "Note Dialog", TRUE );
732 dlgNote->setCaption( tr("Enter Note") ); 734 dlgNote->setCaption( tr("Enter Note") );
733 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); 735 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote );
734 txtNote = new QMultiLineEdit( dlgNote ); 736 txtNote = new QMultiLineEdit( dlgNote );
735 vbNote->addWidget( txtNote ); 737 vbNote->addWidget( txtNote );
736 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); 738 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) );
737 739
738 dlgName = new QDialog( this, "Name Dialog", TRUE ); 740 dlgName = new QDialog( this, "Name Dialog", TRUE );
739 dlgName->setCaption( tr("Edit Name") ); 741 dlgName->setCaption( tr("Edit Name") );
740 gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); 742 gl = new QGridLayout( dlgName, 5, 2, 2, 3 );
741 743
742 l = new QLabel( tr("First Name"), dlgName ); 744 l = new QLabel( tr("First Name"), dlgName );
743 gl->addWidget( l, 0, 0 ); 745 gl->addWidget( l, 0, 0 );
744 txtFirstName = new QLineEdit( dlgName ); 746 txtFirstName = new QLineEdit( dlgName );
745 gl->addWidget( txtFirstName, 0, 1 ); 747 gl->addWidget( txtFirstName, 0, 1 );
746 748
747 l = new QLabel( tr("Middle Name"), dlgName ); 749 l = new QLabel( tr("Middle Name"), dlgName );
748 gl->addWidget( l, 1, 0 ); 750 gl->addWidget( l, 1, 0 );
749 txtMiddleName = new QLineEdit( dlgName ); 751 txtMiddleName = new QLineEdit( dlgName );
750 gl->addWidget( txtMiddleName, 1, 1 ); 752 gl->addWidget( txtMiddleName, 1, 1 );
751 753
752 l = new QLabel( tr("Last Name"), dlgName ); 754 l = new QLabel( tr("Last Name"), dlgName );
753 gl->addWidget( l, 2, 0 ); 755 gl->addWidget( l, 2, 0 );
754 txtLastName = new QLineEdit( dlgName ); 756 txtLastName = new QLineEdit( dlgName );
755 gl->addWidget( txtLastName, 2, 1 ); 757 gl->addWidget( txtLastName, 2, 1 );
756 758
757 l = new QLabel( tr("Suffix"), dlgName ); 759 l = new QLabel( tr("Suffix"), dlgName );
758 gl->addWidget( l, 3, 0 ); 760 gl->addWidget( l, 3, 0 );
759 txtSuffix = new QLineEdit( dlgName ); 761 txtSuffix = new QLineEdit( dlgName );
760 gl->addWidget( txtSuffix, 3, 1 ); 762 gl->addWidget( txtSuffix, 3, 1 );
761 space = new QSpacerItem(1,1, 763 space = new QSpacerItem(1,1,
762 QSizePolicy::Maximum, 764 QSizePolicy::Maximum,
763 QSizePolicy::MinimumExpanding ); 765 QSizePolicy::MinimumExpanding );
764 gl->addItem( space, 4, 0 ); 766 gl->addItem( space, 4, 0 );
765 767
766 cmbChooserField1->insertStringList( trlChooserNames ); 768 cmbChooserField1->insertStringList( trlChooserNames );
767 cmbChooserField2->insertStringList( trlChooserNames ); 769 cmbChooserField2->insertStringList( trlChooserNames );
768 cmbChooserField3->insertStringList( trlChooserNames ); 770 cmbChooserField3->insertStringList( trlChooserNames );
769 cmbChooserField4->insertStringList( trlChooserNames ); 771 cmbChooserField4->insertStringList( trlChooserNames );
770 772
771 cmbChooserField1->setCurrentItem( 0 ); 773 cmbChooserField1->setCurrentItem( 0 );
772 cmbChooserField2->setCurrentItem( 1 ); 774 cmbChooserField2->setCurrentItem( 1 );
773 cmbChooserField3->setCurrentItem( 2 ); 775 cmbChooserField3->setCurrentItem( 2 );
774 776
775 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); 777 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) );
776 778
777 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); 779 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) );
778 780
779 connect( txtChooserField1, SIGNAL(textChanged(const QString &)), 781 connect( txtChooserField1, SIGNAL(textChanged(const QString &)),
780 this, SLOT(slotChooser1Change(const QString &)) ); 782 this, SLOT(slotChooser1Change(const QString &)) );
781 connect( txtChooserField2, SIGNAL(textChanged(const QString &)), 783 connect( txtChooserField2, SIGNAL(textChanged(const QString &)),
782 this, SLOT(slotChooser2Change(const QString &)) ); 784 this, SLOT(slotChooser2Change(const QString &)) );
783 connect( txtChooserField3, SIGNAL(textChanged(const QString &)), 785 connect( txtChooserField3, SIGNAL(textChanged(const QString &)),
784 this, SLOT(slotChooser3Change(const QString &)) ); 786 this, SLOT(slotChooser3Change(const QString &)) );
785 connect( txtChooserField4, SIGNAL(textChanged(const QString &)), 787 connect( txtChooserField4, SIGNAL(textChanged(const QString &)),
786 this, SLOT(slotChooser4Change(const QString &)) ); 788 this, SLOT(slotChooser4Change(const QString &)) );
787 connect( txtAddress, SIGNAL(textChanged(const QString &)), 789 connect( txtAddress, SIGNAL(textChanged(const QString &)),
788 this, SLOT(slotAddressChange(const QString &)) ); 790 this, SLOT(slotAddressChange(const QString &)) );
789 //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); 791 //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) );
790 //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); 792 //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) );
791 connect( txtCity, SIGNAL(textChanged(const QString &)), 793 connect( txtCity, SIGNAL(textChanged(const QString &)),
792 this, SLOT(slotCityChange(const QString &)) ); 794 this, SLOT(slotCityChange(const QString &)) );
793 connect( txtState, SIGNAL(textChanged(const QString &)), 795 connect( txtState, SIGNAL(textChanged(const QString &)),
794 this, SLOT(slotStateChange(const QString &)) ); 796 this, SLOT(slotStateChange(const QString &)) );
795 connect( txtZip, SIGNAL(textChanged(const QString &)), 797 connect( txtZip, SIGNAL(textChanged(const QString &)),
796 this, SLOT(slotZipChange(const QString &)) ); 798 this, SLOT(slotZipChange(const QString &)) );
797 connect( cmbCountry, SIGNAL(textChanged(const QString &)), 799 connect( cmbCountry, SIGNAL(textChanged(const QString &)),
798 this, SLOT(slotCountryChange(const QString &)) ); 800 this, SLOT(slotCountryChange(const QString &)) );
799 connect( cmbCountry, SIGNAL(activated(const QString &)), 801 connect( cmbCountry, SIGNAL(activated(const QString &)),
800 this, SLOT(slotCountryChange(const QString &)) ); 802 this, SLOT(slotCountryChange(const QString &)) );
801 connect( cmbChooserField1, SIGNAL(activated(int)), 803 connect( cmbChooserField1, SIGNAL(activated(int)),
802 this, SLOT(slotCmbChooser1Change(int)) ); 804 this, SLOT(slotCmbChooser1Change(int)) );
803 connect( cmbChooserField2, SIGNAL(activated(int)), 805 connect( cmbChooserField2, SIGNAL(activated(int)),
804 this, SLOT(slotCmbChooser2Change(int)) ); 806 this, SLOT(slotCmbChooser2Change(int)) );
805 connect( cmbChooserField3, SIGNAL(activated(int)), 807 connect( cmbChooserField3, SIGNAL(activated(int)),
806 this, SLOT(slotCmbChooser3Change(int)) ); 808 this, SLOT(slotCmbChooser3Change(int)) );
807 connect( cmbChooserField4, SIGNAL(activated(int)), 809 connect( cmbChooserField4, SIGNAL(activated(int)),
808 this, SLOT(slotCmbChooser4Change(int)) ); 810 this, SLOT(slotCmbChooser4Change(int)) );
809 connect( cmbAddress, SIGNAL(activated(int)), 811 connect( cmbAddress, SIGNAL(activated(int)),
810 this, SLOT(slotAddressTypeChange(int)) ); 812 this, SLOT(slotAddressTypeChange(int)) );
811 813
812 new QPEDialogListener(this); 814 new QPEDialogListener(this);
813} 815}
814 816
815void ContactEditor::initMap() 817void ContactEditor::initMap()
816{ 818{
817 /* 819 /*
818 // since the fields and the XML fields exist, create a map 820 // since the fields and the XML fields exist, create a map
819 // between them... 821 // between them...
820 Config cfg1( "AddressBook" ); 822 Config cfg1( "AddressBook" );
821 Config cfg2( "AddressBook" ); 823 Config cfg2( "AddressBook" );
822 QString strCfg1, 824 QString strCfg1,
823 strCfg2; 825 strCfg2;
824 int i; 826 int i;
825 827
826 // This stuff better exist... 828 // This stuff better exist...
827 cfg1.setGroup( "AddressFields" ); 829 cfg1.setGroup( "AddressFields" );
828o cfg2.setGroup( "XMLFields" ); 830o cfg2.setGroup( "XMLFields" );
829 i = 0; 831 i = 0;
830 strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); 832 strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null );
831 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), 833 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++),
832 QString::null ); 834 QString::null );
833 while ( !strCfg1.isNull() && !strCfg2.isNull() ) { 835 while ( !strCfg1.isNull() && !strCfg2.isNull() ) {
834 mapField.insert( strCfg1, strCfg2 ); 836 mapField.insert( strCfg1, strCfg2 );
835 strCfg1 = cfg1.readEntry( "Field" + QString::number(i), 837 strCfg1 = cfg1.readEntry( "Field" + QString::number(i),
836 QString::null ); 838 QString::null );
837 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), 839 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++),
838 QString::null ); 840 QString::null );
839 } 841 }
840 */ 842 */
841} 843}
842 844
843void ContactEditor::slotChooser1Change( const QString &textChanged ) { 845void ContactEditor::slotChooser1Change( const QString &textChanged ) {
844 846
845 int index = cmbChooserField1->currentItem(); 847 int index = cmbChooserField1->currentItem();
846 848
847 slChooserValues[index] = textChanged; 849 slChooserValues[index] = textChanged;
848 850
849} 851}
850 852
851void ContactEditor::slotChooser2Change( const QString &textChanged ) { 853void ContactEditor::slotChooser2Change( const QString &textChanged ) {
852 854
853 int index = cmbChooserField2->currentItem(); 855 int index = cmbChooserField2->currentItem();
854 856
855 slChooserValues[index] = textChanged; 857 slChooserValues[index] = textChanged;
856 858
857} 859}
858 860
859void ContactEditor::slotChooser3Change( const QString &textChanged ) { 861void ContactEditor::slotChooser3Change( const QString &textChanged ) {
860 862
861 int index = cmbChooserField3->currentItem(); 863 int index = cmbChooserField3->currentItem();
862 864
863 slChooserValues[index] = textChanged; 865 slChooserValues[index] = textChanged;
864 866
865} 867}
866 868
867void ContactEditor::slotChooser4Change( const QString &textChanged ) { 869void ContactEditor::slotChooser4Change( const QString &textChanged ) {
868 870
869 int index = cmbChooserField4->currentItem(); 871 int index = cmbChooserField4->currentItem();
870 872
871 slChooserValues[index] = textChanged; 873 slChooserValues[index] = textChanged;
872 874
873} 875}
874 876
875void ContactEditor::slotAddressChange( const QString &textChanged ) { 877void ContactEditor::slotAddressChange( const QString &textChanged ) {
876 878
877 if ( cmbAddress->currentItem() == 0 ) { 879 if ( cmbAddress->currentItem() == 0 ) {
878 slBusinessAddress[0] = textChanged; 880 slBusinessAddress[0] = textChanged;
879 } else { 881 } else {
880 slHomeAddress[0] = textChanged; 882 slHomeAddress[0] = textChanged;
881 } 883 }
882} 884}
883 885
884void ContactEditor::slotAddress2Change( const QString &textChanged ) { 886void ContactEditor::slotAddress2Change( const QString &textChanged ) {
885 887
886 if ( cmbAddress->currentItem() == 0 ) { 888 if ( cmbAddress->currentItem() == 0 ) {
887 slBusinessAddress[1] = textChanged; 889 slBusinessAddress[1] = textChanged;
888 } else { 890 } else {
889 slHomeAddress[1] = textChanged; 891 slHomeAddress[1] = textChanged;
890 } 892 }
891} 893}
892 894
893void ContactEditor::slotPOBoxChange( const QString &textChanged ) { 895void ContactEditor::slotPOBoxChange( const QString &textChanged ) {
894 896
895 if ( cmbAddress->currentItem() == 0 ) { 897 if ( cmbAddress->currentItem() == 0 ) {
896 slBusinessAddress[2] = textChanged; 898 slBusinessAddress[2] = textChanged;
897 } else { 899 } else {
898 slHomeAddress[2] = textChanged; 900 slHomeAddress[2] = textChanged;
899 } 901 }
900} 902}
901 903
902void ContactEditor::slotCityChange( const QString &textChanged ) { 904void ContactEditor::slotCityChange( const QString &textChanged ) {
903 905
904 if ( cmbAddress->currentItem() == 0 ) { 906 if ( cmbAddress->currentItem() == 0 ) {
905 slBusinessAddress[3] = textChanged; 907 slBusinessAddress[3] = textChanged;
906 } else { 908 } else {
907 slHomeAddress[3] = textChanged; 909 slHomeAddress[3] = textChanged;
908 } 910 }
909} 911}
910 912
911void ContactEditor::slotStateChange( const QString &textChanged ) { 913void ContactEditor::slotStateChange( const QString &textChanged ) {
912 914
913 915
914 if ( cmbAddress->currentItem() == 0 ) { 916 if ( cmbAddress->currentItem() == 0 ) {
915 slBusinessAddress[4] = textChanged; 917 slBusinessAddress[4] = textChanged;
916 } else { 918 } else {
917 slHomeAddress[4] = textChanged; 919 slHomeAddress[4] = textChanged;
918 } 920 }
919} 921}
920 922
921void ContactEditor::slotZipChange( const QString &textChanged ) { 923void ContactEditor::slotZipChange( const QString &textChanged ) {
922 924
923 if ( cmbAddress->currentItem() == 0 ) { 925 if ( cmbAddress->currentItem() == 0 ) {
924 slBusinessAddress[5] = textChanged; 926 slBusinessAddress[5] = textChanged;
925 } else { 927 } else {
926 slHomeAddress[5] = textChanged; 928 slHomeAddress[5] = textChanged;
927 } 929 }
928} 930}
929 931
930void ContactEditor::slotCountryChange( const QString &textChanged ) { 932void ContactEditor::slotCountryChange( const QString &textChanged ) {
931 933
932 if ( cmbAddress->currentItem() == 0 ) { 934 if ( cmbAddress->currentItem() == 0 ) {
933 slBusinessAddress[6] = textChanged; 935 slBusinessAddress[6] = textChanged;
934 } else { 936 } else {
935 slHomeAddress[6] = textChanged; 937 slHomeAddress[6] = textChanged;
936 } 938 }
937} 939}
938 940
939void ContactEditor::slotCmbChooser1Change( int index ) { 941void ContactEditor::slotCmbChooser1Change( int index ) {
940 942
941 txtChooserField1->setText( slChooserValues[index] ); 943 txtChooserField1->setText( slChooserValues[index] );
942 txtChooserField1->setFocus(); 944 txtChooserField1->setFocus();
943} 945}
944 946
945void ContactEditor::slotCmbChooser2Change( int index ) { 947void ContactEditor::slotCmbChooser2Change( int index ) {
946 948
947 txtChooserField2->setText( slChooserValues[index] ); 949 txtChooserField2->setText( slChooserValues[index] );
948 txtChooserField2->setFocus(); 950 txtChooserField2->setFocus();
949} 951}
950 952
951void ContactEditor::slotCmbChooser3Change( int index ) { 953void ContactEditor::slotCmbChooser3Change( int index ) {
952 954
953 txtChooserField3->setText( slChooserValues[index] ); 955 txtChooserField3->setText( slChooserValues[index] );
954 txtChooserField3->setFocus(); 956 txtChooserField3->setFocus();
955 957
956} 958}
957 959
958void ContactEditor::slotCmbChooser4Change( int index ) { 960void ContactEditor::slotCmbChooser4Change( int index ) {
959 961
960 txtChooserField4->setText( slChooserValues[index] ); 962 txtChooserField4->setText( slChooserValues[index] );
961 txtChooserField4->setFocus(); 963 txtChooserField4->setFocus();
962 964
963} 965}
964 966
965void ContactEditor::slotAddressTypeChange( int index ) { 967void ContactEditor::slotAddressTypeChange( int index ) {
966 968
967 if ( index == 0 ) { 969 if ( index == 0 ) {
968 970
969 txtAddress->setText( slBusinessAddress[0] ); 971 txtAddress->setText( slBusinessAddress[0] );
970 //txtAddress2->setText( (*slBusinessAddress)[1] ); 972 //txtAddress2->setText( (*slBusinessAddress)[1] );
971 //txtPOBox->setText( (*slBusinessAddress)[2] ); 973 //txtPOBox->setText( (*slBusinessAddress)[2] );
972 txtCity->setText( slBusinessAddress[3] ); 974 txtCity->setText( slBusinessAddress[3] );
973 txtState->setText( slBusinessAddress[4] ); 975 txtState->setText( slBusinessAddress[4] );
974 txtZip->setText( slBusinessAddress[5] ); 976 txtZip->setText( slBusinessAddress[5] );
975 QLineEdit *txtTmp = cmbCountry->lineEdit(); 977 QLineEdit *txtTmp = cmbCountry->lineEdit();
976 txtTmp->setText( slBusinessAddress[6] ); 978 txtTmp->setText( slBusinessAddress[6] );
977 979
978 } else { 980 } else {
979 981
980 txtAddress->setText( slHomeAddress[0] ); 982 txtAddress->setText( slHomeAddress[0] );
981 //txtAddress2->setText( (*slHomeAddress)[1] ); 983 //txtAddress2->setText( (*slHomeAddress)[1] );
982 //txtPOBox->setText( (*slHomeAddress)[2] ); 984 //txtPOBox->setText( (*slHomeAddress)[2] );
983 txtCity->setText( slHomeAddress[3] ); 985 txtCity->setText( slHomeAddress[3] );
984 txtState->setText( slHomeAddress[4] ); 986 txtState->setText( slHomeAddress[4] );
985 txtZip->setText( slHomeAddress[5] ); 987 txtZip->setText( slHomeAddress[5] );
986 QLineEdit *txtTmp = cmbCountry->lineEdit(); 988 QLineEdit *txtTmp = cmbCountry->lineEdit();
987 txtTmp->setText( slHomeAddress[6] ); 989 txtTmp->setText( slHomeAddress[6] );
988 990
989 } 991 }
990 992
991} 993}
992 994
993void ContactEditor::slotFullNameChange( const QString &textChanged ) { 995void ContactEditor::slotFullNameChange( const QString &textChanged ) {
994 996
995 int index = cmbFileAs->currentItem(); 997 int index = cmbFileAs->currentItem();
996 998
997 cmbFileAs->clear(); 999 cmbFileAs->clear();
998 1000
999 cmbFileAs->insertItem( parseName( textChanged, 0 ) ); 1001 cmbFileAs->insertItem( parseName( textChanged, 0 ) );
1000 cmbFileAs->insertItem( parseName( textChanged, 1 ) ); 1002 cmbFileAs->insertItem( parseName( textChanged, 1 ) );
1001 cmbFileAs->insertItem( parseName( textChanged, 2 ) ); 1003 cmbFileAs->insertItem( parseName( textChanged, 2 ) );
1002 cmbFileAs->insertItem( parseName( textChanged, 3 ) ); 1004 cmbFileAs->insertItem( parseName( textChanged, 3 ) );
1003 1005
1004 cmbFileAs->setCurrentItem( index ); 1006 cmbFileAs->setCurrentItem( index );
1005 1007
1006 useFullName = TRUE; 1008 useFullName = TRUE;
1007 1009
1008} 1010}
1009 1011
1010void ContactEditor::loadFields() { 1012void ContactEditor::loadFields() {
1011 1013
1012 QStringList::ConstIterator it; 1014 QStringList::ConstIterator it;
1013 QListIterator<QLabel> lit( listName ); 1015 QListIterator<QLabel> lit( listName );
1014 for ( it = slDynamicEntries.begin(); *lit; ++lit, ++it) { 1016 for ( it = slDynamicEntries.begin(); *lit; ++lit, ++it) {
1015 (*lit)->setText( *it ); 1017
1018 if ( *it == "Department" )
1019 (*lit)->setText( tr( "Department" ) );
1020
1021 if ( *it == "Company" )
1022 (*lit)->setText( tr( "Company" ) );
1023
1024 if ( *it == "Office" )
1025 (*lit)->setText( tr( "Office" ) );
1026
1027 if ( *it == "Profession" )
1028 (*lit)->setText( tr( "Profession" ) );
1029
1030 if ( *it == "Assistant" )
1031 (*lit)->setText( tr( "Assistant" ) );
1032
1033 if ( *it == "Manager" )
1034 (*lit)->setText( tr( "Manager" ) );
1035
1036 if ( *it == "Spouse" )
1037 (*lit)->setText( tr( "Spouse" ) );
1038
1039 if ( *it == "Birthday" )
1040 (*lit)->setText( tr( "Birthday" ) );
1041
1042 if ( *it == "Anniversary" )
1043 (*lit)->setText( tr( "Anniversary" ) );
1044
1045 if ( *it == "Nickname" )
1046 (*lit)->setText( tr( "Nickname" ) );
1047
1048 if ( *it == "Children" )
1049 (*lit)->setText( tr( "Children" ) );
1016 } 1050 }
1017} 1051}
1018 1052
1019void ContactEditor::accept() { 1053void ContactEditor::accept() {
1020 1054
1021 if ( isEmpty() ) { 1055 if ( isEmpty() ) {
1022 cleanupFields(); 1056 cleanupFields();
1023 reject(); 1057 reject();
1024 } else { 1058 } else {
1025 saveEntry(); 1059 saveEntry();
1026 cleanupFields(); 1060 cleanupFields();
1027 QDialog::accept(); 1061 QDialog::accept();
1028 } 1062 }
1029 1063
1030} 1064}
1031 1065
1032void ContactEditor::slotNote() { 1066void ContactEditor::slotNote() {
1033 1067
1034 dlgNote->showMaximized(); 1068 dlgNote->showMaximized();
1035 if ( !dlgNote->exec() ) { 1069 if ( !dlgNote->exec() ) {
1036 txtNote->setText( ent.notes() ); 1070 txtNote->setText( ent.notes() );
1037 } 1071 }
1038} 1072}
1039 1073
1040void ContactEditor::slotName() { 1074void ContactEditor::slotName() {
1041 1075
1042 QString tmpName; 1076 QString tmpName;
1043 if (useFullName == TRUE) { 1077 if (useFullName == TRUE) {
1044 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); 1078 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) );
1045 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); 1079 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) );
1046 txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); 1080 txtLastName->setText( parseName(txtFullName->text(), NAME_L) );
1047 txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); 1081 txtSuffix->setText( parseName(txtFullName->text(), NAME_S) );
1048 } 1082 }
1049 dlgName->showMaximized(); 1083 dlgName->showMaximized();
1050 if ( dlgName->exec() ) { 1084 if ( dlgName->exec() ) {
1051 1085
1052 tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); 1086 tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text();
1053 txtFullName->setText( tmpName.simplifyWhiteSpace() ); 1087 txtFullName->setText( tmpName.simplifyWhiteSpace() );
1054 slotFullNameChange( txtFullName->text() ); 1088 slotFullNameChange( txtFullName->text() );
1055 useFullName = FALSE; 1089 useFullName = FALSE;
1056 } 1090 }
1057 1091
1058} 1092}
1059 1093
1060void ContactEditor::setNameFocus() { 1094void ContactEditor::setNameFocus() {
1061 1095
1062 txtFullName->setFocus(); 1096 txtFullName->setFocus();
1063 1097
1064} 1098}
1065 1099
1066bool ContactEditor::isEmpty() { 1100bool ContactEditor::isEmpty() {
1067 // Test and see if the record should be saved. 1101 // Test and see if the record should be saved.
1068 // More strict than the original qtopia, needs name or fileas to save 1102 // More strict than the original qtopia, needs name or fileas to save
1069 1103
1070 QString t = txtFullName->text(); 1104 QString t = txtFullName->text();
1071 if ( !t.isEmpty() && containsAlphaNum( t ) ) 1105 if ( !t.isEmpty() && containsAlphaNum( t ) )
1072 return false; 1106 return false;
1073 1107
1074 t = cmbFileAs->currentText(); 1108 t = cmbFileAs->currentText();
1075 if ( !t.isEmpty() && containsAlphaNum( t ) ) 1109 if ( !t.isEmpty() && containsAlphaNum( t ) )
1076 return false; 1110 return false;
1077 1111
1078 return true; 1112 return true;
1079 1113
1080} 1114}
1081 1115
1082QString ContactEditor::parseName( const QString fullName, int type ) { 1116QString ContactEditor::parseName( const QString fullName, int type ) {
1083 1117
1084 QString simplifiedName( fullName.simplifyWhiteSpace() ); 1118 QString simplifiedName( fullName.simplifyWhiteSpace() );
1085 QString strFirstName; 1119 QString strFirstName;
1086 QString strMiddleName; 1120 QString strMiddleName;
1087 QString strLastName; 1121 QString strLastName;
1088 QString strSuffix; 1122 QString strSuffix;
1089 QString strTitle; 1123 QString strTitle;
1090 int commapos; 1124 int commapos;
1091 int spCount; 1125 int spCount;
1092 int spPos; 1126 int spPos;
1093 int spPos2; 1127 int spPos2;
1094 1128
1095 1129
1096 commapos = simplifiedName.find( ',', 0, TRUE); 1130 commapos = simplifiedName.find( ',', 0, TRUE);
1097 spCount = simplifiedName.contains( ' ', TRUE ); 1131 spCount = simplifiedName.contains( ' ', TRUE );
1098 1132
1099 if ( commapos == -1 ) { 1133 if ( commapos == -1 ) {
1100 1134
1101 switch (spCount) { 1135 switch (spCount) {
1102 case 0: 1136 case 0:
1103 //return simplifiedName; 1137 //return simplifiedName;
1104 if (txtLastName->text() != "") { 1138 if (txtLastName->text() != "") {
1105 strLastName = simplifiedName; 1139 strLastName = simplifiedName;
1106 break; 1140 break;
1107 } 1141 }
1108 if (txtMiddleName->text() != "") { 1142 if (txtMiddleName->text() != "") {
1109 strMiddleName = simplifiedName; 1143 strMiddleName = simplifiedName;
1110 break; 1144 break;
1111 } 1145 }
1112 if (txtSuffix->text() != "") { 1146 if (txtSuffix->text() != "") {
1113 strSuffix = simplifiedName; 1147 strSuffix = simplifiedName;
1114 break; 1148 break;
1115 } 1149 }
1116 strFirstName = simplifiedName; 1150 strFirstName = simplifiedName;
1117 break; 1151 break;
1118 1152
1119 case 1: 1153 case 1:
1120 spPos = simplifiedName.find( ' ', 0, TRUE ); 1154 spPos = simplifiedName.find( ' ', 0, TRUE );
1121 strFirstName = simplifiedName.left( spPos ); 1155 strFirstName = simplifiedName.left( spPos );
1122 strLastName = simplifiedName.mid( spPos + 1 ); 1156 strLastName = simplifiedName.mid( spPos + 1 );
1123 break; 1157 break;
1124 1158
1125 case 2: 1159 case 2:
1126 spPos = simplifiedName.find( ' ', 0, TRUE ); 1160 spPos = simplifiedName.find( ' ', 0, TRUE );
1127 strFirstName = simplifiedName.left( spPos ); 1161 strFirstName = simplifiedName.left( spPos );
1128 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1162 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1129 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1163 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1130 strLastName = simplifiedName.mid( spPos2 + 1 ); 1164 strLastName = simplifiedName.mid( spPos2 + 1 );
1131 break; 1165 break;
1132 1166
1133 case 3: 1167 case 3:
1134 spPos = simplifiedName.find( ' ', 0, TRUE ); 1168 spPos = simplifiedName.find( ' ', 0, TRUE );
1135 strFirstName = simplifiedName.left( spPos ); 1169 strFirstName = simplifiedName.left( spPos );
1136 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1170 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1137 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1171 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1138 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1172 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1139 strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); 1173 strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1140 strSuffix = simplifiedName.mid( spPos + 1 ); 1174 strSuffix = simplifiedName.mid( spPos + 1 );
1141 break; 1175 break;
1142 1176
1143 case 4: 1177 case 4:
1144 spPos = simplifiedName.find( ' ', 0, TRUE ); 1178 spPos = simplifiedName.find( ' ', 0, TRUE );
1145 strTitle = simplifiedName.left( spPos ); 1179 strTitle = simplifiedName.left( spPos );
1146 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1180 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1147 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1181 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1148 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1182 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1149 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); 1183 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1150 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1184 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1151 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1185 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1152 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1186 strSuffix = simplifiedName.mid( spPos2 + 1 );
1153 break; 1187 break;
1154 1188
1155 default: 1189 default:
1156 spPos = simplifiedName.find( ' ', 0, TRUE ); 1190 spPos = simplifiedName.find( ' ', 0, TRUE );
1157 strTitle = simplifiedName.left( spPos ); 1191 strTitle = simplifiedName.left( spPos );
1158 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1192 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1159 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1193 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1160 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1194 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1161 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); 1195 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1162 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1196 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1163 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1197 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1164 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1198 strSuffix = simplifiedName.mid( spPos2 + 1 );
1165 break; 1199 break;
1166 } 1200 }
1167 } else { 1201 } else {
1168 simplifiedName.replace( commapos, 1, " " ); 1202 simplifiedName.replace( commapos, 1, " " );
1169 simplifiedName = simplifiedName.simplifyWhiteSpace(); 1203 simplifiedName = simplifiedName.simplifyWhiteSpace();
1170 1204
1171 switch (spCount) { 1205 switch (spCount) {
1172 case 0: 1206 case 0:
1173 //return simplifiedName; 1207 //return simplifiedName;
1174 if (txtLastName->text() != "") { 1208 if (txtLastName->text() != "") {
1175 strLastName = simplifiedName; 1209 strLastName = simplifiedName;
1176 break; 1210 break;
1177 } 1211 }
1178 if (txtMiddleName->text() != "") { 1212 if (txtMiddleName->text() != "") {
1179 strMiddleName = simplifiedName; 1213 strMiddleName = simplifiedName;
1180 break; 1214 break;
1181 } 1215 }
1182 if (txtSuffix->text() != "") { 1216 if (txtSuffix->text() != "") {
1183 strSuffix = simplifiedName; 1217 strSuffix = simplifiedName;
1184 break; 1218 break;
1185 } 1219 }
1186 strFirstName = simplifiedName; 1220 strFirstName = simplifiedName;
1187 break; 1221 break;
1188 1222
1189 case 1: 1223 case 1:
1190 spPos = simplifiedName.find( ' ', 0, TRUE ); 1224 spPos = simplifiedName.find( ' ', 0, TRUE );
1191 strLastName = simplifiedName.left( spPos ); 1225 strLastName = simplifiedName.left( spPos );
1192 strFirstName = simplifiedName.mid( spPos + 1 ); 1226 strFirstName = simplifiedName.mid( spPos + 1 );
1193 break; 1227 break;
1194 1228
1195 case 2: 1229 case 2:
1196 spPos = simplifiedName.find( ' ', 0, TRUE ); 1230 spPos = simplifiedName.find( ' ', 0, TRUE );
1197 strLastName = simplifiedName.left( spPos ); 1231 strLastName = simplifiedName.left( spPos );
1198 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1232 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1199 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1233 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1200 strMiddleName = simplifiedName.mid( spPos2 + 1 ); 1234 strMiddleName = simplifiedName.mid( spPos2 + 1 );
1201 break; 1235 break;
1202 1236
1203 case 3: 1237 case 3:
1204 spPos = simplifiedName.find( ' ', 0, TRUE ); 1238 spPos = simplifiedName.find( ' ', 0, TRUE );
1205 strLastName = simplifiedName.left( spPos ); 1239 strLastName = simplifiedName.left( spPos );
1206 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1240 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1207 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1241 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1208 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1242 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1209 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); 1243 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1210 strSuffix = simplifiedName.mid( spPos + 1 ); 1244 strSuffix = simplifiedName.mid( spPos + 1 );
1211 break; 1245 break;
1212 1246
1213 case 4: 1247 case 4:
1214 spPos = simplifiedName.find( ' ', 0, TRUE ); 1248 spPos = simplifiedName.find( ' ', 0, TRUE );
1215 strLastName = simplifiedName.left( spPos ); 1249 strLastName = simplifiedName.left( spPos );
1216 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1250 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1217 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1251 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1218 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1252 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1219 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); 1253 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1220 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1254 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1221 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1255 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1222 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1256 strSuffix = simplifiedName.mid( spPos2 + 1 );
1223 break; 1257 break;
1224 1258
1225 default: 1259 default:
1226 spPos = simplifiedName.find( ' ', 0, TRUE ); 1260 spPos = simplifiedName.find( ' ', 0, TRUE );
1227 strLastName = simplifiedName.left( spPos ); 1261 strLastName = simplifiedName.left( spPos );
1228 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1262 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1229 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1263 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1230 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1264 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1231 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1265 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos );
1232 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1266 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1233 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1267 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1234 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1268 strSuffix = simplifiedName.mid( spPos2 + 1 );
1235 break; 1269 break;
1236 } 1270 }
1237 } 1271 }
1238 switch (type) { 1272 switch (type) {
1239 case NAME_FL: 1273 case NAME_FL:
1240 return strFirstName + " " + strLastName; 1274 return strFirstName + " " + strLastName;
1241 1275
1242 case NAME_LF: 1276 case NAME_LF:
1243 return strLastName + ", " + strFirstName; 1277 return strLastName + ", " + strFirstName;
1244 1278
1245 case NAME_LFM: 1279 case NAME_LFM:
1246 return strLastName + ", " + strFirstName + " " + strMiddleName; 1280 return strLastName + ", " + strFirstName + " " + strMiddleName;
1247 1281
1248 case NAME_FMLS: 1282 case NAME_FMLS:
1249 return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; 1283 return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix;
1250 1284
1251 case NAME_F: 1285 case NAME_F:
1252 return strFirstName; 1286 return strFirstName;
1253 1287
1254 case NAME_M: 1288 case NAME_M:
1255 return strMiddleName; 1289 return strMiddleName;
1256 1290
1257 case NAME_L: 1291 case NAME_L:
1258 return strLastName; 1292 return strLastName;
1259 1293
1260 case NAME_S: 1294 case NAME_S:
1261 return strSuffix; 1295 return strSuffix;
1262 1296
1263 } 1297 }
1264 return QString::null; 1298 return QString::null;
1265} 1299}
1266 1300
1267void ContactEditor::cleanupFields() { 1301void ContactEditor::cleanupFields() {
1268 1302
1269 QStringList::Iterator it = slChooserValues.begin(); 1303 QStringList::Iterator it = slChooserValues.begin();
1270 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { 1304 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) {
1271 (*it) = ""; 1305 (*it) = "";
1272 } 1306 }
1273 1307
1274 for ( int i = 0; i < 7; i++ ) { 1308 for ( int i = 0; i < 7; i++ ) {
1275 slHomeAddress[i] = ""; 1309 slHomeAddress[i] = "";
1276 slBusinessAddress[i] = ""; 1310 slBusinessAddress[i] = "";
1277 } 1311 }
1278 1312
1279 QStringList::ConstIterator cit; 1313 QStringList::ConstIterator cit;
1280 QListIterator<QLineEdit> itLE( listValue ); 1314 QListIterator<QLineEdit> itLE( listValue );
1281 for ( cit = slDynamicEntries.begin(); cit != slDynamicEntries.end(); ++cit, ++itLE) { 1315 for ( cit = slDynamicEntries.begin(); cit != slDynamicEntries.end(); ++cit, ++itLE) {
1282 (*itLE)->setText( "" ); 1316 (*itLE)->setText( "" );
1283 } 1317 }
1284 1318
1285 txtFirstName->setText(""); 1319 txtFirstName->setText("");
1286 txtMiddleName->setText(""); 1320 txtMiddleName->setText("");
1287 txtLastName->setText(""); 1321 txtLastName->setText("");
1288 txtSuffix->setText(""); 1322 txtSuffix->setText("");
1289 txtNote->setText(""); 1323 txtNote->setText("");
1290 txtFullName->setText(""); 1324 txtFullName->setText("");
1291 txtJobTitle->setText(""); 1325 txtJobTitle->setText("");
1292 txtOrganization->setText(""); 1326 txtOrganization->setText("");
1293 txtChooserField1->setText(""); 1327 txtChooserField1->setText("");
1294 txtChooserField2->setText(""); 1328 txtChooserField2->setText("");
1295 txtChooserField3->setText(""); 1329 txtChooserField3->setText("");
1296 txtAddress->setText(""); 1330 txtAddress->setText("");
1297 //txtAddress2->setText(""); 1331 //txtAddress2->setText("");
1298 txtCity->setText(""); 1332 txtCity->setText("");
1299 //txtPOBox->setText(""); 1333 //txtPOBox->setText("");
1300 txtState->setText(""); 1334 txtState->setText("");
1301 txtZip->setText(""); 1335 txtZip->setText("");
1302 QLineEdit *txtTmp = cmbCountry->lineEdit(); 1336 QLineEdit *txtTmp = cmbCountry->lineEdit();
1303 txtTmp->setText(""); 1337 txtTmp->setText("");
1304 txtTmp = cmbFileAs->lineEdit(); 1338 txtTmp = cmbFileAs->lineEdit();
1305 txtTmp->setText(""); 1339 txtTmp->setText("");
1306 1340
1307} 1341}
1308 1342
1309void ContactEditor::setEntry( const OContact &entry ) { 1343void ContactEditor::setEntry( const OContact &entry ) {
1310 1344
1311 cleanupFields(); 1345 cleanupFields();
1312 1346
1313 1347
1314 ent = entry; 1348 ent = entry;
1315 1349
1316 useFullName = FALSE; 1350 useFullName = FALSE;
1317 txtFirstName->setText( ent.firstName() ); 1351 txtFirstName->setText( ent.firstName() );
1318 txtMiddleName->setText( ent.middleName() ); 1352 txtMiddleName->setText( ent.middleName() );
1319 txtLastName->setText( ent.lastName() ); 1353 txtLastName->setText( ent.lastName() );
1320 txtSuffix->setText( ent.suffix() ); 1354 txtSuffix->setText( ent.suffix() );
1321 1355
1322 QString *tmpString = new QString; 1356 QString *tmpString = new QString;
1323 *tmpString = ent.firstName() + " " + ent.middleName() + 1357 *tmpString = ent.firstName() + " " + ent.middleName() +
1324 + " " + ent.lastName() + " " + ent.suffix(); 1358 + " " + ent.lastName() + " " + ent.suffix();
1325 1359
1326 txtFullName->setText( tmpString->simplifyWhiteSpace() ); 1360 txtFullName->setText( tmpString->simplifyWhiteSpace() );
1327 1361
1328 cmbFileAs->setEditText( ent.fileAs() ); 1362 cmbFileAs->setEditText( ent.fileAs() );
1329 1363
1330 if (hasTitle) 1364 if (hasTitle)
1331 txtJobTitle->setText( ent.jobTitle() ); 1365 txtJobTitle->setText( ent.jobTitle() );
1332 1366
1333 if (hasCompany) 1367 if (hasCompany)
1334 txtOrganization->setText( ent.company() ); 1368 txtOrganization->setText( ent.company() );
1335 1369
1336 if (hasNotes) 1370 if (hasNotes)
1337 txtNote->setText( ent.notes() ); 1371 txtNote->setText( ent.notes() );
1338 1372
1339 if (hasStreet) { 1373 if (hasStreet) {
1340 slHomeAddress[0] = ent.homeStreet(); 1374 slHomeAddress[0] = ent.homeStreet();
1341 slBusinessAddress[0] = ent.businessStreet(); 1375 slBusinessAddress[0] = ent.businessStreet();
1342 } 1376 }
1343/* 1377/*
1344 if (hasStreet2) { 1378 if (hasStreet2) {
1345 (*slHomeAddress)[1] = ent.homeStreet2(); 1379 (*slHomeAddress)[1] = ent.homeStreet2();
1346 (*slBusinessAddress)[1] = ent.businessStreet2(); 1380 (*slBusinessAddress)[1] = ent.businessStreet2();
1347 } 1381 }
1348 1382
1349 if (hasPOBox) { 1383 if (hasPOBox) {
1350 (*slHomeAddress)[2] = ent.homePOBox(); 1384 (*slHomeAddress)[2] = ent.homePOBox();
1351 (*slBusinessAddress)[2] = ent.businessPOBox(); 1385 (*slBusinessAddress)[2] = ent.businessPOBox();
1352 } 1386 }
1353*/ 1387*/
1354 if (hasCity) { 1388 if (hasCity) {
1355 slHomeAddress[3] = ent.homeCity(); 1389 slHomeAddress[3] = ent.homeCity();
1356 slBusinessAddress[3] = ent.businessCity(); 1390 slBusinessAddress[3] = ent.businessCity();
1357 } 1391 }
1358 1392
1359 if (hasState) { 1393 if (hasState) {
1360 slHomeAddress[4] = ent.homeState(); 1394 slHomeAddress[4] = ent.homeState();
1361 slBusinessAddress[4] = ent.businessState(); 1395 slBusinessAddress[4] = ent.businessState();
1362 } 1396 }
1363 1397
1364 if (hasZip) { 1398 if (hasZip) {
1365 slHomeAddress[5] = ent.homeZip(); 1399 slHomeAddress[5] = ent.homeZip();
1366 slBusinessAddress[5] = ent.businessZip(); 1400 slBusinessAddress[5] = ent.businessZip();
1367 } 1401 }
1368 1402
1369 if (hasCountry) { 1403 if (hasCountry) {
1370 slHomeAddress[6] = ent.homeCountry(); 1404 slHomeAddress[6] = ent.homeCountry();
1371 slBusinessAddress[6] = ent.businessCountry(); 1405 slBusinessAddress[6] = ent.businessCountry();
1372 } 1406 }
1373 1407
1374 QStringList::ConstIterator it; 1408 QStringList::ConstIterator it;
1375 QListIterator<QLineEdit> itLE( listValue ); 1409 QListIterator<QLineEdit> itLE( listValue );
1376 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { 1410 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) {
1377 if ( *it == tr( "Department" ) ) 1411 if ( *it == "Department" )
1378 (*itLE)->setText( ent.department() ); 1412 (*itLE)->setText( ent.department() );
1379 1413
1380 if ( *it == tr( "Company" ) ) 1414 if ( *it == "Company" )
1381 (*itLE)->setText( ent.company() ); 1415 (*itLE)->setText( ent.company() );
1382 1416
1383 if ( *it == tr( "Office" ) ) 1417 if ( *it == "Office" )
1384 (*itLE)->setText( ent.office() ); 1418 (*itLE)->setText( ent.office() );
1385 1419
1386 if ( *it == tr( "Profession" ) ) 1420 if ( *it == "Profession" )
1387 (*itLE)->setText( ent.profession() ); 1421 (*itLE)->setText( ent.profession() );
1388 1422
1389 if ( *it == tr( "Assistant" ) ) 1423 if ( *it == "Assistant" )
1390 (*itLE)->setText( ent.assistant() ); 1424 (*itLE)->setText( ent.assistant() );
1391 1425
1392 if ( *it == tr( "Manager" ) ) 1426 if ( *it == "Manager" )
1393 (*itLE)->setText( ent.manager() ); 1427 (*itLE)->setText( ent.manager() );
1394 1428
1395 if ( *it == tr( "Spouse" ) ) 1429 if ( *it == "Spouse" )
1396 (*itLE)->setText( ent.spouse() ); 1430 (*itLE)->setText( ent.spouse() );
1397 1431
1398 if ( *it == tr( "Birthday" ) ) 1432 if ( *it == "Birthday" )
1399 (*itLE)->setText( ent.birthday() ); 1433 (*itLE)->setText( ent.birthday() );
1400 1434
1401 if ( *it == tr( "Anniversary" ) ) 1435 if ( *it == "Anniversary" )
1402 (*itLE)->setText( ent.anniversary() ); 1436 (*itLE)->setText( ent.anniversary() );
1403 1437
1404 if ( *it == tr( "Nickname" ) ) 1438 if ( *it == "Nickname" )
1405 (*itLE)->setText( ent.nickname() ); 1439 (*itLE)->setText( ent.nickname() );
1406 1440
1407 if ( *it == tr( "Children" ) ) 1441 if ( *it == "Children" )
1408 (*itLE)->setText( ent.children() ); 1442 (*itLE)->setText( ent.children() );
1409 1443
1410 } 1444 }
1411 1445
1412 QStringList::Iterator itV; 1446 QStringList::Iterator itV;
1413 for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { 1447 for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) {
1414 1448
1415 if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) 1449 if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) )
1416 *itV = ent.businessPhone(); 1450 *itV = ent.businessPhone();
1417/* 1451/*
1418 if ( *it == "Business 2 Phone" ) 1452 if ( *it == "Business 2 Phone" )
1419 *itV = ent.business2Phone(); 1453 *itV = ent.business2Phone();
1420*/ 1454*/
1421 if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) 1455 if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) )
1422 *itV = ent.businessFax(); 1456 *itV = ent.businessFax();
1423 1457
1424 if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) 1458 if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) )
1425 *itV = ent.businessMobile(); 1459 *itV = ent.businessMobile();
1426/* 1460/*
1427 if ( *it == "Company Phone" ) 1461 if ( *it == "Company Phone" )
1428 *itV = ent.companyPhone(); 1462 *itV = ent.companyPhone();
1429*/ 1463*/
1430 if ( *it == "Default Email" ) 1464 if ( *it == "Default Email" )
1431 *itV = ent.defaultEmail(); 1465 *itV = ent.defaultEmail();
1432 1466
1433 if ( *it == "Emails" ) 1467 if ( *it == "Emails" )
1434 *itV = ent.emailList().join(", "); // :SX 1468 *itV = ent.emailList().join(", "); // :SX
1435 1469
1436 if ( *it == "Home Phone" ) 1470 if ( *it == "Home Phone" )
1437 *itV = ent.homePhone(); 1471 *itV = ent.homePhone();
1438/* 1472/*
1439 if ( *it == "Home 2 Phone" ) 1473 if ( *it == "Home 2 Phone" )
1440 *itV = ent.home2Phone(); 1474 *itV = ent.home2Phone();
1441*/ 1475*/
1442 if ( *it == "Home Fax" ) 1476 if ( *it == "Home Fax" )
1443 *itV = ent.homeFax(); 1477 *itV = ent.homeFax();
1444 1478
1445 if ( *it == "Home Mobile" ) 1479 if ( *it == "Home Mobile" )
1446 *itV = ent.homeMobile(); 1480 *itV = ent.homeMobile();
1447/* 1481/*
1448 if ( *it == "Car Phone" ) 1482 if ( *it == "Car Phone" )
1449 *itV = ent.carPhone(); 1483 *itV = ent.carPhone();
1450 1484
1451 if ( *it == "ISDN Phone" ) 1485 if ( *it == "ISDN Phone" )
1452 *itV = ent.ISDNPhone(); 1486 *itV = ent.ISDNPhone();
1453 1487
1454 if ( *it == "Other Phone" ) 1488 if ( *it == "Other Phone" )
1455 *itV = ent.otherPhone(); 1489 *itV = ent.otherPhone();
1456*/ 1490*/
1457 if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) 1491 if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) )
1458 *itV = ent.businessPager(); 1492 *itV = ent.businessPager();
1459/* 1493/*
1460 if ( *it == "Home Pager") 1494 if ( *it == "Home Pager")
1461 *itV = ent.homePager(); 1495 *itV = ent.homePager();
1462 1496
1463 if ( *it == "AIM IM" ) 1497 if ( *it == "AIM IM" )
1464 *itV = ent.AIMIM(); 1498 *itV = ent.AIMIM();
1465 1499
1466 if ( *it == "ICQ IM" ) 1500 if ( *it == "ICQ IM" )
1467 *itV = ent.ICQIM(); 1501 *itV = ent.ICQIM();
1468 1502
1469 if ( *it == "Jabber IM" ) 1503 if ( *it == "Jabber IM" )
1470 *itV = ent.jabberIM(); 1504 *itV = ent.jabberIM();
1471 1505
1472 if ( *it == "MSN IM" ) 1506 if ( *it == "MSN IM" )
1473 *itV = ent.MSNIM(); 1507 *itV = ent.MSNIM();
1474 1508
1475 if ( *it == "Yahoo IM" ) 1509 if ( *it == "Yahoo IM" )
1476 *itV = ent.yahooIM(); 1510 *itV = ent.yahooIM();
1477*/ 1511*/
1478 if ( *it == "Home Web Page" ) 1512 if ( *it == "Home Web Page" )
1479 *itV = ent.homeWebpage(); 1513 *itV = ent.homeWebpage();
1480 1514
1481 if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) 1515 if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) )
1482 *itV = ent.businessWebpage(); 1516 *itV = ent.businessWebpage();
1483 1517
1484 1518
1485 } 1519 }
1486 1520
1487 cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); 1521 cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") );
1488 1522
1489 QString gender = ent.gender(); 1523 QString gender = ent.gender();
1490 cmbGender->setCurrentItem( gender.toInt() ); 1524 cmbGender->setCurrentItem( gender.toInt() );
1491 1525
1492 txtNote->setText( ent.notes() ); 1526 txtNote->setText( ent.notes() );
1493 1527
1494 slotCmbChooser1Change( cmbChooserField1->currentItem() ); 1528 slotCmbChooser1Change( cmbChooserField1->currentItem() );
1495 slotCmbChooser2Change( cmbChooserField2->currentItem() ); 1529 slotCmbChooser2Change( cmbChooserField2->currentItem() );
1496 slotCmbChooser3Change( cmbChooserField3->currentItem() ); 1530 slotCmbChooser3Change( cmbChooserField3->currentItem() );
1497 1531
1498 slotAddressTypeChange( cmbAddress->currentItem() ); 1532 slotAddressTypeChange( cmbAddress->currentItem() );
1499 1533
1500} 1534}
1501 1535
1502void ContactEditor::saveEntry() { 1536void ContactEditor::saveEntry() {
1503 1537
1504 if ( useFullName == TRUE ) { 1538 if ( useFullName == TRUE ) {
1505 txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); 1539 txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) );
1506 txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); 1540 txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) );
1507 txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); 1541 txtLastName->setText( parseName( txtFullName->text(), NAME_L ) );
1508 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); 1542 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) );
1509 1543
1510 useFullName = FALSE; 1544 useFullName = FALSE;
1511} 1545}
1512 1546
1513 /*if ( ent.firstName() != txtFirstName->text() || 1547 /*if ( ent.firstName() != txtFirstName->text() ||
1514 ent.lastName != txtLastName->text() || 1548 ent.lastName != txtLastName->text() ||
1515 ent.middleName != txtMiddleName->text() ) { 1549 ent.middleName != txtMiddleName->text() ) {
1516 */ 1550 */
1517 ent.setFirstName( txtFirstName->text() ); 1551 ent.setFirstName( txtFirstName->text() );
1518 ent.setLastName( txtLastName->text() ); 1552 ent.setLastName( txtLastName->text() );
1519 ent.setMiddleName( txtMiddleName->text() ); 1553 ent.setMiddleName( txtMiddleName->text() );
1520 ent.setSuffix( txtSuffix->text() ); 1554 ent.setSuffix( txtSuffix->text() );
1521 1555
1522 //} 1556 //}
1523 1557
1524 ent.setFileAs( cmbFileAs->currentText() ); 1558 ent.setFileAs( cmbFileAs->currentText() );
1525 1559
1526 ent.setCategories( cmbCat->currentCategories() ); 1560 ent.setCategories( cmbCat->currentCategories() );
1527 1561
1528 if (hasTitle) 1562 if (hasTitle)
1529 ent.setJobTitle( txtJobTitle->text() ); 1563 ent.setJobTitle( txtJobTitle->text() );
1530 1564
1531 if (hasCompany) 1565 if (hasCompany)
1532 ent.setCompany( txtOrganization->text() ); 1566 ent.setCompany( txtOrganization->text() );
1533 1567
1534 if (hasNotes) 1568 if (hasNotes)
1535 ent.setNotes( txtNote->text() ); 1569 ent.setNotes( txtNote->text() );
1536 1570
1537 if (hasStreet) { 1571 if (hasStreet) {
1538 ent.setHomeStreet( slHomeAddress[0] ); 1572 ent.setHomeStreet( slHomeAddress[0] );
1539 ent.setBusinessStreet( slBusinessAddress[0] ); 1573 ent.setBusinessStreet( slBusinessAddress[0] );
1540 } 1574 }
1541/* 1575/*
1542 if (hasStreet2) { 1576 if (hasStreet2) {
1543 ent.setHomeStreet2( (*slHomeAddress)[1] ); 1577 ent.setHomeStreet2( (*slHomeAddress)[1] );
1544 ent.setBusinessStreet2( (*slBusinessAddress)[1] ); 1578 ent.setBusinessStreet2( (*slBusinessAddress)[1] );
1545 } 1579 }
1546 1580
1547 if (hasPOBox) { 1581 if (hasPOBox) {
1548 ent.setHomePOBox( (*slHomeAddress)[2] ); 1582 ent.setHomePOBox( (*slHomeAddress)[2] );
1549 ent.setBusinessPOBox( (*slBusinessAddress)[2] ); 1583 ent.setBusinessPOBox( (*slBusinessAddress)[2] );
1550 } 1584 }
1551*/ 1585*/
1552 if (hasCity) { 1586 if (hasCity) {
1553 ent.setHomeCity( slHomeAddress[3] ); 1587 ent.setHomeCity( slHomeAddress[3] );
1554 ent.setBusinessCity( slBusinessAddress[3] ); 1588 ent.setBusinessCity( slBusinessAddress[3] );
1555 } 1589 }
1556 1590
1557 if (hasState) { 1591 if (hasState) {
1558 ent.setHomeState( slHomeAddress[4] ); 1592 ent.setHomeState( slHomeAddress[4] );
1559 ent.setBusinessState( slBusinessAddress[4] ); 1593 ent.setBusinessState( slBusinessAddress[4] );
1560 } 1594 }
1561 1595
1562 if (hasZip) { 1596 if (hasZip) {
1563 ent.setHomeZip( slHomeAddress[5] ); 1597 ent.setHomeZip( slHomeAddress[5] );
1564 ent.setBusinessZip( slBusinessAddress[5] ); 1598 ent.setBusinessZip( slBusinessAddress[5] );
1565 } 1599 }
1566 1600
1567 if (hasCountry) { 1601 if (hasCountry) {
1568 ent.setHomeCountry( slHomeAddress[6] ); 1602 ent.setHomeCountry( slHomeAddress[6] );
1569 ent.setBusinessCountry( slBusinessAddress[6] ); 1603 ent.setBusinessCountry( slBusinessAddress[6] );
1570 } 1604 }
1571 1605
1572 QStringList::ConstIterator it; 1606 QStringList::ConstIterator it;
1573 QListIterator<QLineEdit> itLE( listValue ); 1607 QListIterator<QLineEdit> itLE( listValue );
1574 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { 1608 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) {
1575 if ( *it == tr( "Department" ) ) 1609 if ( *it == "Department" )
1576 ent.setDepartment( (*itLE)->text() ); 1610 ent.setDepartment( (*itLE)->text() );
1577 1611
1578 if ( *it == tr( "Company" ) ) 1612 if ( *it == "Company" )
1579 ent.setCompany( (*itLE)->text() ); 1613 ent.setCompany( (*itLE)->text() );
1580 1614
1581 if ( *it == tr( "Office" ) ) 1615 if ( *it == "Office" )
1582 ent.setOffice( (*itLE)->text() ); 1616 ent.setOffice( (*itLE)->text() );
1583 1617
1584 if ( *it == tr( "Profession" ) ) 1618 if ( *it == "Profession" )
1585 ent.setProfession( (*itLE)->text() ); 1619 ent.setProfession( (*itLE)->text() );
1586 1620
1587 if ( *it == tr( "Assistant" ) ) 1621 if ( *it == "Assistant" )
1588 ent.setAssistant( (*itLE)->text() ); 1622 ent.setAssistant( (*itLE)->text() );
1589 1623
1590 if ( *it == tr( "Manager" ) ) 1624 if ( *it == "Manager" )
1591 ent.setManager( (*itLE)->text() ); 1625 ent.setManager( (*itLE)->text() );
1592 1626
1593 if ( *it == tr( "Spouse" ) ) 1627 if ( *it == "Spouse" )
1594 ent.setSpouse( (*itLE)->text() ); 1628 ent.setSpouse( (*itLE)->text() );
1595 1629
1596 if ( *it == tr( "Birthday" ) ) 1630 if ( *it == "Birthday" )
1597 ent.setBirthday( (*itLE)->text() ); 1631 ent.setBirthday( (*itLE)->text() );
1598 1632
1599 if ( *it == tr( "Anniversary" ) ) 1633 if ( *it == "Anniversary" )
1600 ent.setAnniversary( (*itLE)->text() ); 1634 ent.setAnniversary( (*itLE)->text() );
1601 1635
1602 if ( *it == tr( "Nickname" ) ) 1636 if ( *it == "Nickname" )
1603 ent.setNickname( (*itLE)->text() ); 1637 ent.setNickname( (*itLE)->text() );
1604 1638
1605 if ( *it == tr( "Children" ) ) 1639 if ( *it == "Children" )
1606 ent.setChildren( (*itLE)->text() ); 1640 ent.setChildren( (*itLE)->text() );
1607 1641
1608 } 1642 }
1609 1643
1610 QStringList::ConstIterator itV; 1644 QStringList::ConstIterator itV;
1611 for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { 1645 for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) {
1612 1646
1613 if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) 1647 if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) )
1614 ent.setBusinessPhone( *itV ); 1648 ent.setBusinessPhone( *itV );
1615/* 1649/*
1616 if ( *it == tr("Business 2 Phone" ) 1650 if ( *it == tr("Business 2 Phone" )
1617 ent.setBusiness2Phone( *itV ); 1651 ent.setBusiness2Phone( *itV );
1618*/ 1652*/
1619 if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) 1653 if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) )
1620 ent.setBusinessFax( *itV ); 1654 ent.setBusinessFax( *itV );
1621 1655
1622 if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) 1656 if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) )
1623 ent.setBusinessMobile( *itV ); 1657 ent.setBusinessMobile( *itV );
1624/* 1658/*
1625 if ( *it == "Company Phone" ) 1659 if ( *it == "Company Phone" )
1626 ent.setCompanyPhone( *itV ); 1660 ent.setCompanyPhone( *itV );
1627*/ 1661*/
1628 //if ( *it == "Default Email" ) 1662 //if ( *it == "Default Email" )
1629 //ent.setDefaultEmail( *itV ); 1663 //ent.setDefaultEmail( *itV );
1630 1664
1631 if ( *it == "Emails" ){ 1665 if ( *it == "Emails" ){
1632 QString allemail; 1666 QString allemail;
1633 QString defaultmail; 1667 QString defaultmail;
1634 parseEmailFrom( *itV, defaultmail, allemail ); 1668 parseEmailFrom( *itV, defaultmail, allemail );
1635 // ent.clearEmails(); 1669 // ent.clearEmails();
1636 ent.setDefaultEmail( defaultmail ); 1670 ent.setDefaultEmail( defaultmail );
1637 ent.setEmails( allemail ); 1671 ent.setEmails( allemail );
1638 } 1672 }
1639 1673
1640 if ( *it == "Home Phone" ) 1674 if ( *it == "Home Phone" )
1641 ent.setHomePhone( *itV ); 1675 ent.setHomePhone( *itV );
1642/* 1676/*
1643 if ( *it == "Home 2 Phone" ) 1677 if ( *it == "Home 2 Phone" )
1644 ent.setHome2Phone( *itV ); 1678 ent.setHome2Phone( *itV );
1645*/ 1679*/
1646 if ( *it == "Home Fax" ) 1680 if ( *it == "Home Fax" )
1647 ent.setHomeFax( *itV ); 1681 ent.setHomeFax( *itV );
1648 1682
1649 if ( *it == "Home Mobile" ) 1683 if ( *it == "Home Mobile" )
1650 ent.setHomeMobile( *itV ); 1684 ent.setHomeMobile( *itV );
1651/* 1685/*
1652 if ( *it == "Car Phone" ) 1686 if ( *it == "Car Phone" )
1653 ent.setCarPhone( *itV ); 1687 ent.setCarPhone( *itV );
1654 1688
1655 if ( *it == "ISDN Phone" ) 1689 if ( *it == "ISDN Phone" )
1656 ent.setISDNPhone( *itV ); 1690 ent.setISDNPhone( *itV );
1657 1691
1658 if ( *it == "Other Phone" ) 1692 if ( *it == "Other Phone" )
1659 ent.setOtherPhone( *itV ); 1693 ent.setOtherPhone( *itV );
1660*/ 1694*/
1661 if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) 1695 if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) )
1662 ent.setBusinessPager( *itV ); 1696 ent.setBusinessPager( *itV );
1663/* 1697/*
1664 if ( *it == "Home Pager" ) 1698 if ( *it == "Home Pager" )
1665 ent.setHomePager( *itV ); 1699 ent.setHomePager( *itV );
1666 1700
1667 if ( *it == "AIM IM" ) 1701 if ( *it == "AIM IM" )
1668 ent.setAIMIM( *itV ); 1702 ent.setAIMIM( *itV );
1669 1703
1670 if ( *it == "ICQ IM" ) 1704 if ( *it == "ICQ IM" )
1671 ent.setICQIM( *itV ); 1705 ent.setICQIM( *itV );
1672 1706
1673 if ( *it == "Jabber IM" ) 1707 if ( *it == "Jabber IM" )
1674 ent.setJabberIM( *itV ); 1708 ent.setJabberIM( *itV );
1675 1709
1676 if ( *it == "MSN IM" ) 1710 if ( *it == "MSN IM" )
1677 ent.setMSNIM( *itV ); 1711 ent.setMSNIM( *itV );
1678 1712
1679 if ( *it == "Yahoo IM" ) 1713 if ( *it == "Yahoo IM" )
1680 ent.setYahooIM( *itV ); 1714 ent.setYahooIM( *itV );
1681*/ 1715*/
1682 if ( *it == "Home Web Page" ) 1716 if ( *it == "Home Web Page" )
1683 ent.setHomeWebpage( *itV ); 1717 ent.setHomeWebpage( *itV );
1684 1718
1685 if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) 1719 if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) )
1686 ent.setBusinessWebpage( *itV ); 1720 ent.setBusinessWebpage( *itV );
1687 1721
1688 1722
1689 } 1723 }
1690 1724
1691 int gender = cmbGender->currentItem(); 1725 int gender = cmbGender->currentItem();
1692 ent.setGender( QString::number( gender ) ); 1726 ent.setGender( QString::number( gender ) );
1693 1727
1694 QString str = txtNote->text(); 1728 QString str = txtNote->text();
1695 if ( !str.isNull() ) 1729 if ( !str.isNull() )
1696 ent.setNotes( str ); 1730 ent.setNotes( str );
1697 1731
1698} 1732}
1699 1733
1700void parseEmailFrom( const QString &txt, QString &strDefaultEmail, 1734void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
1701 QString &strAll ) 1735 QString &strAll )
1702{ 1736{
1703 int where, 1737 int where,
1704 start; 1738 start;
1705 if ( txt.isEmpty() ) 1739 if ( txt.isEmpty() )
1706 return; 1740 return;
1707 // find the first 1741 // find the first
1708 where = txt.find( ',' ); 1742 where = txt.find( ',' );
1709 if ( where < 0 ) { 1743 if ( where < 0 ) {
1710 strDefaultEmail = txt; 1744 strDefaultEmail = txt;
1711 strAll = txt; 1745 strAll = txt;
1712 } else { 1746 } else {
1713 strDefaultEmail = txt.left( where ).stripWhiteSpace(); 1747 strDefaultEmail = txt.left( where ).stripWhiteSpace();
1714 strAll = strDefaultEmail; 1748 strAll = strDefaultEmail;
1715 while ( where > -1 ) { 1749 while ( where > -1 ) {
1716 strAll.append(" "); 1750 strAll.append(" ");
1717 start = where; 1751 start = where;
1718 where = txt.find( ',', where + 1 ); 1752 where = txt.find( ',', where + 1 );
1719 if ( where > - 1 ) 1753 if ( where > - 1 )
1720 strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); 1754 strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() );
1721 else // grab until the end... 1755 else // grab until the end...
1722 strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); 1756 strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() );
1723 } 1757 }
1724 } 1758 }
1725} 1759}
1726 1760
1727void parseEmailTo( const QString &strDefaultEmail, 1761void parseEmailTo( const QString &strDefaultEmail,
1728 const QString &strOtherEmail, QString &strBack ) 1762 const QString &strOtherEmail, QString &strBack )
1729{ 1763{
1730 // create a comma dilimeted set of emails... 1764 // create a comma dilimeted set of emails...
1731 // use the power of short circuiting... 1765 // use the power of short circuiting...
1732 bool foundDefault = false; 1766 bool foundDefault = false;
1733 QString strTmp; 1767 QString strTmp;
1734 int start = 0; 1768 int start = 0;
1735 int where; 1769 int where;
1736 // start at the beginng. 1770 // start at the beginng.
1737 strBack = strDefaultEmail; 1771 strBack = strDefaultEmail;
1738 where = 0; 1772 where = 0;
1739 while ( where > -1 ) { 1773 while ( where > -1 ) {
1740 start = where; 1774 start = where;
1741 where = strOtherEmail.find( ' ', where + 1 ); 1775 where = strOtherEmail.find( ' ', where + 1 );
1742 if ( where > 0 ) { 1776 if ( where > 0 ) {
1743 strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); 1777 strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace();
1744 } else 1778 } else
1745 strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); 1779 strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace();
1746 if ( foundDefault || strTmp != strDefaultEmail ) { 1780 if ( foundDefault || strTmp != strDefaultEmail ) {
1747 strBack.append( ", " ); 1781 strBack.append( ", " );
1748 strBack.append( strTmp ); 1782 strBack.append( strTmp );
1749 } else 1783 } else
1750 foundDefault = true; 1784 foundDefault = true;
1751 } 1785 }
1752} 1786}
1753 1787
1754 1788
1755static inline bool containsAlphaNum( const QString &str ) 1789static inline bool containsAlphaNum( const QString &str )
1756{ 1790{
1757 int i, 1791 int i,
1758 count = str.length(); 1792 count = str.length();
1759 for ( i = 0; i < count; i++ ) 1793 for ( i = 0; i < count; i++ )
1760 if ( !str[i].isSpace() ) 1794 if ( !str[i].isSpace() )
1761 return TRUE; 1795 return TRUE;
1762 return FALSE; 1796 return FALSE;
1763} 1797}
1764 1798
1765static inline bool constainsWhiteSpace( const QString &str ) 1799static inline bool constainsWhiteSpace( const QString &str )
1766{ 1800{
1767 int i, 1801 int i,
1768 count = str.length(); 1802 count = str.length();
1769 for (i = 0; i < count; i++ ) 1803 for (i = 0; i < count; i++ )
1770 if ( str[i].isSpace() ) 1804 if ( str[i].isSpace() )
1771 return TRUE; 1805 return TRUE;
1772 return FALSE; 1806 return FALSE;
1773} 1807}
1774 1808