summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO8
-rw-r--r--core/pim/addressbook/addressbook.cpp30
-rw-r--r--core/pim/addressbook/addressbook.h5
-rw-r--r--core/pim/addressbook/contacteditor.cpp2
-rw-r--r--core/pim/addressbook/version.h2
5 files changed, 38 insertions, 9 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO
index da9b9c2..a3cffa7 100644
--- a/core/pim/addressbook/TODO
+++ b/core/pim/addressbook/TODO
@@ -1,116 +1,112 @@
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- Optionally put scrollbars left.
16 16
17Known Bugs: 17Known Bugs:
18----------- 18-----------
19 19
20Bugs but not in addressbook:
21-----------------------------
22- VCARD: If umlaut (äöüß) in address, the parser gets confused..
23
24
25Urgent: 20Urgent:
26-------- 21--------
27- Category is on the wrong position after changing to personal and back to normal 22- Category is on the wrong position after changing to personal and back to normal
28 ( Temporarily workaround: Category is never deactivated.. :S ) 23 ( Temporarily workaround: Category is never deactivated.. :S )
29 24
30 25
31Important: 26Important:
32---------- 27----------
33 28
34- "What's this" should be added (Deleyed after Feature Freeze) 29- "What's this" should be added (Deleyed after Feature Freeze)
35 30
36Less important: 31Less important:
37--------------- 32---------------
38- Reload if contacts were changed externally 33- Reload if contacts were changed externally
39- The picker (alphabetical sort widget) should be 34- The picker (alphabetical sort widget) should be
40 placed verticaly or horizontally (configurable) 35 placed verticaly or horizontally (configurable)
41- Find a smart solution for activating/deactivating the "send email" event 36- Find a smart solution for activating/deactivating the "send email" event
42- If new contact is added (contacteditor closed): focus (table, card) to 37- If new contact is added (contacteditor closed): focus (table, card) to
43 this entry ! 38 this entry !
44- After search (Started with Return): KeyFocus should be on Tabelle 39- After search (Started with Return): KeyFocus should be on Tabelle
45 40
46ContactEditor: 41ContactEditor:
47- Redesign of Contacteditor 42- Redesign of Contacteditor
48 43
49Should be Fixed (not absolute sure, need further validation): 44Should be Fixed (not absolute sure, need further validation):
50------------------------------------------------------------- 45-------------------------------------------------------------
51 46
52 47
53Fixed/Ready: 48Fixed/Ready:
54------- 49-------
55- Syncing: abtable not reloaded after sync. 50- Syncing: abtable not reloaded after sync.
56- Find widget should be replaced by something like 51- Find widget should be replaced by something like
57 qpdf has. 52 qpdf has.
58- Adding a configuration dialog 53- Adding a configuration dialog
59- Picker: Activated letter schould be more visible 54- Picker: Activated letter schould be more visible
60- Advanced handling of cursor keys (search..) 55- Advanced handling of cursor keys (search..)
61- Mail-Icon is missing 56- Mail-Icon is missing
62- Use opie-mail insted of qt-mail if possible. 57- Use opie-mail insted of qt-mail if possible.
63- Font menu is invisible using german translation 58- Font menu is invisible using german translation
64- Personal contact editor: Disable categories 59- Personal contact editor: Disable categories
65- "Nonenglish" translation bug has to be fixed. 60- "Nonenglish" translation bug has to be fixed.
66- contacteditor: Birthday, annyversary, ... : Use Dateselector 61- contacteditor: Birthday, annyversary, ... : Use Dateselector
67- The names of the countries are sorted by there english names, only.. 62- The names of the countries are sorted by there english names, only..
68 Even if they are translated.. :S 63 Even if they are translated.. :S
69- Cursor keys should work in detail-view (ablabel) 64- Cursor keys should work in detail-view (ablabel)
70 -> Ablabel should be removed and Abtable should be increased with 65 -> Ablabel should be removed and Abtable should be increased with
71 different views (as started by darwin zins).. 66 different views (as started by darwin zins)..
72- Use advanced database functions in abtable to decrease 67- Use advanced database functions in abtable to decrease
73 memory footprint and to make everything more easy ! 68 memory footprint and to make everything more easy !
74 (abtable should store Iterator for selected Category) 69 (abtable should store Iterator for selected Category)
75- Abtable: Configure Contact column (internally already available, 70- Abtable: Configure Contact column (internally already available,
76 need configuration) 71 need configuration)
77- Select of primary contact (see #274 on mantis) 72- Select of primary contact (see #274 on mantis)
78- Category-select does not work completely: "Unfiled" is always in listview .. 73- Category-select does not work completely: "Unfiled" is always in listview ..
79- Return from Contacteditor: Category resettet to all 74- Return from Contacteditor: Category resettet to all
80- Personal Details not working 75- Personal Details not working
81- If category changed, the letterpicker should be resetted 76- If category changed, the letterpicker should be resetted
82- There should be some icons for List and Cardview 77- There should be some icons for List and Cardview
83- If in Cardview and a category change removes all entries: 78- If in Cardview and a category change removes all entries:
84 There are already entries in Cardview after up/down 79 There are already entries in Cardview after up/down
85- Personal Details: Anniversary zeigt Fantasie-Werte 80- Personal Details: Anniversary zeigt Fantasie-Werte
86- Unfiled shown just in Category "All" and "Unfiled". 81- Unfiled shown just in Category "All" and "Unfiled".
87- After finising search and after Edit: Clear Picker 82- After finising search and after Edit: Clear Picker
88- After Edit: Table position back to edited entry. 83- After Edit: Table position back to edited entry.
89- Optimize Table Update... 84- Optimize Table Update...
90- Change MyDialog to Config 85- Change MyDialog to Config
91- Store position and state of toolbar 86- Store position and state of toolbar
92- Searchwidget closed: Selected user is jumping 87- Searchwidget closed: Selected user is jumping
93- Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist) 88- Wenn suchen beendet, dann dauert das Tabellenupdate (was überhaupt überflüssig ist)
94 zu lange.. 89 zu lange..
95- VCARD: Import of Anniversary does not work correctly (currently disabled) 90- VCARD: Import of Anniversary does not work correctly (currently disabled)
96- Name order selected in "contacteditor" not used in list view. 91- Name order selected in "contacteditor" not used in list view.
97- OK-Key does not switch from Detailview (ablable) to Listview 92- OK-Key does not switch from Detailview (ablable) to Listview
98- Receiving of beams should open a dialog 93- Receiving of beams should open a dialog
99- Fix start of opie-mail 94- Fix start of opie-mail
100- Implement Button Pics 95- Implement Button Pics
101- Add a dialog to accept and optionally edit received contacts by IRDA. 96- Add a dialog to accept and optionally edit received contacts by IRDA.
102- Language not English (tested with german opie-translation): 97- Language not English (tested with german opie-translation):
103 1. Configure nicht übersetzt (alles leer). 98 1. Configure nicht übersetzt (alles leer).
104 2. Contacteditor nur teilweise übersetzt. 99 2. Contacteditor nur teilweise übersetzt.
105 3. Kategorie-Picker geht nicht. 100 3. Kategorie-Picker geht nicht.
106- Plugin for Today for Birthdays and Anniversaries 101- Plugin for Today for Birthdays and Anniversaries
107- Implement a picker/combo for the default email. 102- Implement a picker/combo for the default email.
108- Overview window cleanup needed.. 103- Overview window cleanup needed..
109- Store last settings of combo-boxes 104- Store last settings of combo-boxes
110- Personal and Business Web-page is not editable 105- Personal and Business Web-page is not editable
111- Default Email-button: A lot of problems: 106- Default Email-button: A lot of problems:
112 If on second tab: The combo chooser is on the top left of the screen ! :( 107 If on second tab: The combo chooser is on the top left of the screen ! :(
113- Default Email-Button: Sometimes not hiding the textfields completely 108- Default Email-Button: Sometimes not hiding the textfields completely
114- Fix handling of 3 Firstnames 109- Fix handling of 3 Firstnames
115- Cursor-UP/Down: Should additionally scroll cardview if it is too large 110- Cursor-UP/Down: Should additionally scroll cardview if it is too large
116 (behaviour should be selectable by configuration) 111 (behaviour should be selectable by configuration)
112- User center of the joypad to switch back from card to listview !
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index a5bf19b..89a3312 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -84,378 +84,408 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
84 m_config.load(); 84 m_config.load();
85 85
86 setCaption( tr("Contacts") ); 86 setCaption( tr("Contacts") );
87 setIcon( Resource::loadPixmap( "AddressBook" ) ); 87 setIcon( Resource::loadPixmap( "AddressBook" ) );
88 88
89 // Settings for Main Menu 89 // Settings for Main Menu
90 // setToolBarsMovable( false ); 90 // setToolBarsMovable( false );
91 setToolBarsMovable( !m_config.fixedBars() ); 91 setToolBarsMovable( !m_config.fixedBars() );
92 setRightJustification( true ); 92 setRightJustification( true );
93 93
94 QPEToolBar *bar = new QPEToolBar( this ); 94 QPEToolBar *bar = new QPEToolBar( this );
95 bar->setHorizontalStretchable( TRUE ); 95 bar->setHorizontalStretchable( TRUE );
96 96
97 QPEMenuBar *mbList = new QPEMenuBar( bar ); 97 QPEMenuBar *mbList = new QPEMenuBar( bar );
98 mbList->setMargin( 0 ); 98 mbList->setMargin( 0 );
99 99
100 QPopupMenu *edit = new QPopupMenu( mbList ); 100 QPopupMenu *edit = new QPopupMenu( mbList );
101 mbList->insertItem( tr( "Contact" ), edit ); 101 mbList->insertItem( tr( "Contact" ), edit );
102 102
103 // Category Menu 103 // Category Menu
104 catMenu = new QPopupMenu( this ); 104 catMenu = new QPopupMenu( this );
105 catMenu->setCheckable( TRUE ); 105 catMenu->setCheckable( TRUE );
106 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) ); 106 connect( catMenu, SIGNAL(activated(int)), this, SLOT(slotSetCategory(int)) );
107 mbList->insertItem( tr("View"), catMenu ); 107 mbList->insertItem( tr("View"), catMenu );
108 108
109 // Create Toolbar 109 // Create Toolbar
110 listTools = new QPEToolBar( this, "list operations" ); 110 listTools = new QPEToolBar( this, "list operations" );
111 listTools->setHorizontalStretchable( true ); 111 listTools->setHorizontalStretchable( true );
112 addToolBar( listTools ); 112 addToolBar( listTools );
113 moveToolBar( listTools, m_config.getToolBarPos() ); 113 moveToolBar( listTools, m_config.getToolBarPos() );
114 114
115 // View Icons 115 // View Icons
116 m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ), 116 m_tableViewButton = new QAction( tr( "List" ), Resource::loadPixmap( "addressbook/weeklst" ),
117 QString::null, 0, this, 0 ); 117 QString::null, 0, this, 0 );
118 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) ); 118 connect( m_tableViewButton, SIGNAL( activated() ), this, SLOT( slotListView() ) );
119 m_tableViewButton->setToggleAction( true ); 119 m_tableViewButton->setToggleAction( true );
120 m_tableViewButton->addTo( listTools ); 120 m_tableViewButton->addTo( listTools );
121 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 ); 121 m_cardViewButton = new QAction( tr( "Card" ), Resource::loadPixmap( "day" ), QString::null, 0, this, 0 );
122 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) ); 122 connect( m_cardViewButton, SIGNAL( activated() ), this, SLOT( slotCardView() ) );
123 m_cardViewButton->setToggleAction( true ); 123 m_cardViewButton->setToggleAction( true );
124 m_cardViewButton->addTo( listTools ); 124 m_cardViewButton->addTo( listTools );
125 125
126 listTools->addSeparator(); 126 listTools->addSeparator();
127 127
128 // Other Buttons 128 // Other Buttons
129 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 129 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null,
130 0, this, 0 ); 130 0, this, 0 );
131 actionNew = a; 131 actionNew = a;
132 connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) ); 132 connect( a, SIGNAL( activated() ), this, SLOT( slotListNew() ) );
133 a->addTo( edit ); 133 a->addTo( edit );
134 a->addTo( listTools ); 134 a->addTo( listTools );
135 135
136 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 136 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
137 0, this, 0 ); 137 0, this, 0 );
138 actionEdit = a; 138 actionEdit = a;
139 connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) ); 139 connect( a, SIGNAL( activated() ), this, SLOT( slotViewEdit() ) );
140 a->addTo( edit ); 140 a->addTo( edit );
141 a->addTo( listTools ); 141 a->addTo( listTools );
142 142
143 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 143 a = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
144 0, this, 0 ); 144 0, this, 0 );
145 actionTrash = a; 145 actionTrash = a;
146 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) ); 146 connect( a, SIGNAL( activated() ), this, SLOT( slotListDelete() ) );
147 a->addTo( edit ); 147 a->addTo( edit );
148 a->addTo( listTools ); 148 a->addTo( listTools );
149 149
150 150
151 // make it possible to go directly to businesscard via qcop call 151 // make it possible to go directly to businesscard via qcop call
152 //#if defined(Q_WS_QWS) // Why this ? (se) 152 //#if defined(Q_WS_QWS) // Why this ? (se)
153#if !defined(QT_NO_COP) 153#if !defined(QT_NO_COP)
154 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this ); 154 QCopChannel *addressChannel = new QCopChannel("QPE/Addressbook" , this );
155 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)), 155 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
156 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) ); 156 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
157#endif 157#endif
158 // #endif 158 // #endif
159 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), 159 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ),
160 QString::null, 0, this, 0 ); 160 QString::null, 0, this, 0 );
161 actionFind = a; 161 actionFind = a;
162 connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) ); 162 connect( a, SIGNAL(activated()), this, SLOT( slotFindOpen()) );
163 a->addTo( edit ); 163 a->addTo( edit );
164 a->addTo( listTools ); 164 a->addTo( listTools );
165 165
166 // Much better search widget, taken from QTReader.. (se) 166 // Much better search widget, taken from QTReader.. (se)
167 searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE ); 167 searchBar = new OFloatBar( "Search", this, QMainWindow::Top, TRUE );
168 searchBar->setHorizontalStretchable( TRUE ); 168 searchBar->setHorizontalStretchable( TRUE );
169 searchBar->hide(); 169 searchBar->hide();
170 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 170 searchEdit = new QLineEdit( searchBar, "searchEdit" );
171 171
172 // QFont f("unifont", 16 /*, QFont::Bold*/); 172 // QFont f("unifont", 16 /*, QFont::Bold*/);
173 // searchEdit->setFont( f ); 173 // searchEdit->setFont( f );
174 174
175 searchBar->setStretchableWidget( searchEdit ); 175 searchBar->setStretchableWidget( searchEdit );
176 connect( searchEdit, SIGNAL( returnPressed( ) ), 176 connect( searchEdit, SIGNAL( returnPressed( ) ),
177 this, SLOT( slotFind( ) ) ); 177 this, SLOT( slotFind( ) ) );
178 178
179 a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); 179 a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
180 connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); 180 connect( a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
181 a->addTo( searchBar ); 181 a->addTo( searchBar );
182 182
183 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 183 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
184 connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) ); 184 connect( a, SIGNAL( activated() ), this, SLOT( slotFindClose() ) );
185 a->addTo( searchBar ); 185 a->addTo( searchBar );
186 186
187 a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), 187 a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ),
188 QString::null, 0, this, 0 ); 188 QString::null, 0, this, 0 );
189 //a->setEnabled( FALSE ); we got support for it now :) zecke 189 //a->setEnabled( FALSE ); we got support for it now :) zecke
190 actionMail = a; 190 actionMail = a;
191 connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) ); 191 connect( a, SIGNAL( activated() ), this, SLOT( writeMail() ) );
192 a->addTo( edit ); 192 a->addTo( edit );
193 a->addTo( listTools ); 193 a->addTo( listTools );
194 194
195 if ( Ir::supported() ) { 195 if ( Ir::supported() ) {
196 a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null, 196 a = new QAction( tr ("Beam Entry" ), Resource::loadPixmap( "beam" ), QString::null,
197 0, this, 0 ); 197 0, this, 0 );
198 actionBeam = a; 198 actionBeam = a;
199 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); 199 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
200 a->addTo( edit ); 200 a->addTo( edit );
201 a->addTo( listTools ); 201 a->addTo( listTools );
202 } 202 }
203 203
204 edit->insertSeparator(); 204 edit->insertSeparator();
205 205
206 a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), QString::null, 206 a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), QString::null,
207 0, this, 0); 207 0, this, 0);
208 actionPersonal = a; 208 actionPersonal = a;
209 connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) ); 209 connect( a, SIGNAL( activated() ), this, SLOT( importvCard() ) );
210 a->addTo( edit ); 210 a->addTo( edit );
211 211
212 a = new QAction( tr("Export vCard"), Resource::loadPixmap( "addressbook/fileexport"), QString::null,
213 0, this, 0);
214 actionPersonal = a;
215 connect( a, SIGNAL( activated() ), this, SLOT( exportvCard() ) );
216 a->addTo( edit );
217
212 edit->insertSeparator(); 218 edit->insertSeparator();
213 219
214 a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), 220 a = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ),
215 QString::null, 0, this, 0 , TRUE ); 221 QString::null, 0, this, 0 , TRUE );
216 actionPersonal = a; 222 actionPersonal = a;
217 connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) ); 223 connect( a, SIGNAL( activated() ), this, SLOT( slotPersonalView() ) );
218 a->addTo( edit ); 224 a->addTo( edit );
219 225
220 226
221#ifdef __DEBUG_RELEASE 227#ifdef __DEBUG_RELEASE
222 // Remove this function for public Release ! This is only 228 // Remove this function for public Release ! This is only
223 // for debug purposes .. 229 // for debug purposes ..
224 a = new QAction( tr( "Save all Data"), QString::null, 0, 0 ); 230 a = new QAction( tr( "Save all Data"), QString::null, 0, 0 );
225 connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) ); 231 connect( a, SIGNAL( activated() ), this , SLOT( slotSave() ) );
226 a->addTo( edit ); 232 a->addTo( edit );
227#endif 233#endif
228 a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 234 a = new QAction( tr( "Config" ), Resource::loadPixmap( "SettingsIcon" ), QString::null,
229 0, this, 0 ); 235 0, this, 0 );
230 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); 236 connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) );
231 a->addTo( edit ); 237 a->addTo( edit );
232 238
233 // Create Views 239 // Create Views
234 listContainer = new QWidget( this ); 240 listContainer = new QWidget( this );
235 QVBoxLayout *vb = new QVBoxLayout( listContainer ); 241 QVBoxLayout *vb = new QVBoxLayout( listContainer );
236 242
237 m_abView = new AbView( listContainer, m_config.orderList() ); 243 m_abView = new AbView( listContainer, m_config.orderList() );
238 vb->addWidget( m_abView ); 244 vb->addWidget( m_abView );
239 // abList->setHScrollBarMode( QScrollView::AlwaysOff ); 245 // abList->setHScrollBarMode( QScrollView::AlwaysOff );
240 connect( m_abView, SIGNAL( signalViewSwitched ( int ) ), 246 connect( m_abView, SIGNAL( signalViewSwitched ( int ) ),
241 this, SLOT( slotViewSwitched( int ) ) ); 247 this, SLOT( slotViewSwitched( int ) ) );
242 248
243 249
244 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); 250 QObject::connect( m_abView, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
245 251
246 m_abView->load(); 252 m_abView->load();
247 253
248 // Letter Picker 254 // Letter Picker
249 pLabel = new LetterPicker( listContainer ); 255 pLabel = new LetterPicker( listContainer );
250 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); 256 connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char)));
251 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) ); 257 connect(m_abView, SIGNAL( signalClearLetterPicker() ), pLabel, SLOT( clear() ) );
252 258
253 vb->addWidget( pLabel ); 259 vb->addWidget( pLabel );
254 260
255 // All Categories into view-menu.. 261 // All Categories into view-menu..
256 populateCategories(); 262 populateCategories();
257 263
258 // Fontsize 264 // Fontsize
259 defaultFont = new QFont( m_abView->font() ); 265 defaultFont = new QFont( m_abView->font() );
260 slotSetFont(m_config.fontSize()); 266 slotSetFont(m_config.fontSize());
261 m_curFontSize = m_config.fontSize(); 267 m_curFontSize = m_config.fontSize();
262 268
263 setCentralWidget(listContainer); 269 setCentralWidget(listContainer);
264 270
265 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 271 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
266 272
267 273
268 isLoading = false; 274 isLoading = false;
269} 275}
270 276
271 277
272void AddressbookWindow::slotConfig() 278void AddressbookWindow::slotConfig()
273{ 279{
274 ConfigDlg* dlg = new ConfigDlg( this, "Config" ); 280 ConfigDlg* dlg = new ConfigDlg( this, "Config" );
275 dlg -> setConfig( m_config ); 281 dlg -> setConfig( m_config );
276 dlg -> showMaximized(); 282 dlg -> showMaximized();
277 if ( dlg -> exec() ) { 283 if ( dlg -> exec() ) {
278 qWarning ("Config Dialog accepted!"); 284 qWarning ("Config Dialog accepted!");
279 m_config = dlg -> getConfig(); 285 m_config = dlg -> getConfig();
280 if ( m_curFontSize != m_config.fontSize() ){ 286 if ( m_curFontSize != m_config.fontSize() ){
281 qWarning("Font was changed!"); 287 qWarning("Font was changed!");
282 m_curFontSize = m_config.fontSize(); 288 m_curFontSize = m_config.fontSize();
283 emit slotSetFont( m_curFontSize ); 289 emit slotSetFont( m_curFontSize );
284 } 290 }
285 m_abView -> setListOrder( m_config.orderList() ); 291 m_abView -> setListOrder( m_config.orderList() );
286 } 292 }
287 293
288 delete dlg; 294 delete dlg;
289} 295}
290 296
291 297
292void AddressbookWindow::slotSetFont( int size ) 298void AddressbookWindow::slotSetFont( int size )
293{ 299{
294 qWarning("void AddressbookWindow::slotSetFont( %d )", size); 300 qWarning("void AddressbookWindow::slotSetFont( %d )", size);
295 301
296 if (size > 2 || size < 0) 302 if (size > 2 || size < 0)
297 size = 1; 303 size = 1;
298 304
299 m_config.setFontSize( size ); 305 m_config.setFontSize( size );
300 306
301 QFont *currentFont; 307 QFont *currentFont;
302 308
303 switch (size) { 309 switch (size) {
304 case 0: 310 case 0:
305 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); 311 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) );
306 currentFont = new QFont (m_abView->font()); 312 currentFont = new QFont (m_abView->font());
307 // abList->resizeRows(currentFont->pixelSize() + 7); :SX 313 // abList->resizeRows(currentFont->pixelSize() + 7); :SX
308 // abList->resizeRows(); 314 // abList->resizeRows();
309 break; 315 break;
310 case 1: 316 case 1:
311 m_abView->setFont( *defaultFont ); 317 m_abView->setFont( *defaultFont );
312 currentFont = new QFont (m_abView->font()); 318 currentFont = new QFont (m_abView->font());
313 // // abList->resizeRows(currentFont->pixelSize() + 7); 319 // // abList->resizeRows(currentFont->pixelSize() + 7);
314 // abList->resizeRows(); 320 // abList->resizeRows();
315 break; 321 break;
316 case 2: 322 case 2:
317 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); 323 m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) );
318 currentFont = new QFont (m_abView->font()); 324 currentFont = new QFont (m_abView->font());
319 // //abList->resizeRows(currentFont->pixelSize() + 7); 325 // //abList->resizeRows(currentFont->pixelSize() + 7);
320 // abList->resizeRows(); 326 // abList->resizeRows();
321 break; 327 break;
322 } 328 }
323} 329}
324 330
325 331
326 332
327void AddressbookWindow::importvCard() { 333void AddressbookWindow::importvCard() {
328 QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); 334 QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this );
329 if(!str.isEmpty() ){ 335 if(!str.isEmpty() ){
330 setDocument((const QString&) str ); 336 setDocument((const QString&) str );
331 } 337 }
332 338
333} 339}
340void AddressbookWindow::exportvCard()
341{
342 qWarning(" void AddressbookWindow::exportvCard()");
343 QString filename = OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this );
344 if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){
345 qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 );
346 OContact curCont = m_abView->currentEntry();
347 if ( !curCont.isEmpty() ){
348 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
349 filename );
350 OContactAccess* access = new OContactAccess ( "addressbook_exp", QString::null , vcard_backend, true );
351 if ( access ){
352 access->add( curCont );
353 access->save();
354 }
355 delete access;
356 }else
357 QMessageBox::critical( 0, "Export VCard",
358 QString( tr( "You have to select a contact !") ) );
359
360 }else
361 QMessageBox::critical( 0, "Export VCard",
362 QString( tr( "You have to set a filename !") ) );
363}
334 364
335void AddressbookWindow::setDocument( const QString &filename ) 365void AddressbookWindow::setDocument( const QString &filename )
336{ 366{
337 qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() ); 367 qWarning( "void AddressbookWindow::setDocument( %s )", filename.latin1() );
338 368
339 if ( filename.find(".vcf") != int(filename.length()) - 4 ){ 369 if ( filename.find(".vcf") != int(filename.length()) - 4 ){
340 370
341 371
342 372
343 switch( QMessageBox::information( this, tr ( "Right file type ?" ), 373 switch( QMessageBox::information( this, tr ( "Right file type ?" ),
344 tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ), 374 tr( "The selected file \n does not end with \".vcf\".\n Do you really want to open it?" ),
345 tr( "&Yes" ), tr( "&No" ), QString::null, 375 tr( "&Yes" ), tr( "&No" ), QString::null,
346 0, // Enter == button 0 376 0, // Enter == button 0
347 2 ) ) { // Escape == button 2 377 2 ) ) { // Escape == button 2
348 case 0: 378 case 0:
349 qWarning("YES clicked"); 379 qWarning("YES clicked");
350 break; 380 break;
351 case 1: 381 case 1:
352 qWarning("NO clicked"); 382 qWarning("NO clicked");
353 return; 383 return;
354 break; 384 break;
355 } 385 }
356 } 386 }
357 387
358 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 388 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
359 filename ); 389 filename );
360 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 390 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
361 OContactAccess::List allList = access->allRecords(); 391 OContactAccess::List allList = access->allRecords();
362 qWarning( "Found number of contacts in File: %d", allList.count() ); 392 qWarning( "Found number of contacts in File: %d", allList.count() );
363 393
364 if ( !allList.count() ) { 394 if ( !allList.count() ) {
365 QMessageBox::information( this, "Import VCard", 395 QMessageBox::information( this, "Import VCard",
366 "It was impossible to import\nthe VCard.\n" 396 "It was impossible to import\nthe VCard.\n"
367 "The VCard may be corrupted!" ); 397 "The VCard may be corrupted!" );
368 } 398 }
369 399
370 bool doAsk = true; 400 bool doAsk = true;
371 OContactAccess::List::Iterator it; 401 OContactAccess::List::Iterator it;
372 for ( it = allList.begin(); it != allList.end(); ++it ){ 402 for ( it = allList.begin(); it != allList.end(); ++it ){
373 qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); 403 qWarning("Adding Contact from: %s", (*it).fullName().latin1() );
374 if ( doAsk ){ 404 if ( doAsk ){
375 switch( QMessageBox::information( this, tr ( "Add Contact?" ), 405 switch( QMessageBox::information( this, tr ( "Add Contact?" ),
376 tr( "Do you really want add contact for \n%1?" ) 406 tr( "Do you really want add contact for \n%1?" )
377 .arg( (*it).fullName().latin1() ), 407 .arg( (*it).fullName().latin1() ),
378 tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"), 408 tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"),
379 0, // Enter == button 0 409 0, // Enter == button 0
380 2 ) ) { // Escape == button 2 410 2 ) ) { // Escape == button 2
381 case 0: 411 case 0:
382 qWarning("YES clicked"); 412 qWarning("YES clicked");
383 m_abView->addEntry( *it ); 413 m_abView->addEntry( *it );
384 break; 414 break;
385 case 1: 415 case 1:
386 qWarning("NO clicked"); 416 qWarning("NO clicked");
387 break; 417 break;
388 case 2: 418 case 2:
389 qWarning("YesAll clicked"); 419 qWarning("YesAll clicked");
390 doAsk = false; 420 doAsk = false;
391 break; 421 break;
392 } 422 }
393 }else 423 }else
394 m_abView->addEntry( *it ); 424 m_abView->addEntry( *it );
395 425
396 } 426 }
397 427
398 delete access; 428 delete access;
399} 429}
400 430
401void AddressbookWindow::resizeEvent( QResizeEvent *e ) 431void AddressbookWindow::resizeEvent( QResizeEvent *e )
402{ 432{
403 QMainWindow::resizeEvent( e ); 433 QMainWindow::resizeEvent( e );
404 434
405 435
406} 436}
407 437
408AddressbookWindow::~AddressbookWindow() 438AddressbookWindow::~AddressbookWindow()
409{ 439{
410 ToolBarDock dock; 440 ToolBarDock dock;
411 int dummy; 441 int dummy;
412 bool bDummy; 442 bool bDummy;
413 getLocation ( listTools, dock, dummy, bDummy, dummy ); 443 getLocation ( listTools, dock, dummy, bDummy, dummy );
414 m_config.setToolBarDock( dock ); 444 m_config.setToolBarDock( dock );
415 m_config.save(); 445 m_config.save();
416} 446}
417 447
418void AddressbookWindow::slotUpdateToolbar() 448void AddressbookWindow::slotUpdateToolbar()
419{ 449{
420 OContact ce = m_abView->currentEntry(); 450 OContact ce = m_abView->currentEntry();
421 actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); 451 actionMail->setEnabled( !ce.defaultEmail().isEmpty() );
422} 452}
423 453
424void AddressbookWindow::slotListNew() 454void AddressbookWindow::slotListNew()
425{ 455{
426 OContact cnt; 456 OContact cnt;
427 if( !syncing ) { 457 if( !syncing ) {
428 editEntry( NewEntry ); 458 editEntry( NewEntry );
429 } else { 459 } else {
430 QMessageBox::warning(this, tr("Contacts"), 460 QMessageBox::warning(this, tr("Contacts"),
431 tr("Can not edit data, currently syncing")); 461 tr("Can not edit data, currently syncing"));
432 } 462 }
433} 463}
434 464
435// void AddressbookWindow::slotListView() 465// void AddressbookWindow::slotListView()
436// { 466// {
437 // m_abView -> init( abList->currentEntry() ); 467 // m_abView -> init( abList->currentEntry() );
438 // // :SX mView->sync(); 468 // // :SX mView->sync();
439 // //:SXshowView(); 469 // //:SXshowView();
440// } 470// }
441 471
442void AddressbookWindow::slotListDelete() 472void AddressbookWindow::slotListDelete()
443{ 473{
444 if(!syncing) { 474 if(!syncing) {
445 OContact tmpEntry = m_abView ->currentEntry(); 475 OContact tmpEntry = m_abView ->currentEntry();
446 476
447 // get a name, do the best we can... 477 // get a name, do the best we can...
448 QString strName = tmpEntry.fullName(); 478 QString strName = tmpEntry.fullName();
449 if ( strName.isEmpty() ) { 479 if ( strName.isEmpty() ) {
450 strName = tmpEntry.company(); 480 strName = tmpEntry.company();
451 if ( strName.isEmpty() ) 481 if ( strName.isEmpty() )
452 strName = "No Name"; 482 strName = "No Name";
453 } 483 }
454 484
455 485
456 if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), 486 if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ),
457 strName ) ) { 487 strName ) ) {
458 m_abView->removeEntry( tmpEntry.uid() ); 488 m_abView->removeEntry( tmpEntry.uid() );
459 } 489 }
460 } else { 490 } else {
461 QMessageBox::warning( this, tr("Contacts"), 491 QMessageBox::warning( this, tr("Contacts"),
diff --git a/core/pim/addressbook/addressbook.h b/core/pim/addressbook/addressbook.h
index 69fe2f8..f7a560a 100644
--- a/core/pim/addressbook/addressbook.h
+++ b/core/pim/addressbook/addressbook.h
@@ -1,135 +1,136 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qt Palmtop Environment. 4** This file is part of Qt 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging 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** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef Addressbook_H 20#ifndef Addressbook_H
21#define Addressbook_H 21#define Addressbook_H
22 22
23// Remove this for OPIE releae 1.0 ! 23// Remove this for OPIE releae 1.0 !
24#define __DEBUG_RELEASE 24// #define __DEBUG_RELEASE
25 25
26#include <qmainwindow.h> 26#include <qmainwindow.h>
27#include <qvaluelist.h> 27#include <qvaluelist.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include "ofloatbar.h" 30#include "ofloatbar.h"
31#include "abview.h" 31#include "abview.h"
32#include "abconfig.h" 32#include "abconfig.h"
33 33
34class ContactEditor; 34class ContactEditor;
35class AbLabel; 35class AbLabel;
36class AbTable; 36class AbTable;
37class QPEToolBar; 37class QPEToolBar;
38class QPopupMenu; 38class QPopupMenu;
39class QToolButton; 39class QToolButton;
40class QDialog; 40class QDialog;
41class Ir; 41class Ir;
42class QAction; 42class QAction;
43class LetterPicker; 43class LetterPicker;
44 44
45class AddressbookWindow: public QMainWindow 45class AddressbookWindow: public QMainWindow
46{ 46{
47 Q_OBJECT 47 Q_OBJECT
48public: 48public:
49 enum EntryMode { NewEntry=0, EditEntry }; 49 enum EntryMode { NewEntry=0, EditEntry };
50 50
51 AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 51 AddressbookWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
52 ~AddressbookWindow(); 52 ~AddressbookWindow();
53 53
54protected: 54protected:
55 void resizeEvent( QResizeEvent * e ); 55 void resizeEvent( QResizeEvent * e );
56 56
57 void editPersonal(); 57 void editPersonal();
58 void editEntry( EntryMode ); 58 void editEntry( EntryMode );
59 void closeEvent( QCloseEvent *e ); 59 void closeEvent( QCloseEvent *e );
60 bool save(); 60 bool save();
61 61
62public slots: 62public slots:
63 void flush(); 63 void flush();
64 void reload(); 64 void reload();
65 void appMessage(const QCString &, const QByteArray &); 65 void appMessage(const QCString &, const QByteArray &);
66 void setDocument( const QString & ); 66 void setDocument( const QString & );
67#ifdef __DEBUG_RELEASE 67#ifdef __DEBUG_RELEASE
68 void slotSave(); 68 // void slotSave();
69#endif 69#endif
70 70
71private slots: 71private slots:
72 void importvCard(); 72 void importvCard();
73 void exportvCard();
73 void slotListNew(); 74 void slotListNew();
74 /* void slotListView(); */ 75 /* void slotListView(); */
75 void slotListDelete(); 76 void slotListDelete();
76 void slotViewBack(); 77 void slotViewBack();
77 void slotViewEdit(); 78 void slotViewEdit();
78 void slotPersonalView(); 79 void slotPersonalView();
79 void listIsEmpty( bool ); 80 void listIsEmpty( bool );
80 /* void slotSettings(); */ 81 /* void slotSettings(); */
81 void writeMail(); 82 void writeMail();
82 void slotBeam(); 83 void slotBeam();
83 void beamDone( Ir * ); 84 void beamDone( Ir * );
84 void slotSetCategory( int ); 85 void slotSetCategory( int );
85 void slotSetLetter( char ); 86 void slotSetLetter( char );
86 void slotUpdateToolbar(); 87 void slotUpdateToolbar();
87 void slotSetFont(int); 88 void slotSetFont(int);
88 89
89 void slotFindOpen(); 90 void slotFindOpen();
90 void slotFindClose(); 91 void slotFindClose();
91 void slotFind(); 92 void slotFind();
92 void slotNotFound(); 93 void slotNotFound();
93 void slotWrapAround(); 94 void slotWrapAround();
94 95
95 void slotViewSwitched( int ); 96 void slotViewSwitched( int );
96 void slotListView(); 97 void slotListView();
97 void slotCardView(); 98 void slotCardView();
98 99
99 void slotConfig(); 100 void slotConfig();
100 101
101private: 102private:
102 void populateCategories(); 103 void populateCategories();
103 104
104 QPopupMenu *catMenu; 105 QPopupMenu *catMenu;
105 QPEToolBar *listTools; 106 QPEToolBar *listTools;
106 QToolButton *deleteButton; 107 QToolButton *deleteButton;
107 enum Panes { paneList=0, paneView, paneEdit }; 108 enum Panes { paneList=0, paneView, paneEdit };
108 ContactEditor *abEditor; 109 ContactEditor *abEditor;
109 LetterPicker *pLabel; 110 LetterPicker *pLabel;
110 AbView* m_abView; 111 AbView* m_abView;
111 QWidget *listContainer; 112 QWidget *listContainer;
112 113
113 // Searching stuff 114 // Searching stuff
114 OFloatBar* searchBar; 115 OFloatBar* searchBar;
115 QLineEdit* searchEdit; 116 QLineEdit* searchEdit;
116 117
117 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail; 118 QAction *actionNew, *actionEdit, *actionTrash, *actionFind, *actionBeam, *actionPersonal, *actionMail;
118 119
119 int viewMargin; 120 int viewMargin;
120 121
121 bool syncing; 122 bool syncing;
122 QFont *defaultFont; 123 QFont *defaultFont;
123 int m_curFontSize; 124 int m_curFontSize;
124 125
125 bool isLoading; 126 bool isLoading;
126 127
127 AbConfig m_config; 128 AbConfig m_config;
128 129
129 QAction* m_tableViewButton; 130 QAction* m_tableViewButton;
130 QAction* m_cardViewButton; 131 QAction* m_cardViewButton;
131 132
132 int active_view; 133 int active_view;
133}; 134};
134 135
135#endif 136#endif
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index df97b85..f33ee0a 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1131,257 +1131,259 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1131 QString strTitle; 1131 QString strTitle;
1132 int commapos; 1132 int commapos;
1133 bool haveLastName = false; 1133 bool haveLastName = false;
1134 1134
1135 qWarning("Fullname: %s", simplifiedName.latin1()); 1135 qWarning("Fullname: %s", simplifiedName.latin1());
1136 1136
1137 commapos = simplifiedName.find( ',', 0, TRUE); 1137 commapos = simplifiedName.find( ',', 0, TRUE);
1138 if ( commapos >= 0 ) { 1138 if ( commapos >= 0 ) {
1139 qWarning(" Commapos: %d", commapos ); 1139 qWarning(" Commapos: %d", commapos );
1140 1140
1141 // A comma (",") separates the lastname from one or 1141 // A comma (",") separates the lastname from one or
1142 // many first names. Thus, remove the lastname from the 1142 // many first names. Thus, remove the lastname from the
1143 // String and parse the firstnames. 1143 // String and parse the firstnames.
1144 1144
1145 strLastName = simplifiedName.left( commapos ); 1145 strLastName = simplifiedName.left( commapos );
1146 simplifiedName= simplifiedName.mid( commapos + 1 ); 1146 simplifiedName= simplifiedName.mid( commapos + 1 );
1147 haveLastName = true; 1147 haveLastName = true;
1148 qWarning("Fullname without ',': %s", simplifiedName.latin1()); 1148 qWarning("Fullname without ',': %s", simplifiedName.latin1());
1149 1149
1150 // If we have any lastname, we should now split all first names. 1150 // If we have any lastname, we should now split all first names.
1151 // The first one will be the used as first, the rest as "middle names" 1151 // The first one will be the used as first, the rest as "middle names"
1152 1152
1153 QStringList allFirstNames = QStringList::split(" ", simplifiedName); 1153 QStringList allFirstNames = QStringList::split(" ", simplifiedName);
1154 QStringList::Iterator it = allFirstNames.begin(); 1154 QStringList::Iterator it = allFirstNames.begin();
1155 strFirstName = *it++; 1155 strFirstName = *it++;
1156 QStringList allSecondNames; 1156 QStringList allSecondNames;
1157 for ( ; it != allFirstNames.end(); ++it ) 1157 for ( ; it != allFirstNames.end(); ++it )
1158 allSecondNames.append( *it ); 1158 allSecondNames.append( *it );
1159 1159
1160 strMiddleName = allSecondNames.join(" "); 1160 strMiddleName = allSecondNames.join(" ");
1161 1161
1162 } else { 1162 } else {
1163 1163
1164 // No comma separator used: We use the first word as firstname, the 1164 // No comma separator used: We use the first word as firstname, the
1165 // last as second/lastname and everything in the middle as middlename 1165 // last as second/lastname and everything in the middle as middlename
1166 1166
1167 QStringList allNames = QStringList::split(" ", simplifiedName); 1167 QStringList allNames = QStringList::split(" ", simplifiedName);
1168 QStringList::Iterator it = allNames.begin(); 1168 QStringList::Iterator it = allNames.begin();
1169 strFirstName = *it++; 1169 strFirstName = *it++;
1170 QStringList allSecondNames; 1170 QStringList allSecondNames;
1171 for ( ; it != --allNames.end(); ++it ) 1171 for ( ; it != --allNames.end(); ++it )
1172 allSecondNames.append( *it ); 1172 allSecondNames.append( *it );
1173 1173
1174 strMiddleName = allSecondNames.join(" "); 1174 strMiddleName = allSecondNames.join(" ");
1175 strLastName = *(--allNames.end()); 1175 strLastName = *(--allNames.end());
1176 1176
1177 } 1177 }
1178 1178
1179 if ( strFirstName == strLastName ) 1179 if ( strFirstName == strLastName )
1180 strFirstName = ""; 1180 strFirstName = "";
1181 1181
1182 qWarning(" strFirstName: %s", strFirstName.latin1()); 1182 qWarning(" strFirstName: %s", strFirstName.latin1());
1183 qWarning(" strMiddleName: %s", strMiddleName.latin1()); 1183 qWarning(" strMiddleName: %s", strMiddleName.latin1());
1184 qWarning(" strLastName: %s", strLastName.latin1()); 1184 qWarning(" strLastName: %s", strLastName.latin1());
1185 qWarning(" strTitle: %s", strTitle.latin1()); 1185 qWarning(" strTitle: %s", strTitle.latin1());
1186 1186
1187 switch (type) { 1187 switch (type) {
1188 case NAME_FL: 1188 case NAME_FL:
1189 return strFirstName + " " + strLastName; 1189 return strFirstName + " " + strLastName;
1190 1190
1191 case NAME_LF: 1191 case NAME_LF:
1192 return strLastName + ", " + strFirstName; 1192 return strLastName + ", " + strFirstName;
1193 1193
1194 case NAME_LFM: 1194 case NAME_LFM:
1195 return strLastName + ", " + strFirstName + " " + strMiddleName; 1195 return strLastName + ", " + strFirstName + " " + strMiddleName;
1196 1196
1197 case NAME_FML: 1197 case NAME_FML:
1198 return strFirstName + " " + strMiddleName + " " + strLastName ; 1198 return strFirstName + " " + strMiddleName + " " + strLastName ;
1199 1199
1200 case NAME_F: 1200 case NAME_F:
1201 return strFirstName; 1201 return strFirstName;
1202 1202
1203 case NAME_M: 1203 case NAME_M:
1204 return strMiddleName; 1204 return strMiddleName;
1205 1205
1206 case NAME_L: 1206 case NAME_L:
1207 return strLastName; 1207 return strLastName;
1208 1208
1209 case NAME_S: 1209 case NAME_S:
1210 return txtSuffix->text(); 1210 return txtSuffix->text();
1211 1211
1212 } 1212 }
1213 return QString::null; 1213 return QString::null;
1214} 1214}
1215 1215
1216void ContactEditor::cleanupFields() { 1216void ContactEditor::cleanupFields() {
1217 QStringList::Iterator it = slChooserValues.begin(); 1217 QStringList::Iterator it = slChooserValues.begin();
1218 1218
1219 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { 1219 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) {
1220 (*it) = ""; 1220 (*it) = "";
1221 } 1221 }
1222 1222
1223 for ( int i = 0; i < 7; i++ ) { 1223 for ( int i = 0; i < 7; i++ ) {
1224 slHomeAddress[i] = ""; 1224 slHomeAddress[i] = "";
1225 slBusinessAddress[i] = ""; 1225 slBusinessAddress[i] = "";
1226 } 1226 }
1227 1227
1228 QListIterator<QLineEdit> itLV( listValue ); 1228 QListIterator<QLineEdit> itLV( listValue );
1229 for ( ; itLV.current(); ++itLV ) { 1229 for ( ; itLV.current(); ++itLV ) {
1230 (*itLV)->setText( "" ); 1230 (*itLV)->setText( "" );
1231 } 1231 }
1232 1232
1233 txtFirstName->setText(""); 1233 txtFirstName->setText("");
1234 txtMiddleName->setText(""); 1234 txtMiddleName->setText("");
1235 txtLastName->setText(""); 1235 txtLastName->setText("");
1236 txtSuffix->setText(""); 1236 txtSuffix->setText("");
1237 txtNote->setText(""); 1237 txtNote->setText("");
1238 txtFullName->setText(""); 1238 txtFullName->setText("");
1239 txtJobTitle->setText(""); 1239 txtJobTitle->setText("");
1240 txtOrganization->setText(""); 1240 txtOrganization->setText("");
1241 txtChooserField1->setText(""); 1241 txtChooserField1->setText("");
1242 txtChooserField2->setText(""); 1242 txtChooserField2->setText("");
1243 txtChooserField3->setText(""); 1243 txtChooserField3->setText("");
1244 txtAddress->setText(""); 1244 txtAddress->setText("");
1245 txtCity->setText(""); 1245 txtCity->setText("");
1246 txtState->setText(""); 1246 txtState->setText("");
1247 txtZip->setText(""); 1247 txtZip->setText("");
1248 QLineEdit *txtTmp = cmbCountry->lineEdit(); 1248 QLineEdit *txtTmp = cmbCountry->lineEdit();
1249 txtTmp->setText(""); 1249 txtTmp->setText("");
1250 txtTmp = cmbFileAs->lineEdit(); 1250 txtTmp = cmbFileAs->lineEdit();
1251 txtTmp->setText(""); 1251 txtTmp->setText("");
1252 1252
1253} 1253}
1254 1254
1255void ContactEditor::setEntry( const OContact &entry ) { 1255void ContactEditor::setEntry( const OContact &entry ) {
1256 1256
1257 initializing = true; 1257 initializing = true;
1258 1258
1259 // Cleanup and activate the general Page ..
1259 cleanupFields(); 1260 cleanupFields();
1261 tabMain->setCurrentPage( 0 );
1260 1262
1261 ent = entry; 1263 ent = entry;
1262 1264
1263 emails = QStringList(ent.emailList()); 1265 emails = QStringList(ent.emailList());
1264 defaultEmail = ent.defaultEmail(); 1266 defaultEmail = ent.defaultEmail();
1265 if (defaultEmail.isEmpty()) defaultEmail = emails[0]; 1267 if (defaultEmail.isEmpty()) defaultEmail = emails[0];
1266 qDebug("default email=%s",defaultEmail.latin1()); 1268 qDebug("default email=%s",defaultEmail.latin1());
1267 1269
1268 txtFirstName->setText( ent.firstName() ); 1270 txtFirstName->setText( ent.firstName() );
1269 txtMiddleName->setText( ent.middleName() ); 1271 txtMiddleName->setText( ent.middleName() );
1270 txtLastName->setText( ent.lastName() ); 1272 txtLastName->setText( ent.lastName() );
1271 txtSuffix->setText( ent.suffix() ); 1273 txtSuffix->setText( ent.suffix() );
1272 1274
1273 // QString *tmpString = new QString; 1275 // QString *tmpString = new QString;
1274 // *tmpString = ent.firstName() + " " + ent.middleName() + 1276 // *tmpString = ent.firstName() + " " + ent.middleName() +
1275 // + " " + ent.lastName() + " " + ent.suffix(); 1277 // + " " + ent.lastName() + " " + ent.suffix();
1276 //txtFullName->setText( tmpString->simplifyWhiteSpace() ); 1278 //txtFullName->setText( tmpString->simplifyWhiteSpace() );
1277 1279
1278 if ( !ent.isEmpty() ){ 1280 if ( !ent.isEmpty() ){
1279 // Lastnames with multiple words need to be protected by a comma ! 1281 // Lastnames with multiple words need to be protected by a comma !
1280 if ( ent.lastName().contains( ' ', TRUE ) ) 1282 if ( ent.lastName().contains( ' ', TRUE ) )
1281 txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); 1283 txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() );
1282 else 1284 else
1283 txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); 1285 txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() );
1284 } 1286 }
1285 1287
1286 cmbFileAs->setEditText( ent.fileAs() ); 1288 cmbFileAs->setEditText( ent.fileAs() );
1287 1289
1288 //if (hasTitle) 1290 //if (hasTitle)
1289 txtJobTitle->setText( ent.jobTitle() ); 1291 txtJobTitle->setText( ent.jobTitle() );
1290 1292
1291 //if (hasCompany) 1293 //if (hasCompany)
1292 txtOrganization->setText( ent.company() ); 1294 txtOrganization->setText( ent.company() );
1293 1295
1294 //if (hasNotes) 1296 //if (hasNotes)
1295 txtNote->setText( ent.notes() ); 1297 txtNote->setText( ent.notes() );
1296 1298
1297 //if (hasStreet) { 1299 //if (hasStreet) {
1298 slHomeAddress[0] = ent.homeStreet(); 1300 slHomeAddress[0] = ent.homeStreet();
1299 slBusinessAddress[0] = ent.businessStreet(); 1301 slBusinessAddress[0] = ent.businessStreet();
1300 //} 1302 //}
1301 1303
1302 //if (hasCity) { 1304 //if (hasCity) {
1303 slHomeAddress[3] = ent.homeCity(); 1305 slHomeAddress[3] = ent.homeCity();
1304 slBusinessAddress[3] = ent.businessCity(); 1306 slBusinessAddress[3] = ent.businessCity();
1305 //} 1307 //}
1306 1308
1307 //if (hasState) { 1309 //if (hasState) {
1308 slHomeAddress[4] = ent.homeState(); 1310 slHomeAddress[4] = ent.homeState();
1309 slBusinessAddress[4] = ent.businessState(); 1311 slBusinessAddress[4] = ent.businessState();
1310 //} 1312 //}
1311 1313
1312 //if (hasZip) { 1314 //if (hasZip) {
1313 slHomeAddress[5] = ent.homeZip(); 1315 slHomeAddress[5] = ent.homeZip();
1314 slBusinessAddress[5] = ent.businessZip(); 1316 slBusinessAddress[5] = ent.businessZip();
1315 //} 1317 //}
1316 1318
1317 //if (hasCountry) { 1319 //if (hasCountry) {
1318 slHomeAddress[6] = ent.homeCountry(); 1320 slHomeAddress[6] = ent.homeCountry();
1319 slBusinessAddress[6] = ent.businessCountry(); 1321 slBusinessAddress[6] = ent.businessCountry();
1320 //} 1322 //}
1321 1323
1322 QStringList::ConstIterator it; 1324 QStringList::ConstIterator it;
1323 QListIterator<QLineEdit> itLE( listValue ); 1325 QListIterator<QLineEdit> itLE( listValue );
1324 for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { 1326 for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) {
1325 1327
1326 qWarning(" Filling dynamic Field: %s", (*it).latin1() ); 1328 qWarning(" Filling dynamic Field: %s", (*it).latin1() );
1327 1329
1328 if ( *it == "Department" ) 1330 if ( *it == "Department" )
1329 (*itLE)->setText( ent.department() ); 1331 (*itLE)->setText( ent.department() );
1330 1332
1331 if ( *it == "Company" ) 1333 if ( *it == "Company" )
1332 (*itLE)->setText( ent.company() ); 1334 (*itLE)->setText( ent.company() );
1333 1335
1334 if ( *it == "Office" ) 1336 if ( *it == "Office" )
1335 (*itLE)->setText( ent.office() ); 1337 (*itLE)->setText( ent.office() );
1336 1338
1337 if ( *it == "Profession" ) 1339 if ( *it == "Profession" )
1338 (*itLE)->setText( ent.profession() ); 1340 (*itLE)->setText( ent.profession() );
1339 1341
1340 if ( *it == "Assistant" ) 1342 if ( *it == "Assistant" )
1341 (*itLE)->setText( ent.assistant() ); 1343 (*itLE)->setText( ent.assistant() );
1342 1344
1343 if ( *it == "Manager" ) 1345 if ( *it == "Manager" )
1344 (*itLE)->setText( ent.manager() ); 1346 (*itLE)->setText( ent.manager() );
1345 1347
1346 if ( *it == "Spouse" ) 1348 if ( *it == "Spouse" )
1347 (*itLE)->setText( ent.spouse() ); 1349 (*itLE)->setText( ent.spouse() );
1348 1350
1349 if ( *it == "Nickname" ){ 1351 if ( *it == "Nickname" ){
1350 qWarning("**** Nichname: %s", ent.nickname().latin1() ); 1352 qWarning("**** Nichname: %s", ent.nickname().latin1() );
1351 (*itLE)->setText( ent.nickname() ); 1353 (*itLE)->setText( ent.nickname() );
1352 } 1354 }
1353 1355
1354 if ( *it == "Children" ) 1356 if ( *it == "Children" )
1355 (*itLE)->setText( ent.children() ); 1357 (*itLE)->setText( ent.children() );
1356 1358
1357 } 1359 }
1358 1360
1359 QStringList::Iterator itV; 1361 QStringList::Iterator itV;
1360 for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) { 1362 for ( it = slChooserNames.begin(), itV = slChooserValues.begin(); it != slChooserNames.end(); ++it, ++itV ) {
1361 1363
1362 if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) ) 1364 if ( ( *it == "Business Phone") || ( *it == "Work Phone" ) )
1363 *itV = ent.businessPhone(); 1365 *itV = ent.businessPhone();
1364 /* 1366 /*
1365 if ( *it == "Business 2 Phone" ) 1367 if ( *it == "Business 2 Phone" )
1366 *itV = ent.business2Phone(); 1368 *itV = ent.business2Phone();
1367 */ 1369 */
1368 if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) ) 1370 if ( ( *it == "Business Fax") || ( *it == "Work Fax" ) )
1369 *itV = ent.businessFax(); 1371 *itV = ent.businessFax();
1370 1372
1371 if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) ) 1373 if ( ( *it == "Business Mobile" ) || ( *it == "work Mobile" ) )
1372 *itV = ent.businessMobile(); 1374 *itV = ent.businessMobile();
1373 /* 1375 /*
1374 if ( *it == "Company Phone" ) 1376 if ( *it == "Company Phone" )
1375 *itV = ent.companyPhone(); 1377 *itV = ent.companyPhone();
1376 */ 1378 */
1377 if ( *it == "Default Email" ) 1379 if ( *it == "Default Email" )
1378 *itV = ent.defaultEmail(); 1380 *itV = ent.defaultEmail();
1379 1381
1380 if ( *it == "Emails" ) 1382 if ( *it == "Emails" )
1381 *itV = ent.emailList().join(", "); // :SX 1383 *itV = ent.emailList().join(", "); // :SX
1382 1384
1383 if ( *it == "Home Phone" ) 1385 if ( *it == "Home Phone" )
1384 *itV = ent.homePhone(); 1386 *itV = ent.homePhone();
1385 /* 1387 /*
1386 if ( *it == "Home 2 Phone" ) 1388 if ( *it == "Home 2 Phone" )
1387 *itV = ent.home2Phone(); 1389 *itV = ent.home2Phone();
diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h
index d590a86..c0465b5 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 "9" 5#define SUBVERSION "9"
6#define PATCHVERSION "3" 6#define PATCHVERSION "4"
7 7
8#define APPNAME "OPIE_ADDRESSBOOK" 8#define APPNAME "OPIE_ADDRESSBOOK"
9 9
10#endif 10#endif