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