-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 4e73114..254cff7 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -1,1583 +1,1583 @@ | |||
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 | 49 | ||
50 | static inline bool containsAlphaNum( const QString &str ); | 50 | static inline bool containsAlphaNum( const QString &str ); |
51 | static inline bool constainsWhiteSpace( const QString &str ); | 51 | static inline bool constainsWhiteSpace( const QString &str ); |
52 | 52 | ||
53 | // helper functions, convert our comma delimited list to proper | 53 | // helper functions, convert our comma delimited list to proper |
54 | // file format... | 54 | // file format... |
55 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 55 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
56 | QString &strAll ); | 56 | QString &strAll ); |
57 | 57 | ||
58 | // helper convert from file format to comma delimited... | 58 | // helper convert from file format to comma delimited... |
59 | void parseEmailTo( const QString &strDefaultEmail, | 59 | void parseEmailTo( const QString &strDefaultEmail, |
60 | const QString &strOtherEmail, QString &strBack ); | 60 | const QString &strOtherEmail, QString &strBack ); |
61 | 61 | ||
62 | ContactEditor::ContactEditor(const OContact &entry, | 62 | ContactEditor::ContactEditor(const OContact &entry, |
63 | QWidget *parent, | 63 | QWidget *parent, |
64 | const char *name, | 64 | const char *name, |
65 | WFlags fl ) | 65 | WFlags fl ) |
66 | : QDialog( parent, name, TRUE, fl ), | 66 | : QDialog( parent, name, TRUE, fl ), |
67 | m_personalView ( false ) | 67 | m_personalView ( false ) |
68 | 68 | ||
69 | { | 69 | { |
70 | 70 | ||
71 | init(); | 71 | init(); |
72 | setEntry( entry ); | 72 | setEntry( entry ); |
73 | cmbDefaultEmail = 0; | 73 | cmbDefaultEmail = 0; |
74 | defaultEmailChooserPosition = -1; | 74 | defaultEmailChooserPosition = -1; |
75 | } | 75 | } |
76 | 76 | ||
77 | ContactEditor::~ContactEditor() { | 77 | ContactEditor::~ContactEditor() { |
78 | } | 78 | } |
79 | 79 | ||
80 | void ContactEditor::init() { | 80 | void ContactEditor::init() { |
81 | 81 | ||
82 | useFullName = true; | 82 | useFullName = true; |
83 | 83 | ||
84 | uint i = 0; | 84 | uint i = 0; |
85 | 85 | ||
86 | QStringList trlChooserNames; | 86 | QStringList trlChooserNames; |
87 | 87 | ||
88 | for (i = 0; i <= 6; i++) { | 88 | for (i = 0; i <= 6; i++) { |
89 | slHomeAddress.append( "" ); | 89 | slHomeAddress.append( "" ); |
90 | slBusinessAddress.append( "" ); | 90 | slBusinessAddress.append( "" ); |
91 | } | 91 | } |
92 | 92 | ||
93 | trlChooserNames = OContactFields::trphonefields(); | 93 | trlChooserNames = OContactFields::trphonefields( false ); |
94 | slChooserNames = OContactFields::untrphonefields(); | 94 | slChooserNames = OContactFields::untrphonefields( false ); |
95 | slDynamicEntries = OContactFields::untrdetailsfields(); | 95 | slDynamicEntries = OContactFields::untrdetailsfields( false ); |
96 | trlDynamicEntries = OContactFields::trdetailsfields(); | 96 | trlDynamicEntries = OContactFields::trdetailsfields( false ); |
97 | for (i = 0; i < slChooserNames.count(); i++) | 97 | for (i = 0; i < slChooserNames.count(); i++) |
98 | slChooserValues.append(""); | 98 | slChooserValues.append(""); |
99 | 99 | ||
100 | 100 | ||
101 | QVBoxLayout *vb = new QVBoxLayout( this ); | 101 | QVBoxLayout *vb = new QVBoxLayout( this ); |
102 | 102 | ||
103 | tabMain = new QTabWidget( this ); | 103 | tabMain = new QTabWidget( this ); |
104 | vb->addWidget( tabMain ); | 104 | vb->addWidget( tabMain ); |
105 | 105 | ||
106 | QWidget *tabViewport = new QWidget ( tabMain ); | 106 | QWidget *tabViewport = new QWidget ( tabMain ); |
107 | 107 | ||
108 | vb = new QVBoxLayout( tabViewport ); | 108 | vb = new QVBoxLayout( tabViewport ); |
109 | 109 | ||
110 | svGeneral = new QScrollView( tabViewport ); | 110 | svGeneral = new QScrollView( tabViewport ); |
111 | vb->addWidget( svGeneral, 0, 0 ); | 111 | vb->addWidget( svGeneral, 0, 0 ); |
112 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 112 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
113 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 113 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
114 | 114 | ||
115 | QWidget *container = new QWidget( svGeneral->viewport() ); | 115 | QWidget *container = new QWidget( svGeneral->viewport() ); |
116 | svGeneral->addChild( container ); | 116 | svGeneral->addChild( container ); |
117 | 117 | ||
118 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 118 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); |
119 | gl->setResizeMode( QLayout::FreeResize ); | 119 | gl->setResizeMode( QLayout::FreeResize ); |
120 | 120 | ||
121 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 121 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
122 | gl->addWidget( btnFullName, 0, 0 ); | 122 | gl->addWidget( btnFullName, 0, 0 ); |
123 | txtFullName = new QLineEdit( container ); | 123 | txtFullName = new QLineEdit( container ); |
124 | gl->addWidget( txtFullName, 0, 1 ); | 124 | gl->addWidget( txtFullName, 0, 1 ); |
125 | 125 | ||
126 | QLabel *l = new QLabel( tr( "Job Title" ), container ); | 126 | QLabel *l = new QLabel( tr( "Job Title" ), container ); |
127 | gl->addWidget( l, 1, 0 ); | 127 | gl->addWidget( l, 1, 0 ); |
128 | txtJobTitle = new QLineEdit( container ); | 128 | txtJobTitle = new QLineEdit( container ); |
129 | gl->addWidget( txtJobTitle, 1, 1 ); | 129 | gl->addWidget( txtJobTitle, 1, 1 ); |
130 | 130 | ||
131 | l = new QLabel( tr( "Organization" ), container ); | 131 | l = new QLabel( tr( "Organization" ), container ); |
132 | gl->addWidget( l, 2, 0 ); | 132 | gl->addWidget( l, 2, 0 ); |
133 | txtOrganization = new QLineEdit( container ); | 133 | txtOrganization = new QLineEdit( container ); |
134 | gl->addWidget( txtOrganization, 2, 1 ); | 134 | gl->addWidget( txtOrganization, 2, 1 ); |
135 | 135 | ||
136 | cmbChooserField1 = new QComboBox( FALSE, container ); | 136 | cmbChooserField1 = new QComboBox( FALSE, container ); |
137 | cmbChooserField1->setMaximumWidth( 90 ); | 137 | cmbChooserField1->setMaximumWidth( 90 ); |
138 | gl->addWidget( cmbChooserField1, 3, 0 ); | 138 | gl->addWidget( cmbChooserField1, 3, 0 ); |
139 | txtChooserField1 = new QLineEdit( container ); | 139 | txtChooserField1 = new QLineEdit( container ); |
140 | gl->addWidget( txtChooserField1, 3, 1 ); | 140 | gl->addWidget( txtChooserField1, 3, 1 ); |
141 | 141 | ||
142 | cmbChooserField2 = new QComboBox( FALSE, container ); | 142 | cmbChooserField2 = new QComboBox( FALSE, container ); |
143 | cmbChooserField2->setMaximumWidth( 90 ); | 143 | cmbChooserField2->setMaximumWidth( 90 ); |
144 | gl->addWidget( cmbChooserField2, 4, 0 ); | 144 | gl->addWidget( cmbChooserField2, 4, 0 ); |
145 | txtChooserField2 = new QLineEdit( container ); | 145 | txtChooserField2 = new QLineEdit( container ); |
146 | gl->addWidget( txtChooserField2, 4, 1 ); | 146 | gl->addWidget( txtChooserField2, 4, 1 ); |
147 | 147 | ||
148 | cmbChooserField3 = new QComboBox( FALSE, container ); | 148 | cmbChooserField3 = new QComboBox( FALSE, container ); |
149 | cmbChooserField3->setMaximumWidth( 90 ); | 149 | cmbChooserField3->setMaximumWidth( 90 ); |
150 | gl->addWidget( cmbChooserField3, 5, 0 ); | 150 | gl->addWidget( cmbChooserField3, 5, 0 ); |
151 | txtChooserField3 = new QLineEdit( container ); | 151 | txtChooserField3 = new QLineEdit( container ); |
152 | gl->addWidget( txtChooserField3, 5, 1 ); | 152 | gl->addWidget( txtChooserField3, 5, 1 ); |
153 | 153 | ||
154 | l = new QLabel( tr( "File As" ), container ); | 154 | l = new QLabel( tr( "File As" ), container ); |
155 | gl->addWidget( l, 6, 0 ); | 155 | gl->addWidget( l, 6, 0 ); |
156 | cmbFileAs = new QComboBox( TRUE, container ); | 156 | cmbFileAs = new QComboBox( TRUE, container ); |
157 | gl->addWidget( cmbFileAs, 6, 1 ); | 157 | gl->addWidget( cmbFileAs, 6, 1 ); |
158 | 158 | ||
159 | labCat = new QLabel( tr( "Category" ), container ); | 159 | labCat = new QLabel( tr( "Category" ), container ); |
160 | gl->addWidget( labCat, 7, 0 ); | 160 | gl->addWidget( labCat, 7, 0 ); |
161 | cmbCat = new CategorySelect( container ); | 161 | cmbCat = new CategorySelect( container ); |
162 | gl->addWidget( cmbCat, 7, 1 ); | 162 | gl->addWidget( cmbCat, 7, 1 ); |
163 | labCat->show(); | 163 | labCat->show(); |
164 | cmbCat->show(); | 164 | cmbCat->show(); |
165 | 165 | ||
166 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 166 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
167 | gl->addWidget( btnNote, 8, 1 ); | 167 | gl->addWidget( btnNote, 8, 1 ); |
168 | 168 | ||
169 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 169 | tabMain->insertTab( tabViewport, tr( "General" ) ); |
170 | 170 | ||
171 | tabViewport = new QWidget ( tabMain ); | 171 | tabViewport = new QWidget ( tabMain ); |
172 | 172 | ||
173 | vb = new QVBoxLayout( tabViewport ); | 173 | vb = new QVBoxLayout( tabViewport ); |
174 | 174 | ||
175 | svAddress = new QScrollView( tabViewport ); | 175 | svAddress = new QScrollView( tabViewport ); |
176 | vb->addWidget( svAddress, 0, 0 ); | 176 | vb->addWidget( svAddress, 0, 0 ); |
177 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 177 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
178 | svAddress->setFrameStyle( QFrame::NoFrame ); | 178 | svAddress->setFrameStyle( QFrame::NoFrame ); |
179 | 179 | ||
180 | container = new QWidget( svAddress->viewport() ); | 180 | container = new QWidget( svAddress->viewport() ); |
181 | svAddress->addChild( container ); | 181 | svAddress->addChild( container ); |
182 | 182 | ||
183 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem | 183 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
184 | 184 | ||
185 | cmbAddress = new QComboBox( FALSE, container ); | 185 | cmbAddress = new QComboBox( FALSE, container ); |
186 | cmbAddress->insertItem( tr( "Business" ) ); | 186 | cmbAddress->insertItem( tr( "Business" ) ); |
187 | cmbAddress->insertItem( tr( "Home" ) ); | 187 | cmbAddress->insertItem( tr( "Home" ) ); |
188 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 188 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
189 | 189 | ||
190 | l = new QLabel( tr( "Address" ), container ); | 190 | l = new QLabel( tr( "Address" ), container ); |
191 | gl->addWidget( l, 1, 0 ); | 191 | gl->addWidget( l, 1, 0 ); |
192 | txtAddress = new QLineEdit( container ); | 192 | txtAddress = new QLineEdit( container ); |
193 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); | 193 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); |
194 | 194 | ||
195 | l = new QLabel( tr( "City" ), container ); | 195 | l = new QLabel( tr( "City" ), container ); |
196 | gl->addWidget( l, 2, 0 ); | 196 | gl->addWidget( l, 2, 0 ); |
197 | txtCity = new QLineEdit( container ); | 197 | txtCity = new QLineEdit( container ); |
198 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); | 198 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); |
199 | 199 | ||
200 | l = new QLabel( tr( "State" ), container ); | 200 | l = new QLabel( tr( "State" ), container ); |
201 | gl->addWidget( l, 3, 0 ); | 201 | gl->addWidget( l, 3, 0 ); |
202 | txtState = new QLineEdit( container ); | 202 | txtState = new QLineEdit( container ); |
203 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); | 203 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); |
204 | 204 | ||
205 | l = new QLabel( tr( "Zip Code" ), container ); | 205 | l = new QLabel( tr( "Zip Code" ), container ); |
206 | gl->addWidget( l, 4, 0 ); | 206 | gl->addWidget( l, 4, 0 ); |
207 | txtZip = new QLineEdit( container ); | 207 | txtZip = new QLineEdit( container ); |
208 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); | 208 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); |
209 | 209 | ||
210 | l = new QLabel( tr( "Country" ), container ); | 210 | l = new QLabel( tr( "Country" ), container ); |
211 | gl->addWidget( l, 5, 0 ); | 211 | gl->addWidget( l, 5, 0 ); |
212 | cmbCountry = new QComboBox( TRUE, container ); | 212 | cmbCountry = new QComboBox( TRUE, container ); |
213 | cmbCountry->insertItem( tr( "" ) ); | 213 | cmbCountry->insertItem( tr( "" ) ); |
214 | cmbCountry->insertItem( tr ( "United States" ) ); | 214 | cmbCountry->insertItem( tr ( "United States" ) ); |
215 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); | 215 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); |
216 | cmbCountry->insertItem( tr ( "Afganistan" ) ); | 216 | cmbCountry->insertItem( tr ( "Afganistan" ) ); |
217 | cmbCountry->insertItem( tr ( "Albania" ) ); | 217 | cmbCountry->insertItem( tr ( "Albania" ) ); |
218 | cmbCountry->insertItem( tr ( "Algeria" ) ); | 218 | cmbCountry->insertItem( tr ( "Algeria" ) ); |
219 | cmbCountry->insertItem( tr ( "American Samoa" ) ); | 219 | cmbCountry->insertItem( tr ( "American Samoa" ) ); |
220 | cmbCountry->insertItem( tr ( "Andorra" ) ); | 220 | cmbCountry->insertItem( tr ( "Andorra" ) ); |
221 | cmbCountry->insertItem( tr ( "Angola" ) ); | 221 | cmbCountry->insertItem( tr ( "Angola" ) ); |
222 | cmbCountry->insertItem( tr ( "Anguilla" ) ); | 222 | cmbCountry->insertItem( tr ( "Anguilla" ) ); |
223 | cmbCountry->insertItem( tr ( "Antartica" ) ); | 223 | cmbCountry->insertItem( tr ( "Antartica" ) ); |
224 | cmbCountry->insertItem( tr ( "Argentina" ) ); | 224 | cmbCountry->insertItem( tr ( "Argentina" ) ); |
225 | cmbCountry->insertItem( tr ( "Armania" ) ); | 225 | cmbCountry->insertItem( tr ( "Armania" ) ); |
226 | cmbCountry->insertItem( tr ( "Aruba" ) ); | 226 | cmbCountry->insertItem( tr ( "Aruba" ) ); |
227 | cmbCountry->insertItem( tr ( "Australia" ) ); | 227 | cmbCountry->insertItem( tr ( "Australia" ) ); |
228 | cmbCountry->insertItem( tr ( "Austria" ) ); | 228 | cmbCountry->insertItem( tr ( "Austria" ) ); |
229 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); | 229 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); |
230 | cmbCountry->insertItem( tr ( "Bahamas" ) ); | 230 | cmbCountry->insertItem( tr ( "Bahamas" ) ); |
231 | cmbCountry->insertItem( tr ( "Bahrain" ) ); | 231 | cmbCountry->insertItem( tr ( "Bahrain" ) ); |
232 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); | 232 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); |
233 | cmbCountry->insertItem( tr ( "Barbados" ) ); | 233 | cmbCountry->insertItem( tr ( "Barbados" ) ); |
234 | cmbCountry->insertItem( tr ( "Belarus" ) ); | 234 | cmbCountry->insertItem( tr ( "Belarus" ) ); |
235 | cmbCountry->insertItem( tr ( "Belgium" ) ); | 235 | cmbCountry->insertItem( tr ( "Belgium" ) ); |
236 | cmbCountry->insertItem( tr ( "Belize" ) ); | 236 | cmbCountry->insertItem( tr ( "Belize" ) ); |
237 | cmbCountry->insertItem( tr ( "Benin" ) ); | 237 | cmbCountry->insertItem( tr ( "Benin" ) ); |
238 | cmbCountry->insertItem( tr ( "Bermuda" ) ); | 238 | cmbCountry->insertItem( tr ( "Bermuda" ) ); |
239 | cmbCountry->insertItem( tr ( "Bhutan" ) ); | 239 | cmbCountry->insertItem( tr ( "Bhutan" ) ); |
240 | cmbCountry->insertItem( tr ( "Boliva" ) ); | 240 | cmbCountry->insertItem( tr ( "Boliva" ) ); |
241 | cmbCountry->insertItem( tr ( "Botswana" ) ); | 241 | cmbCountry->insertItem( tr ( "Botswana" ) ); |
242 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); | 242 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); |
243 | cmbCountry->insertItem( tr ( "Brazil" ) ); | 243 | cmbCountry->insertItem( tr ( "Brazil" ) ); |
244 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); | 244 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); |
245 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); | 245 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); |
246 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); | 246 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); |
247 | cmbCountry->insertItem( tr ( "Burundi" ) ); | 247 | cmbCountry->insertItem( tr ( "Burundi" ) ); |
248 | cmbCountry->insertItem( tr ( "Cambodia" ) ); | 248 | cmbCountry->insertItem( tr ( "Cambodia" ) ); |
249 | cmbCountry->insertItem( tr ( "Camaroon" ) ); | 249 | cmbCountry->insertItem( tr ( "Camaroon" ) ); |
250 | cmbCountry->insertItem( tr ( "Canada" ) ); | 250 | cmbCountry->insertItem( tr ( "Canada" ) ); |
251 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); | 251 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); |
252 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); | 252 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); |
253 | cmbCountry->insertItem( tr ( "Chad" ) ); | 253 | cmbCountry->insertItem( tr ( "Chad" ) ); |
254 | cmbCountry->insertItem( tr ( "Chile" ) ); | 254 | cmbCountry->insertItem( tr ( "Chile" ) ); |
255 | cmbCountry->insertItem( tr ( "China" ) ); | 255 | cmbCountry->insertItem( tr ( "China" ) ); |
256 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); | 256 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); |
257 | cmbCountry->insertItem( tr ( "Colombia" ) ); | 257 | cmbCountry->insertItem( tr ( "Colombia" ) ); |
258 | cmbCountry->insertItem( tr ( "Comoros" ) ); | 258 | cmbCountry->insertItem( tr ( "Comoros" ) ); |
259 | cmbCountry->insertItem( tr ( "Congo" ) ); | 259 | cmbCountry->insertItem( tr ( "Congo" ) ); |
260 | cmbCountry->insertItem( tr ( "Cook Island" ) ); | 260 | cmbCountry->insertItem( tr ( "Cook Island" ) ); |
261 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); | 261 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); |
262 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); | 262 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); |
263 | cmbCountry->insertItem( tr ( "Croatia" ) ); | 263 | cmbCountry->insertItem( tr ( "Croatia" ) ); |
264 | cmbCountry->insertItem( tr ( "Cuba" ) ); | 264 | cmbCountry->insertItem( tr ( "Cuba" ) ); |
265 | cmbCountry->insertItem( tr ( "Cyprus" ) ); | 265 | cmbCountry->insertItem( tr ( "Cyprus" ) ); |
266 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); | 266 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); |
267 | cmbCountry->insertItem( tr ( "Denmark" ) ); | 267 | cmbCountry->insertItem( tr ( "Denmark" ) ); |
268 | cmbCountry->insertItem( tr ( "Djibouti" ) ); | 268 | cmbCountry->insertItem( tr ( "Djibouti" ) ); |
269 | cmbCountry->insertItem( tr ( "Dominica" ) ); | 269 | cmbCountry->insertItem( tr ( "Dominica" ) ); |
270 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); | 270 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); |
271 | cmbCountry->insertItem( tr ( "East Timor" ) ); | 271 | cmbCountry->insertItem( tr ( "East Timor" ) ); |
272 | cmbCountry->insertItem( tr ( "Ecuador" ) ); | 272 | cmbCountry->insertItem( tr ( "Ecuador" ) ); |
273 | cmbCountry->insertItem( tr ( "Egypt" ) ); | 273 | cmbCountry->insertItem( tr ( "Egypt" ) ); |
274 | cmbCountry->insertItem( tr ( "El Salvador" ) ); | 274 | cmbCountry->insertItem( tr ( "El Salvador" ) ); |
275 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); | 275 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); |
276 | cmbCountry->insertItem( tr ( "Eritrea" ) ); | 276 | cmbCountry->insertItem( tr ( "Eritrea" ) ); |
277 | cmbCountry->insertItem( tr ( "Estonia" ) ); | 277 | cmbCountry->insertItem( tr ( "Estonia" ) ); |
278 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); | 278 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); |
279 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); | 279 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); |
280 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); | 280 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); |
281 | cmbCountry->insertItem( tr ( "Fiji" ) ); | 281 | cmbCountry->insertItem( tr ( "Fiji" ) ); |
282 | cmbCountry->insertItem( tr ( "Finland" ) ); | 282 | cmbCountry->insertItem( tr ( "Finland" ) ); |
283 | cmbCountry->insertItem( tr ( "France" ) ); | 283 | cmbCountry->insertItem( tr ( "France" ) ); |
284 | cmbCountry->insertItem( tr ( "French Guiana" ) ); | 284 | cmbCountry->insertItem( tr ( "French Guiana" ) ); |
285 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); | 285 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); |
286 | cmbCountry->insertItem( tr ( "Gabon" ) ); | 286 | cmbCountry->insertItem( tr ( "Gabon" ) ); |
287 | cmbCountry->insertItem( tr ( "Gambia" ) ); | 287 | cmbCountry->insertItem( tr ( "Gambia" ) ); |
288 | cmbCountry->insertItem( tr ( "Georgia" ) ); | 288 | cmbCountry->insertItem( tr ( "Georgia" ) ); |
289 | cmbCountry->insertItem( tr ( "Germany" ) ); | 289 | cmbCountry->insertItem( tr ( "Germany" ) ); |
290 | cmbCountry->insertItem( tr ( "Gahna" ) ); | 290 | cmbCountry->insertItem( tr ( "Gahna" ) ); |
291 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); | 291 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); |
292 | cmbCountry->insertItem( tr ( "Greece" ) ); | 292 | cmbCountry->insertItem( tr ( "Greece" ) ); |
293 | cmbCountry->insertItem( tr ( "Greenland" ) ); | 293 | cmbCountry->insertItem( tr ( "Greenland" ) ); |
294 | cmbCountry->insertItem( tr ( "Grenada" ) ); | 294 | cmbCountry->insertItem( tr ( "Grenada" ) ); |
295 | cmbCountry->insertItem( tr ( "Guadelupe" ) ); | 295 | cmbCountry->insertItem( tr ( "Guadelupe" ) ); |
296 | cmbCountry->insertItem( tr ( "Guam" ) ); | 296 | cmbCountry->insertItem( tr ( "Guam" ) ); |
297 | cmbCountry->insertItem( tr ( "Guatemala" ) ); | 297 | cmbCountry->insertItem( tr ( "Guatemala" ) ); |
298 | cmbCountry->insertItem( tr ( "Guinea" ) ); | 298 | cmbCountry->insertItem( tr ( "Guinea" ) ); |
299 | cmbCountry->insertItem( tr ( "Guinea-bissau" ) ); | 299 | cmbCountry->insertItem( tr ( "Guinea-bissau" ) ); |
300 | cmbCountry->insertItem( tr ( "Guyana" ) ); | 300 | cmbCountry->insertItem( tr ( "Guyana" ) ); |
301 | cmbCountry->insertItem( tr ( "Haiti" ) ); | 301 | cmbCountry->insertItem( tr ( "Haiti" ) ); |
302 | cmbCountry->insertItem( tr ( "Holy See" ) ); | 302 | cmbCountry->insertItem( tr ( "Holy See" ) ); |
303 | cmbCountry->insertItem( tr ( "Honduras" ) ); | 303 | cmbCountry->insertItem( tr ( "Honduras" ) ); |
304 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); | 304 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); |
305 | cmbCountry->insertItem( tr ( "Hungary" ) ); | 305 | cmbCountry->insertItem( tr ( "Hungary" ) ); |
306 | cmbCountry->insertItem( tr ( "Iceland" ) ); | 306 | cmbCountry->insertItem( tr ( "Iceland" ) ); |
307 | cmbCountry->insertItem( tr ( "India" ) ); | 307 | cmbCountry->insertItem( tr ( "India" ) ); |
308 | cmbCountry->insertItem( tr ( "Indonesia" ) ); | 308 | cmbCountry->insertItem( tr ( "Indonesia" ) ); |
309 | cmbCountry->insertItem( tr ( "Ireland" ) ); | 309 | cmbCountry->insertItem( tr ( "Ireland" ) ); |
310 | cmbCountry->insertItem( tr ( "Israel" ) ); | 310 | cmbCountry->insertItem( tr ( "Israel" ) ); |
311 | cmbCountry->insertItem( tr ( "Italy" ) ); | 311 | cmbCountry->insertItem( tr ( "Italy" ) ); |
312 | cmbCountry->insertItem( tr ( "Jamacia" ) ); | 312 | cmbCountry->insertItem( tr ( "Jamacia" ) ); |
313 | cmbCountry->insertItem( tr ( "Japan" ) ); | 313 | cmbCountry->insertItem( tr ( "Japan" ) ); |
314 | cmbCountry->insertItem( tr ( "Jordan" ) ); | 314 | cmbCountry->insertItem( tr ( "Jordan" ) ); |
315 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); | 315 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); |
316 | cmbCountry->insertItem( tr ( "Kenya" ) ); | 316 | cmbCountry->insertItem( tr ( "Kenya" ) ); |
317 | cmbCountry->insertItem( tr ( "Kribati" ) ); | 317 | cmbCountry->insertItem( tr ( "Kribati" ) ); |
318 | cmbCountry->insertItem( tr ( "Korea" ) ); | 318 | cmbCountry->insertItem( tr ( "Korea" ) ); |
319 | cmbCountry->insertItem( tr ( "Kuwait" ) ); | 319 | cmbCountry->insertItem( tr ( "Kuwait" ) ); |
320 | cmbCountry->insertItem( tr ( "Kyrgystan" ) ); | 320 | cmbCountry->insertItem( tr ( "Kyrgystan" ) ); |
321 | cmbCountry->insertItem( tr ( "Laos" ) ); | 321 | cmbCountry->insertItem( tr ( "Laos" ) ); |
322 | cmbCountry->insertItem( tr ( "Latvia" ) ); | 322 | cmbCountry->insertItem( tr ( "Latvia" ) ); |
323 | cmbCountry->insertItem( tr ( "Lebanon" ) ); | 323 | cmbCountry->insertItem( tr ( "Lebanon" ) ); |
324 | cmbCountry->insertItem( tr ( "Lesotho" ) ); | 324 | cmbCountry->insertItem( tr ( "Lesotho" ) ); |
325 | cmbCountry->insertItem( tr ( "Liberia" ) ); | 325 | cmbCountry->insertItem( tr ( "Liberia" ) ); |
326 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); | 326 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); |
327 | cmbCountry->insertItem( tr ( "Lithuania" ) ); | 327 | cmbCountry->insertItem( tr ( "Lithuania" ) ); |
328 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); | 328 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); |
329 | cmbCountry->insertItem( tr ( "Macau" ) ); | 329 | cmbCountry->insertItem( tr ( "Macau" ) ); |
330 | cmbCountry->insertItem( tr ( "Macedonia" ) ); | 330 | cmbCountry->insertItem( tr ( "Macedonia" ) ); |
331 | cmbCountry->insertItem( tr ( "Madagascar" ) ); | 331 | cmbCountry->insertItem( tr ( "Madagascar" ) ); |
332 | cmbCountry->insertItem( tr ( "Malawi" ) ); | 332 | cmbCountry->insertItem( tr ( "Malawi" ) ); |
333 | cmbCountry->insertItem( tr ( "Malaysia" ) ); | 333 | cmbCountry->insertItem( tr ( "Malaysia" ) ); |
334 | cmbCountry->insertItem( tr ( "Maldives" ) ); | 334 | cmbCountry->insertItem( tr ( "Maldives" ) ); |
335 | cmbCountry->insertItem( tr ( "Mali" ) ); | 335 | cmbCountry->insertItem( tr ( "Mali" ) ); |
336 | cmbCountry->insertItem( tr ( "Malta" ) ); | 336 | cmbCountry->insertItem( tr ( "Malta" ) ); |
337 | cmbCountry->insertItem( tr ( "Martinique" ) ); | 337 | cmbCountry->insertItem( tr ( "Martinique" ) ); |
338 | cmbCountry->insertItem( tr ( "Mauritania" ) ); | 338 | cmbCountry->insertItem( tr ( "Mauritania" ) ); |
339 | cmbCountry->insertItem( tr ( "Mauritius" ) ); | 339 | cmbCountry->insertItem( tr ( "Mauritius" ) ); |
340 | cmbCountry->insertItem( tr ( "Mayotte" ) ); | 340 | cmbCountry->insertItem( tr ( "Mayotte" ) ); |
341 | cmbCountry->insertItem( tr ( "Mexico" ) ); | 341 | cmbCountry->insertItem( tr ( "Mexico" ) ); |
342 | cmbCountry->insertItem( tr ( "Micronesia" ) ); | 342 | cmbCountry->insertItem( tr ( "Micronesia" ) ); |
343 | cmbCountry->insertItem( tr ( "Moldova" ) ); | 343 | cmbCountry->insertItem( tr ( "Moldova" ) ); |
344 | cmbCountry->insertItem( tr ( "Monaco" ) ); | 344 | cmbCountry->insertItem( tr ( "Monaco" ) ); |
345 | cmbCountry->insertItem( tr ( "Mongolia" ) ); | 345 | cmbCountry->insertItem( tr ( "Mongolia" ) ); |
346 | cmbCountry->insertItem( tr ( "Montserrat" ) ); | 346 | cmbCountry->insertItem( tr ( "Montserrat" ) ); |
347 | cmbCountry->insertItem( tr ( "Morocco" ) ); | 347 | cmbCountry->insertItem( tr ( "Morocco" ) ); |
348 | cmbCountry->insertItem( tr ( "Mozambique" ) ); | 348 | cmbCountry->insertItem( tr ( "Mozambique" ) ); |
349 | cmbCountry->insertItem( tr ( "Myanmar" ) ); | 349 | cmbCountry->insertItem( tr ( "Myanmar" ) ); |
350 | cmbCountry->insertItem( tr ( "Namibia" ) ); | 350 | cmbCountry->insertItem( tr ( "Namibia" ) ); |
351 | cmbCountry->insertItem( tr ( "Nauru" ) ); | 351 | cmbCountry->insertItem( tr ( "Nauru" ) ); |
352 | cmbCountry->insertItem( tr ( "Nepal" ) ); | 352 | cmbCountry->insertItem( tr ( "Nepal" ) ); |
353 | cmbCountry->insertItem( tr ( "Netherlands" ) ); | 353 | cmbCountry->insertItem( tr ( "Netherlands" ) ); |
354 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); | 354 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); |
355 | cmbCountry->insertItem( tr ( "New Zealand" ) ); | 355 | cmbCountry->insertItem( tr ( "New Zealand" ) ); |
356 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); | 356 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); |
357 | cmbCountry->insertItem( tr ( "Niger" ) ); | 357 | cmbCountry->insertItem( tr ( "Niger" ) ); |
358 | cmbCountry->insertItem( tr ( "Nigeria" ) ); | 358 | cmbCountry->insertItem( tr ( "Nigeria" ) ); |
359 | cmbCountry->insertItem( tr ( "Niue" ) ); | 359 | cmbCountry->insertItem( tr ( "Niue" ) ); |
360 | cmbCountry->insertItem( tr ( "Norway" ) ); | 360 | cmbCountry->insertItem( tr ( "Norway" ) ); |
361 | cmbCountry->insertItem( tr ( "Oman" ) ); | 361 | cmbCountry->insertItem( tr ( "Oman" ) ); |
362 | cmbCountry->insertItem( tr ( "Pakistan" ) ); | 362 | cmbCountry->insertItem( tr ( "Pakistan" ) ); |
363 | cmbCountry->insertItem( tr ( "Palau" ) ); | 363 | cmbCountry->insertItem( tr ( "Palau" ) ); |
364 | cmbCountry->insertItem( tr ( "Palestinian Territory" ) ); | 364 | cmbCountry->insertItem( tr ( "Palestinian Territory" ) ); |
365 | cmbCountry->insertItem( tr ( "Panama" ) ); | 365 | cmbCountry->insertItem( tr ( "Panama" ) ); |
366 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); | 366 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); |
367 | cmbCountry->insertItem( tr ( "Paraguay" ) ); | 367 | cmbCountry->insertItem( tr ( "Paraguay" ) ); |
368 | cmbCountry->insertItem( tr ( "Peru" ) ); | 368 | cmbCountry->insertItem( tr ( "Peru" ) ); |
369 | cmbCountry->insertItem( tr ( "Philippines" ) ); | 369 | cmbCountry->insertItem( tr ( "Philippines" ) ); |
370 | cmbCountry->insertItem( tr ( "Pitcairn" ) ); | 370 | cmbCountry->insertItem( tr ( "Pitcairn" ) ); |
371 | cmbCountry->insertItem( tr ( "Poland" ) ); | 371 | cmbCountry->insertItem( tr ( "Poland" ) ); |
372 | cmbCountry->insertItem( tr ( "Portugal" ) ); | 372 | cmbCountry->insertItem( tr ( "Portugal" ) ); |
373 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); | 373 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); |
374 | cmbCountry->insertItem( tr ( "Qatar" ) ); | 374 | cmbCountry->insertItem( tr ( "Qatar" ) ); |
375 | cmbCountry->insertItem( tr ( "Reunion" ) ); | 375 | cmbCountry->insertItem( tr ( "Reunion" ) ); |
376 | cmbCountry->insertItem( tr ( "Romania" ) ); | 376 | cmbCountry->insertItem( tr ( "Romania" ) ); |
377 | cmbCountry->insertItem( tr ( "Russia" ) ); | 377 | cmbCountry->insertItem( tr ( "Russia" ) ); |
378 | cmbCountry->insertItem( tr ( "Rwanda" ) ); | 378 | cmbCountry->insertItem( tr ( "Rwanda" ) ); |
379 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); | 379 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); |
380 | cmbCountry->insertItem( tr ( "Samoa" ) ); | 380 | cmbCountry->insertItem( tr ( "Samoa" ) ); |
381 | cmbCountry->insertItem( tr ( "San Marino" ) ); | 381 | cmbCountry->insertItem( tr ( "San Marino" ) ); |
382 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); | 382 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); |
383 | cmbCountry->insertItem( tr ( "Senegal" ) ); | 383 | cmbCountry->insertItem( tr ( "Senegal" ) ); |
384 | cmbCountry->insertItem( tr ( "Seychelles" ) ); | 384 | cmbCountry->insertItem( tr ( "Seychelles" ) ); |
385 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); | 385 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); |
386 | cmbCountry->insertItem( tr ( "Singapore" ) ); | 386 | cmbCountry->insertItem( tr ( "Singapore" ) ); |
387 | cmbCountry->insertItem( tr ( "Slovakia" ) ); | 387 | cmbCountry->insertItem( tr ( "Slovakia" ) ); |
388 | cmbCountry->insertItem( tr ( "Slovenia" ) ); | 388 | cmbCountry->insertItem( tr ( "Slovenia" ) ); |
389 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); | 389 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); |
390 | cmbCountry->insertItem( tr ( "Somalia" ) ); | 390 | cmbCountry->insertItem( tr ( "Somalia" ) ); |
391 | cmbCountry->insertItem( tr ( "South Africa" ) ); | 391 | cmbCountry->insertItem( tr ( "South Africa" ) ); |
392 | cmbCountry->insertItem( tr ( "Spain" ) ); | 392 | cmbCountry->insertItem( tr ( "Spain" ) ); |
393 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); | 393 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); |
394 | cmbCountry->insertItem( tr ( "St. Helena" ) ); | 394 | cmbCountry->insertItem( tr ( "St. Helena" ) ); |
395 | cmbCountry->insertItem( tr ( "Sudan" ) ); | 395 | cmbCountry->insertItem( tr ( "Sudan" ) ); |
396 | cmbCountry->insertItem( tr ( "Suriname" ) ); | 396 | cmbCountry->insertItem( tr ( "Suriname" ) ); |
397 | cmbCountry->insertItem( tr ( "Swaziland" ) ); | 397 | cmbCountry->insertItem( tr ( "Swaziland" ) ); |
398 | cmbCountry->insertItem( tr ( "Sweden" ) ); | 398 | cmbCountry->insertItem( tr ( "Sweden" ) ); |
399 | cmbCountry->insertItem( tr ( "Switzerland" ) ); | 399 | cmbCountry->insertItem( tr ( "Switzerland" ) ); |
400 | cmbCountry->insertItem( tr ( "Taiwan" ) ); | 400 | cmbCountry->insertItem( tr ( "Taiwan" ) ); |
401 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); | 401 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); |
402 | cmbCountry->insertItem( tr ( "Tanzania" ) ); | 402 | cmbCountry->insertItem( tr ( "Tanzania" ) ); |
403 | cmbCountry->insertItem( tr ( "Thailand" ) ); | 403 | cmbCountry->insertItem( tr ( "Thailand" ) ); |
404 | cmbCountry->insertItem( tr ( "Togo" ) ); | 404 | cmbCountry->insertItem( tr ( "Togo" ) ); |
405 | cmbCountry->insertItem( tr ( "Tokelau" ) ); | 405 | cmbCountry->insertItem( tr ( "Tokelau" ) ); |
406 | cmbCountry->insertItem( tr ( "Tonga" ) ); | 406 | cmbCountry->insertItem( tr ( "Tonga" ) ); |
407 | cmbCountry->insertItem( tr ( "Tunisia" ) ); | 407 | cmbCountry->insertItem( tr ( "Tunisia" ) ); |
408 | cmbCountry->insertItem( tr ( "Turkey" ) ); | 408 | cmbCountry->insertItem( tr ( "Turkey" ) ); |
409 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); | 409 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); |
410 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); | 410 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); |
411 | cmbCountry->insertItem( tr ( "Uganda" ) ); | 411 | cmbCountry->insertItem( tr ( "Uganda" ) ); |
412 | cmbCountry->insertItem( tr ( "Ukraine" ) ); | 412 | cmbCountry->insertItem( tr ( "Ukraine" ) ); |
413 | cmbCountry->insertItem( tr ( "Uruguay" ) ); | 413 | cmbCountry->insertItem( tr ( "Uruguay" ) ); |
414 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); | 414 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); |
415 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); | 415 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); |
416 | cmbCountry->insertItem( tr ( "Venezuela" ) ); | 416 | cmbCountry->insertItem( tr ( "Venezuela" ) ); |
417 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); | 417 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); |
418 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); | 418 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); |
419 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); | 419 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); |
420 | cmbCountry->insertItem( tr ( "Yemen" ) ); | 420 | cmbCountry->insertItem( tr ( "Yemen" ) ); |
421 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); | 421 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); |
422 | cmbCountry->insertItem( tr ( "Zambia" ) ); | 422 | cmbCountry->insertItem( tr ( "Zambia" ) ); |
423 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); | 423 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); |
424 | if (cmbCountry->listBox()!=0) | 424 | if (cmbCountry->listBox()!=0) |
425 | cmbCountry->listBox()->sort(); | 425 | cmbCountry->listBox()->sort(); |
426 | 426 | ||
427 | cmbCountry->setMaximumWidth( 135 ); | 427 | cmbCountry->setMaximumWidth( 135 ); |
428 | 428 | ||
429 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 429 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
430 | 430 | ||
431 | cmbChooserField4 = new QComboBox( FALSE, container ); | 431 | cmbChooserField4 = new QComboBox( FALSE, container ); |
432 | cmbChooserField4->setMaximumWidth( 90 ); | 432 | cmbChooserField4->setMaximumWidth( 90 ); |
433 | gl->addWidget( cmbChooserField4, 6, 0 ); | 433 | gl->addWidget( cmbChooserField4, 6, 0 ); |
434 | txtChooserField4 = new QLineEdit( container ); | 434 | txtChooserField4 = new QLineEdit( container ); |
435 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); | 435 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); |
436 | 436 | ||
437 | QSpacerItem *space = new QSpacerItem(1,1, | 437 | QSpacerItem *space = new QSpacerItem(1,1, |
438 | QSizePolicy::Maximum, | 438 | QSizePolicy::Maximum, |
439 | QSizePolicy::MinimumExpanding ); | 439 | QSizePolicy::MinimumExpanding ); |
440 | gl->addItem( space, 7, 0 ); | 440 | gl->addItem( space, 7, 0 ); |
441 | 441 | ||
442 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 442 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
443 | 443 | ||
444 | tabViewport = new QWidget ( tabMain ); | 444 | tabViewport = new QWidget ( tabMain ); |
445 | 445 | ||
446 | vb = new QVBoxLayout( tabViewport ); | 446 | vb = new QVBoxLayout( tabViewport ); |
447 | 447 | ||
448 | svDetails = new QScrollView( tabViewport ); | 448 | svDetails = new QScrollView( tabViewport ); |
449 | vb->addWidget( svDetails, 0, 0 ); | 449 | vb->addWidget( svDetails, 0, 0 ); |
450 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 450 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
451 | svDetails->setFrameStyle( QFrame::NoFrame ); | 451 | svDetails->setFrameStyle( QFrame::NoFrame ); |
452 | 452 | ||
453 | container = new QWidget( svDetails->viewport() ); | 453 | container = new QWidget( svDetails->viewport() ); |
454 | svDetails->addChild( container ); | 454 | svDetails->addChild( container ); |
455 | 455 | ||
456 | gl = new QGridLayout( container, 1, 2, 2, 4 ); | 456 | gl = new QGridLayout( container, 1, 2, 2, 4 ); |
457 | 457 | ||
458 | int counter = 0; | 458 | int counter = 0; |
459 | 459 | ||
460 | // Birthday | 460 | // Birthday |
461 | QHBox* hBox = new QHBox( container ); | 461 | QHBox* hBox = new QHBox( container ); |
462 | l = new QLabel( tr("Birthday"), container ); | 462 | l = new QLabel( tr("Birthday"), container ); |
463 | gl->addWidget( l, counter, 0 ); | 463 | gl->addWidget( l, counter, 0 ); |
464 | 464 | ||
465 | QPopupMenu* m1 = new QPopupMenu( container ); | 465 | QPopupMenu* m1 = new QPopupMenu( container ); |
466 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | 466 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); |
467 | m1->insertItem( birthdayPicker ); | 467 | m1->insertItem( birthdayPicker ); |
468 | 468 | ||
469 | birthdayButton= new QToolButton( hBox, "buttonStart" ); | 469 | birthdayButton= new QToolButton( hBox, "buttonStart" ); |
470 | birthdayButton->setPopup( m1 ); | 470 | birthdayButton->setPopup( m1 ); |
471 | birthdayButton->setPopupDelay(0); | 471 | birthdayButton->setPopupDelay(0); |
472 | 472 | ||
473 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 473 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
474 | tr( "Delete" ), | 474 | tr( "Delete" ), |
475 | hBox, 0 ); | 475 | hBox, 0 ); |
476 | 476 | ||
477 | gl->addWidget( hBox, counter , 1 ); | 477 | gl->addWidget( hBox, counter , 1 ); |
478 | 478 | ||
479 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), | 479 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), |
480 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); | 480 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); |
481 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); | 481 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); |
482 | 482 | ||
483 | ++counter; | 483 | ++counter; |
484 | 484 | ||
485 | // Anniversary | 485 | // Anniversary |
486 | hBox = new QHBox( container ); | 486 | hBox = new QHBox( container ); |
487 | l = new QLabel( tr("Anniversary"), container ); | 487 | l = new QLabel( tr("Anniversary"), container ); |
488 | gl->addWidget( l, counter, 0 ); | 488 | gl->addWidget( l, counter, 0 ); |
489 | 489 | ||
490 | m1 = new QPopupMenu( container ); | 490 | m1 = new QPopupMenu( container ); |
491 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | 491 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); |
492 | m1->insertItem( anniversaryPicker ); | 492 | m1->insertItem( anniversaryPicker ); |
493 | 493 | ||
494 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); | 494 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); |
495 | anniversaryButton->setPopup( m1 ); | 495 | anniversaryButton->setPopup( m1 ); |
496 | anniversaryButton->setPopupDelay(0); | 496 | anniversaryButton->setPopupDelay(0); |
497 | 497 | ||
498 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 498 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
499 | tr( "Delete" ), | 499 | tr( "Delete" ), |
500 | hBox, 0 ); | 500 | hBox, 0 ); |
501 | gl->addWidget( hBox, counter , 1 ); | 501 | gl->addWidget( hBox, counter , 1 ); |
502 | 502 | ||
503 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), | 503 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), |
504 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); | 504 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); |
505 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); | 505 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); |
506 | 506 | ||
507 | ++counter; | 507 | ++counter; |
508 | 508 | ||
509 | // Gender | 509 | // Gender |
510 | l = new QLabel( tr("Gender"), container ); | 510 | l = new QLabel( tr("Gender"), container ); |
511 | gl->addWidget( l, counter, 0 ); | 511 | gl->addWidget( l, counter, 0 ); |
512 | cmbGender = new QComboBox( container ); | 512 | cmbGender = new QComboBox( container ); |
513 | cmbGender->insertItem( "", 0 ); | 513 | cmbGender->insertItem( "", 0 ); |
514 | cmbGender->insertItem( tr("Male"), 1); | 514 | cmbGender->insertItem( tr("Male"), 1); |
515 | cmbGender->insertItem( tr("Female"), 2); | 515 | cmbGender->insertItem( tr("Female"), 2); |
516 | gl->addWidget( cmbGender, counter, 1 ); | 516 | gl->addWidget( cmbGender, counter, 1 ); |
517 | 517 | ||
518 | ++counter; | 518 | ++counter; |
519 | 519 | ||
520 | // Create Labels and lineedit fields for every dynamic entry | 520 | // Create Labels and lineedit fields for every dynamic entry |
521 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 521 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
522 | QStringList::ConstIterator trit = trlDynamicEntries.begin(); | 522 | QStringList::ConstIterator trit = trlDynamicEntries.begin(); |
523 | for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { | 523 | for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { |
524 | 524 | ||
525 | if (((*it) == "Anniversary") || | 525 | if (((*it) == "Anniversary") || |
526 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; | 526 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; |
527 | 527 | ||
528 | l = new QLabel( (*it).utf8() , container ); | 528 | l = new QLabel( (*it).utf8() , container ); |
529 | listName.append( l ); | 529 | listName.append( l ); |
530 | gl->addWidget( l, i, 0 ); | 530 | gl->addWidget( l, i, 0 ); |
531 | QLineEdit *e = new QLineEdit( container ); | 531 | QLineEdit *e = new QLineEdit( container ); |
532 | listValue.append( e ); | 532 | listValue.append( e ); |
533 | gl->addWidget( e, i, 1); | 533 | gl->addWidget( e, i, 1); |
534 | } | 534 | } |
535 | // Fill labels with names.. | 535 | // Fill labels with names.. |
536 | //loadFields(); | 536 | //loadFields(); |
537 | 537 | ||
538 | 538 | ||
539 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 539 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
540 | 540 | ||
541 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 541 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
542 | dlgNote->setCaption( tr("Enter Note") ); | 542 | dlgNote->setCaption( tr("Enter Note") ); |
543 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 543 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
544 | txtNote = new QMultiLineEdit( dlgNote ); | 544 | txtNote = new QMultiLineEdit( dlgNote ); |
545 | vbNote->addWidget( txtNote ); | 545 | vbNote->addWidget( txtNote ); |
546 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 546 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
547 | 547 | ||
548 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 548 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
549 | dlgName->setCaption( tr("Edit Name") ); | 549 | dlgName->setCaption( tr("Edit Name") ); |
550 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 550 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
551 | 551 | ||
552 | l = new QLabel( tr("First Name"), dlgName ); | 552 | l = new QLabel( tr("First Name"), dlgName ); |
553 | gl->addWidget( l, 0, 0 ); | 553 | gl->addWidget( l, 0, 0 ); |
554 | txtFirstName = new QLineEdit( dlgName ); | 554 | txtFirstName = new QLineEdit( dlgName ); |
555 | gl->addWidget( txtFirstName, 0, 1 ); | 555 | gl->addWidget( txtFirstName, 0, 1 ); |
556 | 556 | ||
557 | l = new QLabel( tr("Middle Name"), dlgName ); | 557 | l = new QLabel( tr("Middle Name"), dlgName ); |
558 | gl->addWidget( l, 1, 0 ); | 558 | gl->addWidget( l, 1, 0 ); |
559 | txtMiddleName = new QLineEdit( dlgName ); | 559 | txtMiddleName = new QLineEdit( dlgName ); |
560 | gl->addWidget( txtMiddleName, 1, 1 ); | 560 | gl->addWidget( txtMiddleName, 1, 1 ); |
561 | 561 | ||
562 | l = new QLabel( tr("Last Name"), dlgName ); | 562 | l = new QLabel( tr("Last Name"), dlgName ); |
563 | gl->addWidget( l, 2, 0 ); | 563 | gl->addWidget( l, 2, 0 ); |
564 | txtLastName = new QLineEdit( dlgName ); | 564 | txtLastName = new QLineEdit( dlgName ); |
565 | gl->addWidget( txtLastName, 2, 1 ); | 565 | gl->addWidget( txtLastName, 2, 1 ); |
566 | 566 | ||
567 | l = new QLabel( tr("Suffix"), dlgName ); | 567 | l = new QLabel( tr("Suffix"), dlgName ); |
568 | gl->addWidget( l, 3, 0 ); | 568 | gl->addWidget( l, 3, 0 ); |
569 | txtSuffix = new QLineEdit( dlgName ); | 569 | txtSuffix = new QLineEdit( dlgName ); |
570 | gl->addWidget( txtSuffix, 3, 1 ); | 570 | gl->addWidget( txtSuffix, 3, 1 ); |
571 | space = new QSpacerItem(1,1, | 571 | space = new QSpacerItem(1,1, |
572 | QSizePolicy::Maximum, | 572 | QSizePolicy::Maximum, |
573 | QSizePolicy::MinimumExpanding ); | 573 | QSizePolicy::MinimumExpanding ); |
574 | gl->addItem( space, 4, 0 ); | 574 | gl->addItem( space, 4, 0 ); |
575 | 575 | ||
576 | cmbChooserField1->insertStringList( trlChooserNames ); | 576 | cmbChooserField1->insertStringList( trlChooserNames ); |
577 | cmbChooserField2->insertStringList( trlChooserNames ); | 577 | cmbChooserField2->insertStringList( trlChooserNames ); |
578 | cmbChooserField3->insertStringList( trlChooserNames ); | 578 | cmbChooserField3->insertStringList( trlChooserNames ); |
579 | cmbChooserField4->insertStringList( trlChooserNames ); | 579 | cmbChooserField4->insertStringList( trlChooserNames ); |
580 | 580 | ||
581 | cmbChooserField1->setCurrentItem( 0 ); | 581 | cmbChooserField1->setCurrentItem( 0 ); |
582 | cmbChooserField2->setCurrentItem( 1 ); | 582 | cmbChooserField2->setCurrentItem( 1 ); |
583 | cmbChooserField3->setCurrentItem( 2 ); | 583 | cmbChooserField3->setCurrentItem( 2 ); |
584 | 584 | ||
585 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 585 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
586 | 586 | ||
587 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 587 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
588 | 588 | ||
589 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 589 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
590 | this, SLOT(slotChooser1Change(const QString &)) ); | 590 | this, SLOT(slotChooser1Change(const QString &)) ); |
591 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 591 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
592 | this, SLOT(slotChooser2Change(const QString &)) ); | 592 | this, SLOT(slotChooser2Change(const QString &)) ); |
593 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), | 593 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
594 | this, SLOT(slotChooser3Change(const QString &)) ); | 594 | this, SLOT(slotChooser3Change(const QString &)) ); |
595 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | 595 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), |
596 | this, SLOT(slotChooser4Change(const QString &)) ); | 596 | this, SLOT(slotChooser4Change(const QString &)) ); |
597 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | 597 | connect( txtAddress, SIGNAL(textChanged(const QString &)), |
598 | this, SLOT(slotAddressChange(const QString &)) ); | 598 | this, SLOT(slotAddressChange(const QString &)) ); |
599 | connect( txtCity, SIGNAL(textChanged(const QString &)), | 599 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
600 | this, SLOT(slotCityChange(const QString &)) ); | 600 | this, SLOT(slotCityChange(const QString &)) ); |
601 | connect( txtState, SIGNAL(textChanged(const QString &)), | 601 | connect( txtState, SIGNAL(textChanged(const QString &)), |
602 | this, SLOT(slotStateChange(const QString &)) ); | 602 | this, SLOT(slotStateChange(const QString &)) ); |
603 | connect( txtZip, SIGNAL(textChanged(const QString &)), | 603 | connect( txtZip, SIGNAL(textChanged(const QString &)), |
604 | this, SLOT(slotZipChange(const QString &)) ); | 604 | this, SLOT(slotZipChange(const QString &)) ); |
605 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), | 605 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), |
606 | this, SLOT(slotCountryChange(const QString &)) ); | 606 | this, SLOT(slotCountryChange(const QString &)) ); |
607 | connect( cmbCountry, SIGNAL(activated(const QString &)), | 607 | connect( cmbCountry, SIGNAL(activated(const QString &)), |
608 | this, SLOT(slotCountryChange(const QString &)) ); | 608 | this, SLOT(slotCountryChange(const QString &)) ); |
609 | connect( cmbChooserField1, SIGNAL(activated(int)), | 609 | connect( cmbChooserField1, SIGNAL(activated(int)), |
610 | this, SLOT(slotCmbChooser1Change(int)) ); | 610 | this, SLOT(slotCmbChooser1Change(int)) ); |
611 | connect( cmbChooserField2, SIGNAL(activated(int)), | 611 | connect( cmbChooserField2, SIGNAL(activated(int)), |
612 | this, SLOT(slotCmbChooser2Change(int)) ); | 612 | this, SLOT(slotCmbChooser2Change(int)) ); |
613 | connect( cmbChooserField3, SIGNAL(activated(int)), | 613 | connect( cmbChooserField3, SIGNAL(activated(int)), |
614 | this, SLOT(slotCmbChooser3Change(int)) ); | 614 | this, SLOT(slotCmbChooser3Change(int)) ); |
615 | connect( cmbChooserField4, SIGNAL(activated(int)), | 615 | connect( cmbChooserField4, SIGNAL(activated(int)), |
616 | this, SLOT(slotCmbChooser4Change(int)) ); | 616 | this, SLOT(slotCmbChooser4Change(int)) ); |
617 | connect( cmbAddress, SIGNAL(activated(int)), | 617 | connect( cmbAddress, SIGNAL(activated(int)), |
618 | this, SLOT(slotAddressTypeChange(int)) ); | 618 | this, SLOT(slotAddressTypeChange(int)) ); |
619 | 619 | ||
620 | new QPEDialogListener(this); | 620 | new QPEDialogListener(this); |
621 | 621 | ||
622 | setPersonalView ( m_personalView ); | 622 | setPersonalView ( m_personalView ); |
623 | } | 623 | } |
624 | 624 | ||
625 | void ContactEditor::defaultEmailChanged(int i){ | 625 | void ContactEditor::defaultEmailChanged(int i){ |
626 | qDebug("defaultEmailChanged"); | 626 | qDebug("defaultEmailChanged"); |
627 | int index = cmbChooserField1->currentItem(); | 627 | int index = cmbChooserField1->currentItem(); |
628 | slChooserValues[index] = cmbDefaultEmail->text(i); | 628 | slChooserValues[index] = cmbDefaultEmail->text(i); |
629 | 629 | ||
630 | } | 630 | } |
631 | 631 | ||
632 | void ContactEditor::populateDefaultEmailCmb(){ | 632 | void ContactEditor::populateDefaultEmailCmb(){ |
633 | cmbDefaultEmail->clear(); | 633 | cmbDefaultEmail->clear(); |
634 | cmbDefaultEmail->insertStringList(emails); | 634 | cmbDefaultEmail->insertStringList(emails); |
635 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ | 635 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ |
636 | qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<",cmbDefaultEmail->text( i ).latin1(),defaultEmail.latin1()); | 636 | qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<",cmbDefaultEmail->text( i ).latin1(),defaultEmail.latin1()); |
637 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ | 637 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ |
638 | cmbDefaultEmail->setCurrentItem( i ); | 638 | cmbDefaultEmail->setCurrentItem( i ); |
639 | qDebug("set"); | 639 | qDebug("set"); |
640 | } | 640 | } |
641 | } | 641 | } |
642 | } | 642 | } |
643 | 643 | ||
644 | void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid, int widgetPos ) { | 644 | void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid, int widgetPos ) { |
645 | QString type = slChooserNames[index]; | 645 | QString type = slChooserNames[index]; |
646 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",type.latin1(),textChanged.latin1(), index, widgetPos ); | 646 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",type.latin1(),textChanged.latin1(), index, widgetPos ); |
647 | if ( type == "Default Email"){ | 647 | if ( type == "Default Email"){ |
648 | defaultEmail = textChanged; | 648 | defaultEmail = textChanged; |
649 | if (cmbDefaultEmail) delete cmbDefaultEmail; | 649 | if (cmbDefaultEmail) delete cmbDefaultEmail; |
650 | cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); | 650 | cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); |
651 | cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); | 651 | cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); |
652 | cmbDefaultEmail->show(); | 652 | cmbDefaultEmail->show(); |
653 | populateDefaultEmailCmb(); | 653 | populateDefaultEmailCmb(); |
654 | connect(cmbDefaultEmail,SIGNAL(activated(int)), | 654 | connect(cmbDefaultEmail,SIGNAL(activated(int)), |
655 | SLOT(defaultEmailChanged(int))); | 655 | SLOT(defaultEmailChanged(int))); |
656 | defaultEmailChooserPosition = widgetPos; | 656 | defaultEmailChooserPosition = widgetPos; |
657 | }else if (defaultEmailChooserPosition == widgetPos){ | 657 | }else if (defaultEmailChooserPosition == widgetPos){ |
658 | qDebug("cmbDefaultEmail->hide()"); | 658 | qDebug("cmbDefaultEmail->hide()"); |
659 | if (cmbDefaultEmail) cmbDefaultEmail->hide(); | 659 | if (cmbDefaultEmail) cmbDefaultEmail->hide(); |
660 | widgetPos=-1; | 660 | widgetPos=-1; |
661 | }else if (type == "Emails"){ | 661 | }else if (type == "Emails"){ |
662 | qDebug("emails"); | 662 | qDebug("emails"); |
663 | QString de; | 663 | QString de; |
664 | emails = QStringList::split (",", textChanged ); | 664 | emails = QStringList::split (",", textChanged ); |
665 | 665 | ||
666 | populateDefaultEmailCmb(); | 666 | populateDefaultEmailCmb(); |
667 | } | 667 | } |
668 | 668 | ||
669 | 669 | ||
670 | 670 | ||
671 | slChooserValues[index] = textChanged; | 671 | slChooserValues[index] = textChanged; |
672 | 672 | ||
673 | } | 673 | } |
674 | 674 | ||
675 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 675 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
676 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); | 676 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); |
677 | } | 677 | } |
678 | 678 | ||
679 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 679 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
680 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); | 680 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); |
681 | 681 | ||
682 | } | 682 | } |
683 | 683 | ||
684 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 684 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
685 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); | 685 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); |
686 | } | 686 | } |
687 | 687 | ||
688 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 688 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
689 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); | 689 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); |
690 | } | 690 | } |
691 | 691 | ||
692 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 692 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
693 | 693 | ||
694 | if ( cmbAddress->currentItem() == 0 ) { | 694 | if ( cmbAddress->currentItem() == 0 ) { |
695 | slBusinessAddress[0] = textChanged; | 695 | slBusinessAddress[0] = textChanged; |
696 | } else { | 696 | } else { |
697 | slHomeAddress[0] = textChanged; | 697 | slHomeAddress[0] = textChanged; |
698 | } | 698 | } |
699 | } | 699 | } |
700 | 700 | ||
701 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { | 701 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { |
702 | 702 | ||
703 | if ( cmbAddress->currentItem() == 0 ) { | 703 | if ( cmbAddress->currentItem() == 0 ) { |
704 | slBusinessAddress[1] = textChanged; | 704 | slBusinessAddress[1] = textChanged; |
705 | } else { | 705 | } else { |
706 | slHomeAddress[1] = textChanged; | 706 | slHomeAddress[1] = textChanged; |
707 | } | 707 | } |
708 | } | 708 | } |
709 | 709 | ||
710 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { | 710 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { |
711 | 711 | ||
712 | if ( cmbAddress->currentItem() == 0 ) { | 712 | if ( cmbAddress->currentItem() == 0 ) { |
713 | slBusinessAddress[2] = textChanged; | 713 | slBusinessAddress[2] = textChanged; |
714 | } else { | 714 | } else { |
715 | slHomeAddress[2] = textChanged; | 715 | slHomeAddress[2] = textChanged; |
716 | } | 716 | } |
717 | } | 717 | } |
718 | 718 | ||
719 | void ContactEditor::slotCityChange( const QString &textChanged ) { | 719 | void ContactEditor::slotCityChange( const QString &textChanged ) { |
720 | 720 | ||
721 | if ( cmbAddress->currentItem() == 0 ) { | 721 | if ( cmbAddress->currentItem() == 0 ) { |
722 | slBusinessAddress[3] = textChanged; | 722 | slBusinessAddress[3] = textChanged; |
723 | } else { | 723 | } else { |
724 | slHomeAddress[3] = textChanged; | 724 | slHomeAddress[3] = textChanged; |
725 | } | 725 | } |
726 | } | 726 | } |
727 | 727 | ||
728 | void ContactEditor::slotStateChange( const QString &textChanged ) { | 728 | void ContactEditor::slotStateChange( const QString &textChanged ) { |
729 | 729 | ||
730 | 730 | ||
731 | if ( cmbAddress->currentItem() == 0 ) { | 731 | if ( cmbAddress->currentItem() == 0 ) { |
732 | slBusinessAddress[4] = textChanged; | 732 | slBusinessAddress[4] = textChanged; |
733 | } else { | 733 | } else { |
734 | slHomeAddress[4] = textChanged; | 734 | slHomeAddress[4] = textChanged; |
735 | } | 735 | } |
736 | } | 736 | } |
737 | 737 | ||
738 | void ContactEditor::slotZipChange( const QString &textChanged ) { | 738 | void ContactEditor::slotZipChange( const QString &textChanged ) { |
739 | 739 | ||
740 | if ( cmbAddress->currentItem() == 0 ) { | 740 | if ( cmbAddress->currentItem() == 0 ) { |
741 | slBusinessAddress[5] = textChanged; | 741 | slBusinessAddress[5] = textChanged; |
742 | } else { | 742 | } else { |
743 | slHomeAddress[5] = textChanged; | 743 | slHomeAddress[5] = textChanged; |
744 | } | 744 | } |
745 | } | 745 | } |
746 | 746 | ||
747 | void ContactEditor::slotCountryChange( const QString &textChanged ) { | 747 | void ContactEditor::slotCountryChange( const QString &textChanged ) { |
748 | 748 | ||
749 | if ( cmbAddress->currentItem() == 0 ) { | 749 | if ( cmbAddress->currentItem() == 0 ) { |
750 | slBusinessAddress[6] = textChanged; | 750 | slBusinessAddress[6] = textChanged; |
751 | } else { | 751 | } else { |
752 | slHomeAddress[6] = textChanged; | 752 | slHomeAddress[6] = textChanged; |
753 | } | 753 | } |
754 | } | 754 | } |
755 | 755 | ||
756 | 756 | ||
757 | void ContactEditor::slotCmbChooser1Change( int index ) { | 757 | void ContactEditor::slotCmbChooser1Change( int index ) { |
758 | 758 | ||
759 | txtChooserField1->setText( slChooserValues[index] ); | 759 | txtChooserField1->setText( slChooserValues[index] ); |
760 | txtChooserField1->setFocus(); | 760 | txtChooserField1->setFocus(); |
761 | } | 761 | } |
762 | 762 | ||
763 | void ContactEditor::slotCmbChooser2Change( int index ) { | 763 | void ContactEditor::slotCmbChooser2Change( int index ) { |
764 | 764 | ||
765 | txtChooserField2->setText( slChooserValues[index] ); | 765 | txtChooserField2->setText( slChooserValues[index] ); |
766 | txtChooserField2->setFocus(); | 766 | txtChooserField2->setFocus(); |
767 | } | 767 | } |
768 | 768 | ||
769 | void ContactEditor::slotCmbChooser3Change( int index ) { | 769 | void ContactEditor::slotCmbChooser3Change( int index ) { |
770 | 770 | ||
771 | txtChooserField3->setText( slChooserValues[index] ); | 771 | txtChooserField3->setText( slChooserValues[index] ); |
772 | txtChooserField3->setFocus(); | 772 | txtChooserField3->setFocus(); |
773 | 773 | ||
774 | } | 774 | } |
775 | 775 | ||
776 | void ContactEditor::slotCmbChooser4Change( int index ) { | 776 | void ContactEditor::slotCmbChooser4Change( int index ) { |
777 | 777 | ||
778 | txtChooserField4->setText( slChooserValues[index] ); | 778 | txtChooserField4->setText( slChooserValues[index] ); |
779 | txtChooserField4->setFocus(); | 779 | txtChooserField4->setFocus(); |
780 | 780 | ||
781 | } | 781 | } |
782 | 782 | ||
783 | void ContactEditor::slotAddressTypeChange( int index ) { | 783 | void ContactEditor::slotAddressTypeChange( int index ) { |
784 | 784 | ||
785 | if ( index == 0 ) { | 785 | if ( index == 0 ) { |
786 | 786 | ||
787 | txtAddress->setText( slBusinessAddress[0] ); | 787 | txtAddress->setText( slBusinessAddress[0] ); |
788 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 788 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
789 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 789 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
790 | txtCity->setText( slBusinessAddress[3] ); | 790 | txtCity->setText( slBusinessAddress[3] ); |
791 | txtState->setText( slBusinessAddress[4] ); | 791 | txtState->setText( slBusinessAddress[4] ); |
792 | txtZip->setText( slBusinessAddress[5] ); | 792 | txtZip->setText( slBusinessAddress[5] ); |
793 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 793 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
794 | txtTmp->setText( slBusinessAddress[6] ); | 794 | txtTmp->setText( slBusinessAddress[6] ); |
795 | 795 | ||
796 | } else { | 796 | } else { |
797 | 797 | ||
798 | txtAddress->setText( slHomeAddress[0] ); | 798 | txtAddress->setText( slHomeAddress[0] ); |
799 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 799 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
800 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 800 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
801 | txtCity->setText( slHomeAddress[3] ); | 801 | txtCity->setText( slHomeAddress[3] ); |
802 | txtState->setText( slHomeAddress[4] ); | 802 | txtState->setText( slHomeAddress[4] ); |
803 | txtZip->setText( slHomeAddress[5] ); | 803 | txtZip->setText( slHomeAddress[5] ); |
804 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 804 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
805 | txtTmp->setText( slHomeAddress[6] ); | 805 | txtTmp->setText( slHomeAddress[6] ); |
806 | 806 | ||
807 | } | 807 | } |
808 | 808 | ||
809 | } | 809 | } |
810 | 810 | ||
811 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 811 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
812 | 812 | ||
813 | int index = cmbFileAs->currentItem(); | 813 | int index = cmbFileAs->currentItem(); |
814 | 814 | ||
815 | cmbFileAs->clear(); | 815 | cmbFileAs->clear(); |
816 | 816 | ||
817 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); | 817 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); |
818 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); | 818 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); |
819 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); | 819 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); |
820 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); | 820 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); |
821 | 821 | ||
822 | cmbFileAs->setCurrentItem( index ); | 822 | cmbFileAs->setCurrentItem( index ); |
823 | 823 | ||
824 | useFullName = true; | 824 | useFullName = true; |
825 | 825 | ||
826 | } | 826 | } |
827 | 827 | ||
828 | void ContactEditor::accept() { | 828 | void ContactEditor::accept() { |
829 | 829 | ||
830 | if ( isEmpty() ) { | 830 | if ( isEmpty() ) { |
831 | cleanupFields(); | 831 | cleanupFields(); |
832 | reject(); | 832 | reject(); |
833 | } else { | 833 | } else { |
834 | saveEntry(); | 834 | saveEntry(); |
835 | cleanupFields(); | 835 | cleanupFields(); |
836 | QDialog::accept(); | 836 | QDialog::accept(); |
837 | } | 837 | } |
838 | 838 | ||
839 | } | 839 | } |
840 | 840 | ||
841 | void ContactEditor::slotNote() { | 841 | void ContactEditor::slotNote() { |
842 | 842 | ||
843 | dlgNote->showMaximized(); | 843 | dlgNote->showMaximized(); |
844 | if ( !dlgNote->exec() ) { | 844 | if ( !dlgNote->exec() ) { |
845 | txtNote->setText( ent.notes() ); | 845 | txtNote->setText( ent.notes() ); |
846 | } | 846 | } |
847 | } | 847 | } |
848 | 848 | ||
849 | void ContactEditor::slotName() { | 849 | void ContactEditor::slotName() { |
850 | 850 | ||
851 | QString tmpName; | 851 | QString tmpName; |
852 | if (useFullName) { | 852 | if (useFullName) { |
853 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 853 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
854 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 854 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
855 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 855 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
856 | txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 856 | txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
857 | } | 857 | } |
858 | dlgName->showMaximized(); | 858 | dlgName->showMaximized(); |
859 | if ( dlgName->exec() ) { | 859 | if ( dlgName->exec() ) { |
860 | 860 | ||
861 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); | 861 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); |
862 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 862 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
863 | slotFullNameChange( txtFullName->text() ); | 863 | slotFullNameChange( txtFullName->text() ); |
864 | useFullName = false; | 864 | useFullName = false; |
865 | } | 865 | } |
866 | 866 | ||
867 | } | 867 | } |
868 | 868 | ||
869 | void ContactEditor::setNameFocus() { | 869 | void ContactEditor::setNameFocus() { |
870 | 870 | ||
871 | txtFullName->setFocus(); | 871 | txtFullName->setFocus(); |
872 | 872 | ||
873 | } | 873 | } |
874 | 874 | ||
875 | bool ContactEditor::isEmpty() { | 875 | bool ContactEditor::isEmpty() { |
876 | // Test and see if the record should be saved. | 876 | // Test and see if the record should be saved. |
877 | // More strict than the original qtopia, needs name or fileas to save | 877 | // More strict than the original qtopia, needs name or fileas to save |
878 | 878 | ||
879 | QString t = txtFullName->text(); | 879 | QString t = txtFullName->text(); |
880 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 880 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
881 | return false; | 881 | return false; |
882 | 882 | ||
883 | t = cmbFileAs->currentText(); | 883 | t = cmbFileAs->currentText(); |
884 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 884 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
885 | return false; | 885 | return false; |
886 | 886 | ||
887 | return true; | 887 | return true; |
888 | 888 | ||
889 | } | 889 | } |
890 | 890 | ||
891 | QString ContactEditor::parseName( const QString fullName, int type ) { | 891 | QString ContactEditor::parseName( const QString fullName, int type ) { |
892 | 892 | ||
893 | QString simplifiedName( fullName.simplifyWhiteSpace() ); | 893 | QString simplifiedName( fullName.simplifyWhiteSpace() ); |
894 | QString strFirstName; | 894 | QString strFirstName; |
895 | QString strMiddleName; | 895 | QString strMiddleName; |
896 | QString strLastName; | 896 | QString strLastName; |
897 | QString strSuffix; | 897 | QString strSuffix; |
898 | QString strTitle; | 898 | QString strTitle; |
899 | int commapos; | 899 | int commapos; |
900 | int spCount; | 900 | int spCount; |
901 | int spPos; | 901 | int spPos; |
902 | int spPos2; | 902 | int spPos2; |
903 | 903 | ||
904 | 904 | ||
905 | commapos = simplifiedName.find( ',', 0, TRUE); | 905 | commapos = simplifiedName.find( ',', 0, TRUE); |
906 | spCount = simplifiedName.contains( ' ', TRUE ); | 906 | spCount = simplifiedName.contains( ' ', TRUE ); |
907 | 907 | ||
908 | if ( commapos == -1 ) { | 908 | if ( commapos == -1 ) { |
909 | 909 | ||
910 | switch (spCount) { | 910 | switch (spCount) { |
911 | case 0: | 911 | case 0: |
912 | //return simplifiedName; | 912 | //return simplifiedName; |
913 | if (txtLastName->text() != "") { | 913 | if (txtLastName->text() != "") { |
914 | strLastName = simplifiedName; | 914 | strLastName = simplifiedName; |
915 | break; | 915 | break; |
916 | } | 916 | } |
917 | if (txtMiddleName->text() != "") { | 917 | if (txtMiddleName->text() != "") { |
918 | strMiddleName = simplifiedName; | 918 | strMiddleName = simplifiedName; |
919 | break; | 919 | break; |
920 | } | 920 | } |
921 | if (txtSuffix->text() != "") { | 921 | if (txtSuffix->text() != "") { |
922 | strSuffix = simplifiedName; | 922 | strSuffix = simplifiedName; |
923 | break; | 923 | break; |
924 | } | 924 | } |
925 | strFirstName = simplifiedName; | 925 | strFirstName = simplifiedName; |
926 | break; | 926 | break; |
927 | 927 | ||
928 | case 1: | 928 | case 1: |
929 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 929 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
930 | strFirstName = simplifiedName.left( spPos ); | 930 | strFirstName = simplifiedName.left( spPos ); |
931 | strLastName = simplifiedName.mid( spPos + 1 ); | 931 | strLastName = simplifiedName.mid( spPos + 1 ); |
932 | break; | 932 | break; |
933 | 933 | ||
934 | case 2: | 934 | case 2: |
935 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 935 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
936 | strFirstName = simplifiedName.left( spPos ); | 936 | strFirstName = simplifiedName.left( spPos ); |
937 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 937 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
938 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 938 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
939 | strLastName = simplifiedName.mid( spPos2 + 1 ); | 939 | strLastName = simplifiedName.mid( spPos2 + 1 ); |
940 | break; | 940 | break; |
941 | 941 | ||
942 | case 3: | 942 | case 3: |
943 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 943 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
944 | strFirstName = simplifiedName.left( spPos ); | 944 | strFirstName = simplifiedName.left( spPos ); |
945 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 945 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
946 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 946 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
947 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 947 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
948 | strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 948 | strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
949 | strSuffix = simplifiedName.mid( spPos + 1 ); | 949 | strSuffix = simplifiedName.mid( spPos + 1 ); |
950 | break; | 950 | break; |
951 | 951 | ||
952 | case 4: | 952 | case 4: |
953 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 953 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
954 | strTitle = simplifiedName.left( spPos ); | 954 | strTitle = simplifiedName.left( spPos ); |
955 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 955 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
956 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 956 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
957 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 957 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
958 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 958 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
959 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 959 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
960 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 960 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
961 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 961 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
962 | break; | 962 | break; |
963 | 963 | ||
964 | default: | 964 | default: |
965 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 965 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
966 | strTitle = simplifiedName.left( spPos ); | 966 | strTitle = simplifiedName.left( spPos ); |
967 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 967 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
968 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 968 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
969 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 969 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
970 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 970 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
971 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 971 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
972 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 972 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
973 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 973 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
974 | break; | 974 | break; |
975 | } | 975 | } |
976 | } else { | 976 | } else { |
977 | simplifiedName.replace( commapos, 1, " " ); | 977 | simplifiedName.replace( commapos, 1, " " ); |
978 | simplifiedName = simplifiedName.simplifyWhiteSpace(); | 978 | simplifiedName = simplifiedName.simplifyWhiteSpace(); |
979 | 979 | ||
980 | switch (spCount) { | 980 | switch (spCount) { |
981 | case 0: | 981 | case 0: |
982 | //return simplifiedName; | 982 | //return simplifiedName; |
983 | if (txtLastName->text() != "") { | 983 | if (txtLastName->text() != "") { |
984 | strLastName = simplifiedName; | 984 | strLastName = simplifiedName; |
985 | break; | 985 | break; |
986 | } | 986 | } |
987 | if (txtMiddleName->text() != "") { | 987 | if (txtMiddleName->text() != "") { |
988 | strMiddleName = simplifiedName; | 988 | strMiddleName = simplifiedName; |
989 | break; | 989 | break; |
990 | } | 990 | } |
991 | if (txtSuffix->text() != "") { | 991 | if (txtSuffix->text() != "") { |
992 | strSuffix = simplifiedName; | 992 | strSuffix = simplifiedName; |
993 | break; | 993 | break; |
994 | } | 994 | } |
995 | strFirstName = simplifiedName; | 995 | strFirstName = simplifiedName; |
996 | break; | 996 | break; |
997 | 997 | ||
998 | case 1: | 998 | case 1: |
999 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 999 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
1000 | strLastName = simplifiedName.left( spPos ); | 1000 | strLastName = simplifiedName.left( spPos ); |
1001 | strFirstName = simplifiedName.mid( spPos + 1 ); | 1001 | strFirstName = simplifiedName.mid( spPos + 1 ); |
1002 | break; | 1002 | break; |
1003 | 1003 | ||
1004 | case 2: | 1004 | case 2: |
1005 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 1005 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
1006 | strLastName = simplifiedName.left( spPos ); | 1006 | strLastName = simplifiedName.left( spPos ); |
1007 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1007 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1008 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1008 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1009 | strMiddleName = simplifiedName.mid( spPos2 + 1 ); | 1009 | strMiddleName = simplifiedName.mid( spPos2 + 1 ); |
1010 | break; | 1010 | break; |
1011 | 1011 | ||
1012 | case 3: | 1012 | case 3: |
1013 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 1013 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
1014 | strLastName = simplifiedName.left( spPos ); | 1014 | strLastName = simplifiedName.left( spPos ); |
1015 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1015 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1016 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1016 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1017 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 1017 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
1018 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 1018 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
1019 | strSuffix = simplifiedName.mid( spPos + 1 ); | 1019 | strSuffix = simplifiedName.mid( spPos + 1 ); |
1020 | break; | 1020 | break; |
1021 | 1021 | ||
1022 | case 4: | 1022 | case 4: |
1023 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 1023 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
1024 | strLastName = simplifiedName.left( spPos ); | 1024 | strLastName = simplifiedName.left( spPos ); |
1025 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1025 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1026 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1026 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1027 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 1027 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
1028 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 1028 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
1029 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1029 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1030 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1030 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1031 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 1031 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
1032 | break; | 1032 | break; |
1033 | 1033 | ||
1034 | default: | 1034 | default: |
1035 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 1035 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
1036 | strLastName = simplifiedName.left( spPos ); | 1036 | strLastName = simplifiedName.left( spPos ); |
1037 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1037 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1038 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1038 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1039 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 1039 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
1040 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); | 1040 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); |
1041 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1041 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1042 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1042 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1043 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 1043 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
1044 | break; | 1044 | break; |
1045 | } | 1045 | } |
1046 | } | 1046 | } |
1047 | switch (type) { | 1047 | switch (type) { |
1048 | case NAME_FL: | 1048 | case NAME_FL: |
1049 | return strFirstName + " " + strLastName; | 1049 | return strFirstName + " " + strLastName; |
1050 | 1050 | ||
1051 | case NAME_LF: | 1051 | case NAME_LF: |
1052 | return strLastName + ", " + strFirstName; | 1052 | return strLastName + ", " + strFirstName; |
1053 | 1053 | ||
1054 | case NAME_LFM: | 1054 | case NAME_LFM: |
1055 | return strLastName + ", " + strFirstName + " " + strMiddleName; | 1055 | return strLastName + ", " + strFirstName + " " + strMiddleName; |
1056 | 1056 | ||
1057 | case NAME_FMLS: | 1057 | case NAME_FMLS: |
1058 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; | 1058 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; |
1059 | 1059 | ||
1060 | case NAME_F: | 1060 | case NAME_F: |
1061 | return strFirstName; | 1061 | return strFirstName; |
1062 | 1062 | ||
1063 | case NAME_M: | 1063 | case NAME_M: |
1064 | return strMiddleName; | 1064 | return strMiddleName; |
1065 | 1065 | ||
1066 | case NAME_L: | 1066 | case NAME_L: |
1067 | return strLastName; | 1067 | return strLastName; |
1068 | 1068 | ||
1069 | case NAME_S: | 1069 | case NAME_S: |
1070 | return strSuffix; | 1070 | return strSuffix; |
1071 | 1071 | ||
1072 | } | 1072 | } |
1073 | return QString::null; | 1073 | return QString::null; |
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | void ContactEditor::cleanupFields() { | 1076 | void ContactEditor::cleanupFields() { |
1077 | QStringList::Iterator it = slChooserValues.begin(); | 1077 | QStringList::Iterator it = slChooserValues.begin(); |
1078 | 1078 | ||
1079 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { | 1079 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { |
1080 | (*it) = ""; | 1080 | (*it) = ""; |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | for ( int i = 0; i < 7; i++ ) { | 1083 | for ( int i = 0; i < 7; i++ ) { |
1084 | slHomeAddress[i] = ""; | 1084 | slHomeAddress[i] = ""; |
1085 | slBusinessAddress[i] = ""; | 1085 | slBusinessAddress[i] = ""; |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | QListIterator<QLineEdit> itLV( listValue ); | 1088 | QListIterator<QLineEdit> itLV( listValue ); |
1089 | for ( ; itLV.current(); ++itLV ) { | 1089 | for ( ; itLV.current(); ++itLV ) { |
1090 | (*itLV)->setText( "" ); | 1090 | (*itLV)->setText( "" ); |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | txtFirstName->setText(""); | 1093 | txtFirstName->setText(""); |
1094 | txtMiddleName->setText(""); | 1094 | txtMiddleName->setText(""); |
1095 | txtLastName->setText(""); | 1095 | txtLastName->setText(""); |
1096 | txtSuffix->setText(""); | 1096 | txtSuffix->setText(""); |
1097 | txtNote->setText(""); | 1097 | txtNote->setText(""); |
1098 | txtFullName->setText(""); | 1098 | txtFullName->setText(""); |
1099 | txtJobTitle->setText(""); | 1099 | txtJobTitle->setText(""); |
1100 | txtOrganization->setText(""); | 1100 | txtOrganization->setText(""); |
1101 | txtChooserField1->setText(""); | 1101 | txtChooserField1->setText(""); |
1102 | txtChooserField2->setText(""); | 1102 | txtChooserField2->setText(""); |
1103 | txtChooserField3->setText(""); | 1103 | txtChooserField3->setText(""); |
1104 | txtAddress->setText(""); | 1104 | txtAddress->setText(""); |
1105 | txtCity->setText(""); | 1105 | txtCity->setText(""); |
1106 | txtState->setText(""); | 1106 | txtState->setText(""); |
1107 | txtZip->setText(""); | 1107 | txtZip->setText(""); |
1108 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1108 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1109 | txtTmp->setText(""); | 1109 | txtTmp->setText(""); |
1110 | txtTmp = cmbFileAs->lineEdit(); | 1110 | txtTmp = cmbFileAs->lineEdit(); |
1111 | txtTmp->setText(""); | 1111 | txtTmp->setText(""); |
1112 | 1112 | ||
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | void ContactEditor::setEntry( const OContact &entry ) { | 1115 | void ContactEditor::setEntry( const OContact &entry ) { |
1116 | 1116 | ||
1117 | cleanupFields(); | 1117 | cleanupFields(); |
1118 | 1118 | ||
1119 | ent = entry; | 1119 | ent = entry; |
1120 | 1120 | ||
1121 | 1121 | ||
1122 | 1122 | ||
1123 | emails = QStringList(ent.emailList()); | 1123 | emails = QStringList(ent.emailList()); |
1124 | defaultEmail = ent.defaultEmail(); | 1124 | defaultEmail = ent.defaultEmail(); |
1125 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1125 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
1126 | qDebug("default email=%s",defaultEmail.latin1()); | 1126 | qDebug("default email=%s",defaultEmail.latin1()); |
1127 | 1127 | ||
1128 | useFullName = false; | 1128 | useFullName = false; |
1129 | txtFirstName->setText( ent.firstName() ); | 1129 | txtFirstName->setText( ent.firstName() ); |
1130 | txtMiddleName->setText( ent.middleName() ); | 1130 | txtMiddleName->setText( ent.middleName() ); |
1131 | txtLastName->setText( ent.lastName() ); | 1131 | txtLastName->setText( ent.lastName() ); |
1132 | txtSuffix->setText( ent.suffix() ); | 1132 | txtSuffix->setText( ent.suffix() ); |
1133 | 1133 | ||
1134 | QString *tmpString = new QString; | 1134 | QString *tmpString = new QString; |
1135 | *tmpString = ent.firstName() + " " + ent.middleName() + | 1135 | *tmpString = ent.firstName() + " " + ent.middleName() + |
1136 | + " " + ent.lastName() + " " + ent.suffix(); | 1136 | + " " + ent.lastName() + " " + ent.suffix(); |
1137 | 1137 | ||
1138 | txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1138 | txtFullName->setText( tmpString->simplifyWhiteSpace() ); |
1139 | 1139 | ||
1140 | cmbFileAs->setEditText( ent.fileAs() ); | 1140 | cmbFileAs->setEditText( ent.fileAs() ); |
1141 | 1141 | ||
1142 | //if (hasTitle) | 1142 | //if (hasTitle) |
1143 | txtJobTitle->setText( ent.jobTitle() ); | 1143 | txtJobTitle->setText( ent.jobTitle() ); |
1144 | 1144 | ||
1145 | //if (hasCompany) | 1145 | //if (hasCompany) |
1146 | txtOrganization->setText( ent.company() ); | 1146 | txtOrganization->setText( ent.company() ); |
1147 | 1147 | ||
1148 | //if (hasNotes) | 1148 | //if (hasNotes) |
1149 | txtNote->setText( ent.notes() ); | 1149 | txtNote->setText( ent.notes() ); |
1150 | 1150 | ||
1151 | //if (hasStreet) { | 1151 | //if (hasStreet) { |
1152 | slHomeAddress[0] = ent.homeStreet(); | 1152 | slHomeAddress[0] = ent.homeStreet(); |
1153 | slBusinessAddress[0] = ent.businessStreet(); | 1153 | slBusinessAddress[0] = ent.businessStreet(); |
1154 | //} | 1154 | //} |
1155 | 1155 | ||
1156 | //if (hasCity) { | 1156 | //if (hasCity) { |
1157 | slHomeAddress[3] = ent.homeCity(); | 1157 | slHomeAddress[3] = ent.homeCity(); |
1158 | slBusinessAddress[3] = ent.businessCity(); | 1158 | slBusinessAddress[3] = ent.businessCity(); |
1159 | //} | 1159 | //} |
1160 | 1160 | ||
1161 | //if (hasState) { | 1161 | //if (hasState) { |
1162 | slHomeAddress[4] = ent.homeState(); | 1162 | slHomeAddress[4] = ent.homeState(); |
1163 | slBusinessAddress[4] = ent.businessState(); | 1163 | slBusinessAddress[4] = ent.businessState(); |
1164 | //} | 1164 | //} |
1165 | 1165 | ||
1166 | //if (hasZip) { | 1166 | //if (hasZip) { |
1167 | slHomeAddress[5] = ent.homeZip(); | 1167 | slHomeAddress[5] = ent.homeZip(); |
1168 | slBusinessAddress[5] = ent.businessZip(); | 1168 | slBusinessAddress[5] = ent.businessZip(); |
1169 | //} | 1169 | //} |
1170 | 1170 | ||
1171 | //if (hasCountry) { | 1171 | //if (hasCountry) { |
1172 | slHomeAddress[6] = ent.homeCountry(); | 1172 | slHomeAddress[6] = ent.homeCountry(); |
1173 | slBusinessAddress[6] = ent.businessCountry(); | 1173 | slBusinessAddress[6] = ent.businessCountry(); |
1174 | //} | 1174 | //} |
1175 | 1175 | ||
1176 | QStringList::ConstIterator it; | 1176 | QStringList::ConstIterator it; |
1177 | QListIterator<QLineEdit> itLE( listValue ); | 1177 | QListIterator<QLineEdit> itLE( listValue ); |
1178 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { | 1178 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { |
1179 | if ( *it == "Department" ) | 1179 | if ( *it == "Department" ) |
1180 | (*itLE)->setText( ent.department() ); | 1180 | (*itLE)->setText( ent.department() ); |
1181 | 1181 | ||
1182 | if ( *it == "Company" ) | 1182 | if ( *it == "Company" ) |
1183 | (*itLE)->setText( ent.company() ); | 1183 | (*itLE)->setText( ent.company() ); |
1184 | 1184 | ||
1185 | if ( *it == "Office" ) | 1185 | if ( *it == "Office" ) |
1186 | (*itLE)->setText( ent.office() ); | 1186 | (*itLE)->setText( ent.office() ); |
1187 | 1187 | ||
1188 | if ( *it == "Profession" ) | 1188 | if ( *it == "Profession" ) |
1189 | (*itLE)->setText( ent.profession() ); | 1189 | (*itLE)->setText( ent.profession() ); |
1190 | 1190 | ||
1191 | if ( *it == "Assistant" ) | 1191 | if ( *it == "Assistant" ) |
1192 | (*itLE)->setText( ent.assistant() ); | 1192 | (*itLE)->setText( ent.assistant() ); |
1193 | 1193 | ||
1194 | if ( *it == "Manager" ) | 1194 | if ( *it == "Manager" ) |
1195 | (*itLE)->setText( ent.manager() ); | 1195 | (*itLE)->setText( ent.manager() ); |
1196 | 1196 | ||
1197 | if ( *it == "Spouse" ) | 1197 | if ( *it == "Spouse" ) |
1198 | (*itLE)->setText( ent.spouse() ); | 1198 | (*itLE)->setText( ent.spouse() ); |
1199 | 1199 | ||
1200 | if ( *it == "Nickname" ) | 1200 | if ( *it == "Nickname" ) |
1201 | (*itLE)->setText( ent.nickname() ); | 1201 | (*itLE)->setText( ent.nickname() ); |
1202 | 1202 | ||
1203 | if ( *it == "Children" ) | 1203 | if ( *it == "Children" ) |
1204 | (*itLE)->setText( ent.children() ); | 1204 | (*itLE)->setText( ent.children() ); |
1205 | 1205 | ||
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | QStringList::Iterator itV; | 1208 | QStringList::Iterator itV; |
1209 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1209 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1210 | 1210 | ||
1211 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) | 1211 | if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) |
1212 | *itV = ent.businessPhone(); | 1212 | *itV = ent.businessPhone(); |
1213 | /* | 1213 | /* |
1214 | if ( *it == "Business 2 Phone" ) | 1214 | if ( *it == "Business 2 Phone" ) |
1215 | *itV = ent.business2Phone(); | 1215 | *itV = ent.business2Phone(); |
1216 | */ | 1216 | */ |
1217 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) | 1217 | if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) |
1218 | *itV = ent.businessFax(); | 1218 | *itV = ent.businessFax(); |
1219 | 1219 | ||
1220 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) | 1220 | if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) |
1221 | *itV = ent.businessMobile(); | 1221 | *itV = ent.businessMobile(); |
1222 | /* | 1222 | /* |
1223 | if ( *it == "Company Phone" ) | 1223 | if ( *it == "Company Phone" ) |
1224 | *itV = ent.companyPhone(); | 1224 | *itV = ent.companyPhone(); |
1225 | */ | 1225 | */ |
1226 | if ( *it == "Default Email" ) | 1226 | if ( *it == "Default Email" ) |
1227 | *itV = ent.defaultEmail(); | 1227 | *itV = ent.defaultEmail(); |
1228 | 1228 | ||
1229 | if ( *it == "Emails" ) | 1229 | if ( *it == "Emails" ) |
1230 | *itV = ent.emailList().join(", "); // :SX | 1230 | *itV = ent.emailList().join(", "); // :SX |
1231 | 1231 | ||
1232 | if ( *it == "Home Phone" ) | 1232 | if ( *it == "Home Phone" ) |
1233 | *itV = ent.homePhone(); | 1233 | *itV = ent.homePhone(); |
1234 | /* | 1234 | /* |
1235 | if ( *it == "Home 2 Phone" ) | 1235 | if ( *it == "Home 2 Phone" ) |
1236 | *itV = ent.home2Phone(); | 1236 | *itV = ent.home2Phone(); |
1237 | */ | 1237 | */ |
1238 | if ( *it == "Home Fax" ) | 1238 | if ( *it == "Home Fax" ) |
1239 | *itV = ent.homeFax(); | 1239 | *itV = ent.homeFax(); |
1240 | 1240 | ||
1241 | if ( *it == "Home Mobile" ) | 1241 | if ( *it == "Home Mobile" ) |
1242 | *itV = ent.homeMobile(); | 1242 | *itV = ent.homeMobile(); |
1243 | /* | 1243 | /* |
1244 | if ( *it == "Car Phone" ) | 1244 | if ( *it == "Car Phone" ) |
1245 | *itV = ent.carPhone(); | 1245 | *itV = ent.carPhone(); |
1246 | 1246 | ||
1247 | if ( *it == "ISDN Phone" ) | 1247 | if ( *it == "ISDN Phone" ) |
1248 | *itV = ent.ISDNPhone(); | 1248 | *itV = ent.ISDNPhone(); |
1249 | 1249 | ||
1250 | if ( *it == "Other Phone" ) | 1250 | if ( *it == "Other Phone" ) |
1251 | *itV = ent.otherPhone(); | 1251 | *itV = ent.otherPhone(); |
1252 | */ | 1252 | */ |
1253 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) | 1253 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) |
1254 | *itV = ent.businessPager(); | 1254 | *itV = ent.businessPager(); |
1255 | /* | 1255 | /* |
1256 | if ( *it == "Home Pager") | 1256 | if ( *it == "Home Pager") |
1257 | *itV = ent.homePager(); | 1257 | *itV = ent.homePager(); |
1258 | 1258 | ||
1259 | if ( *it == "AIM IM" ) | 1259 | if ( *it == "AIM IM" ) |
1260 | *itV = ent.AIMIM(); | 1260 | *itV = ent.AIMIM(); |
1261 | 1261 | ||
1262 | if ( *it == "ICQ IM" ) | 1262 | if ( *it == "ICQ IM" ) |
1263 | *itV = ent.ICQIM(); | 1263 | *itV = ent.ICQIM(); |
1264 | 1264 | ||
1265 | if ( *it == "Jabber IM" ) | 1265 | if ( *it == "Jabber IM" ) |
1266 | *itV = ent.jabberIM(); | 1266 | *itV = ent.jabberIM(); |
1267 | 1267 | ||
1268 | if ( *it == "MSN IM" ) | 1268 | if ( *it == "MSN IM" ) |
1269 | *itV = ent.MSNIM(); | 1269 | *itV = ent.MSNIM(); |
1270 | 1270 | ||
1271 | if ( *it == "Yahoo IM" ) | 1271 | if ( *it == "Yahoo IM" ) |
1272 | *itV = ent.yahooIM(); | 1272 | *itV = ent.yahooIM(); |
1273 | */ | 1273 | */ |
1274 | if ( *it == "Home Web Page" ) | 1274 | if ( *it == "Home Web Page" ) |
1275 | *itV = ent.homeWebpage(); | 1275 | *itV = ent.homeWebpage(); |
1276 | 1276 | ||
1277 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) | 1277 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) |
1278 | *itV = ent.businessWebpage(); | 1278 | *itV = ent.businessWebpage(); |
1279 | 1279 | ||
1280 | 1280 | ||
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | 1283 | ||
1284 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); | 1284 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); |
1285 | 1285 | ||
1286 | QString gender = ent.gender(); | 1286 | QString gender = ent.gender(); |
1287 | cmbGender->setCurrentItem( gender.toInt() ); | 1287 | cmbGender->setCurrentItem( gender.toInt() ); |
1288 | 1288 | ||
1289 | txtNote->setText( ent.notes() ); | 1289 | txtNote->setText( ent.notes() ); |
1290 | 1290 | ||
1291 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); | 1291 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); |
1292 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); | 1292 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); |
1293 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); | 1293 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); |
1294 | 1294 | ||
1295 | slotAddressTypeChange( cmbAddress->currentItem() ); | 1295 | slotAddressTypeChange( cmbAddress->currentItem() ); |
1296 | 1296 | ||
1297 | // loadFields(); :SX | 1297 | // loadFields(); :SX |
1298 | updateDatePicker(); | 1298 | updateDatePicker(); |
1299 | } | 1299 | } |
1300 | void ContactEditor::updateDatePicker() | 1300 | void ContactEditor::updateDatePicker() |
1301 | { | 1301 | { |
1302 | // Set DatePicker | 1302 | // Set DatePicker |
1303 | if ( !ent.birthday().isNull() ){ | 1303 | if ( !ent.birthday().isNull() ){ |
1304 | birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); | 1304 | birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); |
1305 | birthdayPicker->setDate( ent.birthday() ); | 1305 | birthdayPicker->setDate( ent.birthday() ); |
1306 | } else | 1306 | } else |
1307 | birthdayButton->setText( tr ("Unknown") ); | 1307 | birthdayButton->setText( tr ("Unknown") ); |
1308 | 1308 | ||
1309 | if ( !ent.anniversary().isNull() ){ | 1309 | if ( !ent.anniversary().isNull() ){ |
1310 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); | 1310 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); |
1311 | anniversaryPicker->setDate( ent.anniversary() ); | 1311 | anniversaryPicker->setDate( ent.anniversary() ); |
1312 | } else | 1312 | } else |
1313 | anniversaryButton->setText( tr ("Unknown") ); | 1313 | anniversaryButton->setText( tr ("Unknown") ); |
1314 | 1314 | ||
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | void ContactEditor::saveEntry() { | 1317 | void ContactEditor::saveEntry() { |
1318 | 1318 | ||
1319 | if ( useFullName ) { | 1319 | if ( useFullName ) { |
1320 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); | 1320 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); |
1321 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); | 1321 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); |
1322 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); | 1322 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); |
1323 | txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); | 1323 | txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); |
1324 | 1324 | ||
1325 | useFullName = false; | 1325 | useFullName = false; |
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | ent.setFirstName( txtFirstName->text() ); | 1328 | ent.setFirstName( txtFirstName->text() ); |
1329 | ent.setLastName( txtLastName->text() ); | 1329 | ent.setLastName( txtLastName->text() ); |
1330 | ent.setMiddleName( txtMiddleName->text() ); | 1330 | ent.setMiddleName( txtMiddleName->text() ); |
1331 | ent.setSuffix( txtSuffix->text() ); | 1331 | ent.setSuffix( txtSuffix->text() ); |
1332 | 1332 | ||
1333 | ent.setFileAs( cmbFileAs->currentText() ); | 1333 | ent.setFileAs( cmbFileAs->currentText() ); |
1334 | 1334 | ||
1335 | ent.setCategories( cmbCat->currentCategories() ); | 1335 | ent.setCategories( cmbCat->currentCategories() ); |
1336 | 1336 | ||
1337 | 1337 | ||
1338 | //if (hasTitle) | 1338 | //if (hasTitle) |
1339 | ent.setJobTitle( txtJobTitle->text() ); | 1339 | ent.setJobTitle( txtJobTitle->text() ); |
1340 | 1340 | ||
1341 | //if (hasCompany) | 1341 | //if (hasCompany) |
1342 | ent.setCompany( txtOrganization->text() ); | 1342 | ent.setCompany( txtOrganization->text() ); |
1343 | 1343 | ||
1344 | //if (hasNotes) | 1344 | //if (hasNotes) |
1345 | ent.setNotes( txtNote->text() ); | 1345 | ent.setNotes( txtNote->text() ); |
1346 | 1346 | ||
1347 | //if (hasStreet) { | 1347 | //if (hasStreet) { |
1348 | ent.setHomeStreet( slHomeAddress[0] ); | 1348 | ent.setHomeStreet( slHomeAddress[0] ); |
1349 | ent.setBusinessStreet( slBusinessAddress[0] ); | 1349 | ent.setBusinessStreet( slBusinessAddress[0] ); |
1350 | //} | 1350 | //} |
1351 | 1351 | ||
1352 | //if (hasCity) { | 1352 | //if (hasCity) { |
1353 | ent.setHomeCity( slHomeAddress[3] ); | 1353 | ent.setHomeCity( slHomeAddress[3] ); |
1354 | ent.setBusinessCity( slBusinessAddress[3] ); | 1354 | ent.setBusinessCity( slBusinessAddress[3] ); |
1355 | //} | 1355 | //} |
1356 | 1356 | ||
1357 | //if (hasState) { | 1357 | //if (hasState) { |
1358 | ent.setHomeState( slHomeAddress[4] ); | 1358 | ent.setHomeState( slHomeAddress[4] ); |
1359 | ent.setBusinessState( slBusinessAddress[4] ); | 1359 | ent.setBusinessState( slBusinessAddress[4] ); |
1360 | //} | 1360 | //} |
1361 | 1361 | ||
1362 | //if (hasZip) { | 1362 | //if (hasZip) { |
1363 | ent.setHomeZip( slHomeAddress[5] ); | 1363 | ent.setHomeZip( slHomeAddress[5] ); |
1364 | ent.setBusinessZip( slBusinessAddress[5] ); | 1364 | ent.setBusinessZip( slBusinessAddress[5] ); |
1365 | //} | 1365 | //} |
1366 | 1366 | ||
1367 | //if (hasCountry) { | 1367 | //if (hasCountry) { |
1368 | ent.setHomeCountry( slHomeAddress[6] ); | 1368 | ent.setHomeCountry( slHomeAddress[6] ); |
1369 | ent.setBusinessCountry( slBusinessAddress[6] ); | 1369 | ent.setBusinessCountry( slBusinessAddress[6] ); |
1370 | //} | 1370 | //} |
1371 | 1371 | ||
1372 | QStringList::ConstIterator it; | 1372 | QStringList::ConstIterator it; |
1373 | QListIterator<QLineEdit> itLE( listValue ); | 1373 | QListIterator<QLineEdit> itLE( listValue ); |
1374 | for ( it = slDynamicEntries.begin(); itLE.current() && it != slDynamicEntries.end(); ++it, ++itLE) { | 1374 | for ( it = slDynamicEntries.begin(); itLE.current() && it != slDynamicEntries.end(); ++it, ++itLE) { |
1375 | 1375 | ||
1376 | if ( *it == "Department" ) | 1376 | if ( *it == "Department" ) |
1377 | ent.setDepartment( (*itLE)->text() ); | 1377 | ent.setDepartment( (*itLE)->text() ); |
1378 | 1378 | ||
1379 | if ( *it == "Company" ) | 1379 | if ( *it == "Company" ) |
1380 | ent.setCompany( (*itLE)->text() ); | 1380 | ent.setCompany( (*itLE)->text() ); |
1381 | 1381 | ||
1382 | if ( *it == "Office" ) | 1382 | if ( *it == "Office" ) |
1383 | ent.setOffice( (*itLE)->text() ); | 1383 | ent.setOffice( (*itLE)->text() ); |
1384 | 1384 | ||
1385 | if ( *it == "Profession" ) | 1385 | if ( *it == "Profession" ) |
1386 | ent.setProfession( (*itLE)->text() ); | 1386 | ent.setProfession( (*itLE)->text() ); |
1387 | 1387 | ||
1388 | if ( *it == "Assistant" ) | 1388 | if ( *it == "Assistant" ) |
1389 | ent.setAssistant( (*itLE)->text() ); | 1389 | ent.setAssistant( (*itLE)->text() ); |
1390 | 1390 | ||
1391 | if ( *it == "Manager" ) | 1391 | if ( *it == "Manager" ) |
1392 | ent.setManager( (*itLE)->text() ); | 1392 | ent.setManager( (*itLE)->text() ); |
1393 | 1393 | ||
1394 | if ( *it == "Spouse" ) | 1394 | if ( *it == "Spouse" ) |
1395 | ent.setSpouse( (*itLE)->text() ); | 1395 | ent.setSpouse( (*itLE)->text() ); |
1396 | 1396 | ||
1397 | if ( *it == "Nickname" ) | 1397 | if ( *it == "Nickname" ) |
1398 | ent.setNickname( (*itLE)->text() ); | 1398 | ent.setNickname( (*itLE)->text() ); |
1399 | 1399 | ||
1400 | if ( *it == "Children" ) | 1400 | if ( *it == "Children" ) |
1401 | ent.setChildren( (*itLE)->text() ); | 1401 | ent.setChildren( (*itLE)->text() ); |
1402 | 1402 | ||
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | 1405 | ||
1406 | QStringList::ConstIterator itV; | 1406 | QStringList::ConstIterator itV; |
1407 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { | 1407 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1408 | 1408 | ||
1409 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) | 1409 | if ( ( *it == "Business Phone" ) || ( *it == "Work Phone" ) ) |
1410 | ent.setBusinessPhone( *itV ); | 1410 | ent.setBusinessPhone( *itV ); |
1411 | 1411 | ||
1412 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) | 1412 | if ( ( *it == "Business Fax" ) || ( *it == "Work Fax" ) ) |
1413 | ent.setBusinessFax( *itV ); | 1413 | ent.setBusinessFax( *itV ); |
1414 | 1414 | ||
1415 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) | 1415 | if ( ( *it == "Business Mobile" ) || ( *it == "Work Mobile" ) ) |
1416 | ent.setBusinessMobile( *itV ); | 1416 | ent.setBusinessMobile( *itV ); |
1417 | 1417 | ||
1418 | if ( *it == "Emails" ){ | 1418 | if ( *it == "Emails" ){ |
1419 | QString allemail; | 1419 | QString allemail; |
1420 | QString defaultmail; | 1420 | QString defaultmail; |
1421 | parseEmailFrom( *itV, defaultmail, allemail ); | 1421 | parseEmailFrom( *itV, defaultmail, allemail ); |
1422 | // ent.clearEmails(); | 1422 | // ent.clearEmails(); |
1423 | // ent.setDefaultEmail( defaultmail ); | 1423 | // ent.setDefaultEmail( defaultmail ); |
1424 | ent.setEmails( allemail ); | 1424 | ent.setEmails( allemail ); |
1425 | } | 1425 | } |
1426 | 1426 | ||
1427 | if ( *it == "Default Email") | 1427 | if ( *it == "Default Email") |
1428 | ent.setDefaultEmail( *itV ); | 1428 | ent.setDefaultEmail( *itV ); |
1429 | 1429 | ||
1430 | if ( *it == "Home Phone" ) | 1430 | if ( *it == "Home Phone" ) |
1431 | ent.setHomePhone( *itV ); | 1431 | ent.setHomePhone( *itV ); |
1432 | 1432 | ||
1433 | if ( *it == "Home Fax" ) | 1433 | if ( *it == "Home Fax" ) |
1434 | ent.setHomeFax( *itV ); | 1434 | ent.setHomeFax( *itV ); |
1435 | 1435 | ||
1436 | if ( *it == "Home Mobile" ) | 1436 | if ( *it == "Home Mobile" ) |
1437 | ent.setHomeMobile( *itV ); | 1437 | ent.setHomeMobile( *itV ); |
1438 | 1438 | ||
1439 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) | 1439 | if ( ( *it == "Business Pager" ) || ( *it == "Work Pager" ) ) |
1440 | ent.setBusinessPager( *itV ); | 1440 | ent.setBusinessPager( *itV ); |
1441 | 1441 | ||
1442 | if ( *it == "Home Web Page" ) | 1442 | if ( *it == "Home Web Page" ) |
1443 | ent.setHomeWebpage( *itV ); | 1443 | ent.setHomeWebpage( *itV ); |
1444 | 1444 | ||
1445 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) | 1445 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) |
1446 | ent.setBusinessWebpage( *itV ); | 1446 | ent.setBusinessWebpage( *itV ); |
1447 | 1447 | ||
1448 | 1448 | ||
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | int gender = cmbGender->currentItem(); | 1451 | int gender = cmbGender->currentItem(); |
1452 | ent.setGender( QString::number( gender ) ); | 1452 | ent.setGender( QString::number( gender ) ); |
1453 | 1453 | ||
1454 | QString str = txtNote->text(); | 1454 | QString str = txtNote->text(); |
1455 | if ( !str.isNull() ) | 1455 | if ( !str.isNull() ) |
1456 | ent.setNotes( str ); | 1456 | ent.setNotes( str ); |
1457 | 1457 | ||
1458 | } | 1458 | } |
1459 | 1459 | ||
1460 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 1460 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
1461 | QString &strAll ) | 1461 | QString &strAll ) |
1462 | { | 1462 | { |
1463 | int where, | 1463 | int where, |
1464 | start; | 1464 | start; |
1465 | if ( txt.isEmpty() ) | 1465 | if ( txt.isEmpty() ) |
1466 | return; | 1466 | return; |
1467 | // find the first | 1467 | // find the first |
1468 | where = txt.find( ',' ); | 1468 | where = txt.find( ',' ); |
1469 | if ( where < 0 ) { | 1469 | if ( where < 0 ) { |
1470 | strDefaultEmail = txt; | 1470 | strDefaultEmail = txt; |
1471 | strAll = txt; | 1471 | strAll = txt; |
1472 | } else { | 1472 | } else { |
1473 | strDefaultEmail = txt.left( where ).stripWhiteSpace(); | 1473 | strDefaultEmail = txt.left( where ).stripWhiteSpace(); |
1474 | strAll = strDefaultEmail; | 1474 | strAll = strDefaultEmail; |
1475 | while ( where > -1 ) { | 1475 | while ( where > -1 ) { |
1476 | strAll.append(" "); | 1476 | strAll.append(" "); |
1477 | start = where; | 1477 | start = where; |
1478 | where = txt.find( ',', where + 1 ); | 1478 | where = txt.find( ',', where + 1 ); |
1479 | if ( where > - 1 ) | 1479 | if ( where > - 1 ) |
1480 | strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); | 1480 | strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); |
1481 | else // grab until the end... | 1481 | else // grab until the end... |
1482 | strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); | 1482 | strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); |
1483 | } | 1483 | } |
1484 | } | 1484 | } |
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | void parseEmailTo( const QString &strDefaultEmail, | 1487 | void parseEmailTo( const QString &strDefaultEmail, |
1488 | const QString &strOtherEmail, QString &strBack ) | 1488 | const QString &strOtherEmail, QString &strBack ) |
1489 | { | 1489 | { |
1490 | // create a comma dilimeted set of emails... | 1490 | // create a comma dilimeted set of emails... |
1491 | // use the power of short circuiting... | 1491 | // use the power of short circuiting... |
1492 | bool foundDefault = false; | 1492 | bool foundDefault = false; |
1493 | QString strTmp; | 1493 | QString strTmp; |
1494 | int start = 0; | 1494 | int start = 0; |
1495 | int where; | 1495 | int where; |
1496 | // start at the beginng. | 1496 | // start at the beginng. |
1497 | strBack = strDefaultEmail; | 1497 | strBack = strDefaultEmail; |
1498 | where = 0; | 1498 | where = 0; |
1499 | while ( where > -1 ) { | 1499 | while ( where > -1 ) { |
1500 | start = where; | 1500 | start = where; |
1501 | where = strOtherEmail.find( ' ', where + 1 ); | 1501 | where = strOtherEmail.find( ' ', where + 1 ); |
1502 | if ( where > 0 ) { | 1502 | if ( where > 0 ) { |
1503 | strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); | 1503 | strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); |
1504 | } else | 1504 | } else |
1505 | strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); | 1505 | strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); |
1506 | if ( foundDefault || strTmp != strDefaultEmail ) { | 1506 | if ( foundDefault || strTmp != strDefaultEmail ) { |
1507 | strBack.append( ", " ); | 1507 | strBack.append( ", " ); |
1508 | strBack.append( strTmp ); | 1508 | strBack.append( strTmp ); |
1509 | } else | 1509 | } else |
1510 | foundDefault = true; | 1510 | foundDefault = true; |
1511 | } | 1511 | } |
1512 | } | 1512 | } |
1513 | 1513 | ||
1514 | 1514 | ||
1515 | static inline bool containsAlphaNum( const QString &str ) | 1515 | static inline bool containsAlphaNum( const QString &str ) |
1516 | { | 1516 | { |
1517 | int i, | 1517 | int i, |
1518 | count = str.length(); | 1518 | count = str.length(); |
1519 | for ( i = 0; i < count; i++ ) | 1519 | for ( i = 0; i < count; i++ ) |
1520 | if ( !str[i].isSpace() ) | 1520 | if ( !str[i].isSpace() ) |
1521 | return TRUE; | 1521 | return TRUE; |
1522 | return FALSE; | 1522 | return FALSE; |
1523 | } | 1523 | } |
1524 | 1524 | ||
1525 | static inline bool constainsWhiteSpace( const QString &str ) | 1525 | static inline bool constainsWhiteSpace( const QString &str ) |
1526 | { | 1526 | { |
1527 | int i, | 1527 | int i, |
1528 | count = str.length(); | 1528 | count = str.length(); |
1529 | for (i = 0; i < count; i++ ) | 1529 | for (i = 0; i < count; i++ ) |
1530 | if ( str[i].isSpace() ) | 1530 | if ( str[i].isSpace() ) |
1531 | return TRUE; | 1531 | return TRUE; |
1532 | return FALSE; | 1532 | return FALSE; |
1533 | } | 1533 | } |
1534 | 1534 | ||
1535 | void ContactEditor::setPersonalView( bool personal ) | 1535 | void ContactEditor::setPersonalView( bool personal ) |
1536 | { | 1536 | { |
1537 | m_personalView = personal; | 1537 | m_personalView = personal; |
1538 | 1538 | ||
1539 | // Currently disbled due to the fact that | 1539 | // Currently disbled due to the fact that |
1540 | // show will not work... | 1540 | // show will not work... |
1541 | return; | 1541 | return; |
1542 | 1542 | ||
1543 | if ( personal ){ | 1543 | if ( personal ){ |
1544 | cmbCat->hide(); | 1544 | cmbCat->hide(); |
1545 | labCat->hide(); | 1545 | labCat->hide(); |
1546 | 1546 | ||
1547 | } else{ | 1547 | } else{ |
1548 | cmbCat->show(); | 1548 | cmbCat->show(); |
1549 | labCat->show(); | 1549 | labCat->show(); |
1550 | } | 1550 | } |
1551 | } | 1551 | } |
1552 | 1552 | ||
1553 | void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) | 1553 | void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) |
1554 | { | 1554 | { |
1555 | QDate date; | 1555 | QDate date; |
1556 | date.setYMD( year, month, day ); | 1556 | date.setYMD( year, month, day ); |
1557 | QString dateString = TimeString::numberDateString( date ); | 1557 | QString dateString = TimeString::numberDateString( date ); |
1558 | anniversaryButton->setText( dateString ); | 1558 | anniversaryButton->setText( dateString ); |
1559 | ent.setAnniversary ( date ); | 1559 | ent.setAnniversary ( date ); |
1560 | } | 1560 | } |
1561 | 1561 | ||
1562 | void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) | 1562 | void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) |
1563 | { | 1563 | { |
1564 | QDate date; | 1564 | QDate date; |
1565 | date.setYMD( year, month, day ); | 1565 | date.setYMD( year, month, day ); |
1566 | QString dateString = TimeString::numberDateString( date ); | 1566 | QString dateString = TimeString::numberDateString( date ); |
1567 | birthdayButton->setText( dateString ); | 1567 | birthdayButton->setText( dateString ); |
1568 | ent.setBirthday ( date ); | 1568 | ent.setBirthday ( date ); |
1569 | } | 1569 | } |
1570 | 1570 | ||
1571 | void ContactEditor::slotRemoveBirthday() | 1571 | void ContactEditor::slotRemoveBirthday() |
1572 | { | 1572 | { |
1573 | qWarning("void ContactEditor::slotRemoveBirthday()"); | 1573 | qWarning("void ContactEditor::slotRemoveBirthday()"); |
1574 | ent.setBirthday( QDate() ); | 1574 | ent.setBirthday( QDate() ); |
1575 | updateDatePicker(); | 1575 | updateDatePicker(); |
1576 | } | 1576 | } |
1577 | 1577 | ||
1578 | void ContactEditor::slotRemoveAnniversary() | 1578 | void ContactEditor::slotRemoveAnniversary() |
1579 | { | 1579 | { |
1580 | qWarning("void ContactEditor::slotRemoveAnniversary()"); | 1580 | qWarning("void ContactEditor::slotRemoveAnniversary()"); |
1581 | ent.setAnniversary( QDate() ); | 1581 | ent.setAnniversary( QDate() ); |
1582 | updateDatePicker(); | 1582 | updateDatePicker(); |
1583 | } | 1583 | } |