summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 7682399..0b65a10 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1,1297 +1,1298 @@
1/* 1/*
2 * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> 2 * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org>
3 * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) 3 * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de)
4 * 4 *
5 * This file is an add-on for the OPIE Palmtop Environment 5 * This file is an add-on for the OPIE Palmtop Environment
6 * 6 *
7 * This file may be distributed and/or modified under the terms of the 7 * This file may be distributed and/or modified under the terms of the
8 * GNU General Public License version 2 as published by the Free Software 8 * GNU General Public License version 2 as published by the Free Software
9 * Foundation and appearing in the file LICENSE.GPL included in the pacakaging 9 * Foundation and appearing in the file LICENSE.GPL included in the pacakaging
10 * of this file. 10 * of this file.
11 * 11 *
12 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 * 14 *
15 * 15 *
16 * This is a rewrite of the abeditor.h file, modified to provide a more 16 * This is a rewrite of the abeditor.h file, modified to provide a more
17 * intuitive interface to TrollTech's original Address Book editor. This 17 * intuitive interface to TrollTech's original Address Book editor. This
18 * is made to operate exactly in interface with the exception of name. 18 * is made to operate exactly in interface with the exception of name.
19 * 19 *
20 */ 20 */
21 21
22#include "contacteditor.h" 22#include "contacteditor.h"
23#include "addresspicker.h" 23#include "addresspicker.h"
24#include "ocontactfields.h" 24#include "ocontactfields.h"
25 25
26#include <qpe/categoryselect.h> 26#include <qpe/categoryselect.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qpe/qpedialog.h> 28#include <qpe/qpedialog.h>
29#include <qpe/timeconversion.h> 29#include <qpe/timeconversion.h>
30#include <opie/ocontact.h> 30#include <opie/ocontact.h>
31#include <qpe/resource.h> 31#include <qpe/resource.h>
32 32
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qlabel.h> 34#include <qlabel.h>
35#include <qtabwidget.h> 35#include <qtabwidget.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qlineedit.h> 37#include <qlineedit.h>
38#include <qmultilineedit.h> 38#include <qmultilineedit.h>
39#include <qscrollview.h> 39#include <qscrollview.h>
40#include <qtoolbutton.h> 40#include <qtoolbutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qmainwindow.h> 42#include <qmainwindow.h>
43#include <qvaluelist.h> 43#include <qvaluelist.h>
44#include <qpopupmenu.h> 44#include <qpopupmenu.h>
45#include <qlistbox.h> 45#include <qlistbox.h>
46#include <qhbox.h> 46#include <qhbox.h>
47#include <qaction.h> 47#include <qaction.h>
48#include <qiconset.h> 48#include <qiconset.h>
49#include <qmessagebox.h> 49#include <qmessagebox.h>
50 50
51#include <assert.h> 51#include <assert.h>
52 52
53static inline bool containsAlphaNum( const QString &str ); 53static inline bool containsAlphaNum( const QString &str );
54static inline bool constainsWhiteSpace( const QString &str ); 54static inline bool constainsWhiteSpace( const QString &str );
55 55
56// helper functions, convert our comma delimited list to proper 56// helper functions, convert our comma delimited list to proper
57// file format... 57// file format...
58void parseEmailFrom( const QString &txt, QString &strDefaultEmail, 58void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
59 QString &strAll ); 59 QString &strAll );
60 60
61// helper convert from file format to comma delimited... 61// helper convert from file format to comma delimited...
62void parseEmailTo( const QString &strDefaultEmail, 62void parseEmailTo( const QString &strDefaultEmail,
63 const QString &strOtherEmail, QString &strBack ); 63 const QString &strOtherEmail, QString &strBack );
64 64
65 ContactEditor::ContactEditor(const OContact &entry, 65 ContactEditor::ContactEditor(const OContact &entry,
66 QWidget *parent, 66 QWidget *parent,
67 const char *name, 67 const char *name,
68 WFlags fl ) 68 WFlags fl )
69 : QDialog( parent, name, TRUE, fl ), 69 : QDialog( parent, name, TRUE, fl ),
70 defaultEmailChooserPosition( -1 ), 70 defaultEmailChooserPosition( -1 ),
71 m_personalView ( false ), 71 m_personalView ( false ),
72 cmbDefaultEmail( 0 ), 72 cmbDefaultEmail( 0 ),
73 initializing ( false ) 73 initializing ( false )
74{ 74{
75 75
76 initializing = true; 76 initializing = true;
77 77
78 init(); 78 init();
79 setEntry( entry ); 79 setEntry( entry );
80 // cmbDefaultEmail = 0; 80 // cmbDefaultEmail = 0;
81 // defaultEmailChooserPosition = -1; 81 // defaultEmailChooserPosition = -1;
82 82
83 initializing = false; 83 initializing = false;
84} 84}
85 85
86ContactEditor::~ContactEditor() { 86ContactEditor::~ContactEditor() {
87} 87}
88 88
89void ContactEditor::init() { 89void ContactEditor::init() {
90 qWarning("init() START"); 90 qWarning("init() START");
91 91
92 uint i = 0; 92 uint i = 0;
93 93
94 QStringList trlChooserNames; 94 QStringList trlChooserNames;
95 95
96 for (i = 0; i <= 6; i++) { 96 for (i = 0; i <= 6; i++) {
97 slHomeAddress.append( "" ); 97 slHomeAddress.append( "" );
98 slBusinessAddress.append( "" ); 98 slBusinessAddress.append( "" );
99 } 99 }
100 100
101 trlChooserNames = OContactFields::trphonefields( false ); 101 trlChooserNames = OContactFields::trphonefields( false );
102 slChooserNames = OContactFields::untrphonefields( false ); 102 slChooserNames = OContactFields::untrphonefields( false );
103 slDynamicEntries = OContactFields::untrdetailsfields( false ); 103 slDynamicEntries = OContactFields::untrdetailsfields( false );
104 trlDynamicEntries = OContactFields::trdetailsfields( false ); 104 trlDynamicEntries = OContactFields::trdetailsfields( false );
105 105
106 // Ok, we have to remove elements from the list of dynamic entries 106 // Ok, we have to remove elements from the list of dynamic entries
107 // which are now stored in special (not dynamic) widgets.. 107 // which are now stored in special (not dynamic) widgets..
108 // Otherwise we will get problems with field assignments! (se) 108 // Otherwise we will get problems with field assignments! (se)
109 slDynamicEntries.remove("Anniversary"); 109 slDynamicEntries.remove("Anniversary");
110 slDynamicEntries.remove("Birthday"); 110 slDynamicEntries.remove("Birthday");
111 slDynamicEntries.remove("Gender"); 111 slDynamicEntries.remove("Gender");
112 112
113 // The same with translated fields.. But I will 113 // The same with translated fields.. But I will
114 // use the translation map to avoid mismatches.. 114 // use the translation map to avoid mismatches..
115 QMap<int, QString> translMap = OContactFields::idToTrFields(); 115 QMap<int, QString> translMap = OContactFields::idToTrFields();
116 trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); 116 trlDynamicEntries.remove( translMap[Qtopia::Anniversary] );
117 trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); 117 trlDynamicEntries.remove( translMap[Qtopia::Birthday] );
118 trlDynamicEntries.remove( translMap[Qtopia::Gender] ); 118 trlDynamicEntries.remove( translMap[Qtopia::Gender] );
119 119
120 // Last Check to be sure.. 120 // Last Check to be sure..
121 assert( slDynamicEntries.count() == trlDynamicEntries.count() ); 121 assert( slDynamicEntries.count() == trlDynamicEntries.count() );
122 assert( slChooserNames.count() == trlChooserNames.count() ); 122 assert( slChooserNames.count() == trlChooserNames.count() );
123 123
124 for (i = 0; i < slChooserNames.count(); i++) 124 for (i = 0; i < slChooserNames.count(); i++)
125 slChooserValues.append(""); 125 slChooserValues.append("");
126 126
127 127
128 QVBoxLayout *vb = new QVBoxLayout( this ); 128 QVBoxLayout *vb = new QVBoxLayout( this );
129 129
130 tabMain = new QTabWidget( this ); 130 tabMain = new QTabWidget( this );
131 vb->addWidget( tabMain ); 131 vb->addWidget( tabMain );
132 132
133 QWidget *tabViewport = new QWidget ( tabMain ); 133 QWidget *tabViewport = new QWidget ( tabMain );
134 134
135 vb = new QVBoxLayout( tabViewport ); 135 vb = new QVBoxLayout( tabViewport );
136 136
137 svGeneral = new QScrollView( tabViewport ); 137 svGeneral = new QScrollView( tabViewport );
138 vb->addWidget( svGeneral, 0, 0 ); 138 vb->addWidget( svGeneral, 0, 0 );
139 svGeneral->setResizePolicy( QScrollView::AutoOneFit ); 139 svGeneral->setResizePolicy( QScrollView::AutoOneFit );
140 // svGeneral->setHScrollBarMode( QScrollView::AlwaysOff );
141 // svGeneral->setVScrollBarMode( QScrollView::AlwaysOff );
140 svGeneral->setFrameStyle( QFrame::NoFrame ); 142 svGeneral->setFrameStyle( QFrame::NoFrame );
141 143
142 QWidget *container = new QWidget( svGeneral->viewport() ); 144 QWidget *container = new QWidget( svGeneral->viewport() );
143 svGeneral->addChild( container ); 145 svGeneral->addChild( container );
144 146
145 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); 147 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 );
146 gl->setResizeMode( QLayout::FreeResize ); 148 gl->setResizeMode( QLayout::FreeResize );
147 149
148 btnFullName = new QPushButton( tr( "Full Name..." ), container ); 150 btnFullName = new QPushButton( tr( "Full Name..." ), container );
149 gl->addWidget( btnFullName, 0, 0 ); 151 gl->addWidget( btnFullName, 0, 0 );
150 txtFullName = new QLineEdit( container ); 152 txtFullName = new QLineEdit( container );
151 gl->addWidget( txtFullName, 0, 1 ); 153 gl->addWidget( txtFullName, 0, 1 );
152 154
153 QLabel *l = new QLabel( tr( "Job Title" ), container ); 155 QLabel *l = new QLabel( tr( "Job Title" ), container );
154 gl->addWidget( l, 1, 0 ); 156 gl->addWidget( l, 1, 0 );
155 txtJobTitle = new QLineEdit( container ); 157 txtJobTitle = new QLineEdit( container );
156 gl->addWidget( txtJobTitle, 1, 1 ); 158 gl->addWidget( txtJobTitle, 1, 1 );
157 159
158 l = new QLabel( tr("Suffix"), container ); 160 l = new QLabel( tr("Suffix"), container );
159 gl->addWidget( l, 2, 0 ); 161 gl->addWidget( l, 2, 0 );
160 txtSuffix = new QLineEdit( container ); 162 txtSuffix = new QLineEdit( container );
161 gl->addWidget( txtSuffix, 2, 1 ); 163 gl->addWidget( txtSuffix, 2, 1 );
162 164
163 l = new QLabel( tr( "Organization" ), container ); 165 l = new QLabel( tr( "Organization" ), container );
164 gl->addWidget( l, 3, 0 ); 166 gl->addWidget( l, 3, 0 );
165 txtOrganization = new QLineEdit( container ); 167 txtOrganization = new QLineEdit( container );
166 gl->addWidget( txtOrganization, 3, 1 ); 168 gl->addWidget( txtOrganization, 3, 1 );
167 169
168 // Chooser 1 170 // Chooser 1
169 cmbChooserField1 = new QComboBox( FALSE, container ); 171 cmbChooserField1 = new QComboBox( FALSE, container );
170 cmbChooserField1->setMaximumWidth( 90 ); 172 cmbChooserField1->setMaximumWidth( 90 );
171 gl->addWidget( cmbChooserField1, 4, 0 ); 173 gl->addWidget( cmbChooserField1, 4, 0 );
172 // Textfield for chooser 1. 174 // Textfield for chooser 1.
173 // Now use Widgetstack to contain the textfield and the default-email combo ! 175 // Now use Widgetstack to contain the textfield and the default-email combo !
174 m_widgetStack1 = new QWidgetStack( container ); 176 m_widgetStack1 = new QWidgetStack( container );
175 txtChooserField1 = new QLineEdit( m_widgetStack1 ); 177 txtChooserField1 = new QLineEdit( m_widgetStack1 );
176 m_widgetStack1 -> addWidget( txtChooserField1, TextField ); 178 m_widgetStack1 -> addWidget( txtChooserField1, TextField );
177 gl->addWidget( m_widgetStack1, 4, 1 ); 179 gl->addWidget( m_widgetStack1, 4, 1 );
178 m_widgetStack1 -> raiseWidget( TextField ); 180 m_widgetStack1 -> raiseWidget( TextField );
179 181
180 // Chooser 2 182 // Chooser 2
181 cmbChooserField2 = new QComboBox( FALSE, container ); 183 cmbChooserField2 = new QComboBox( FALSE, container );
182 cmbChooserField2->setMaximumWidth( 90 ); 184 cmbChooserField2->setMaximumWidth( 90 );
183 gl->addWidget( cmbChooserField2, 5, 0 ); 185 gl->addWidget( cmbChooserField2, 5, 0 );
184 // Textfield for chooser 2 186 // Textfield for chooser 2
185 // Now use WidgetStack to contain the textfield and the default-email combo! 187 // Now use WidgetStack to contain the textfield and the default-email combo!
186 m_widgetStack2 = new QWidgetStack( container ); 188 m_widgetStack2 = new QWidgetStack( container );
187 txtChooserField2 = new QLineEdit( m_widgetStack2 ); 189 txtChooserField2 = new QLineEdit( m_widgetStack2 );
188 m_widgetStack2 -> addWidget( txtChooserField2, TextField ); 190 m_widgetStack2 -> addWidget( txtChooserField2, TextField );
189 gl->addWidget( m_widgetStack2, 5, 1 ); 191 gl->addWidget( m_widgetStack2, 5, 1 );
190 m_widgetStack2 -> raiseWidget( TextField ); 192 m_widgetStack2 -> raiseWidget( TextField );
191 193
192 // Chooser 3 194 // Chooser 3
193 cmbChooserField3 = new QComboBox( FALSE, container ); 195 cmbChooserField3 = new QComboBox( FALSE, container );
194 cmbChooserField3->setMaximumWidth( 90 ); 196 cmbChooserField3->setMaximumWidth( 90 );
195 gl->addWidget( cmbChooserField3, 6, 0 ); 197 gl->addWidget( cmbChooserField3, 6, 0 );
196 // Textfield for chooser 2 198 // Textfield for chooser 2
197 // Now use WidgetStack to contain the textfield and the default-email combo! 199 // Now use WidgetStack to contain the textfield and the default-email combo!
198 m_widgetStack3 = new QWidgetStack( container ); 200 m_widgetStack3 = new QWidgetStack( container );
199 txtChooserField3 = new QLineEdit( m_widgetStack3 ); 201 txtChooserField3 = new QLineEdit( m_widgetStack3 );
200 m_widgetStack3 -> addWidget( txtChooserField3, TextField ); 202 m_widgetStack3 -> addWidget( txtChooserField3, TextField );
201 gl->addWidget( m_widgetStack3, 6, 1 ); 203 gl->addWidget( m_widgetStack3, 6, 1 );
202 m_widgetStack3 -> raiseWidget( TextField ); 204 m_widgetStack3 -> raiseWidget( TextField );
203 205
204 l = new QLabel( tr( "File As" ), container ); 206 l = new QLabel( tr( "File As" ), container );
205 gl->addWidget( l, 7, 0 ); 207 gl->addWidget( l, 7, 0 );
206 cmbFileAs = new QComboBox( TRUE, container ); 208 cmbFileAs = new QComboBox( TRUE, container );
207 gl->addWidget( cmbFileAs, 7, 1 ); 209 gl->addWidget( cmbFileAs, 7, 1 );
208 210
209 labCat = new QLabel( tr( "Category" ), container ); 211 labCat = new QLabel( tr( "Category" ), container );
210 gl->addWidget( labCat, 8, 0 ); 212 gl->addWidget( labCat, 8, 0 );
211 cmbCat = new CategorySelect( container ); 213 cmbCat = new CategorySelect( container );
212 gl->addWidget( cmbCat, 8, 1 ); 214 gl->addWidget( cmbCat, 8, 1 );
213 labCat->show(); 215 labCat->show();
214 cmbCat->show(); 216 cmbCat->show();
215 217
216 btnNote = new QPushButton( tr( "Notes..." ), container ); 218 btnNote = new QPushButton( tr( "Notes..." ), container );
217 gl->addWidget( btnNote, 9, 1 ); 219 gl->addWidget( btnNote, 9, 1 );
218 220
219 tabMain->insertTab( tabViewport, tr( "General" ) ); 221 tabMain->insertTab( tabViewport, tr( "General" ) );
220 222
221 tabViewport = new QWidget ( tabMain ); 223 tabViewport = new QWidget ( tabMain );
222 224
223 vb = new QVBoxLayout( tabViewport ); 225 vb = new QVBoxLayout( tabViewport );
224 226
225 svAddress = new QScrollView( tabViewport ); 227 svAddress = new QScrollView( tabViewport );
226 vb->addWidget( svAddress, 0, 0 ); 228 vb->addWidget( svAddress, 0, 0 );
227 svAddress->setResizePolicy( QScrollView::AutoOneFit ); 229 svAddress->setResizePolicy( QScrollView::AutoOneFit );
228 svAddress->setFrameStyle( QFrame::NoFrame ); 230 svAddress->setFrameStyle( QFrame::NoFrame );
229 231
230 container = new QWidget( svAddress->viewport() ); 232 container = new QWidget( svAddress->viewport() );
231 svAddress->addChild( container ); 233 svAddress->addChild( container );
232 234
233 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem 235 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem
234 236
235 cmbAddress = new QComboBox( FALSE, container ); 237 cmbAddress = new QComboBox( FALSE, container );
236 cmbAddress->insertItem( tr( "Business" ) ); 238 cmbAddress->insertItem( tr( "Business" ) );
237 cmbAddress->insertItem( tr( "Home" ) ); 239 cmbAddress->insertItem( tr( "Home" ) );
238 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); 240 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 );
239 241
240 l = new QLabel( tr( "Address" ), container ); 242 l = new QLabel( tr( "Address" ), container );
241 gl->addWidget( l, 1, 0 ); 243 gl->addWidget( l, 1, 0 );
242 txtAddress = new QLineEdit( container ); 244 txtAddress = new QLineEdit( container );
243 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); 245 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 );
244 246
245 l = new QLabel( tr( "City" ), container ); 247 l = new QLabel( tr( "City" ), container );
246 gl->addWidget( l, 2, 0 ); 248 gl->addWidget( l, 2, 0 );
247 txtCity = new QLineEdit( container ); 249 txtCity = new QLineEdit( container );
248 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); 250 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 );
249 251
250 l = new QLabel( tr( "State" ), container ); 252 l = new QLabel( tr( "State" ), container );
251 gl->addWidget( l, 3, 0 ); 253 gl->addWidget( l, 3, 0 );
252 txtState = new QLineEdit( container ); 254 txtState = new QLineEdit( container );
253 gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); 255 gl->addMultiCellWidget( txtState, 3, 3, 1, 2 );
254 256
255 l = new QLabel( tr( "Zip Code" ), container ); 257 l = new QLabel( tr( "Zip Code" ), container );
256 gl->addWidget( l, 4, 0 ); 258 gl->addWidget( l, 4, 0 );
257 txtZip = new QLineEdit( container ); 259 txtZip = new QLineEdit( container );
258 gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); 260 gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 );
259 261
260 l = new QLabel( tr( "Country" ), container ); 262 l = new QLabel( tr( "Country" ), container );
261 gl->addWidget( l, 5, 0 ); 263 gl->addWidget( l, 5, 0 );
262 cmbCountry = new QComboBox( TRUE, container ); 264 cmbCountry = new QComboBox( TRUE, container );
263 cmbCountry->insertItem( tr( "" ) ); 265 cmbCountry->insertItem( tr( "" ) );
264 cmbCountry->insertItem( tr ( "United States" ) ); 266 cmbCountry->insertItem( tr ( "United States" ) );
265 cmbCountry->insertItem( tr ( "United Kingdom" ) ); 267 cmbCountry->insertItem( tr ( "United Kingdom" ) );
266 cmbCountry->insertItem( tr ( "Afghanistan" ) ); 268 cmbCountry->insertItem( tr ( "Afghanistan" ) );
267 cmbCountry->insertItem( tr ( "Albania" ) ); 269 cmbCountry->insertItem( tr ( "Albania" ) );
268 cmbCountry->insertItem( tr ( "Algeria" ) ); 270 cmbCountry->insertItem( tr ( "Algeria" ) );
269 cmbCountry->insertItem( tr ( "American Samoa" ) ); 271 cmbCountry->insertItem( tr ( "American Samoa" ) );
270 cmbCountry->insertItem( tr ( "Andorra" ) ); 272 cmbCountry->insertItem( tr ( "Andorra" ) );
271 cmbCountry->insertItem( tr ( "Angola" ) ); 273 cmbCountry->insertItem( tr ( "Angola" ) );
272 cmbCountry->insertItem( tr ( "Anguilla" ) ); 274 cmbCountry->insertItem( tr ( "Anguilla" ) );
273 cmbCountry->insertItem( tr ( "Antarctica" ) ); 275 cmbCountry->insertItem( tr ( "Antarctica" ) );
274 cmbCountry->insertItem( tr ( "Argentina" ) ); 276 cmbCountry->insertItem( tr ( "Argentina" ) );
275 cmbCountry->insertItem( tr ( "Armenia" ) ); 277 cmbCountry->insertItem( tr ( "Armenia" ) );
276 cmbCountry->insertItem( tr ( "Aruba" ) ); 278 cmbCountry->insertItem( tr ( "Aruba" ) );
277 cmbCountry->insertItem( tr ( "Australia" ) ); 279 cmbCountry->insertItem( tr ( "Australia" ) );
278 cmbCountry->insertItem( tr ( "Austria" ) ); 280 cmbCountry->insertItem( tr ( "Austria" ) );
279 cmbCountry->insertItem( tr ( "Azerbaijan" ) ); 281 cmbCountry->insertItem( tr ( "Azerbaijan" ) );
280 cmbCountry->insertItem( tr ( "Bahamas" ) ); 282 cmbCountry->insertItem( tr ( "Bahamas" ) );
281 cmbCountry->insertItem( tr ( "Bahrain" ) ); 283 cmbCountry->insertItem( tr ( "Bahrain" ) );
282 cmbCountry->insertItem( tr ( "Bangladesh" ) ); 284 cmbCountry->insertItem( tr ( "Bangladesh" ) );
283 cmbCountry->insertItem( tr ( "Barbados" ) ); 285 cmbCountry->insertItem( tr ( "Barbados" ) );
284 cmbCountry->insertItem( tr ( "Belarus" ) ); 286 cmbCountry->insertItem( tr ( "Belarus" ) );
285 cmbCountry->insertItem( tr ( "Belgium" ) ); 287 cmbCountry->insertItem( tr ( "Belgium" ) );
286 cmbCountry->insertItem( tr ( "Belize" ) ); 288 cmbCountry->insertItem( tr ( "Belize" ) );
287 cmbCountry->insertItem( tr ( "Benin" ) ); 289 cmbCountry->insertItem( tr ( "Benin" ) );
288 cmbCountry->insertItem( tr ( "Bermuda" ) ); 290 cmbCountry->insertItem( tr ( "Bermuda" ) );
289 cmbCountry->insertItem( tr ( "Bhutan" ) ); 291 cmbCountry->insertItem( tr ( "Bhutan" ) );
290 cmbCountry->insertItem( tr ( "Bolivia" ) ); 292 cmbCountry->insertItem( tr ( "Bolivia" ) );
291 cmbCountry->insertItem( tr ( "Botswana" ) ); 293 cmbCountry->insertItem( tr ( "Botswana" ) );
292 cmbCountry->insertItem( tr ( "Bouvet Island" ) ); 294 cmbCountry->insertItem( tr ( "Bouvet Island" ) );
293 cmbCountry->insertItem( tr ( "Brazil" ) ); 295 cmbCountry->insertItem( tr ( "Brazil" ) );
294 cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); 296 cmbCountry->insertItem( tr ( "Brunei Darussalam" ) );
295 cmbCountry->insertItem( tr ( "Bulgaria" ) ); 297 cmbCountry->insertItem( tr ( "Bulgaria" ) );
296 cmbCountry->insertItem( tr ( "Burkina Faso" ) ); 298 cmbCountry->insertItem( tr ( "Burkina Faso" ) );
297 cmbCountry->insertItem( tr ( "Burundi" ) ); 299 cmbCountry->insertItem( tr ( "Burundi" ) );
298 cmbCountry->insertItem( tr ( "Cambodia" ) ); 300 cmbCountry->insertItem( tr ( "Cambodia" ) );
299 cmbCountry->insertItem( tr ( "Cameroon" ) ); 301 cmbCountry->insertItem( tr ( "Cameroon" ) );
300 cmbCountry->insertItem( tr ( "Canada" ) ); 302 cmbCountry->insertItem( tr ( "Canada" ) );
301 cmbCountry->insertItem( tr ( "Cape Verde" ) ); 303 cmbCountry->insertItem( tr ( "Cape Verde" ) );
302 cmbCountry->insertItem( tr ( "Cayman Islands" ) ); 304 cmbCountry->insertItem( tr ( "Cayman Islands" ) );
303 cmbCountry->insertItem( tr ( "Chad" ) ); 305 cmbCountry->insertItem( tr ( "Chad" ) );
304 cmbCountry->insertItem( tr ( "Chile" ) ); 306 cmbCountry->insertItem( tr ( "Chile" ) );
305 cmbCountry->insertItem( tr ( "China" ) ); 307 cmbCountry->insertItem( tr ( "China" ) );
306 cmbCountry->insertItem( tr ( "Christmas Island" ) ); 308 cmbCountry->insertItem( tr ( "Christmas Island" ) );
307 cmbCountry->insertItem( tr ( "Colombia" ) ); 309 cmbCountry->insertItem( tr ( "Colombia" ) );
308 cmbCountry->insertItem( tr ( "Comoros" ) ); 310 cmbCountry->insertItem( tr ( "Comoros" ) );
309 cmbCountry->insertItem( tr ( "Congo" ) ); 311 cmbCountry->insertItem( tr ( "Congo" ) );
310 cmbCountry->insertItem( tr ( "Cook Island" ) ); 312 cmbCountry->insertItem( tr ( "Cook Island" ) );
311 cmbCountry->insertItem( tr ( "Costa Rica" ) ); 313 cmbCountry->insertItem( tr ( "Costa Rica" ) );
312 cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); 314 cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) );
313 cmbCountry->insertItem( tr ( "Croatia" ) ); 315 cmbCountry->insertItem( tr ( "Croatia" ) );
314 cmbCountry->insertItem( tr ( "Cuba" ) ); 316 cmbCountry->insertItem( tr ( "Cuba" ) );
315 cmbCountry->insertItem( tr ( "Cyprus" ) ); 317 cmbCountry->insertItem( tr ( "Cyprus" ) );
316 cmbCountry->insertItem( tr ( "Czech Republic" ) ); 318 cmbCountry->insertItem( tr ( "Czech Republic" ) );
317 cmbCountry->insertItem( tr ( "Denmark" ) ); 319 cmbCountry->insertItem( tr ( "Denmark" ) );
318 cmbCountry->insertItem( tr ( "Djibouti" ) ); 320 cmbCountry->insertItem( tr ( "Djibouti" ) );
319 cmbCountry->insertItem( tr ( "Dominica" ) ); 321 cmbCountry->insertItem( tr ( "Dominica" ) );
320 cmbCountry->insertItem( tr ( "Dominican Republic" ) ); 322 cmbCountry->insertItem( tr ( "Dominican Republic" ) );
321 cmbCountry->insertItem( tr ( "East Timor" ) ); 323 cmbCountry->insertItem( tr ( "East Timor" ) );
322 cmbCountry->insertItem( tr ( "Ecuador" ) ); 324 cmbCountry->insertItem( tr ( "Ecuador" ) );
323 cmbCountry->insertItem( tr ( "Egypt" ) ); 325 cmbCountry->insertItem( tr ( "Egypt" ) );
324 cmbCountry->insertItem( tr ( "El Salvador" ) ); 326 cmbCountry->insertItem( tr ( "El Salvador" ) );
325 cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); 327 cmbCountry->insertItem( tr ( "Equatorial Guinea" ) );
326 cmbCountry->insertItem( tr ( "Eritrea" ) ); 328 cmbCountry->insertItem( tr ( "Eritrea" ) );
327 cmbCountry->insertItem( tr ( "Estonia" ) ); 329 cmbCountry->insertItem( tr ( "Estonia" ) );
328 cmbCountry->insertItem( tr ( "Ethiopia" ) ); 330 cmbCountry->insertItem( tr ( "Ethiopia" ) );
329 cmbCountry->insertItem( tr ( "Falkland Islands" ) ); 331 cmbCountry->insertItem( tr ( "Falkland Islands" ) );
330 cmbCountry->insertItem( tr ( "Faroe Islands" ) ); 332 cmbCountry->insertItem( tr ( "Faroe Islands" ) );
331 cmbCountry->insertItem( tr ( "Fiji" ) ); 333 cmbCountry->insertItem( tr ( "Fiji" ) );
332 cmbCountry->insertItem( tr ( "Finland" ) ); 334 cmbCountry->insertItem( tr ( "Finland" ) );
333 cmbCountry->insertItem( tr ( "France" ) ); 335 cmbCountry->insertItem( tr ( "France" ) );
334 cmbCountry->insertItem( tr ( "French Guiana" ) ); 336 cmbCountry->insertItem( tr ( "French Guiana" ) );
335 cmbCountry->insertItem( tr ( "French Polynesia" ) ); 337 cmbCountry->insertItem( tr ( "French Polynesia" ) );
336 cmbCountry->insertItem( tr ( "Gabon" ) ); 338 cmbCountry->insertItem( tr ( "Gabon" ) );
337 cmbCountry->insertItem( tr ( "Gambia" ) ); 339 cmbCountry->insertItem( tr ( "Gambia" ) );
338 cmbCountry->insertItem( tr ( "Georgia" ) ); 340 cmbCountry->insertItem( tr ( "Georgia" ) );
339 cmbCountry->insertItem( tr ( "Germany" ) ); 341 cmbCountry->insertItem( tr ( "Germany" ) );
340 cmbCountry->insertItem( tr ( "Ghana" ) ); 342 cmbCountry->insertItem( tr ( "Ghana" ) );
341 cmbCountry->insertItem( tr ( "Gibraltar" ) ); 343 cmbCountry->insertItem( tr ( "Gibraltar" ) );
342 cmbCountry->insertItem( tr ( "Greece" ) ); 344 cmbCountry->insertItem( tr ( "Greece" ) );
343 cmbCountry->insertItem( tr ( "Greenland" ) ); 345 cmbCountry->insertItem( tr ( "Greenland" ) );
344 cmbCountry->insertItem( tr ( "Grenada" ) ); 346 cmbCountry->insertItem( tr ( "Grenada" ) );
345 cmbCountry->insertItem( tr ( "Guadeloupe" ) ); 347 cmbCountry->insertItem( tr ( "Guadeloupe" ) );
346 cmbCountry->insertItem( tr ( "Guam" ) ); 348 cmbCountry->insertItem( tr ( "Guam" ) );
347 cmbCountry->insertItem( tr ( "Guatemala" ) ); 349 cmbCountry->insertItem( tr ( "Guatemala" ) );
348 cmbCountry->insertItem( tr ( "Guinea" ) ); 350 cmbCountry->insertItem( tr ( "Guinea" ) );
349 cmbCountry->insertItem( tr ( "Guinea-Bissau" ) ); 351 cmbCountry->insertItem( tr ( "Guinea-Bissau" ) );
350 cmbCountry->insertItem( tr ( "Guyana" ) ); 352 cmbCountry->insertItem( tr ( "Guyana" ) );
351 cmbCountry->insertItem( tr ( "Haiti" ) ); 353 cmbCountry->insertItem( tr ( "Haiti" ) );
352 cmbCountry->insertItem( tr ( "Holy See" ) ); 354 cmbCountry->insertItem( tr ( "Holy See" ) );
353 cmbCountry->insertItem( tr ( "Honduras" ) ); 355 cmbCountry->insertItem( tr ( "Honduras" ) );
354 cmbCountry->insertItem( tr ( "Hong Kong" ) ); 356 cmbCountry->insertItem( tr ( "Hong Kong" ) );
355 cmbCountry->insertItem( tr ( "Hungary" ) ); 357 cmbCountry->insertItem( tr ( "Hungary" ) );
356 cmbCountry->insertItem( tr ( "Iceland" ) ); 358 cmbCountry->insertItem( tr ( "Iceland" ) );
357 cmbCountry->insertItem( tr ( "India" ) ); 359 cmbCountry->insertItem( tr ( "India" ) );
358 cmbCountry->insertItem( tr ( "Indonesia" ) ); 360 cmbCountry->insertItem( tr ( "Indonesia" ) );
359 cmbCountry->insertItem( tr ( "Ireland" ) ); 361 cmbCountry->insertItem( tr ( "Ireland" ) );
360 cmbCountry->insertItem( tr ( "Israel" ) ); 362 cmbCountry->insertItem( tr ( "Israel" ) );
361 cmbCountry->insertItem( tr ( "Italy" ) ); 363 cmbCountry->insertItem( tr ( "Italy" ) );
362 cmbCountry->insertItem( tr ( "Jamaica" ) ); 364 cmbCountry->insertItem( tr ( "Jamaica" ) );
363 cmbCountry->insertItem( tr ( "Japan" ) ); 365 cmbCountry->insertItem( tr ( "Japan" ) );
364 cmbCountry->insertItem( tr ( "Jordan" ) ); 366 cmbCountry->insertItem( tr ( "Jordan" ) );
365 cmbCountry->insertItem( tr ( "Kazakhstan" ) ); 367 cmbCountry->insertItem( tr ( "Kazakhstan" ) );
366 cmbCountry->insertItem( tr ( "Kenya" ) ); 368 cmbCountry->insertItem( tr ( "Kenya" ) );
367 cmbCountry->insertItem( tr ( "Kiribati" ) ); 369 cmbCountry->insertItem( tr ( "Kiribati" ) );
368 cmbCountry->insertItem( tr ( "Korea" ) ); 370 cmbCountry->insertItem( tr ( "Korea" ) );
369 cmbCountry->insertItem( tr ( "Kuwait" ) ); 371 cmbCountry->insertItem( tr ( "Kuwait" ) );
370 cmbCountry->insertItem( tr ( "Kyrgyzstan" ) ); 372 cmbCountry->insertItem( tr ( "Kyrgyzstan" ) );
371 cmbCountry->insertItem( tr ( "Laos" ) ); 373 cmbCountry->insertItem( tr ( "Laos" ) );
372 cmbCountry->insertItem( tr ( "Latvia" ) ); 374 cmbCountry->insertItem( tr ( "Latvia" ) );
373 cmbCountry->insertItem( tr ( "Lebanon" ) ); 375 cmbCountry->insertItem( tr ( "Lebanon" ) );
374 cmbCountry->insertItem( tr ( "Lesotho" ) ); 376 cmbCountry->insertItem( tr ( "Lesotho" ) );
375 cmbCountry->insertItem( tr ( "Liberia" ) ); 377 cmbCountry->insertItem( tr ( "Liberia" ) );
376 cmbCountry->insertItem( tr ( "Liechtenstein" ) ); 378 cmbCountry->insertItem( tr ( "Liechtenstein" ) );
377 cmbCountry->insertItem( tr ( "Lithuania" ) ); 379 cmbCountry->insertItem( tr ( "Lithuania" ) );
378 cmbCountry->insertItem( tr ( "Luxembourg" ) ); 380 cmbCountry->insertItem( tr ( "Luxembourg" ) );
379 cmbCountry->insertItem( tr ( "Macau" ) ); 381 cmbCountry->insertItem( tr ( "Macau" ) );
380 cmbCountry->insertItem( tr ( "Macedonia" ) ); 382 cmbCountry->insertItem( tr ( "Macedonia" ) );
381 cmbCountry->insertItem( tr ( "Madagascar" ) ); 383 cmbCountry->insertItem( tr ( "Madagascar" ) );
382 cmbCountry->insertItem( tr ( "Malawi" ) ); 384 cmbCountry->insertItem( tr ( "Malawi" ) );
383 cmbCountry->insertItem( tr ( "Malaysia" ) ); 385 cmbCountry->insertItem( tr ( "Malaysia" ) );
384 cmbCountry->insertItem( tr ( "Maldives" ) ); 386 cmbCountry->insertItem( tr ( "Maldives" ) );
385 cmbCountry->insertItem( tr ( "Mali" ) ); 387 cmbCountry->insertItem( tr ( "Mali" ) );
386 cmbCountry->insertItem( tr ( "Malta" ) ); 388 cmbCountry->insertItem( tr ( "Malta" ) );
387 cmbCountry->insertItem( tr ( "Martinique" ) ); 389 cmbCountry->insertItem( tr ( "Martinique" ) );
388 cmbCountry->insertItem( tr ( "Mauritania" ) ); 390 cmbCountry->insertItem( tr ( "Mauritania" ) );
389 cmbCountry->insertItem( tr ( "Mauritius" ) ); 391 cmbCountry->insertItem( tr ( "Mauritius" ) );
390 cmbCountry->insertItem( tr ( "Mayotte" ) ); 392 cmbCountry->insertItem( tr ( "Mayotte" ) );
391 cmbCountry->insertItem( tr ( "Mexico" ) ); 393 cmbCountry->insertItem( tr ( "Mexico" ) );
392 cmbCountry->insertItem( tr ( "Micronesia" ) ); 394 cmbCountry->insertItem( tr ( "Micronesia" ) );
393 cmbCountry->insertItem( tr ( "Moldova" ) ); 395 cmbCountry->insertItem( tr ( "Moldova" ) );
394 cmbCountry->insertItem( tr ( "Monaco" ) ); 396 cmbCountry->insertItem( tr ( "Monaco" ) );
395 cmbCountry->insertItem( tr ( "Mongolia" ) ); 397 cmbCountry->insertItem( tr ( "Mongolia" ) );
396 cmbCountry->insertItem( tr ( "Montserrat" ) ); 398 cmbCountry->insertItem( tr ( "Montserrat" ) );
397 cmbCountry->insertItem( tr ( "Morocco" ) ); 399 cmbCountry->insertItem( tr ( "Morocco" ) );
398 cmbCountry->insertItem( tr ( "Mozambique" ) ); 400 cmbCountry->insertItem( tr ( "Mozambique" ) );
399 cmbCountry->insertItem( tr ( "Myanmar" ) ); 401 cmbCountry->insertItem( tr ( "Myanmar" ) );
400 cmbCountry->insertItem( tr ( "Namibia" ) ); 402 cmbCountry->insertItem( tr ( "Namibia" ) );
401 cmbCountry->insertItem( tr ( "Nauru" ) ); 403 cmbCountry->insertItem( tr ( "Nauru" ) );
402 cmbCountry->insertItem( tr ( "Nepal" ) ); 404 cmbCountry->insertItem( tr ( "Nepal" ) );
403 cmbCountry->insertItem( tr ( "Netherlands" ) ); 405 cmbCountry->insertItem( tr ( "Netherlands" ) );
404 cmbCountry->insertItem( tr ( "New Caledonia" ) ); 406 cmbCountry->insertItem( tr ( "New Caledonia" ) );
405 cmbCountry->insertItem( tr ( "New Zealand" ) ); 407 cmbCountry->insertItem( tr ( "New Zealand" ) );
406 cmbCountry->insertItem( tr ( "Nicaragua" ) ); 408 cmbCountry->insertItem( tr ( "Nicaragua" ) );
407 cmbCountry->insertItem( tr ( "Niger" ) ); 409 cmbCountry->insertItem( tr ( "Niger" ) );
408 cmbCountry->insertItem( tr ( "Nigeria" ) ); 410 cmbCountry->insertItem( tr ( "Nigeria" ) );
409 cmbCountry->insertItem( tr ( "Niue" ) ); 411 cmbCountry->insertItem( tr ( "Niue" ) );
410 cmbCountry->insertItem( tr ( "Norway" ) ); 412 cmbCountry->insertItem( tr ( "Norway" ) );
411 cmbCountry->insertItem( tr ( "Oman" ) ); 413 cmbCountry->insertItem( tr ( "Oman" ) );
412 cmbCountry->insertItem( tr ( "Pakistan" ) ); 414 cmbCountry->insertItem( tr ( "Pakistan" ) );
413 cmbCountry->insertItem( tr ( "Palau" ) ); 415 cmbCountry->insertItem( tr ( "Palau" ) );
414 cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) ); 416 cmbCountry->insertItem( tr ( "Palestinian Sovereign Areas" ) );
415 cmbCountry->insertItem( tr ( "Panama" ) ); 417 cmbCountry->insertItem( tr ( "Panama" ) );
416 cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); 418 cmbCountry->insertItem( tr ( "Papua New Guinea" ) );
417 cmbCountry->insertItem( tr ( "Paraguay" ) ); 419 cmbCountry->insertItem( tr ( "Paraguay" ) );
418 cmbCountry->insertItem( tr ( "Peru" ) ); 420 cmbCountry->insertItem( tr ( "Peru" ) );
419 cmbCountry->insertItem( tr ( "Philippines" ) ); 421 cmbCountry->insertItem( tr ( "Philippines" ) );
420 cmbCountry->insertItem( tr ( "Pitcairn Islands" ) ); 422 cmbCountry->insertItem( tr ( "Pitcairn Islands" ) );
421 cmbCountry->insertItem( tr ( "Poland" ) ); 423 cmbCountry->insertItem( tr ( "Poland" ) );
422 cmbCountry->insertItem( tr ( "Portugal" ) ); 424 cmbCountry->insertItem( tr ( "Portugal" ) );
423 cmbCountry->insertItem( tr ( "Puerto Rico" ) ); 425 cmbCountry->insertItem( tr ( "Puerto Rico" ) );
424 cmbCountry->insertItem( tr ( "Qatar" ) ); 426 cmbCountry->insertItem( tr ( "Qatar" ) );
425 cmbCountry->insertItem( tr ( "Reunion" ) ); 427 cmbCountry->insertItem( tr ( "Reunion" ) );
426 cmbCountry->insertItem( tr ( "Romania" ) ); 428 cmbCountry->insertItem( tr ( "Romania" ) );
427 cmbCountry->insertItem( tr ( "Russia" ) ); 429 cmbCountry->insertItem( tr ( "Russia" ) );
428 cmbCountry->insertItem( tr ( "Rwanda" ) ); 430 cmbCountry->insertItem( tr ( "Rwanda" ) );
429 cmbCountry->insertItem( tr ( "Saint Lucia" ) ); 431 cmbCountry->insertItem( tr ( "Saint Lucia" ) );
430 cmbCountry->insertItem( tr ( "Samoa" ) ); 432 cmbCountry->insertItem( tr ( "Samoa" ) );
431 cmbCountry->insertItem( tr ( "San Marino" ) ); 433 cmbCountry->insertItem( tr ( "San Marino" ) );
432 cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); 434 cmbCountry->insertItem( tr ( "Saudi Arabia" ) );
433 cmbCountry->insertItem( tr ( "Senegal" ) ); 435 cmbCountry->insertItem( tr ( "Senegal" ) );
434 cmbCountry->insertItem( tr ( "Seychelles" ) ); 436 cmbCountry->insertItem( tr ( "Seychelles" ) );
435 cmbCountry->insertItem( tr ( "Sierra Leone" ) ); 437 cmbCountry->insertItem( tr ( "Sierra Leone" ) );
436 cmbCountry->insertItem( tr ( "Singapore" ) ); 438 cmbCountry->insertItem( tr ( "Singapore" ) );
437 cmbCountry->insertItem( tr ( "Slovakia" ) ); 439 cmbCountry->insertItem( tr ( "Slovakia" ) );
438 cmbCountry->insertItem( tr ( "Slovenia" ) ); 440 cmbCountry->insertItem( tr ( "Slovenia" ) );
439 cmbCountry->insertItem( tr ( "Solomon Islands" ) ); 441 cmbCountry->insertItem( tr ( "Solomon Islands" ) );
440 cmbCountry->insertItem( tr ( "Somalia" ) ); 442 cmbCountry->insertItem( tr ( "Somalia" ) );
441 cmbCountry->insertItem( tr ( "South Africa" ) ); 443 cmbCountry->insertItem( tr ( "South Africa" ) );
442 cmbCountry->insertItem( tr ( "Spain" ) ); 444 cmbCountry->insertItem( tr ( "Spain" ) );
443 cmbCountry->insertItem( tr ( "Sri Lanka" ) ); 445 cmbCountry->insertItem( tr ( "Sri Lanka" ) );
444 cmbCountry->insertItem( tr ( "St. Helena" ) ); 446 cmbCountry->insertItem( tr ( "St. Helena" ) );
445 cmbCountry->insertItem( tr ( "Sudan" ) ); 447 cmbCountry->insertItem( tr ( "Sudan" ) );
446 cmbCountry->insertItem( tr ( "Suriname" ) ); 448 cmbCountry->insertItem( tr ( "Suriname" ) );
447 cmbCountry->insertItem( tr ( "Swaziland" ) ); 449 cmbCountry->insertItem( tr ( "Swaziland" ) );
448 cmbCountry->insertItem( tr ( "Sweden" ) ); 450 cmbCountry->insertItem( tr ( "Sweden" ) );
449 cmbCountry->insertItem( tr ( "Switzerland" ) ); 451 cmbCountry->insertItem( tr ( "Switzerland" ) );
450 cmbCountry->insertItem( tr ( "Taiwan" ) ); 452 cmbCountry->insertItem( tr ( "Taiwan" ) );
451 cmbCountry->insertItem( tr ( "Tajikistan" ) ); 453 cmbCountry->insertItem( tr ( "Tajikistan" ) );
452 cmbCountry->insertItem( tr ( "Tanzania" ) ); 454 cmbCountry->insertItem( tr ( "Tanzania" ) );
453 cmbCountry->insertItem( tr ( "Thailand" ) ); 455 cmbCountry->insertItem( tr ( "Thailand" ) );
454 cmbCountry->insertItem( tr ( "Togo" ) ); 456 cmbCountry->insertItem( tr ( "Togo" ) );
455 cmbCountry->insertItem( tr ( "Tokelau" ) ); 457 cmbCountry->insertItem( tr ( "Tokelau" ) );
456 cmbCountry->insertItem( tr ( "Tonga" ) ); 458 cmbCountry->insertItem( tr ( "Tonga" ) );
457 cmbCountry->insertItem( tr ( "Tunisia" ) ); 459 cmbCountry->insertItem( tr ( "Tunisia" ) );
458 cmbCountry->insertItem( tr ( "Turkey" ) ); 460 cmbCountry->insertItem( tr ( "Turkey" ) );
459 cmbCountry->insertItem( tr ( "Turkmenistan" ) ); 461 cmbCountry->insertItem( tr ( "Turkmenistan" ) );
460 cmbCountry->insertItem( tr ( "Tuvalu" ) ); 462 cmbCountry->insertItem( tr ( "Tuvalu" ) );
461 cmbCountry->insertItem( tr ( "Uganda" ) ); 463 cmbCountry->insertItem( tr ( "Uganda" ) );
462 cmbCountry->insertItem( tr ( "Ukraine" ) ); 464 cmbCountry->insertItem( tr ( "Ukraine" ) );
463 cmbCountry->insertItem( tr ( "Uruguay" ) ); 465 cmbCountry->insertItem( tr ( "Uruguay" ) );
464 cmbCountry->insertItem( tr ( "Uzbekistan" ) ); 466 cmbCountry->insertItem( tr ( "Uzbekistan" ) );
465 cmbCountry->insertItem( tr ( "Vanuatu" ) ); 467 cmbCountry->insertItem( tr ( "Vanuatu" ) );
466 cmbCountry->insertItem( tr ( "Venezuela" ) ); 468 cmbCountry->insertItem( tr ( "Venezuela" ) );
467 cmbCountry->insertItem( tr ( "Vietnam" ) ); 469 cmbCountry->insertItem( tr ( "Vietnam" ) );
468 cmbCountry->insertItem( tr ( "Virgin Islands" ) ); 470 cmbCountry->insertItem( tr ( "Virgin Islands" ) );
469 cmbCountry->insertItem( tr ( "Western Sahara" ) ); 471 cmbCountry->insertItem( tr ( "Western Sahara" ) );
470 cmbCountry->insertItem( tr ( "Yemen" ) ); 472 cmbCountry->insertItem( tr ( "Yemen" ) );
471 cmbCountry->insertItem( tr ( "Yugoslavia" ) ); 473 cmbCountry->insertItem( tr ( "Yugoslavia" ) );
472 cmbCountry->insertItem( tr ( "Zambia" ) ); 474 cmbCountry->insertItem( tr ( "Zambia" ) );
473 cmbCountry->insertItem( tr ( "Zimbabwe" ) ); 475 cmbCountry->insertItem( tr ( "Zimbabwe" ) );
474 if (cmbCountry->listBox()!=0) 476 if (cmbCountry->listBox()!=0)
475 cmbCountry->listBox()->sort(); 477 cmbCountry->listBox()->sort();
476 478
477 cmbCountry->setMaximumWidth( 135 ); 479 cmbCountry->setMaximumWidth( 135 );
478 480
479 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); 481 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 );
480 482
481 // Chooser 4 483 // Chooser 4
482 cmbChooserField4 = new QComboBox( FALSE, container ); 484 cmbChooserField4 = new QComboBox( FALSE, container );
483 cmbChooserField4->setMaximumWidth( 90 ); 485 cmbChooserField4->setMaximumWidth( 90 );
484 gl->addWidget( cmbChooserField4, 6, 0 ); 486 gl->addWidget( cmbChooserField4, 6, 0 );
485 // Textfield for chooser 2 487 // Textfield for chooser 2
486 // Now use WidgetStack to contain the textfield and the default-email combo! 488 // Now use WidgetStack to contain the textfield and the default-email combo!
487 m_widgetStack4 = new QWidgetStack( container ); 489 m_widgetStack4 = new QWidgetStack( container );
488 txtChooserField4 = new QLineEdit( m_widgetStack4 ); 490 txtChooserField4 = new QLineEdit( m_widgetStack4 );
489 m_widgetStack4 -> addWidget( txtChooserField4, TextField ); 491 m_widgetStack4 -> addWidget( txtChooserField4, TextField );
490 gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 ); 492 gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 );
491 m_widgetStack4 -> raiseWidget( TextField ); 493 m_widgetStack4 -> raiseWidget( TextField );
492 494
493 QSpacerItem *space = new QSpacerItem(1,1, 495 QSpacerItem *space = new QSpacerItem(1,1,
494 QSizePolicy::Maximum, 496 QSizePolicy::Maximum,
495 QSizePolicy::MinimumExpanding ); 497 QSizePolicy::MinimumExpanding );
496 gl->addItem( space, 7, 0 ); 498 gl->addItem( space, 7, 0 );
497 499
498 tabMain->insertTab( tabViewport, tr( "Address" ) ); 500 tabMain->insertTab( tabViewport, tr( "Address" ) );
499 501
500 tabViewport = new QWidget ( tabMain ); 502 tabViewport = new QWidget ( tabMain );
501 503
502 vb = new QVBoxLayout( tabViewport ); 504 vb = new QVBoxLayout( tabViewport );
503 505
504 svDetails = new QScrollView( tabViewport ); 506 svDetails = new QScrollView( tabViewport );
505 vb->addWidget( svDetails, 0, 0 ); 507 vb->addWidget( svDetails, 0, 0 );
506 svDetails->setResizePolicy( QScrollView::AutoOneFit ); 508 svDetails->setResizePolicy( QScrollView::AutoOneFit );
507 svDetails->setFrameStyle( QFrame::NoFrame ); 509 svDetails->setFrameStyle( QFrame::NoFrame );
508 510
509 container = new QWidget( svDetails->viewport() ); 511 container = new QWidget( svDetails->viewport() );
510 svDetails->addChild( container ); 512 svDetails->addChild( container );
511 513
512 gl = new QGridLayout( container, 1, 2, 2, 4 ); 514 gl = new QGridLayout( container, 1, 2, 2, 4 );
513 515
514 int counter = 0; 516 int counter = 0;
515 517
516 // Birthday 518 // Birthday
517 QHBox* hBox = new QHBox( container ); 519 QHBox* hBox = new QHBox( container );
518 l = new QLabel( tr("Birthday"), container ); 520 l = new QLabel( tr("Birthday"), container );
519 gl->addWidget( l, counter, 0 ); 521 gl->addWidget( l, counter, 0 );
520 522
521 QPopupMenu* m1 = new QPopupMenu( container ); 523 QPopupMenu* m1 = new QPopupMenu( container );
522 birthdayPicker = new DateBookMonth( m1, 0, TRUE ); 524 birthdayPicker = new DateBookMonth( m1, 0, TRUE );
523 m1->insertItem( birthdayPicker ); 525 m1->insertItem( birthdayPicker );
524 526
525 birthdayButton= new QToolButton( hBox, "buttonStart" ); 527 birthdayButton= new QToolButton( hBox, "buttonStart" );
526 birthdayButton->setPopup( m1 ); 528 birthdayButton->setPopup( m1 );
527 birthdayButton->setPopupDelay(0); 529 birthdayButton->setPopupDelay(0);
528 530
529 QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), 531 QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ),
530 tr( "Delete" ), 532 tr( "Delete" ),
531 hBox, 0 ); 533 hBox, 0 );
532 534
533 gl->addWidget( hBox, counter , 1 ); 535 gl->addWidget( hBox, counter , 1 );
534 536
535 connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), 537 connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ),
536 this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); 538 this, SLOT( slotBirthdayDateChanged( int, int, int ) ) );
537 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); 539 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) );
538 540
539 ++counter; 541 ++counter;
540 542
541 // Anniversary 543 // Anniversary
542 hBox = new QHBox( container ); 544 hBox = new QHBox( container );
543 l = new QLabel( tr("Anniversary"), container ); 545 l = new QLabel( tr("Anniversary"), container );
544 gl->addWidget( l, counter, 0 ); 546 gl->addWidget( l, counter, 0 );
545 547
546 m1 = new QPopupMenu( container ); 548 m1 = new QPopupMenu( container );
547 anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); 549 anniversaryPicker = new DateBookMonth( m1, 0, TRUE );
548 m1->insertItem( anniversaryPicker ); 550 m1->insertItem( anniversaryPicker );
549 551
550 anniversaryButton= new QToolButton( hBox, "buttonStart" ); 552 anniversaryButton= new QToolButton( hBox, "buttonStart" );
551 anniversaryButton->setPopup( m1 ); 553 anniversaryButton->setPopup( m1 );
552 anniversaryButton->setPopupDelay(0); 554 anniversaryButton->setPopupDelay(0);
553 555
554 deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), 556 deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ),
555 tr( "Delete" ), 557 tr( "Delete" ),
556 hBox, 0 ); 558 hBox, 0 );
557 gl->addWidget( hBox, counter , 1 ); 559 gl->addWidget( hBox, counter , 1 );
558 560
559 connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), 561 connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ),
560 this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); 562 this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) );
561 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); 563 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) );
562 564
563 ++counter; 565 ++counter;
564 566
565 // Gender 567 // Gender
566 l = new QLabel( tr("Gender"), container ); 568 l = new QLabel( tr("Gender"), container );
567 gl->addWidget( l, counter, 0 ); 569 gl->addWidget( l, counter, 0 );
568 cmbGender = new QComboBox( container ); 570 cmbGender = new QComboBox( container );
569 cmbGender->insertItem( "", 0 ); 571 cmbGender->insertItem( "", 0 );
570 cmbGender->insertItem( tr("Male"), 1); 572 cmbGender->insertItem( tr("Male"), 1);
571 cmbGender->insertItem( tr("Female"), 2); 573 cmbGender->insertItem( tr("Female"), 2);
572 gl->addWidget( cmbGender, counter, 1 ); 574 gl->addWidget( cmbGender, counter, 1 );
573 575
574 ++counter; 576 ++counter;
575 577
576 // Create Labels and lineedit fields for every dynamic entry 578 // Create Labels and lineedit fields for every dynamic entry
577 QStringList::ConstIterator it = slDynamicEntries.begin(); 579 QStringList::ConstIterator it = slDynamicEntries.begin();
578 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); 580 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId();
579 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); 581 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields();
580 for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { 582 for (i = counter; it != slDynamicEntries.end(); i++, ++it ) {
581 583
582 if (((*it) == "Anniversary") || 584 if (((*it) == "Anniversary") ||
583 ((*it) == "Birthday")|| ((*it) == "Gender")) continue; 585 ((*it) == "Birthday")|| ((*it) == "Gender")) continue;
584 586
585 l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container ); 587 l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container );
586 listName.append( l ); 588 listName.append( l );
587 gl->addWidget( l, i, 0 ); 589 gl->addWidget( l, i, 0 );
588 QLineEdit *e = new QLineEdit( container ); 590 QLineEdit *e = new QLineEdit( container );
589 listValue.append( e ); 591 listValue.append( e );
590 gl->addWidget( e, i, 1); 592 gl->addWidget( e, i, 1);
591 } 593 }
592 // Fill labels with names.. 594 // Fill labels with names..
593 //loadFields(); 595 //loadFields();
594 596
595 597
596 tabMain->insertTab( tabViewport, tr( "Details" ) ); 598 tabMain->insertTab( tabViewport, tr( "Details" ) );
597 599
598 dlgNote = new QDialog( this, "Note Dialog", TRUE ); 600 dlgNote = new QDialog( this, "Note Dialog", TRUE );
599 dlgNote->setCaption( tr("Enter Note") ); 601 dlgNote->setCaption( tr("Enter Note") );
600 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); 602 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote );
601 txtNote = new QMultiLineEdit( dlgNote ); 603 txtNote = new QMultiLineEdit( dlgNote );
602 vbNote->addWidget( txtNote ); 604 vbNote->addWidget( txtNote );
603 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); 605 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) );
604 606
605 dlgName = new QDialog( this, "Name Dialog", TRUE ); 607 dlgName = new QDialog( this, "Name Dialog", TRUE );
606 dlgName->setCaption( tr("Edit Name") ); 608 dlgName->setCaption( tr("Edit Name") );
607 gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); 609 gl = new QGridLayout( dlgName, 5, 2, 2, 3 );
608 610
609 l = new QLabel( tr("First Name"), dlgName ); 611 l = new QLabel( tr("First Name"), dlgName );
610 gl->addWidget( l, 0, 0 ); 612 gl->addWidget( l, 0, 0 );
611 txtFirstName = new QLineEdit( dlgName ); 613 txtFirstName = new QLineEdit( dlgName );
612 gl->addWidget( txtFirstName, 0, 1 ); 614 gl->addWidget( txtFirstName, 0, 1 );
613 615
614 l = new QLabel( tr("Middle Name"), dlgName ); 616 l = new QLabel( tr("Middle Name"), dlgName );
615 gl->addWidget( l, 1, 0 ); 617 gl->addWidget( l, 1, 0 );
616 txtMiddleName = new QLineEdit( dlgName ); 618 txtMiddleName = new QLineEdit( dlgName );
617 gl->addWidget( txtMiddleName, 1, 1 ); 619 gl->addWidget( txtMiddleName, 1, 1 );
618 620
619 l = new QLabel( tr("Last Name"), dlgName ); 621 l = new QLabel( tr("Last Name"), dlgName );
620 gl->addWidget( l, 2, 0 ); 622 gl->addWidget( l, 2, 0 );
621 txtLastName = new QLineEdit( dlgName ); 623 txtLastName = new QLineEdit( dlgName );
622 gl->addWidget( txtLastName, 2, 1 ); 624 gl->addWidget( txtLastName, 2, 1 );
623 625
624 // l = new QLabel( tr("Suffix"), dlgName ); 626 // l = new QLabel( tr("Suffix"), dlgName );
625 // gl->addWidget( l, 3, 0 ); 627 // gl->addWidget( l, 3, 0 );
626 // txtSuffix = new QLineEdit( dlgName ); 628 // txtSuffix = new QLineEdit( dlgName );
627 // gl->addWidget( txtSuffix, 3, 1 ); 629 // gl->addWidget( txtSuffix, 3, 1 );
628 space = new QSpacerItem(1,1, 630 space = new QSpacerItem(1,1,
629 QSizePolicy::Maximum, 631 QSizePolicy::Maximum,
630 QSizePolicy::MinimumExpanding ); 632 QSizePolicy::MinimumExpanding );
631 gl->addItem( space, 4, 0 ); 633 gl->addItem( space, 4, 0 );
632 634
633 cmbChooserField1->insertStringList( trlChooserNames ); 635 cmbChooserField1->insertStringList( trlChooserNames );
634 cmbChooserField2->insertStringList( trlChooserNames ); 636 cmbChooserField2->insertStringList( trlChooserNames );
635 cmbChooserField3->insertStringList( trlChooserNames ); 637 cmbChooserField3->insertStringList( trlChooserNames );
636 cmbChooserField4->insertStringList( trlChooserNames ); 638 cmbChooserField4->insertStringList( trlChooserNames );
637 639
638 cmbChooserField1->setCurrentItem( 0 ); 640 cmbChooserField1->setCurrentItem( 0 );
639 cmbChooserField2->setCurrentItem( 1 ); 641 cmbChooserField2->setCurrentItem( 1 );
640 cmbChooserField3->setCurrentItem( 2 ); 642 cmbChooserField3->setCurrentItem( 2 );
641 643
642 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); 644 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) );
643 645
644 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); 646 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) );
645 647
646 connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); 648 connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) );
647 649
648 connect( txtChooserField1, SIGNAL(textChanged(const QString &)), 650 connect( txtChooserField1, SIGNAL(textChanged(const QString &)),
649 this, SLOT(slotChooser1Change(const QString &)) ); 651 this, SLOT(slotChooser1Change(const QString &)) );
650 connect( txtChooserField2, SIGNAL(textChanged(const QString &)), 652 connect( txtChooserField2, SIGNAL(textChanged(const QString &)),
651 this, SLOT(slotChooser2Change(const QString &)) ); 653 this, SLOT(slotChooser2Change(const QString &)) );
652 connect( txtChooserField3, SIGNAL(textChanged(const QString &)), 654 connect( txtChooserField3, SIGNAL(textChanged(const QString &)),
653 this, SLOT(slotChooser3Change(const QString &)) ); 655 this, SLOT(slotChooser3Change(const QString &)) );
654 connect( txtChooserField4, SIGNAL(textChanged(const QString &)), 656 connect( txtChooserField4, SIGNAL(textChanged(const QString &)),
655 this, SLOT(slotChooser4Change(const QString &)) ); 657 this, SLOT(slotChooser4Change(const QString &)) );
656 connect( txtAddress, SIGNAL(textChanged(const QString &)), 658 connect( txtAddress, SIGNAL(textChanged(const QString &)),
657 this, SLOT(slotAddressChange(const QString &)) ); 659 this, SLOT(slotAddressChange(const QString &)) );
658 connect( txtCity, SIGNAL(textChanged(const QString &)), 660 connect( txtCity, SIGNAL(textChanged(const QString &)),
659 this, SLOT(slotCityChange(const QString &)) ); 661 this, SLOT(slotCityChange(const QString &)) );
660 connect( txtState, SIGNAL(textChanged(const QString &)), 662 connect( txtState, SIGNAL(textChanged(const QString &)),
661 this, SLOT(slotStateChange(const QString &)) ); 663 this, SLOT(slotStateChange(const QString &)) );
662 connect( txtZip, SIGNAL(textChanged(const QString &)), 664 connect( txtZip, SIGNAL(textChanged(const QString &)),
663 this, SLOT(slotZipChange(const QString &)) ); 665 this, SLOT(slotZipChange(const QString &)) );
664 connect( cmbCountry, SIGNAL(textChanged(const QString &)), 666 connect( cmbCountry, SIGNAL(textChanged(const QString &)),
665 this, SLOT(slotCountryChange(const QString &)) ); 667 this, SLOT(slotCountryChange(const QString &)) );
666 connect( cmbCountry, SIGNAL(activated(const QString &)), 668 connect( cmbCountry, SIGNAL(activated(const QString &)),
667 this, SLOT(slotCountryChange(const QString &)) ); 669 this, SLOT(slotCountryChange(const QString &)) );
668 connect( cmbChooserField1, SIGNAL(activated(int)), 670 connect( cmbChooserField1, SIGNAL(activated(int)),
669 this, SLOT(slotCmbChooser1Change(int)) ); 671 this, SLOT(slotCmbChooser1Change(int)) );
670 connect( cmbChooserField2, SIGNAL(activated(int)), 672 connect( cmbChooserField2, SIGNAL(activated(int)),
671 this, SLOT(slotCmbChooser2Change(int)) ); 673 this, SLOT(slotCmbChooser2Change(int)) );
672 connect( cmbChooserField3, SIGNAL(activated(int)), 674 connect( cmbChooserField3, SIGNAL(activated(int)),
673 this, SLOT(slotCmbChooser3Change(int)) ); 675 this, SLOT(slotCmbChooser3Change(int)) );
674 connect( cmbChooserField4, SIGNAL(activated(int)), 676 connect( cmbChooserField4, SIGNAL(activated(int)),
675 this, SLOT(slotCmbChooser4Change(int)) ); 677 this, SLOT(slotCmbChooser4Change(int)) );
676 connect( cmbAddress, SIGNAL(activated(int)), 678 connect( cmbAddress, SIGNAL(activated(int)),
677 this, SLOT(slotAddressTypeChange(int)) ); 679 this, SLOT(slotAddressTypeChange(int)) );
678 680
679 new QPEDialogListener(this); 681 new QPEDialogListener(this);
680 682
681 setPersonalView ( m_personalView ); 683 setPersonalView ( m_personalView );
682 684
683 qWarning("init() END"); 685 qWarning("init() END");
684} 686}
685 687
686void ContactEditor::defaultEmailChanged(int i){ 688void ContactEditor::defaultEmailChanged(int i){
687 qDebug("defaultEmailChanged"); 689 qDebug("defaultEmailChanged");
688 690
689 // was sollte das ? (se) 691 // was sollte das ? (se)
690 // int index = cmbChooserField1->currentItem(); 692 // int index = cmbChooserField1->currentItem();
691 // slChooserValues[index] = cmbDefaultEmail->text(i); 693 // slChooserValues[index] = cmbDefaultEmail->text(i);
692 694
693 defaultEmail = cmbDefaultEmail->text(i); 695 defaultEmail = cmbDefaultEmail->text(i);
694 qDebug ("Changed to: %s", defaultEmail.latin1()); 696 qDebug ("Changed to: %s", defaultEmail.latin1());
695 697
696} 698}
697 699
698void ContactEditor::populateDefaultEmailCmb(){ 700void ContactEditor::populateDefaultEmailCmb(){
699 701
700 // if the default-email combo was not selected and therfore not created 702 // if the default-email combo was not selected and therfore not created
701 // we get a lot of trouble.. Therfore create an invisible one.. 703 // we get a lot of trouble.. Therfore create an invisible one..
702 if ( !cmbDefaultEmail ){ 704 if ( !cmbDefaultEmail ){
703 cmbDefaultEmail = new QComboBox(this); 705 cmbDefaultEmail = new QComboBox(this);
704 cmbDefaultEmail -> hide(); 706 cmbDefaultEmail -> hide();
705 } 707 }
706 cmbDefaultEmail->clear(); 708 cmbDefaultEmail->clear();
707 cmbDefaultEmail->insertStringList( emails ); 709 cmbDefaultEmail->insertStringList( emails );
708 // cmbDefaultEmail->show(); 710 // cmbDefaultEmail->show();
709 711
710 // Select default email in combo.. 712 // Select default email in combo..
711 bool found = false; 713 bool found = false;
712 for ( int i = 0; i < cmbDefaultEmail->count(); i++){ 714 for ( int i = 0; i < cmbDefaultEmail->count(); i++){
713 qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", 715 qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<",
714 cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); 716 cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1());
715 717
716 if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ 718 if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){
717 cmbDefaultEmail->setCurrentItem( i ); 719 cmbDefaultEmail->setCurrentItem( i );
718 qDebug("set"); 720 qDebug("set");
719 found = true; 721 found = true;
720 } 722 }
721 } 723 }
722 724
723 // If the current default email is not found in the list, we choose the 725 // If the current default email is not found in the list, we choose the
724 // first one.. 726 // first one..
725 if ( !found ) 727 if ( !found )
726 defaultEmail = cmbDefaultEmail->text(0); 728 defaultEmail = cmbDefaultEmail->text(0);
727} 729}
728 730
729// Called when any combobox was changed. 731// Called when any combobox was changed.
730// "true" returned if the change was chandled by this function, else it should 732// "true" returned if the change was chandled by this function, else it should
731// be handled by something else.. 733// be handled by something else..
732bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { 734bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) {
733 QString type = slChooserNames[index]; 735 QString type = slChooserNames[index];
734 qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos ); 736 qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos );
735 737
736 if ( !initializing ) 738 if ( !initializing )
737 contactfields.setFieldOrder( widgetPos-1, index ); 739 contactfields.setFieldOrder( widgetPos-1, index );
738 740
739 // Create and connect combobox for selecting the default email 741 // Create and connect combobox for selecting the default email
740 if ( type == "Default Email"){ 742 if ( type == "Default Email"){
741 qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition); 743 qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition);
742 744
743 // More than one default-email chooser is not allowed ! 745 // More than one default-email chooser is not allowed !
744 if ( ( defaultEmailChooserPosition != -1 ) && 746 if ( ( defaultEmailChooserPosition != -1 ) &&
745 defaultEmailChooserPosition != widgetPos && !initializing){ 747 defaultEmailChooserPosition != widgetPos && !initializing){
746 chooserError( widgetPos ); 748 chooserError( widgetPos );
747 return true; 749 return true;
748 } 750 }
749 751
750 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); 752 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
751 if ( cmbo ){ 753 if ( cmbo ){
752 inputStack->raiseWidget( TextField ); 754 inputStack->raiseWidget( TextField );
753 inputStack -> removeWidget( cmbo ); 755 inputStack -> removeWidget( cmbo );
754 delete cmbo; 756 delete cmbo;
755 } 757 }
756 cmbo = new QComboBox( inputStack ); 758 cmbo = new QComboBox( inputStack );
757 cmbo -> insertStringList( emails ); 759 cmbo -> insertStringList( emails );
758 760
759 inputStack -> addWidget( cmbo, Combo ); 761 inputStack -> addWidget( cmbo, Combo );
760 inputStack -> raiseWidget( Combo ); 762 inputStack -> raiseWidget( Combo );
761 763
762 defaultEmailChooserPosition = widgetPos; 764 defaultEmailChooserPosition = widgetPos;
763 cmbDefaultEmail = cmbo; 765 cmbDefaultEmail = cmbo;
764 766
765 connect( cmbo,SIGNAL( activated(int) ), 767 connect( cmbo,SIGNAL( activated(int) ),
766 SLOT( defaultEmailChanged(int) ) ); 768 SLOT( defaultEmailChanged(int) ) );
767 769
768 // Set current default email 770 // Set current default email
769 populateDefaultEmailCmb(); 771 populateDefaultEmailCmb();
770 772
771 773
772 } else { 774 } else {
773 // Something else was selected: Hide combo.. 775 // Something else was selected: Hide combo..
774 qWarning(" Hiding default-email combo" ); 776 qWarning(" Hiding default-email combo" );
775 if ( defaultEmailChooserPosition == widgetPos ){ 777 if ( defaultEmailChooserPosition == widgetPos ){
776 defaultEmailChooserPosition = -1; 778 defaultEmailChooserPosition = -1;
777 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); 779 }
778 if ( cmbo ){ 780 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
779 inputStack->raiseWidget( TextField ); 781 if ( cmbo ){
780 inputStack -> removeWidget( cmbo ); 782 inputStack->raiseWidget( TextField );
781 cmbDefaultEmail = 0l; 783 inputStack -> removeWidget( cmbo );
782 delete cmbo; 784 cmbDefaultEmail = 0l;
783 } 785 delete cmbo;
784 786 }
785 }
786 787
787 // Caller should initialize the responsible textfield, therefore 788 // Caller should initialize the responsible textfield, therefore
788 // "false" is returned 789 // "false" is returned
789 return false; 790 return false;
790 } 791 }
791 792
792 // Everything is worked off .. 793 // Everything is worked off ..
793 return true; 794 return true;
794 795
795} 796}
796 797
797// Currently accessed when we select default-email more than once ! 798// Currently accessed when we select default-email more than once !
798void ContactEditor::chooserError( int index ) 799void ContactEditor::chooserError( int index )
799{ 800{
800 qWarning("ContactEditor::chooserError( %d )", index); 801 qWarning("ContactEditor::chooserError( %d )", index);
801 QMessageBox::warning( this, "Chooser Error", 802 QMessageBox::warning( this, "Chooser Error",
802 "Multiple selection of this\n" 803 "Multiple selection of this\n"
803 "Item is not allowed !\n\n" 804 "Item is not allowed !\n\n"
804 "First deselect the previous one !", 805 "First deselect the previous one !",
805 "&OK", 0, 0, 806 "&OK", 0, 0,
806 0, 0 ); 807 0, 0 );
807 808
808 // Reset the selected Chooser. Unfortunately the chooser 809 // Reset the selected Chooser. Unfortunately the chooser
809 // generates no signal, therfore we have to 810 // generates no signal, therfore we have to
810 // call the cmbChooserChange function manually.. 811 // call the cmbChooserChange function manually..
811 switch( index ){ 812 switch( index ){
812 case 1: 813 case 1:
813 cmbChooserField1 -> setCurrentItem( 0 ); 814 cmbChooserField1 -> setCurrentItem( 0 );
814 slotCmbChooser1Change( 0 ); 815 slotCmbChooser1Change( 0 );
815 break; 816 break;
816 case 2: 817 case 2:
817 cmbChooserField2 -> setCurrentItem( 0 ); 818 cmbChooserField2 -> setCurrentItem( 0 );
818 slotCmbChooser2Change( 0 ); 819 slotCmbChooser2Change( 0 );
819 break; 820 break;
820 case 3: 821 case 3:
821 cmbChooserField3 -> setCurrentItem( 0 ); 822 cmbChooserField3 -> setCurrentItem( 0 );
822 slotCmbChooser3Change( 0 ); 823 slotCmbChooser3Change( 0 );
823 break; 824 break;
824 case 4: 825 case 4:
825 cmbChooserField4 -> setCurrentItem( 0 ); 826 cmbChooserField4 -> setCurrentItem( 0 );
826 slotCmbChooser4Change( 0 ); 827 slotCmbChooser4Change( 0 );
827 break; 828 break;
828 } 829 }
829} 830}
830 831
831// Called when something was changed in a textfield (shouldn't it called textchanged? (se)) 832// Called when something was changed in a textfield (shouldn't it called textchanged? (se))
832void ContactEditor::chooserChange( const QString &textChanged, int index, 833void ContactEditor::chooserChange( const QString &textChanged, int index,
833 QLineEdit* , int widgetPos ) { 834 QLineEdit* , int widgetPos ) {
834 835
835 QString type = slChooserNames[index]; // :SX 836 QString type = slChooserNames[index]; // :SX
836 qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i", 837 qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",
837 type.latin1(),textChanged.latin1(), index, widgetPos ); 838 type.latin1(),textChanged.latin1(), index, widgetPos );
838 839
839 if ( type == "Default Email"){ 840 if ( type == "Default Email"){
840 qWarning ("??? Wozu??: %s", textChanged.latin1()); 841 qWarning ("??? Wozu??: %s", textChanged.latin1());
841 defaultEmail = textChanged; 842 defaultEmail = textChanged;
842 843
843 populateDefaultEmailCmb(); 844 populateDefaultEmailCmb();
844 845
845 }else if (type == "Emails"){ 846 }else if (type == "Emails"){
846 qDebug("emails"); 847 qDebug("emails");
847 848
848 QString de; 849 QString de;
849 emails = QStringList::split (",", textChanged ); 850 emails = QStringList::split (",", textChanged );
850 851
851 populateDefaultEmailCmb(); 852 populateDefaultEmailCmb();
852 } 853 }
853 854
854 slChooserValues[index] = textChanged; 855 slChooserValues[index] = textChanged;
855 856
856} 857}
857 858
858void ContactEditor::slotChooser1Change( const QString &textChanged ) { 859void ContactEditor::slotChooser1Change( const QString &textChanged ) {
859 qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1()); 860 qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1());
860 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); 861 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1);
861} 862}
862 863
863void ContactEditor::slotChooser2Change( const QString &textChanged ) { 864void ContactEditor::slotChooser2Change( const QString &textChanged ) {
864 qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1()); 865 qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1());
865 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); 866 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2);
866 867
867} 868}
868 869
869void ContactEditor::slotChooser3Change( const QString &textChanged ) { 870void ContactEditor::slotChooser3Change( const QString &textChanged ) {
870 qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1()); 871 qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1());
871 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); 872 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3);
872} 873}
873 874
874void ContactEditor::slotChooser4Change( const QString &textChanged ) { 875void ContactEditor::slotChooser4Change( const QString &textChanged ) {
875 qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1()); 876 qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1());
876 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); 877 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4);
877} 878}
878 879
879void ContactEditor::slotAddressChange( const QString &textChanged ) { 880void ContactEditor::slotAddressChange( const QString &textChanged ) {
880 881
881 if ( cmbAddress->currentItem() == 0 ) { 882 if ( cmbAddress->currentItem() == 0 ) {
882 slBusinessAddress[0] = textChanged; 883 slBusinessAddress[0] = textChanged;
883 } else { 884 } else {
884 slHomeAddress[0] = textChanged; 885 slHomeAddress[0] = textChanged;
885 } 886 }
886} 887}
887 888
888void ContactEditor::slotAddress2Change( const QString &textChanged ) { 889void ContactEditor::slotAddress2Change( const QString &textChanged ) {
889 890
890 if ( cmbAddress->currentItem() == 0 ) { 891 if ( cmbAddress->currentItem() == 0 ) {
891 slBusinessAddress[1] = textChanged; 892 slBusinessAddress[1] = textChanged;
892 } else { 893 } else {
893 slHomeAddress[1] = textChanged; 894 slHomeAddress[1] = textChanged;
894 } 895 }
895} 896}
896 897
897void ContactEditor::slotPOBoxChange( const QString &textChanged ) { 898void ContactEditor::slotPOBoxChange( const QString &textChanged ) {
898 899
899 if ( cmbAddress->currentItem() == 0 ) { 900 if ( cmbAddress->currentItem() == 0 ) {
900 slBusinessAddress[2] = textChanged; 901 slBusinessAddress[2] = textChanged;
901 } else { 902 } else {
902 slHomeAddress[2] = textChanged; 903 slHomeAddress[2] = textChanged;
903 } 904 }
904} 905}
905 906
906void ContactEditor::slotCityChange( const QString &textChanged ) { 907void ContactEditor::slotCityChange( const QString &textChanged ) {
907 908
908 if ( cmbAddress->currentItem() == 0 ) { 909 if ( cmbAddress->currentItem() == 0 ) {
909 slBusinessAddress[3] = textChanged; 910 slBusinessAddress[3] = textChanged;
910 } else { 911 } else {
911 slHomeAddress[3] = textChanged; 912 slHomeAddress[3] = textChanged;
912 } 913 }
913} 914}
914 915
915void ContactEditor::slotStateChange( const QString &textChanged ) { 916void ContactEditor::slotStateChange( const QString &textChanged ) {
916 917
917 918
918 if ( cmbAddress->currentItem() == 0 ) { 919 if ( cmbAddress->currentItem() == 0 ) {
919 slBusinessAddress[4] = textChanged; 920 slBusinessAddress[4] = textChanged;
920 } else { 921 } else {
921 slHomeAddress[4] = textChanged; 922 slHomeAddress[4] = textChanged;
922 } 923 }
923} 924}
924 925
925void ContactEditor::slotZipChange( const QString &textChanged ) { 926void ContactEditor::slotZipChange( const QString &textChanged ) {
926 927
927 if ( cmbAddress->currentItem() == 0 ) { 928 if ( cmbAddress->currentItem() == 0 ) {
928 slBusinessAddress[5] = textChanged; 929 slBusinessAddress[5] = textChanged;
929 } else { 930 } else {
930 slHomeAddress[5] = textChanged; 931 slHomeAddress[5] = textChanged;
931 } 932 }
932} 933}
933 934
934void ContactEditor::slotCountryChange( const QString &textChanged ) { 935void ContactEditor::slotCountryChange( const QString &textChanged ) {
935 936
936 if ( cmbAddress->currentItem() == 0 ) { 937 if ( cmbAddress->currentItem() == 0 ) {
937 slBusinessAddress[6] = textChanged; 938 slBusinessAddress[6] = textChanged;
938 } else { 939 } else {
939 slHomeAddress[6] = textChanged; 940 slHomeAddress[6] = textChanged;
940 } 941 }
941} 942}
942 943
943 944
944void ContactEditor::slotCmbChooser1Change( int index ) { 945void ContactEditor::slotCmbChooser1Change( int index ) {
945 qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); 946 qWarning("ContactEditor::slotCmbChooser1Change( %d )", index);
946 if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ 947 if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){
947 948
948 txtChooserField1->setText( slChooserValues[index] ); 949 txtChooserField1->setText( slChooserValues[index] );
949 txtChooserField1->setFocus(); 950 txtChooserField1->setFocus();
950 951
951 } 952 }
952 953
953} 954}
954 955
955void ContactEditor::slotCmbChooser2Change( int index ) { 956void ContactEditor::slotCmbChooser2Change( int index ) {
956 qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); 957 qWarning("ContactEditor::slotCmbChooser2Change( %d )", index);
957 958
958 if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ 959 if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){
959 960
960 txtChooserField2->setText( slChooserValues[index] ); 961 txtChooserField2->setText( slChooserValues[index] );
961 txtChooserField2->setFocus(); 962 txtChooserField2->setFocus();
962 963
963 } 964 }
964} 965}
965 966
966void ContactEditor::slotCmbChooser3Change( int index ) { 967void ContactEditor::slotCmbChooser3Change( int index ) {
967 qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); 968 qWarning("ContactEditor::slotCmbChooser3Change( %d )", index);
968 969
969 if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ 970 if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){
970 971
971 txtChooserField3->setText( slChooserValues[index] ); 972 txtChooserField3->setText( slChooserValues[index] );
972 txtChooserField3->setFocus(); 973 txtChooserField3->setFocus();
973 974
974 } 975 }
975} 976}
976 977
977void ContactEditor::slotCmbChooser4Change( int index ) { 978void ContactEditor::slotCmbChooser4Change( int index ) {
978 qWarning("ContactEditor::slotCmbChooser4Change( %d )", index); 979 qWarning("ContactEditor::slotCmbChooser4Change( %d )", index);
979 980
980 if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ 981 if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){
981 982
982 txtChooserField4->setText( slChooserValues[index] ); 983 txtChooserField4->setText( slChooserValues[index] );
983 txtChooserField4->setFocus(); 984 txtChooserField4->setFocus();
984 985
985 } 986 }
986} 987}
987 988
988void ContactEditor::slotAddressTypeChange( int index ) { 989void ContactEditor::slotAddressTypeChange( int index ) {
989 990
990 991
991 if ( !initializing ) 992 if ( !initializing )
992 contactfields.setFieldOrder( 4, index ); 993 contactfields.setFieldOrder( 4, index );
993 994
994 995
995 if ( index == 0 ) { 996 if ( index == 0 ) {
996 997
997 txtAddress->setText( slBusinessAddress[0] ); 998 txtAddress->setText( slBusinessAddress[0] );
998 //txtAddress2->setText( (*slBusinessAddress)[1] ); 999 //txtAddress2->setText( (*slBusinessAddress)[1] );
999 //txtPOBox->setText( (*slBusinessAddress)[2] ); 1000 //txtPOBox->setText( (*slBusinessAddress)[2] );
1000 txtCity->setText( slBusinessAddress[3] ); 1001 txtCity->setText( slBusinessAddress[3] );
1001 txtState->setText( slBusinessAddress[4] ); 1002 txtState->setText( slBusinessAddress[4] );
1002 txtZip->setText( slBusinessAddress[5] ); 1003 txtZip->setText( slBusinessAddress[5] );
1003 QLineEdit *txtTmp = cmbCountry->lineEdit(); 1004 QLineEdit *txtTmp = cmbCountry->lineEdit();
1004 txtTmp->setText( slBusinessAddress[6] ); 1005 txtTmp->setText( slBusinessAddress[6] );
1005 1006
1006 } else { 1007 } else {
1007 1008
1008 txtAddress->setText( slHomeAddress[0] ); 1009 txtAddress->setText( slHomeAddress[0] );
1009 //txtAddress2->setText( (*slHomeAddress)[1] ); 1010 //txtAddress2->setText( (*slHomeAddress)[1] );
1010 //txtPOBox->setText( (*slHomeAddress)[2] ); 1011 //txtPOBox->setText( (*slHomeAddress)[2] );
1011 txtCity->setText( slHomeAddress[3] ); 1012 txtCity->setText( slHomeAddress[3] );
1012 txtState->setText( slHomeAddress[4] ); 1013 txtState->setText( slHomeAddress[4] );
1013 txtZip->setText( slHomeAddress[5] ); 1014 txtZip->setText( slHomeAddress[5] );
1014 QLineEdit *txtTmp = cmbCountry->lineEdit(); 1015 QLineEdit *txtTmp = cmbCountry->lineEdit();
1015 txtTmp->setText( slHomeAddress[6] ); 1016 txtTmp->setText( slHomeAddress[6] );
1016 1017
1017 } 1018 }
1018 1019
1019} 1020}
1020 1021
1021void ContactEditor::slotFullNameChange( const QString &textChanged ) { 1022void ContactEditor::slotFullNameChange( const QString &textChanged ) {
1022 1023
1023 qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); 1024 qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() );
1024 1025
1025 int index = cmbFileAs->currentItem(); 1026 int index = cmbFileAs->currentItem();
1026 1027
1027 cmbFileAs->clear(); 1028 cmbFileAs->clear();
1028 1029
1029 cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); 1030 cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) );
1030 cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); 1031 cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) );
1031 cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); 1032 cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) );
1032 cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) ); 1033 cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) );
1033 if ( ! txtSuffix->text().isEmpty() ) 1034 if ( ! txtSuffix->text().isEmpty() )
1034 cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); 1035 cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() );
1035 1036
1036 cmbFileAs->setCurrentItem( index ); 1037 cmbFileAs->setCurrentItem( index );
1037 1038
1038 1039
1039} 1040}
1040 1041
1041void ContactEditor::slotSuffixChange( const QString& ) { 1042void ContactEditor::slotSuffixChange( const QString& ) {
1042 // Just want to update the FileAs combo if the suffix was changed.. 1043 // Just want to update the FileAs combo if the suffix was changed..
1043 slotFullNameChange( txtFullName->text() ); 1044 slotFullNameChange( txtFullName->text() );
1044} 1045}
1045 1046
1046void ContactEditor::accept() { 1047void ContactEditor::accept() {
1047 1048
1048 if ( isEmpty() ) { 1049 if ( isEmpty() ) {
1049 cleanupFields(); 1050 cleanupFields();
1050 reject(); 1051 reject();
1051 } else { 1052 } else {
1052 saveEntry(); 1053 saveEntry();
1053 cleanupFields(); 1054 cleanupFields();
1054 QDialog::accept(); 1055 QDialog::accept();
1055 } 1056 }
1056 1057
1057} 1058}
1058 1059
1059void ContactEditor::slotNote() { 1060void ContactEditor::slotNote() {
1060 1061
1061 dlgNote->showMaximized(); 1062 dlgNote->showMaximized();
1062 if ( !dlgNote->exec() ) { 1063 if ( !dlgNote->exec() ) {
1063 txtNote->setText( ent.notes() ); 1064 txtNote->setText( ent.notes() );
1064 } 1065 }
1065} 1066}
1066 1067
1067void ContactEditor::slotName() { 1068void ContactEditor::slotName() {
1068 1069
1069 QString tmpName; 1070 QString tmpName;
1070 1071
1071 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); 1072 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) );
1072 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); 1073 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) );
1073 txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); 1074 txtLastName->setText( parseName(txtFullName->text(), NAME_L) );
1074 // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); 1075 // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) );
1075 1076
1076 dlgName->showMaximized(); 1077 dlgName->showMaximized();
1077 if ( dlgName->exec() ) { 1078 if ( dlgName->exec() ) {
1078 if ( txtLastName->text().contains( ' ', TRUE ) ) 1079 if ( txtLastName->text().contains( ' ', TRUE ) )
1079 tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); 1080 tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text();
1080 else 1081 else
1081 tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); 1082 tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text();
1082 1083
1083 txtFullName->setText( tmpName.simplifyWhiteSpace() ); 1084 txtFullName->setText( tmpName.simplifyWhiteSpace() );
1084 slotFullNameChange( txtFullName->text() ); 1085 slotFullNameChange( txtFullName->text() );
1085 } 1086 }
1086 1087
1087} 1088}
1088 1089
1089void ContactEditor::setNameFocus() { 1090void ContactEditor::setNameFocus() {
1090 1091
1091 txtFullName->setFocus(); 1092 txtFullName->setFocus();
1092 1093
1093} 1094}
1094 1095
1095bool ContactEditor::isEmpty() { 1096bool ContactEditor::isEmpty() {
1096 // Test and see if the record should be saved. 1097 // Test and see if the record should be saved.
1097 // More strict than the original qtopia, needs name or fileas to save 1098 // More strict than the original qtopia, needs name or fileas to save
1098 1099
1099 QString t = txtFullName->text(); 1100 QString t = txtFullName->text();
1100 if ( !t.isEmpty() && containsAlphaNum( t ) ) 1101 if ( !t.isEmpty() && containsAlphaNum( t ) )
1101 return false; 1102 return false;
1102 1103
1103 t = cmbFileAs->currentText(); 1104 t = cmbFileAs->currentText();
1104 if ( !t.isEmpty() && containsAlphaNum( t ) ) 1105 if ( !t.isEmpty() && containsAlphaNum( t ) )
1105 return false; 1106 return false;
1106 1107
1107 return true; 1108 return true;
1108 1109
1109} 1110}
1110 1111
1111QString ContactEditor::parseName( const QString fullName, int type ) { 1112QString ContactEditor::parseName( const QString fullName, int type ) {
1112 1113
1113 QString simplifiedName( fullName.simplifyWhiteSpace() ); 1114 QString simplifiedName( fullName.simplifyWhiteSpace() );
1114 QString strFirstName; 1115 QString strFirstName;
1115 QString strMiddleName; 1116 QString strMiddleName;
1116 QString strLastName; 1117 QString strLastName;
1117 QString strTitle; 1118 QString strTitle;
1118 int commapos; 1119 int commapos;
1119 bool haveLastName = false; 1120 bool haveLastName = false;
1120 1121
1121 qWarning("Fullname: %s", simplifiedName.latin1()); 1122 qWarning("Fullname: %s", simplifiedName.latin1());
1122 1123
1123 commapos = simplifiedName.find( ',', 0, TRUE); 1124 commapos = simplifiedName.find( ',', 0, TRUE);
1124 if ( commapos >= 0 ) { 1125 if ( commapos >= 0 ) {
1125 qWarning(" Commapos: %d", commapos ); 1126 qWarning(" Commapos: %d", commapos );
1126 1127
1127 // A comma (",") separates the lastname from one or 1128 // A comma (",") separates the lastname from one or
1128 // many first names. Thus, remove the lastname from the 1129 // many first names. Thus, remove the lastname from the
1129 // String and parse the firstnames. 1130 // String and parse the firstnames.
1130 1131
1131 strLastName = simplifiedName.left( commapos ); 1132 strLastName = simplifiedName.left( commapos );
1132 simplifiedName= simplifiedName.mid( commapos + 1 ); 1133 simplifiedName= simplifiedName.mid( commapos + 1 );
1133 haveLastName = true; 1134 haveLastName = true;
1134 qWarning("Fullname without ',': %s", simplifiedName.latin1()); 1135 qWarning("Fullname without ',': %s", simplifiedName.latin1());
1135 1136
1136 // If we have any lastname, we should now split all first names. 1137 // If we have any lastname, we should now split all first names.
1137 // The first one will be the used as first, the rest as "middle names" 1138 // The first one will be the used as first, the rest as "middle names"
1138 1139
1139 QStringList allFirstNames = QStringList::split(" ", simplifiedName); 1140 QStringList allFirstNames = QStringList::split(" ", simplifiedName);
1140 QStringList::Iterator it = allFirstNames.begin(); 1141 QStringList::Iterator it = allFirstNames.begin();
1141 strFirstName = *it++; 1142 strFirstName = *it++;
1142 QStringList allSecondNames; 1143 QStringList allSecondNames;
1143 for ( ; it != allFirstNames.end(); ++it ) 1144 for ( ; it != allFirstNames.end(); ++it )
1144 allSecondNames.append( *it ); 1145 allSecondNames.append( *it );
1145 1146
1146 strMiddleName = allSecondNames.join(" "); 1147 strMiddleName = allSecondNames.join(" ");
1147 1148
1148 } else { 1149 } else {
1149 1150
1150 // No comma separator used: We use the first word as firstname, the 1151 // No comma separator used: We use the first word as firstname, the
1151 // last as second/lastname and everything in the middle as middlename 1152 // last as second/lastname and everything in the middle as middlename
1152 1153
1153 QStringList allNames = QStringList::split(" ", simplifiedName); 1154 QStringList allNames = QStringList::split(" ", simplifiedName);
1154 QStringList::Iterator it = allNames.begin(); 1155 QStringList::Iterator it = allNames.begin();
1155 strFirstName = *it++; 1156 strFirstName = *it++;
1156 QStringList allSecondNames; 1157 QStringList allSecondNames;
1157 for ( ; it != --allNames.end(); ++it ) 1158 for ( ; it != --allNames.end(); ++it )
1158 allSecondNames.append( *it ); 1159 allSecondNames.append( *it );
1159 1160
1160 strMiddleName = allSecondNames.join(" "); 1161 strMiddleName = allSecondNames.join(" ");
1161 strLastName = *(--allNames.end()); 1162 strLastName = *(--allNames.end());
1162 1163
1163 } 1164 }
1164 1165
1165 if ( strFirstName == strLastName ) 1166 if ( strFirstName == strLastName )
1166 strFirstName = ""; 1167 strFirstName = "";
1167 1168
1168 qWarning(" strFirstName: %s", strFirstName.latin1()); 1169 qWarning(" strFirstName: %s", strFirstName.latin1());
1169 qWarning(" strMiddleName: %s", strMiddleName.latin1()); 1170 qWarning(" strMiddleName: %s", strMiddleName.latin1());
1170 qWarning(" strLastName: %s", strLastName.latin1()); 1171 qWarning(" strLastName: %s", strLastName.latin1());
1171 qWarning(" strTitle: %s", strTitle.latin1()); 1172 qWarning(" strTitle: %s", strTitle.latin1());
1172 1173
1173 switch (type) { 1174 switch (type) {
1174 case NAME_FL: 1175 case NAME_FL:
1175 return strFirstName + " " + strLastName; 1176 return strFirstName + " " + strLastName;
1176 1177
1177 case NAME_LF: 1178 case NAME_LF:
1178 return strLastName + ", " + strFirstName; 1179 return strLastName + ", " + strFirstName;
1179 1180
1180 case NAME_LFM: 1181 case NAME_LFM:
1181 return strLastName + ", " + strFirstName + " " + strMiddleName; 1182 return strLastName + ", " + strFirstName + " " + strMiddleName;
1182 1183
1183 case NAME_FML: 1184 case NAME_FML:
1184 return strFirstName + " " + strMiddleName + " " + strLastName ; 1185 return strFirstName + " " + strMiddleName + " " + strLastName ;
1185 1186
1186 case NAME_F: 1187 case NAME_F:
1187 return strFirstName; 1188 return strFirstName;
1188 1189
1189 case NAME_M: 1190 case NAME_M:
1190 return strMiddleName; 1191 return strMiddleName;
1191 1192
1192 case NAME_L: 1193 case NAME_L:
1193 return strLastName; 1194 return strLastName;
1194 1195
1195 case NAME_S: 1196 case NAME_S:
1196 return txtSuffix->text(); 1197 return txtSuffix->text();
1197 1198
1198 } 1199 }
1199 return QString::null; 1200 return QString::null;
1200} 1201}
1201 1202
1202void ContactEditor::cleanupFields() { 1203void ContactEditor::cleanupFields() {
1203 QStringList::Iterator it = slChooserValues.begin(); 1204 QStringList::Iterator it = slChooserValues.begin();
1204 1205
1205 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { 1206 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) {
1206 (*it) = ""; 1207 (*it) = "";
1207 } 1208 }
1208 1209
1209 for ( int i = 0; i < 7; i++ ) { 1210 for ( int i = 0; i < 7; i++ ) {
1210 slHomeAddress[i] = ""; 1211 slHomeAddress[i] = "";
1211 slBusinessAddress[i] = ""; 1212 slBusinessAddress[i] = "";
1212 } 1213 }
1213 1214
1214 QListIterator<QLineEdit> itLV( listValue ); 1215 QListIterator<QLineEdit> itLV( listValue );
1215 for ( ; itLV.current(); ++itLV ) { 1216 for ( ; itLV.current(); ++itLV ) {
1216 (*itLV)->setText( "" ); 1217 (*itLV)->setText( "" );
1217 } 1218 }
1218 1219
1219 txtFirstName->setText(""); 1220 txtFirstName->setText("");
1220 txtMiddleName->setText(""); 1221 txtMiddleName->setText("");
1221 txtLastName->setText(""); 1222 txtLastName->setText("");
1222 txtSuffix->setText(""); 1223 txtSuffix->setText("");
1223 txtNote->setText(""); 1224 txtNote->setText("");
1224 txtFullName->setText(""); 1225 txtFullName->setText("");
1225 txtJobTitle->setText(""); 1226 txtJobTitle->setText("");
1226 txtOrganization->setText(""); 1227 txtOrganization->setText("");
1227 txtChooserField1->setText(""); 1228 txtChooserField1->setText("");
1228 txtChooserField2->setText(""); 1229 txtChooserField2->setText("");
1229 txtChooserField3->setText(""); 1230 txtChooserField3->setText("");
1230 txtAddress->setText(""); 1231 txtAddress->setText("");
1231 txtCity->setText(""); 1232 txtCity->setText("");
1232 txtState->setText(""); 1233 txtState->setText("");
1233 txtZip->setText(""); 1234 txtZip->setText("");
1234 QLineEdit *txtTmp = cmbCountry->lineEdit(); 1235 QLineEdit *txtTmp = cmbCountry->lineEdit();
1235 txtTmp->setText(""); 1236 txtTmp->setText("");
1236 txtTmp = cmbFileAs->lineEdit(); 1237 txtTmp = cmbFileAs->lineEdit();
1237 txtTmp->setText(""); 1238 txtTmp->setText("");
1238 1239
1239} 1240}
1240 1241
1241void ContactEditor::setEntry( const OContact &entry ) { 1242void ContactEditor::setEntry( const OContact &entry ) {
1242 1243
1243 initializing = true; 1244 initializing = true;
1244 1245
1245 cleanupFields(); 1246 cleanupFields();
1246 1247
1247 ent = entry; 1248 ent = entry;
1248 1249
1249 emails = QStringList(ent.emailList()); 1250 emails = QStringList(ent.emailList());
1250 defaultEmail = ent.defaultEmail(); 1251 defaultEmail = ent.defaultEmail();
1251 if (defaultEmail.isEmpty()) defaultEmail = emails[0]; 1252 if (defaultEmail.isEmpty()) defaultEmail = emails[0];
1252 qDebug("default email=%s",defaultEmail.latin1()); 1253 qDebug("default email=%s",defaultEmail.latin1());
1253 1254
1254 txtFirstName->setText( ent.firstName() ); 1255 txtFirstName->setText( ent.firstName() );
1255 txtMiddleName->setText( ent.middleName() ); 1256 txtMiddleName->setText( ent.middleName() );
1256 txtLastName->setText( ent.lastName() ); 1257 txtLastName->setText( ent.lastName() );
1257 txtSuffix->setText( ent.suffix() ); 1258 txtSuffix->setText( ent.suffix() );
1258 1259
1259 // QString *tmpString = new QString; 1260 // QString *tmpString = new QString;
1260 // *tmpString = ent.firstName() + " " + ent.middleName() + 1261 // *tmpString = ent.firstName() + " " + ent.middleName() +
1261 // + " " + ent.lastName() + " " + ent.suffix(); 1262 // + " " + ent.lastName() + " " + ent.suffix();
1262 //txtFullName->setText( tmpString->simplifyWhiteSpace() ); 1263 //txtFullName->setText( tmpString->simplifyWhiteSpace() );
1263 1264
1264 if ( !ent.isEmpty() ){ 1265 if ( !ent.isEmpty() ){
1265 // Lastnames with multiple words need to be protected by a comma ! 1266 // Lastnames with multiple words need to be protected by a comma !
1266 if ( ent.lastName().contains( ' ', TRUE ) ) 1267 if ( ent.lastName().contains( ' ', TRUE ) )
1267 txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); 1268 txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() );
1268 else 1269 else
1269 txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); 1270 txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() );
1270 } 1271 }
1271 1272
1272 cmbFileAs->setEditText( ent.fileAs() ); 1273 cmbFileAs->setEditText( ent.fileAs() );
1273 1274
1274 //if (hasTitle) 1275 //if (hasTitle)
1275 txtJobTitle->setText( ent.jobTitle() ); 1276 txtJobTitle->setText( ent.jobTitle() );
1276 1277
1277 //if (hasCompany) 1278 //if (hasCompany)
1278 txtOrganization->setText( ent.company() ); 1279 txtOrganization->setText( ent.company() );
1279 1280
1280 //if (hasNotes) 1281 //if (hasNotes)
1281 txtNote->setText( ent.notes() ); 1282 txtNote->setText( ent.notes() );
1282 1283
1283 //if (hasStreet) { 1284 //if (hasStreet) {
1284 slHomeAddress[0] = ent.homeStreet(); 1285 slHomeAddress[0] = ent.homeStreet();
1285 slBusinessAddress[0] = ent.businessStreet(); 1286 slBusinessAddress[0] = ent.businessStreet();
1286 //} 1287 //}
1287 1288
1288 //if (hasCity) { 1289 //if (hasCity) {
1289 slHomeAddress[3] = ent.homeCity(); 1290 slHomeAddress[3] = ent.homeCity();
1290 slBusinessAddress[3] = ent.businessCity(); 1291 slBusinessAddress[3] = ent.businessCity();
1291 //} 1292 //}
1292 1293
1293 //if (hasState) { 1294 //if (hasState) {
1294 slHomeAddress[4] = ent.homeState(); 1295 slHomeAddress[4] = ent.homeState();
1295 slBusinessAddress[4] = ent.businessState(); 1296 slBusinessAddress[4] = ent.businessState();
1296 //} 1297 //}
1297 1298