-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 1 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 254 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 12 |
3 files changed, 148 insertions, 119 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index beb953a..8229212 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -885,39 +885,40 @@ void AddressbookWindow::slotSetCategory( int c ) | |||
885 | setCaption( tr("Contacts") + " - " + tr ( "All" ) ); | 885 | setCaption( tr("Contacts") + " - " + tr ( "All" ) ); |
886 | } else if ( c == (int)catMenu->count() ) { | 886 | } else if ( c == (int)catMenu->count() ) { |
887 | abList->setShowCategory( tr( "Unfiled" ) ); | 887 | abList->setShowCategory( tr( "Unfiled" ) ); |
888 | setCaption( tr("Contacts") + " - " + tr( "Unfiled" ) ); | 888 | setCaption( tr("Contacts") + " - " + tr( "Unfiled" ) ); |
889 | } else { | 889 | } else { |
890 | QString cat = abList->categories()[c - 2]; | 890 | QString cat = abList->categories()[c - 2]; |
891 | abList->setShowCategory( cat ); | 891 | abList->setShowCategory( cat ); |
892 | setCaption( tr("Contacts") + " - " + cat ); | 892 | setCaption( tr("Contacts") + " - " + cat ); |
893 | } | 893 | } |
894 | } | 894 | } |
895 | 895 | ||
896 | void AddressbookWindow::slotSetLetter( char c ) { | 896 | void AddressbookWindow::slotSetLetter( char c ) { |
897 | 897 | ||
898 | abList->setShowByLetter( c ); | 898 | abList->setShowByLetter( c ); |
899 | 899 | ||
900 | } | 900 | } |
901 | 901 | ||
902 | void AddressbookWindow::populateCategories() | 902 | void AddressbookWindow::populateCategories() |
903 | { | 903 | { |
904 | catMenu->clear(); | 904 | catMenu->clear(); |
905 | 905 | ||
906 | int id, | 906 | int id, |
907 | rememberId; | 907 | rememberId; |
908 | id = 1; | 908 | id = 1; |
909 | rememberId = 0; | ||
909 | catMenu->insertItem( tr( "All" ), id++ ); | 910 | catMenu->insertItem( tr( "All" ), id++ ); |
910 | QStringList categories = abList->categories(); | 911 | QStringList categories = abList->categories(); |
911 | categories.append( tr( "Unfiled" ) ); | 912 | categories.append( tr( "Unfiled" ) ); |
912 | for ( QStringList::Iterator it = categories.begin(); | 913 | for ( QStringList::Iterator it = categories.begin(); |
913 | it != categories.end(); ++it ) { | 914 | it != categories.end(); ++it ) { |
914 | catMenu->insertItem( *it, id ); | 915 | catMenu->insertItem( *it, id ); |
915 | if ( *it == abList->showCategory() ) | 916 | if ( *it == abList->showCategory() ) |
916 | rememberId = id; | 917 | rememberId = id; |
917 | ++id; | 918 | ++id; |
918 | } | 919 | } |
919 | if ( abList->showCategory().isEmpty() ) | 920 | if ( abList->showCategory().isEmpty() ) |
920 | slotSetCategory( 1 ); | 921 | slotSetCategory( 1 ); |
921 | else | 922 | else |
922 | slotSetCategory( rememberId ); | 923 | slotSetCategory( rememberId ); |
923 | } | 924 | } |
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index e74da87..fa60f98 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -36,148 +36,148 @@ | |||
36 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
37 | #include <qmainwindow.h> | 37 | #include <qmainwindow.h> |
38 | #include <qvaluelist.h> | 38 | #include <qvaluelist.h> |
39 | 39 | ||
40 | static inline bool containsAlphaNum( const QString &str ); | 40 | static inline bool containsAlphaNum( const QString &str ); |
41 | static inline bool constainsWhiteSpace( const QString &str ); | 41 | static inline bool constainsWhiteSpace( const QString &str ); |
42 | 42 | ||
43 | // helper functions, convert our comma delimited list to proper | 43 | // helper functions, convert our comma delimited list to proper |
44 | // file format... | 44 | // file format... |
45 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 45 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
46 | QString &strAll ); | 46 | QString &strAll ); |
47 | 47 | ||
48 | // helper convert from file format to comma delimited... | 48 | // helper convert from file format to comma delimited... |
49 | void parseEmailTo( const QString &strDefaultEmail, | 49 | void parseEmailTo( const QString &strDefaultEmail, |
50 | const QString &strOtherEmail, QString &strBack ); | 50 | const QString &strOtherEmail, QString &strBack ); |
51 | 51 | ||
52 | ContactEditor::ContactEditor(const Contact &entry, | 52 | ContactEditor::ContactEditor(const Contact &entry, |
53 | const QValueList<int> *newOrderedValues, | 53 | const QValueList<int> *newOrderedValues, |
54 | QStringList *slNewOrdered, | 54 | QStringList *slNewOrdered, |
55 | QWidget *parent, | 55 | QWidget *parent, |
56 | const char *name, | 56 | const char *name, |
57 | WFlags fl ) | 57 | WFlags fl ) |
58 | : QDialog( parent, name, TRUE, fl ), | 58 | : QDialog( parent, name, TRUE, fl ), |
59 | orderedValues( newOrderedValues ), | 59 | orderedValues( newOrderedValues ), |
60 | slOrdered( slNewOrdered ) | 60 | slOrdered( *slNewOrdered ) |
61 | { | 61 | { |
62 | 62 | ||
63 | init(); | 63 | init(); |
64 | initMap(); | 64 | initMap(); |
65 | setEntry( entry ); | 65 | setEntry( entry ); |
66 | qDebug("finish"); | 66 | qDebug("finish"); |
67 | } | 67 | } |
68 | 68 | ||
69 | ContactEditor::~ContactEditor() { | 69 | ContactEditor::~ContactEditor() { |
70 | } | 70 | } |
71 | 71 | ||
72 | void ContactEditor::init() { | 72 | void ContactEditor::init() { |
73 | 73 | ||
74 | useFullName = TRUE; | 74 | useFullName = TRUE; |
75 | 75 | ||
76 | int i = 0; | 76 | int i = 0; |
77 | 77 | /** SHut up and stop leaking | |
78 | slHomeAddress = new QStringList; | 78 | slHomeAddress = new QStringList; |
79 | slBusinessAddress = new QStringList; | 79 | slBusinessAddress = new QStringList; |
80 | slChooserNames = new QStringList; | 80 | slChooserNames = new QStringList; |
81 | slChooserValues = new QStringList; | 81 | slChooserValues = new QStringList; |
82 | 82 | ||
83 | slDynamicEntries = new QStringList; | 83 | slDynamicEntries = new QStringList; |
84 | 84 | */ | |
85 | //*slDynamicEntries = *slOrdered; | 85 | //*slDynamicEntries = *slOrdered; |
86 | 86 | ||
87 | for (i = 0; i <= 6; i++) { | 87 | for (i = 0; i <= 6; i++) { |
88 | slHomeAddress->append( "" ); | 88 | slHomeAddress.append( "" ); |
89 | slBusinessAddress->append( "" ); | 89 | slBusinessAddress.append( "" ); |
90 | } | 90 | } |
91 | 91 | ||
92 | { | 92 | { |
93 | hasGender = FALSE; | 93 | hasGender = FALSE; |
94 | hasTitle = FALSE; | 94 | hasTitle = FALSE; |
95 | hasCompany = FALSE; | 95 | hasCompany = FALSE; |
96 | hasNotes = FALSE; | 96 | hasNotes = FALSE; |
97 | hasStreet = FALSE; | 97 | hasStreet = FALSE; |
98 | hasStreet2 = FALSE; | 98 | hasStreet2 = FALSE; |
99 | hasPOBox = FALSE; | 99 | hasPOBox = FALSE; |
100 | hasCity = FALSE; | 100 | hasCity = FALSE; |
101 | hasState = FALSE; | 101 | hasState = FALSE; |
102 | hasZip = FALSE; | 102 | hasZip = FALSE; |
103 | hasCountry = FALSE; | 103 | hasCountry = FALSE; |
104 | 104 | ||
105 | QStringList::ConstIterator it = slOrdered->begin(); | 105 | QStringList::ConstIterator it = slOrdered.begin(); |
106 | for ( i = 0; it != slOrdered->end(); i++, ++it ) { | 106 | for ( i = 0; it != slOrdered.end(); i++, ++it ) { |
107 | 107 | ||
108 | if ( (*it).right( 3 ) == tr( "Fax" ) ) { | 108 | if ( (*it).right( 3 ) == tr( "Fax" ) ) { |
109 | slChooserNames->append( *it ); | 109 | slChooserNames.append( *it ); |
110 | slChooserValues->append( tr( "" ) ); | 110 | slChooserValues.append("" ); |
111 | //slDynamicEntries->remove( it ); | 111 | //slDynamicEntries->remove( it ); |
112 | continue; | 112 | continue; |
113 | } | 113 | } |
114 | 114 | ||
115 | if ( (*it).right( 5 ) == tr( "Phone" ) ) { | 115 | if ( (*it).right( 5 ) == tr( "Phone" ) ) { |
116 | slChooserNames->append( *it ); | 116 | slChooserNames.append( *it ); |
117 | slChooserValues->append( "" ); | 117 | slChooserValues.append( "" ); |
118 | //slDynamicEntries->remove( it ); | 118 | //slDynamicEntries->remove( it ); |
119 | continue; | 119 | continue; |
120 | } | 120 | } |
121 | 121 | ||
122 | if ( (*it).right( 2 ) == tr( "IM" ) ) { | 122 | if ( (*it).right( 2 ) == tr( "IM" ) ) { |
123 | slChooserNames->append( *it ); | 123 | slChooserNames.append( *it ); |
124 | slChooserValues->append( "" ); | 124 | slChooserValues.append( "" ); |
125 | //slDynamicEntries->remove( it ); | 125 | //slDynamicEntries->remove( it ); |
126 | continue; | 126 | continue; |
127 | } | 127 | } |
128 | 128 | ||
129 | if ( (*it).right( 6 ) == tr( "Mobile" ) ) { | 129 | if ( (*it).right( 6 ) == tr( "Mobile" ) ) { |
130 | slChooserNames->append( *it ); | 130 | slChooserNames.append( *it ); |
131 | slChooserValues->append( "" ); | 131 | slChooserValues.append( "" ); |
132 | //slDynamicEntries->remove( it ); | 132 | //slDynamicEntries->remove( it ); |
133 | continue; | 133 | continue; |
134 | } | 134 | } |
135 | 135 | ||
136 | if ( (*it).right( 4 ) == tr( "Page" ) ) { | 136 | if ( (*it).right( 4 ) == tr( "Page" ) ) { |
137 | slChooserNames->append( *it ); | 137 | slChooserNames.append( *it ); |
138 | slChooserValues->append( "" ); | 138 | slChooserValues.append( "" ); |
139 | //slDynamicEntries->remove( it ); | 139 | //slDynamicEntries->remove( it ); |
140 | continue; | 140 | continue; |
141 | } | 141 | } |
142 | 142 | ||
143 | if ( (*it).right( 5 ) == tr( "Pager" ) ) { | 143 | if ( (*it).right( 5 ) == tr( "Pager" ) ) { |
144 | slChooserNames->append( *it ); | 144 | slChooserNames.append( *it ); |
145 | slChooserValues->append( "" ); | 145 | slChooserValues.append( "" ); |
146 | //slDynamicEntries->remove( it ); | 146 | //slDynamicEntries->remove( it ); |
147 | continue; | 147 | continue; |
148 | } | 148 | } |
149 | 149 | ||
150 | if ( *it == tr( "Default Email" ) ) { | 150 | if ( *it == tr( "Default Email" ) ) { |
151 | slChooserNames->append( *it ); | 151 | slChooserNames.append( *it ); |
152 | slChooserValues->append( "" ); | 152 | slChooserValues.append( "" ); |
153 | //slDynamicEntries->remove( it ); | 153 | //slDynamicEntries->remove( it ); |
154 | continue; | 154 | continue; |
155 | } | 155 | } |
156 | 156 | ||
157 | if ( *it == tr( "Emails" ) ) { | 157 | if ( *it == tr( "Emails" ) ) { |
158 | slChooserNames->append( *it ); | 158 | slChooserNames.append( *it ); |
159 | slChooserValues->append( "" ); | 159 | slChooserValues.append( "" ); |
160 | //slDynamicEntries->remove( it ); | 160 | //slDynamicEntries->remove( it ); |
161 | continue; | 161 | continue; |
162 | } | 162 | } |
163 | 163 | ||
164 | if ( *it == tr( "Name Title" ) ) { | 164 | if ( *it == tr( "Name Title" ) ) { |
165 | //slDynamicEntries->remove( it ); | 165 | //slDynamicEntries->remove( it ); |
166 | continue; | 166 | continue; |
167 | } | 167 | } |
168 | 168 | ||
169 | if ( *it == tr( "First Name" ) ) { | 169 | if ( *it == tr( "First Name" ) ) { |
170 | //slDynamicEntries->remove( it ); | 170 | //slDynamicEntries->remove( it ); |
171 | continue; | 171 | continue; |
172 | } | 172 | } |
173 | 173 | ||
174 | if ( *it == tr( "Middle Name" ) ) { | 174 | if ( *it == tr( "Middle Name" ) ) { |
175 | //slDynamicEntries->remove( it ); | 175 | //slDynamicEntries->remove( it ); |
176 | continue; | 176 | continue; |
177 | } | 177 | } |
178 | 178 | ||
179 | if ( *it == tr( "Last Name" ) ) { | 179 | if ( *it == tr( "Last Name" ) ) { |
180 | //slDynamicEntries->remove( it ); | 180 | //slDynamicEntries->remove( it ); |
181 | continue; | 181 | continue; |
182 | } | 182 | } |
183 | 183 | ||
@@ -241,49 +241,49 @@ void ContactEditor::init() { | |||
241 | if ( (*it).right( 4 ) == tr( "City" ) ) { | 241 | if ( (*it).right( 4 ) == tr( "City" ) ) { |
242 | hasCity = TRUE; | 242 | hasCity = TRUE; |
243 | //slDynamicEntries->remove( it ); | 243 | //slDynamicEntries->remove( it ); |
244 | continue; | 244 | continue; |
245 | } | 245 | } |
246 | 246 | ||
247 | if ( (*it).right( 5 ) == tr( "State" ) ) { | 247 | if ( (*it).right( 5 ) == tr( "State" ) ) { |
248 | hasState = TRUE; | 248 | hasState = TRUE; |
249 | //slDynamicEntries->remove( it ); | 249 | //slDynamicEntries->remove( it ); |
250 | continue; | 250 | continue; |
251 | } | 251 | } |
252 | 252 | ||
253 | if ( (*it).right( 3 ) == tr( "Zip" ) ) { | 253 | if ( (*it).right( 3 ) == tr( "Zip" ) ) { |
254 | hasZip = TRUE; | 254 | hasZip = TRUE; |
255 | //slDynamicEntries->remove( it ); | 255 | //slDynamicEntries->remove( it ); |
256 | continue; | 256 | continue; |
257 | } | 257 | } |
258 | 258 | ||
259 | if ( (*it).right( 7 ) == tr( "Country" ) ) { | 259 | if ( (*it).right( 7 ) == tr( "Country" ) ) { |
260 | hasCountry = TRUE; | 260 | hasCountry = TRUE; |
261 | //slDynamicEntries->remove( it ); | 261 | //slDynamicEntries->remove( it ); |
262 | continue; | 262 | continue; |
263 | } | 263 | } |
264 | 264 | ||
265 | slDynamicEntries->append( *it ); | 265 | slDynamicEntries.append( *it ); |
266 | } | 266 | } |
267 | } | 267 | } |
268 | 268 | ||
269 | QVBoxLayout *vb = new QVBoxLayout( this ); | 269 | QVBoxLayout *vb = new QVBoxLayout( this ); |
270 | 270 | ||
271 | tabMain = new QTabWidget( this ); | 271 | tabMain = new QTabWidget( this ); |
272 | vb->addWidget( tabMain ); | 272 | vb->addWidget( tabMain ); |
273 | 273 | ||
274 | QWidget *tabViewport = new QWidget ( tabMain ); | 274 | QWidget *tabViewport = new QWidget ( tabMain ); |
275 | 275 | ||
276 | vb = new QVBoxLayout( tabViewport ); | 276 | vb = new QVBoxLayout( tabViewport ); |
277 | 277 | ||
278 | svGeneral = new QScrollView( tabViewport ); | 278 | svGeneral = new QScrollView( tabViewport ); |
279 | vb->addWidget( svGeneral, 0, 0 ); | 279 | vb->addWidget( svGeneral, 0, 0 ); |
280 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 280 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
281 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 281 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
282 | 282 | ||
283 | QWidget *container = new QWidget( svGeneral->viewport() ); | 283 | QWidget *container = new QWidget( svGeneral->viewport() ); |
284 | svGeneral->addChild( container ); | 284 | svGeneral->addChild( container ); |
285 | 285 | ||
286 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 286 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); |
287 | gl->setResizeMode( QLayout::FreeResize ); | 287 | gl->setResizeMode( QLayout::FreeResize ); |
288 | 288 | ||
289 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 289 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
@@ -325,49 +325,49 @@ void ContactEditor::init() { | |||
325 | gl->addWidget( cmbFileAs, 6, 1 ); | 325 | gl->addWidget( cmbFileAs, 6, 1 ); |
326 | 326 | ||
327 | l = new QLabel( tr( "Category" ), container ); | 327 | l = new QLabel( tr( "Category" ), container ); |
328 | gl->addWidget( l, 7, 0 ); | 328 | gl->addWidget( l, 7, 0 ); |
329 | cmbCat = new CategorySelect( container ); | 329 | cmbCat = new CategorySelect( container ); |
330 | gl->addWidget( cmbCat, 7, 1 ); | 330 | gl->addWidget( cmbCat, 7, 1 ); |
331 | 331 | ||
332 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 332 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
333 | gl->addWidget( btnNote, 8, 1 ); | 333 | gl->addWidget( btnNote, 8, 1 ); |
334 | 334 | ||
335 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 335 | tabMain->insertTab( tabViewport, tr( "General" ) ); |
336 | 336 | ||
337 | tabViewport = new QWidget ( tabMain ); | 337 | tabViewport = new QWidget ( tabMain ); |
338 | 338 | ||
339 | vb = new QVBoxLayout( tabViewport ); | 339 | vb = new QVBoxLayout( tabViewport ); |
340 | 340 | ||
341 | svAddress = new QScrollView( tabViewport ); | 341 | svAddress = new QScrollView( tabViewport ); |
342 | vb->addWidget( svAddress, 0, 0 ); | 342 | vb->addWidget( svAddress, 0, 0 ); |
343 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 343 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
344 | svAddress->setFrameStyle( QFrame::NoFrame ); | 344 | svAddress->setFrameStyle( QFrame::NoFrame ); |
345 | 345 | ||
346 | container = new QWidget( svAddress->viewport() ); | 346 | container = new QWidget( svAddress->viewport() ); |
347 | svAddress->addChild( container ); | 347 | svAddress->addChild( container ); |
348 | 348 | ||
349 | gl = new QGridLayout( container, 6, 3, 2, 4 ); | 349 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
350 | 350 | ||
351 | cmbAddress = new QComboBox( FALSE, container ); | 351 | cmbAddress = new QComboBox( FALSE, container ); |
352 | cmbAddress->insertItem( tr( "Business" ) ); | 352 | cmbAddress->insertItem( tr( "Business" ) ); |
353 | cmbAddress->insertItem( tr( "Home" ) ); | 353 | cmbAddress->insertItem( tr( "Home" ) ); |
354 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 354 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
355 | 355 | ||
356 | l = new QLabel( tr( "Address" ), container ); | 356 | l = new QLabel( tr( "Address" ), container ); |
357 | gl->addWidget( l, 1, 0 ); | 357 | gl->addWidget( l, 1, 0 ); |
358 | txtAddress = new QLineEdit( container ); | 358 | txtAddress = new QLineEdit( container ); |
359 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); | 359 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); |
360 | /* | 360 | /* |
361 | l = new QLabel( tr( "Address 2" ), container ); | 361 | l = new QLabel( tr( "Address 2" ), container ); |
362 | gl->addWidget( l, 2, 0 ); | 362 | gl->addWidget( l, 2, 0 ); |
363 | txtAddress2 = new QLineEdit( container ); | 363 | txtAddress2 = new QLineEdit( container ); |
364 | gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 ); | 364 | gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 ); |
365 | 365 | ||
366 | l = new QLabel( tr( "P.O. Box" ), container ); | 366 | l = new QLabel( tr( "P.O. Box" ), container ); |
367 | gl->addWidget( l, 3, 0 ); | 367 | gl->addWidget( l, 3, 0 ); |
368 | txtPOBox = new QLineEdit( container ); | 368 | txtPOBox = new QLineEdit( container ); |
369 | gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 ); | 369 | gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 ); |
370 | */ | 370 | */ |
371 | l = new QLabel( tr( "City" ), container ); | 371 | l = new QLabel( tr( "City" ), container ); |
372 | gl->addWidget( l, 2, 0 ); | 372 | gl->addWidget( l, 2, 0 ); |
373 | txtCity = new QLineEdit( container ); | 373 | txtCity = new QLineEdit( container ); |
@@ -586,346 +586,374 @@ void ContactEditor::init() { | |||
586 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); | 586 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); |
587 | cmbCountry->insertItem( tr ( "Uganda" ) ); | 587 | cmbCountry->insertItem( tr ( "Uganda" ) ); |
588 | cmbCountry->insertItem( tr ( "Ukraine" ) ); | 588 | cmbCountry->insertItem( tr ( "Ukraine" ) ); |
589 | cmbCountry->insertItem( tr ( "Uruguay" ) ); | 589 | cmbCountry->insertItem( tr ( "Uruguay" ) ); |
590 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); | 590 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); |
591 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); | 591 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); |
592 | cmbCountry->insertItem( tr ( "Venezuela" ) ); | 592 | cmbCountry->insertItem( tr ( "Venezuela" ) ); |
593 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); | 593 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); |
594 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); | 594 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); |
595 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); | 595 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); |
596 | cmbCountry->insertItem( tr ( "Yemen" ) ); | 596 | cmbCountry->insertItem( tr ( "Yemen" ) ); |
597 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); | 597 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); |
598 | cmbCountry->insertItem( tr ( "Zambia" ) ); | 598 | cmbCountry->insertItem( tr ( "Zambia" ) ); |
599 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); | 599 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); |
600 | 600 | ||
601 | cmbCountry->setMaximumWidth( 135 ); | 601 | cmbCountry->setMaximumWidth( 135 ); |
602 | 602 | ||
603 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 603 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
604 | 604 | ||
605 | cmbChooserField4 = new QComboBox( FALSE, container ); | 605 | cmbChooserField4 = new QComboBox( FALSE, container ); |
606 | cmbChooserField4->setMaximumWidth( 90 ); | 606 | cmbChooserField4->setMaximumWidth( 90 ); |
607 | gl->addWidget( cmbChooserField4, 6, 0 ); | 607 | gl->addWidget( cmbChooserField4, 6, 0 ); |
608 | txtChooserField4 = new QLineEdit( container ); | 608 | txtChooserField4 = new QLineEdit( container ); |
609 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); | 609 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); |
610 | |||
611 | QSpacerItem *space = new QSpacerItem(1,1, | ||
612 | QSizePolicy::Maximum, | ||
613 | QSizePolicy::MinimumExpanding ); | ||
614 | gl->addItem( space, 7, 0 ); | ||
615 | |||
610 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 616 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
611 | 617 | ||
612 | tabViewport = new QWidget ( tabMain ); | 618 | tabViewport = new QWidget ( tabMain ); |
613 | 619 | ||
614 | vb = new QVBoxLayout( tabViewport ); | 620 | vb = new QVBoxLayout( tabViewport ); |
615 | 621 | ||
616 | svDetails = new QScrollView( tabViewport ); | 622 | svDetails = new QScrollView( tabViewport ); |
617 | vb->addWidget( svDetails, 0, 0 ); | 623 | vb->addWidget( svDetails, 0, 0 ); |
618 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 624 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
619 | svDetails->setFrameStyle( QFrame::NoFrame ); | 625 | svDetails->setFrameStyle( QFrame::NoFrame ); |
620 | 626 | ||
621 | container = new QWidget( svDetails->viewport() ); | 627 | container = new QWidget( svDetails->viewport() ); |
622 | svDetails->addChild( container ); | 628 | svDetails->addChild( container ); |
623 | 629 | ||
624 | gl = new QGridLayout( container, 1, 2, 2, 4 ); | 630 | gl = new QGridLayout( container, 1, 2, 2, 4 ); |
625 | 631 | ||
626 | QStringList::ConstIterator it = slDynamicEntries->begin(); | 632 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
627 | for (i = 0; it != slDynamicEntries->end(); i++, ++it) { | 633 | for (i = 0; it != slDynamicEntries.end(); i++, ++it) { |
628 | l = new QLabel( *it, container ); | 634 | l = new QLabel( *it, container ); |
629 | listName.append( l ); | 635 | listName.append( l ); |
630 | gl->addWidget( l, i, 0 ); | 636 | gl->addWidget( l, i, 0 ); |
631 | QLineEdit *e = new QLineEdit( container ); | 637 | QLineEdit *e = new QLineEdit( container ); |
632 | listValue.append( e ); | 638 | listValue.append( e ); |
633 | gl->addWidget( e, i, 1); | 639 | gl->addWidget( e, i, 1); |
634 | } | 640 | } |
635 | 641 | ||
636 | l = new QLabel( tr("Gender"), container ); | 642 | l = new QLabel( tr("Gender"), container ); |
637 | gl->addWidget( l, slDynamicEntries->count(), 0 ); | 643 | gl->addWidget( l, slDynamicEntries.count(), 0 ); |
638 | cmbGender = new QComboBox( container ); | 644 | cmbGender = new QComboBox( container ); |
639 | cmbGender->insertItem( "", 0 ); | 645 | cmbGender->insertItem( "", 0 ); |
640 | cmbGender->insertItem( tr("Male"), 1); | 646 | cmbGender->insertItem( tr("Male"), 1); |
641 | cmbGender->insertItem( tr("Female"), 2); | 647 | cmbGender->insertItem( tr("Female"), 2); |
642 | gl->addWidget( cmbGender, slDynamicEntries->count(), 1 ); | 648 | gl->addWidget( cmbGender, slDynamicEntries.count(), 1 ); |
643 | 649 | ||
644 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 650 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
645 | 651 | ||
646 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 652 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
647 | dlgNote->setCaption( tr("Enter Note") ); | 653 | dlgNote->setCaption( tr("Enter Note") ); |
648 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 654 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
649 | txtNote = new QMultiLineEdit( dlgNote ); | 655 | txtNote = new QMultiLineEdit( dlgNote ); |
650 | vbNote->addWidget( txtNote ); | 656 | vbNote->addWidget( txtNote ); |
651 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 657 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
652 | 658 | ||
653 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 659 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
654 | dlgName->setCaption( tr("Edit Name") ); | 660 | dlgName->setCaption( tr("Edit Name") ); |
655 | gl = new QGridLayout( dlgName, 4, 2, 2, 3 ); | 661 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
656 | 662 | ||
657 | l = new QLabel( tr("First Name"), dlgName ); | 663 | l = new QLabel( tr("First Name"), dlgName ); |
658 | gl->addWidget( l, 0, 0 ); | 664 | gl->addWidget( l, 0, 0 ); |
659 | txtFirstName = new QLineEdit( dlgName ); | 665 | txtFirstName = new QLineEdit( dlgName ); |
660 | gl->addWidget( txtFirstName, 0, 1 ); | 666 | gl->addWidget( txtFirstName, 0, 1 ); |
661 | 667 | ||
662 | l = new QLabel( tr("Middle Name"), dlgName ); | 668 | l = new QLabel( tr("Middle Name"), dlgName ); |
663 | gl->addWidget( l, 1, 0 ); | 669 | gl->addWidget( l, 1, 0 ); |
664 | txtMiddleName = new QLineEdit( dlgName ); | 670 | txtMiddleName = new QLineEdit( dlgName ); |
665 | gl->addWidget( txtMiddleName, 1, 1 ); | 671 | gl->addWidget( txtMiddleName, 1, 1 ); |
666 | 672 | ||
667 | l = new QLabel( tr("Last Name"), dlgName ); | 673 | l = new QLabel( tr("Last Name"), dlgName ); |
668 | gl->addWidget( l, 2, 0 ); | 674 | gl->addWidget( l, 2, 0 ); |
669 | txtLastName = new QLineEdit( dlgName ); | 675 | txtLastName = new QLineEdit( dlgName ); |
670 | gl->addWidget( txtLastName, 2, 1 ); | 676 | gl->addWidget( txtLastName, 2, 1 ); |
671 | 677 | ||
672 | l = new QLabel( tr("Suffix"), dlgName ); | 678 | l = new QLabel( tr("Suffix"), dlgName ); |
673 | gl->addWidget( l, 3, 0 ); | 679 | gl->addWidget( l, 3, 0 ); |
674 | txtSuffix = new QLineEdit( dlgName ); | 680 | txtSuffix = new QLineEdit( dlgName ); |
675 | gl->addWidget( txtSuffix, 3, 1 ); | 681 | gl->addWidget( txtSuffix, 3, 1 ); |
682 | space = new QSpacerItem(1,1, | ||
683 | QSizePolicy::Maximum, | ||
684 | QSizePolicy::MinimumExpanding ); | ||
685 | gl->addItem( space, 4, 0 ); | ||
676 | 686 | ||
677 | cmbChooserField1->insertStringList( *slChooserNames ); | 687 | cmbChooserField1->insertStringList( slChooserNames ); |
678 | cmbChooserField2->insertStringList( *slChooserNames ); | 688 | cmbChooserField2->insertStringList( slChooserNames ); |
679 | cmbChooserField3->insertStringList( *slChooserNames ); | 689 | cmbChooserField3->insertStringList( slChooserNames ); |
680 | cmbChooserField4->insertStringList( *slChooserNames ); | 690 | cmbChooserField4->insertStringList( slChooserNames ); |
681 | 691 | ||
682 | cmbChooserField1->setCurrentItem( 0 ); | 692 | cmbChooserField1->setCurrentItem( 0 ); |
683 | cmbChooserField2->setCurrentItem( 1 ); | 693 | cmbChooserField2->setCurrentItem( 1 ); |
684 | cmbChooserField3->setCurrentItem( 2 ); | 694 | cmbChooserField3->setCurrentItem( 2 ); |
685 | 695 | ||
686 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 696 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
687 | 697 | ||
688 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 698 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
689 | 699 | ||
690 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) ); | 700 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
691 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser2Change(const QString &)) ); | 701 | this, SLOT(slotChooser1Change(const QString &)) ); |
692 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser3Change(const QString &)) ); | 702 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
693 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser4Change(const QString &)) ); | 703 | this, SLOT(slotChooser2Change(const QString &)) ); |
694 | connect( txtAddress, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddressChange(const QString &)) ); | 704 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
705 | this, SLOT(slotChooser3Change(const QString &)) ); | ||
706 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | ||
707 | this, SLOT(slotChooser4Change(const QString &)) ); | ||
708 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | ||
709 | this, SLOT(slotAddressChange(const QString &)) ); | ||
695 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); | 710 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); |
696 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); | 711 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); |
697 | connect( txtCity, SIGNAL(textChanged(const QString &)), this, SLOT(slotCityChange(const QString &)) ); | 712 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
698 | connect( txtState, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChange(const QString &)) ); | 713 | this, SLOT(slotCityChange(const QString &)) ); |
699 | connect( txtZip, SIGNAL(textChanged(const QString &)), this, SLOT(slotZipChange(const QString &)) ); | 714 | connect( txtState, SIGNAL(textChanged(const QString &)), |
700 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); | 715 | this, SLOT(slotStateChange(const QString &)) ); |
701 | connect( cmbCountry, SIGNAL(activated(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); | 716 | connect( txtZip, SIGNAL(textChanged(const QString &)), |
702 | connect( cmbChooserField1, SIGNAL(activated(int)), this, SLOT(slotCmbChooser1Change(int)) ); | 717 | this, SLOT(slotZipChange(const QString &)) ); |
703 | connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) ); | 718 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), |
704 | connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) ); | 719 | this, SLOT(slotCountryChange(const QString &)) ); |
705 | connect( cmbChooserField4, SIGNAL(activated(int)), this, SLOT(slotCmbChooser4Change(int)) ); | 720 | connect( cmbCountry, SIGNAL(activated(const QString &)), |
706 | connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) ); | 721 | this, SLOT(slotCountryChange(const QString &)) ); |
722 | connect( cmbChooserField1, SIGNAL(activated(int)), | ||
723 | this, SLOT(slotCmbChooser1Change(int)) ); | ||
724 | connect( cmbChooserField2, SIGNAL(activated(int)), | ||
725 | this, SLOT(slotCmbChooser2Change(int)) ); | ||
726 | connect( cmbChooserField3, SIGNAL(activated(int)), | ||
727 | this, SLOT(slotCmbChooser3Change(int)) ); | ||
728 | connect( cmbChooserField4, SIGNAL(activated(int)), | ||
729 | this, SLOT(slotCmbChooser4Change(int)) ); | ||
730 | connect( cmbAddress, SIGNAL(activated(int)), | ||
731 | this, SLOT(slotAddressTypeChange(int)) ); | ||
732 | |||
707 | new QPEDialogListener(this); | 733 | new QPEDialogListener(this); |
708 | } | 734 | } |
709 | 735 | ||
710 | void ContactEditor::initMap() | 736 | void ContactEditor::initMap() |
711 | { | 737 | { |
712 | /* | 738 | /* |
713 | // since the fields and the XML fields exist, create a map | 739 | // since the fields and the XML fields exist, create a map |
714 | // between them... | 740 | // between them... |
715 | Config cfg1( "AddressBook" ); | 741 | Config cfg1( "AddressBook" ); |
716 | Config cfg2( "AddressBook" ); | 742 | Config cfg2( "AddressBook" ); |
717 | QString strCfg1, | 743 | QString strCfg1, |
718 | strCfg2; | 744 | strCfg2; |
719 | int i; | 745 | int i; |
720 | 746 | ||
721 | // This stuff better exist... | 747 | // This stuff better exist... |
722 | cfg1.setGroup( "AddressFields" ); | 748 | cfg1.setGroup( "AddressFields" ); |
723 | o cfg2.setGroup( "XMLFields" ); | 749 | o cfg2.setGroup( "XMLFields" ); |
724 | i = 0; | 750 | i = 0; |
725 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); | 751 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); |
726 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), | 752 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), |
727 | QString::null ); | 753 | QString::null ); |
728 | while ( !strCfg1.isNull() && !strCfg2.isNull() ) { | 754 | while ( !strCfg1.isNull() && !strCfg2.isNull() ) { |
729 | mapField.insert( strCfg1, strCfg2 ); | 755 | mapField.insert( strCfg1, strCfg2 ); |
730 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), | 756 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), |
731 | QString::null ); | 757 | QString::null ); |
732 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), | 758 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), |
733 | QString::null ); | 759 | QString::null ); |
734 | } | 760 | } |
735 | */ | 761 | */ |
736 | } | 762 | } |
737 | 763 | ||
738 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 764 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
739 | 765 | ||
740 | int index = cmbChooserField1->currentItem(); | 766 | int index = cmbChooserField1->currentItem(); |
741 | 767 | ||
742 | (*slChooserValues)[index] = textChanged; | 768 | slChooserValues[index] = textChanged; |
743 | 769 | ||
744 | } | 770 | } |
745 | 771 | ||
746 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 772 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
747 | 773 | ||
748 | int index = cmbChooserField2->currentItem(); | 774 | int index = cmbChooserField2->currentItem(); |
749 | 775 | ||
750 | (*slChooserValues)[index] = textChanged; | 776 | slChooserValues[index] = textChanged; |
751 | 777 | ||
752 | } | 778 | } |
753 | 779 | ||
754 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 780 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
755 | 781 | ||
756 | int index = cmbChooserField3->currentItem(); | 782 | int index = cmbChooserField3->currentItem(); |
757 | 783 | ||
758 | (*slChooserValues)[index] = textChanged; | 784 | slChooserValues[index] = textChanged; |
759 | 785 | ||
760 | } | 786 | } |
761 | 787 | ||
762 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 788 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
763 | 789 | ||
764 | int index = cmbChooserField4->currentItem(); | 790 | int index = cmbChooserField4->currentItem(); |
765 | 791 | ||
766 | (*slChooserValues)[index] = textChanged; | 792 | slChooserValues[index] = textChanged; |
767 | 793 | ||
768 | } | 794 | } |
769 | 795 | ||
770 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 796 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
771 | 797 | ||
772 | if ( cmbAddress->currentItem() == 0 ) { | 798 | if ( cmbAddress->currentItem() == 0 ) { |
773 | (*slBusinessAddress)[0] = textChanged; | 799 | slBusinessAddress[0] = textChanged; |
774 | } else { | 800 | } else { |
775 | (*slHomeAddress)[0] = textChanged; | 801 | slHomeAddress[0] = textChanged; |
776 | } | 802 | } |
777 | } | 803 | } |
778 | 804 | ||
779 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { | 805 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { |
780 | 806 | ||
781 | if ( cmbAddress->currentItem() == 0 ) { | 807 | if ( cmbAddress->currentItem() == 0 ) { |
782 | (*slBusinessAddress)[1] = textChanged; | 808 | slBusinessAddress[1] = textChanged; |
783 | } else { | 809 | } else { |
784 | (*slHomeAddress)[1] = textChanged; | 810 | slHomeAddress[1] = textChanged; |
785 | } | 811 | } |
786 | } | 812 | } |
787 | 813 | ||
788 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { | 814 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { |
789 | 815 | ||
790 | if ( cmbAddress->currentItem() == 0 ) { | 816 | if ( cmbAddress->currentItem() == 0 ) { |
791 | (*slBusinessAddress)[2] = textChanged; | 817 | slBusinessAddress[2] = textChanged; |
792 | } else { | 818 | } else { |
793 | (*slHomeAddress)[2] = textChanged; | 819 | slHomeAddress[2] = textChanged; |
794 | } | 820 | } |
795 | } | 821 | } |
796 | 822 | ||
797 | void ContactEditor::slotCityChange( const QString &textChanged ) { | 823 | void ContactEditor::slotCityChange( const QString &textChanged ) { |
798 | 824 | ||
799 | if ( cmbAddress->currentItem() == 0 ) { | 825 | if ( cmbAddress->currentItem() == 0 ) { |
800 | (*slBusinessAddress)[3] = textChanged; | 826 | slBusinessAddress[3] = textChanged; |
801 | } else { | 827 | } else { |
802 | (*slHomeAddress)[3] = textChanged; | 828 | slHomeAddress[3] = textChanged; |
803 | } | 829 | } |
804 | } | 830 | } |
805 | 831 | ||
806 | void ContactEditor::slotStateChange( const QString &textChanged ) { | 832 | void ContactEditor::slotStateChange( const QString &textChanged ) { |
807 | 833 | ||
808 | 834 | ||
809 | if ( cmbAddress->currentItem() == 0 ) { | 835 | if ( cmbAddress->currentItem() == 0 ) { |
810 | (*slBusinessAddress)[4] = textChanged; | 836 | slBusinessAddress[4] = textChanged; |
811 | } else { | 837 | } else { |
812 | (*slHomeAddress)[4] = textChanged; | 838 | slHomeAddress[4] = textChanged; |
813 | } | 839 | } |
814 | } | 840 | } |
815 | 841 | ||
816 | void ContactEditor::slotZipChange( const QString &textChanged ) { | 842 | void ContactEditor::slotZipChange( const QString &textChanged ) { |
817 | 843 | ||
818 | if ( cmbAddress->currentItem() == 0 ) { | 844 | if ( cmbAddress->currentItem() == 0 ) { |
819 | (*slBusinessAddress)[5] = textChanged; | 845 | slBusinessAddress[5] = textChanged; |
820 | } else { | 846 | } else { |
821 | (*slHomeAddress)[5] = textChanged; | 847 | slHomeAddress[5] = textChanged; |
822 | } | 848 | } |
823 | } | 849 | } |
824 | 850 | ||
825 | void ContactEditor::slotCountryChange( const QString &textChanged ) { | 851 | void ContactEditor::slotCountryChange( const QString &textChanged ) { |
826 | 852 | ||
827 | if ( cmbAddress->currentItem() == 0 ) { | 853 | if ( cmbAddress->currentItem() == 0 ) { |
828 | (*slBusinessAddress)[6] = textChanged; | 854 | slBusinessAddress[6] = textChanged; |
829 | } else { | 855 | } else { |
830 | (*slHomeAddress)[6] = textChanged; | 856 | slHomeAddress[6] = textChanged; |
831 | } | 857 | } |
832 | } | 858 | } |
833 | 859 | ||
834 | void ContactEditor::slotCmbChooser1Change( int index ) { | 860 | void ContactEditor::slotCmbChooser1Change( int index ) { |
835 | 861 | ||
836 | txtChooserField1->setText( (*slChooserValues)[index] ); | 862 | txtChooserField1->setText( slChooserValues[index] ); |
837 | 863 | txtChooserField1->setFocus(); | |
838 | } | 864 | } |
839 | 865 | ||
840 | void ContactEditor::slotCmbChooser2Change( int index ) { | 866 | void ContactEditor::slotCmbChooser2Change( int index ) { |
841 | 867 | ||
842 | txtChooserField2->setText( (*slChooserValues)[index] ); | 868 | txtChooserField2->setText( slChooserValues[index] ); |
843 | 869 | txtChooserField2->setFocus(); | |
844 | } | 870 | } |
845 | 871 | ||
846 | void ContactEditor::slotCmbChooser3Change( int index ) { | 872 | void ContactEditor::slotCmbChooser3Change( int index ) { |
847 | 873 | ||
848 | txtChooserField3->setText( (*slChooserValues)[index] ); | 874 | txtChooserField3->setText( slChooserValues[index] ); |
875 | txtChooserField3->setFocus(); | ||
849 | 876 | ||
850 | } | 877 | } |
851 | 878 | ||
852 | void ContactEditor::slotCmbChooser4Change( int index ) { | 879 | void ContactEditor::slotCmbChooser4Change( int index ) { |
853 | 880 | ||
854 | txtChooserField4->setText( (*slChooserValues)[index] ); | 881 | txtChooserField4->setText( slChooserValues[index] ); |
882 | txtChooserField4->setFocus(); | ||
855 | 883 | ||
856 | } | 884 | } |
857 | 885 | ||
858 | void ContactEditor::slotAddressTypeChange( int index ) { | 886 | void ContactEditor::slotAddressTypeChange( int index ) { |
859 | 887 | ||
860 | if ( index == 0 ) { | 888 | if ( index == 0 ) { |
861 | 889 | ||
862 | txtAddress->setText( (*slBusinessAddress)[0] ); | 890 | txtAddress->setText( slBusinessAddress[0] ); |
863 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 891 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
864 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 892 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
865 | txtCity->setText( (*slBusinessAddress)[3] ); | 893 | txtCity->setText( slBusinessAddress[3] ); |
866 | txtState->setText( (*slBusinessAddress)[4] ); | 894 | txtState->setText( slBusinessAddress[4] ); |
867 | txtZip->setText( (*slBusinessAddress)[5] ); | 895 | txtZip->setText( slBusinessAddress[5] ); |
868 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 896 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
869 | txtTmp->setText( (*slBusinessAddress)[6] ); | 897 | txtTmp->setText( slBusinessAddress[6] ); |
870 | 898 | ||
871 | } else { | 899 | } else { |
872 | 900 | ||
873 | txtAddress->setText( (*slHomeAddress)[0] ); | 901 | txtAddress->setText( slHomeAddress[0] ); |
874 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 902 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
875 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 903 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
876 | txtCity->setText( (*slHomeAddress)[3] ); | 904 | txtCity->setText( slHomeAddress[3] ); |
877 | txtState->setText( (*slHomeAddress)[4] ); | 905 | txtState->setText( slHomeAddress[4] ); |
878 | txtZip->setText( (*slHomeAddress)[5] ); | 906 | txtZip->setText( slHomeAddress[5] ); |
879 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 907 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
880 | txtTmp->setText( (*slHomeAddress)[6] ); | 908 | txtTmp->setText( slHomeAddress[6] ); |
881 | 909 | ||
882 | } | 910 | } |
883 | 911 | ||
884 | } | 912 | } |
885 | 913 | ||
886 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 914 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
887 | 915 | ||
888 | int index = cmbFileAs->currentItem(); | 916 | int index = cmbFileAs->currentItem(); |
889 | 917 | ||
890 | cmbFileAs->clear(); | 918 | cmbFileAs->clear(); |
891 | 919 | ||
892 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); | 920 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); |
893 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); | 921 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); |
894 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); | 922 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); |
895 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); | 923 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); |
896 | 924 | ||
897 | cmbFileAs->setCurrentItem( index ); | 925 | cmbFileAs->setCurrentItem( index ); |
898 | 926 | ||
899 | useFullName = TRUE; | 927 | useFullName = TRUE; |
900 | 928 | ||
901 | } | 929 | } |
902 | 930 | ||
903 | void ContactEditor::loadFields() { | 931 | void ContactEditor::loadFields() { |
904 | 932 | ||
905 | QStringList::ConstIterator it; | 933 | QStringList::ConstIterator it; |
906 | QListIterator<QLabel> lit( listName ); | 934 | QListIterator<QLabel> lit( listName ); |
907 | for ( it = slDynamicEntries->begin(); *lit; ++lit, ++it) { | 935 | for ( it = slDynamicEntries.begin(); *lit; ++lit, ++it) { |
908 | (*lit)->setText( *it ); | 936 | (*lit)->setText( *it ); |
909 | } | 937 | } |
910 | } | 938 | } |
911 | 939 | ||
912 | void ContactEditor::accept() { | 940 | void ContactEditor::accept() { |
913 | 941 | ||
914 | if ( isEmpty() ) { | 942 | if ( isEmpty() ) { |
915 | cleanupFields(); | 943 | cleanupFields(); |
916 | reject(); | 944 | reject(); |
917 | } else { | 945 | } else { |
918 | saveEntry(); | 946 | saveEntry(); |
919 | cleanupFields(); | 947 | cleanupFields(); |
920 | QDialog::accept(); | 948 | QDialog::accept(); |
921 | } | 949 | } |
922 | 950 | ||
923 | } | 951 | } |
924 | 952 | ||
925 | void ContactEditor::slotNote() { | 953 | void ContactEditor::slotNote() { |
926 | 954 | ||
927 | dlgNote->showMaximized(); | 955 | dlgNote->showMaximized(); |
928 | if ( !dlgNote->exec() ) { | 956 | if ( !dlgNote->exec() ) { |
929 | txtNote->setText( ent.notes() ); | 957 | txtNote->setText( ent.notes() ); |
930 | } | 958 | } |
931 | } | 959 | } |
@@ -1109,61 +1137,61 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1109 | case NAME_LFM: | 1137 | case NAME_LFM: |
1110 | return strLastName + ", " + strFirstName + " " + strMiddleName; | 1138 | return strLastName + ", " + strFirstName + " " + strMiddleName; |
1111 | 1139 | ||
1112 | case NAME_FMLS: | 1140 | case NAME_FMLS: |
1113 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; | 1141 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; |
1114 | 1142 | ||
1115 | case NAME_F: | 1143 | case NAME_F: |
1116 | return strFirstName; | 1144 | return strFirstName; |
1117 | 1145 | ||
1118 | case NAME_M: | 1146 | case NAME_M: |
1119 | return strMiddleName; | 1147 | return strMiddleName; |
1120 | 1148 | ||
1121 | case NAME_L: | 1149 | case NAME_L: |
1122 | return strLastName; | 1150 | return strLastName; |
1123 | 1151 | ||
1124 | case NAME_S: | 1152 | case NAME_S: |
1125 | return strSuffix; | 1153 | return strSuffix; |
1126 | 1154 | ||
1127 | } | 1155 | } |
1128 | return QString::null; | 1156 | return QString::null; |
1129 | } | 1157 | } |
1130 | 1158 | ||
1131 | void ContactEditor::cleanupFields() { | 1159 | void ContactEditor::cleanupFields() { |
1132 | 1160 | ||
1133 | QStringList::Iterator it = slChooserValues->begin(); | 1161 | QStringList::Iterator it = slChooserValues.begin(); |
1134 | for ( int i = 0; it != slChooserValues->end(); i++, ++it ) { | 1162 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { |
1135 | (*it) = ""; | 1163 | (*it) = ""; |
1136 | } | 1164 | } |
1137 | 1165 | ||
1138 | for ( int i = 0; i < 7; i++ ) { | 1166 | for ( int i = 0; i < 7; i++ ) { |
1139 | (*slHomeAddress)[i] = ""; | 1167 | slHomeAddress[i] = ""; |
1140 | (*slBusinessAddress)[i] = ""; | 1168 | slBusinessAddress[i] = ""; |
1141 | } | 1169 | } |
1142 | 1170 | ||
1143 | QStringList::ConstIterator cit; | 1171 | QStringList::ConstIterator cit; |
1144 | QListIterator<QLineEdit> itLE( listValue ); | 1172 | QListIterator<QLineEdit> itLE( listValue ); |
1145 | for ( cit = slDynamicEntries->begin(); cit != slDynamicEntries->end(); ++cit, ++itLE) { | 1173 | for ( cit = slDynamicEntries.begin(); cit != slDynamicEntries.end(); ++cit, ++itLE) { |
1146 | (*itLE)->setText( "" ); | 1174 | (*itLE)->setText( "" ); |
1147 | } | 1175 | } |
1148 | 1176 | ||
1149 | txtFirstName->setText(""); | 1177 | txtFirstName->setText(""); |
1150 | txtMiddleName->setText(""); | 1178 | txtMiddleName->setText(""); |
1151 | txtLastName->setText(""); | 1179 | txtLastName->setText(""); |
1152 | txtSuffix->setText(""); | 1180 | txtSuffix->setText(""); |
1153 | txtNote->setText(""); | 1181 | txtNote->setText(""); |
1154 | txtFullName->setText(""); | 1182 | txtFullName->setText(""); |
1155 | txtJobTitle->setText(""); | 1183 | txtJobTitle->setText(""); |
1156 | txtOrganization->setText(""); | 1184 | txtOrganization->setText(""); |
1157 | txtChooserField1->setText(""); | 1185 | txtChooserField1->setText(""); |
1158 | txtChooserField2->setText(""); | 1186 | txtChooserField2->setText(""); |
1159 | txtChooserField3->setText(""); | 1187 | txtChooserField3->setText(""); |
1160 | txtAddress->setText(""); | 1188 | txtAddress->setText(""); |
1161 | //txtAddress2->setText(""); | 1189 | //txtAddress2->setText(""); |
1162 | txtCity->setText(""); | 1190 | txtCity->setText(""); |
1163 | //txtPOBox->setText(""); | 1191 | //txtPOBox->setText(""); |
1164 | txtState->setText(""); | 1192 | txtState->setText(""); |
1165 | txtZip->setText(""); | 1193 | txtZip->setText(""); |
1166 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1194 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1167 | txtTmp->setText(""); | 1195 | txtTmp->setText(""); |
1168 | txtTmp = cmbFileAs->lineEdit(); | 1196 | txtTmp = cmbFileAs->lineEdit(); |
1169 | txtTmp->setText(""); | 1197 | txtTmp->setText(""); |
@@ -1180,122 +1208,122 @@ void ContactEditor::setEntry( const Contact &entry ) { | |||
1180 | useFullName = FALSE; | 1208 | useFullName = FALSE; |
1181 | txtFirstName->setText( ent.firstName() ); | 1209 | txtFirstName->setText( ent.firstName() ); |
1182 | txtMiddleName->setText( ent.middleName() ); | 1210 | txtMiddleName->setText( ent.middleName() ); |
1183 | txtLastName->setText( ent.lastName() ); | 1211 | txtLastName->setText( ent.lastName() ); |
1184 | txtSuffix->setText( ent.suffix() ); | 1212 | txtSuffix->setText( ent.suffix() ); |
1185 | 1213 | ||
1186 | QString *tmpString = new QString; | 1214 | QString *tmpString = new QString; |
1187 | *tmpString = ent.firstName() + " " + ent.middleName() + | 1215 | *tmpString = ent.firstName() + " " + ent.middleName() + |
1188 | + " " + ent.lastName() + " " + ent.suffix(); | 1216 | + " " + ent.lastName() + " " + ent.suffix(); |
1189 | 1217 | ||
1190 | txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1218 | txtFullName->setText( tmpString->simplifyWhiteSpace() ); |
1191 | 1219 | ||
1192 | cmbFileAs->setEditText( ent.fileAs() ); | 1220 | cmbFileAs->setEditText( ent.fileAs() ); |
1193 | 1221 | ||
1194 | if (hasTitle) | 1222 | if (hasTitle) |
1195 | txtJobTitle->setText( ent.jobTitle() ); | 1223 | txtJobTitle->setText( ent.jobTitle() ); |
1196 | 1224 | ||
1197 | if (hasCompany) | 1225 | if (hasCompany) |
1198 | txtOrganization->setText( ent.company() ); | 1226 | txtOrganization->setText( ent.company() ); |
1199 | 1227 | ||
1200 | if (hasNotes) | 1228 | if (hasNotes) |
1201 | txtNote->setText( ent.notes() ); | 1229 | txtNote->setText( ent.notes() ); |
1202 | 1230 | ||
1203 | if (hasStreet) { | 1231 | if (hasStreet) { |
1204 | (*slHomeAddress)[0] = ent.homeStreet(); | 1232 | slHomeAddress[0] = ent.homeStreet(); |
1205 | (*slBusinessAddress)[0] = ent.businessStreet(); | 1233 | slBusinessAddress[0] = ent.businessStreet(); |
1206 | } | 1234 | } |
1207 | /* | 1235 | /* |
1208 | if (hasStreet2) { | 1236 | if (hasStreet2) { |
1209 | (*slHomeAddress)[1] = ent.homeStreet2(); | 1237 | (*slHomeAddress)[1] = ent.homeStreet2(); |
1210 | (*slBusinessAddress)[1] = ent.businessStreet2(); | 1238 | (*slBusinessAddress)[1] = ent.businessStreet2(); |
1211 | } | 1239 | } |
1212 | 1240 | ||
1213 | if (hasPOBox) { | 1241 | if (hasPOBox) { |
1214 | (*slHomeAddress)[2] = ent.homePOBox(); | 1242 | (*slHomeAddress)[2] = ent.homePOBox(); |
1215 | (*slBusinessAddress)[2] = ent.businessPOBox(); | 1243 | (*slBusinessAddress)[2] = ent.businessPOBox(); |
1216 | } | 1244 | } |
1217 | */ | 1245 | */ |
1218 | if (hasCity) { | 1246 | if (hasCity) { |
1219 | (*slHomeAddress)[3] = ent.homeCity(); | 1247 | slHomeAddress[3] = ent.homeCity(); |
1220 | (*slBusinessAddress)[3] = ent.businessCity(); | 1248 | slBusinessAddress[3] = ent.businessCity(); |
1221 | } | 1249 | } |
1222 | 1250 | ||
1223 | if (hasState) { | 1251 | if (hasState) { |
1224 | (*slHomeAddress)[4] = ent.homeState(); | 1252 | slHomeAddress[4] = ent.homeState(); |
1225 | (*slBusinessAddress)[4] = ent.businessState(); | 1253 | slBusinessAddress[4] = ent.businessState(); |
1226 | } | 1254 | } |
1227 | 1255 | ||
1228 | if (hasZip) { | 1256 | if (hasZip) { |
1229 | (*slHomeAddress)[5] = ent.homeZip(); | 1257 | slHomeAddress[5] = ent.homeZip(); |
1230 | (*slBusinessAddress)[5] = ent.businessZip(); | 1258 | slBusinessAddress[5] = ent.businessZip(); |
1231 | } | 1259 | } |
1232 | 1260 | ||
1233 | if (hasCountry) { | 1261 | if (hasCountry) { |
1234 | (*slHomeAddress)[6] = ent.homeCountry(); | 1262 | slHomeAddress[6] = ent.homeCountry(); |
1235 | (*slBusinessAddress)[6] = ent.businessCountry(); | 1263 | slBusinessAddress[6] = ent.businessCountry(); |
1236 | } | 1264 | } |
1237 | 1265 | ||
1238 | QStringList::ConstIterator it; | 1266 | QStringList::ConstIterator it; |
1239 | QListIterator<QLineEdit> itLE( listValue ); | 1267 | QListIterator<QLineEdit> itLE( listValue ); |
1240 | for ( it = slDynamicEntries->begin(); it != slDynamicEntries->end(); ++it, ++itLE) { | 1268 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { |
1241 | if ( *it == "Department" ) | 1269 | if ( *it == "Department" ) |
1242 | (*itLE)->setText( ent.department() ); | 1270 | (*itLE)->setText( ent.department() ); |
1243 | 1271 | ||
1244 | if ( *it == "Company" ) | 1272 | if ( *it == "Company" ) |
1245 | (*itLE)->setText( ent.company() ); | 1273 | (*itLE)->setText( ent.company() ); |
1246 | 1274 | ||
1247 | if ( *it == "Office" ) | 1275 | if ( *it == "Office" ) |
1248 | (*itLE)->setText( ent.office() ); | 1276 | (*itLE)->setText( ent.office() ); |
1249 | 1277 | ||
1250 | if ( *it == "Profession" ) | 1278 | if ( *it == "Profession" ) |
1251 | (*itLE)->setText( ent.profession() ); | 1279 | (*itLE)->setText( ent.profession() ); |
1252 | 1280 | ||
1253 | if ( *it == "Assistant" ) | 1281 | if ( *it == "Assistant" ) |
1254 | (*itLE)->setText( ent.assistant() ); | 1282 | (*itLE)->setText( ent.assistant() ); |
1255 | 1283 | ||
1256 | if ( *it == "Manager" ) | 1284 | if ( *it == "Manager" ) |
1257 | (*itLE)->setText( ent.manager() ); | 1285 | (*itLE)->setText( ent.manager() ); |
1258 | 1286 | ||
1259 | if ( *it == "Spouse" ) | 1287 | if ( *it == "Spouse" ) |
1260 | (*itLE)->setText( ent.spouse() ); | 1288 | (*itLE)->setText( ent.spouse() ); |
1261 | 1289 | ||
1262 | if ( *it == "Birthday" ) | 1290 | if ( *it == "Birthday" ) |
1263 | (*itLE)->setText( ent.birthday() ); | 1291 | (*itLE)->setText( ent.birthday() ); |
1264 | 1292 | ||
1265 | if ( *it == "Anniversary" ) | 1293 | if ( *it == "Anniversary" ) |
1266 | (*itLE)->setText( ent.anniversary() ); | 1294 | (*itLE)->setText( ent.anniversary() ); |
1267 | 1295 | ||
1268 | if ( *it == "Nickname" ) | 1296 | if ( *it == "Nickname" ) |
1269 | (*itLE)->setText( ent.nickname() ); | 1297 | (*itLE)->setText( ent.nickname() ); |
1270 | 1298 | ||
1271 | if ( *it == "Children" ) | 1299 | if ( *it == "Children" ) |
1272 | (*itLE)->setText( ent.children() ); | 1300 | (*itLE)->setText( ent.children() ); |
1273 | 1301 | ||
1274 | } | 1302 | } |
1275 | 1303 | ||
1276 | QStringList::Iterator itV; | 1304 | QStringList::Iterator itV; |
1277 | for ( it = slChooserNames->begin(), itV = slChooserValues->begin(); it != slChooserNames->end(); ++it, ++itV ) { | 1305 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1278 | 1306 | ||
1279 | if ( *it == "Business Phone" || *it == "Work Phone" ) | 1307 | if ( *it == "Business Phone" || *it == "Work Phone" ) |
1280 | *itV = ent.businessPhone(); | 1308 | *itV = ent.businessPhone(); |
1281 | /* | 1309 | /* |
1282 | if ( *it == "Business 2 Phone" ) | 1310 | if ( *it == "Business 2 Phone" ) |
1283 | *itV = ent.business2Phone(); | 1311 | *itV = ent.business2Phone(); |
1284 | */ | 1312 | */ |
1285 | if ( *it == "Business Fax" || *it == "Work Fax" ) | 1313 | if ( *it == "Business Fax" || *it == "Work Fax" ) |
1286 | *itV = ent.businessFax(); | 1314 | *itV = ent.businessFax(); |
1287 | 1315 | ||
1288 | if ( *it == "Business Mobile" || *it == "work Mobile" ) | 1316 | if ( *it == "Business Mobile" || *it == "work Mobile" ) |
1289 | *itV = ent.businessMobile(); | 1317 | *itV = ent.businessMobile(); |
1290 | /* | 1318 | /* |
1291 | if ( *it == "Company Phone" ) | 1319 | if ( *it == "Company Phone" ) |
1292 | *itV = ent.companyPhone(); | 1320 | *itV = ent.companyPhone(); |
1293 | */ | 1321 | */ |
1294 | if ( *it == "Default Email" ) | 1322 | if ( *it == "Default Email" ) |
1295 | *itV = ent.defaultEmail(); | 1323 | *itV = ent.defaultEmail(); |
1296 | 1324 | ||
1297 | if ( *it == "Emails" ) | 1325 | if ( *it == "Emails" ) |
1298 | *itV = ent.emails(); | 1326 | *itV = ent.emails(); |
1299 | 1327 | ||
1300 | if ( *it == "Home Phone" ) | 1328 | if ( *it == "Home Phone" ) |
1301 | *itV = ent.homePhone(); | 1329 | *itV = ent.homePhone(); |
@@ -1377,122 +1405,122 @@ void ContactEditor::saveEntry() { | |||
1377 | ent.lastName != txtLastName->text() || | 1405 | ent.lastName != txtLastName->text() || |
1378 | ent.middleName != txtMiddleName->text() ) { | 1406 | ent.middleName != txtMiddleName->text() ) { |
1379 | */ | 1407 | */ |
1380 | ent.setFirstName( txtFirstName->text() ); | 1408 | ent.setFirstName( txtFirstName->text() ); |
1381 | ent.setLastName( txtLastName->text() ); | 1409 | ent.setLastName( txtLastName->text() ); |
1382 | ent.setMiddleName( txtMiddleName->text() ); | 1410 | ent.setMiddleName( txtMiddleName->text() ); |
1383 | ent.setSuffix( txtSuffix->text() ); | 1411 | ent.setSuffix( txtSuffix->text() ); |
1384 | 1412 | ||
1385 | //} | 1413 | //} |
1386 | 1414 | ||
1387 | ent.setFileAs( cmbFileAs->currentText() ); | 1415 | ent.setFileAs( cmbFileAs->currentText() ); |
1388 | 1416 | ||
1389 | ent.setCategories( cmbCat->currentCategories() ); | 1417 | ent.setCategories( cmbCat->currentCategories() ); |
1390 | 1418 | ||
1391 | if (hasTitle) | 1419 | if (hasTitle) |
1392 | ent.setJobTitle( txtJobTitle->text() ); | 1420 | ent.setJobTitle( txtJobTitle->text() ); |
1393 | 1421 | ||
1394 | if (hasCompany) | 1422 | if (hasCompany) |
1395 | ent.setCompany( txtOrganization->text() ); | 1423 | ent.setCompany( txtOrganization->text() ); |
1396 | 1424 | ||
1397 | if (hasNotes) | 1425 | if (hasNotes) |
1398 | ent.setNotes( txtNote->text() ); | 1426 | ent.setNotes( txtNote->text() ); |
1399 | 1427 | ||
1400 | if (hasStreet) { | 1428 | if (hasStreet) { |
1401 | ent.setHomeStreet( (*slHomeAddress)[0] ); | 1429 | ent.setHomeStreet( slHomeAddress[0] ); |
1402 | ent.setBusinessStreet( (*slBusinessAddress)[0] ); | 1430 | ent.setBusinessStreet( slBusinessAddress[0] ); |
1403 | } | 1431 | } |
1404 | /* | 1432 | /* |
1405 | if (hasStreet2) { | 1433 | if (hasStreet2) { |
1406 | ent.setHomeStreet2( (*slHomeAddress)[1] ); | 1434 | ent.setHomeStreet2( (*slHomeAddress)[1] ); |
1407 | ent.setBusinessStreet2( (*slBusinessAddress)[1] ); | 1435 | ent.setBusinessStreet2( (*slBusinessAddress)[1] ); |
1408 | } | 1436 | } |
1409 | 1437 | ||
1410 | if (hasPOBox) { | 1438 | if (hasPOBox) { |
1411 | ent.setHomePOBox( (*slHomeAddress)[2] ); | 1439 | ent.setHomePOBox( (*slHomeAddress)[2] ); |
1412 | ent.setBusinessPOBox( (*slBusinessAddress)[2] ); | 1440 | ent.setBusinessPOBox( (*slBusinessAddress)[2] ); |
1413 | } | 1441 | } |
1414 | */ | 1442 | */ |
1415 | if (hasCity) { | 1443 | if (hasCity) { |
1416 | ent.setHomeCity( (*slHomeAddress)[3] ); | 1444 | ent.setHomeCity( slHomeAddress[3] ); |
1417 | ent.setBusinessCity( (*slBusinessAddress)[3] ); | 1445 | ent.setBusinessCity( slBusinessAddress[3] ); |
1418 | } | 1446 | } |
1419 | 1447 | ||
1420 | if (hasState) { | 1448 | if (hasState) { |
1421 | ent.setHomeState( (*slHomeAddress)[4] ); | 1449 | ent.setHomeState( slHomeAddress[4] ); |
1422 | ent.setBusinessState( (*slBusinessAddress)[4] ); | 1450 | ent.setBusinessState( slBusinessAddress[4] ); |
1423 | } | 1451 | } |
1424 | 1452 | ||
1425 | if (hasZip) { | 1453 | if (hasZip) { |
1426 | ent.setHomeZip( (*slHomeAddress)[5] ); | 1454 | ent.setHomeZip( slHomeAddress[5] ); |
1427 | ent.setBusinessZip( (*slBusinessAddress)[5] ); | 1455 | ent.setBusinessZip( slBusinessAddress[5] ); |
1428 | } | 1456 | } |
1429 | 1457 | ||
1430 | if (hasCountry) { | 1458 | if (hasCountry) { |
1431 | ent.setHomeCountry( (*slHomeAddress)[6] ); | 1459 | ent.setHomeCountry( slHomeAddress[6] ); |
1432 | ent.setBusinessCountry( (*slBusinessAddress)[6] ); | 1460 | ent.setBusinessCountry( slBusinessAddress[6] ); |
1433 | } | 1461 | } |
1434 | 1462 | ||
1435 | QStringList::ConstIterator it; | 1463 | QStringList::ConstIterator it; |
1436 | QListIterator<QLineEdit> itLE( listValue ); | 1464 | QListIterator<QLineEdit> itLE( listValue ); |
1437 | for ( it = slDynamicEntries->begin(); it != slDynamicEntries->end(); ++it, ++itLE) { | 1465 | for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { |
1438 | if ( *it == "Department" ) | 1466 | if ( *it == "Department" ) |
1439 | ent.setDepartment( (*itLE)->text() ); | 1467 | ent.setDepartment( (*itLE)->text() ); |
1440 | 1468 | ||
1441 | if ( *it == "Company" ) | 1469 | if ( *it == "Company" ) |
1442 | ent.setCompany( (*itLE)->text() ); | 1470 | ent.setCompany( (*itLE)->text() ); |
1443 | 1471 | ||
1444 | if ( *it == "Office" ) | 1472 | if ( *it == "Office" ) |
1445 | ent.setOffice( (*itLE)->text() ); | 1473 | ent.setOffice( (*itLE)->text() ); |
1446 | 1474 | ||
1447 | if ( *it == "Profession" ) | 1475 | if ( *it == "Profession" ) |
1448 | ent.setProfession( (*itLE)->text() ); | 1476 | ent.setProfession( (*itLE)->text() ); |
1449 | 1477 | ||
1450 | if ( *it == "Assistant" ) | 1478 | if ( *it == "Assistant" ) |
1451 | ent.setAssistant( (*itLE)->text() ); | 1479 | ent.setAssistant( (*itLE)->text() ); |
1452 | 1480 | ||
1453 | if ( *it == "Manager" ) | 1481 | if ( *it == "Manager" ) |
1454 | ent.setManager( (*itLE)->text() ); | 1482 | ent.setManager( (*itLE)->text() ); |
1455 | 1483 | ||
1456 | if ( *it == "Spouse" ) | 1484 | if ( *it == "Spouse" ) |
1457 | ent.setSpouse( (*itLE)->text() ); | 1485 | ent.setSpouse( (*itLE)->text() ); |
1458 | 1486 | ||
1459 | if ( *it == "Birthday" ) | 1487 | if ( *it == "Birthday" ) |
1460 | ent.setBirthday( (*itLE)->text() ); | 1488 | ent.setBirthday( (*itLE)->text() ); |
1461 | 1489 | ||
1462 | if ( *it == "Anniversary" ) | 1490 | if ( *it == "Anniversary" ) |
1463 | ent.setAnniversary( (*itLE)->text() ); | 1491 | ent.setAnniversary( (*itLE)->text() ); |
1464 | 1492 | ||
1465 | if ( *it == "Nickname" ) | 1493 | if ( *it == "Nickname" ) |
1466 | ent.setNickname( (*itLE)->text() ); | 1494 | ent.setNickname( (*itLE)->text() ); |
1467 | 1495 | ||
1468 | if ( *it == "Children" ) | 1496 | if ( *it == "Children" ) |
1469 | ent.setChildren( (*itLE)->text() ); | 1497 | ent.setChildren( (*itLE)->text() ); |
1470 | 1498 | ||
1471 | } | 1499 | } |
1472 | 1500 | ||
1473 | QStringList::ConstIterator itV; | 1501 | QStringList::ConstIterator itV; |
1474 | for ( it = slChooserNames->begin(), itV = slChooserValues->begin(); it != slChooserNames->end(); ++it, ++itV ) { | 1502 | for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { |
1475 | 1503 | ||
1476 | if ( *it == "Business Phone" || *it == "Work Phone" ) | 1504 | if ( *it == "Business Phone" || *it == "Work Phone" ) |
1477 | ent.setBusinessPhone( *itV ); | 1505 | ent.setBusinessPhone( *itV ); |
1478 | /* | 1506 | /* |
1479 | if ( *it == "Business 2 Phone" ) | 1507 | if ( *it == "Business 2 Phone" ) |
1480 | ent.setBusiness2Phone( *itV ); | 1508 | ent.setBusiness2Phone( *itV ); |
1481 | */ | 1509 | */ |
1482 | if ( *it == "Business Fax" || *it == "Work Fax" ) | 1510 | if ( *it == "Business Fax" || *it == "Work Fax" ) |
1483 | ent.setBusinessFax( *itV ); | 1511 | ent.setBusinessFax( *itV ); |
1484 | 1512 | ||
1485 | if ( *it == "Business Mobile" || *it == "Work Mobile" ) | 1513 | if ( *it == "Business Mobile" || *it == "Work Mobile" ) |
1486 | ent.setBusinessMobile( *itV ); | 1514 | ent.setBusinessMobile( *itV ); |
1487 | /* | 1515 | /* |
1488 | if ( *it == "Company Phone" ) | 1516 | if ( *it == "Company Phone" ) |
1489 | ent.setCompanyPhone( *itV ); | 1517 | ent.setCompanyPhone( *itV ); |
1490 | */ | 1518 | */ |
1491 | //if ( *it == "Default Email" ) | 1519 | //if ( *it == "Default Email" ) |
1492 | //ent.setDefaultEmail( *itV ); | 1520 | //ent.setDefaultEmail( *itV ); |
1493 | 1521 | ||
1494 | if ( *it == "Emails" ) { | 1522 | if ( *it == "Emails" ) { |
1495 | QString allemail; | 1523 | QString allemail; |
1496 | QString defaultmail; | 1524 | QString defaultmail; |
1497 | parseEmailFrom( *itV, defaultmail, allemail ); | 1525 | parseEmailFrom( *itV, defaultmail, allemail ); |
1498 | ent.setDefaultEmail( defaultmail ); | 1526 | ent.setDefaultEmail( defaultmail ); |
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h index a58a860..4f3b56e 100644 --- a/core/pim/addressbook/contacteditor.h +++ b/core/pim/addressbook/contacteditor.h | |||
@@ -88,55 +88,55 @@ class ContactEditor : public QDialog { | |||
88 | void slotCmbChooser2Change( int index ); | 88 | void slotCmbChooser2Change( int index ); |
89 | void slotCmbChooser3Change( int index ); | 89 | void slotCmbChooser3Change( int index ); |
90 | void slotCmbChooser4Change( int index ); | 90 | void slotCmbChooser4Change( int index ); |
91 | void slotAddressTypeChange( int index ); | 91 | void slotAddressTypeChange( int index ); |
92 | void slotAddressChange( const QString &textChanged ); | 92 | void slotAddressChange( const QString &textChanged ); |
93 | void slotAddress2Change( const QString &textChanged ); | 93 | void slotAddress2Change( const QString &textChanged ); |
94 | void slotPOBoxChange( const QString &textChanged ); | 94 | void slotPOBoxChange( const QString &textChanged ); |
95 | void slotCityChange( const QString &textChanged ); | 95 | void slotCityChange( const QString &textChanged ); |
96 | void slotStateChange( const QString &textChanged ); | 96 | void slotStateChange( const QString &textChanged ); |
97 | void slotZipChange( const QString &textChanged ); | 97 | void slotZipChange( const QString &textChanged ); |
98 | void slotCountryChange( const QString &textChanged ); | 98 | void slotCountryChange( const QString &textChanged ); |
99 | void slotFullNameChange( const QString &textChanged ); | 99 | void slotFullNameChange( const QString &textChanged ); |
100 | 100 | ||
101 | private: | 101 | private: |
102 | bool useFullName, hasGender, hasTitle, hasCompany, hasNotes, hasStreet, hasStreet2, hasPOBox, hasCity, hasState, hasZip, hasCountry; | 102 | bool useFullName, hasGender, hasTitle, hasCompany, hasNotes, hasStreet, hasStreet2, hasPOBox, hasCity, hasState, hasZip, hasCountry; |
103 | 103 | ||
104 | Contact ent; | 104 | Contact ent; |
105 | 105 | ||
106 | QDialog *dlgNote; | 106 | QDialog *dlgNote; |
107 | QDialog *dlgName; | 107 | QDialog *dlgName; |
108 | 108 | ||
109 | QList<QLineEdit> listValue; | 109 | QList<QLineEdit> listValue; |
110 | QList<QLabel> listName; | 110 | QList<QLabel> listName; |
111 | const QValueList<int> *orderedValues; | 111 | const QValueList<int> *orderedValues; |
112 | QStringList *slOrdered; | 112 | QStringList slOrdered; |
113 | QStringList *slDynamicEntries; | 113 | QStringList slDynamicEntries; |
114 | 114 | ||
115 | QStringList *slHomeAddress; | 115 | QStringList slHomeAddress; |
116 | QStringList *slBusinessAddress; | 116 | QStringList slBusinessAddress; |
117 | QStringList *slChooserNames; | 117 | QStringList slChooserNames; |
118 | QStringList *slChooserValues; | 118 | QStringList slChooserValues; |
119 | 119 | ||
120 | QMultiLineEdit *txtNote; | 120 | QMultiLineEdit *txtNote; |
121 | QLabel *lblNote; | 121 | QLabel *lblNote; |
122 | 122 | ||
123 | //QLineEdit *txtTitle; | 123 | //QLineEdit *txtTitle; |
124 | QLineEdit *txtFirstName; | 124 | QLineEdit *txtFirstName; |
125 | QLineEdit *txtMiddleName; | 125 | QLineEdit *txtMiddleName; |
126 | QLineEdit *txtLastName; | 126 | QLineEdit *txtLastName; |
127 | QLineEdit *txtSuffix; | 127 | QLineEdit *txtSuffix; |
128 | 128 | ||
129 | QTabWidget *tabMain; | 129 | QTabWidget *tabMain; |
130 | QScrollView *svGeneral; | 130 | QScrollView *svGeneral; |
131 | QPushButton *btnFullName; | 131 | QPushButton *btnFullName; |
132 | QPushButton *btnNote; | 132 | QPushButton *btnNote; |
133 | QLineEdit *txtFullName; | 133 | QLineEdit *txtFullName; |
134 | QLineEdit *txtJobTitle; | 134 | QLineEdit *txtJobTitle; |
135 | QLineEdit *txtOrganization; | 135 | QLineEdit *txtOrganization; |
136 | QLineEdit *txtChooserField1; | 136 | QLineEdit *txtChooserField1; |
137 | QLineEdit *txtChooserField2; | 137 | QLineEdit *txtChooserField2; |
138 | QLineEdit *txtChooserField3; | 138 | QLineEdit *txtChooserField3; |
139 | QLineEdit *txtChooserField4; | 139 | QLineEdit *txtChooserField4; |
140 | QComboBox *cmbChooserField1; | 140 | QComboBox *cmbChooserField1; |
141 | QComboBox *cmbChooserField2; | 141 | QComboBox *cmbChooserField2; |
142 | QComboBox *cmbChooserField3; | 142 | QComboBox *cmbChooserField3; |