summaryrefslogtreecommitdiff
authoreilers <eilers>2003-03-01 18:06:49 (UTC)
committer eilers <eilers>2003-03-01 18:06:49 (UTC)
commita0ae7d2b8cfef3f643c4aa536bdf25d7da510142 (patch) (unidiff)
tree7658121cba0f106d019ecf34682fe9cc079cbf73
parent7dd36872a3eb63eb1c3c7a17549f3eeba92f1b32 (diff)
downloadopie-a0ae7d2b8cfef3f643c4aa536bdf25d7da510142.zip
opie-a0ae7d2b8cfef3f643c4aa536bdf25d7da510142.tar.gz
opie-a0ae7d2b8cfef3f643c4aa536bdf25d7da510142.tar.bz2
Fixing following bugs:
default email chooser jumped sometimes through the widget default email chooser not completely hiding the textfield storing the position of the chooser for the home webpage failed
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO21
-rw-r--r--core/pim/addressbook/contacteditor.cpp107
-rw-r--r--core/pim/addressbook/contacteditor.h8
-rw-r--r--core/pim/addressbook/ocontactfields.cpp4
-rw-r--r--core/pim/addressbook/version.h2
5 files changed, 82 insertions, 60 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO
index 719b720..a0d50a3 100644
--- a/core/pim/addressbook/TODO
+++ b/core/pim/addressbook/TODO
@@ -1,119 +1,116 @@
1Stuff todo until OPIE 1.0 : 1Stuff todo until OPIE 1.0 :
2=========================== 2===========================
3 3
4Feature requests: 4Feature requests:
5----------------- 5-----------------
6- Dial by mobile phone by tapping the number.. 6- Dial by mobile phone by tapping the number..
7 (Maybe using gsmtool. And we may 7 (Maybe using gsmtool. And we may
8 add a library class for this) 8 add a library class for this)
9- dial with dtmfdial in case it's installed and there's no mobile 9- dial with dtmfdial in case it's installed and there's no mobile
10- 3rd column for 2. Contact 10- 3rd column for 2. Contact
11- Implementing additional Views (Phonebook, ...) 11- Implementing additional Views (Phonebook, ...)
12- Birthday & Anniversary Reminder 12- Birthday & Anniversary Reminder
13- Beaming of multiple contacts (current list/ by search or by category) 13- Beaming of multiple contacts (current list/ by search or by category)
14- Configure the letter-picker: lastname/fullname search 14- Configure the letter-picker: lastname/fullname search
15- User center of the joypad to switch back from card to listview ! 15- User center of the joypad to switch back from card to listview !
16- Cursor-UP/Down: Should additionally scroll cardview if it is too large 16- Cursor-UP/Down: Should additionally scroll cardview if it is too large
17 (behaviour should be selectable by configuration) 17 (behaviour should be selectable by configuration)
18 18
19Known Bugs: 19Known Bugs:
20----------- 20-----------
21- Default Email-button: A lot of problems:
22 If on second tab: The combo chooser is on the top left of the screen ! :(
23- Default Email-Button: Sometimes not hiding the textfields completely
24 21
25Bugs but not in addressbook: 22Bugs but not in addressbook:
26----------------------------- 23-----------------------------
27- VCARD: If umlaut (äöüß) in address, the parser gets confused.. 24- VCARD: If umlaut (äöüß) in address, the parser gets confused..
28 25
29- Exporting and reimporting of Jobtitle was reported to fail (Could not reproduce this ! (se))
30
31 26
32Urgent: 27Urgent:
33-------- 28--------
34ContactEditor:
35- Contact-Editor is temporarely reenabled. Wait for replacement.
36- Redesign of Contacteditor
37- Category is on the wrong position after changing to personal and back to normal 29- Category is on the wrong position after changing to personal and back to normal
38 ( Temporarily workaround: Category is never deactivated.. :S ) 30 ( Temporarily workaround: Category is never deactivated.. :S )
39 31
40- Fix handling of 3 Firstnames 32- Fix handling of 3 Firstnames
41 33
42Important: 34Important:
43---------- 35----------
44 36
45- If new contact is added (contacteditor closed): focus (table, card) to
46 this entry !
47- After search (Started with Return): KeyFocus should be on Tabelle
48
49- "What's this" should be added (Deleyed after Feature Freeze) 37- "What's this" should be added (Deleyed after Feature Freeze)
50 38
51Less important: 39Less important:
52--------------- 40---------------
53- Reload if contacts were changed externally 41- Reload if contacts were changed externally
54- The picker (alphabetical sort widget) should be 42- The picker (alphabetical sort widget) should be
55 placed verticaly or horizontally (configurable) 43 placed verticaly or horizontally (configurable)
56- Find a smart solution for activating/deactivating the "send email" event 44- Find a smart solution for activating/deactivating the "send email" event
45- If new contact is added (contacteditor closed): focus (table, card) to
46 this entry !
47- After search (Started with Return): KeyFocus should be on Tabelle
48
49ContactEditor:
50- Redesign of Contacteditor
57 51
58Should be Fixed (not absolute sure, need further validation): 52Should be Fixed (not absolute sure, need further validation):
59------------------------------------------------------------- 53-------------------------------------------------------------
60 54
61 55
62Fixed/Ready: 56Fixed/Ready:
63------- 57-------
64- Syncing: abtable not reloaded after sync. 58- Syncing: abtable not reloaded after sync.
65- Find widget should be replaced by something like 59- Find widget should be replaced by something like
66 qpdf has. 60 qpdf has.
67- Adding a configuration dialog 61- Adding a configuration dialog
68- Picker: Activated letter schould be more visible 62- Picker: Activated letter schould be more visible
69- Advanced handling of cursor keys (search..) 63- Advanced handling of cursor keys (search..)
70- Mail-Icon is missing 64- Mail-Icon is missing
71- Use opie-mail insted of qt-mail if possible. 65- Use opie-mail insted of qt-mail if possible.
72- Font menu is invisible using german translation 66- Font menu is invisible using german translation
73- Personal contact editor: Disable categories 67- Personal contact editor: Disable categories
74- "Nonenglish" translation bug has to be fixed. 68- "Nonenglish" translation bug has to be fixed.
75- contacteditor: Birthday, annyversary, ... : Use Dateselector 69- contacteditor: Birthday, annyversary, ... : Use Dateselector
76- The names of the countries are sorted by there english names, only.. 70- The names of the countries are sorted by there english names, only..
77 Even if they are translated.. :S 71 Even if they are translated.. :S
78- Cursor keys should work in detail-view (ablabel) 72- Cursor keys should work in detail-view (ablabel)
79 -> Ablabel should be removed and Abtable should be increased with 73 -> Ablabel should be removed and Abtable should be increased with
80 different views (as started by darwin zins).. 74 different views (as started by darwin zins)..
81- Use advanced database functions in abtable to decrease 75- Use advanced database functions in abtable to decrease
82 memory footprint and to make everything more easy ! 76 memory footprint and to make everything more easy !
83 (abtable should store Iterator for selected Category) 77 (abtable should store Iterator for selected Category)
84- Abtable: Configure Contact column (internally already available, 78- Abtable: Configure Contact column (internally already available,
85 need configuration) 79 need configuration)
86- Select of primary contact (see #274 on mantis) 80- Select of primary contact (see #274 on mantis)
87- Category-select does not work completely: "Unfiled" is always in listview .. 81- Category-select does not work completely: "Unfiled" is always in listview ..
88- Return from Contacteditor: Category resettet to all 82- Return from Contacteditor: Category resettet to all
89- Personal Details not working 83- Personal Details not working
90- If category changed, the letterpicker should be resetted 84- If category changed, the letterpicker should be resetted
91- There should be some icons for List and Cardview 85- There should be some icons for List and Cardview
92- If in Cardview and a category change removes all entries: 86- If in Cardview and a category change removes all entries:
93 There are already entries in Cardview after up/down 87 There are already entries in Cardview after up/down
94- Personal Details: Anniversary zeigt Fantasie-Werte 88- Personal Details: Anniversary zeigt Fantasie-Werte
95- Unfiled shown just in Category "All" and "Unfiled". 89- Unfiled shown just in Category "All" and "Unfiled".
96- After finising search and after Edit: Clear Picker 90- After finising search and after Edit: Clear Picker
97- After Edit: Table position back to edited entry. 91- After Edit: Table position back to edited entry.
98- Optimize Table Update... 92- Optimize Table Update...
99- Change MyDialog to Config 93- Change MyDialog to Config
100- Store position and state of toolbar 94- Store position and state of toolbar
101- Searchwidget closed: Selected user is jumping 95- Searchwidget closed: Selected user is jumping
102- Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) 96- Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist)
103 zu lange.. 97 zu lange..
104- VCARD: Import of Anniversary does not work correctly (currently disabled) 98- VCARD: Import of Anniversary does not work correctly (currently disabled)
105- Name order selected in "contacteditor" not used in list view. 99- Name order selected in "contacteditor" not used in list view.
106- OK-Key does not switch from Detailview (ablable) to Listview 100- OK-Key does not switch from Detailview (ablable) to Listview
107- Receiving of beams should open a dialog 101- Receiving of beams should open a dialog
108- Fix start of opie-mail 102- Fix start of opie-mail
109- Implement Button Pics 103- Implement Button Pics
110- Add a dialog to accept and optionally edit received contacts by IRDA. 104- Add a dialog to accept and optionally edit received contacts by IRDA.
111- Language not English (tested with german opie-translation): 105- Language not English (tested with german opie-translation):
112 1. Configure nicht übersetzt (alles leer). 106 1. Configure nicht übersetzt (alles leer).
113 2. Contacteditor nur teilweise übersetzt. 107 2. Contacteditor nur teilweise übersetzt.
114 3. Kategorie-Picker geht nicht. 108 3. Kategorie-Picker geht nicht.
115- Plugin for Today for Birthdays and Anniversaries 109- Plugin for Today for Birthdays and Anniversaries
116- Implement a picker/combo for the default email. 110- Implement a picker/combo for the default email.
117- Overview window cleanup needed.. 111- Overview window cleanup needed..
118- Store last settings of combo-boxes 112- Store last settings of combo-boxes
119- Personal and Business Web-page is not editable 113- Personal and Business Web-page is not editable
114- Default Email-button: A lot of problems:
115 If on second tab: The combo chooser is on the top left of the screen ! :(
116- Default Email-Button: Sometimes not hiding the textfields completely
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index b60f2dd..d1338f6 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -117,113 +117,131 @@ void ContactEditor::init() {
117 QMap<int, QString> translMap = OContactFields::idToTrFields(); 117 QMap<int, QString> translMap = OContactFields::idToTrFields();
118 trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); 118 trlDynamicEntries.remove( translMap[Qtopia::Anniversary] );
119 trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); 119 trlDynamicEntries.remove( translMap[Qtopia::Birthday] );
120 trlDynamicEntries.remove( translMap[Qtopia::Gender] ); 120 trlDynamicEntries.remove( translMap[Qtopia::Gender] );
121 121
122 // Last Check to be sure.. 122 // Last Check to be sure..
123 assert( slDynamicEntries.count() == trlDynamicEntries.count() ); 123 assert( slDynamicEntries.count() == trlDynamicEntries.count() );
124 assert( slChooserNames.count() == trlChooserNames.count() ); 124 assert( slChooserNames.count() == trlChooserNames.count() );
125 125
126 for (i = 0; i < slChooserNames.count(); i++) 126 for (i = 0; i < slChooserNames.count(); i++)
127 slChooserValues.append(""); 127 slChooserValues.append("");
128 128
129 129
130 QVBoxLayout *vb = new QVBoxLayout( this ); 130 QVBoxLayout *vb = new QVBoxLayout( this );
131 131
132 tabMain = new QTabWidget( this ); 132 tabMain = new QTabWidget( this );
133 vb->addWidget( tabMain ); 133 vb->addWidget( tabMain );
134 134
135 QWidget *tabViewport = new QWidget ( tabMain ); 135 QWidget *tabViewport = new QWidget ( tabMain );
136 136
137 vb = new QVBoxLayout( tabViewport ); 137 vb = new QVBoxLayout( tabViewport );
138 138
139 svGeneral = new QScrollView( tabViewport ); 139 svGeneral = new QScrollView( tabViewport );
140 vb->addWidget( svGeneral, 0, 0 ); 140 vb->addWidget( svGeneral, 0, 0 );
141 svGeneral->setResizePolicy( QScrollView::AutoOneFit ); 141 svGeneral->setResizePolicy( QScrollView::AutoOneFit );
142 svGeneral->setFrameStyle( QFrame::NoFrame ); 142 svGeneral->setFrameStyle( QFrame::NoFrame );
143 143
144 QWidget *container = new QWidget( svGeneral->viewport() ); 144 QWidget *container = new QWidget( svGeneral->viewport() );
145 svGeneral->addChild( container ); 145 svGeneral->addChild( container );
146 146
147 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); 147 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 );
148 gl->setResizeMode( QLayout::FreeResize ); 148 gl->setResizeMode( QLayout::FreeResize );
149 149
150 btnFullName = new QPushButton( tr( "Full Name..." ), container ); 150 btnFullName = new QPushButton( tr( "Full Name..." ), container );
151 gl->addWidget( btnFullName, 0, 0 ); 151 gl->addWidget( btnFullName, 0, 0 );
152 txtFullName = new QLineEdit( container ); 152 txtFullName = new QLineEdit( container );
153 gl->addWidget( txtFullName, 0, 1 ); 153 gl->addWidget( txtFullName, 0, 1 );
154 154
155 QLabel *l = new QLabel( tr( "Job Title" ), container ); 155 QLabel *l = new QLabel( tr( "Job Title" ), container );
156 gl->addWidget( l, 1, 0 ); 156 gl->addWidget( l, 1, 0 );
157 txtJobTitle = new QLineEdit( container ); 157 txtJobTitle = new QLineEdit( container );
158 gl->addWidget( txtJobTitle, 1, 1 ); 158 gl->addWidget( txtJobTitle, 1, 1 );
159 159
160 l = new QLabel( tr( "Organization" ), container ); 160 l = new QLabel( tr( "Organization" ), container );
161 gl->addWidget( l, 2, 0 ); 161 gl->addWidget( l, 2, 0 );
162 txtOrganization = new QLineEdit( container ); 162 txtOrganization = new QLineEdit( container );
163 gl->addWidget( txtOrganization, 2, 1 ); 163 gl->addWidget( txtOrganization, 2, 1 );
164 164
165 // Chooser 1
165 cmbChooserField1 = new QComboBox( FALSE, container ); 166 cmbChooserField1 = new QComboBox( FALSE, container );
166 cmbChooserField1->setMaximumWidth( 90 ); 167 cmbChooserField1->setMaximumWidth( 90 );
167 gl->addWidget( cmbChooserField1, 3, 0 ); 168 gl->addWidget( cmbChooserField1, 3, 0 );
168 txtChooserField1 = new QLineEdit( container ); 169 // Textfield for chooser 1.
169 gl->addWidget( txtChooserField1, 3, 1 ); 170 // Now use Widgetstack to contain the textfield and the default-email combo !
170 171 m_widgetStack1 = new QWidgetStack( container );
172 txtChooserField1 = new QLineEdit( m_widgetStack1 );
173 m_widgetStack1 -> addWidget( txtChooserField1, TextField );
174 gl->addWidget( m_widgetStack1, 3, 1 );
175 m_widgetStack1 -> raiseWidget( TextField );
176
177 // Chooser 2
171 cmbChooserField2 = new QComboBox( FALSE, container ); 178 cmbChooserField2 = new QComboBox( FALSE, container );
172 cmbChooserField2->setMaximumWidth( 90 ); 179 cmbChooserField2->setMaximumWidth( 90 );
173 gl->addWidget( cmbChooserField2, 4, 0 ); 180 gl->addWidget( cmbChooserField2, 4, 0 );
174 txtChooserField2 = new QLineEdit( container ); 181 // Textfield for chooser 2
175 gl->addWidget( txtChooserField2, 4, 1 ); 182 // Now use WidgetStack to contain the textfield and the default-email combo!
176 183 m_widgetStack2 = new QWidgetStack( container );
184 txtChooserField2 = new QLineEdit( m_widgetStack2 );
185 m_widgetStack2 -> addWidget( txtChooserField2, TextField );
186 gl->addWidget( m_widgetStack2, 4, 1 );
187 m_widgetStack2 -> raiseWidget( TextField );
188
189 // Chooser 3
177 cmbChooserField3 = new QComboBox( FALSE, container ); 190 cmbChooserField3 = new QComboBox( FALSE, container );
178 cmbChooserField3->setMaximumWidth( 90 ); 191 cmbChooserField3->setMaximumWidth( 90 );
179 gl->addWidget( cmbChooserField3, 5, 0 ); 192 gl->addWidget( cmbChooserField3, 5, 0 );
180 txtChooserField3 = new QLineEdit( container ); 193 // Textfield for chooser 2
181 gl->addWidget( txtChooserField3, 5, 1 ); 194 // Now use WidgetStack to contain the textfield and the default-email combo!
195 m_widgetStack3 = new QWidgetStack( container );
196 txtChooserField3 = new QLineEdit( m_widgetStack3 );
197 m_widgetStack3 -> addWidget( txtChooserField3, TextField );
198 gl->addWidget( m_widgetStack3, 5, 1 );
199 m_widgetStack3 -> raiseWidget( TextField );
182 200
183 l = new QLabel( tr( "File As" ), container ); 201 l = new QLabel( tr( "File As" ), container );
184 gl->addWidget( l, 6, 0 ); 202 gl->addWidget( l, 6, 0 );
185 cmbFileAs = new QComboBox( TRUE, container ); 203 cmbFileAs = new QComboBox( TRUE, container );
186 gl->addWidget( cmbFileAs, 6, 1 ); 204 gl->addWidget( cmbFileAs, 6, 1 );
187 205
188 labCat = new QLabel( tr( "Category" ), container ); 206 labCat = new QLabel( tr( "Category" ), container );
189 gl->addWidget( labCat, 7, 0 ); 207 gl->addWidget( labCat, 7, 0 );
190 cmbCat = new CategorySelect( container ); 208 cmbCat = new CategorySelect( container );
191 gl->addWidget( cmbCat, 7, 1 ); 209 gl->addWidget( cmbCat, 7, 1 );
192 labCat->show(); 210 labCat->show();
193 cmbCat->show(); 211 cmbCat->show();
194 212
195 btnNote = new QPushButton( tr( "Notes..." ), container ); 213 btnNote = new QPushButton( tr( "Notes..." ), container );
196 gl->addWidget( btnNote, 8, 1 ); 214 gl->addWidget( btnNote, 8, 1 );
197 215
198 tabMain->insertTab( tabViewport, tr( "General" ) ); 216 tabMain->insertTab( tabViewport, tr( "General" ) );
199 217
200 tabViewport = new QWidget ( tabMain ); 218 tabViewport = new QWidget ( tabMain );
201 219
202 vb = new QVBoxLayout( tabViewport ); 220 vb = new QVBoxLayout( tabViewport );
203 221
204 svAddress = new QScrollView( tabViewport ); 222 svAddress = new QScrollView( tabViewport );
205 vb->addWidget( svAddress, 0, 0 ); 223 vb->addWidget( svAddress, 0, 0 );
206 svAddress->setResizePolicy( QScrollView::AutoOneFit ); 224 svAddress->setResizePolicy( QScrollView::AutoOneFit );
207 svAddress->setFrameStyle( QFrame::NoFrame ); 225 svAddress->setFrameStyle( QFrame::NoFrame );
208 226
209 container = new QWidget( svAddress->viewport() ); 227 container = new QWidget( svAddress->viewport() );
210 svAddress->addChild( container ); 228 svAddress->addChild( container );
211 229
212 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem 230 gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem
213 231
214 cmbAddress = new QComboBox( FALSE, container ); 232 cmbAddress = new QComboBox( FALSE, container );
215 cmbAddress->insertItem( tr( "Business" ) ); 233 cmbAddress->insertItem( tr( "Business" ) );
216 cmbAddress->insertItem( tr( "Home" ) ); 234 cmbAddress->insertItem( tr( "Home" ) );
217 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); 235 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 );
218 236
219 l = new QLabel( tr( "Address" ), container ); 237 l = new QLabel( tr( "Address" ), container );
220 gl->addWidget( l, 1, 0 ); 238 gl->addWidget( l, 1, 0 );
221 txtAddress = new QLineEdit( container ); 239 txtAddress = new QLineEdit( container );
222 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); 240 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 );
223 241
224 l = new QLabel( tr( "City" ), container ); 242 l = new QLabel( tr( "City" ), container );
225 gl->addWidget( l, 2, 0 ); 243 gl->addWidget( l, 2, 0 );
226 txtCity = new QLineEdit( container ); 244 txtCity = new QLineEdit( container );
227 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); 245 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 );
228 246
229 l = new QLabel( tr( "State" ), container ); 247 l = new QLabel( tr( "State" ), container );
@@ -412,101 +430,107 @@ void ContactEditor::init() {
412 cmbCountry->insertItem( tr ( "Senegal" ) ); 430 cmbCountry->insertItem( tr ( "Senegal" ) );
413 cmbCountry->insertItem( tr ( "Seychelles" ) ); 431 cmbCountry->insertItem( tr ( "Seychelles" ) );
414 cmbCountry->insertItem( tr ( "Sierra Leone" ) ); 432 cmbCountry->insertItem( tr ( "Sierra Leone" ) );
415 cmbCountry->insertItem( tr ( "Singapore" ) ); 433 cmbCountry->insertItem( tr ( "Singapore" ) );
416 cmbCountry->insertItem( tr ( "Slovakia" ) ); 434 cmbCountry->insertItem( tr ( "Slovakia" ) );
417 cmbCountry->insertItem( tr ( "Slovenia" ) ); 435 cmbCountry->insertItem( tr ( "Slovenia" ) );
418 cmbCountry->insertItem( tr ( "Solomon Islands" ) ); 436 cmbCountry->insertItem( tr ( "Solomon Islands" ) );
419 cmbCountry->insertItem( tr ( "Somalia" ) ); 437 cmbCountry->insertItem( tr ( "Somalia" ) );
420 cmbCountry->insertItem( tr ( "South Africa" ) ); 438 cmbCountry->insertItem( tr ( "South Africa" ) );
421 cmbCountry->insertItem( tr ( "Spain" ) ); 439 cmbCountry->insertItem( tr ( "Spain" ) );
422 cmbCountry->insertItem( tr ( "Sri Lanka" ) ); 440 cmbCountry->insertItem( tr ( "Sri Lanka" ) );
423 cmbCountry->insertItem( tr ( "St. Helena" ) ); 441 cmbCountry->insertItem( tr ( "St. Helena" ) );
424 cmbCountry->insertItem( tr ( "Sudan" ) ); 442 cmbCountry->insertItem( tr ( "Sudan" ) );
425 cmbCountry->insertItem( tr ( "Suriname" ) ); 443 cmbCountry->insertItem( tr ( "Suriname" ) );
426 cmbCountry->insertItem( tr ( "Swaziland" ) ); 444 cmbCountry->insertItem( tr ( "Swaziland" ) );
427 cmbCountry->insertItem( tr ( "Sweden" ) ); 445 cmbCountry->insertItem( tr ( "Sweden" ) );
428 cmbCountry->insertItem( tr ( "Switzerland" ) ); 446 cmbCountry->insertItem( tr ( "Switzerland" ) );
429 cmbCountry->insertItem( tr ( "Taiwan" ) ); 447 cmbCountry->insertItem( tr ( "Taiwan" ) );
430 cmbCountry->insertItem( tr ( "Tajikistan" ) ); 448 cmbCountry->insertItem( tr ( "Tajikistan" ) );
431 cmbCountry->insertItem( tr ( "Tanzania" ) ); 449 cmbCountry->insertItem( tr ( "Tanzania" ) );
432 cmbCountry->insertItem( tr ( "Thailand" ) ); 450 cmbCountry->insertItem( tr ( "Thailand" ) );
433 cmbCountry->insertItem( tr ( "Togo" ) ); 451 cmbCountry->insertItem( tr ( "Togo" ) );
434 cmbCountry->insertItem( tr ( "Tokelau" ) ); 452 cmbCountry->insertItem( tr ( "Tokelau" ) );
435 cmbCountry->insertItem( tr ( "Tonga" ) ); 453 cmbCountry->insertItem( tr ( "Tonga" ) );
436 cmbCountry->insertItem( tr ( "Tunisia" ) ); 454 cmbCountry->insertItem( tr ( "Tunisia" ) );
437 cmbCountry->insertItem( tr ( "Turkey" ) ); 455 cmbCountry->insertItem( tr ( "Turkey" ) );
438 cmbCountry->insertItem( tr ( "Turkmenistan" ) ); 456 cmbCountry->insertItem( tr ( "Turkmenistan" ) );
439 cmbCountry->insertItem( tr ( "Tuvalu" ) ); 457 cmbCountry->insertItem( tr ( "Tuvalu" ) );
440 cmbCountry->insertItem( tr ( "Uganda" ) ); 458 cmbCountry->insertItem( tr ( "Uganda" ) );
441 cmbCountry->insertItem( tr ( "Ukraine" ) ); 459 cmbCountry->insertItem( tr ( "Ukraine" ) );
442 cmbCountry->insertItem( tr ( "Uruguay" ) ); 460 cmbCountry->insertItem( tr ( "Uruguay" ) );
443 cmbCountry->insertItem( tr ( "Uzbekistan" ) ); 461 cmbCountry->insertItem( tr ( "Uzbekistan" ) );
444 cmbCountry->insertItem( tr ( "Vanuatu" ) ); 462 cmbCountry->insertItem( tr ( "Vanuatu" ) );
445 cmbCountry->insertItem( tr ( "Venezuela" ) ); 463 cmbCountry->insertItem( tr ( "Venezuela" ) );
446 cmbCountry->insertItem( tr ( "Vietnam" ) ); 464 cmbCountry->insertItem( tr ( "Vietnam" ) );
447 cmbCountry->insertItem( tr ( "Virgin Islands" ) ); 465 cmbCountry->insertItem( tr ( "Virgin Islands" ) );
448 cmbCountry->insertItem( tr ( "Western Sahara" ) ); 466 cmbCountry->insertItem( tr ( "Western Sahara" ) );
449 cmbCountry->insertItem( tr ( "Yemen" ) ); 467 cmbCountry->insertItem( tr ( "Yemen" ) );
450 cmbCountry->insertItem( tr ( "Yugoslavia" ) ); 468 cmbCountry->insertItem( tr ( "Yugoslavia" ) );
451 cmbCountry->insertItem( tr ( "Zambia" ) ); 469 cmbCountry->insertItem( tr ( "Zambia" ) );
452 cmbCountry->insertItem( tr ( "Zimbabwe" ) ); 470 cmbCountry->insertItem( tr ( "Zimbabwe" ) );
453 if (cmbCountry->listBox()!=0) 471 if (cmbCountry->listBox()!=0)
454 cmbCountry->listBox()->sort(); 472 cmbCountry->listBox()->sort();
455 473
456 cmbCountry->setMaximumWidth( 135 ); 474 cmbCountry->setMaximumWidth( 135 );
457 475
458 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); 476 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 );
459 477
478 // Chooser 4
460 cmbChooserField4 = new QComboBox( FALSE, container ); 479 cmbChooserField4 = new QComboBox( FALSE, container );
461 cmbChooserField4->setMaximumWidth( 90 ); 480 cmbChooserField4->setMaximumWidth( 90 );
462 gl->addWidget( cmbChooserField4, 6, 0 ); 481 gl->addWidget( cmbChooserField4, 6, 0 );
463 txtChooserField4 = new QLineEdit( container ); 482 // Textfield for chooser 2
464 gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); 483 // Now use WidgetStack to contain the textfield and the default-email combo!
484 m_widgetStack4 = new QWidgetStack( container );
485 txtChooserField4 = new QLineEdit( m_widgetStack4 );
486 m_widgetStack4 -> addWidget( txtChooserField4, TextField );
487 gl->addMultiCellWidget( m_widgetStack4, 6, 6, 1, 2 );
488 m_widgetStack4 -> raiseWidget( TextField );
465 489
466 QSpacerItem *space = new QSpacerItem(1,1, 490 QSpacerItem *space = new QSpacerItem(1,1,
467 QSizePolicy::Maximum, 491 QSizePolicy::Maximum,
468 QSizePolicy::MinimumExpanding ); 492 QSizePolicy::MinimumExpanding );
469 gl->addItem( space, 7, 0 ); 493 gl->addItem( space, 7, 0 );
470 494
471 tabMain->insertTab( tabViewport, tr( "Address" ) ); 495 tabMain->insertTab( tabViewport, tr( "Address" ) );
472 496
473 tabViewport = new QWidget ( tabMain ); 497 tabViewport = new QWidget ( tabMain );
474 498
475 vb = new QVBoxLayout( tabViewport ); 499 vb = new QVBoxLayout( tabViewport );
476 500
477 svDetails = new QScrollView( tabViewport ); 501 svDetails = new QScrollView( tabViewport );
478 vb->addWidget( svDetails, 0, 0 ); 502 vb->addWidget( svDetails, 0, 0 );
479 svDetails->setResizePolicy( QScrollView::AutoOneFit ); 503 svDetails->setResizePolicy( QScrollView::AutoOneFit );
480 svDetails->setFrameStyle( QFrame::NoFrame ); 504 svDetails->setFrameStyle( QFrame::NoFrame );
481 505
482 container = new QWidget( svDetails->viewport() ); 506 container = new QWidget( svDetails->viewport() );
483 svDetails->addChild( container ); 507 svDetails->addChild( container );
484 508
485 gl = new QGridLayout( container, 1, 2, 2, 4 ); 509 gl = new QGridLayout( container, 1, 2, 2, 4 );
486 510
487 int counter = 0; 511 int counter = 0;
488 512
489 // Birthday 513 // Birthday
490 QHBox* hBox = new QHBox( container ); 514 QHBox* hBox = new QHBox( container );
491 l = new QLabel( tr("Birthday"), container ); 515 l = new QLabel( tr("Birthday"), container );
492 gl->addWidget( l, counter, 0 ); 516 gl->addWidget( l, counter, 0 );
493 517
494 QPopupMenu* m1 = new QPopupMenu( container ); 518 QPopupMenu* m1 = new QPopupMenu( container );
495 birthdayPicker = new DateBookMonth( m1, 0, TRUE ); 519 birthdayPicker = new DateBookMonth( m1, 0, TRUE );
496 m1->insertItem( birthdayPicker ); 520 m1->insertItem( birthdayPicker );
497 521
498 birthdayButton= new QToolButton( hBox, "buttonStart" ); 522 birthdayButton= new QToolButton( hBox, "buttonStart" );
499 birthdayButton->setPopup( m1 ); 523 birthdayButton->setPopup( m1 );
500 birthdayButton->setPopupDelay(0); 524 birthdayButton->setPopupDelay(0);
501 525
502 QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), 526 QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ),
503 tr( "Delete" ), 527 tr( "Delete" ),
504 hBox, 0 ); 528 hBox, 0 );
505 529
506 gl->addWidget( hBox, counter , 1 ); 530 gl->addWidget( hBox, counter , 1 );
507 531
508 connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), 532 connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ),
509 this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); 533 this, SLOT( slotBirthdayDateChanged( int, int, int ) ) );
510 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); 534 connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) );
511 535
512 ++counter; 536 ++counter;
@@ -655,215 +679,210 @@ void ContactEditor::init() {
655} 679}
656 680
657void ContactEditor::defaultEmailChanged(int i){ 681void ContactEditor::defaultEmailChanged(int i){
658 qDebug("defaultEmailChanged"); 682 qDebug("defaultEmailChanged");
659 683
660 // was sollte das ? (se) 684 // was sollte das ? (se)
661 // int index = cmbChooserField1->currentItem(); 685 // int index = cmbChooserField1->currentItem();
662 // slChooserValues[index] = cmbDefaultEmail->text(i); 686 // slChooserValues[index] = cmbDefaultEmail->text(i);
663 687
664 defaultEmail = cmbDefaultEmail->text(i); 688 defaultEmail = cmbDefaultEmail->text(i);
665 qDebug ("Changed to: %s", defaultEmail.latin1()); 689 qDebug ("Changed to: %s", defaultEmail.latin1());
666 690
667} 691}
668 692
669void ContactEditor::populateDefaultEmailCmb(){ 693void ContactEditor::populateDefaultEmailCmb(){
670 694
671 // if the default-email combo was not selected and therfore not created 695 // if the default-email combo was not selected and therfore not created
672 // we get a lot of trouble.. Therfore create an invisible one.. 696 // we get a lot of trouble.. Therfore create an invisible one..
673 if ( !cmbDefaultEmail ){ 697 if ( !cmbDefaultEmail ){
674 cmbDefaultEmail = new QComboBox(this); 698 cmbDefaultEmail = new QComboBox(this);
675 cmbDefaultEmail -> hide(); 699 cmbDefaultEmail -> hide();
676 } 700 }
677 cmbDefaultEmail->clear(); 701 cmbDefaultEmail->clear();
678 cmbDefaultEmail->insertStringList( emails ); 702 cmbDefaultEmail->insertStringList( emails );
679 // cmbDefaultEmail->show(); 703 // cmbDefaultEmail->show();
680 704
681 // Select default email in combo.. 705 // Select default email in combo..
682 bool found = false; 706 bool found = false;
683 for ( int i = 0; i < cmbDefaultEmail->count(); i++){ 707 for ( int i = 0; i < cmbDefaultEmail->count(); i++){
684 qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", 708 qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<",
685 cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); 709 cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1());
686 710
687 if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ 711 if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){
688 cmbDefaultEmail->setCurrentItem( i ); 712 cmbDefaultEmail->setCurrentItem( i );
689 qDebug("set"); 713 qDebug("set");
690 found = true; 714 found = true;
691 } 715 }
692 } 716 }
693 717
694 // If the current default email is not found in the list, we choose the 718 // If the current default email is not found in the list, we choose the
695 // first one.. 719 // first one..
696 if ( !found ) 720 if ( !found )
697 defaultEmail = cmbDefaultEmail->text(0); 721 defaultEmail = cmbDefaultEmail->text(0);
698} 722}
699 723
700// Called when any combobox was changed. 724// Called when any combobox was changed.
701// "true" returned if the change was chandled by this function, else it should 725// "true" returned if the change was chandled by this function, else it should
702// be handled by something else.. 726// be handled by something else..
703bool ContactEditor::cmbChooserChange( int index, QLineEdit *inputWid, int widgetPos ) { 727bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) {
704 QString type = slChooserNames[index]; 728 QString type = slChooserNames[index];
705 qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos ); 729 qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos );
706 730
707 if ( !initializing ) 731 if ( !initializing )
708 contactfields.setFieldOrder( widgetPos-1, index ); 732 contactfields.setFieldOrder( widgetPos-1, index );
709 733
710 // Create and connect combobox for selecting the default email 734 // Create and connect combobox for selecting the default email
711 if ( type == "Default Email"){ 735 if ( type == "Default Email"){
712 qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition); 736 qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition);
713 737
714 // More than one defaul-email chooser is not allowed ! 738 // More than one default-email chooser is not allowed !
715 if ( ( defaultEmailChooserPosition != -1 ) && 739 if ( ( defaultEmailChooserPosition != -1 ) &&
716 defaultEmailChooserPosition != widgetPos && !initializing){ 740 defaultEmailChooserPosition != widgetPos && !initializing){
717 chooserError( widgetPos ); 741 chooserError( widgetPos );
718 return true; 742 return true;
719 } 743 }
720 744
721 if ( cmbDefaultEmail ){ 745 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
722 delete cmbDefaultEmail; 746 if ( cmbo ){
723 cmbDefaultEmail = 0l; 747 inputStack->raiseWidget( TextField );
748 inputStack -> removeWidget( cmbo );
749 delete cmbo;
724 } 750 }
725 cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); 751 cmbo = new QComboBox( inputStack );
726 cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); /* :SX */ 752 cmbo -> insertStringList( emails );
727
728 QRect rect = inputWid->frameGeometry();
729 qWarning("Geometrie: X=%d, Y=%d, Left=%d, Top=%d, Right=%d, Bottom=%d",
730 rect.x(), rect.y(), rect.left(), rect.top(), rect.right(), rect.bottom());
731 QPoint pnt = inputWid->pos();
732 qWarning("Position : X=%d, Y=%d", pnt.x(), pnt.y() );
733
734 connect( cmbDefaultEmail,SIGNAL( activated(int) ),
735 SLOT( defaultEmailChanged(int) ) );
736 753
737 cmbDefaultEmail->clear(); 754 inputStack -> addWidget( cmbo, Combo );
738 cmbDefaultEmail->insertStringList( emails ); 755 inputStack -> raiseWidget( Combo );
739 cmbDefaultEmail->show();
740 756
741 defaultEmailChooserPosition = widgetPos; 757 defaultEmailChooserPosition = widgetPos;
758 cmbDefaultEmail = cmbo;
759
760 connect( cmbo,SIGNAL( activated(int) ),
761 SLOT( defaultEmailChanged(int) ) );
742 762
743 // Set current default email 763 // Set current default email
744 populateDefaultEmailCmb(); 764 populateDefaultEmailCmb();
745 765
746 766
747 } else { 767 } else {
748 // Something else was selected: Hide combo.. 768 // Something else was selected: Hide combo..
749 qWarning(" Hiding default-email combo" ); 769 qWarning(" Hiding default-email combo" );
750 if ( defaultEmailChooserPosition == widgetPos ){ 770 if ( defaultEmailChooserPosition == widgetPos ){
751 defaultEmailChooserPosition = -1; 771 defaultEmailChooserPosition = -1;
752 if ( cmbDefaultEmail ) 772 QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo );
753 cmbDefaultEmail->hide(); 773 if ( cmbo ){
774 inputStack->raiseWidget( TextField );
775 inputStack -> removeWidget( cmbo );
776 cmbDefaultEmail = 0l;
777 delete cmbo;
778 }
754 779
755 } 780 }
756 781
757 // Caller should initialize the responsible textfield, therefore 782 // Caller should initialize the responsible textfield, therefore
758 // "false" is returned 783 // "false" is returned
759 return false; 784 return false;
760 } 785 }
761 786
762 // Everything is worked off .. 787 // Everything is worked off ..
763 return true; 788 return true;
764 789
765} 790}
766 791
767// Currently accessed when we select default-email more than once ! 792// Currently accessed when we select default-email more than once !
768void ContactEditor::chooserError( int index ) 793void ContactEditor::chooserError( int index )
769{ 794{
770 qWarning("ContactEditor::chooserError( %d )", index); 795 qWarning("ContactEditor::chooserError( %d )", index);
771 QMessageBox::warning( this, "Chooser Error", 796 QMessageBox::warning( this, "Chooser Error",
772 "Multiple selection of this\n" 797 "Multiple selection of this\n"
773 "Item is not allowed !\n\n" 798 "Item is not allowed !\n\n"
774 "First deselect the previous one !", 799 "First deselect the previous one !",
775 "&OK", 0, 0, 800 "&OK", 0, 0,
776 0, 0 ); 801 0, 0 );
777 802
778 // Reset the selected Chooser. Unfortunately the chooser 803 // Reset the selected Chooser. Unfortunately the chooser
779 // generates no signal, therfore we have to 804 // generates no signal, therfore we have to
780 // call the cmbChooserChange function manually.. 805 // call the cmbChooserChange function manually..
781 switch( index ){ 806 switch( index ){
782 case 1: 807 case 1:
783 cmbChooserField1 -> setCurrentItem( 0 ); 808 cmbChooserField1 -> setCurrentItem( 0 );
784 slotCmbChooser1Change( 0 ); 809 slotCmbChooser1Change( 0 );
785 break; 810 break;
786 case 2: 811 case 2:
787 cmbChooserField2 -> setCurrentItem( 0 ); 812 cmbChooserField2 -> setCurrentItem( 0 );
788 slotCmbChooser2Change( 0 ); 813 slotCmbChooser2Change( 0 );
789 break; 814 break;
790 case 3: 815 case 3:
791 cmbChooserField3 -> setCurrentItem( 0 ); 816 cmbChooserField3 -> setCurrentItem( 0 );
792 slotCmbChooser3Change( 0 ); 817 slotCmbChooser3Change( 0 );
793 break; 818 break;
794 case 4: 819 case 4:
795 cmbChooserField4 -> setCurrentItem( 0 ); 820 cmbChooserField4 -> setCurrentItem( 0 );
796 slotCmbChooser4Change( 0 ); 821 slotCmbChooser4Change( 0 );
797 break; 822 break;
798 } 823 }
799} 824}
800 825
801// Called when something was changed in a textfield (shouldn't it called textchanged? (se)) 826// Called when something was changed in a textfield (shouldn't it called textchanged? (se))
802void ContactEditor::chooserChange( const QString &textChanged, int index, 827void ContactEditor::chooserChange( const QString &textChanged, int index,
803 QLineEdit* , int widgetPos ) { 828 QLineEdit* , int widgetPos ) {
804 829
805 QString type = slChooserNames[index]; 830 QString type = slChooserNames[index]; // :SX
806 qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i", 831 qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",
807 type.latin1(),textChanged.latin1(), index, widgetPos ); 832 type.latin1(),textChanged.latin1(), index, widgetPos );
808 833
809 if ( type == "Default Email"){ 834 if ( type == "Default Email"){
810 qWarning ("??? Wozu??: %s", textChanged.latin1()); 835 qWarning ("??? Wozu??: %s", textChanged.latin1());
811 defaultEmail = textChanged; 836 defaultEmail = textChanged;
812 837
813 populateDefaultEmailCmb(); 838 populateDefaultEmailCmb();
814 839
815 }else if (defaultEmailChooserPosition == widgetPos){ 840 }else if (type == "Emails"){
816 qDebug("cmbDefaultEmail->hide()");
817
818 if (cmbDefaultEmail) cmbDefaultEmail->hide();
819 widgetPos=-1;
820
821 }else if (type == "Emails"){
822 qDebug("emails"); 841 qDebug("emails");
823 842
824 QString de; 843 QString de;
825 emails = QStringList::split (",", textChanged ); 844 emails = QStringList::split (",", textChanged );
826 845
827 populateDefaultEmailCmb(); 846 populateDefaultEmailCmb();
828 } 847 }
829 848
830 slChooserValues[index] = textChanged; 849 slChooserValues[index] = textChanged;
831 850
832} 851}
833 852
834void ContactEditor::slotChooser1Change( const QString &textChanged ) { 853void ContactEditor::slotChooser1Change( const QString &textChanged ) {
835 qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1()); 854 qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1());
836 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); 855 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1);
837} 856}
838 857
839void ContactEditor::slotChooser2Change( const QString &textChanged ) { 858void ContactEditor::slotChooser2Change( const QString &textChanged ) {
840 qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1()); 859 qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1());
841 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); 860 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2);
842 861
843} 862}
844 863
845void ContactEditor::slotChooser3Change( const QString &textChanged ) { 864void ContactEditor::slotChooser3Change( const QString &textChanged ) {
846 qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1()); 865 qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1());
847 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); 866 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3);
848} 867}
849 868
850void ContactEditor::slotChooser4Change( const QString &textChanged ) { 869void ContactEditor::slotChooser4Change( const QString &textChanged ) {
851 qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1()); 870 qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1());
852 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); 871 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4);
853} 872}
854 873
855void ContactEditor::slotAddressChange( const QString &textChanged ) { 874void ContactEditor::slotAddressChange( const QString &textChanged ) {
856 875
857 if ( cmbAddress->currentItem() == 0 ) { 876 if ( cmbAddress->currentItem() == 0 ) {
858 slBusinessAddress[0] = textChanged; 877 slBusinessAddress[0] = textChanged;
859 } else { 878 } else {
860 slHomeAddress[0] = textChanged; 879 slHomeAddress[0] = textChanged;
861 } 880 }
862} 881}
863 882
864void ContactEditor::slotAddress2Change( const QString &textChanged ) { 883void ContactEditor::slotAddress2Change( const QString &textChanged ) {
865 884
866 if ( cmbAddress->currentItem() == 0 ) { 885 if ( cmbAddress->currentItem() == 0 ) {
867 slBusinessAddress[1] = textChanged; 886 slBusinessAddress[1] = textChanged;
868 } else { 887 } else {
869 slHomeAddress[1] = textChanged; 888 slHomeAddress[1] = textChanged;
@@ -874,131 +893,131 @@ void ContactEditor::slotPOBoxChange( const QString &textChanged ) {
874 893
875 if ( cmbAddress->currentItem() == 0 ) { 894 if ( cmbAddress->currentItem() == 0 ) {
876 slBusinessAddress[2] = textChanged; 895 slBusinessAddress[2] = textChanged;
877 } else { 896 } else {
878 slHomeAddress[2] = textChanged; 897 slHomeAddress[2] = textChanged;
879 } 898 }
880} 899}
881 900
882void ContactEditor::slotCityChange( const QString &textChanged ) { 901void ContactEditor::slotCityChange( const QString &textChanged ) {
883 902
884 if ( cmbAddress->currentItem() == 0 ) { 903 if ( cmbAddress->currentItem() == 0 ) {
885 slBusinessAddress[3] = textChanged; 904 slBusinessAddress[3] = textChanged;
886 } else { 905 } else {
887 slHomeAddress[3] = textChanged; 906 slHomeAddress[3] = textChanged;
888 } 907 }
889} 908}
890 909
891void ContactEditor::slotStateChange( const QString &textChanged ) { 910void ContactEditor::slotStateChange( const QString &textChanged ) {
892 911
893 912
894 if ( cmbAddress->currentItem() == 0 ) { 913 if ( cmbAddress->currentItem() == 0 ) {
895 slBusinessAddress[4] = textChanged; 914 slBusinessAddress[4] = textChanged;
896 } else { 915 } else {
897 slHomeAddress[4] = textChanged; 916 slHomeAddress[4] = textChanged;
898 } 917 }
899} 918}
900 919
901void ContactEditor::slotZipChange( const QString &textChanged ) { 920void ContactEditor::slotZipChange( const QString &textChanged ) {
902 921
903 if ( cmbAddress->currentItem() == 0 ) { 922 if ( cmbAddress->currentItem() == 0 ) {
904 slBusinessAddress[5] = textChanged; 923 slBusinessAddress[5] = textChanged;
905 } else { 924 } else {
906 slHomeAddress[5] = textChanged; 925 slHomeAddress[5] = textChanged;
907 } 926 }
908} 927}
909 928
910void ContactEditor::slotCountryChange( const QString &textChanged ) { 929void ContactEditor::slotCountryChange( const QString &textChanged ) {
911 930
912 if ( cmbAddress->currentItem() == 0 ) { 931 if ( cmbAddress->currentItem() == 0 ) {
913 slBusinessAddress[6] = textChanged; 932 slBusinessAddress[6] = textChanged;
914 } else { 933 } else {
915 slHomeAddress[6] = textChanged; 934 slHomeAddress[6] = textChanged;
916 } 935 }
917} 936}
918 937
919 938
920void ContactEditor::slotCmbChooser1Change( int index ) { 939void ContactEditor::slotCmbChooser1Change( int index ) {
921 qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); 940 qWarning("ContactEditor::slotCmbChooser1Change( %d )", index);
922 if ( !cmbChooserChange( cmbChooserField1->currentItem(), txtChooserField1, 1) ){ 941 if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){
923 942
924 txtChooserField1->setText( slChooserValues[index] ); 943 txtChooserField1->setText( slChooserValues[index] );
925 txtChooserField1->setFocus(); 944 txtChooserField1->setFocus();
926 945
927 } 946 }
928 947
929} 948}
930 949
931void ContactEditor::slotCmbChooser2Change( int index ) { 950void ContactEditor::slotCmbChooser2Change( int index ) {
932 qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); 951 qWarning("ContactEditor::slotCmbChooser2Change( %d )", index);
933 952
934 if ( !cmbChooserChange( cmbChooserField2->currentItem(), txtChooserField2, 2) ){ 953 if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){
935 954
936 txtChooserField2->setText( slChooserValues[index] ); 955 txtChooserField2->setText( slChooserValues[index] );
937 txtChooserField2->setFocus(); 956 txtChooserField2->setFocus();
938 957
939 } 958 }
940} 959}
941 960
942void ContactEditor::slotCmbChooser3Change( int index ) { 961void ContactEditor::slotCmbChooser3Change( int index ) {
943 qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); 962 qWarning("ContactEditor::slotCmbChooser3Change( %d )", index);
944 963
945 if ( !cmbChooserChange( cmbChooserField3->currentItem(), txtChooserField3, 3) ){ 964 if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){
946 965
947 txtChooserField3->setText( slChooserValues[index] ); 966 txtChooserField3->setText( slChooserValues[index] );
948 txtChooserField3->setFocus(); 967 txtChooserField3->setFocus();
949 968
950 } 969 }
951} 970}
952 971
953void ContactEditor::slotCmbChooser4Change( int index ) { 972void ContactEditor::slotCmbChooser4Change( int index ) {
954 qWarning("ContactEditor::slotCmbChooser4Change( %d )", index); 973 qWarning("ContactEditor::slotCmbChooser4Change( %d )", index);
955 974
956 if ( !cmbChooserChange( cmbChooserField4->currentItem(), txtChooserField4, 4) ){ 975 if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){
957 976
958 txtChooserField4->setText( slChooserValues[index] ); 977 txtChooserField4->setText( slChooserValues[index] );
959 txtChooserField4->setFocus(); 978 txtChooserField4->setFocus();
960 979
961 } 980 }
962} 981}
963 982
964void ContactEditor::slotAddressTypeChange( int index ) { 983void ContactEditor::slotAddressTypeChange( int index ) {
965 984
966 985
967 if ( !initializing ) 986 if ( !initializing )
968 contactfields.setFieldOrder( 4, index ); 987 contactfields.setFieldOrder( 4, index );
969 988
970 989
971 if ( index == 0 ) { 990 if ( index == 0 ) {
972 991
973 txtAddress->setText( slBusinessAddress[0] ); 992 txtAddress->setText( slBusinessAddress[0] );
974 //txtAddress2->setText( (*slBusinessAddress)[1] ); 993 //txtAddress2->setText( (*slBusinessAddress)[1] );
975 //txtPOBox->setText( (*slBusinessAddress)[2] ); 994 //txtPOBox->setText( (*slBusinessAddress)[2] );
976 txtCity->setText( slBusinessAddress[3] ); 995 txtCity->setText( slBusinessAddress[3] );
977 txtState->setText( slBusinessAddress[4] ); 996 txtState->setText( slBusinessAddress[4] );
978 txtZip->setText( slBusinessAddress[5] ); 997 txtZip->setText( slBusinessAddress[5] );
979 QLineEdit *txtTmp = cmbCountry->lineEdit(); 998 QLineEdit *txtTmp = cmbCountry->lineEdit();
980 txtTmp->setText( slBusinessAddress[6] ); 999 txtTmp->setText( slBusinessAddress[6] );
981 1000
982 } else { 1001 } else {
983 1002
984 txtAddress->setText( slHomeAddress[0] ); 1003 txtAddress->setText( slHomeAddress[0] );
985 //txtAddress2->setText( (*slHomeAddress)[1] ); 1004 //txtAddress2->setText( (*slHomeAddress)[1] );
986 //txtPOBox->setText( (*slHomeAddress)[2] ); 1005 //txtPOBox->setText( (*slHomeAddress)[2] );
987 txtCity->setText( slHomeAddress[3] ); 1006 txtCity->setText( slHomeAddress[3] );
988 txtState->setText( slHomeAddress[4] ); 1007 txtState->setText( slHomeAddress[4] );
989 txtZip->setText( slHomeAddress[5] ); 1008 txtZip->setText( slHomeAddress[5] );
990 QLineEdit *txtTmp = cmbCountry->lineEdit(); 1009 QLineEdit *txtTmp = cmbCountry->lineEdit();
991 txtTmp->setText( slHomeAddress[6] ); 1010 txtTmp->setText( slHomeAddress[6] );
992 1011
993 } 1012 }
994 1013
995} 1014}
996 1015
997void ContactEditor::slotFullNameChange( const QString &textChanged ) { 1016void ContactEditor::slotFullNameChange( const QString &textChanged ) {
998 1017
999 int index = cmbFileAs->currentItem(); 1018 int index = cmbFileAs->currentItem();
1000 1019
1001 cmbFileAs->clear(); 1020 cmbFileAs->clear();
1002 1021
1003 cmbFileAs->insertItem( parseName( textChanged, 0 ) ); 1022 cmbFileAs->insertItem( parseName( textChanged, 0 ) );
1004 cmbFileAs->insertItem( parseName( textChanged, 1 ) ); 1023 cmbFileAs->insertItem( parseName( textChanged, 1 ) );
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h
index 95f9f2d..703e702 100644
--- a/core/pim/addressbook/contacteditor.h
+++ b/core/pim/addressbook/contacteditor.h
@@ -1,186 +1,192 @@
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#ifndef CONTACTEDITOR_H 21#ifndef CONTACTEDITOR_H
22#define CONTACTEDITOR_H 22#define CONTACTEDITOR_H
23 23
24#include <opie/ocontact.h> 24#include <opie/ocontact.h>
25 25
26#include <qpe/datebookmonth.h> 26#include <qpe/datebookmonth.h>
27 27
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qlist.h> 29#include <qlist.h>
30#include <qmap.h> 30#include <qmap.h>
31#include <qstringlist.h> 31#include <qstringlist.h>
32#include <qwidgetstack.h>
32 33
33#include "ocontactfields.h" 34#include "ocontactfields.h"
34 35
35const int NAME_LF = 0; 36const int NAME_LF = 0;
36const int NAME_LFM = 1; 37const int NAME_LFM = 1;
37const int NAME_FL = 2; 38const int NAME_FL = 2;
38const int NAME_FMLS = 3; 39const int NAME_FMLS = 3;
39 40
40const int NAME_F = 4; 41const int NAME_F = 4;
41const int NAME_M = 5; 42const int NAME_M = 5;
42const int NAME_L = 6; 43const int NAME_L = 6;
43const int NAME_S = 7; 44const int NAME_S = 7;
44 45
45 46
46class QScrollView; 47class QScrollView;
47class QTabWidget; 48class QTabWidget;
48class QMultiLineEdit; 49class QMultiLineEdit;
49class QLineEdit; 50class QLineEdit;
50class QComboBox; 51class QComboBox;
51class QPushButton; 52class QPushButton;
52class CategorySelect; 53class CategorySelect;
53class QLabel; 54class QLabel;
54 55
55class ContactEditor : public QDialog { 56class ContactEditor : public QDialog {
56 Q_OBJECT 57 Q_OBJECT
57 58
58 public: 59 public:
59 ContactEditor(const OContact &entry, 60 ContactEditor(const OContact &entry,
60 QWidget *parent = 0, 61 QWidget *parent = 0,
61 const char *name = 0, 62 const char *name = 0,
62 WFlags fl = 0 ); 63 WFlags fl = 0 );
63 ~ContactEditor(); 64 ~ContactEditor();
64 void setNameFocus(); 65 void setNameFocus();
65 void setPersonalView( bool personal = true ); 66 void setPersonalView( bool personal = true );
66 OContact entry() const { return ent; } 67 OContact entry() const { return ent; }
67 68
68 public slots: 69 public slots:
69 void slotNote(); 70 void slotNote();
70 void slotName(); 71 void slotName();
71 void setEntry(const OContact &entry); 72 void setEntry(const OContact &entry);
72 73
73 protected slots: 74 protected slots:
74 void accept(); 75 void accept();
75 76
76 private: 77 private:
77 void init(); 78 void init();
78 void saveEntry(); 79 void saveEntry();
79 bool isEmpty(); 80 bool isEmpty();
80 void cleanupFields(); 81 void cleanupFields();
81 void updateDatePicker(); 82 void updateDatePicker();
82 QString parseName( QString fullName, int type ); 83 QString parseName( QString fullName, int type );
83 void chooserError( int index ); 84 void chooserError( int index );
84 private slots: 85 private slots:
85 void slotChooser1Change( const QString &textChanged ); 86 void slotChooser1Change( const QString &textChanged );
86 void slotChooser2Change( const QString &textChanged ); 87 void slotChooser2Change( const QString &textChanged );
87 void slotChooser3Change( const QString &textChanged ); 88 void slotChooser3Change( const QString &textChanged );
88 void slotChooser4Change( const QString &textChanged ); 89 void slotChooser4Change( const QString &textChanged );
89 void slotCmbChooser1Change( int index ); 90 void slotCmbChooser1Change( int index );
90 void slotCmbChooser2Change( int index ); 91 void slotCmbChooser2Change( int index );
91 void slotCmbChooser3Change( int index ); 92 void slotCmbChooser3Change( int index );
92 void slotCmbChooser4Change( int index ); 93 void slotCmbChooser4Change( int index );
93 void slotAddressTypeChange( int index ); 94 void slotAddressTypeChange( int index );
94 void slotAddressChange( const QString &textChanged ); 95 void slotAddressChange( const QString &textChanged );
95 void slotAddress2Change( const QString &textChanged ); 96 void slotAddress2Change( const QString &textChanged );
96 void slotPOBoxChange( const QString &textChanged ); 97 void slotPOBoxChange( const QString &textChanged );
97 void slotCityChange( const QString &textChanged ); 98 void slotCityChange( const QString &textChanged );
98 void slotStateChange( const QString &textChanged ); 99 void slotStateChange( const QString &textChanged );
99 void slotZipChange( const QString &textChanged ); 100 void slotZipChange( const QString &textChanged );
100 void slotCountryChange( const QString &textChanged ); 101 void slotCountryChange( const QString &textChanged );
101 void slotFullNameChange( const QString &textChanged ); 102 void slotFullNameChange( const QString &textChanged );
102 void slotAnniversaryDateChanged( int year, int month, int day); 103 void slotAnniversaryDateChanged( int year, int month, int day);
103 void slotBirthdayDateChanged( int year, int month, int day); 104 void slotBirthdayDateChanged( int year, int month, int day);
104 void slotRemoveBirthday(); 105 void slotRemoveBirthday();
105 void slotRemoveAnniversary(); 106 void slotRemoveAnniversary();
106 void defaultEmailChanged(int); 107 void defaultEmailChanged(int);
107 108
108 private: 109 private:
110 enum StackWidgets { TextField = 1, Combo };
109 int defaultEmailChooserPosition; 111 int defaultEmailChooserPosition;
110 void populateDefaultEmailCmb(); 112 void populateDefaultEmailCmb();
111 void chooserChange( const QString&, int , QLineEdit*, int ); 113 void chooserChange( const QString&, int , QLineEdit*, int );
112 bool cmbChooserChange( int , QLineEdit*, int ); 114 bool cmbChooserChange( int , QWidgetStack*, int );
113 OContactFields contactfields; 115 OContactFields contactfields;
114 116
115 bool useFullName; 117 bool useFullName;
116 118
117 OContact ent; 119 OContact ent;
118 120
119 QDialog *dlgNote; 121 QDialog *dlgNote;
120 QDialog *dlgName; 122 QDialog *dlgName;
121 123
122 QList<QLineEdit> listValue; 124 QList<QLineEdit> listValue;
123 QList<QLabel> listName; 125 QList<QLabel> listName;
124 126
125 QStringList slDynamicEntries; 127 QStringList slDynamicEntries;
126 QStringList trlDynamicEntries; 128 QStringList trlDynamicEntries;
127 129
128 bool m_personalView; 130 bool m_personalView;
129 131
130 QStringList slHomeAddress; 132 QStringList slHomeAddress;
131 QStringList slBusinessAddress; 133 QStringList slBusinessAddress;
132 QStringList slChooserNames; 134 QStringList slChooserNames;
133 QStringList slChooserValues; 135 QStringList slChooserValues;
134 QStringList emails; 136 QStringList emails;
135 QString defaultEmail; 137 QString defaultEmail;
136 138
137 QMultiLineEdit *txtNote; 139 QMultiLineEdit *txtNote;
138 QLabel *lblNote; 140 QLabel *lblNote;
139 141
140 //QLineEdit *txtTitle; 142 //QLineEdit *txtTitle;
141 QLineEdit *txtFirstName; 143 QLineEdit *txtFirstName;
142 QLineEdit *txtMiddleName; 144 QLineEdit *txtMiddleName;
143 QLineEdit *txtLastName; 145 QLineEdit *txtLastName;
144 QLineEdit *txtSuffix; 146 QLineEdit *txtSuffix;
145 147
146 QTabWidget *tabMain; 148 QTabWidget *tabMain;
147 QScrollView *svGeneral; 149 QScrollView *svGeneral;
148 QPushButton *btnFullName; 150 QPushButton *btnFullName;
149 QPushButton *btnNote; 151 QPushButton *btnNote;
150 QLineEdit *txtFullName; 152 QLineEdit *txtFullName;
151 QLineEdit *txtJobTitle; 153 QLineEdit *txtJobTitle;
152 QLineEdit *txtOrganization; 154 QLineEdit *txtOrganization;
153 QLineEdit *txtChooserField1; 155 QLineEdit *txtChooserField1;
154 QLineEdit *txtChooserField2; 156 QLineEdit *txtChooserField2;
155 QLineEdit *txtChooserField3; 157 QLineEdit *txtChooserField3;
156 QLineEdit *txtChooserField4; 158 QLineEdit *txtChooserField4;
159 QWidgetStack* m_widgetStack1;
160 QWidgetStack* m_widgetStack2;
161 QWidgetStack* m_widgetStack3;
162 QWidgetStack* m_widgetStack4;
157 QComboBox *cmbChooserField1; 163 QComboBox *cmbChooserField1;
158 QComboBox *cmbChooserField2; 164 QComboBox *cmbChooserField2;
159 QComboBox *cmbChooserField3; 165 QComboBox *cmbChooserField3;
160 QComboBox *cmbChooserField4; 166 QComboBox *cmbChooserField4;
161 QComboBox *cmbDefaultEmail; 167 QComboBox *cmbDefaultEmail;
162 QComboBox *cmbFileAs; 168 QComboBox *cmbFileAs;
163 CategorySelect *cmbCat; 169 CategorySelect *cmbCat;
164 QLabel *labCat; 170 QLabel *labCat;
165 171
166 QScrollView *svAddress; 172 QScrollView *svAddress;
167 QLineEdit *txtAddress; 173 QLineEdit *txtAddress;
168 //QLineEdit *txtAddress2; 174 //QLineEdit *txtAddress2;
169 //QLineEdit *txtPOBox; 175 //QLineEdit *txtPOBox;
170 QLineEdit *txtCity; 176 QLineEdit *txtCity;
171 QLineEdit *txtState; 177 QLineEdit *txtState;
172 QLineEdit *txtZip; 178 QLineEdit *txtZip;
173 QComboBox *cmbAddress; 179 QComboBox *cmbAddress;
174 QComboBox *cmbCountry; 180 QComboBox *cmbCountry;
175 181
176 QScrollView *svDetails; 182 QScrollView *svDetails;
177 QComboBox *cmbGender; 183 QComboBox *cmbGender;
178 DateBookMonth* birthdayPicker; 184 DateBookMonth* birthdayPicker;
179 QToolButton* birthdayButton; 185 QToolButton* birthdayButton;
180 DateBookMonth* anniversaryPicker; 186 DateBookMonth* anniversaryPicker;
181 QToolButton* anniversaryButton; 187 QToolButton* anniversaryButton;
182 188
183 bool initializing; 189 bool initializing;
184 }; 190 };
185 191
186#endif 192#endif
diff --git a/core/pim/addressbook/ocontactfields.cpp b/core/pim/addressbook/ocontactfields.cpp
index ffb88e8..831a596 100644
--- a/core/pim/addressbook/ocontactfields.cpp
+++ b/core/pim/addressbook/ocontactfields.cpp
@@ -375,82 +375,82 @@ OContactFields::OContactFields():
375 375
376OContactFields::~OContactFields(){ 376OContactFields::~OContactFields(){
377 377
378 // We will store the fieldorder into the config file 378 // We will store the fieldorder into the config file
379 // to reuse it for the future.. 379 // to reuse it for the future..
380 if ( changedFieldOrder ){ 380 if ( changedFieldOrder ){
381 Config cfg ( "AddressBook" ); 381 Config cfg ( "AddressBook" );
382 cfg.setGroup( "ContactFieldOrder" ); 382 cfg.setGroup( "ContactFieldOrder" );
383 cfg.writeEntry( "General", globalFieldOrder ); 383 cfg.writeEntry( "General", globalFieldOrder );
384 } 384 }
385} 385}
386 386
387 387
388 388
389void OContactFields::saveToRecord( OContact &cnt ){ 389void OContactFields::saveToRecord( OContact &cnt ){
390 390
391 qDebug("ocontactfields saveToRecord: >%s<",fieldOrder.latin1()); 391 qDebug("ocontactfields saveToRecord: >%s<",fieldOrder.latin1());
392 392
393 // Store fieldorder into this contact. 393 // Store fieldorder into this contact.
394 cnt.setCustomField( CONTACT_FIELD_ORDER_NAME, fieldOrder ); 394 cnt.setCustomField( CONTACT_FIELD_ORDER_NAME, fieldOrder );
395 395
396 globalFieldOrder = fieldOrder; 396 globalFieldOrder = fieldOrder;
397 changedFieldOrder = true; 397 changedFieldOrder = true;
398 398
399} 399}
400 400
401void OContactFields::loadFromRecord( const OContact &cnt ){ 401void OContactFields::loadFromRecord( const OContact &cnt ){
402 qDebug("ocontactfields loadFromRecord"); 402 qDebug("ocontactfields loadFromRecord");
403 qDebug("loading >%s<",cnt.fullName().latin1()); 403 qDebug("loading >%s<",cnt.fullName().latin1());
404 404
405 // Get fieldorder for this contact. If none is defined, 405 // Get fieldorder for this contact. If none is defined,
406 // we will use the global one from the config file.. 406 // we will use the global one from the config file..
407 407
408 fieldOrder = cnt.customField( CONTACT_FIELD_ORDER_NAME ); 408 fieldOrder = cnt.customField( CONTACT_FIELD_ORDER_NAME );
409 409
410 qDebug("fieldOrder from contact>%s<",fieldOrder.latin1()); 410 qDebug("fieldOrder from contact>%s<",fieldOrder.latin1());
411 411
412 if (fieldOrder.isEmpty()){ 412 if (fieldOrder.isEmpty()){
413 fieldOrder = globalFieldOrder; 413 fieldOrder = globalFieldOrder;
414 } 414 }
415 415
416 416
417 qDebug("effective fieldOrder in loadFromRecord >%s<",fieldOrder.latin1()); 417 qDebug("effective fieldOrder in loadFromRecord >%s<",fieldOrder.latin1());
418} 418}
419 419
420void OContactFields::setFieldOrder( int num, int index ){ 420void OContactFields::setFieldOrder( int num, int index ){
421 qDebug("qcontactfields setfieldorder pos %i -> %i",num,index); 421 qDebug("qcontactfields setfieldorder pos %i -> %i",num,index);
422 422
423 fieldOrder[num] = QString::number( index )[0]; 423 fieldOrder[num] = QString::number( index, 16 )[0];
424 424
425 // We will store this new fieldorder globally to 425 // We will store this new fieldorder globally to
426 // remember it for contacts which have none 426 // remember it for contacts which have none
427 globalFieldOrder = fieldOrder; 427 globalFieldOrder = fieldOrder;
428 changedFieldOrder = true; 428 changedFieldOrder = true;
429 429
430 qDebug("fieldOrder >%s<",fieldOrder.latin1()); 430 qDebug("fieldOrder >%s<",fieldOrder.latin1());
431} 431}
432 432
433int OContactFields::getFieldOrder( int num, int defIndex ){ 433int OContactFields::getFieldOrder( int num, int defIndex ){
434 qDebug("ocontactfields getFieldOrder"); 434 qDebug("ocontactfields getFieldOrder");
435 qDebug("fieldOrder >%s<",fieldOrder.latin1()); 435 qDebug("fieldOrder >%s<",fieldOrder.latin1());
436 436
437 // Get index of combo as char.. 437 // Get index of combo as char..
438 QChar poschar = fieldOrder[num]; 438 QChar poschar = fieldOrder[num];
439 439
440 bool ok; 440 bool ok;
441 int ret = 0; 441 int ret = 0;
442 // Convert char to number.. 442 // Convert char to number..
443 if ( !( poschar == QChar::null ) ) 443 if ( !( poschar == QChar::null ) )
444 ret = QString( poschar ).toInt(&ok, 10); 444 ret = QString( poschar ).toInt(&ok, 16);
445 else 445 else
446 ok = false; 446 ok = false;
447 447
448 // Return default value if index for 448 // Return default value if index for
449 // num was not set or if anything else happened.. 449 // num was not set or if anything else happened..
450 if ( !ok ) ret = defIndex; 450 if ( !ok ) ret = defIndex;
451 451
452 qDebug("returning >%i<",ret); 452 qDebug("returning >%i<",ret);
453 453
454 return ret; 454 return ret;
455 455
456} 456}
diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h
index 3c1e5ee..3becfdc 100644
--- a/core/pim/addressbook/version.h
+++ b/core/pim/addressbook/version.h
@@ -1,10 +1,10 @@
1#ifndef _VERSION_H_ 1#ifndef _VERSION_H_
2#define _VERSION_H_ 2#define _VERSION_H_
3 3
4#define MAINVERSION "0" 4#define MAINVERSION "0"
5#define SUBVERSION "2" 5#define SUBVERSION "2"
6#define PATCHVERSION "1" 6#define PATCHVERSION "2"
7 7
8#define APPNAME "OPIE_ADDRESSBOOK" 8#define APPNAME "OPIE_ADDRESSBOOK"
9 9
10#endif 10#endif