author | drw <drw> | 2004-03-25 23:40:52 (UTC) |
---|---|---|
committer | drw <drw> | 2004-03-25 23:40:52 (UTC) |
commit | 98721c16aa480c4a160d3492462cb8f0de783268 (patch) (unidiff) | |
tree | 2be8dcd6cf985d98912cbb18e5d23e4b567396ff /core/pim/addressbook | |
parent | 03091cd727701bdb2aa6ac623cd606131546d686 (diff) | |
download | opie-98721c16aa480c4a160d3492462cb8f0de783268.zip opie-98721c16aa480c4a160d3492462cb8f0de783268.tar.gz opie-98721c16aa480c4a160d3492462cb8f0de783268.tar.bz2 |
libopie -> libopie2
-rw-r--r-- | core/pim/addressbook/ablabel.cpp | 12 | ||||
-rw-r--r-- | core/pim/addressbook/ablabel.h | 14 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 25 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.h | 19 | ||||
-rw-r--r-- | core/pim/addressbook/abview.cpp | 32 | ||||
-rw-r--r-- | core/pim/addressbook/abview.h | 23 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 58 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.pro | 2 | ||||
-rw-r--r-- | core/pim/addressbook/config.in | 2 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg.cpp | 16 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 21 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 14 | ||||
-rw-r--r-- | core/pim/addressbook/main.cpp | 4 | ||||
-rw-r--r-- | core/pim/addressbook/opie-addressbook.control | 2 |
14 files changed, 123 insertions, 121 deletions
diff --git a/core/pim/addressbook/ablabel.cpp b/core/pim/addressbook/ablabel.cpp index 076e2e0..70a66a0 100644 --- a/core/pim/addressbook/ablabel.cpp +++ b/core/pim/addressbook/ablabel.cpp | |||
@@ -23,54 +23,54 @@ | |||
23 | 23 | ||
24 | 24 | ||
25 | AbLabel::AbLabel( QWidget *parent, const char *name ): | 25 | AbLabel::AbLabel( QWidget *parent, const char *name ): |
26 | QTextView( parent, name ), | 26 | QTextView( parent, name ), |
27 | m_empty( false ) | 27 | m_empty( false ) |
28 | { | 28 | { |
29 | } | 29 | } |
30 | 30 | ||
31 | AbLabel::~AbLabel() | 31 | AbLabel::~AbLabel() |
32 | { | 32 | { |
33 | } | 33 | } |
34 | 34 | ||
35 | void AbLabel::setContacts( const OContactAccess::List& viewList ) | 35 | void AbLabel::setContacts( const Opie::OPimContactAccess::List& viewList ) |
36 | { | 36 | { |
37 | m_viewList = viewList; | 37 | m_viewList = viewList; |
38 | if (m_viewList.count() != 0){ | 38 | if (m_viewList.count() != 0){ |
39 | m_empty = false; | 39 | m_empty = false; |
40 | m_itCurContact = m_viewList.begin(); | 40 | m_itCurContact = m_viewList.begin(); |
41 | sync(); | 41 | sync(); |
42 | }else{ | 42 | }else{ |
43 | // m_itCurContact.clear(); | 43 | // m_itCurContact.clear(); |
44 | m_empty = true; | 44 | m_empty = true; |
45 | setText( "" ); | 45 | setText( "" ); |
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | int AbLabel::currentEntry_UID() | 49 | int AbLabel::currentEntry_UID() |
50 | { | 50 | { |
51 | OContact contact = currentEntry(); | 51 | Opie::OPimContact contact = currentEntry(); |
52 | 52 | ||
53 | if ( contact.isEmpty() ) | 53 | if ( contact.isEmpty() ) |
54 | return 0; | 54 | return 0; |
55 | else | 55 | else |
56 | return ( contact.uid() ); | 56 | return ( contact.uid() ); |
57 | } | 57 | } |
58 | 58 | ||
59 | OContact AbLabel::currentEntry() | 59 | Opie::OPimContact AbLabel::currentEntry() |
60 | { | 60 | { |
61 | if ( ! m_empty ) | 61 | if ( ! m_empty ) |
62 | return ( *m_itCurContact ); | 62 | return ( *m_itCurContact ); |
63 | else | 63 | else |
64 | return OContact(); | 64 | return Opie::OPimContact(); |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | bool AbLabel::selectContact( int UID ) | 68 | bool AbLabel::selectContact( int UID ) |
69 | { | 69 | { |
70 | 70 | ||
71 | for ( int r = 0; r < m_viewList.count(); ++r ) { | 71 | for ( int r = 0; r < m_viewList.count(); ++r ) { |
72 | if ( m_viewList.uidAt( r ) == UID ){ | 72 | if ( m_viewList.uidAt( r ) == UID ){ |
73 | m_itCurContact.setCurrent( r ); | 73 | m_itCurContact.setCurrent( r ); |
74 | break; | 74 | break; |
75 | } | 75 | } |
76 | } | 76 | } |
@@ -100,42 +100,42 @@ void AbLabel::keyPressEvent( QKeyEvent *e ) | |||
100 | qWarning( "Right.."); | 100 | qWarning( "Right.."); |
101 | case Qt::Key_F33: | 101 | case Qt::Key_F33: |
102 | qWarning( "OK.."); | 102 | qWarning( "OK.."); |
103 | emit signalOkPressed(); | 103 | emit signalOkPressed(); |
104 | break; | 104 | break; |
105 | case Qt::Key_Up: | 105 | case Qt::Key_Up: |
106 | qWarning( "UP.."); | 106 | qWarning( "UP.."); |
107 | if ( ( visibleHeight() < contentsHeight() ) && | 107 | if ( ( visibleHeight() < contentsHeight() ) && |
108 | ( verticalScrollBar()->value() > verticalScrollBar()->minValue() ) ) | 108 | ( verticalScrollBar()->value() > verticalScrollBar()->minValue() ) ) |
109 | scrollBy( 0, -(visibleHeight()-20) ); | 109 | scrollBy( 0, -(visibleHeight()-20) ); |
110 | else { | 110 | else { |
111 | --m_itCurContact; | 111 | --m_itCurContact; |
112 | if ( *m_itCurContact != OContact() ) | 112 | if ( *m_itCurContact != Opie::OPimContact() ) |
113 | sync(); | 113 | sync(); |
114 | else | 114 | else |
115 | m_itCurContact = m_viewList.end(); | 115 | m_itCurContact = m_viewList.end(); |
116 | } | 116 | } |
117 | 117 | ||
118 | break; | 118 | break; |
119 | case Qt::Key_Down: | 119 | case Qt::Key_Down: |
120 | qWarning( "DOWN.."); | 120 | qWarning( "DOWN.."); |
121 | // qWarning( "visible: %d, content: %d",visibleHeight(),contentsHeight()); | 121 | // qWarning( "visible: %d, content: %d",visibleHeight(),contentsHeight()); |
122 | // qWarning( "value: %d; barMaxValue: %d", verticalScrollBar()->value() | 122 | // qWarning( "value: %d; barMaxValue: %d", verticalScrollBar()->value() |
123 | // , verticalScrollBar()->maxValue() ); | 123 | // , verticalScrollBar()->maxValue() ); |
124 | if ( ( visibleHeight() < contentsHeight() ) && | 124 | if ( ( visibleHeight() < contentsHeight() ) && |
125 | ( verticalScrollBar()->value() < verticalScrollBar()->maxValue() ) ) | 125 | ( verticalScrollBar()->value() < verticalScrollBar()->maxValue() ) ) |
126 | scrollBy( 0, visibleHeight()-20 ); | 126 | scrollBy( 0, visibleHeight()-20 ); |
127 | else { | 127 | else { |
128 | ++m_itCurContact; | 128 | ++m_itCurContact; |
129 | if ( *m_itCurContact != OContact() ) | 129 | if ( *m_itCurContact != Opie::OPimContact() ) |
130 | sync(); | 130 | sync(); |
131 | else | 131 | else |
132 | m_itCurContact = m_viewList.begin(); | 132 | m_itCurContact = m_viewList.begin(); |
133 | } | 133 | } |
134 | break; | 134 | break; |
135 | case Qt::Key_Return: // fall through | 135 | case Qt::Key_Return: // fall through |
136 | case Qt::Key_Space: // fall through | 136 | case Qt::Key_Space: // fall through |
137 | case Qt::Key_Enter: // we want to switch back | 137 | case Qt::Key_Enter: // we want to switch back |
138 | emit signalOkPressed(); | 138 | emit signalOkPressed(); |
139 | break; | 139 | break; |
140 | default: break; | 140 | default: break; |
141 | } | 141 | } |
diff --git a/core/pim/addressbook/ablabel.h b/core/pim/addressbook/ablabel.h index 80336dc..8d7f2ac 100644 --- a/core/pim/addressbook/ablabel.h +++ b/core/pim/addressbook/ablabel.h | |||
@@ -11,54 +11,54 @@ | |||
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 ABLABEL_H | 20 | #ifndef ABLABEL_H |
21 | #define ABLABEL_H | 21 | #define ABLABEL_H |
22 | 22 | ||
23 | #include <opie/ocontact.h> | 23 | #include <opie2/opimcontact.h> |
24 | #include <qtextview.h> | 24 | #include <opie2/ocontactaccess.h> |
25 | 25 | ||
26 | #include <opie/ocontactaccess.h> | 26 | #include <qtextview.h> |
27 | 27 | ||
28 | class AbLabel : public QTextView | 28 | class AbLabel : public QTextView |
29 | { | 29 | { |
30 | Q_OBJECT | 30 | Q_OBJECT |
31 | 31 | ||
32 | public: | 32 | public: |
33 | AbLabel( QWidget *parent, const char *name = 0 ); | 33 | AbLabel( QWidget *parent, const char *name = 0 ); |
34 | ~AbLabel(); | 34 | ~AbLabel(); |
35 | 35 | ||
36 | // Set the contacts | 36 | // Set the contacts |
37 | void setContacts( const OContactAccess::List& viewList ); | 37 | void setContacts( const Opie::OPimContactAccess::List& viewList ); |
38 | 38 | ||
39 | // Selects a contact | 39 | // Selects a contact |
40 | bool selectContact( int UID ); | 40 | bool selectContact( int UID ); |
41 | 41 | ||
42 | // Get the UID of the current selected Entry | 42 | // Get the UID of the current selected Entry |
43 | int currentEntry_UID(); | 43 | int currentEntry_UID(); |
44 | 44 | ||
45 | // | 45 | // |
46 | OContact currentEntry(); | 46 | Opie::OPimContact currentEntry(); |
47 | 47 | ||
48 | signals: | 48 | signals: |
49 | void signalOkPressed(); | 49 | void signalOkPressed(); |
50 | 50 | ||
51 | protected: | 51 | protected: |
52 | void sync(); | 52 | void sync(); |
53 | void keyPressEvent( QKeyEvent * ); | 53 | void keyPressEvent( QKeyEvent * ); |
54 | 54 | ||
55 | private: | 55 | private: |
56 | OContactAccess::List m_viewList; | 56 | Opie::OPimContactAccess::List m_viewList; |
57 | OContactAccess::List::Iterator m_itCurContact; | 57 | Opie::OPimContactAccess::List::Iterator m_itCurContact; |
58 | 58 | ||
59 | bool m_empty; | 59 | bool m_empty; |
60 | 60 | ||
61 | }; | 61 | }; |
62 | 62 | ||
63 | #endif // ABLABEL_H | 63 | #endif // ABLABEL_H |
64 | 64 | ||
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 29f4383..cd77b13 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -11,30 +11,29 @@ | |||
11 | ** | 11 | ** |
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | 22 | ||
23 | #include <opie2/opimrecordlist.h> | ||
24 | |||
23 | #include <qpe/timestring.h> | 25 | #include <qpe/timestring.h> |
24 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
25 | 27 | ||
26 | #include <opie/orecordlist.h> | ||
27 | |||
28 | |||
29 | #include "abtable.h" | 28 | #include "abtable.h" |
30 | 29 | ||
31 | #include <errno.h> | 30 | #include <errno.h> |
32 | #include <fcntl.h> | 31 | #include <fcntl.h> |
33 | #include <unistd.h> | 32 | #include <unistd.h> |
34 | #include <stdlib.h> | 33 | #include <stdlib.h> |
35 | 34 | ||
36 | #include <ctype.h> //toupper() for key hack | 35 | #include <ctype.h> //toupper() for key hack |
37 | 36 | ||
38 | #if 0 | 37 | #if 0 |
39 | 38 | ||
40 | /*! | 39 | /*! |
@@ -142,35 +141,35 @@ void AbTable::init() | |||
142 | { | 141 | { |
143 | // :SX showChar = '\0'; | 142 | // :SX showChar = '\0'; |
144 | setNumRows( 0 ); | 143 | setNumRows( 0 ); |
145 | setNumCols( 2 ); | 144 | setNumCols( 2 ); |
146 | 145 | ||
147 | horizontalHeader()->setLabel( 0, tr( "Full Name" )); | 146 | horizontalHeader()->setLabel( 0, tr( "Full Name" )); |
148 | horizontalHeader()->setLabel( 1, tr( "Contact" )); | 147 | horizontalHeader()->setLabel( 1, tr( "Contact" )); |
149 | setLeftMargin( 0 ); | 148 | setLeftMargin( 0 ); |
150 | verticalHeader()->hide(); | 149 | verticalHeader()->hide(); |
151 | columnVisible = true; | 150 | columnVisible = true; |
152 | } | 151 | } |
153 | 152 | ||
154 | void AbTable::setContacts( const OContactAccess::List& viewList ) | 153 | void AbTable::setContacts( const Opie::OPimContactAccess::List& viewList ) |
155 | { | 154 | { |
156 | qWarning("AbTable::setContacts()"); | 155 | qWarning("AbTable::setContacts()"); |
157 | 156 | ||
158 | clear(); | 157 | clear(); |
159 | m_viewList = viewList; | 158 | m_viewList = viewList; |
160 | 159 | ||
161 | setSorting( false ); | 160 | setSorting( false ); |
162 | setPaintingEnabled( FALSE ); | 161 | setPaintingEnabled( FALSE ); |
163 | 162 | ||
164 | OContactAccess::List::Iterator it; | 163 | Opie::OPimContactAccess::List::Iterator it; |
165 | setNumRows( m_viewList.count() ); | 164 | setNumRows( m_viewList.count() ); |
166 | //int row = 0; | 165 | //int row = 0; |
167 | // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) | 166 | // for ( it = m_viewList.begin(); it != m_viewList.end(); ++it ) |
168 | // insertIntoTable( *it, row++ ); | 167 | // insertIntoTable( *it, row++ ); |
169 | 168 | ||
170 | // setSorting( true ); | 169 | // setSorting( true ); |
171 | 170 | ||
172 | // resort(); | 171 | // resort(); |
173 | 172 | ||
174 | updateVisible(); | 173 | updateVisible(); |
175 | 174 | ||
176 | setPaintingEnabled( TRUE ); | 175 | setPaintingEnabled( TRUE ); |
@@ -178,25 +177,25 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) | |||
178 | } | 177 | } |
179 | 178 | ||
180 | void AbTable::setOrderedList( const QValueList<int> ordered ) | 179 | void AbTable::setOrderedList( const QValueList<int> ordered ) |
181 | { | 180 | { |
182 | intFields = ordered; | 181 | intFields = ordered; |
183 | } | 182 | } |
184 | 183 | ||
185 | 184 | ||
186 | bool AbTable::selectContact( int UID ) | 185 | bool AbTable::selectContact( int UID ) |
187 | { | 186 | { |
188 | qWarning( "AbTable::selectContact( %d )", UID ); | 187 | qWarning( "AbTable::selectContact( %d )", UID ); |
189 | int rows = numRows(); | 188 | int rows = numRows(); |
190 | OContact* foundContact = 0l; | 189 | Opie::OPimContact* foundContact = 0l; |
191 | bool found = false; | 190 | bool found = false; |
192 | 191 | ||
193 | setPaintingEnabled( FALSE ); | 192 | setPaintingEnabled( FALSE ); |
194 | qWarning( "search start" ); | 193 | qWarning( "search start" ); |
195 | for ( int r = 0; r < rows; ++r ) { | 194 | for ( int r = 0; r < rows; ++r ) { |
196 | if ( m_viewList.uidAt( r ) == UID ){ | 195 | if ( m_viewList.uidAt( r ) == UID ){ |
197 | ensureCellVisible( r, 0 ); | 196 | ensureCellVisible( r, 0 ); |
198 | setCurrentCell( r, 0 ); | 197 | setCurrentCell( r, 0 ); |
199 | found = true; | 198 | found = true; |
200 | break; | 199 | break; |
201 | } | 200 | } |
202 | } | 201 | } |
@@ -204,27 +203,27 @@ bool AbTable::selectContact( int UID ) | |||
204 | 203 | ||
205 | if ( !found ){ | 204 | if ( !found ){ |
206 | ensureCellVisible( 0,0 ); | 205 | ensureCellVisible( 0,0 ); |
207 | setCurrentCell( 0, 0 ); | 206 | setCurrentCell( 0, 0 ); |
208 | } | 207 | } |
209 | 208 | ||
210 | setPaintingEnabled( TRUE ); | 209 | setPaintingEnabled( TRUE ); |
211 | 210 | ||
212 | return true; | 211 | return true; |
213 | } | 212 | } |
214 | 213 | ||
215 | #if 0 | 214 | #if 0 |
216 | void AbTable::insertIntoTable( const OContact& cnt, int row ) | 215 | void AbTable::insertIntoTable( const Opie::OPimContact& cnt, int row ) |
217 | { | 216 | { |
218 | qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); | 217 | qWarning( "void AbTable::insertIntoTable( const Opie::OPimContact& cnt, %d )", row ); |
219 | QString strName; | 218 | QString strName; |
220 | ContactItem contactItem; | 219 | ContactItem contactItem; |
221 | 220 | ||
222 | strName = findContactName( cnt ); | 221 | strName = findContactName( cnt ); |
223 | contactItem = findContactContact( cnt, row ); | 222 | contactItem = findContactContact( cnt, row ); |
224 | 223 | ||
225 | AbTableItem *ati; | 224 | AbTableItem *ati; |
226 | ati = new AbTableItem( this, QTableItem::Never, strName, contactItem.value ); | 225 | ati = new AbTableItem( this, QTableItem::Never, strName, contactItem.value ); |
227 | contactList.insert( ati, cnt ); | 226 | contactList.insert( ati, cnt ); |
228 | setItem( row, 0, ati ); | 227 | setItem( row, 0, ati ); |
229 | ati = new AbTableItem( this, QTableItem::Never, contactItem.value, strName); | 228 | ati = new AbTableItem( this, QTableItem::Never, contactItem.value, strName); |
230 | if ( !contactItem.icon.isNull() ) | 229 | if ( !contactItem.icon.isNull() ) |
@@ -263,25 +262,25 @@ void AbTable::resort() | |||
263 | setPaintingEnabled( FALSE ); | 262 | setPaintingEnabled( FALSE ); |
264 | if ( sorting() ) { | 263 | if ( sorting() ) { |
265 | if ( lastSortCol == -1 ) | 264 | if ( lastSortCol == -1 ) |
266 | lastSortCol = 0; | 265 | lastSortCol = 0; |
267 | sortColumn( lastSortCol, asc, TRUE ); | 266 | sortColumn( lastSortCol, asc, TRUE ); |
268 | //QMessageBox::information( this, "resort", "resort" ); | 267 | //QMessageBox::information( this, "resort", "resort" ); |
269 | updateVisible(); | 268 | updateVisible(); |
270 | } | 269 | } |
271 | setPaintingEnabled( TRUE ); | 270 | setPaintingEnabled( TRUE ); |
272 | #endif | 271 | #endif |
273 | } | 272 | } |
274 | 273 | ||
275 | OContact AbTable::currentEntry() | 274 | Opie::OPimContact AbTable::currentEntry() |
276 | { | 275 | { |
277 | return m_viewList[currentRow()]; | 276 | return m_viewList[currentRow()]; |
278 | } | 277 | } |
279 | 278 | ||
280 | int AbTable::currentEntry_UID() | 279 | int AbTable::currentEntry_UID() |
281 | { | 280 | { |
282 | return ( currentEntry().uid() ); | 281 | return ( currentEntry().uid() ); |
283 | } | 282 | } |
284 | 283 | ||
285 | void AbTable::clear() | 284 | void AbTable::clear() |
286 | { | 285 | { |
287 | qWarning( "void AbTable::clear()" ); | 286 | qWarning( "void AbTable::clear()" ); |
@@ -385,25 +384,25 @@ void AbTable::moveTo( char c ) | |||
385 | if ( first.row() || first.cell() >= c ) | 384 | if ( first.row() || first.cell() >= c ) |
386 | break; | 385 | break; |
387 | r--; | 386 | r--; |
388 | } | 387 | } |
389 | } | 388 | } |
390 | setCurrentCell( r, currentColumn() ); | 389 | setCurrentCell( r, currentColumn() ); |
391 | 390 | ||
392 | #endif | 391 | #endif |
393 | } | 392 | } |
394 | 393 | ||
395 | #if 0 | 394 | #if 0 |
396 | // Useless.. Nobody uses it .. (se) | 395 | // Useless.. Nobody uses it .. (se) |
397 | QString AbTable::findContactName( const OContact &entry ) | 396 | QString AbTable::findContactName( const Opie::OPimContact &entry ) |
398 | { | 397 | { |
399 | // We use the fileAs, then company, defaultEmail | 398 | // We use the fileAs, then company, defaultEmail |
400 | QString str; | 399 | QString str; |
401 | str = entry.fileAs(); | 400 | str = entry.fileAs(); |
402 | if ( str.isEmpty() ) { | 401 | if ( str.isEmpty() ) { |
403 | str = entry.company(); | 402 | str = entry.company(); |
404 | if ( str.isEmpty() ) { | 403 | if ( str.isEmpty() ) { |
405 | str = entry.defaultEmail(); | 404 | str = entry.defaultEmail(); |
406 | } | 405 | } |
407 | } | 406 | } |
408 | return str; | 407 | return str; |
409 | } | 408 | } |
@@ -541,25 +540,25 @@ QStringList AbTable::choiceNames() const | |||
541 | void AbTable::setChoiceSelection( const QValueList<int>& list ) | 540 | void AbTable::setChoiceSelection( const QValueList<int>& list ) |
542 | { | 541 | { |
543 | intFields = list; | 542 | intFields = list; |
544 | } | 543 | } |
545 | 544 | ||
546 | QStringList AbTable::choiceSelection(int /*index*/) const | 545 | QStringList AbTable::choiceSelection(int /*index*/) const |
547 | { | 546 | { |
548 | QStringList r; | 547 | QStringList r; |
549 | /* ###### | 548 | /* ###### |
550 | 549 | ||
551 | QString selname = choicenames.at(index); | 550 | QString selname = choicenames.at(index); |
552 | for (each row) { | 551 | for (each row) { |
553 | OContact *c = contactForRow(row); | 552 | Opie::OPimContact *c = contactForRow(row); |
554 | if ( text(row,2) == selname ) { | 553 | if ( text(row,2) == selname ) { |
555 | r.append(c->email); | 554 | r.append(c->email); |
556 | } | 555 | } |
557 | } | 556 | } |
558 | 557 | ||
559 | */ | 558 | */ |
560 | return r; | 559 | return r; |
561 | } | 560 | } |
562 | 561 | ||
563 | 562 | ||
564 | void AbTable::updateVisible() | 563 | void AbTable::updateVisible() |
565 | { | 564 | { |
@@ -622,25 +621,25 @@ void AbTable::viewportPaintEvent( QPaintEvent* e ) { | |||
622 | //qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); | 621 | //qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); |
623 | if ( enablePainting ) | 622 | if ( enablePainting ) |
624 | QTable::viewportPaintEvent( e ); | 623 | QTable::viewportPaintEvent( e ); |
625 | } | 624 | } |
626 | 625 | ||
627 | void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) { | 626 | void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) { |
628 | const QColorGroup &cg = colorGroup(); | 627 | const QColorGroup &cg = colorGroup(); |
629 | 628 | ||
630 | p->save(); | 629 | p->save(); |
631 | 630 | ||
632 | //qWarning( "Paint row: %d", row ); | 631 | //qWarning( "Paint row: %d", row ); |
633 | 632 | ||
634 | OContact act_contact = m_viewList[row]; | 633 | Opie::OPimContact act_contact = m_viewList[row]; |
635 | 634 | ||
636 | // Paint alternating background bars | 635 | // Paint alternating background bars |
637 | if ( (row % 2 ) == 0 ) { | 636 | if ( (row % 2 ) == 0 ) { |
638 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); | 637 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); |
639 | p->setPen( QPen( cg.text() ) ); | 638 | p->setPen( QPen( cg.text() ) ); |
640 | } | 639 | } |
641 | else { | 640 | else { |
642 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Background ) ); | 641 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Background ) ); |
643 | p->setPen( QPen( cg.buttonText() ) ); | 642 | p->setPen( QPen( cg.buttonText() ) ); |
644 | } | 643 | } |
645 | 644 | ||
646 | QFont f = p->font(); | 645 | QFont f = p->font(); |
@@ -675,25 +674,25 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) | |||
675 | } | 674 | } |
676 | break; | 675 | break; |
677 | 676 | ||
678 | } | 677 | } |
679 | p->restore(); | 678 | p->restore(); |
680 | } | 679 | } |
681 | 680 | ||
682 | void AbTable::rowHeightChanged( int row ) | 681 | void AbTable::rowHeightChanged( int row ) |
683 | { | 682 | { |
684 | if ( enablePainting ) | 683 | if ( enablePainting ) |
685 | QTable::rowHeightChanged( row ); | 684 | QTable::rowHeightChanged( row ); |
686 | } | 685 | } |
687 | ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ ) | 686 | ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* row */ ) |
688 | { | 687 | { |
689 | 688 | ||
690 | ContactItem item; | 689 | ContactItem item; |
691 | 690 | ||
692 | item.value = ""; | 691 | item.value = ""; |
693 | 692 | ||
694 | for ( QValueList<int>::ConstIterator it = intFields.begin(); | 693 | for ( QValueList<int>::ConstIterator it = intFields.begin(); |
695 | it != intFields.end(); ++it ) { | 694 | it != intFields.end(); ++it ) { |
696 | switch ( *it ) { | 695 | switch ( *it ) { |
697 | default: | 696 | default: |
698 | break; | 697 | break; |
699 | case Qtopia::Title: | 698 | case Qtopia::Title: |
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index b9ebe27..927a5a9 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h | |||
@@ -13,27 +13,28 @@ | |||
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #ifndef ABTABLE_H | 22 | #ifndef ABTABLE_H |
23 | #define ABTABLE_H | 23 | #define ABTABLE_H |
24 | 24 | ||
25 | #include <opie2/opimcontact.h> | ||
26 | #include <opie2/ocontactaccess.h> | ||
27 | |||
25 | #include <qpe/categories.h> | 28 | #include <qpe/categories.h> |
26 | #include <opie/ocontact.h> | ||
27 | #include <opie/ocontactaccess.h> | ||
28 | 29 | ||
29 | #include <qmap.h> | 30 | #include <qmap.h> |
30 | #include <qtable.h> | 31 | #include <qtable.h> |
31 | #include <qstringlist.h> | 32 | #include <qstringlist.h> |
32 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
33 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
34 | 35 | ||
35 | #if 0 | 36 | #if 0 |
36 | class AbTableItem : public QTableItem | 37 | class AbTableItem : public QTableItem |
37 | { | 38 | { |
38 | public: | 39 | public: |
39 | AbTableItem( QTable *t, EditType et, const QString &s, | 40 | AbTableItem( QTable *t, EditType et, const QString &s, |
@@ -74,39 +75,39 @@ private: | |||
74 | 75 | ||
75 | #endif | 76 | #endif |
76 | 77 | ||
77 | class AbTable : public QTable | 78 | class AbTable : public QTable |
78 | { | 79 | { |
79 | Q_OBJECT | 80 | Q_OBJECT |
80 | 81 | ||
81 | public: | 82 | public: |
82 | AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); | 83 | AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); |
83 | ~AbTable(); | 84 | ~AbTable(); |
84 | 85 | ||
85 | // Set the contacts shown in the table | 86 | // Set the contacts shown in the table |
86 | void setContacts( const OContactAccess::List& viewList ); | 87 | void setContacts( const Opie::OPimContactAccess::List& viewList ); |
87 | 88 | ||
88 | // Set the list for primary contacts | 89 | // Set the list for primary contacts |
89 | void setOrderedList( const QValueList<int> ordered ); | 90 | void setOrderedList( const QValueList<int> ordered ); |
90 | 91 | ||
91 | // Selects a contact of a specific UID | 92 | // Selects a contact of a specific UID |
92 | bool selectContact( int UID ); | 93 | bool selectContact( int UID ); |
93 | 94 | ||
94 | // Get the current selected entry | 95 | // Get the current selected entry |
95 | OContact currentEntry(); | 96 | Opie::OPimContact currentEntry(); |
96 | 97 | ||
97 | // Get the UID of the current selected Entry | 98 | // Get the UID of the current selected Entry |
98 | int currentEntry_UID(); | 99 | int currentEntry_UID(); |
99 | 100 | ||
100 | // QString findContactName( const OContact &entry ); | 101 | // QString findContactName( const Opie::OPimContact &entry ); |
101 | 102 | ||
102 | void init(); | 103 | void init(); |
103 | void clear(); | 104 | void clear(); |
104 | void refresh(); | 105 | void refresh(); |
105 | 106 | ||
106 | void show(); | 107 | void show(); |
107 | void setPaintingEnabled( bool e ); | 108 | void setPaintingEnabled( bool e ); |
108 | void viewportPaintEvent( QPaintEvent* e); | 109 | void viewportPaintEvent( QPaintEvent* e); |
109 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); | 110 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); |
110 | 111 | ||
111 | // addresspicker mode (What's that ? se) | 112 | // addresspicker mode (What's that ? se) |
112 | // void setChoiceNames( const QStringList& list); | 113 | // void setChoiceNames( const QStringList& list); |
@@ -126,33 +127,33 @@ protected: | |||
126 | // int rowHeight( int ) const; | 127 | // int rowHeight( int ) const; |
127 | // int rowPos( int row ) const; | 128 | // int rowPos( int row ) const; |
128 | // virtual int rowAt( int pos ) const; | 129 | // virtual int rowAt( int pos ) const; |
129 | 130 | ||
130 | 131 | ||
131 | protected slots: | 132 | protected slots: |
132 | void moveTo( char ); | 133 | void moveTo( char ); |
133 | virtual void columnClicked( int col ); | 134 | virtual void columnClicked( int col ); |
134 | void itemClicked(int,int col); | 135 | void itemClicked(int,int col); |
135 | void rowHeightChanged( int row ); | 136 | void rowHeightChanged( int row ); |
136 | 137 | ||
137 | private: | 138 | private: |
138 | // void insertIntoTable( const OContact &cnt, int row ); | 139 | // void insertIntoTable( const Opie::OPimContact &cnt, int row ); |
139 | ContactItem findContactContact( const OContact &entry, int row ); | 140 | ContactItem findContactContact( const Opie::OPimContact &entry, int row ); |
140 | void fitColumns(); | 141 | void fitColumns(); |
141 | void resizeRows(); | 142 | void resizeRows(); |
142 | void realignTable(); | 143 | void realignTable(); |
143 | void resort(); | 144 | void resort(); |
144 | void updateVisible(); | 145 | void updateVisible(); |
145 | 146 | ||
146 | int lastSortCol; | 147 | int lastSortCol; |
147 | bool asc; | 148 | bool asc; |
148 | // QMap<AbTableItem*, OContact> contactList; | 149 | // QMap<AbTableItem*, Opie::OPimContact> contactList; |
149 | QValueList<int> intFields; | 150 | QValueList<int> intFields; |
150 | QStringList choicenames; | 151 | QStringList choicenames; |
151 | bool enablePainting; | 152 | bool enablePainting; |
152 | bool columnVisible; | 153 | bool columnVisible; |
153 | int countNested; | 154 | int countNested; |
154 | 155 | ||
155 | OContactAccess::List m_viewList; | 156 | Opie::OPimContactAccess::List m_viewList; |
156 | 157 | ||
157 | }; | 158 | }; |
158 | #endif // ABTABLE_H | 159 | #endif // ABTABLE_H |
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 8d61582..aa242b7 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -7,29 +7,29 @@ | |||
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 | ** | 14 | ** |
15 | **********************************************************************/ | 15 | **********************************************************************/ |
16 | 16 | ||
17 | #include "abview.h" | 17 | #include "abview.h" |
18 | 18 | ||
19 | #include <qlayout.h> | 19 | #include <opie2/ocontactaccessbackend_vcard.h> |
20 | 20 | ||
21 | #include <qpe/global.h> | 21 | #include <qpe/global.h> |
22 | 22 | ||
23 | #include <opie/ocontactaccessbackend_vcard.h> | 23 | #include <qlayout.h> |
24 | 24 | ||
25 | #include <assert.h> | 25 | #include <assert.h> |
26 | 26 | ||
27 | 27 | ||
28 | // Is defined in LibQPE | 28 | // Is defined in LibQPE |
29 | extern QString categoryFileName(); | 29 | extern QString categoryFileName(); |
30 | 30 | ||
31 | QString addressbookPersonalVCardName() | 31 | QString addressbookPersonalVCardName() |
32 | { | 32 | { |
33 | QString filename = Global::applicationFileName("addressbook", | 33 | QString filename = Global::applicationFileName("addressbook", |
34 | "businesscard.vcf"); | 34 | "businesscard.vcf"); |
35 | return filename; | 35 | return filename; |
@@ -44,25 +44,25 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): | |||
44 | m_curr_category( -1 ), | 44 | m_curr_category( -1 ), |
45 | m_curr_View( TableView ), | 45 | m_curr_View( TableView ), |
46 | m_prev_View( TableView ), | 46 | m_prev_View( TableView ), |
47 | m_curr_Contact ( 0 ), | 47 | m_curr_Contact ( 0 ), |
48 | m_contactdb ( 0l ), | 48 | m_contactdb ( 0l ), |
49 | m_storedDB ( 0l ), | 49 | m_storedDB ( 0l ), |
50 | m_viewStack( 0l ), | 50 | m_viewStack( 0l ), |
51 | m_abTable( 0l ), | 51 | m_abTable( 0l ), |
52 | m_orderedFields( ordered ) | 52 | m_orderedFields( ordered ) |
53 | { | 53 | { |
54 | qWarning("AbView::c'tor"); | 54 | qWarning("AbView::c'tor"); |
55 | // Load default database and handle syncing myself.. ! | 55 | // Load default database and handle syncing myself.. ! |
56 | m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ); | 56 | m_contactdb = new Opie::OPimContactAccess ( "addressbook", 0l, 0l, false ); |
57 | m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available | 57 | m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available |
58 | mCat.load( categoryFileName() ); | 58 | mCat.load( categoryFileName() ); |
59 | 59 | ||
60 | // Create Layout and put WidgetStack into it. | 60 | // Create Layout and put WidgetStack into it. |
61 | QVBoxLayout *vb = new QVBoxLayout( this ); | 61 | QVBoxLayout *vb = new QVBoxLayout( this ); |
62 | m_viewStack = new QWidgetStack( this ); | 62 | m_viewStack = new QWidgetStack( this ); |
63 | vb->addWidget( m_viewStack ); | 63 | vb->addWidget( m_viewStack ); |
64 | 64 | ||
65 | // Creat TableView | 65 | // Creat TableView |
66 | QVBox* tableBox = new QVBox( m_viewStack ); | 66 | QVBox* tableBox = new QVBox( m_viewStack ); |
67 | m_abTable = new AbTable( m_orderedFields, tableBox, "table" ); | 67 | m_abTable = new AbTable( m_orderedFields, tableBox, "table" ); |
68 | m_abTable->setCurrentCell( 0, 0 ); | 68 | m_abTable->setCurrentCell( 0, 0 ); |
@@ -95,49 +95,49 @@ AbView::~AbView() | |||
95 | delete m_storedDB; | 95 | delete m_storedDB; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | void AbView::setView( Views view ) | 100 | void AbView::setView( Views view ) |
101 | { | 101 | { |
102 | qWarning("AbView::setView( Views view )"); | 102 | qWarning("AbView::setView( Views view )"); |
103 | m_curr_View = view; | 103 | m_curr_View = view; |
104 | load(); | 104 | load(); |
105 | } | 105 | } |
106 | 106 | ||
107 | void AbView::addEntry( const OContact &newContact ) | 107 | void AbView::addEntry( const Opie::OPimContact &newContact ) |
108 | { | 108 | { |
109 | qWarning("abview:AddContact"); | 109 | qWarning("abview:AddContact"); |
110 | m_contactdb->add ( newContact ); | 110 | m_contactdb->add ( newContact ); |
111 | load(); | 111 | load(); |
112 | 112 | ||
113 | } | 113 | } |
114 | void AbView::removeEntry( const int UID ) | 114 | void AbView::removeEntry( const int UID ) |
115 | { | 115 | { |
116 | qWarning("abview:RemoveContact"); | 116 | qWarning("abview:RemoveContact"); |
117 | m_contactdb->remove( UID ); | 117 | m_contactdb->remove( UID ); |
118 | load(); | 118 | load(); |
119 | } | 119 | } |
120 | 120 | ||
121 | void AbView::replaceEntry( const OContact &contact ) | 121 | void AbView::replaceEntry( const Opie::OPimContact &contact ) |
122 | { | 122 | { |
123 | qWarning("abview:ReplaceContact"); | 123 | qWarning("abview:ReplaceContact"); |
124 | m_contactdb->replace( contact ); | 124 | m_contactdb->replace( contact ); |
125 | load(); | 125 | load(); |
126 | 126 | ||
127 | } | 127 | } |
128 | 128 | ||
129 | OContact AbView::currentEntry() | 129 | Opie::OPimContact AbView::currentEntry() |
130 | { | 130 | { |
131 | OContact currentContact; | 131 | Opie::OPimContact currentContact; |
132 | 132 | ||
133 | switch ( (int) m_curr_View ) { | 133 | switch ( (int) m_curr_View ) { |
134 | case TableView: | 134 | case TableView: |
135 | currentContact = m_abTable -> currentEntry(); | 135 | currentContact = m_abTable -> currentEntry(); |
136 | break; | 136 | break; |
137 | case CardView: | 137 | case CardView: |
138 | currentContact = m_ablabel -> currentEntry(); | 138 | currentContact = m_ablabel -> currentEntry(); |
139 | break; | 139 | break; |
140 | } | 140 | } |
141 | m_curr_Contact = currentContact.uid(); | 141 | m_curr_Contact = currentContact.uid(); |
142 | return currentContact; | 142 | return currentContact; |
143 | } | 143 | } |
@@ -219,48 +219,48 @@ void AbView::setShowToView( Views view ) | |||
219 | 219 | ||
220 | updateView(); | 220 | updateView(); |
221 | } | 221 | } |
222 | 222 | ||
223 | } | 223 | } |
224 | 224 | ||
225 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) | 225 | void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode ) |
226 | { | 226 | { |
227 | qWarning("void AbView::setShowByLetter( %c, %d )", c, mode ); | 227 | qWarning("void AbView::setShowByLetter( %c, %d )", c, mode ); |
228 | 228 | ||
229 | assert( mode < AbConfig::LASTELEMENT ); | 229 | assert( mode < AbConfig::LASTELEMENT ); |
230 | 230 | ||
231 | OContact query; | 231 | Opie::OPimContact query; |
232 | if ( c == 0 ){ | 232 | if ( c == 0 ){ |
233 | load(); | 233 | load(); |
234 | return; | 234 | return; |
235 | }else{ | 235 | }else{ |
236 | // If the current Backend is unable to solve the query, we will | 236 | // If the current Backend is unable to solve the query, we will |
237 | // ignore the request .. | 237 | // ignore the request .. |
238 | if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){ | 238 | if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ) ){ |
239 | return; | 239 | return; |
240 | } | 240 | } |
241 | 241 | ||
242 | switch( mode ){ | 242 | switch( mode ){ |
243 | case AbConfig::LastName: | 243 | case AbConfig::LastName: |
244 | query.setLastName( QString("%1*").arg(c) ); | 244 | query.setLastName( QString("%1*").arg(c) ); |
245 | break; | 245 | break; |
246 | case AbConfig::FileAs: | 246 | case AbConfig::FileAs: |
247 | query.setFileAs( QString("%1*").arg(c) ); | 247 | query.setFileAs( QString("%1*").arg(c) ); |
248 | break; | 248 | break; |
249 | default: | 249 | default: |
250 | qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode ); | 250 | qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode ); |
251 | qWarning( "I will ignore it.." ); | 251 | qWarning( "I will ignore it.." ); |
252 | return; | 252 | return; |
253 | } | 253 | } |
254 | m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); | 254 | m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ); |
255 | if ( m_curr_category != -1 ) | 255 | if ( m_curr_category != -1 ) |
256 | clearForCategory(); | 256 | clearForCategory(); |
257 | m_curr_Contact = 0; | 257 | m_curr_Contact = 0; |
258 | } | 258 | } |
259 | updateView( true ); | 259 | updateView( true ); |
260 | } | 260 | } |
261 | 261 | ||
262 | void AbView::setListOrder( const QValueList<int>& ordered ) | 262 | void AbView::setListOrder( const QValueList<int>& ordered ) |
263 | { | 263 | { |
264 | m_orderedFields = ordered; | 264 | m_orderedFields = ordered; |
265 | if ( m_abTable ){ | 265 | if ( m_abTable ){ |
266 | m_abTable->setOrderedList( ordered ); | 266 | m_abTable->setOrderedList( ordered ); |
@@ -280,27 +280,27 @@ void AbView::showPersonal( bool personal ) | |||
280 | qWarning ("void AbView::showPersonal( %d )", personal); | 280 | qWarning ("void AbView::showPersonal( %d )", personal); |
281 | 281 | ||
282 | if ( personal ){ | 282 | if ( personal ){ |
283 | 283 | ||
284 | if ( m_inPersonal ) | 284 | if ( m_inPersonal ) |
285 | return; | 285 | return; |
286 | 286 | ||
287 | // Now switch to vCard Backend and load data. | 287 | // Now switch to vCard Backend and load data. |
288 | // The current default backend will be stored | 288 | // The current default backend will be stored |
289 | // to avoid unneeded load/stores. | 289 | // to avoid unneeded load/stores. |
290 | m_storedDB = m_contactdb; | 290 | m_storedDB = m_contactdb; |
291 | 291 | ||
292 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 292 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
293 | addressbookPersonalVCardName() ); | 293 | addressbookPersonalVCardName() ); |
294 | m_contactdb = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 294 | m_contactdb = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
295 | 295 | ||
296 | m_inPersonal = true; | 296 | m_inPersonal = true; |
297 | m_curr_View = CardView; | 297 | m_curr_View = CardView; |
298 | 298 | ||
299 | }else{ | 299 | }else{ |
300 | 300 | ||
301 | if ( !m_inPersonal ) | 301 | if ( !m_inPersonal ) |
302 | return; | 302 | return; |
303 | 303 | ||
304 | // Remove vCard Backend and restore default | 304 | // Remove vCard Backend and restore default |
305 | m_contactdb->save(); | 305 | m_contactdb->save(); |
306 | delete m_contactdb; | 306 | delete m_contactdb; |
@@ -392,42 +392,42 @@ void AbView::slotSwitch(){ | |||
392 | qWarning("Switching to TableView"); | 392 | qWarning("Switching to TableView"); |
393 | m_curr_View = TableView; | 393 | m_curr_View = TableView; |
394 | break; | 394 | break; |
395 | } | 395 | } |
396 | updateView(); | 396 | updateView(); |
397 | 397 | ||
398 | } | 398 | } |
399 | 399 | ||
400 | // END: Slots | 400 | // END: Slots |
401 | 401 | ||
402 | void AbView::clearForCategory() | 402 | void AbView::clearForCategory() |
403 | { | 403 | { |
404 | OContactAccess::List::Iterator it; | 404 | Opie::OPimContactAccess::List::Iterator it; |
405 | // Now remove all contacts with wrong category if any category selected | 405 | // Now remove all contacts with wrong category if any category selected |
406 | 406 | ||
407 | OContactAccess::List allList = m_list; | 407 | Opie::OPimContactAccess::List allList = m_list; |
408 | if ( m_curr_category != -1 ){ | 408 | if ( m_curr_category != -1 ){ |
409 | for ( it = allList.begin(); it != allList.end(); ++it ){ | 409 | for ( it = allList.begin(); it != allList.end(); ++it ){ |
410 | if ( !contactCompare( *it, m_curr_category ) ){ | 410 | if ( !contactCompare( *it, m_curr_category ) ){ |
411 | // qWarning("Removing %d", (*it).uid()); | 411 | // qWarning("Removing %d", (*it).uid()); |
412 | m_list.remove( (*it).uid() ); | 412 | m_list.remove( (*it).uid() ); |
413 | } | 413 | } |
414 | } | 414 | } |
415 | } | 415 | } |
416 | 416 | ||
417 | } | 417 | } |
418 | 418 | ||
419 | bool AbView::contactCompare( const OContact &cnt, int category ) | 419 | bool AbView::contactCompare( const Opie::OPimContact &cnt, int category ) |
420 | { | 420 | { |
421 | //qWarning ("bool AbView::contactCompare( const OContact &cnt, %d )", category); | 421 | //qWarning ("bool AbView::contactCompare( const Opie::OPimContact &cnt, %d )", category); |
422 | 422 | ||
423 | bool returnMe; | 423 | bool returnMe; |
424 | QArray<int> cats; | 424 | QArray<int> cats; |
425 | cats = cnt.categories(); | 425 | cats = cnt.categories(); |
426 | 426 | ||
427 | //qWarning ("Number of categories: %d", cats.count() ); | 427 | //qWarning ("Number of categories: %d", cats.count() ); |
428 | 428 | ||
429 | returnMe = false; | 429 | returnMe = false; |
430 | if ( cats.count() == 0 && category == 0 ) | 430 | if ( cats.count() == 0 && category == 0 ) |
431 | // Contacts with no category will just shown on "All" and "Unfiled" | 431 | // Contacts with no category will just shown on "All" and "Unfiled" |
432 | returnMe = true; | 432 | returnMe = true; |
433 | else { | 433 | else { |
diff --git a/core/pim/addressbook/abview.h b/core/pim/addressbook/abview.h index 49bb4be..b8c8a08 100644 --- a/core/pim/addressbook/abview.h +++ b/core/pim/addressbook/abview.h | |||
@@ -1,21 +1,22 @@ | |||
1 | #ifndef _ABVIEW_H_ | 1 | #ifndef _ABVIEW_H_ |
2 | #define _ABVIEW_H_ | 2 | #define _ABVIEW_H_ |
3 | 3 | ||
4 | #include <qwidget.h> | 4 | #include <opie2/opimcontact.h> |
5 | #include <qwidgetstack.h> | 5 | #include <opie2/ocontactaccess.h> |
6 | 6 | ||
7 | #include <qpe/categories.h> | 7 | #include <qpe/categories.h> |
8 | #include <opie/ocontact.h> | 8 | |
9 | #include <opie/ocontactaccess.h> | 9 | #include <qwidget.h> |
10 | #include <qwidgetstack.h> | ||
10 | 11 | ||
11 | #include "contacteditor.h" | 12 | #include "contacteditor.h" |
12 | #include "abtable.h" | 13 | #include "abtable.h" |
13 | #include "ablabel.h" | 14 | #include "ablabel.h" |
14 | #include "abconfig.h" | 15 | #include "abconfig.h" |
15 | 16 | ||
16 | class AbView: public QWidget | 17 | class AbView: public QWidget |
17 | { | 18 | { |
18 | Q_OBJECT | 19 | Q_OBJECT |
19 | 20 | ||
20 | public: | 21 | public: |
21 | enum Views{ TableView=0, CardView, PersonalView }; | 22 | enum Views{ TableView=0, CardView, PersonalView }; |
@@ -28,62 +29,62 @@ public: | |||
28 | void reload(); | 29 | void reload(); |
29 | void clear(); | 30 | void clear(); |
30 | 31 | ||
31 | void setView( Views view ); | 32 | void setView( Views view ); |
32 | void showPersonal( bool personal ); | 33 | void showPersonal( bool personal ); |
33 | void setCurrentUid( int uid ); | 34 | void setCurrentUid( int uid ); |
34 | void setShowByCategory( const QString& cat ); | 35 | void setShowByCategory( const QString& cat ); |
35 | void setShowToView( Views view ); | 36 | void setShowToView( Views view ); |
36 | void setShowByLetter( char c, AbConfig::LPSearchMode mode = AbConfig::LastName ); | 37 | void setShowByLetter( char c, AbConfig::LPSearchMode mode = AbConfig::LastName ); |
37 | void setListOrder( const QValueList<int>& ordered ); | 38 | void setListOrder( const QValueList<int>& ordered ); |
38 | 39 | ||
39 | // Add Entry and put to current | 40 | // Add Entry and put to current |
40 | void addEntry( const OContact &newContact ); | 41 | void addEntry( const Opie::OPimContact &newContact ); |
41 | void removeEntry( const int UID ); | 42 | void removeEntry( const int UID ); |
42 | void replaceEntry( const OContact &contact ); | 43 | void replaceEntry( const Opie::OPimContact &contact ); |
43 | OContact currentEntry(); | 44 | Opie::OPimContact currentEntry(); |
44 | 45 | ||
45 | void inSearch() { m_inSearch = true; } | 46 | void inSearch() { m_inSearch = true; } |
46 | void offSearch(); | 47 | void offSearch(); |
47 | 48 | ||
48 | QString showCategory() const; | 49 | QString showCategory() const; |
49 | QStringList categories(); | 50 | QStringList categories(); |
50 | 51 | ||
51 | signals: | 52 | signals: |
52 | void signalNotFound(); | 53 | void signalNotFound(); |
53 | void signalClearLetterPicker(); | 54 | void signalClearLetterPicker(); |
54 | void signalViewSwitched ( int ); | 55 | void signalViewSwitched ( int ); |
55 | 56 | ||
56 | public slots: | 57 | public slots: |
57 | void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, | 58 | void slotDoFind( const QString &str, bool caseSensitive, bool useRegExp, |
58 | bool backwards, QString category = QString::null ); | 59 | bool backwards, QString category = QString::null ); |
59 | void slotSwitch(); | 60 | void slotSwitch(); |
60 | 61 | ||
61 | private: | 62 | private: |
62 | void updateListinViews(); | 63 | void updateListinViews(); |
63 | void updateView( bool newdata = false ); | 64 | void updateView( bool newdata = false ); |
64 | void clearForCategory(); | 65 | void clearForCategory(); |
65 | bool contactCompare( const OContact &cnt, int category ); | 66 | bool contactCompare( const Opie::OPimContact &cnt, int category ); |
66 | void parseName( const QString& name, QString *first, QString *middle, | 67 | void parseName( const QString& name, QString *first, QString *middle, |
67 | QString * last ); | 68 | QString * last ); |
68 | 69 | ||
69 | Categories mCat; | 70 | Categories mCat; |
70 | bool m_inSearch; | 71 | bool m_inSearch; |
71 | bool m_inPersonal; | 72 | bool m_inPersonal; |
72 | int m_curr_category; | 73 | int m_curr_category; |
73 | Views m_curr_View; | 74 | Views m_curr_View; |
74 | Views m_prev_View; | 75 | Views m_prev_View; |
75 | int m_curr_Contact; | 76 | int m_curr_Contact; |
76 | 77 | ||
77 | OContactAccess* m_contactdb; | 78 | Opie::OPimContactAccess* m_contactdb; |
78 | OContactAccess* m_storedDB; | 79 | Opie::OPimContactAccess* m_storedDB; |
79 | OContactAccess::List m_list; | 80 | Opie::OPimContactAccess::List m_list; |
80 | 81 | ||
81 | QWidgetStack* m_viewStack; | 82 | QWidgetStack* m_viewStack; |
82 | AbTable* m_abTable; | 83 | AbTable* m_abTable; |
83 | AbLabel* m_ablabel; | 84 | AbLabel* m_ablabel; |
84 | 85 | ||
85 | QValueList<int> m_orderedFields; | 86 | QValueList<int> m_orderedFields; |
86 | }; | 87 | }; |
87 | 88 | ||
88 | 89 | ||
89 | #endif | 90 | #endif |
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 8a5f9d5..9ae66d1 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -14,28 +14,28 @@ | |||
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** | 17 | ** |
18 | **********************************************************************/ | 18 | **********************************************************************/ |
19 | 19 | ||
20 | #define QTOPIA_INTERNAL_FD | 20 | #define QTOPIA_INTERNAL_FD |
21 | 21 | ||
22 | // #include "addresssettings.h" | 22 | // #include "addresssettings.h" |
23 | #include "addressbook.h" | 23 | #include "addressbook.h" |
24 | 24 | ||
25 | 25 | ||
26 | #include <opie/ofileselector.h> | 26 | #include <opie2/ofileselector.h> |
27 | #include <opie/ofiledialog.h> | 27 | #include <opie2/ofiledialog.h> |
28 | #include <opie/ocontact.h> | 28 | #include <opie2/opimcontact.h> |
29 | #include <opie/ocontactaccessbackend_vcard.h> | 29 | #include <opie2/ocontactaccessbackend_vcard.h> |
30 | 30 | ||
31 | #include <qpe/resource.h> | 31 | #include <qpe/resource.h> |
32 | #include <qpe/ir.h> | 32 | #include <qpe/ir.h> |
33 | #include <qpe/qpemessagebox.h> | 33 | #include <qpe/qpemessagebox.h> |
34 | #include <qmenubar.h> | 34 | #include <qmenubar.h> |
35 | // #include <qtoolbar.h> | 35 | // #include <qtoolbar.h> |
36 | // #include <qmenubar.h> | 36 | // #include <qmenubar.h> |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | 38 | ||
39 | #include <qaction.h> | 39 | #include <qaction.h> |
40 | #include <qlayout.h> | 40 | #include <qlayout.h> |
41 | #include <qmessagebox.h> | 41 | #include <qmessagebox.h> |
@@ -308,41 +308,41 @@ void AddressbookWindow::slotSetFont( int size ) | |||
308 | case 2: | 308 | case 2: |
309 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); | 309 | m_abView->setFont( QFont( defaultFont->family(), defaultFont->pointSize() + 2 ) ); |
310 | currentFont = new QFont (m_abView->font()); | 310 | currentFont = new QFont (m_abView->font()); |
311 | // //abList->resizeRows(currentFont->pixelSize() + 7); | 311 | // //abList->resizeRows(currentFont->pixelSize() + 7); |
312 | // abList->resizeRows(); | 312 | // abList->resizeRows(); |
313 | break; | 313 | break; |
314 | } | 314 | } |
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | void AddressbookWindow::importvCard() { | 319 | void AddressbookWindow::importvCard() { |
320 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | 320 | QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); |
321 | if(!str.isEmpty() ){ | 321 | if(!str.isEmpty() ){ |
322 | setDocument((const QString&) str ); | 322 | setDocument((const QString&) str ); |
323 | } | 323 | } |
324 | 324 | ||
325 | } | 325 | } |
326 | void AddressbookWindow::exportvCard() | 326 | void AddressbookWindow::exportvCard() |
327 | { | 327 | { |
328 | qWarning(" void AddressbookWindow::exportvCard()"); | 328 | qWarning(" void AddressbookWindow::exportvCard()"); |
329 | QString filename = OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); | 329 | QString filename = Opie::Ui::OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); |
330 | if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ | 330 | if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ |
331 | qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 ); | 331 | qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 ); |
332 | OContact curCont = m_abView->currentEntry(); | 332 | Opie::OPimContact curCont = m_abView->currentEntry(); |
333 | if ( !curCont.isEmpty() ){ | 333 | if ( !curCont.isEmpty() ){ |
334 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 334 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
335 | filename ); | 335 | filename ); |
336 | OContactAccess* access = new OContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); | 336 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); |
337 | if ( access ){ | 337 | if ( access ){ |
338 | access->add( curCont ); | 338 | access->add( curCont ); |
339 | access->save(); | 339 | access->save(); |
340 | } | 340 | } |
341 | delete access; | 341 | delete access; |
342 | }else | 342 | }else |
343 | QMessageBox::critical( 0, "Export VCard", | 343 | QMessageBox::critical( 0, "Export VCard", |
344 | QString( tr( "You have to select a contact !") ) ); | 344 | QString( tr( "You have to select a contact !") ) ); |
345 | 345 | ||
346 | }else | 346 | }else |
347 | QMessageBox::critical( 0, "Export VCard", | 347 | QMessageBox::critical( 0, "Export VCard", |
348 | QString( tr( "You have to set a filename !") ) ); | 348 | QString( tr( "You have to set a filename !") ) ); |
@@ -362,38 +362,38 @@ void AddressbookWindow::setDocument( const QString &filename ) | |||
362 | 0, // Enter == button 0 | 362 | 0, // Enter == button 0 |
363 | 2 ) ) { // Escape == button 2 | 363 | 2 ) ) { // Escape == button 2 |
364 | case 0: | 364 | case 0: |
365 | qWarning("YES clicked"); | 365 | qWarning("YES clicked"); |
366 | break; | 366 | break; |
367 | case 1: | 367 | case 1: |
368 | qWarning("NO clicked"); | 368 | qWarning("NO clicked"); |
369 | return; | 369 | return; |
370 | break; | 370 | break; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
374 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 374 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
375 | filename ); | 375 | filename ); |
376 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 376 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
377 | OContactAccess::List allList = access->allRecords(); | 377 | Opie::OPimContactAccess::List allList = access->allRecords(); |
378 | qWarning( "Found number of contacts in File: %d", allList.count() ); | 378 | qWarning( "Found number of contacts in File: %d", allList.count() ); |
379 | 379 | ||
380 | if ( !allList.count() ) { | 380 | if ( !allList.count() ) { |
381 | QMessageBox::information( this, "Import VCard", | 381 | QMessageBox::information( this, "Import VCard", |
382 | "It was impossible to import\nthe VCard.\n" | 382 | "It was impossible to import\nthe VCard.\n" |
383 | "The VCard may be corrupted!" ); | 383 | "The VCard may be corrupted!" ); |
384 | } | 384 | } |
385 | 385 | ||
386 | bool doAsk = true; | 386 | bool doAsk = true; |
387 | OContactAccess::List::Iterator it; | 387 | Opie::OPimContactAccess::List::Iterator it; |
388 | for ( it = allList.begin(); it != allList.end(); ++it ){ | 388 | for ( it = allList.begin(); it != allList.end(); ++it ){ |
389 | qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); | 389 | qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); |
390 | if ( doAsk ){ | 390 | if ( doAsk ){ |
391 | switch( QMessageBox::information( this, tr ( "Add Contact?" ), | 391 | switch( QMessageBox::information( this, tr ( "Add Contact?" ), |
392 | tr( "Do you really want add contact for \n%1?" ) | 392 | tr( "Do you really want add contact for \n%1?" ) |
393 | .arg( (*it).fullName().latin1() ), | 393 | .arg( (*it).fullName().latin1() ), |
394 | tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"), | 394 | tr( "&Yes" ), tr( "&No" ), tr( "&All Yes"), |
395 | 0, // Enter == button 0 | 395 | 0, // Enter == button 0 |
396 | 2 ) ) { // Escape == button 2 | 396 | 2 ) ) { // Escape == button 2 |
397 | case 0: | 397 | case 0: |
398 | qWarning("YES clicked"); | 398 | qWarning("YES clicked"); |
399 | m_abView->addEntry( *it ); | 399 | m_abView->addEntry( *it ); |
@@ -424,50 +424,50 @@ void AddressbookWindow::resizeEvent( QResizeEvent *e ) | |||
424 | AddressbookWindow::~AddressbookWindow() | 424 | AddressbookWindow::~AddressbookWindow() |
425 | { | 425 | { |
426 | ToolBarDock dock; | 426 | ToolBarDock dock; |
427 | int dummy; | 427 | int dummy; |
428 | bool bDummy; | 428 | bool bDummy; |
429 | getLocation ( listTools, dock, dummy, bDummy, dummy ); | 429 | getLocation ( listTools, dock, dummy, bDummy, dummy ); |
430 | m_config.setToolBarDock( dock ); | 430 | m_config.setToolBarDock( dock ); |
431 | m_config.save(); | 431 | m_config.save(); |
432 | } | 432 | } |
433 | 433 | ||
434 | void AddressbookWindow::slotUpdateToolbar() | 434 | void AddressbookWindow::slotUpdateToolbar() |
435 | { | 435 | { |
436 | OContact ce = m_abView->currentEntry(); | 436 | Opie::OPimContact ce = m_abView->currentEntry(); |
437 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); | 437 | actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); |
438 | } | 438 | } |
439 | 439 | ||
440 | void AddressbookWindow::slotListNew() | 440 | void AddressbookWindow::slotListNew() |
441 | { | 441 | { |
442 | OContact cnt; | 442 | Opie::OPimContact cnt; |
443 | if( !syncing ) { | 443 | if( !syncing ) { |
444 | editEntry( NewEntry ); | 444 | editEntry( NewEntry ); |
445 | } else { | 445 | } else { |
446 | QMessageBox::warning(this, tr("Contacts"), | 446 | QMessageBox::warning(this, tr("Contacts"), |
447 | tr("Can not edit data, currently syncing")); | 447 | tr("Can not edit data, currently syncing")); |
448 | } | 448 | } |
449 | } | 449 | } |
450 | 450 | ||
451 | // void AddressbookWindow::slotListView() | 451 | // void AddressbookWindow::slotListView() |
452 | // { | 452 | // { |
453 | // m_abView -> init( abList->currentEntry() ); | 453 | // m_abView -> init( abList->currentEntry() ); |
454 | // // :SX mView->sync(); | 454 | // // :SX mView->sync(); |
455 | // //:SXshowView(); | 455 | // //:SXshowView(); |
456 | // } | 456 | // } |
457 | 457 | ||
458 | void AddressbookWindow::slotListDelete() | 458 | void AddressbookWindow::slotListDelete() |
459 | { | 459 | { |
460 | if(!syncing) { | 460 | if(!syncing) { |
461 | OContact tmpEntry = m_abView ->currentEntry(); | 461 | Opie::OPimContact tmpEntry = m_abView ->currentEntry(); |
462 | 462 | ||
463 | // get a name, do the best we can... | 463 | // get a name, do the best we can... |
464 | QString strName = tmpEntry.fullName(); | 464 | QString strName = tmpEntry.fullName(); |
465 | if ( strName.isEmpty() ) { | 465 | if ( strName.isEmpty() ) { |
466 | strName = tmpEntry.company(); | 466 | strName = tmpEntry.company(); |
467 | if ( strName.isEmpty() ) | 467 | if ( strName.isEmpty() ) |
468 | strName = "No Name"; | 468 | strName = "No Name"; |
469 | } | 469 | } |
470 | 470 | ||
471 | 471 | ||
472 | if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), | 472 | if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), |
473 | strName ) ) { | 473 | strName ) ) { |
@@ -516,25 +516,25 @@ void AddressbookWindow::slotViewEdit() | |||
516 | editEntry( EditEntry ); | 516 | editEntry( EditEntry ); |
517 | } | 517 | } |
518 | } else { | 518 | } else { |
519 | QMessageBox::warning( this, tr("Contacts"), | 519 | QMessageBox::warning( this, tr("Contacts"), |
520 | tr("Can not edit data, currently syncing") ); | 520 | tr("Can not edit data, currently syncing") ); |
521 | } | 521 | } |
522 | } | 522 | } |
523 | 523 | ||
524 | 524 | ||
525 | 525 | ||
526 | void AddressbookWindow::writeMail() | 526 | void AddressbookWindow::writeMail() |
527 | { | 527 | { |
528 | OContact c = m_abView -> currentEntry(); | 528 | Opie::OPimContact c = m_abView -> currentEntry(); |
529 | QString name = c.fileAs(); | 529 | QString name = c.fileAs(); |
530 | QString email = c.defaultEmail(); | 530 | QString email = c.defaultEmail(); |
531 | 531 | ||
532 | // I prefer the OPIE-Environment variable before the | 532 | // I prefer the OPIE-Environment variable before the |
533 | // QPE-one.. | 533 | // QPE-one.. |
534 | QString basepath = QString::fromLatin1( getenv("OPIEDIR") ); | 534 | QString basepath = QString::fromLatin1( getenv("OPIEDIR") ); |
535 | if ( basepath.isEmpty() ) | 535 | if ( basepath.isEmpty() ) |
536 | basepath = QString::fromLatin1( getenv("QPEDIR") ); | 536 | basepath = QString::fromLatin1( getenv("QPEDIR") ); |
537 | 537 | ||
538 | // Try to access the preferred. If not possible, try to | 538 | // Try to access the preferred. If not possible, try to |
539 | // switch to the other one.. | 539 | // switch to the other one.. |
540 | if ( m_config.useQtMail() ){ | 540 | if ( m_config.useQtMail() ){ |
@@ -556,44 +556,44 @@ void AddressbookWindow::writeMail() | |||
556 | return; | 556 | return; |
557 | } else | 557 | } else |
558 | m_config.setUseQtMail( true ); | 558 | m_config.setUseQtMail( true ); |
559 | } | 559 | } |
560 | 560 | ||
561 | } | 561 | } |
562 | 562 | ||
563 | static const char * beamfile = "/tmp/obex/contact.vcf"; | 563 | static const char * beamfile = "/tmp/obex/contact.vcf"; |
564 | 564 | ||
565 | void AddressbookWindow::slotBeam() | 565 | void AddressbookWindow::slotBeam() |
566 | { | 566 | { |
567 | QString beamFilename; | 567 | QString beamFilename; |
568 | OContact c; | 568 | Opie::OPimContact c; |
569 | if ( actionPersonal->isOn() ) { | 569 | if ( actionPersonal->isOn() ) { |
570 | beamFilename = addressbookPersonalVCardName(); | 570 | beamFilename = addressbookPersonalVCardName(); |
571 | if ( !QFile::exists( beamFilename ) ) | 571 | if ( !QFile::exists( beamFilename ) ) |
572 | return; // can't beam a non-existent file | 572 | return; // can't beam a non-existent file |
573 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 573 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
574 | beamFilename ); | 574 | beamFilename ); |
575 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 575 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
576 | OContactAccess::List allList = access->allRecords(); | 576 | Opie::OPimContactAccess::List allList = access->allRecords(); |
577 | OContactAccess::List::Iterator it = allList.begin(); // Just take first | 577 | Opie::OPimContactAccess::List::Iterator it = allList.begin(); // Just take first |
578 | c = *it; | 578 | c = *it; |
579 | 579 | ||
580 | delete access; | 580 | delete access; |
581 | } else { | 581 | } else { |
582 | unlink( beamfile ); // delete if exists | 582 | unlink( beamfile ); // delete if exists |
583 | mkdir("/tmp/obex/", 0755); | 583 | mkdir("/tmp/obex/", 0755); |
584 | c = m_abView -> currentEntry(); | 584 | c = m_abView -> currentEntry(); |
585 | OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, | 585 | Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null, |
586 | beamfile ); | 586 | beamfile ); |
587 | OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); | 587 | Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true ); |
588 | access->add( c ); | 588 | access->add( c ); |
589 | access->save(); | 589 | access->save(); |
590 | delete access; | 590 | delete access; |
591 | 591 | ||
592 | beamFilename = beamfile; | 592 | beamFilename = beamfile; |
593 | } | 593 | } |
594 | 594 | ||
595 | qWarning("Beaming: %s", beamFilename.latin1() ); | 595 | qWarning("Beaming: %s", beamFilename.latin1() ); |
596 | 596 | ||
597 | Ir *ir = new Ir( this ); | 597 | Ir *ir = new Ir( this ); |
598 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 598 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
599 | QString description = c.fullName(); | 599 | QString description = c.fullName(); |
@@ -643,25 +643,25 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) | |||
643 | 643 | ||
644 | 644 | ||
645 | if (msg == "editPersonal()") { | 645 | if (msg == "editPersonal()") { |
646 | editPersonal(); | 646 | editPersonal(); |
647 | } else if (msg == "editPersonalAndClose()") { | 647 | } else if (msg == "editPersonalAndClose()") { |
648 | editPersonal(); | 648 | editPersonal(); |
649 | close(); | 649 | close(); |
650 | } else if ( msg == "addContact(QString,QString)" ) { | 650 | } else if ( msg == "addContact(QString,QString)" ) { |
651 | QDataStream stream(data,IO_ReadOnly); | 651 | QDataStream stream(data,IO_ReadOnly); |
652 | QString name, email; | 652 | QString name, email; |
653 | stream >> name >> email; | 653 | stream >> name >> email; |
654 | 654 | ||
655 | OContact cnt; | 655 | Opie::OPimContact cnt; |
656 | QString fn, mn, ln; | 656 | QString fn, mn, ln; |
657 | parseName( name, &fn, &mn, &ln ); | 657 | parseName( name, &fn, &mn, &ln ); |
658 | // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() ); | 658 | // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() ); |
659 | cnt.setFirstName( fn ); | 659 | cnt.setFirstName( fn ); |
660 | cnt.setMiddleName( mn ); | 660 | cnt.setMiddleName( mn ); |
661 | cnt.setLastName( ln ); | 661 | cnt.setLastName( ln ); |
662 | cnt.insertEmails( email ); | 662 | cnt.insertEmails( email ); |
663 | cnt.setDefaultEmail( email ); | 663 | cnt.setDefaultEmail( email ); |
664 | cnt.setFileAs(); | 664 | cnt.setFileAs(); |
665 | 665 | ||
666 | m_abView -> addEntry( cnt ); | 666 | m_abView -> addEntry( cnt ); |
667 | 667 | ||
@@ -713,60 +713,60 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) | |||
713 | m_abView -> setShowByCategory( QString::null ); | 713 | m_abView -> setShowByCategory( QString::null ); |
714 | m_abView -> setCurrentUid( uid ); | 714 | m_abView -> setCurrentUid( uid ); |
715 | slotViewEdit(); | 715 | slotViewEdit(); |
716 | } | 716 | } |
717 | 717 | ||
718 | if (needShow) | 718 | if (needShow) |
719 | QPEApplication::setKeepRunning(); | 719 | QPEApplication::setKeepRunning(); |
720 | 720 | ||
721 | } | 721 | } |
722 | 722 | ||
723 | void AddressbookWindow::editEntry( EntryMode entryMode ) | 723 | void AddressbookWindow::editEntry( EntryMode entryMode ) |
724 | { | 724 | { |
725 | OContact entry; | 725 | Opie::OPimContact entry; |
726 | if ( !abEditor ) { | 726 | if ( !abEditor ) { |
727 | abEditor = new ContactEditor( entry, this, "editor" ); | 727 | abEditor = new ContactEditor( entry, this, "editor" ); |
728 | } | 728 | } |
729 | if ( entryMode == EditEntry ) | 729 | if ( entryMode == EditEntry ) |
730 | abEditor->setEntry( m_abView -> currentEntry() ); | 730 | abEditor->setEntry( m_abView -> currentEntry() ); |
731 | else if ( entryMode == NewEntry ) | 731 | else if ( entryMode == NewEntry ) |
732 | abEditor->setEntry( entry ); | 732 | abEditor->setEntry( entry ); |
733 | // other things may change the caption. | 733 | // other things may change the caption. |
734 | abEditor->setCaption( tr("Edit Address") ); | 734 | abEditor->setCaption( tr("Edit Address") ); |
735 | 735 | ||
736 | // fix the foxus... | 736 | // fix the foxus... |
737 | abEditor->setNameFocus(); | 737 | abEditor->setNameFocus(); |
738 | if ( QPEApplication::execDialog( abEditor ) ) { | 738 | if ( QPEApplication::execDialog( abEditor ) ) { |
739 | setFocus(); | 739 | setFocus(); |
740 | if ( entryMode == NewEntry ) { | 740 | if ( entryMode == NewEntry ) { |
741 | OContact insertEntry = abEditor->entry(); | 741 | Opie::OPimContact insertEntry = abEditor->entry(); |
742 | insertEntry.assignUid(); | 742 | insertEntry.assignUid(); |
743 | m_abView -> addEntry( insertEntry ); | 743 | m_abView -> addEntry( insertEntry ); |
744 | m_abView -> setCurrentUid( insertEntry.uid() ); | 744 | m_abView -> setCurrentUid( insertEntry.uid() ); |
745 | } else { | 745 | } else { |
746 | OContact replEntry = abEditor->entry(); | 746 | Opie::OPimContact replEntry = abEditor->entry(); |
747 | 747 | ||
748 | if ( !replEntry.isValidUid() ) | 748 | if ( !replEntry.isValidUid() ) |
749 | replEntry.assignUid(); | 749 | replEntry.assignUid(); |
750 | 750 | ||
751 | m_abView -> replaceEntry( replEntry ); | 751 | m_abView -> replaceEntry( replEntry ); |
752 | } | 752 | } |
753 | } | 753 | } |
754 | // populateCategories(); | 754 | // populateCategories(); |
755 | 755 | ||
756 | } | 756 | } |
757 | 757 | ||
758 | void AddressbookWindow::editPersonal() | 758 | void AddressbookWindow::editPersonal() |
759 | { | 759 | { |
760 | OContact entry; | 760 | Opie::OPimContact entry; |
761 | 761 | ||
762 | // Switch to personal view if not selected | 762 | // Switch to personal view if not selected |
763 | // but take care of the menu, too | 763 | // but take care of the menu, too |
764 | if ( ! actionPersonal->isOn() ){ | 764 | if ( ! actionPersonal->isOn() ){ |
765 | qWarning("*** ++++"); | 765 | qWarning("*** ++++"); |
766 | actionPersonal->setOn( true ); | 766 | actionPersonal->setOn( true ); |
767 | slotPersonalView(); | 767 | slotPersonalView(); |
768 | } | 768 | } |
769 | 769 | ||
770 | if ( !abEditor ) { | 770 | if ( !abEditor ) { |
771 | abEditor = new ContactEditor( entry, this, "editor" ); | 771 | abEditor = new ContactEditor( entry, this, "editor" ); |
772 | } | 772 | } |
diff --git a/core/pim/addressbook/addressbook.pro b/core/pim/addressbook/addressbook.pro index afd3b92..05f02c3 100644 --- a/core/pim/addressbook/addressbook.pro +++ b/core/pim/addressbook/addressbook.pro | |||
@@ -14,15 +14,15 @@ SOURCES = main.cpp \ | |||
14 | contacteditor.cpp \ | 14 | contacteditor.cpp \ |
15 | ablabel.cpp \ | 15 | ablabel.cpp \ |
16 | abtable.cpp \ | 16 | abtable.cpp \ |
17 | picker.cpp \ | 17 | picker.cpp \ |
18 | configdlg.cpp \ | 18 | configdlg.cpp \ |
19 | abconfig.cpp \ | 19 | abconfig.cpp \ |
20 | abview.cpp | 20 | abview.cpp |
21 | 21 | ||
22 | INTERFACES= configdlg_base.ui | 22 | INTERFACES= configdlg_base.ui |
23 | TARGET = addressbook | 23 | TARGET = addressbook |
24 | INCLUDEPATH += $(OPIEDIR)/include | 24 | INCLUDEPATH += $(OPIEDIR)/include |
25 | DEPENDPATH+= $(OPIEDIR)/include | 25 | DEPENDPATH+= $(OPIEDIR)/include |
26 | LIBS += -lqpe -lopie | 26 | LIBS += -lqpe -lopiecore2 -lopieui2 -lopiepim2 -lopiedb2 |
27 | 27 | ||
28 | include ( $(OPIEDIR)/include.pro ) | 28 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/pim/addressbook/config.in b/core/pim/addressbook/config.in index 3377763..7ecf14c 100644 --- a/core/pim/addressbook/config.in +++ b/core/pim/addressbook/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config ADDRESSBOOK | 1 | config ADDRESSBOOK |
2 | boolean "opie-addressbook (a simple addressbook)" | 2 | boolean "opie-addressbook (a simple addressbook)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM && LIBOPIE2DB |
diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp index dee0f11..6c98b5d 100644 --- a/core/pim/addressbook/configdlg.cpp +++ b/core/pim/addressbook/configdlg.cpp | |||
@@ -1,47 +1,47 @@ | |||
1 | #include "configdlg.h" | 1 | #include "configdlg.h" |
2 | 2 | ||
3 | #include <opie2/opimcontact.h> | ||
4 | #include "opie2/opimcontactfields.h" | ||
5 | |||
6 | #include <qpe/resource.h> | ||
7 | |||
3 | #include <qcheckbox.h> | 8 | #include <qcheckbox.h> |
4 | #include <qradiobutton.h> | 9 | #include <qradiobutton.h> |
5 | #include <qlistbox.h> | 10 | #include <qlistbox.h> |
6 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
7 | 12 | ||
8 | #include <qpe/resource.h> | ||
9 | |||
10 | #include <opie/ocontact.h> | ||
11 | #include "opie/ocontactfields.h" | ||
12 | |||
13 | ConfigDlg::ConfigDlg( QWidget *parent, const char *name): | 13 | ConfigDlg::ConfigDlg( QWidget *parent, const char *name): |
14 | ConfigDlg_Base(parent, name, true ) | 14 | ConfigDlg_Base(parent, name, true ) |
15 | { | 15 | { |
16 | contFields = OContactFields::trfields(); | 16 | contFields = Opie::OPimContactFields::trfields(); |
17 | 17 | ||
18 | // We add all Fields into the Listbox | 18 | // We add all Fields into the Listbox |
19 | for (uint i=0; i < contFields.count(); i++) { | 19 | for (uint i=0; i < contFields.count(); i++) { |
20 | allFieldListBox->insertItem( contFields[i] ); | 20 | allFieldListBox->insertItem( contFields[i] ); |
21 | } | 21 | } |
22 | 22 | ||
23 | // Reset Widget Flags: This was not changeable by designer :( | 23 | // Reset Widget Flags: This was not changeable by designer :( |
24 | setWFlags ( WStyle_ContextHelp ); | 24 | setWFlags ( WStyle_ContextHelp ); |
25 | 25 | ||
26 | // Set Pics to Buttons and Tabs | 26 | // Set Pics to Buttons and Tabs |
27 | m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); | 27 | m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); |
28 | m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); | 28 | m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); |
29 | m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); | 29 | m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); |
30 | m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); | 30 | m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); |
31 | 31 | ||
32 | 32 | ||
33 | // Get the translation maps between Field ID and translated strings | 33 | // Get the translation maps between Field ID and translated strings |
34 | m_mapStrToID = OContactFields::trFieldsToId(); | 34 | m_mapStrToID = Opie::OPimContactFields::trFieldsToId(); |
35 | m_mapIDToStr = OContactFields::idToTrFields(); | 35 | m_mapIDToStr = Opie::OPimContactFields::idToTrFields(); |
36 | 36 | ||
37 | connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); | 37 | connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); |
38 | connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); | 38 | connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); |
39 | connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); | 39 | connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); |
40 | connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); | 40 | connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); |
41 | } | 41 | } |
42 | 42 | ||
43 | void ConfigDlg::slotItemUp() | 43 | void ConfigDlg::slotItemUp() |
44 | { | 44 | { |
45 | qWarning( "void ConfigDlg::slotItemUp()" ); | 45 | qWarning( "void ConfigDlg::slotItemUp()" ); |
46 | 46 | ||
47 | int i = fieldListBox->currentItem(); | 47 | int i = fieldListBox->currentItem(); |
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 8acf570..534666d 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -12,28 +12,29 @@ | |||
12 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | * | 14 | * |
15 | * | 15 | * |
16 | * This is a rewrite of the abeditor.h file, modified to provide a more | 16 | * This is a rewrite of the abeditor.h file, modified to provide a more |
17 | * intuitive interface to TrollTech's original Address Book editor. This | 17 | * intuitive interface to TrollTech's original Address Book editor. This |
18 | * is made to operate exactly in interface with the exception of name. | 18 | * is made to operate exactly in interface with the exception of name. |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "contacteditor.h" | 22 | #include "contacteditor.h" |
23 | 23 | ||
24 | #include <opie2/opimcontact.h> | ||
25 | |||
24 | #include <qpe/categoryselect.h> | 26 | #include <qpe/categoryselect.h> |
25 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
26 | #include <qpe/qpedialog.h> | 28 | #include <qpe/qpedialog.h> |
27 | #include <opie/ocontact.h> | ||
28 | #include <qpe/resource.h> | 29 | #include <qpe/resource.h> |
29 | 30 | ||
30 | #include <qlabel.h> | 31 | #include <qlabel.h> |
31 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
32 | #include <qlayout.h> | 33 | #include <qlayout.h> |
33 | #include <qlineedit.h> | 34 | #include <qlineedit.h> |
34 | #include <qmultilineedit.h> | 35 | #include <qmultilineedit.h> |
35 | #include <qtoolbutton.h> | 36 | #include <qtoolbutton.h> |
36 | #include <qlistbox.h> | 37 | #include <qlistbox.h> |
37 | #include <qmessagebox.h> | 38 | #include <qmessagebox.h> |
38 | #include <qwhatsthis.h> | 39 | #include <qwhatsthis.h> |
39 | 40 | ||
@@ -42,25 +43,25 @@ | |||
42 | static inline bool containsAlphaNum( const QString &str ); | 43 | static inline bool containsAlphaNum( const QString &str ); |
43 | static inline bool constainsWhiteSpace( const QString &str ); | 44 | static inline bool constainsWhiteSpace( const QString &str ); |
44 | 45 | ||
45 | // helper functions, convert our comma delimited list to proper | 46 | // helper functions, convert our comma delimited list to proper |
46 | // file format... | 47 | // file format... |
47 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 48 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
48 | QString &strAll ); | 49 | QString &strAll ); |
49 | 50 | ||
50 | // helper convert from file format to comma delimited... | 51 | // helper convert from file format to comma delimited... |
51 | void parseEmailTo( const QString &strDefaultEmail, | 52 | void parseEmailTo( const QString &strDefaultEmail, |
52 | const QString &strOtherEmail, QString &strBack ); | 53 | const QString &strOtherEmail, QString &strBack ); |
53 | 54 | ||
54 | ContactEditor::ContactEditor(const OContact &entry, | 55 | ContactEditor::ContactEditor(const Opie::OPimContact &entry, |
55 | QWidget *parent, | 56 | QWidget *parent, |
56 | const char *name, | 57 | const char *name, |
57 | WFlags ) | 58 | WFlags ) |
58 | : QDialog( parent, name, TRUE, WStyle_ContextHelp ), | 59 | : QDialog( parent, name, TRUE, WStyle_ContextHelp ), |
59 | defaultEmailChooserPosition( -1 ), | 60 | defaultEmailChooserPosition( -1 ), |
60 | m_personalView ( false ), | 61 | m_personalView ( false ), |
61 | cmbDefaultEmail( 0 ), | 62 | cmbDefaultEmail( 0 ), |
62 | initializing ( false ) | 63 | initializing ( false ) |
63 | { | 64 | { |
64 | 65 | ||
65 | initializing = true; | 66 | initializing = true; |
66 | 67 | ||
@@ -78,39 +79,39 @@ ContactEditor::~ContactEditor() { | |||
78 | void ContactEditor::init() { | 79 | void ContactEditor::init() { |
79 | qWarning("init() START"); | 80 | qWarning("init() START"); |
80 | 81 | ||
81 | uint i = 0; | 82 | uint i = 0; |
82 | 83 | ||
83 | QStringList trlChooserNames; | 84 | QStringList trlChooserNames; |
84 | 85 | ||
85 | for (i = 0; i <= 6; i++) { | 86 | for (i = 0; i <= 6; i++) { |
86 | slHomeAddress.append( "" ); | 87 | slHomeAddress.append( "" ); |
87 | slBusinessAddress.append( "" ); | 88 | slBusinessAddress.append( "" ); |
88 | } | 89 | } |
89 | 90 | ||
90 | trlChooserNames = OContactFields::trphonefields( false ); | 91 | trlChooserNames = Opie::OPimContactFields::trphonefields( false ); |
91 | slChooserNames = OContactFields::untrphonefields( false ); | 92 | slChooserNames = Opie::OPimContactFields::untrphonefields( false ); |
92 | slDynamicEntries = OContactFields::untrdetailsfields( false ); | 93 | slDynamicEntries = Opie::OPimContactFields::untrdetailsfields( false ); |
93 | trlDynamicEntries = OContactFields::trdetailsfields( false ); | 94 | trlDynamicEntries = Opie::OPimContactFields::trdetailsfields( false ); |
94 | 95 | ||
95 | // Ok, we have to remove elements from the list of dynamic entries | 96 | // Ok, we have to remove elements from the list of dynamic entries |
96 | // which are now stored in special (not dynamic) widgets.. | 97 | // which are now stored in special (not dynamic) widgets.. |
97 | // Otherwise we will get problems with field assignments! (se) | 98 | // Otherwise we will get problems with field assignments! (se) |
98 | slDynamicEntries.remove("Anniversary"); | 99 | slDynamicEntries.remove("Anniversary"); |
99 | slDynamicEntries.remove("Birthday"); | 100 | slDynamicEntries.remove("Birthday"); |
100 | slDynamicEntries.remove("Gender"); | 101 | slDynamicEntries.remove("Gender"); |
101 | 102 | ||
102 | // The same with translated fields.. But I will | 103 | // The same with translated fields.. But I will |
103 | // use the translation map to avoid mismatches.. | 104 | // use the translation map to avoid mismatches.. |
104 | QMap<int, QString> translMap = OContactFields::idToTrFields(); | 105 | QMap<int, QString> translMap = Opie::OPimContactFields::idToTrFields(); |
105 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); | 106 | trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); |
106 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); | 107 | trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); |
107 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); | 108 | trlDynamicEntries.remove( translMap[Qtopia::Gender] ); |
108 | 109 | ||
109 | // Last Check to be sure.. | 110 | // Last Check to be sure.. |
110 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); | 111 | assert( slDynamicEntries.count() == trlDynamicEntries.count() ); |
111 | assert( slChooserNames.count() == trlChooserNames.count() ); | 112 | assert( slChooserNames.count() == trlChooserNames.count() ); |
112 | 113 | ||
113 | for (i = 0; i < slChooserNames.count(); i++) | 114 | for (i = 0; i < slChooserNames.count(); i++) |
114 | slChooserValues.append(""); | 115 | slChooserValues.append(""); |
115 | 116 | ||
116 | 117 | ||
@@ -569,26 +570,26 @@ void ContactEditor::init() { | |||
569 | l = new QLabel( tr("Gender"), container ); | 570 | l = new QLabel( tr("Gender"), container ); |
570 | gl->addWidget( l, counter, 0 ); | 571 | gl->addWidget( l, counter, 0 ); |
571 | cmbGender = new QComboBox( container ); | 572 | cmbGender = new QComboBox( container ); |
572 | cmbGender->insertItem( "", 0 ); | 573 | cmbGender->insertItem( "", 0 ); |
573 | cmbGender->insertItem( tr("Male"), 1); | 574 | cmbGender->insertItem( tr("Male"), 1); |
574 | cmbGender->insertItem( tr("Female"), 2); | 575 | cmbGender->insertItem( tr("Female"), 2); |
575 | gl->addWidget( cmbGender, counter, 1 ); | 576 | gl->addWidget( cmbGender, counter, 1 ); |
576 | 577 | ||
577 | ++counter; | 578 | ++counter; |
578 | 579 | ||
579 | // Create Labels and lineedit fields for every dynamic entry | 580 | // Create Labels and lineedit fields for every dynamic entry |
580 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 581 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
581 | QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId(); | 582 | QMap<QString, int> mapStrToID = Opie::OPimContactFields::untrFieldsToId(); |
582 | QMap<int, QString> mapIdToStr = OContactFields::idToTrFields(); | 583 | QMap<int, QString> mapIdToStr = Opie::OPimContactFields::idToTrFields(); |
583 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { | 584 | for (i = counter; it != slDynamicEntries.end(); i++, ++it ) { |
584 | 585 | ||
585 | if (((*it) == "Anniversary") || | 586 | if (((*it) == "Anniversary") || |
586 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; | 587 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; |
587 | 588 | ||
588 | l = new QLabel( mapIdToStr[mapStrToID[*it]], container ); | 589 | l = new QLabel( mapIdToStr[mapStrToID[*it]], container ); |
589 | listName.append( l ); | 590 | listName.append( l ); |
590 | gl->addWidget( l, i, 0 ); | 591 | gl->addWidget( l, i, 0 ); |
591 | QLineEdit *e = new QLineEdit( container ); | 592 | QLineEdit *e = new QLineEdit( container ); |
592 | listValue.append( e ); | 593 | listValue.append( e ); |
593 | gl->addWidget( e, i, 1); | 594 | gl->addWidget( e, i, 1); |
594 | } | 595 | } |
@@ -1241,25 +1242,25 @@ void ContactEditor::cleanupFields() { | |||
1241 | txtChooserField3->setText(""); | 1242 | txtChooserField3->setText(""); |
1242 | txtAddress->setText(""); | 1243 | txtAddress->setText(""); |
1243 | txtCity->setText(""); | 1244 | txtCity->setText(""); |
1244 | txtState->setText(""); | 1245 | txtState->setText(""); |
1245 | txtZip->setText(""); | 1246 | txtZip->setText(""); |
1246 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1247 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1247 | txtTmp->setText(""); | 1248 | txtTmp->setText(""); |
1248 | txtTmp = cmbFileAs->lineEdit(); | 1249 | txtTmp = cmbFileAs->lineEdit(); |
1249 | txtTmp->setText(""); | 1250 | txtTmp->setText(""); |
1250 | 1251 | ||
1251 | } | 1252 | } |
1252 | 1253 | ||
1253 | void ContactEditor::setEntry( const OContact &entry ) { | 1254 | void ContactEditor::setEntry( const Opie::OPimContact &entry ) { |
1254 | 1255 | ||
1255 | initializing = true; | 1256 | initializing = true; |
1256 | 1257 | ||
1257 | // Cleanup and activate the general Page .. | 1258 | // Cleanup and activate the general Page .. |
1258 | cleanupFields(); | 1259 | cleanupFields(); |
1259 | tabMain->setCurrentPage( 0 ); | 1260 | tabMain->setCurrentPage( 0 ); |
1260 | 1261 | ||
1261 | ent = entry; | 1262 | ent = entry; |
1262 | 1263 | ||
1263 | emails = QStringList(ent.emailList()); | 1264 | emails = QStringList(ent.emailList()); |
1264 | defaultEmail = ent.defaultEmail(); | 1265 | defaultEmail = ent.defaultEmail(); |
1265 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1266 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h index 72d14a9..1b86e6f 100644 --- a/core/pim/addressbook/contacteditor.h +++ b/core/pim/addressbook/contacteditor.h | |||
@@ -12,26 +12,26 @@ | |||
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 <opie2/opimcontact.h> |
25 | #include <opie/ocontactfields.h> | 25 | #include <opie2/opimcontactfields.h> |
26 | 26 | ||
27 | #include <qpe/datebookmonth.h> | 27 | #include <qpe/datebookmonth.h> |
28 | 28 | ||
29 | #include <qdialog.h> | 29 | #include <qdialog.h> |
30 | #include <qlist.h> | 30 | #include <qlist.h> |
31 | #include <qmap.h> | 31 | #include <qmap.h> |
32 | #include <qstringlist.h> | 32 | #include <qstringlist.h> |
33 | #include <qwidgetstack.h> | 33 | #include <qwidgetstack.h> |
34 | 34 | ||
35 | const int NAME_LF = 0; | 35 | const int NAME_LF = 0; |
36 | const int NAME_LFM = 1; | 36 | const int NAME_LFM = 1; |
37 | const int NAME_FL = 2; | 37 | const int NAME_FL = 2; |
@@ -47,37 +47,37 @@ class QScrollView; | |||
47 | class QTabWidget; | 47 | class QTabWidget; |
48 | class QMultiLineEdit; | 48 | class QMultiLineEdit; |
49 | class QLineEdit; | 49 | class QLineEdit; |
50 | class QComboBox; | 50 | class QComboBox; |
51 | class QPushButton; | 51 | class QPushButton; |
52 | class CategorySelect; | 52 | class CategorySelect; |
53 | class QLabel; | 53 | class QLabel; |
54 | 54 | ||
55 | class ContactEditor : public QDialog { | 55 | class ContactEditor : public QDialog { |
56 | Q_OBJECT | 56 | Q_OBJECT |
57 | 57 | ||
58 | public: | 58 | public: |
59 | ContactEditor(const OContact &entry, | 59 | ContactEditor(const Opie::OPimContact &entry, |
60 | QWidget *parent = 0, | 60 | QWidget *parent = 0, |
61 | const char *name = 0, | 61 | const char *name = 0, |
62 | WFlags fl = 0 ); | 62 | WFlags fl = 0 ); |
63 | ~ContactEditor(); | 63 | ~ContactEditor(); |
64 | void setNameFocus(); | 64 | void setNameFocus(); |
65 | void setPersonalView( bool personal = true ); | 65 | void setPersonalView( bool personal = true ); |
66 | OContact entry() const { return ent; } | 66 | Opie::OPimContact entry() const { return ent; } |
67 | 67 | ||
68 | public slots: | 68 | public slots: |
69 | void slotNote(); | 69 | void slotNote(); |
70 | void slotName(); | 70 | void slotName(); |
71 | void setEntry(const OContact &entry); | 71 | void setEntry(const Opie::OPimContact &entry); |
72 | 72 | ||
73 | protected slots: | 73 | protected slots: |
74 | void accept(); | 74 | void accept(); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | void init(); | 77 | void init(); |
78 | void saveEntry(); | 78 | void saveEntry(); |
79 | bool isEmpty(); | 79 | bool isEmpty(); |
80 | void cleanupFields(); | 80 | void cleanupFields(); |
81 | void updateDatePicker(); | 81 | void updateDatePicker(); |
82 | QString parseName( QString fullName, int type ); | 82 | QString parseName( QString fullName, int type ); |
83 | void chooserError( int index ); | 83 | void chooserError( int index ); |
@@ -104,27 +104,27 @@ class ContactEditor : public QDialog { | |||
104 | void slotAnniversaryDateChanged( int year, int month, int day); | 104 | void slotAnniversaryDateChanged( int year, int month, int day); |
105 | void slotBirthdayDateChanged( int year, int month, int day); | 105 | void slotBirthdayDateChanged( int year, int month, int day); |
106 | void slotRemoveBirthday(); | 106 | void slotRemoveBirthday(); |
107 | void slotRemoveAnniversary(); | 107 | void slotRemoveAnniversary(); |
108 | void defaultEmailChanged(int); | 108 | void defaultEmailChanged(int); |
109 | 109 | ||
110 | private: | 110 | private: |
111 | enum StackWidgets { TextField = 1, Combo }; | 111 | enum StackWidgets { TextField = 1, Combo }; |
112 | int defaultEmailChooserPosition; | 112 | int defaultEmailChooserPosition; |
113 | void populateDefaultEmailCmb(); | 113 | void populateDefaultEmailCmb(); |
114 | void chooserChange( const QString&, int , QLineEdit*, int ); | 114 | void chooserChange( const QString&, int , QLineEdit*, int ); |
115 | bool cmbChooserChange( int , QWidgetStack*, int ); | 115 | bool cmbChooserChange( int , QWidgetStack*, int ); |
116 | OContactFields contactfields; | 116 | Opie::OPimContactFields contactfields; |
117 | 117 | ||
118 | OContact ent; | 118 | Opie::OPimContact ent; |
119 | 119 | ||
120 | QDialog *dlgNote; | 120 | QDialog *dlgNote; |
121 | QDialog *dlgName; | 121 | QDialog *dlgName; |
122 | 122 | ||
123 | QList<QLineEdit> listValue; | 123 | QList<QLineEdit> listValue; |
124 | QList<QLabel> listName; | 124 | QList<QLabel> listName; |
125 | 125 | ||
126 | QStringList slDynamicEntries; | 126 | QStringList slDynamicEntries; |
127 | QStringList trlDynamicEntries; | 127 | QStringList trlDynamicEntries; |
128 | 128 | ||
129 | bool m_personalView; | 129 | bool m_personalView; |
130 | 130 | ||
diff --git a/core/pim/addressbook/main.cpp b/core/pim/addressbook/main.cpp index 47d370a..660fae6 100644 --- a/core/pim/addressbook/main.cpp +++ b/core/pim/addressbook/main.cpp | |||
@@ -12,16 +12,16 @@ | |||
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 | 20 | ||
21 | #include "addressbook.h" | 21 | #include "addressbook.h" |
22 | 22 | ||
23 | 23 | ||
24 | #include <opie/oapplicationfactory.h> | 24 | #include <opie2/oapplicationfactory.h> |
25 | 25 | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<AddressbookWindow> ) | 26 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<AddressbookWindow> ) |
27 | 27 | ||
diff --git a/core/pim/addressbook/opie-addressbook.control b/core/pim/addressbook/opie-addressbook.control index 2d30dc5..18a3791 100644 --- a/core/pim/addressbook/opie-addressbook.control +++ b/core/pim/addressbook/opie-addressbook.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-addressbook | 1 | Package: opie-addressbook |
2 | Files: plugins/application/libaddressbook.so* bin/addressbook apps/1Pim/addressbook.desktop | 2 | Files: plugins/application/libaddressbook.so* bin/addressbook apps/1Pim/addressbook.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/pim | 4 | Section: opie/pim |
5 | Conflicts: qpe-tkcaddressbook | 5 | Conflicts: qpe-tkcaddressbook |
6 | Maintainer: Stefan Eilers <eilers.stefan@epost.de> | 6 | Maintainer: Stefan Eilers <eilers.stefan@epost.de> |
7 | Architecture: arm | 7 | Architecture: arm |
8 | Depends: task-opie-minimal, libopie1, opie-pics | 8 | Depends: task-opie-minimal, opie-pics, libopiecore2, libopieui2, libopiepim2, libopiedb2 |
9 | Description: Contacts | 9 | Description: Contacts |
10 | A simple addressbook for the Opie environment. | 10 | A simple addressbook for the Opie environment. |
11 | Version: $QPE_VERSION$EXTRAVERSION | 11 | Version: $QPE_VERSION$EXTRAVERSION |