author | zautrix <zautrix> | 2004-09-17 00:05:23 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-17 00:05:23 (UTC) |
commit | 8462751df135b9ad08b1269661d2c7eb18c67976 (patch) (unidiff) | |
tree | 1c40fa2638f9f22df2d96b0879acfd20a9c2c502 | |
parent | eebe4409884ccd4dedb7cb697a800f74b33eb292 (diff) | |
download | kdepimpi-8462751df135b9ad08b1269661d2c7eb18c67976.zip kdepimpi-8462751df135b9ad08b1269661d2c7eb18c67976.tar.gz kdepimpi-8462751df135b9ad08b1269661d2c7eb18c67976.tar.bz2 |
Rearranged linking
-rw-r--r-- | kabc/addresseeview.cpp | 401 | ||||
-rw-r--r-- | kabc/addresseeview.h | 60 | ||||
-rw-r--r-- | kabc/kabc.pro | 2 | ||||
-rw-r--r-- | kabc/kabcE.pro | 2 | ||||
-rw-r--r-- | kaddressbook/details/look_html.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kaddressbookE.pro | 6 | ||||
-rw-r--r-- | kaddressbook/xxportmanager.cpp | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/incomingdialog.cpp | 3 | ||||
-rw-r--r-- | korganizer/korganizerE.pro | 4 | ||||
-rw-r--r-- | korganizer/publishdialog.cpp | 3 | ||||
-rw-r--r-- | libkdepim/libkdepim.pro | 2 | ||||
-rw-r--r-- | libkdepim/libkdepimE.pro | 2 |
14 files changed, 482 insertions, 13 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp new file mode 100644 index 0000000..b4717d7 --- a/dev/null +++ b/kabc/addresseeview.cpp | |||
@@ -0,0 +1,401 @@ | |||
1 | /* | ||
2 | This file is part of libkdepim. | ||
3 | |||
4 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | ||
5 | |||
6 | This library is free software; you can redistribute it and/or | ||
7 | modify it under the terms of the GNU Library General Public | ||
8 | License as published by the Free Software Foundation; either | ||
9 | version 2 of the License, or (at your option) any later version. | ||
10 | |||
11 | This library is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | Library General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU Library General Public License | ||
17 | along with this library; see the file COPYING.LIB. If not, write to | ||
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
19 | Boston, MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #include <kabc/address.h> | ||
23 | #include <kabc/addressee.h> | ||
24 | #include <kabc/phonenumber.h> | ||
25 | #include <kglobal.h> | ||
26 | //US#include <kglobalsettings.h> | ||
27 | #include <kiconloader.h> | ||
28 | #include <klocale.h> | ||
29 | //US #include <kstringhandler.h> | ||
30 | #include <qscrollview.h> | ||
31 | #include <qregexp.h> | ||
32 | #include <qfile.h> | ||
33 | #include <qapplication.h> | ||
34 | |||
35 | |||
36 | #include "externalapphandler.h" | ||
37 | #include "addresseeview.h" | ||
38 | |||
39 | |||
40 | //US #ifndef DESKTOP_VERSION | ||
41 | //US #include <qtopia/qcopenvelope_qws.h> | ||
42 | //US #include <qpe/qpeapplication.h> | ||
43 | //US #endif | ||
44 | |||
45 | //US static int kphoneInstalled = 0; | ||
46 | |||
47 | using namespace KPIM; | ||
48 | |||
49 | AddresseeView::AddresseeView( QWidget *parent, const char *name ) | ||
50 | //US : KTextBrowser( parent, name ) | ||
51 | : QTextBrowser( parent, name ) | ||
52 | |||
53 | |||
54 | { | ||
55 | //US setWrapPolicy( QTextEdit::AtWordBoundary ); | ||
56 | setLinkUnderline( false ); | ||
57 | // setVScrollBarMode( QScrollView::AlwaysOff ); | ||
58 | //setHScrollBarMode( QScrollView::AlwaysOff ); | ||
59 | |||
60 | //US QStyleSheet *sheet = styleSheet(); | ||
61 | //US QStyleSheetItem *link = sheet->item( "a" ); | ||
62 | //US link->setColor( KGlobalSettings::linkColor() ); | ||
63 | |||
64 | } | ||
65 | |||
66 | void AddresseeView::setSource(const QString& n) | ||
67 | { | ||
68 | //qDebug("********AddresseeView::setSource %s", n.latin1()); | ||
69 | |||
70 | if ( n.left( 6 ) == "mailto" ) | ||
71 | ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); | ||
72 | else if ( n.left( 7 ) == "phoneto" ) | ||
73 | ExternalAppHandler::instance()->callByPhone( n.mid(8) ); | ||
74 | else if ( n.left( 5 ) == "faxto" ) | ||
75 | ExternalAppHandler::instance()->callByFax( n.mid(6) ); | ||
76 | else if ( n.left( 5 ) == "smsto" ) | ||
77 | ExternalAppHandler::instance()->callBySMS( n.mid(6) ); | ||
78 | else if ( n.left( 7 ) == "pagerto" ) | ||
79 | ExternalAppHandler::instance()->callByPager( n.mid(8) ); | ||
80 | else if ( n.left( 5 ) == "sipto" ) | ||
81 | ExternalAppHandler::instance()->callBySIP( n.mid(6) ); | ||
82 | |||
83 | } | ||
84 | void AddresseeView::setAddressee( const KABC::Addressee& addr ) | ||
85 | { | ||
86 | ExternalAppHandler* eah = ExternalAppHandler::instance(); | ||
87 | bool kemailAvail = eah->isEmailAppAvailable(); | ||
88 | bool kphoneAvail = eah->isPhoneAppAvailable(); | ||
89 | bool kfaxAvail = eah->isFaxAppAvailable(); | ||
90 | bool ksmsAvail = eah->isSMSAppAvailable(); | ||
91 | bool kpagerAvail = eah->isPagerAppAvailable(); | ||
92 | bool ksipAvail = eah->isSIPAppAvailable(); | ||
93 | |||
94 | |||
95 | mAddressee = addr; | ||
96 | // clear view | ||
97 | setText( QString::null ); | ||
98 | |||
99 | if ( mAddressee.isEmpty() ) | ||
100 | return; | ||
101 | |||
102 | QString name = ( mAddressee.assembledName().isEmpty() ? | ||
103 | mAddressee.formattedName() : mAddressee.assembledName() ); | ||
104 | |||
105 | QString dynamicPart; | ||
106 | |||
107 | QStringList emails = mAddressee.emails(); | ||
108 | QStringList::ConstIterator emailIt; | ||
109 | QString type = i18n( "Email" ); | ||
110 | emailIt = emails.begin(); | ||
111 | if ( emailIt != emails.end() ) { | ||
112 | if ( kemailAvail ) { | ||
113 | dynamicPart += QString( | ||
114 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
115 | "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) | ||
116 | .arg( type ) | ||
117 | .arg( name ) | ||
118 | .arg( *emailIt ) | ||
119 | .arg( *emailIt ); | ||
120 | ++emailIt; | ||
121 | } else { | ||
122 | dynamicPart += QString( | ||
123 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
124 | "<td align=\"left\">%2</td></tr>" ) | ||
125 | .arg( type ) | ||
126 | .arg( *emailIt ); | ||
127 | ++emailIt; | ||
128 | } | ||
129 | } | ||
130 | if ( mAddressee.birthday().date().isValid() ) { | ||
131 | dynamicPart += QString( | ||
132 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
133 | "<td align=\"left\">%2</td></tr>" ) | ||
134 | .arg( i18n ("Birthday") ) | ||
135 | .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) ); | ||
136 | } | ||
137 | KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); | ||
138 | KABC::PhoneNumber::List::ConstIterator phoneIt; | ||
139 | QString extension; | ||
140 | int phonetype; | ||
141 | QString sms; | ||
142 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { | ||
143 | phonetype = (*phoneIt).type(); | ||
144 | if (ksmsAvail && | ||
145 | ( | ||
146 | ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || | ||
147 | ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) | ||
148 | ) | ||
149 | ) | ||
150 | { | ||
151 | sms = QString("<a href=\"smsto:%1 \">(sms)</a>" ) | ||
152 | .arg( (*phoneIt).number() ); | ||
153 | |||
154 | } | ||
155 | else | ||
156 | sms = ""; | ||
157 | |||
158 | extension = QString::null; | ||
159 | if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) { | ||
160 | if (kfaxAvail) extension = "faxto:"; | ||
161 | } | ||
162 | else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) { | ||
163 | if (kpagerAvail) extension = "pagerto:"; | ||
164 | } | ||
165 | else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) { | ||
166 | if (ksipAvail) extension = "sipto:"; | ||
167 | } | ||
168 | else if (kphoneAvail) { | ||
169 | extension = "phoneto:"; | ||
170 | } | ||
171 | else | ||
172 | extension = QString::null; | ||
173 | |||
174 | if ( !extension.isEmpty() ) { | ||
175 | dynamicPart += QString( | ||
176 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
177 | "<td align=\"left\"><a href=\"%2%3 \">%4</a> %5</td></tr>" ) | ||
178 | .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) | ||
179 | .arg( extension ) | ||
180 | .arg( (*phoneIt).number() ) | ||
181 | .arg( (*phoneIt).number() ) | ||
182 | .arg( sms ); | ||
183 | |||
184 | } else { | ||
185 | dynamicPart += QString( | ||
186 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
187 | "<td align=\"left\">%2 %3</td></tr>" ) | ||
188 | .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) | ||
189 | .arg( (*phoneIt).number() ) | ||
190 | .arg( sms ); | ||
191 | } | ||
192 | } | ||
193 | |||
194 | |||
195 | for ( ; emailIt != emails.end(); ++emailIt ) { | ||
196 | if ( kemailAvail ) { | ||
197 | dynamicPart += QString( | ||
198 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
199 | "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) | ||
200 | .arg( type ) | ||
201 | .arg( name ) | ||
202 | .arg( *emailIt ) | ||
203 | .arg( *emailIt ); | ||
204 | } else { | ||
205 | dynamicPart += QString( | ||
206 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
207 | "<td align=\"left\">%2</td></tr>" ) | ||
208 | .arg( type ) | ||
209 | .arg( *emailIt ); | ||
210 | } | ||
211 | } | ||
212 | |||
213 | if ( !mAddressee.url().url().isEmpty() ) { | ||
214 | dynamicPart += QString( | ||
215 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
216 | "<td align=\"left\">%2</td></tr>" ) | ||
217 | .arg( i18n( "Homepage" ) ) | ||
218 | //US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) ); | ||
219 | .arg( mAddressee.url().url() ); | ||
220 | //qDebug("AddresseeView::setAddressee has to be verified."); | ||
221 | } | ||
222 | |||
223 | KABC::Address::List addresses = mAddressee.addresses(); | ||
224 | KABC::Address::List::ConstIterator addrIt; | ||
225 | for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) { | ||
226 | if ( true /*(*addrIt).label().isEmpty()*/ ) { | ||
227 | QString formattedAddress = (*addrIt).formattedAddress().stripWhiteSpace(); | ||
228 | //US formattedAddress = formattedAddress.replace( '\n', "<br>" ); | ||
229 | //qDebug("adresss %s ",formattedAddress.latin1() ); | ||
230 | formattedAddress = formattedAddress.replace( QRegExp("\n"), "<br>" ); | ||
231 | //qDebug("AddresseeView::setAddressee has to be verified."); | ||
232 | |||
233 | dynamicPart += QString( | ||
234 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
235 | "<td align=\"left\">%2</td></tr>" ) | ||
236 | .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) | ||
237 | .arg( formattedAddress ); | ||
238 | } else { | ||
239 | |||
240 | dynamicPart += QString( | ||
241 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
242 | "<td align=\"left\">%2</td></tr>" ) | ||
243 | .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) | ||
244 | //US .arg( (*addrIt).label().replace( '\n', "<br>" ) ); | ||
245 | .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ ); | ||
246 | |||
247 | } | ||
248 | } | ||
249 | |||
250 | QString notes; | ||
251 | if ( !mAddressee.note().isEmpty() ) { | ||
252 | notes = QString( | ||
253 | "<tr>" | ||
254 | "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label | ||
255 | "<td align=\"left\">%2</td>" // note | ||
256 | "</tr>" ).arg( i18n( "Notes" ) ) | ||
257 | //US .arg( mAddressee.note().replace( '\n', "<br>" ) ); | ||
258 | .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); | ||
259 | //qDebug("AddresseeView::setAddressee has to be verified."); | ||
260 | } | ||
261 | |||
262 | QString aRole = ""; | ||
263 | QString aOrga = ""; | ||
264 | if ( true /*!mAddressee.role().isEmpty()*/ ) { | ||
265 | aRole = "<tr>" | ||
266 | "<td align=\"left\">" + mAddressee.role() + "</td>" | ||
267 | "</tr>"; | ||
268 | } | ||
269 | if ( true /*!mAddressee.organization().isEmpty()*/ ) { | ||
270 | aOrga = "<tr>" | ||
271 | "<td align=\"left\">" + mAddressee.organization() + "</td>" ; | ||
272 | "</tr>"; | ||
273 | } | ||
274 | mText = ""; | ||
275 | QString picString = ""; | ||
276 | KABC::Picture picture = mAddressee.photo(); | ||
277 | bool picAvailintern = false; | ||
278 | bool picAvailUrl = false; | ||
279 | if (! picture.undefined() ) { | ||
280 | picAvailintern = (picture.isIntern() && !picture.data().isNull()); | ||
281 | picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() ); | ||
282 | } | ||
283 | if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { | ||
284 | if ( picAvailintern ) { | ||
285 | QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); | ||
286 | } else { | ||
287 | if ( picAvailUrl ) { | ||
288 | QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() )); | ||
289 | } else { | ||
290 | QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) ); | ||
291 | } | ||
292 | } | ||
293 | picString = "<img src=\"myimage\" width=\"50\" height=\"70\">"; | ||
294 | mText = QString::fromLatin1( | ||
295 | "<html>" | ||
296 | "<body text=\"%1\" bgcolor=\"%2\">" // text and background color | ||
297 | "<table>" | ||
298 | "<tr>" | ||
299 | "<td rowspan=\"3\" align=\"right\" valign=\"top\">" | ||
300 | "%3" | ||
301 | "</td>" | ||
302 | "<td align=\"left\"><font size=\"+2\"><b>%4</b></font></td>" // name | ||
303 | "</tr>" | ||
304 | "%5" // role | ||
305 | "%6" // organization | ||
306 | "<td colspan=\"2\"> </td>" | ||
307 | "%7" // dynamic part | ||
308 | "%8" // notes | ||
309 | "</table>" | ||
310 | "</body>" | ||
311 | "</html>") | ||
312 | //US | ||
313 | .arg( /*KGlobalSettings::textColor().name()*/ "black" ) | ||
314 | //US | ||
315 | .arg( /*KGlobalSettings::baseColor().name()*/ "white" ) | ||
316 | .arg( picString ) | ||
317 | .arg( name ) | ||
318 | .arg( aRole ) | ||
319 | .arg( aOrga ) | ||
320 | .arg( dynamicPart ) | ||
321 | .arg( notes ); | ||
322 | |||
323 | } else { // no picture! | ||
324 | |||
325 | mText = "<table width=\"100%\">\n"; | ||
326 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; | ||
327 | #ifdef DESKTOP_VERSION | ||
328 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h1>"; | ||
329 | #else | ||
330 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h2>"; | ||
331 | #endif | ||
332 | |||
333 | #ifdef DESKTOP_VERSION | ||
334 | mText += "<font color=\"#FFFFFF\"> <em>" + name+"</em></font></h1>"; | ||
335 | #else | ||
336 | mText += "<font color=\"#FFFFFF\"> <em>" + name +"</em></font></h2>"; | ||
337 | #endif | ||
338 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; | ||
339 | |||
340 | mText += "<table><td colspan=\"2\"> </td>"; | ||
341 | /* | ||
342 | mText += QString("<tr><td align=\"right\"><b2>%1</b2></td>" | ||
343 | "<td align=\"left\"><b>%2</b></td></tr>" ) | ||
344 | .arg( i18n(" ") ) | ||
345 | .arg( name ); | ||
346 | */ | ||
347 | if ( ! mAddressee.role().isEmpty() ) | ||
348 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" | ||
349 | "<td align=\"left\">%2</td></tr>" ) | ||
350 | .arg( i18n(" ") ) | ||
351 | .arg( mAddressee.role()); | ||
352 | if ( ! mAddressee.organization().isEmpty() ) | ||
353 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" | ||
354 | "<td align=\"left\">%2</td></tr>" ) | ||
355 | .arg( i18n(" ") ) | ||
356 | .arg( mAddressee.organization()); | ||
357 | mText += dynamicPart; | ||
358 | mText += notes; | ||
359 | mText += "</table>"; | ||
360 | |||
361 | } | ||
362 | |||
363 | // at last display it... | ||
364 | setText( mText ); | ||
365 | |||
366 | } | ||
367 | |||
368 | KABC::Addressee AddresseeView::addressee() const | ||
369 | { | ||
370 | return mAddressee; | ||
371 | } | ||
372 | void AddresseeView::addTag(const QString & tag,const QString & text) | ||
373 | { | ||
374 | if ( text.isEmpty() ) | ||
375 | return; | ||
376 | int number=text.contains("\n"); | ||
377 | QString str = "<" + tag + ">"; | ||
378 | QString tmpText=text; | ||
379 | QString tmpStr=str; | ||
380 | if(number !=-1) | ||
381 | { | ||
382 | if (number > 0) { | ||
383 | int pos=0; | ||
384 | QString tmp; | ||
385 | for(int i=0;i<=number;i++) { | ||
386 | pos=tmpText.find("\n"); | ||
387 | tmp=tmpText.left(pos); | ||
388 | tmpText=tmpText.right(tmpText.length()-pos-1); | ||
389 | tmpStr+=tmp+"<br>"; | ||
390 | } | ||
391 | } | ||
392 | else tmpStr += tmpText; | ||
393 | tmpStr+="</" + tag + ">"; | ||
394 | mText.append(tmpStr); | ||
395 | } | ||
396 | else | ||
397 | { | ||
398 | str += text + "</" + tag + ">"; | ||
399 | mText.append(str); | ||
400 | } | ||
401 | } | ||
diff --git a/kabc/addresseeview.h b/kabc/addresseeview.h new file mode 100644 index 0000000..1865fc4 --- a/dev/null +++ b/kabc/addresseeview.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | This file is part of libkdepim. | ||
3 | |||
4 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | ||
5 | |||
6 | This library is free software; you can redistribute it and/or | ||
7 | modify it under the terms of the GNU Library General Public | ||
8 | License as published by the Free Software Foundation; either | ||
9 | version 2 of the License, or (at your option) any later version. | ||
10 | |||
11 | This library is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | Library General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU Library General Public License | ||
17 | along with this library; see the file COPYING.LIB. If not, write to | ||
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
19 | Boston, MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef KPIM_ADDRESSEEVIEW_H | ||
23 | #define KPIM_ADDRESSEEVIEW_H | ||
24 | |||
25 | #include <kabc/addressee.h> | ||
26 | |||
27 | //US #include <ktextbrowser.h> | ||
28 | #include <qtextbrowser.h> | ||
29 | |||
30 | namespace KPIM { | ||
31 | |||
32 | //US class AddresseeView : public KTextBrowser | ||
33 | class AddresseeView : public QTextBrowser | ||
34 | { | ||
35 | public: | ||
36 | AddresseeView( QWidget *parent = 0, const char *name = 0 ); | ||
37 | |||
38 | /** | ||
39 | Sets the addressee object. The addressee is displayed immediately. | ||
40 | |||
41 | @param addr The addressee object. | ||
42 | */ | ||
43 | void setAddressee( const KABC::Addressee& addr ); | ||
44 | void setSource(const QString& n); | ||
45 | /** | ||
46 | Returns the current addressee object. | ||
47 | */ | ||
48 | KABC::Addressee addressee() const; | ||
49 | |||
50 | private: | ||
51 | KABC::Addressee mAddressee; | ||
52 | QString mText; | ||
53 | void addTag(const QString & tag,const QString & text); | ||
54 | class AddresseeViewPrivate; | ||
55 | AddresseeViewPrivate *d; | ||
56 | }; | ||
57 | |||
58 | } | ||
59 | |||
60 | #endif | ||
diff --git a/kabc/kabc.pro b/kabc/kabc.pro index 417f5b0..d690acc 100644 --- a/kabc/kabc.pro +++ b/kabc/kabc.pro | |||
@@ -1,218 +1,220 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | #release debug | 3 | #release debug |
4 | DESTDIR=../bin | 4 | DESTDIR=../bin |
5 | 5 | ||
6 | TARGET = microkabc | 6 | TARGET = microkabc |
7 | 7 | ||
8 | include( ../variables.pri ) | 8 | include( ../variables.pri ) |
9 | 9 | ||
10 | INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim ../qtcompat ../microkde/kdeui .. | 10 | INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim ../qtcompat ../microkde/kdeui .. |
11 | 11 | ||
12 | #LIBS += -lmicrokde -lldap | 12 | #LIBS += -lmicrokde -lldap |
13 | LIBS += -L$(QPEDIR)/lib | 13 | LIBS += -L$(QPEDIR)/lib |
14 | DEFINES += KAB_EMBEDDED DESKTOP_VERSION | 14 | DEFINES += KAB_EMBEDDED DESKTOP_VERSION |
15 | unix : { | 15 | unix : { |
16 | 16 | ||
17 | OBJECTS_DIR = obj/unix | 17 | OBJECTS_DIR = obj/unix |
18 | MOC_DIR = moc/unix | 18 | MOC_DIR = moc/unix |
19 | } | 19 | } |
20 | win32: { | 20 | win32: { |
21 | DEFINES += _WIN32_ | 21 | DEFINES += _WIN32_ |
22 | OBJECTS_DIR = obj/win | 22 | OBJECTS_DIR = obj/win |
23 | MOC_DIR = moc/win | 23 | MOC_DIR = moc/win |
24 | } | 24 | } |
25 | INTERFACES = \ | 25 | INTERFACES = \ |
26 | 26 | ||
27 | 27 | ||
28 | HEADERS = \ | 28 | HEADERS = \ |
29 | resource.h \ | 29 | resource.h \ |
30 | stdaddressbook.h \ | 30 | stdaddressbook.h \ |
31 | agent.h \ | 31 | agent.h \ |
32 | geo.h \ | 32 | geo.h \ |
33 | key.h \ | 33 | key.h \ |
34 | field.h \ | 34 | field.h \ |
35 | plugin.h \ | 35 | plugin.h \ |
36 | address.h \ | 36 | address.h \ |
37 | addresseelist.h \ | 37 | addresseelist.h \ |
38 | addresseeview.h \ | ||
38 | formatfactory.h \ | 39 | formatfactory.h \ |
39 | formatplugin.h \ | 40 | formatplugin.h \ |
40 | phonenumber.h \ | 41 | phonenumber.h \ |
41 | distributionlist.h \ | 42 | distributionlist.h \ |
42 | distributionlistdialog.h \ | 43 | distributionlistdialog.h \ |
43 | distributionlisteditor.h \ | 44 | distributionlisteditor.h \ |
44 | vcardformatplugin.h \ | 45 | vcardformatplugin.h \ |
45 | formats/vcardformatplugin2.h \ | 46 | formats/vcardformatplugin2.h \ |
46 | picture.h \ | 47 | picture.h \ |
47 | secrecy.h \ | 48 | secrecy.h \ |
48 | sound.h \ | 49 | sound.h \ |
49 | addressbook.h \ | 50 | addressbook.h \ |
50 | syncprefwidget.h \ | 51 | syncprefwidget.h \ |
51 | timezone.h \ | 52 | timezone.h \ |
52 | tmpaddressbook.h \ | 53 | tmpaddressbook.h \ |
53 | addressee.h \ | 54 | addressee.h \ |
54 | addresseedialog.h \ | 55 | addresseedialog.h \ |
55 | vcardconverter.h \ | 56 | vcardconverter.h \ |
56 | vcard21parser.h \ | 57 | vcard21parser.h \ |
57 | vcardformatimpl.h \ | 58 | vcardformatimpl.h \ |
58 | plugins/file/resourcefile.h \ | 59 | plugins/file/resourcefile.h \ |
59 | plugins/file/resourcefileconfig.h \ | 60 | plugins/file/resourcefileconfig.h \ |
60 | plugins/dir/resourcedir.h \ | 61 | plugins/dir/resourcedir.h \ |
61 | plugins/dir/resourcedirconfig.h \ | 62 | plugins/dir/resourcedirconfig.h \ |
62 | vcardparser/vcardline.h \ | 63 | vcardparser/vcardline.h \ |
63 | vcardparser/vcard.h \ | 64 | vcardparser/vcard.h \ |
64 | vcardparser/vcardtool.h \ | 65 | vcardparser/vcardtool.h \ |
65 | vcardparser/vcardparser.h \ | 66 | vcardparser/vcardparser.h \ |
66 | vcard/include/VCardAdrParam.h \ | 67 | vcard/include/VCardAdrParam.h \ |
67 | vcard/include/VCardAdrValue.h \ | 68 | vcard/include/VCardAdrValue.h \ |
68 | vcard/include/VCardAgentParam.h \ | 69 | vcard/include/VCardAgentParam.h \ |
69 | vcard/include/VCardContentLine.h \ | 70 | vcard/include/VCardContentLine.h \ |
70 | vcard/include/VCardDateParam.h \ | 71 | vcard/include/VCardDateParam.h \ |
71 | vcard/include/VCardDateValue.h \ | 72 | vcard/include/VCardDateValue.h \ |
72 | vcard/include/VCardEmailParam.h \ | 73 | vcard/include/VCardEmailParam.h \ |
73 | vcard/include/VCardGeoValue.h \ | 74 | vcard/include/VCardGeoValue.h \ |
74 | vcard/include/VCardGroup.h \ | 75 | vcard/include/VCardGroup.h \ |
75 | vcard/include/VCardImageParam.h \ | 76 | vcard/include/VCardImageParam.h \ |
76 | vcard/include/VCardImageValue.h \ | 77 | vcard/include/VCardImageValue.h \ |
77 | vcard/include/VCardLangValue.h \ | 78 | vcard/include/VCardLangValue.h \ |
78 | vcard/include/VCardNValue.h \ | 79 | vcard/include/VCardNValue.h \ |
79 | vcard/include/VCardParam.h \ | 80 | vcard/include/VCardParam.h \ |
80 | vcard/include/VCardPhoneNumberValue.h \ | 81 | vcard/include/VCardPhoneNumberValue.h \ |
81 | vcard/include/VCardSourceParam.h \ | 82 | vcard/include/VCardSourceParam.h \ |
82 | vcard/include/VCardTelParam.h \ | 83 | vcard/include/VCardTelParam.h \ |
83 | vcard/include/VCardTextParam.h \ | 84 | vcard/include/VCardTextParam.h \ |
84 | vcard/include/VCardTextValue.h \ | 85 | vcard/include/VCardTextValue.h \ |
85 | vcard/include/VCardTextBinParam.h \ | 86 | vcard/include/VCardTextBinParam.h \ |
86 | vcard/include/VCardURIValue.h \ | 87 | vcard/include/VCardURIValue.h \ |
87 | vcard/include/VCardVCard.h \ | 88 | vcard/include/VCardVCard.h \ |
88 | vcard/include/VCardEntity.h \ | 89 | vcard/include/VCardEntity.h \ |
89 | vcard/include/VCardValue.h \ | 90 | vcard/include/VCardValue.h \ |
90 | vcard/include/VCardSoundValue.h \ | 91 | vcard/include/VCardSoundValue.h \ |
91 | vcard/include/VCardAgentValue.h \ | 92 | vcard/include/VCardAgentValue.h \ |
92 | vcard/include/VCardTelValue.h \ | 93 | vcard/include/VCardTelValue.h \ |
93 | vcard/include/VCardTextBinValue.h \ | 94 | vcard/include/VCardTextBinValue.h \ |
94 | vcard/include/VCardOrgValue.h \ | 95 | vcard/include/VCardOrgValue.h \ |
95 | vcard/include/VCardUTCValue.h \ | 96 | vcard/include/VCardUTCValue.h \ |
96 | vcard/include/VCardClassValue.h \ | 97 | vcard/include/VCardClassValue.h \ |
97 | vcard/include/VCardFloatValue.h \ | 98 | vcard/include/VCardFloatValue.h \ |
98 | vcard/include/VCardTextListValue.h \ | 99 | vcard/include/VCardTextListValue.h \ |
99 | vcard/include/generated/AdrParam-generated.h \ | 100 | vcard/include/generated/AdrParam-generated.h \ |
100 | vcard/include/generated/AdrValue-generated.h \ | 101 | vcard/include/generated/AdrValue-generated.h \ |
101 | vcard/include/generated/AgentParam-generated.h \ | 102 | vcard/include/generated/AgentParam-generated.h \ |
102 | vcard/include/generated/ContentLine-generated.h \ | 103 | vcard/include/generated/ContentLine-generated.h \ |
103 | vcard/include/generated/DateParam-generated.h \ | 104 | vcard/include/generated/DateParam-generated.h \ |
104 | vcard/include/generated/DateValue-generated.h \ | 105 | vcard/include/generated/DateValue-generated.h \ |
105 | vcard/include/generated/EmailParam-generated.h \ | 106 | vcard/include/generated/EmailParam-generated.h \ |
106 | vcard/include/generated/GeoValue-generated.h \ | 107 | vcard/include/generated/GeoValue-generated.h \ |
107 | vcard/include/generated/Group-generated.h \ | 108 | vcard/include/generated/Group-generated.h \ |
108 | vcard/include/generated/ImageParam-generated.h \ | 109 | vcard/include/generated/ImageParam-generated.h \ |
109 | vcard/include/generated/ImageValue-generated.h \ | 110 | vcard/include/generated/ImageValue-generated.h \ |
110 | vcard/include/generated/LangValue-generated.h \ | 111 | vcard/include/generated/LangValue-generated.h \ |
111 | vcard/include/generated/NValue-generated.h \ | 112 | vcard/include/generated/NValue-generated.h \ |
112 | vcard/include/generated/Param-generated.h \ | 113 | vcard/include/generated/Param-generated.h \ |
113 | vcard/include/generated/PhoneNumberValue-generated.h \ | 114 | vcard/include/generated/PhoneNumberValue-generated.h \ |
114 | vcard/include/generated/SourceParam-generated.h \ | 115 | vcard/include/generated/SourceParam-generated.h \ |
115 | vcard/include/generated/TelParam-generated.h \ | 116 | vcard/include/generated/TelParam-generated.h \ |
116 | vcard/include/generated/TextParam-generated.h \ | 117 | vcard/include/generated/TextParam-generated.h \ |
117 | vcard/include/generated/TextNSParam-generated.h \ | 118 | vcard/include/generated/TextNSParam-generated.h \ |
118 | vcard/include/generated/TextValue-generated.h \ | 119 | vcard/include/generated/TextValue-generated.h \ |
119 | vcard/include/generated/TextBinParam-generated.h \ | 120 | vcard/include/generated/TextBinParam-generated.h \ |
120 | vcard/include/generated/URIValue-generated.h \ | 121 | vcard/include/generated/URIValue-generated.h \ |
121 | vcard/include/generated/VCard-generated.h \ | 122 | vcard/include/generated/VCard-generated.h \ |
122 | vcard/include/generated/VCardEntity-generated.h \ | 123 | vcard/include/generated/VCardEntity-generated.h \ |
123 | vcard/include/generated/Value-generated.h \ | 124 | vcard/include/generated/Value-generated.h \ |
124 | vcard/include/generated/SoundValue-generated.h \ | 125 | vcard/include/generated/SoundValue-generated.h \ |
125 | vcard/include/generated/AgentValue-generated.h \ | 126 | vcard/include/generated/AgentValue-generated.h \ |
126 | vcard/include/generated/TelValue-generated.h \ | 127 | vcard/include/generated/TelValue-generated.h \ |
127 | vcard/include/generated/TextBinValue-generated.h \ | 128 | vcard/include/generated/TextBinValue-generated.h \ |
128 | vcard/include/generated/OrgValue-generated.h \ | 129 | vcard/include/generated/OrgValue-generated.h \ |
129 | vcard/include/generated/UTCValue-generated.h \ | 130 | vcard/include/generated/UTCValue-generated.h \ |
130 | vcard/include/generated/ClassValue-generated.h \ | 131 | vcard/include/generated/ClassValue-generated.h \ |
131 | vcard/include/generated/FloatValue-generated.h \ | 132 | vcard/include/generated/FloatValue-generated.h \ |
132 | vcard/include/generated/TextListValue-generated.h | 133 | vcard/include/generated/TextListValue-generated.h |
133 | 134 | ||
134 | 135 | ||
135 | # plugins/ldap/resourceldap.h \ | 136 | # plugins/ldap/resourceldap.h \ |
136 | # plugins/ldap/resourceldapconfig.h \ | 137 | # plugins/ldap/resourceldapconfig.h \ |
137 | #formats/binary/binaryformat.h \ | 138 | #formats/binary/binaryformat.h \ |
138 | 139 | ||
139 | #vcard/include/VCardTextNSParam.h \ | 140 | #vcard/include/VCardTextNSParam.h \ |
140 | 141 | ||
141 | SOURCES = \ | 142 | SOURCES = \ |
142 | distributionlist.cpp \ | 143 | distributionlist.cpp \ |
143 | distributionlistdialog.cpp \ | 144 | distributionlistdialog.cpp \ |
144 | distributionlisteditor.cpp \ | 145 | distributionlisteditor.cpp \ |
145 | vcardformatplugin.cpp \ | 146 | vcardformatplugin.cpp \ |
146 | formats/vcardformatplugin2.cpp \ | 147 | formats/vcardformatplugin2.cpp \ |
147 | formatfactory.cpp \ | 148 | formatfactory.cpp \ |
148 | resource.cpp \ | 149 | resource.cpp \ |
149 | stdaddressbook.cpp \ | 150 | stdaddressbook.cpp \ |
150 | plugin.cpp \ | 151 | plugin.cpp \ |
151 | agent.cpp \ | 152 | agent.cpp \ |
152 | geo.cpp \ | 153 | geo.cpp \ |
153 | key.cpp \ | 154 | key.cpp \ |
154 | field.cpp \ | 155 | field.cpp \ |
156 | addresseeview.cpp \ | ||
155 | address.cpp \ | 157 | address.cpp \ |
156 | phonenumber.cpp \ | 158 | phonenumber.cpp \ |
157 | picture.cpp \ | 159 | picture.cpp \ |
158 | secrecy.cpp \ | 160 | secrecy.cpp \ |
159 | sound.cpp \ | 161 | sound.cpp \ |
160 | addressbook.cpp \ | 162 | addressbook.cpp \ |
161 | syncprefwidget.cpp \ | 163 | syncprefwidget.cpp \ |
162 | timezone.cpp \ | 164 | timezone.cpp \ |
163 | tmpaddressbook.cpp \ | 165 | tmpaddressbook.cpp \ |
164 | addressee.cpp \ | 166 | addressee.cpp \ |
165 | addresseelist.cpp \ | 167 | addresseelist.cpp \ |
166 | addresseedialog.cpp \ | 168 | addresseedialog.cpp \ |
167 | vcardconverter.cpp \ | 169 | vcardconverter.cpp \ |
168 | vcard21parser.cpp \ | 170 | vcard21parser.cpp \ |
169 | vcardformatimpl.cpp \ | 171 | vcardformatimpl.cpp \ |
170 | plugins/file/resourcefile.cpp \ | 172 | plugins/file/resourcefile.cpp \ |
171 | plugins/file/resourcefileconfig.cpp \ | 173 | plugins/file/resourcefileconfig.cpp \ |
172 | plugins/dir/resourcedir.cpp \ | 174 | plugins/dir/resourcedir.cpp \ |
173 | plugins/dir/resourcedirconfig.cpp \ | 175 | plugins/dir/resourcedirconfig.cpp \ |
174 | vcardparser/vcardline.cpp \ | 176 | vcardparser/vcardline.cpp \ |
175 | vcardparser/vcard.cpp \ | 177 | vcardparser/vcard.cpp \ |
176 | vcardparser/vcardtool.cpp \ | 178 | vcardparser/vcardtool.cpp \ |
177 | vcardparser/vcardparser.cpp \ | 179 | vcardparser/vcardparser.cpp \ |
178 | vcard/AdrParam.cpp \ | 180 | vcard/AdrParam.cpp \ |
179 | vcard/AdrValue.cpp \ | 181 | vcard/AdrValue.cpp \ |
180 | vcard/AgentParam.cpp \ | 182 | vcard/AgentParam.cpp \ |
181 | vcard/ContentLine.cpp \ | 183 | vcard/ContentLine.cpp \ |
182 | vcard/DateParam.cpp \ | 184 | vcard/DateParam.cpp \ |
183 | vcard/DateValue.cpp \ | 185 | vcard/DateValue.cpp \ |
184 | vcard/EmailParam.cpp \ | 186 | vcard/EmailParam.cpp \ |
185 | vcard/Entity.cpp \ | 187 | vcard/Entity.cpp \ |
186 | vcard/Enum.cpp \ | 188 | vcard/Enum.cpp \ |
187 | vcard/GeoValue.cpp \ | 189 | vcard/GeoValue.cpp \ |
188 | vcard/ImageParam.cpp \ | 190 | vcard/ImageParam.cpp \ |
189 | vcard/ImageValue.cpp \ | 191 | vcard/ImageValue.cpp \ |
190 | vcard/LangValue.cpp \ | 192 | vcard/LangValue.cpp \ |
191 | vcard/NValue.cpp \ | 193 | vcard/NValue.cpp \ |
192 | vcard/Param.cpp \ | 194 | vcard/Param.cpp \ |
193 | vcard/PhoneNumberValue.cpp \ | 195 | vcard/PhoneNumberValue.cpp \ |
194 | vcard/RToken.cpp \ | 196 | vcard/RToken.cpp \ |
195 | vcard/SourceParam.cpp \ | 197 | vcard/SourceParam.cpp \ |
196 | vcard/TelParam.cpp \ | 198 | vcard/TelParam.cpp \ |
197 | vcard/TextParam.cpp \ | 199 | vcard/TextParam.cpp \ |
198 | vcard/TextValue.cpp \ | 200 | vcard/TextValue.cpp \ |
199 | vcard/TextBinParam.cpp \ | 201 | vcard/TextBinParam.cpp \ |
200 | vcard/URIValue.cpp \ | 202 | vcard/URIValue.cpp \ |
201 | vcard/VCardv.cpp \ | 203 | vcard/VCardv.cpp \ |
202 | vcard/VCardEntity.cpp \ | 204 | vcard/VCardEntity.cpp \ |
203 | vcard/Value.cpp \ | 205 | vcard/Value.cpp \ |
204 | vcard/SoundValue.cpp \ | 206 | vcard/SoundValue.cpp \ |
205 | vcard/AgentValue.cpp \ | 207 | vcard/AgentValue.cpp \ |
206 | vcard/TelValue.cpp \ | 208 | vcard/TelValue.cpp \ |
207 | vcard/TextBinValue.cpp \ | 209 | vcard/TextBinValue.cpp \ |
208 | vcard/OrgValue.cpp \ | 210 | vcard/OrgValue.cpp \ |
209 | vcard/UTCValue.cpp \ | 211 | vcard/UTCValue.cpp \ |
210 | vcard/ClassValue.cpp \ | 212 | vcard/ClassValue.cpp \ |
211 | vcard/FloatValue.cpp \ | 213 | vcard/FloatValue.cpp \ |
212 | vcard/TextListValue.cpp | 214 | vcard/TextListValue.cpp |
213 | 215 | ||
214 | 216 | ||
215 | # plugins/ldap/resourceldap.cpp \ | 217 | # plugins/ldap/resourceldap.cpp \ |
216 | # plugins/ldap/resourceldapconfig.cpp \ | 218 | # plugins/ldap/resourceldapconfig.cpp \ |
217 | 219 | ||
218 | #formats/binary/binaryformat.cpp \ | 220 | #formats/binary/binaryformat.cpp \ |
diff --git a/kabc/kabcE.pro b/kabc/kabcE.pro index dfdbcff..b360e8c 100644 --- a/kabc/kabcE.pro +++ b/kabc/kabcE.pro | |||
@@ -1,193 +1,195 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | TARGET = microkabc | 3 | TARGET = microkabc |
4 | 4 | ||
5 | 5 | ||
6 | INCLUDEPATH += . $(KDEPIMDIR) vcard/include vcard/include/generated $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(QPEDIR)/include | 6 | INCLUDEPATH += . $(KDEPIMDIR) vcard/include vcard/include/generated $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(QPEDIR)/include |
7 | OBJECTS_DIR = obj/$(PLATFORM) | 7 | OBJECTS_DIR = obj/$(PLATFORM) |
8 | MOC_DIR = moc/$(PLATFORM) | 8 | MOC_DIR = moc/$(PLATFORM) |
9 | DESTDIR = $(QPEDIR)/lib | 9 | DESTDIR = $(QPEDIR)/lib |
10 | LIBS += -lmicrokde | 10 | LIBS += -lmicrokde |
11 | LIBS += -lmicrokdepim | 11 | LIBS += -lmicrokdepim |
12 | #LIBS += -lldap | 12 | #LIBS += -lldap |
13 | LIBS += -L$(QPEDIR)/lib | 13 | LIBS += -L$(QPEDIR)/lib |
14 | DEFINES += KAB_EMBEDDED | 14 | DEFINES += KAB_EMBEDDED |
15 | 15 | ||
16 | INTERFACES = \ | 16 | INTERFACES = \ |
17 | 17 | ||
18 | HEADERS = \ | 18 | HEADERS = \ |
19 | address.h \ | 19 | address.h \ |
20 | addressbook.h \ | 20 | addressbook.h \ |
21 | addressee.h \ | 21 | addressee.h \ |
22 | addresseedialog.h \ | 22 | addresseedialog.h \ |
23 | addresseelist.h \ | 23 | addresseelist.h \ |
24 | addresseeview.h \ | ||
24 | agent.h \ | 25 | agent.h \ |
25 | distributionlist.h \ | 26 | distributionlist.h \ |
26 | distributionlistdialog.h \ | 27 | distributionlistdialog.h \ |
27 | distributionlisteditor.h \ | 28 | distributionlisteditor.h \ |
28 | field.h \ | 29 | field.h \ |
29 | formatfactory.h \ | 30 | formatfactory.h \ |
30 | formatplugin.h \ | 31 | formatplugin.h \ |
31 | geo.h \ | 32 | geo.h \ |
32 | key.h \ | 33 | key.h \ |
33 | phonenumber.h \ | 34 | phonenumber.h \ |
34 | picture.h \ | 35 | picture.h \ |
35 | plugin.h \ | 36 | plugin.h \ |
36 | resource.h \ | 37 | resource.h \ |
37 | secrecy.h \ | 38 | secrecy.h \ |
38 | sound.h \ | 39 | sound.h \ |
39 | stdaddressbook.h \ | 40 | stdaddressbook.h \ |
40 | syncprefwidget.h \ | 41 | syncprefwidget.h \ |
41 | timezone.h \ | 42 | timezone.h \ |
42 | tmpaddressbook.h \ | 43 | tmpaddressbook.h \ |
43 | vcardconverter.h \ | 44 | vcardconverter.h \ |
44 | vcard21parser.h \ | 45 | vcard21parser.h \ |
45 | vcardformatimpl.h \ | 46 | vcardformatimpl.h \ |
46 | vcardformatplugin.h \ | 47 | vcardformatplugin.h \ |
47 | vcardparser/vcardline.h \ | 48 | vcardparser/vcardline.h \ |
48 | vcardparser/vcard.h \ | 49 | vcardparser/vcard.h \ |
49 | vcardparser/vcardtool.h \ | 50 | vcardparser/vcardtool.h \ |
50 | vcardparser/vcardparser.h \ | 51 | vcardparser/vcardparser.h \ |
51 | vcard/include/VCardAdrParam.h \ | 52 | vcard/include/VCardAdrParam.h \ |
52 | vcard/include/VCardAdrValue.h \ | 53 | vcard/include/VCardAdrValue.h \ |
53 | vcard/include/VCardAgentParam.h \ | 54 | vcard/include/VCardAgentParam.h \ |
54 | vcard/include/VCardContentLine.h \ | 55 | vcard/include/VCardContentLine.h \ |
55 | vcard/include/VCardDateParam.h \ | 56 | vcard/include/VCardDateParam.h \ |
56 | vcard/include/VCardDateValue.h \ | 57 | vcard/include/VCardDateValue.h \ |
57 | vcard/include/VCardEmailParam.h \ | 58 | vcard/include/VCardEmailParam.h \ |
58 | vcard/include/VCardGeoValue.h \ | 59 | vcard/include/VCardGeoValue.h \ |
59 | vcard/include/VCardGroup.h \ | 60 | vcard/include/VCardGroup.h \ |
60 | vcard/include/VCardImageParam.h \ | 61 | vcard/include/VCardImageParam.h \ |
61 | vcard/include/VCardImageValue.h \ | 62 | vcard/include/VCardImageValue.h \ |
62 | vcard/include/VCardLangValue.h \ | 63 | vcard/include/VCardLangValue.h \ |
63 | vcard/include/VCardNValue.h \ | 64 | vcard/include/VCardNValue.h \ |
64 | vcard/include/VCardParam.h \ | 65 | vcard/include/VCardParam.h \ |
65 | vcard/include/VCardPhoneNumberValue.h \ | 66 | vcard/include/VCardPhoneNumberValue.h \ |
66 | vcard/include/VCardSourceParam.h \ | 67 | vcard/include/VCardSourceParam.h \ |
67 | vcard/include/VCardTelParam.h \ | 68 | vcard/include/VCardTelParam.h \ |
68 | vcard/include/VCardTextParam.h \ | 69 | vcard/include/VCardTextParam.h \ |
69 | vcard/include/VCardTextNSParam.h \ | 70 | vcard/include/VCardTextNSParam.h \ |
70 | vcard/include/VCardTextValue.h \ | 71 | vcard/include/VCardTextValue.h \ |
71 | vcard/include/VCardTextBinParam.h \ | 72 | vcard/include/VCardTextBinParam.h \ |
72 | vcard/include/VCardURIValue.h \ | 73 | vcard/include/VCardURIValue.h \ |
73 | vcard/include/VCardVCard.h \ | 74 | vcard/include/VCardVCard.h \ |
74 | vcard/include/VCardEntity.h \ | 75 | vcard/include/VCardEntity.h \ |
75 | vcard/include/VCardValue.h \ | 76 | vcard/include/VCardValue.h \ |
76 | vcard/include/VCardSoundValue.h \ | 77 | vcard/include/VCardSoundValue.h \ |
77 | vcard/include/VCardAgentValue.h \ | 78 | vcard/include/VCardAgentValue.h \ |
78 | vcard/include/VCardTelValue.h \ | 79 | vcard/include/VCardTelValue.h \ |
79 | vcard/include/VCardTextBinValue.h \ | 80 | vcard/include/VCardTextBinValue.h \ |
80 | vcard/include/VCardOrgValue.h \ | 81 | vcard/include/VCardOrgValue.h \ |
81 | vcard/include/VCardUTCValue.h \ | 82 | vcard/include/VCardUTCValue.h \ |
82 | vcard/include/VCardClassValue.h \ | 83 | vcard/include/VCardClassValue.h \ |
83 | vcard/include/VCardFloatValue.h \ | 84 | vcard/include/VCardFloatValue.h \ |
84 | vcard/include/VCardTextListValue.h \ | 85 | vcard/include/VCardTextListValue.h \ |
85 | vcard/include/generated/AdrParam-generated.h \ | 86 | vcard/include/generated/AdrParam-generated.h \ |
86 | vcard/include/generated/AdrValue-generated.h \ | 87 | vcard/include/generated/AdrValue-generated.h \ |
87 | vcard/include/generated/AgentParam-generated.h \ | 88 | vcard/include/generated/AgentParam-generated.h \ |
88 | vcard/include/generated/ContentLine-generated.h \ | 89 | vcard/include/generated/ContentLine-generated.h \ |
89 | vcard/include/generated/DateParam-generated.h \ | 90 | vcard/include/generated/DateParam-generated.h \ |
90 | vcard/include/generated/DateValue-generated.h \ | 91 | vcard/include/generated/DateValue-generated.h \ |
91 | vcard/include/generated/EmailParam-generated.h \ | 92 | vcard/include/generated/EmailParam-generated.h \ |
92 | vcard/include/generated/GeoValue-generated.h \ | 93 | vcard/include/generated/GeoValue-generated.h \ |
93 | vcard/include/generated/Group-generated.h \ | 94 | vcard/include/generated/Group-generated.h \ |
94 | vcard/include/generated/ImageParam-generated.h \ | 95 | vcard/include/generated/ImageParam-generated.h \ |
95 | vcard/include/generated/ImageValue-generated.h \ | 96 | vcard/include/generated/ImageValue-generated.h \ |
96 | vcard/include/generated/LangValue-generated.h \ | 97 | vcard/include/generated/LangValue-generated.h \ |
97 | vcard/include/generated/NValue-generated.h \ | 98 | vcard/include/generated/NValue-generated.h \ |
98 | vcard/include/generated/Param-generated.h \ | 99 | vcard/include/generated/Param-generated.h \ |
99 | vcard/include/generated/PhoneNumberValue-generated.h \ | 100 | vcard/include/generated/PhoneNumberValue-generated.h \ |
100 | vcard/include/generated/SourceParam-generated.h \ | 101 | vcard/include/generated/SourceParam-generated.h \ |
101 | vcard/include/generated/TelParam-generated.h \ | 102 | vcard/include/generated/TelParam-generated.h \ |
102 | vcard/include/generated/TextParam-generated.h \ | 103 | vcard/include/generated/TextParam-generated.h \ |
103 | vcard/include/generated/TextNSParam-generated.h \ | 104 | vcard/include/generated/TextNSParam-generated.h \ |
104 | vcard/include/generated/TextValue-generated.h \ | 105 | vcard/include/generated/TextValue-generated.h \ |
105 | vcard/include/generated/TextBinParam-generated.h \ | 106 | vcard/include/generated/TextBinParam-generated.h \ |
106 | vcard/include/generated/URIValue-generated.h \ | 107 | vcard/include/generated/URIValue-generated.h \ |
107 | vcard/include/generated/VCard-generated.h \ | 108 | vcard/include/generated/VCard-generated.h \ |
108 | vcard/include/generated/VCardEntity-generated.h \ | 109 | vcard/include/generated/VCardEntity-generated.h \ |
109 | vcard/include/generated/Value-generated.h \ | 110 | vcard/include/generated/Value-generated.h \ |
110 | vcard/include/generated/SoundValue-generated.h \ | 111 | vcard/include/generated/SoundValue-generated.h \ |
111 | vcard/include/generated/AgentValue-generated.h \ | 112 | vcard/include/generated/AgentValue-generated.h \ |
112 | vcard/include/generated/TelValue-generated.h \ | 113 | vcard/include/generated/TelValue-generated.h \ |
113 | vcard/include/generated/TextBinValue-generated.h \ | 114 | vcard/include/generated/TextBinValue-generated.h \ |
114 | vcard/include/generated/OrgValue-generated.h \ | 115 | vcard/include/generated/OrgValue-generated.h \ |
115 | vcard/include/generated/UTCValue-generated.h \ | 116 | vcard/include/generated/UTCValue-generated.h \ |
116 | vcard/include/generated/ClassValue-generated.h \ | 117 | vcard/include/generated/ClassValue-generated.h \ |
117 | vcard/include/generated/FloatValue-generated.h \ | 118 | vcard/include/generated/FloatValue-generated.h \ |
118 | vcard/include/generated/TextListValue-generated.h | 119 | vcard/include/generated/TextListValue-generated.h |
119 | 120 | ||
120 | 121 | ||
121 | 122 | ||
122 | 123 | ||
123 | SOURCES = \ | 124 | SOURCES = \ |
124 | address.cpp \ | 125 | address.cpp \ |
125 | addressbook.cpp \ | 126 | addressbook.cpp \ |
126 | addressee.cpp \ | 127 | addressee.cpp \ |
127 | addresseedialog.cpp \ | 128 | addresseedialog.cpp \ |
128 | addresseelist.cpp \ | 129 | addresseelist.cpp \ |
130 | addresseeview.cpp \ | ||
129 | agent.cpp \ | 131 | agent.cpp \ |
130 | distributionlist.cpp \ | 132 | distributionlist.cpp \ |
131 | distributionlistdialog.cpp \ | 133 | distributionlistdialog.cpp \ |
132 | distributionlisteditor.cpp \ | 134 | distributionlisteditor.cpp \ |
133 | field.cpp \ | 135 | field.cpp \ |
134 | formatfactory.cpp \ | 136 | formatfactory.cpp \ |
135 | geo.cpp \ | 137 | geo.cpp \ |
136 | key.cpp \ | 138 | key.cpp \ |
137 | phonenumber.cpp \ | 139 | phonenumber.cpp \ |
138 | picture.cpp \ | 140 | picture.cpp \ |
139 | plugin.cpp \ | 141 | plugin.cpp \ |
140 | resource.cpp \ | 142 | resource.cpp \ |
141 | secrecy.cpp \ | 143 | secrecy.cpp \ |
142 | sound.cpp \ | 144 | sound.cpp \ |
143 | stdaddressbook.cpp \ | 145 | stdaddressbook.cpp \ |
144 | syncprefwidget.cpp \ | 146 | syncprefwidget.cpp \ |
145 | timezone.cpp \ | 147 | timezone.cpp \ |
146 | tmpaddressbook.cpp \ | 148 | tmpaddressbook.cpp \ |
147 | vcardconverter.cpp \ | 149 | vcardconverter.cpp \ |
148 | vcard21parser.cpp \ | 150 | vcard21parser.cpp \ |
149 | vcardformatimpl.cpp \ | 151 | vcardformatimpl.cpp \ |
150 | vcardformatplugin.cpp \ | 152 | vcardformatplugin.cpp \ |
151 | vcardparser/vcardline.cpp \ | 153 | vcardparser/vcardline.cpp \ |
152 | vcardparser/vcard.cpp \ | 154 | vcardparser/vcard.cpp \ |
153 | vcardparser/vcardtool.cpp \ | 155 | vcardparser/vcardtool.cpp \ |
154 | vcardparser/vcardparser.cpp \ | 156 | vcardparser/vcardparser.cpp \ |
155 | vcard/AdrParam.cpp \ | 157 | vcard/AdrParam.cpp \ |
156 | vcard/AdrValue.cpp \ | 158 | vcard/AdrValue.cpp \ |
157 | vcard/AgentParam.cpp \ | 159 | vcard/AgentParam.cpp \ |
158 | vcard/ContentLine.cpp \ | 160 | vcard/ContentLine.cpp \ |
159 | vcard/DateParam.cpp \ | 161 | vcard/DateParam.cpp \ |
160 | vcard/DateValue.cpp \ | 162 | vcard/DateValue.cpp \ |
161 | vcard/EmailParam.cpp \ | 163 | vcard/EmailParam.cpp \ |
162 | vcard/Entity.cpp \ | 164 | vcard/Entity.cpp \ |
163 | vcard/Enum.cpp \ | 165 | vcard/Enum.cpp \ |
164 | vcard/GeoValue.cpp \ | 166 | vcard/GeoValue.cpp \ |
165 | vcard/ImageParam.cpp \ | 167 | vcard/ImageParam.cpp \ |
166 | vcard/ImageValue.cpp \ | 168 | vcard/ImageValue.cpp \ |
167 | vcard/LangValue.cpp \ | 169 | vcard/LangValue.cpp \ |
168 | vcard/NValue.cpp \ | 170 | vcard/NValue.cpp \ |
169 | vcard/Param.cpp \ | 171 | vcard/Param.cpp \ |
170 | vcard/PhoneNumberValue.cpp \ | 172 | vcard/PhoneNumberValue.cpp \ |
171 | vcard/RToken.cpp \ | 173 | vcard/RToken.cpp \ |
172 | vcard/SourceParam.cpp \ | 174 | vcard/SourceParam.cpp \ |
173 | vcard/TelParam.cpp \ | 175 | vcard/TelParam.cpp \ |
174 | vcard/TextParam.cpp \ | 176 | vcard/TextParam.cpp \ |
175 | vcard/TextValue.cpp \ | 177 | vcard/TextValue.cpp \ |
176 | vcard/TextBinParam.cpp \ | 178 | vcard/TextBinParam.cpp \ |
177 | vcard/URIValue.cpp \ | 179 | vcard/URIValue.cpp \ |
178 | vcard/VCardv.cpp \ | 180 | vcard/VCardv.cpp \ |
179 | vcard/VCardEntity.cpp \ | 181 | vcard/VCardEntity.cpp \ |
180 | vcard/Value.cpp \ | 182 | vcard/Value.cpp \ |
181 | vcard/SoundValue.cpp \ | 183 | vcard/SoundValue.cpp \ |
182 | vcard/AgentValue.cpp \ | 184 | vcard/AgentValue.cpp \ |
183 | vcard/TelValue.cpp \ | 185 | vcard/TelValue.cpp \ |
184 | vcard/TextBinValue.cpp \ | 186 | vcard/TextBinValue.cpp \ |
185 | vcard/OrgValue.cpp \ | 187 | vcard/OrgValue.cpp \ |
186 | vcard/UTCValue.cpp \ | 188 | vcard/UTCValue.cpp \ |
187 | vcard/ClassValue.cpp \ | 189 | vcard/ClassValue.cpp \ |
188 | vcard/FloatValue.cpp \ | 190 | vcard/FloatValue.cpp \ |
189 | vcard/TextListValue.cpp | 191 | vcard/TextListValue.cpp |
190 | 192 | ||
191 | 193 | ||
192 | # plugins/ldap/resourceldap.cpp \ | 194 | # plugins/ldap/resourceldap.cpp \ |
193 | # plugins/ldap/resourceldapconfig.cpp \ | 195 | # plugins/ldap/resourceldapconfig.cpp \ |
diff --git a/kaddressbook/details/look_html.cpp b/kaddressbook/details/look_html.cpp index 2a70273..63364a7 100644 --- a/kaddressbook/details/look_html.cpp +++ b/kaddressbook/details/look_html.cpp | |||
@@ -1,45 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <libkdepim/addresseeview.h> | 24 | #include <addresseeview.h> |
25 | 25 | ||
26 | #include "look_html.h" | 26 | #include "look_html.h" |
27 | #include <qscrollview.h> | 27 | #include <qscrollview.h> |
28 | KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) | 28 | KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) |
29 | : KABBasicLook( parent, name ) | 29 | : KABBasicLook( parent, name ) |
30 | { | 30 | { |
31 | mView = new KPIM::AddresseeView( this ); | 31 | mView = new KPIM::AddresseeView( this ); |
32 | } | 32 | } |
33 | 33 | ||
34 | KABHtmlView::~KABHtmlView() | 34 | KABHtmlView::~KABHtmlView() |
35 | { | 35 | { |
36 | } | 36 | } |
37 | 37 | ||
38 | void KABHtmlView::setAddressee( const KABC::Addressee &addr ) | 38 | void KABHtmlView::setAddressee( const KABC::Addressee &addr ) |
39 | { | 39 | { |
40 | mView->setAddressee( addr ); | 40 | mView->setAddressee( addr ); |
41 | } | 41 | } |
42 | 42 | ||
43 | #ifndef KAB_EMBEDDED | 43 | #ifndef KAB_EMBEDDED |
44 | #include "look_html.moc" | 44 | #include "look_html.moc" |
45 | #endif //KAB_EMBEDDED | 45 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index f21507a..32dd43a 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1,463 +1,463 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressbook. | 2 | This file is part of KAddressbook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "kabcore.h" | 31 | #include "kabcore.h" |
32 | 32 | ||
33 | #include <stdaddressbook.h> | 33 | #include <stdaddressbook.h> |
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | 35 | ||
36 | #ifndef KAB_EMBEDDED | 36 | #ifndef KAB_EMBEDDED |
37 | #include <qclipboard.h> | 37 | #include <qclipboard.h> |
38 | #include <qdir.h> | 38 | #include <qdir.h> |
39 | #include <qfile.h> | 39 | #include <qfile.h> |
40 | #include <qapplicaton.h> | 40 | #include <qapplicaton.h> |
41 | #include <qlayout.h> | 41 | #include <qlayout.h> |
42 | #include <qregexp.h> | 42 | #include <qregexp.h> |
43 | #include <qvbox.h> | 43 | #include <qvbox.h> |
44 | #include <kabc/addresseelist.h> | 44 | #include <kabc/addresseelist.h> |
45 | #include <kabc/errorhandler.h> | 45 | #include <kabc/errorhandler.h> |
46 | #include <kabc/resource.h> | 46 | #include <kabc/resource.h> |
47 | #include <kabc/vcardconverter.h> | 47 | #include <kabc/vcardconverter.h> |
48 | #include <kapplication.h> | 48 | #include <kapplication.h> |
49 | #include <kactionclasses.h> | 49 | #include <kactionclasses.h> |
50 | #include <kcmultidialog.h> | 50 | #include <kcmultidialog.h> |
51 | #include <kdebug.h> | 51 | #include <kdebug.h> |
52 | #include <kdeversion.h> | 52 | #include <kdeversion.h> |
53 | #include <kkeydialog.h> | 53 | #include <kkeydialog.h> |
54 | #include <kmessagebox.h> | 54 | #include <kmessagebox.h> |
55 | #include <kprinter.h> | 55 | #include <kprinter.h> |
56 | #include <kprotocolinfo.h> | 56 | #include <kprotocolinfo.h> |
57 | #include <kresources/selectdialog.h> | 57 | #include <kresources/selectdialog.h> |
58 | #include <kstandarddirs.h> | 58 | #include <kstandarddirs.h> |
59 | #include <ktempfile.h> | 59 | #include <ktempfile.h> |
60 | #include <kxmlguiclient.h> | 60 | #include <kxmlguiclient.h> |
61 | #include <kaboutdata.h> | 61 | #include <kaboutdata.h> |
62 | #include <libkdepim/categoryselectdialog.h> | 62 | #include <libkdepim/categoryselectdialog.h> |
63 | 63 | ||
64 | #include "addresseeutil.h" | 64 | #include "addresseeutil.h" |
65 | #include "addresseeeditordialog.h" | 65 | #include "addresseeeditordialog.h" |
66 | #include "extensionmanager.h" | 66 | #include "extensionmanager.h" |
67 | #include "kstdaction.h" | 67 | #include "kstdaction.h" |
68 | #include "kaddressbookservice.h" | 68 | #include "kaddressbookservice.h" |
69 | #include "ldapsearchdialog.h" | 69 | #include "ldapsearchdialog.h" |
70 | #include "printing/printingwizard.h" | 70 | #include "printing/printingwizard.h" |
71 | #else // KAB_EMBEDDED | 71 | #else // KAB_EMBEDDED |
72 | 72 | ||
73 | #include <kapplication.h> | 73 | #include <kapplication.h> |
74 | #include "KDGanttMinimizeSplitter.h" | 74 | #include "KDGanttMinimizeSplitter.h" |
75 | #include "kaddressbookmain.h" | 75 | #include "kaddressbookmain.h" |
76 | #include "kactioncollection.h" | 76 | #include "kactioncollection.h" |
77 | #include "addresseedialog.h" | 77 | #include "addresseedialog.h" |
78 | //US | 78 | //US |
79 | #include <libkdepim/addresseeview.h> | 79 | #include <addresseeview.h> |
80 | 80 | ||
81 | #include <qapp.h> | 81 | #include <qapp.h> |
82 | #include <qmenubar.h> | 82 | #include <qmenubar.h> |
83 | //#include <qtoolbar.h> | 83 | //#include <qtoolbar.h> |
84 | #include <qmessagebox.h> | 84 | #include <qmessagebox.h> |
85 | #include <kdebug.h> | 85 | #include <kdebug.h> |
86 | #include <kiconloader.h> // needed for SmallIcon | 86 | #include <kiconloader.h> // needed for SmallIcon |
87 | #include <kresources/kcmkresources.h> | 87 | #include <kresources/kcmkresources.h> |
88 | #include <ktoolbar.h> | 88 | #include <ktoolbar.h> |
89 | 89 | ||
90 | 90 | ||
91 | //#include <qlabel.h> | 91 | //#include <qlabel.h> |
92 | 92 | ||
93 | 93 | ||
94 | #ifndef DESKTOP_VERSION | 94 | #ifndef DESKTOP_VERSION |
95 | #include <qpe/ir.h> | 95 | #include <qpe/ir.h> |
96 | #include <qpe/qpemenubar.h> | 96 | #include <qpe/qpemenubar.h> |
97 | #include <qtopia/qcopenvelope_qws.h> | 97 | #include <qtopia/qcopenvelope_qws.h> |
98 | #else | 98 | #else |
99 | 99 | ||
100 | #include <qmenubar.h> | 100 | #include <qmenubar.h> |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #endif // KAB_EMBEDDED | 103 | #endif // KAB_EMBEDDED |
104 | #include "kcmconfigs/kcmkabconfig.h" | 104 | #include "kcmconfigs/kcmkabconfig.h" |
105 | #include "kcmconfigs/kcmkdepimconfig.h" | 105 | #include "kcmconfigs/kcmkdepimconfig.h" |
106 | #include "kpimglobalprefs.h" | 106 | #include "kpimglobalprefs.h" |
107 | #include "externalapphandler.h" | 107 | #include "externalapphandler.h" |
108 | 108 | ||
109 | 109 | ||
110 | #include <kresources/selectdialog.h> | 110 | #include <kresources/selectdialog.h> |
111 | #include <kmessagebox.h> | 111 | #include <kmessagebox.h> |
112 | 112 | ||
113 | #include <picture.h> | 113 | #include <picture.h> |
114 | #include <resource.h> | 114 | #include <resource.h> |
115 | 115 | ||
116 | //US#include <qsplitter.h> | 116 | //US#include <qsplitter.h> |
117 | #include <qmap.h> | 117 | #include <qmap.h> |
118 | #include <qdir.h> | 118 | #include <qdir.h> |
119 | #include <qfile.h> | 119 | #include <qfile.h> |
120 | #include <qvbox.h> | 120 | #include <qvbox.h> |
121 | #include <qlayout.h> | 121 | #include <qlayout.h> |
122 | #include <qclipboard.h> | 122 | #include <qclipboard.h> |
123 | #include <qtextstream.h> | 123 | #include <qtextstream.h> |
124 | 124 | ||
125 | #include <libkdepim/categoryselectdialog.h> | 125 | #include <libkdepim/categoryselectdialog.h> |
126 | #include <kabc/vcardconverter.h> | 126 | #include <kabc/vcardconverter.h> |
127 | 127 | ||
128 | 128 | ||
129 | #include "addresseeutil.h" | 129 | #include "addresseeutil.h" |
130 | #include "undocmds.h" | 130 | #include "undocmds.h" |
131 | #include "addresseeeditordialog.h" | 131 | #include "addresseeeditordialog.h" |
132 | #include "viewmanager.h" | 132 | #include "viewmanager.h" |
133 | #include "details/detailsviewcontainer.h" | 133 | #include "details/detailsviewcontainer.h" |
134 | #include "kabprefs.h" | 134 | #include "kabprefs.h" |
135 | #include "xxportmanager.h" | 135 | #include "xxportmanager.h" |
136 | #include "incsearchwidget.h" | 136 | #include "incsearchwidget.h" |
137 | #include "jumpbuttonbar.h" | 137 | #include "jumpbuttonbar.h" |
138 | #include "extensionmanager.h" | 138 | #include "extensionmanager.h" |
139 | #include "addresseeconfig.h" | 139 | #include "addresseeconfig.h" |
140 | #include <kcmultidialog.h> | 140 | #include <kcmultidialog.h> |
141 | 141 | ||
142 | #ifdef _WIN32_ | 142 | #ifdef _WIN32_ |
143 | 143 | ||
144 | #include "kaimportoldialog.h" | 144 | #include "kaimportoldialog.h" |
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | bool pasteWithNewUid = true; | 147 | bool pasteWithNewUid = true; |
148 | 148 | ||
149 | #ifdef KAB_EMBEDDED | 149 | #ifdef KAB_EMBEDDED |
150 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 150 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) |
151 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), | 151 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), |
152 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ | 152 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ |
153 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) | 153 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) |
154 | #else //KAB_EMBEDDED | 154 | #else //KAB_EMBEDDED |
155 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 155 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) |
156 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), | 156 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), |
157 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), | 157 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), |
158 | mReadWrite( readWrite ), mModified( false ) | 158 | mReadWrite( readWrite ), mModified( false ) |
159 | #endif //KAB_EMBEDDED | 159 | #endif //KAB_EMBEDDED |
160 | { | 160 | { |
161 | 161 | ||
162 | mExtensionBarSplitter = 0; | 162 | mExtensionBarSplitter = 0; |
163 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 163 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
164 | 164 | ||
165 | mAddressBook = KABC::StdAddressBook::self(); | 165 | mAddressBook = KABC::StdAddressBook::self(); |
166 | KABC::StdAddressBook::setAutomaticSave( false ); | 166 | KABC::StdAddressBook::setAutomaticSave( false ); |
167 | 167 | ||
168 | #ifndef KAB_EMBEDDED | 168 | #ifndef KAB_EMBEDDED |
169 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 169 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
170 | #endif //KAB_EMBEDDED | 170 | #endif //KAB_EMBEDDED |
171 | 171 | ||
172 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 172 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
173 | SLOT( addressBookChanged() ) ); | 173 | SLOT( addressBookChanged() ) ); |
174 | 174 | ||
175 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 175 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
176 | "X-Department", "KADDRESSBOOK" ); | 176 | "X-Department", "KADDRESSBOOK" ); |
177 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 177 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
178 | "X-Profession", "KADDRESSBOOK" ); | 178 | "X-Profession", "KADDRESSBOOK" ); |
179 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 179 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
180 | "X-AssistantsName", "KADDRESSBOOK" ); | 180 | "X-AssistantsName", "KADDRESSBOOK" ); |
181 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 181 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
182 | "X-ManagersName", "KADDRESSBOOK" ); | 182 | "X-ManagersName", "KADDRESSBOOK" ); |
183 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 183 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |
184 | "X-SpousesName", "KADDRESSBOOK" ); | 184 | "X-SpousesName", "KADDRESSBOOK" ); |
185 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, | 185 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, |
186 | "X-Office", "KADDRESSBOOK" ); | 186 | "X-Office", "KADDRESSBOOK" ); |
187 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 187 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
188 | "X-IMAddress", "KADDRESSBOOK" ); | 188 | "X-IMAddress", "KADDRESSBOOK" ); |
189 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 189 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
190 | "X-Anniversary", "KADDRESSBOOK" ); | 190 | "X-Anniversary", "KADDRESSBOOK" ); |
191 | 191 | ||
192 | //US added this field to become compatible with Opie/qtopia addressbook | 192 | //US added this field to become compatible with Opie/qtopia addressbook |
193 | // values can be "female" or "male" or "". An empty field represents undefined. | 193 | // values can be "female" or "male" or "". An empty field represents undefined. |
194 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 194 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
195 | "X-Gender", "KADDRESSBOOK" ); | 195 | "X-Gender", "KADDRESSBOOK" ); |
196 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 196 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
197 | "X-Children", "KADDRESSBOOK" ); | 197 | "X-Children", "KADDRESSBOOK" ); |
198 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 198 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
199 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 199 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |
200 | 200 | ||
201 | initGUI(); | 201 | initGUI(); |
202 | 202 | ||
203 | mIncSearchWidget->setFocus(); | 203 | mIncSearchWidget->setFocus(); |
204 | 204 | ||
205 | 205 | ||
206 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 206 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
207 | SLOT( setContactSelected( const QString& ) ) ); | 207 | SLOT( setContactSelected( const QString& ) ) ); |
208 | connect( mViewManager, SIGNAL( executed( const QString& ) ), | 208 | connect( mViewManager, SIGNAL( executed( const QString& ) ), |
209 | SLOT( executeContact( const QString& ) ) ); | 209 | SLOT( executeContact( const QString& ) ) ); |
210 | 210 | ||
211 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 211 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
212 | SLOT( deleteContacts( ) ) ); | 212 | SLOT( deleteContacts( ) ) ); |
213 | connect( mViewManager, SIGNAL( modified() ), | 213 | connect( mViewManager, SIGNAL( modified() ), |
214 | SLOT( setModified() ) ); | 214 | SLOT( setModified() ) ); |
215 | 215 | ||
216 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 216 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
217 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); | 217 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); |
218 | 218 | ||
219 | connect( mXXPortManager, SIGNAL( modified() ), | 219 | connect( mXXPortManager, SIGNAL( modified() ), |
220 | SLOT( setModified() ) ); | 220 | SLOT( setModified() ) ); |
221 | 221 | ||
222 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 222 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
223 | SLOT( incrementalSearch( const QString& ) ) ); | 223 | SLOT( incrementalSearch( const QString& ) ) ); |
224 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 224 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
225 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 225 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
226 | 226 | ||
227 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 227 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
228 | SLOT( sendMail( const QString& ) ) ); | 228 | SLOT( sendMail( const QString& ) ) ); |
229 | 229 | ||
230 | 230 | ||
231 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 231 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
232 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 232 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
233 | 233 | ||
234 | 234 | ||
235 | #ifndef KAB_EMBEDDED | 235 | #ifndef KAB_EMBEDDED |
236 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 236 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
237 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 237 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
238 | 238 | ||
239 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 239 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
240 | SLOT( browse( const QString& ) ) ); | 240 | SLOT( browse( const QString& ) ) ); |
241 | 241 | ||
242 | 242 | ||
243 | mAddressBookService = new KAddressBookService( this ); | 243 | mAddressBookService = new KAddressBookService( this ); |
244 | 244 | ||
245 | #endif //KAB_EMBEDDED | 245 | #endif //KAB_EMBEDDED |
246 | mEditorDialog = 0; | 246 | mEditorDialog = 0; |
247 | createAddresseeEditorDialog( this ); | 247 | createAddresseeEditorDialog( this ); |
248 | setModified( false ); | 248 | setModified( false ); |
249 | } | 249 | } |
250 | 250 | ||
251 | KABCore::~KABCore() | 251 | KABCore::~KABCore() |
252 | { | 252 | { |
253 | // save(); | 253 | // save(); |
254 | //saveSettings(); | 254 | //saveSettings(); |
255 | //KABPrefs::instance()->writeConfig(); | 255 | //KABPrefs::instance()->writeConfig(); |
256 | delete AddresseeConfig::instance(); | 256 | delete AddresseeConfig::instance(); |
257 | mAddressBook = 0; | 257 | mAddressBook = 0; |
258 | KABC::StdAddressBook::close(); | 258 | KABC::StdAddressBook::close(); |
259 | } | 259 | } |
260 | 260 | ||
261 | void KABCore::restoreSettings() | 261 | void KABCore::restoreSettings() |
262 | { | 262 | { |
263 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 263 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
264 | 264 | ||
265 | bool state; | 265 | bool state; |
266 | 266 | ||
267 | if (mMultipleViewsAtOnce) | 267 | if (mMultipleViewsAtOnce) |
268 | state = KABPrefs::instance()->mDetailsPageVisible; | 268 | state = KABPrefs::instance()->mDetailsPageVisible; |
269 | else | 269 | else |
270 | state = false; | 270 | state = false; |
271 | 271 | ||
272 | mActionDetails->setChecked( state ); | 272 | mActionDetails->setChecked( state ); |
273 | setDetailsVisible( state ); | 273 | setDetailsVisible( state ); |
274 | 274 | ||
275 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 275 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
276 | 276 | ||
277 | mActionJumpBar->setChecked( state ); | 277 | mActionJumpBar->setChecked( state ); |
278 | setJumpButtonBarVisible( state ); | 278 | setJumpButtonBarVisible( state ); |
279 | /*US | 279 | /*US |
280 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 280 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
281 | if ( splitterSize.count() == 0 ) { | 281 | if ( splitterSize.count() == 0 ) { |
282 | splitterSize.append( width() / 2 ); | 282 | splitterSize.append( width() / 2 ); |
283 | splitterSize.append( width() / 2 ); | 283 | splitterSize.append( width() / 2 ); |
284 | } | 284 | } |
285 | mMiniSplitter->setSizes( splitterSize ); | 285 | mMiniSplitter->setSizes( splitterSize ); |
286 | if ( mExtensionBarSplitter ) { | 286 | if ( mExtensionBarSplitter ) { |
287 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 287 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
288 | if ( splitterSize.count() == 0 ) { | 288 | if ( splitterSize.count() == 0 ) { |
289 | splitterSize.append( width() / 2 ); | 289 | splitterSize.append( width() / 2 ); |
290 | splitterSize.append( width() / 2 ); | 290 | splitterSize.append( width() / 2 ); |
291 | } | 291 | } |
292 | mExtensionBarSplitter->setSizes( splitterSize ); | 292 | mExtensionBarSplitter->setSizes( splitterSize ); |
293 | 293 | ||
294 | } | 294 | } |
295 | */ | 295 | */ |
296 | mViewManager->restoreSettings(); | 296 | mViewManager->restoreSettings(); |
297 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 297 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
298 | mExtensionManager->restoreSettings(); | 298 | mExtensionManager->restoreSettings(); |
299 | #ifdef DESKTOP_VERSION | 299 | #ifdef DESKTOP_VERSION |
300 | int wid = width(); | 300 | int wid = width(); |
301 | if ( wid < 10 ) | 301 | if ( wid < 10 ) |
302 | wid = 400; | 302 | wid = 400; |
303 | #else | 303 | #else |
304 | int wid = QApplication::desktop()->width(); | 304 | int wid = QApplication::desktop()->width(); |
305 | if ( wid < 640 ) | 305 | if ( wid < 640 ) |
306 | wid = QApplication::desktop()->height(); | 306 | wid = QApplication::desktop()->height(); |
307 | #endif | 307 | #endif |
308 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; | 308 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; |
309 | if ( true /*splitterSize.count() == 0*/ ) { | 309 | if ( true /*splitterSize.count() == 0*/ ) { |
310 | splitterSize.append( wid / 2 ); | 310 | splitterSize.append( wid / 2 ); |
311 | splitterSize.append( wid / 2 ); | 311 | splitterSize.append( wid / 2 ); |
312 | } | 312 | } |
313 | mMiniSplitter->setSizes( splitterSize ); | 313 | mMiniSplitter->setSizes( splitterSize ); |
314 | if ( mExtensionBarSplitter ) { | 314 | if ( mExtensionBarSplitter ) { |
315 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 315 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
316 | if ( true /*splitterSize.count() == 0*/ ) { | 316 | if ( true /*splitterSize.count() == 0*/ ) { |
317 | splitterSize.append( wid / 2 ); | 317 | splitterSize.append( wid / 2 ); |
318 | splitterSize.append( wid / 2 ); | 318 | splitterSize.append( wid / 2 ); |
319 | } | 319 | } |
320 | mExtensionBarSplitter->setSizes( splitterSize ); | 320 | mExtensionBarSplitter->setSizes( splitterSize ); |
321 | 321 | ||
322 | } | 322 | } |
323 | 323 | ||
324 | 324 | ||
325 | } | 325 | } |
326 | 326 | ||
327 | void KABCore::saveSettings() | 327 | void KABCore::saveSettings() |
328 | { | 328 | { |
329 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 329 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
330 | if ( mExtensionBarSplitter ) | 330 | if ( mExtensionBarSplitter ) |
331 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 331 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
332 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 332 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
333 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 333 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
334 | #ifndef KAB_EMBEDDED | 334 | #ifndef KAB_EMBEDDED |
335 | 335 | ||
336 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 336 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
337 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 337 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
338 | #endif //KAB_EMBEDDED | 338 | #endif //KAB_EMBEDDED |
339 | mExtensionManager->saveSettings(); | 339 | mExtensionManager->saveSettings(); |
340 | mViewManager->saveSettings(); | 340 | mViewManager->saveSettings(); |
341 | 341 | ||
342 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 342 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
343 | } | 343 | } |
344 | 344 | ||
345 | KABC::AddressBook *KABCore::addressBook() const | 345 | KABC::AddressBook *KABCore::addressBook() const |
346 | { | 346 | { |
347 | return mAddressBook; | 347 | return mAddressBook; |
348 | } | 348 | } |
349 | 349 | ||
350 | KConfig *KABCore::config() | 350 | KConfig *KABCore::config() |
351 | { | 351 | { |
352 | #ifndef KAB_EMBEDDED | 352 | #ifndef KAB_EMBEDDED |
353 | return KABPrefs::instance()->config(); | 353 | return KABPrefs::instance()->config(); |
354 | #else //KAB_EMBEDDED | 354 | #else //KAB_EMBEDDED |
355 | return KABPrefs::instance()->getConfig(); | 355 | return KABPrefs::instance()->getConfig(); |
356 | #endif //KAB_EMBEDDED | 356 | #endif //KAB_EMBEDDED |
357 | } | 357 | } |
358 | 358 | ||
359 | KActionCollection *KABCore::actionCollection() const | 359 | KActionCollection *KABCore::actionCollection() const |
360 | { | 360 | { |
361 | return mGUIClient->actionCollection(); | 361 | return mGUIClient->actionCollection(); |
362 | } | 362 | } |
363 | 363 | ||
364 | KABC::Field *KABCore::currentSearchField() const | 364 | KABC::Field *KABCore::currentSearchField() const |
365 | { | 365 | { |
366 | if (mIncSearchWidget) | 366 | if (mIncSearchWidget) |
367 | return mIncSearchWidget->currentField(); | 367 | return mIncSearchWidget->currentField(); |
368 | else | 368 | else |
369 | return 0; | 369 | return 0; |
370 | } | 370 | } |
371 | 371 | ||
372 | QStringList KABCore::selectedUIDs() const | 372 | QStringList KABCore::selectedUIDs() const |
373 | { | 373 | { |
374 | return mViewManager->selectedUids(); | 374 | return mViewManager->selectedUids(); |
375 | } | 375 | } |
376 | 376 | ||
377 | KABC::Resource *KABCore::requestResource( QWidget *parent ) | 377 | KABC::Resource *KABCore::requestResource( QWidget *parent ) |
378 | { | 378 | { |
379 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); | 379 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); |
380 | 380 | ||
381 | QPtrList<KRES::Resource> kresResources; | 381 | QPtrList<KRES::Resource> kresResources; |
382 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); | 382 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); |
383 | KABC::Resource *resource; | 383 | KABC::Resource *resource; |
384 | while ( ( resource = resIt.current() ) != 0 ) { | 384 | while ( ( resource = resIt.current() ) != 0 ) { |
385 | ++resIt; | 385 | ++resIt; |
386 | if ( !resource->readOnly() ) { | 386 | if ( !resource->readOnly() ) { |
387 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 387 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
388 | if ( res ) | 388 | if ( res ) |
389 | kresResources.append( res ); | 389 | kresResources.append( res ); |
390 | } | 390 | } |
391 | } | 391 | } |
392 | 392 | ||
393 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); | 393 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); |
394 | return static_cast<KABC::Resource*>( res ); | 394 | return static_cast<KABC::Resource*>( res ); |
395 | } | 395 | } |
396 | 396 | ||
397 | #ifndef KAB_EMBEDDED | 397 | #ifndef KAB_EMBEDDED |
398 | KAboutData *KABCore::createAboutData() | 398 | KAboutData *KABCore::createAboutData() |
399 | #else //KAB_EMBEDDED | 399 | #else //KAB_EMBEDDED |
400 | void KABCore::createAboutData() | 400 | void KABCore::createAboutData() |
401 | #endif //KAB_EMBEDDED | 401 | #endif //KAB_EMBEDDED |
402 | { | 402 | { |
403 | #ifndef KAB_EMBEDDED | 403 | #ifndef KAB_EMBEDDED |
404 | KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), | 404 | KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), |
405 | "3.1", I18N_NOOP( "The KDE Address Book" ), | 405 | "3.1", I18N_NOOP( "The KDE Address Book" ), |
406 | KAboutData::License_GPL_V2, | 406 | KAboutData::License_GPL_V2, |
407 | I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); | 407 | I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); |
408 | about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); | 408 | about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); |
409 | about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); | 409 | about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); |
410 | about->addAuthor( "Cornelius Schumacher", | 410 | about->addAuthor( "Cornelius Schumacher", |
411 | I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), | 411 | I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), |
412 | "schumacher@kde.org" ); | 412 | "schumacher@kde.org" ); |
413 | about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), | 413 | about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), |
414 | "mpilone@slac.com" ); | 414 | "mpilone@slac.com" ); |
415 | about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); | 415 | about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); |
416 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); | 416 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); |
417 | about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), | 417 | about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), |
418 | "michel@klaralvdalens-datakonsult.se" ); | 418 | "michel@klaralvdalens-datakonsult.se" ); |
419 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), | 419 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), |
420 | "hansen@kde.org" ); | 420 | "hansen@kde.org" ); |
421 | 421 | ||
422 | return about; | 422 | return about; |
423 | #endif //KAB_EMBEDDED | 423 | #endif //KAB_EMBEDDED |
424 | 424 | ||
425 | QString version; | 425 | QString version; |
426 | #include <../version> | 426 | #include <../version> |
427 | QMessageBox::about( this, "About KAddressbook/Pi", | 427 | QMessageBox::about( this, "About KAddressbook/Pi", |
428 | "KAddressbook/Platform-independent\n" | 428 | "KAddressbook/Platform-independent\n" |
429 | "(KA/Pi) " +version + " - " + | 429 | "(KA/Pi) " +version + " - " + |
430 | #ifdef DESKTOP_VERSION | 430 | #ifdef DESKTOP_VERSION |
431 | "Desktop Edition\n" | 431 | "Desktop Edition\n" |
432 | #else | 432 | #else |
433 | "PDA-Edition\n" | 433 | "PDA-Edition\n" |
434 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 434 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
435 | #endif | 435 | #endif |
436 | 436 | ||
437 | "(c) 2004 Ulf Schenk\n" | 437 | "(c) 2004 Ulf Schenk\n" |
438 | "(c) 2004 Lutz Rogowski\n" | 438 | "(c) 2004 Lutz Rogowski\n" |
439 | "(c) 1997-2003, The KDE PIM Team\n" | 439 | "(c) 1997-2003, The KDE PIM Team\n" |
440 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" | 440 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" |
441 | "Don Sanders Original author\n" | 441 | "Don Sanders Original author\n" |
442 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" | 442 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" |
443 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" | 443 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" |
444 | "Greg Stern DCOP interface\n" | 444 | "Greg Stern DCOP interface\n" |
445 | "Mark Westcot Contact pinning\n" | 445 | "Mark Westcot Contact pinning\n" |
446 | "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" | 446 | "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" |
447 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" | 447 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" |
448 | #ifdef _WIN32_ | 448 | #ifdef _WIN32_ |
449 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" | 449 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" |
450 | #endif | 450 | #endif |
451 | ); | 451 | ); |
452 | } | 452 | } |
453 | 453 | ||
454 | void KABCore::setContactSelected( const QString &uid ) | 454 | void KABCore::setContactSelected( const QString &uid ) |
455 | { | 455 | { |
456 | KABC::Addressee addr = mAddressBook->findByUid( uid ); | 456 | KABC::Addressee addr = mAddressBook->findByUid( uid ); |
457 | if ( !mDetails->isHidden() ) | 457 | if ( !mDetails->isHidden() ) |
458 | mDetails->setAddressee( addr ); | 458 | mDetails->setAddressee( addr ); |
459 | 459 | ||
460 | if ( !addr.isEmpty() ) { | 460 | if ( !addr.isEmpty() ) { |
461 | emit contactSelected( addr.formattedName() ); | 461 | emit contactSelected( addr.formattedName() ); |
462 | KABC::Picture pic = addr.photo(); | 462 | KABC::Picture pic = addr.photo(); |
463 | if ( pic.isIntern() ) { | 463 | if ( pic.isIntern() ) { |
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro index 1c9eeef..c027895 100644 --- a/kaddressbook/kaddressbookE.pro +++ b/kaddressbook/kaddressbookE.pro | |||
@@ -1,159 +1,161 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | 3 | ||
4 | 4 | ||
5 | TARGET = kapi | 5 | TARGET = kapi |
6 | OBJECTS_DIR = obj/$(PLATFORM) | 6 | OBJECTS_DIR = obj/$(PLATFORM) |
7 | MOC_DIR = moc/$(PLATFORM) | 7 | MOC_DIR = moc/$(PLATFORM) |
8 | DESTDIR=$(QPEDIR)/bin | 8 | DESTDIR=$(QPEDIR)/bin |
9 | 9 | ||
10 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include | 10 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include |
11 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER | 11 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER |
12 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL | 12 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL |
13 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 13 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
14 | #DEFINES += KORG_NOLVALTERNATION | 14 | #DEFINES += KORG_NOLVALTERNATION |
15 | LIBS += -lmicrokdepim | 15 | #LIBS += -lmicrokdepim |
16 | LIBS += -lmicrokcal | 16 | #LIBS += -lmicrokcal |
17 | LIBS += -lmicrokde | 17 | LIBS += -lmicrokde |
18 | LIBS += -lmicroqtcompat | 18 | LIBS += -lmicroqtcompat |
19 | LIBS += -lmicrokabc | 19 | LIBS += -lmicrokabc |
20 | LIBS += -lqpe | 20 | LIBS += -lqpe |
21 | LIBS += -ljpeg | 21 | LIBS += -ljpeg |
22 | LIBS += $(QTOPIALIB) | 22 | LIBS += $(QTOPIALIB) |
23 | LIBS += -L$(QPEDIR)/lib | 23 | LIBS += -L$(QPEDIR)/lib |
24 | LIBS += -Wl,-export-dynamic | 24 | LIBS += -Wl,-export-dynamic |
25 | LIBS += $(GCC3EXTRALIB1) | ||
26 | LIBS += $(GCC3EXTRALIB2) | ||
25 | 27 | ||
26 | INTERFACES = \ | 28 | INTERFACES = \ |
27 | # filteredit_base.ui \ | 29 | # filteredit_base.ui \ |
28 | # kofilterview_base.ui \ | 30 | # kofilterview_base.ui \ |
29 | 31 | ||
30 | HEADERS = \ | 32 | HEADERS = \ |
31 | features/mergewidget.h \ | 33 | features/mergewidget.h \ |
32 | features/distributionlistwidget.h \ | 34 | features/distributionlistwidget.h \ |
33 | kcmconfigs/addresseewidget.h \ | 35 | kcmconfigs/addresseewidget.h \ |
34 | kcmconfigs/extensionconfigdialog.h \ | 36 | kcmconfigs/extensionconfigdialog.h \ |
35 | kcmconfigs/kcmkabconfig.h \ | 37 | kcmconfigs/kcmkabconfig.h \ |
36 | kcmconfigs/kabconfigwidget.h \ | 38 | kcmconfigs/kabconfigwidget.h \ |
37 | addresseeeditordialog.h \ | 39 | addresseeeditordialog.h \ |
38 | addresseeeditorwidget.h \ | 40 | addresseeeditorwidget.h \ |
39 | addresseditwidget.h \ | 41 | addresseditwidget.h \ |
40 | addresseeconfig.h \ | 42 | addresseeconfig.h \ |
41 | addresseeutil.h \ | 43 | addresseeutil.h \ |
42 | emaileditwidget.h \ | 44 | emaileditwidget.h \ |
43 | filtereditdialog.h \ | 45 | filtereditdialog.h \ |
44 | kaddressbookmain.h \ | 46 | kaddressbookmain.h \ |
45 | kabprefs.h \ | 47 | kabprefs.h \ |
46 | kabcore.h \ | 48 | kabcore.h \ |
47 | viewmanager.h \ | 49 | viewmanager.h \ |
48 | extensionmanager.h \ | 50 | extensionmanager.h \ |
49 | extensionwidget.h \ | 51 | extensionwidget.h \ |
50 | kaddressbookview.h \ | 52 | kaddressbookview.h \ |
51 | geowidget.h \ | 53 | geowidget.h \ |
52 | imagewidget.h \ | 54 | imagewidget.h \ |
53 | incsearchwidget.h \ | 55 | incsearchwidget.h \ |
54 | jumpbuttonbar.h \ | 56 | jumpbuttonbar.h \ |
55 | phoneeditwidget.h \ | 57 | phoneeditwidget.h \ |
56 | secrecywidget.h \ | 58 | secrecywidget.h \ |
57 | keywidget.h \ | 59 | keywidget.h \ |
58 | nameeditdialog.h \ | 60 | nameeditdialog.h \ |
59 | filter.h \ | 61 | filter.h \ |
60 | addviewdialog.h \ | 62 | addviewdialog.h \ |
61 | configurewidget.h \ | 63 | configurewidget.h \ |
62 | viewconfigurewidget.h \ | 64 | viewconfigurewidget.h \ |
63 | viewconfigurefieldspage.h \ | 65 | viewconfigurefieldspage.h \ |
64 | viewconfigurefilterpage.h \ | 66 | viewconfigurefilterpage.h \ |
65 | typecombo.h \ | 67 | typecombo.h \ |
66 | undo.h \ | 68 | undo.h \ |
67 | undocmds.h \ | 69 | undocmds.h \ |
68 | xxportmanager.h \ | 70 | xxportmanager.h \ |
69 | xxportobject.h \ | 71 | xxportobject.h \ |
70 | xxportselectdialog.h \ | 72 | xxportselectdialog.h \ |
71 | details/detailsviewcontainer.h \ | 73 | details/detailsviewcontainer.h \ |
72 | details/look_basic.h \ | 74 | details/look_basic.h \ |
73 | details/look_html.h \ | 75 | details/look_html.h \ |
74 | views/kaddressbookiconview.h \ | 76 | views/kaddressbookiconview.h \ |
75 | views/kaddressbooktableview.h \ | 77 | views/kaddressbooktableview.h \ |
76 | views/kaddressbookcardview.h \ | 78 | views/kaddressbookcardview.h \ |
77 | views/configuretableviewdialog.h \ | 79 | views/configuretableviewdialog.h \ |
78 | views/configurecardviewdialog.h \ | 80 | views/configurecardviewdialog.h \ |
79 | views/cardview.h \ | 81 | views/cardview.h \ |
80 | views/colorlistbox.h \ | 82 | views/colorlistbox.h \ |
81 | views/contactlistview.h \ | 83 | views/contactlistview.h \ |
82 | xxport/vcard_xxport.h \ | 84 | xxport/vcard_xxport.h \ |
83 | xxport/kde2_xxport.h \ | 85 | xxport/kde2_xxport.h \ |
84 | xxport/csv_xxport.h \ | 86 | xxport/csv_xxport.h \ |
85 | xxport/csvimportdialog.h \ | 87 | xxport/csvimportdialog.h \ |
86 | xxport/opie_xxport.h \ | 88 | xxport/opie_xxport.h \ |
87 | xxport/qtopia_xxport.h \ | 89 | xxport/qtopia_xxport.h \ |
88 | xxport/sharpdtm_xxport.h \ | 90 | xxport/sharpdtm_xxport.h \ |
89 | #details/look_details.h \ | 91 | #details/look_details.h \ |
90 | #mainwindoiw.h \ | 92 | #mainwindoiw.h \ |
91 | # alarmclient.h \ | 93 | # alarmclient.h \ |
92 | # calendarview.h \ | 94 | # calendarview.h \ |
93 | # customlistviewitem.h \ | 95 | # customlistviewitem.h \ |
94 | # datenavigator.h | 96 | # datenavigator.h |
95 | 97 | ||
96 | SOURCES = \ | 98 | SOURCES = \ |
97 | addresseeeditordialog.cpp \ | 99 | addresseeeditordialog.cpp \ |
98 | addresseeeditorwidget.cpp \ | 100 | addresseeeditorwidget.cpp \ |
99 | addresseditwidget.cpp \ | 101 | addresseditwidget.cpp \ |
100 | addresseeconfig.cpp \ | 102 | addresseeconfig.cpp \ |
101 | addresseeutil.cpp \ | 103 | addresseeutil.cpp \ |
102 | extensionmanager.cpp \ | 104 | extensionmanager.cpp \ |
103 | features/mergewidget.cpp \ | 105 | features/mergewidget.cpp \ |
104 | features/distributionlistwidget.cpp \ | 106 | features/distributionlistwidget.cpp \ |
105 | kcmconfigs/addresseewidget.cpp \ | 107 | kcmconfigs/addresseewidget.cpp \ |
106 | kcmconfigs/extensionconfigdialog.cpp \ | 108 | kcmconfigs/extensionconfigdialog.cpp \ |
107 | kcmconfigs/kcmkabconfig.cpp \ | 109 | kcmconfigs/kcmkabconfig.cpp \ |
108 | kcmconfigs/kabconfigwidget.cpp \ | 110 | kcmconfigs/kabconfigwidget.cpp \ |
109 | emaileditwidget.cpp \ | 111 | emaileditwidget.cpp \ |
110 | filtereditdialog.cpp \ | 112 | filtereditdialog.cpp \ |
111 | mainembedded.cpp \ | 113 | mainembedded.cpp \ |
112 | kaddressbookmain.cpp \ | 114 | kaddressbookmain.cpp \ |
113 | kabcore.cpp \ | 115 | kabcore.cpp \ |
114 | kabprefs.cpp \ | 116 | kabprefs.cpp \ |
115 | viewmanager.cpp \ | 117 | viewmanager.cpp \ |
116 | kaddressbookview.cpp \ | 118 | kaddressbookview.cpp \ |
117 | extensionwidget.cpp \ | 119 | extensionwidget.cpp \ |
118 | geowidget.cpp \ | 120 | geowidget.cpp \ |
119 | imagewidget.cpp \ | 121 | imagewidget.cpp \ |
120 | incsearchwidget.cpp \ | 122 | incsearchwidget.cpp \ |
121 | jumpbuttonbar.cpp \ | 123 | jumpbuttonbar.cpp \ |
122 | phoneeditwidget.cpp \ | 124 | phoneeditwidget.cpp \ |
123 | secrecywidget.cpp \ | 125 | secrecywidget.cpp \ |
124 | keywidget.cpp \ | 126 | keywidget.cpp \ |
125 | nameeditdialog.cpp \ | 127 | nameeditdialog.cpp \ |
126 | filter.cpp \ | 128 | filter.cpp \ |
127 | addviewdialog.cpp \ | 129 | addviewdialog.cpp \ |
128 | configurewidget.cpp \ | 130 | configurewidget.cpp \ |
129 | viewconfigurewidget.cpp \ | 131 | viewconfigurewidget.cpp \ |
130 | viewconfigurefieldspage.cpp \ | 132 | viewconfigurefieldspage.cpp \ |
131 | viewconfigurefilterpage.cpp \ | 133 | viewconfigurefilterpage.cpp \ |
132 | undo.cpp \ | 134 | undo.cpp \ |
133 | undocmds.cpp \ | 135 | undocmds.cpp \ |
134 | xxportmanager.cpp \ | 136 | xxportmanager.cpp \ |
135 | xxportobject.cpp \ | 137 | xxportobject.cpp \ |
136 | xxportselectdialog.cpp \ | 138 | xxportselectdialog.cpp \ |
137 | details/detailsviewcontainer.cpp \ | 139 | details/detailsviewcontainer.cpp \ |
138 | details/look_basic.cpp \ | 140 | details/look_basic.cpp \ |
139 | details/look_html.cpp \ | 141 | details/look_html.cpp \ |
140 | views/kaddressbookiconview.cpp \ | 142 | views/kaddressbookiconview.cpp \ |
141 | views/kaddressbooktableview.cpp \ | 143 | views/kaddressbooktableview.cpp \ |
142 | views/kaddressbookcardview.cpp \ | 144 | views/kaddressbookcardview.cpp \ |
143 | views/configuretableviewdialog.cpp \ | 145 | views/configuretableviewdialog.cpp \ |
144 | views/configurecardviewdialog.cpp \ | 146 | views/configurecardviewdialog.cpp \ |
145 | views/cardview.cpp \ | 147 | views/cardview.cpp \ |
146 | views/contactlistview.cpp \ | 148 | views/contactlistview.cpp \ |
147 | views/colorlistbox.cpp \ | 149 | views/colorlistbox.cpp \ |
148 | xxport/vcard_xxport.cpp \ | 150 | xxport/vcard_xxport.cpp \ |
149 | xxport/kde2_xxport.cpp \ | 151 | xxport/kde2_xxport.cpp \ |
150 | xxport/csv_xxport.cpp \ | 152 | xxport/csv_xxport.cpp \ |
151 | xxport/csvimportdialog.cpp \ | 153 | xxport/csvimportdialog.cpp \ |
152 | xxport/opie_xxport.cpp \ | 154 | xxport/opie_xxport.cpp \ |
153 | xxport/qtopia_xxport.cpp \ | 155 | xxport/qtopia_xxport.cpp \ |
154 | xxport/sharpdtm_xxport.cpp \ | 156 | xxport/sharpdtm_xxport.cpp \ |
155 | #details/look_details.cpp \ | 157 | #details/look_details.cpp \ |
156 | #mainwindow.cpp \ | 158 | #mainwindow.cpp \ |
157 | # calendarview.cpp \ | 159 | # calendarview.cpp \ |
158 | # timespanview.cpp | 160 | # timespanview.cpp |
159 | 161 | ||
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 713b0fc..810c3e2 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp | |||
@@ -1,243 +1,243 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressbook. | 2 | This file is part of KAddressbook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qlist.h> | 32 | #include <qlist.h> |
33 | 33 | ||
34 | #include <kabc/addressbook.h> | 34 | #include <kabc/addressbook.h> |
35 | #include <kabc/resource.h> | 35 | #include <kabc/resource.h> |
36 | #include <kdebug.h> | 36 | #include <kdebug.h> |
37 | #include <kdialogbase.h> | 37 | #include <kdialogbase.h> |
38 | #include <klocale.h> | 38 | #include <klocale.h> |
39 | #include <kmessagebox.h> | 39 | #include <kmessagebox.h> |
40 | 40 | ||
41 | #ifndef KAB_EMBEDDED | 41 | #ifndef KAB_EMBEDDED |
42 | #include <ktrader.h> | 42 | #include <ktrader.h> |
43 | #else //KAB_EMBEDDED | 43 | #else //KAB_EMBEDDED |
44 | extern "C" | 44 | extern "C" |
45 | { | 45 | { |
46 | void* init_microkaddrbk_csv_xxport(); | 46 | void* init_microkaddrbk_csv_xxport(); |
47 | void* init_microkaddrbk_kde2_xxport(); | 47 | void* init_microkaddrbk_kde2_xxport(); |
48 | void* init_microkaddrbk_vcard_xxport(); | 48 | void* init_microkaddrbk_vcard_xxport(); |
49 | void* init_microkaddrbk_opie_xxport(); | 49 | void* init_microkaddrbk_opie_xxport(); |
50 | void* init_microkaddrbk_qtopia_xxport(); | 50 | void* init_microkaddrbk_qtopia_xxport(); |
51 | void* init_microkaddrbk_sharpdtm_xxport(); | 51 | void* init_microkaddrbk_sharpdtm_xxport(); |
52 | } | 52 | } |
53 | #endif //KAB_EMBEDDED | 53 | #endif //KAB_EMBEDDED |
54 | 54 | ||
55 | #include <libkdepim/addresseeview.h> | 55 | #include <addresseeview.h> |
56 | 56 | ||
57 | #include "kabcore.h" | 57 | #include "kabcore.h" |
58 | #include "undocmds.h" | 58 | #include "undocmds.h" |
59 | #include "xxportselectdialog.h" | 59 | #include "xxportselectdialog.h" |
60 | 60 | ||
61 | #include "xxportmanager.h" | 61 | #include "xxportmanager.h" |
62 | 62 | ||
63 | KURL XXPortManager::importURL = KURL(); | 63 | KURL XXPortManager::importURL = KURL(); |
64 | QString XXPortManager::importData = QString::null; | 64 | QString XXPortManager::importData = QString::null; |
65 | 65 | ||
66 | class PreviewDialog : public KDialogBase | 66 | class PreviewDialog : public KDialogBase |
67 | { | 67 | { |
68 | public: | 68 | public: |
69 | PreviewDialog( const KABC::Addressee &addr, | 69 | PreviewDialog( const KABC::Addressee &addr, |
70 | QWidget *parent, const char *name = 0 ); | 70 | QWidget *parent, const char *name = 0 ); |
71 | }; | 71 | }; |
72 | 72 | ||
73 | XXPortManager::XXPortManager( KABCore *core, QObject *parent, const char *name ) | 73 | XXPortManager::XXPortManager( KABCore *core, QObject *parent, const char *name ) |
74 | : QObject( parent, name ), mCore( core ), mShowPreview( false ) | 74 | : QObject( parent, name ), mCore( core ), mShowPreview( false ) |
75 | { | 75 | { |
76 | loadPlugins(); | 76 | loadPlugins(); |
77 | } | 77 | } |
78 | 78 | ||
79 | XXPortManager::~XXPortManager() | 79 | XXPortManager::~XXPortManager() |
80 | { | 80 | { |
81 | } | 81 | } |
82 | 82 | ||
83 | void XXPortManager::restoreSettings() | 83 | void XXPortManager::restoreSettings() |
84 | { | 84 | { |
85 | } | 85 | } |
86 | 86 | ||
87 | void XXPortManager::saveSettings() | 87 | void XXPortManager::saveSettings() |
88 | { | 88 | { |
89 | } | 89 | } |
90 | 90 | ||
91 | void XXPortManager::importVCard( const KURL &url ) | 91 | void XXPortManager::importVCard( const KURL &url ) |
92 | { | 92 | { |
93 | importVCard( url, false ); | 93 | importVCard( url, false ); |
94 | } | 94 | } |
95 | 95 | ||
96 | void XXPortManager::importVCard( const KURL &url, bool showPreview ) | 96 | void XXPortManager::importVCard( const KURL &url, bool showPreview ) |
97 | { | 97 | { |
98 | importURL = url; | 98 | importURL = url; |
99 | mShowPreview = showPreview; | 99 | mShowPreview = showPreview; |
100 | slotImport( "vcard", "<empty>" ); | 100 | slotImport( "vcard", "<empty>" ); |
101 | mShowPreview = false; | 101 | mShowPreview = false; |
102 | importURL = KURL(); | 102 | importURL = KURL(); |
103 | } | 103 | } |
104 | 104 | ||
105 | void XXPortManager::importVCard( const QString &vCard, bool showPreview ) | 105 | void XXPortManager::importVCard( const QString &vCard, bool showPreview ) |
106 | { | 106 | { |
107 | importData = vCard; | 107 | importData = vCard; |
108 | mShowPreview = showPreview; | 108 | mShowPreview = showPreview; |
109 | slotImport( "vcard", "<empty>" ); | 109 | slotImport( "vcard", "<empty>" ); |
110 | mShowPreview = false; | 110 | mShowPreview = false; |
111 | importData = ""; | 111 | importData = ""; |
112 | } | 112 | } |
113 | 113 | ||
114 | void XXPortManager::slotImport( const QString &identifier, const QString &data ) | 114 | void XXPortManager::slotImport( const QString &identifier, const QString &data ) |
115 | { | 115 | { |
116 | XXPortObject *obj = mXXPortObjects[ identifier ]; | 116 | XXPortObject *obj = mXXPortObjects[ identifier ]; |
117 | if ( !obj ) { | 117 | if ( !obj ) { |
118 | KMessageBox::error( mCore, i18n( "<qt>No import plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); | 118 | KMessageBox::error( mCore, i18n( "<qt>No import plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); |
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | 121 | ||
122 | KABC::Resource *resource = mCore->requestResource( mCore ); | 122 | KABC::Resource *resource = mCore->requestResource( mCore ); |
123 | if ( !resource ) | 123 | if ( !resource ) |
124 | return; | 124 | return; |
125 | 125 | ||
126 | KABC::AddresseeList list = obj->importContacts( data ); | 126 | KABC::AddresseeList list = obj->importContacts( data ); |
127 | KABC::AddresseeList::Iterator it; | 127 | KABC::AddresseeList::Iterator it; |
128 | bool imported = false; | 128 | bool imported = false; |
129 | for ( it = list.begin(); it != list.end(); ++it ) { | 129 | for ( it = list.begin(); it != list.end(); ++it ) { |
130 | if ( mShowPreview ) { | 130 | if ( mShowPreview ) { |
131 | PreviewDialog dlg( *it, mCore ); | 131 | PreviewDialog dlg( *it, mCore ); |
132 | if ( !dlg.exec() ) | 132 | if ( !dlg.exec() ) |
133 | continue; | 133 | continue; |
134 | } | 134 | } |
135 | 135 | ||
136 | (*it).setResource( resource ); | 136 | (*it).setResource( resource ); |
137 | // We use a PwNewCommand so the user can undo it. | 137 | // We use a PwNewCommand so the user can undo it. |
138 | PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); | 138 | PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); |
139 | UndoStack::instance()->push( command ); | 139 | UndoStack::instance()->push( command ); |
140 | RedoStack::instance()->clear(); | 140 | RedoStack::instance()->clear(); |
141 | imported = true; | 141 | imported = true; |
142 | } | 142 | } |
143 | 143 | ||
144 | if ( imported ) { | 144 | if ( imported ) { |
145 | KMessageBox::information( mCore, i18n( "contacts successfully imported." ) ); | 145 | KMessageBox::information( mCore, i18n( "contacts successfully imported." ) ); |
146 | 146 | ||
147 | emit modified(); | 147 | emit modified(); |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | void XXPortManager::slotExport( const QString &identifier, const QString &data ) | 151 | void XXPortManager::slotExport( const QString &identifier, const QString &data ) |
152 | { | 152 | { |
153 | XXPortObject *obj = mXXPortObjects[ identifier ]; | 153 | XXPortObject *obj = mXXPortObjects[ identifier ]; |
154 | if ( !obj ) { | 154 | if ( !obj ) { |
155 | KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); | 155 | KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); |
156 | return; | 156 | return; |
157 | } | 157 | } |
158 | 158 | ||
159 | KABC::AddresseeList addrList; | 159 | KABC::AddresseeList addrList; |
160 | XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore ); | 160 | XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore ); |
161 | if ( dlg.exec() ) | 161 | if ( dlg.exec() ) |
162 | addrList = dlg.contacts(); | 162 | addrList = dlg.contacts(); |
163 | else | 163 | else |
164 | return; | 164 | return; |
165 | 165 | ||
166 | if ( !obj->exportContacts( addrList, data ) ) | 166 | if ( !obj->exportContacts( addrList, data ) ) |
167 | KMessageBox::error( mCore, i18n( "Unable to export contacts." ) ); | 167 | KMessageBox::error( mCore, i18n( "Unable to export contacts." ) ); |
168 | else | 168 | else |
169 | KMessageBox::information( mCore, i18n( "contacts successfully exported." ) ); | 169 | KMessageBox::information( mCore, i18n( "contacts successfully exported." ) ); |
170 | } | 170 | } |
171 | 171 | ||
172 | void XXPortManager::loadPlugins() | 172 | void XXPortManager::loadPlugins() |
173 | { | 173 | { |
174 | mXXPortObjects.clear(); | 174 | mXXPortObjects.clear(); |
175 | 175 | ||
176 | #ifndef KAB_EMBEDDED | 176 | #ifndef KAB_EMBEDDED |
177 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/XXPort" ); | 177 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/XXPort" ); |
178 | KTrader::OfferList::ConstIterator it; | 178 | KTrader::OfferList::ConstIterator it; |
179 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { | 179 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { |
180 | if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) ) | 180 | if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) ) |
181 | continue; | 181 | continue; |
182 | 182 | ||
183 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); | 183 | KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); |
184 | if ( !factory ) { | 184 | if ( !factory ) { |
185 | kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl; | 185 | kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl; |
186 | continue; | 186 | continue; |
187 | } | 187 | } |
188 | 188 | ||
189 | XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); | 189 | XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); |
190 | 190 | ||
191 | if ( !xxportFactory ) { | 191 | if ( !xxportFactory ) { |
192 | kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; | 192 | kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; |
193 | continue; | 193 | continue; |
194 | } | 194 | } |
195 | 195 | ||
196 | #else //KAB_EMBEDDED | 196 | #else //KAB_EMBEDDED |
197 | QList<XXPortFactory> factorylist; | 197 | QList<XXPortFactory> factorylist; |
198 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); | 198 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); |
199 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); | 199 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); |
200 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); | 200 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); |
201 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport())); | 201 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport())); |
202 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); | 202 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); |
203 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); | 203 | factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); |
204 | 204 | ||
205 | QListIterator<XXPortFactory> it(factorylist); | 205 | QListIterator<XXPortFactory> it(factorylist); |
206 | for ( ; it.current(); ++it ) | 206 | for ( ; it.current(); ++it ) |
207 | { | 207 | { |
208 | XXPortFactory *xxportFactory = it.current(); | 208 | XXPortFactory *xxportFactory = it.current(); |
209 | #endif //KAB_EMBEDDED | 209 | #endif //KAB_EMBEDDED |
210 | 210 | ||
211 | XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); | 211 | XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); |
212 | if ( obj ) { | 212 | if ( obj ) { |
213 | mCore->addGUIClient( obj ); | 213 | mCore->addGUIClient( obj ); |
214 | mXXPortObjects.insert( obj->identifier(), obj ); | 214 | mXXPortObjects.insert( obj->identifier(), obj ); |
215 | connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), | 215 | connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), |
216 | this, SLOT( slotExport( const QString&, const QString& ) ) ); | 216 | this, SLOT( slotExport( const QString&, const QString& ) ) ); |
217 | connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), | 217 | connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), |
218 | this, SLOT( slotImport( const QString&, const QString& ) ) ); | 218 | this, SLOT( slotImport( const QString&, const QString& ) ) ); |
219 | } | 219 | } |
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | 223 | ||
224 | PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, | 224 | PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, |
225 | const char *name ) | 225 | const char *name ) |
226 | : KDialogBase( Plain, i18n( "Contact Preview" ), Ok | Cancel, Ok, parent, | 226 | : KDialogBase( Plain, i18n( "Contact Preview" ), Ok | Cancel, Ok, parent, |
227 | name, true, true ) | 227 | name, true, true ) |
228 | { | 228 | { |
229 | QWidget *page = plainPage(); | 229 | QWidget *page = plainPage(); |
230 | QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); | 230 | QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); |
231 | 231 | ||
232 | KPIM::AddresseeView *view = new KPIM::AddresseeView( page ); | 232 | KPIM::AddresseeView *view = new KPIM::AddresseeView( page ); |
233 | view->setAddressee( addr ); | 233 | view->setAddressee( addr ); |
234 | 234 | ||
235 | layout->addWidget( view ); | 235 | layout->addWidget( view ); |
236 | 236 | ||
237 | resize( 400, 300 ); | 237 | resize( 400, 300 ); |
238 | } | 238 | } |
239 | 239 | ||
240 | #ifndef KAB_EMBEDDED | 240 | #ifndef KAB_EMBEDDED |
241 | #include "xxportmanager.moc" | 241 | #include "xxportmanager.moc" |
242 | #endif //KAB_EMBEDDED | 242 | #endif //KAB_EMBEDDED |
243 | 243 | ||
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 369c7a0..56b3fb0 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -945,811 +945,813 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
945 | local->resetTempSyncStat(); | 945 | local->resetTempSyncStat(); |
946 | mLastCalendarSync = QDateTime::currentDateTime(); | 946 | mLastCalendarSync = QDateTime::currentDateTime(); |
947 | QDateTime modifiedCalendar = mLastCalendarSync;; | 947 | QDateTime modifiedCalendar = mLastCalendarSync;; |
948 | eventLSync = getLastSyncEvent(); | 948 | eventLSync = getLastSyncEvent(); |
949 | eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); | 949 | eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); |
950 | if ( eventR ) { | 950 | if ( eventR ) { |
951 | eventRSync = (Event*) eventR->clone(); | 951 | eventRSync = (Event*) eventR->clone(); |
952 | remote->deleteEvent(eventR ); | 952 | remote->deleteEvent(eventR ); |
953 | 953 | ||
954 | } else { | 954 | } else { |
955 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 955 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
956 | eventRSync = (Event*)eventLSync->clone(); | 956 | eventRSync = (Event*)eventLSync->clone(); |
957 | } else { | 957 | } else { |
958 | fullDateRange = true; | 958 | fullDateRange = true; |
959 | eventRSync = new Event(); | 959 | eventRSync = new Event(); |
960 | eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); | 960 | eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); |
961 | eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); | 961 | eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); |
962 | eventRSync->setDtStart( mLastCalendarSync ); | 962 | eventRSync->setDtStart( mLastCalendarSync ); |
963 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); | 963 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); |
964 | eventRSync->setCategories( i18n("SyncEvent") ); | 964 | eventRSync->setCategories( i18n("SyncEvent") ); |
965 | } | 965 | } |
966 | } | 966 | } |
967 | if ( eventLSync->dtStart() == mLastCalendarSync ) | 967 | if ( eventLSync->dtStart() == mLastCalendarSync ) |
968 | fullDateRange = true; | 968 | fullDateRange = true; |
969 | 969 | ||
970 | if ( ! fullDateRange ) { | 970 | if ( ! fullDateRange ) { |
971 | if ( eventLSync->dtStart() != eventRSync->dtStart() ) { | 971 | if ( eventLSync->dtStart() != eventRSync->dtStart() ) { |
972 | 972 | ||
973 | // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); | 973 | // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); |
974 | //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); | 974 | //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); |
975 | fullDateRange = true; | 975 | fullDateRange = true; |
976 | } | 976 | } |
977 | } | 977 | } |
978 | if ( fullDateRange ) | 978 | if ( fullDateRange ) |
979 | mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); | 979 | mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); |
980 | else | 980 | else |
981 | mLastCalendarSync = eventLSync->dtStart(); | 981 | mLastCalendarSync = eventLSync->dtStart(); |
982 | // for resyncing if own file has changed | 982 | // for resyncing if own file has changed |
983 | if ( mCurrentSyncDevice == "deleteaftersync" ) { | 983 | if ( mCurrentSyncDevice == "deleteaftersync" ) { |
984 | mLastCalendarSync = loadedFileVersion; | 984 | mLastCalendarSync = loadedFileVersion; |
985 | qDebug("setting mLastCalendarSync "); | 985 | qDebug("setting mLastCalendarSync "); |
986 | } | 986 | } |
987 | //qDebug("*************************** "); | 987 | //qDebug("*************************** "); |
988 | qDebug("mLastCalendarSync %s ",mLastCalendarSync.toString().latin1() ); | 988 | qDebug("mLastCalendarSync %s ",mLastCalendarSync.toString().latin1() ); |
989 | QPtrList<Incidence> er = remote->rawIncidences(); | 989 | QPtrList<Incidence> er = remote->rawIncidences(); |
990 | Incidence* inR = er.first(); | 990 | Incidence* inR = er.first(); |
991 | Incidence* inL; | 991 | Incidence* inL; |
992 | QProgressBar bar( er.count(),0 ); | 992 | QProgressBar bar( er.count(),0 ); |
993 | bar.setCaption (i18n("Syncing - close to abort!") ); | 993 | bar.setCaption (i18n("Syncing - close to abort!") ); |
994 | 994 | ||
995 | int w = 300; | 995 | int w = 300; |
996 | if ( QApplication::desktop()->width() < 320 ) | 996 | if ( QApplication::desktop()->width() < 320 ) |
997 | w = 220; | 997 | w = 220; |
998 | int h = bar.sizeHint().height() ; | 998 | int h = bar.sizeHint().height() ; |
999 | int dw = QApplication::desktop()->width(); | 999 | int dw = QApplication::desktop()->width(); |
1000 | int dh = QApplication::desktop()->height(); | 1000 | int dh = QApplication::desktop()->height(); |
1001 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1001 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1002 | bar.show(); | 1002 | bar.show(); |
1003 | int modulo = (er.count()/10)+1; | 1003 | int modulo = (er.count()/10)+1; |
1004 | int incCounter = 0; | 1004 | int incCounter = 0; |
1005 | while ( inR ) { | 1005 | while ( inR ) { |
1006 | if ( ! bar.isVisible() ) | 1006 | if ( ! bar.isVisible() ) |
1007 | return false; | 1007 | return false; |
1008 | if ( incCounter % modulo == 0 ) | 1008 | if ( incCounter % modulo == 0 ) |
1009 | bar.setProgress( incCounter ); | 1009 | bar.setProgress( incCounter ); |
1010 | ++incCounter; | 1010 | ++incCounter; |
1011 | uid = inR->uid(); | 1011 | uid = inR->uid(); |
1012 | bool skipIncidence = false; | 1012 | bool skipIncidence = false; |
1013 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1013 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1014 | skipIncidence = true; | 1014 | skipIncidence = true; |
1015 | QString idS; | 1015 | QString idS; |
1016 | qApp->processEvents(); | 1016 | qApp->processEvents(); |
1017 | if ( !skipIncidence ) { | 1017 | if ( !skipIncidence ) { |
1018 | inL = local->incidence( uid ); | 1018 | inL = local->incidence( uid ); |
1019 | if ( inL ) { // maybe conflict - same uid in both calendars | 1019 | if ( inL ) { // maybe conflict - same uid in both calendars |
1020 | int maxrev = inL->revision(); | 1020 | int maxrev = inL->revision(); |
1021 | if ( maxrev < inR->revision() ) | 1021 | if ( maxrev < inR->revision() ) |
1022 | maxrev = inR->revision(); | 1022 | maxrev = inR->revision(); |
1023 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1023 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1024 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1024 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1025 | if ( take == 3 ) | 1025 | if ( take == 3 ) |
1026 | return false; | 1026 | return false; |
1027 | if ( take == 1 ) {// take local | 1027 | if ( take == 1 ) {// take local |
1028 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 1028 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
1029 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1029 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1030 | else | 1030 | else |
1031 | idS = inR->IDStr(); | 1031 | idS = inR->IDStr(); |
1032 | remote->deleteIncidence( inR ); | 1032 | remote->deleteIncidence( inR ); |
1033 | if ( inL->revision() < maxrev ) | 1033 | if ( inL->revision() < maxrev ) |
1034 | inL->setRevision( maxrev ); | 1034 | inL->setRevision( maxrev ); |
1035 | inR = inL->clone(); | 1035 | inR = inL->clone(); |
1036 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1036 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1037 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) | 1037 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) |
1038 | inR->setIDStr( idS ); | 1038 | inR->setIDStr( idS ); |
1039 | remote->addIncidence( inR ); | 1039 | remote->addIncidence( inR ); |
1040 | ++changedRemote; | 1040 | ++changedRemote; |
1041 | } else { | 1041 | } else { |
1042 | if ( inR->revision() < maxrev ) | 1042 | if ( inR->revision() < maxrev ) |
1043 | inR->setRevision( maxrev ); | 1043 | inR->setRevision( maxrev ); |
1044 | idS = inL->IDStr(); | 1044 | idS = inL->IDStr(); |
1045 | local->deleteIncidence( inL ); | 1045 | local->deleteIncidence( inL ); |
1046 | inL = inR->clone(); | 1046 | inL = inR->clone(); |
1047 | inL->setIDStr( idS ); | 1047 | inL->setIDStr( idS ); |
1048 | local->addIncidence( inL ); | 1048 | local->addIncidence( inL ); |
1049 | ++changedLocal; | 1049 | ++changedLocal; |
1050 | } | 1050 | } |
1051 | } | 1051 | } |
1052 | } else { // no conflict | 1052 | } else { // no conflict |
1053 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1053 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1054 | QString des = eventLSync->description(); | 1054 | QString des = eventLSync->description(); |
1055 | QString pref = "e"; | 1055 | QString pref = "e"; |
1056 | if ( inR->type() == "Todo" ) | 1056 | if ( inR->type() == "Todo" ) |
1057 | pref = "t"; | 1057 | pref = "t"; |
1058 | if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it | 1058 | if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it |
1059 | inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); | 1059 | inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); |
1060 | //remote->deleteIncidence( inR ); | 1060 | //remote->deleteIncidence( inR ); |
1061 | ++deletedEventR; | 1061 | ++deletedEventR; |
1062 | } else { | 1062 | } else { |
1063 | inR->setLastModified( modifiedCalendar ); | 1063 | inR->setLastModified( modifiedCalendar ); |
1064 | inL = inR->clone(); | 1064 | inL = inR->clone(); |
1065 | local->addIncidence( inL ); | 1065 | local->addIncidence( inL ); |
1066 | ++addedEvent; | 1066 | ++addedEvent; |
1067 | } | 1067 | } |
1068 | } else { | 1068 | } else { |
1069 | if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { | 1069 | if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { |
1070 | inR->setLastModified( modifiedCalendar ); | 1070 | inR->setLastModified( modifiedCalendar ); |
1071 | local->addIncidence( inR->clone() ); | 1071 | local->addIncidence( inR->clone() ); |
1072 | ++addedEvent; | 1072 | ++addedEvent; |
1073 | } else { | 1073 | } else { |
1074 | checkExternSyncEvent(eventRSyncSharp, inR); | 1074 | checkExternSyncEvent(eventRSyncSharp, inR); |
1075 | remote->deleteIncidence( inR ); | 1075 | remote->deleteIncidence( inR ); |
1076 | ++deletedEventR; | 1076 | ++deletedEventR; |
1077 | } | 1077 | } |
1078 | } | 1078 | } |
1079 | } | 1079 | } |
1080 | } | 1080 | } |
1081 | inR = er.next(); | 1081 | inR = er.next(); |
1082 | } | 1082 | } |
1083 | QPtrList<Incidence> el = local->rawIncidences(); | 1083 | QPtrList<Incidence> el = local->rawIncidences(); |
1084 | inL = el.first(); | 1084 | inL = el.first(); |
1085 | modulo = (el.count()/10)+1; | 1085 | modulo = (el.count()/10)+1; |
1086 | bar.setCaption (i18n("Add / remove events") ); | 1086 | bar.setCaption (i18n("Add / remove events") ); |
1087 | bar.setTotalSteps ( el.count() ) ; | 1087 | bar.setTotalSteps ( el.count() ) ; |
1088 | bar.show(); | 1088 | bar.show(); |
1089 | incCounter = 0; | 1089 | incCounter = 0; |
1090 | 1090 | ||
1091 | while ( inL ) { | 1091 | while ( inL ) { |
1092 | 1092 | ||
1093 | qApp->processEvents(); | 1093 | qApp->processEvents(); |
1094 | if ( ! bar.isVisible() ) | 1094 | if ( ! bar.isVisible() ) |
1095 | return false; | 1095 | return false; |
1096 | if ( incCounter % modulo == 0 ) | 1096 | if ( incCounter % modulo == 0 ) |
1097 | bar.setProgress( incCounter ); | 1097 | bar.setProgress( incCounter ); |
1098 | ++incCounter; | 1098 | ++incCounter; |
1099 | uid = inL->uid(); | 1099 | uid = inL->uid(); |
1100 | bool skipIncidence = false; | 1100 | bool skipIncidence = false; |
1101 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1101 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1102 | skipIncidence = true; | 1102 | skipIncidence = true; |
1103 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) | 1103 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) |
1104 | skipIncidence = true; | 1104 | skipIncidence = true; |
1105 | if ( !skipIncidence ) { | 1105 | if ( !skipIncidence ) { |
1106 | inR = remote->incidence( uid ); | 1106 | inR = remote->incidence( uid ); |
1107 | if ( ! inR ) { | 1107 | if ( ! inR ) { |
1108 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1108 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1109 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 1109 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
1110 | checkExternSyncEvent(eventLSyncSharp, inL); | 1110 | checkExternSyncEvent(eventLSyncSharp, inL); |
1111 | local->deleteIncidence( inL ); | 1111 | local->deleteIncidence( inL ); |
1112 | ++deletedEventL; | 1112 | ++deletedEventL; |
1113 | } else { | 1113 | } else { |
1114 | if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { | 1114 | if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { |
1115 | inL->removeID(mCurrentSyncDevice ); | 1115 | inL->removeID(mCurrentSyncDevice ); |
1116 | ++addedEventR; | 1116 | ++addedEventR; |
1117 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); | 1117 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); |
1118 | inL->setLastModified( modifiedCalendar ); | 1118 | inL->setLastModified( modifiedCalendar ); |
1119 | inR = inL->clone(); | 1119 | inR = inL->clone(); |
1120 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1120 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1121 | remote->addIncidence( inR ); | 1121 | remote->addIncidence( inR ); |
1122 | } | 1122 | } |
1123 | } | 1123 | } |
1124 | } else { | 1124 | } else { |
1125 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { | 1125 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { |
1126 | checkExternSyncEvent(eventLSyncSharp, inL); | 1126 | checkExternSyncEvent(eventLSyncSharp, inL); |
1127 | local->deleteIncidence( inL ); | 1127 | local->deleteIncidence( inL ); |
1128 | ++deletedEventL; | 1128 | ++deletedEventL; |
1129 | } else { | 1129 | } else { |
1130 | if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { | 1130 | if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) { |
1131 | ++addedEventR; | 1131 | ++addedEventR; |
1132 | inL->setLastModified( modifiedCalendar ); | 1132 | inL->setLastModified( modifiedCalendar ); |
1133 | remote->addIncidence( inL->clone() ); | 1133 | remote->addIncidence( inL->clone() ); |
1134 | } | 1134 | } |
1135 | } | 1135 | } |
1136 | } | 1136 | } |
1137 | } | 1137 | } |
1138 | } | 1138 | } |
1139 | inL = el.next(); | 1139 | inL = el.next(); |
1140 | } | 1140 | } |
1141 | int delFut = 0; | 1141 | int delFut = 0; |
1142 | if ( KOPrefs::instance()->mWriteBackInFuture ) { | 1142 | if ( KOPrefs::instance()->mWriteBackInFuture ) { |
1143 | er = remote->rawIncidences(); | 1143 | er = remote->rawIncidences(); |
1144 | inR = er.first(); | 1144 | inR = er.first(); |
1145 | QDateTime dt; | 1145 | QDateTime dt; |
1146 | QDateTime cur = QDateTime::currentDateTime(); | 1146 | QDateTime cur = QDateTime::currentDateTime(); |
1147 | QDateTime end = cur.addSecs( KOPrefs::instance()->mWriteBackInFuture * 3600 *24 *7 ); | 1147 | QDateTime end = cur.addSecs( KOPrefs::instance()->mWriteBackInFuture * 3600 *24 *7 ); |
1148 | while ( inR ) { | 1148 | while ( inR ) { |
1149 | if ( inR->type() == "Todo" ) { | 1149 | if ( inR->type() == "Todo" ) { |
1150 | Todo * t = (Todo*)inR; | 1150 | Todo * t = (Todo*)inR; |
1151 | if ( t->hasDueDate() ) | 1151 | if ( t->hasDueDate() ) |
1152 | dt = t->dtDue(); | 1152 | dt = t->dtDue(); |
1153 | else | 1153 | else |
1154 | dt = cur.addSecs( 62 ); | 1154 | dt = cur.addSecs( 62 ); |
1155 | } | 1155 | } |
1156 | else if (inR->type() == "Event" ) { | 1156 | else if (inR->type() == "Event" ) { |
1157 | bool ok; | 1157 | bool ok; |
1158 | dt = inR->getNextOccurence( cur, &ok ); | 1158 | dt = inR->getNextOccurence( cur, &ok ); |
1159 | if ( !ok ) | 1159 | if ( !ok ) |
1160 | dt = cur.addSecs( -62 ); | 1160 | dt = cur.addSecs( -62 ); |
1161 | } | 1161 | } |
1162 | else | 1162 | else |
1163 | dt = inR->dtStart(); | 1163 | dt = inR->dtStart(); |
1164 | if ( dt < cur || dt > end ) { | 1164 | if ( dt < cur || dt > end ) { |
1165 | remote->deleteIncidence( inR ); | 1165 | remote->deleteIncidence( inR ); |
1166 | ++delFut; | 1166 | ++delFut; |
1167 | } | 1167 | } |
1168 | inR = er.next(); | 1168 | inR = er.next(); |
1169 | } | 1169 | } |
1170 | } | 1170 | } |
1171 | bar.hide(); | 1171 | bar.hide(); |
1172 | mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); | 1172 | mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); |
1173 | eventLSync->setReadOnly( false ); | 1173 | eventLSync->setReadOnly( false ); |
1174 | eventLSync->setDtStart( mLastCalendarSync ); | 1174 | eventLSync->setDtStart( mLastCalendarSync ); |
1175 | eventRSync->setDtStart( mLastCalendarSync ); | 1175 | eventRSync->setDtStart( mLastCalendarSync ); |
1176 | eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); | 1176 | eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); |
1177 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); | 1177 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); |
1178 | eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; | 1178 | eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; |
1179 | eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); | 1179 | eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); |
1180 | eventLSync->setReadOnly( true ); | 1180 | eventLSync->setReadOnly( true ); |
1181 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) | 1181 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) |
1182 | remote->addEvent( eventRSync ); | 1182 | remote->addEvent( eventRSync ); |
1183 | QString mes; | 1183 | QString mes; |
1184 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR ); | 1184 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR ); |
1185 | QString delmess; | 1185 | QString delmess; |
1186 | if ( delFut ) { | 1186 | if ( delFut ) { |
1187 | delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\n"),delFut, KOPrefs::instance()->mWriteBackInFuture ); | 1187 | delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\n"),delFut, KOPrefs::instance()->mWriteBackInFuture ); |
1188 | mes += delmess; | 1188 | mes += delmess; |
1189 | } | 1189 | } |
1190 | if ( KOPrefs::instance()->mShowSyncSummary ) { | 1190 | if ( KOPrefs::instance()->mShowSyncSummary ) { |
1191 | KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); | 1191 | KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); |
1192 | } | 1192 | } |
1193 | qDebug( mes ); | 1193 | qDebug( mes ); |
1194 | mCalendar->checkAlarmForIncidence( 0, true ); | 1194 | mCalendar->checkAlarmForIncidence( 0, true ); |
1195 | return syncOK; | 1195 | return syncOK; |
1196 | } | 1196 | } |
1197 | 1197 | ||
1198 | void CalendarView::setSyncDevice( QString s ) | 1198 | void CalendarView::setSyncDevice( QString s ) |
1199 | { | 1199 | { |
1200 | mCurrentSyncDevice= s; | 1200 | mCurrentSyncDevice= s; |
1201 | } | 1201 | } |
1202 | void CalendarView::setSyncName( QString s ) | 1202 | void CalendarView::setSyncName( QString s ) |
1203 | { | 1203 | { |
1204 | mCurrentSyncName= s; | 1204 | mCurrentSyncName= s; |
1205 | } | 1205 | } |
1206 | bool CalendarView::syncCalendar(QString filename, int mode) | 1206 | bool CalendarView::syncCalendar(QString filename, int mode) |
1207 | { | 1207 | { |
1208 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 1208 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
1209 | CalendarLocal* calendar = new CalendarLocal(); | 1209 | CalendarLocal* calendar = new CalendarLocal(); |
1210 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1210 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1211 | FileStorage* storage = new FileStorage( calendar ); | 1211 | FileStorage* storage = new FileStorage( calendar ); |
1212 | bool syncOK = false; | 1212 | bool syncOK = false; |
1213 | storage->setFileName( filename ); | 1213 | storage->setFileName( filename ); |
1214 | // qDebug("loading ... "); | 1214 | // qDebug("loading ... "); |
1215 | if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { | 1215 | if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { |
1216 | getEventViewerDialog()->setSyncMode( true ); | 1216 | getEventViewerDialog()->setSyncMode( true ); |
1217 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); | 1217 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); |
1218 | getEventViewerDialog()->setSyncMode( false ); | 1218 | getEventViewerDialog()->setSyncMode( false ); |
1219 | if ( syncOK ) { | 1219 | if ( syncOK ) { |
1220 | if ( KOPrefs::instance()->mWriteBackFile ) | 1220 | if ( KOPrefs::instance()->mWriteBackFile ) |
1221 | { | 1221 | { |
1222 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 1222 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); |
1223 | storage->save(); | 1223 | storage->save(); |
1224 | } | 1224 | } |
1225 | } | 1225 | } |
1226 | setModified( true ); | 1226 | setModified( true ); |
1227 | } | 1227 | } |
1228 | delete storage; | 1228 | delete storage; |
1229 | delete calendar; | 1229 | delete calendar; |
1230 | if ( syncOK ) | 1230 | if ( syncOK ) |
1231 | updateView(); | 1231 | updateView(); |
1232 | return syncOK; | 1232 | return syncOK; |
1233 | } | 1233 | } |
1234 | void CalendarView::syncPhone() | 1234 | void CalendarView::syncPhone() |
1235 | { | 1235 | { |
1236 | syncExternal( 1 ); | 1236 | syncExternal( 1 ); |
1237 | } | 1237 | } |
1238 | void CalendarView::syncExternal( int mode ) | 1238 | void CalendarView::syncExternal( int mode ) |
1239 | { | 1239 | { |
1240 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 1240 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1241 | //mCurrentSyncDevice = "sharp-DTM"; | 1241 | //mCurrentSyncDevice = "sharp-DTM"; |
1242 | if ( KOPrefs::instance()->mAskForPreferences ) | 1242 | if ( KOPrefs::instance()->mAskForPreferences ) |
1243 | edit_sync_options(); | 1243 | edit_sync_options(); |
1244 | qApp->processEvents(); | 1244 | qApp->processEvents(); |
1245 | CalendarLocal* calendar = new CalendarLocal(); | 1245 | CalendarLocal* calendar = new CalendarLocal(); |
1246 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1246 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1247 | bool syncOK = false; | 1247 | bool syncOK = false; |
1248 | bool loadSuccess = false; | 1248 | bool loadSuccess = false; |
1249 | PhoneFormat* phoneFormat = 0; | 1249 | PhoneFormat* phoneFormat = 0; |
1250 | #ifndef DESKTOP_VERSION | 1250 | #ifndef DESKTOP_VERSION |
1251 | SharpFormat* sharpFormat = 0; | 1251 | SharpFormat* sharpFormat = 0; |
1252 | if ( mode == 0 ) { // sharp | 1252 | if ( mode == 0 ) { // sharp |
1253 | sharpFormat = new SharpFormat () ; | 1253 | sharpFormat = new SharpFormat () ; |
1254 | loadSuccess = sharpFormat->load( calendar, mCalendar ); | 1254 | loadSuccess = sharpFormat->load( calendar, mCalendar ); |
1255 | 1255 | ||
1256 | } else | 1256 | } else |
1257 | #endif | 1257 | #endif |
1258 | if ( mode == 1 ) { // phone | 1258 | if ( mode == 1 ) { // phone |
1259 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, | 1259 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, |
1260 | KOPrefs::instance()->mPhoneDevice, | 1260 | KOPrefs::instance()->mPhoneDevice, |
1261 | KOPrefs::instance()->mPhoneConnection, | 1261 | KOPrefs::instance()->mPhoneConnection, |
1262 | KOPrefs::instance()->mPhoneModel); | 1262 | KOPrefs::instance()->mPhoneModel); |
1263 | loadSuccess = phoneFormat->load( calendar,mCalendar); | 1263 | loadSuccess = phoneFormat->load( calendar,mCalendar); |
1264 | 1264 | ||
1265 | } else | 1265 | } else |
1266 | return; | 1266 | return; |
1267 | if ( loadSuccess ) { | 1267 | if ( loadSuccess ) { |
1268 | getEventViewerDialog()->setSyncMode( true ); | 1268 | getEventViewerDialog()->setSyncMode( true ); |
1269 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); | 1269 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); |
1270 | getEventViewerDialog()->setSyncMode( false ); | 1270 | getEventViewerDialog()->setSyncMode( false ); |
1271 | qApp->processEvents(); | 1271 | qApp->processEvents(); |
1272 | if ( syncOK ) { | 1272 | if ( syncOK ) { |
1273 | if ( KOPrefs::instance()->mWriteBackFile ) | 1273 | if ( KOPrefs::instance()->mWriteBackFile ) |
1274 | { | 1274 | { |
1275 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); | 1275 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); |
1276 | Incidence* inc = iL.first(); | 1276 | Incidence* inc = iL.first(); |
1277 | if ( phoneFormat ) { | 1277 | if ( phoneFormat ) { |
1278 | while ( inc ) { | 1278 | while ( inc ) { |
1279 | inc->removeID(mCurrentSyncDevice); | 1279 | inc->removeID(mCurrentSyncDevice); |
1280 | inc = iL.next(); | 1280 | inc = iL.next(); |
1281 | } | 1281 | } |
1282 | } | 1282 | } |
1283 | #ifndef DESKTOP_VERSION | 1283 | #ifndef DESKTOP_VERSION |
1284 | if ( sharpFormat ) | 1284 | if ( sharpFormat ) |
1285 | sharpFormat->save(calendar); | 1285 | sharpFormat->save(calendar); |
1286 | #endif | 1286 | #endif |
1287 | if ( phoneFormat ) | 1287 | if ( phoneFormat ) |
1288 | phoneFormat->save(calendar); | 1288 | phoneFormat->save(calendar); |
1289 | iL = calendar->rawIncidences(); | 1289 | iL = calendar->rawIncidences(); |
1290 | inc = iL.first(); | 1290 | inc = iL.first(); |
1291 | Incidence* loc; | 1291 | Incidence* loc; |
1292 | while ( inc ) { | 1292 | while ( inc ) { |
1293 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { | 1293 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { |
1294 | loc = mCalendar->incidence(inc->uid() ); | 1294 | loc = mCalendar->incidence(inc->uid() ); |
1295 | if ( loc ) { | 1295 | if ( loc ) { |
1296 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); | 1296 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); |
1297 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); | 1297 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); |
1298 | } | 1298 | } |
1299 | } | 1299 | } |
1300 | inc = iL.next(); | 1300 | inc = iL.next(); |
1301 | } | 1301 | } |
1302 | Incidence* lse = getLastSyncEvent(); | 1302 | Incidence* lse = getLastSyncEvent(); |
1303 | if ( lse ) { | 1303 | if ( lse ) { |
1304 | lse->setReadOnly( false ); | 1304 | lse->setReadOnly( false ); |
1305 | lse->setDescription( "" ); | 1305 | lse->setDescription( "" ); |
1306 | lse->setReadOnly( true ); | 1306 | lse->setReadOnly( true ); |
1307 | } | 1307 | } |
1308 | } | 1308 | } |
1309 | } | 1309 | } |
1310 | setModified( true ); | 1310 | setModified( true ); |
1311 | } else { | 1311 | } else { |
1312 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; | 1312 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; |
1313 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), | 1313 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), |
1314 | question, i18n("Ok")) ; | 1314 | question, i18n("Ok")) ; |
1315 | 1315 | ||
1316 | } | 1316 | } |
1317 | delete calendar; | 1317 | delete calendar; |
1318 | updateView(); | 1318 | updateView(); |
1319 | return ;//syncOK; | 1319 | return ;//syncOK; |
1320 | 1320 | ||
1321 | } | 1321 | } |
1322 | void CalendarView::syncSharp() | 1322 | void CalendarView::syncSharp() |
1323 | { | 1323 | { |
1324 | syncExternal( 0 ); | 1324 | syncExternal( 0 ); |
1325 | 1325 | ||
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | 1328 | ||
1329 | #include <kabc/stdaddressbook.h> | 1329 | //#include <kabc/stdaddressbook.h> |
1330 | bool CalendarView::importBday() | 1330 | bool CalendarView::importBday() |
1331 | { | 1331 | { |
1332 | #if 0 | ||
1332 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1333 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
1333 | KABC::AddressBook::Iterator it; | 1334 | KABC::AddressBook::Iterator it; |
1334 | int count = 0; | 1335 | int count = 0; |
1335 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1336 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1336 | ++count; | 1337 | ++count; |
1337 | } | 1338 | } |
1338 | QProgressBar bar(count,0 ); | 1339 | QProgressBar bar(count,0 ); |
1339 | int w = 300; | 1340 | int w = 300; |
1340 | if ( QApplication::desktop()->width() < 320 ) | 1341 | if ( QApplication::desktop()->width() < 320 ) |
1341 | w = 220; | 1342 | w = 220; |
1342 | int h = bar.sizeHint().height() ; | 1343 | int h = bar.sizeHint().height() ; |
1343 | int dw = QApplication::desktop()->width(); | 1344 | int dw = QApplication::desktop()->width(); |
1344 | int dh = QApplication::desktop()->height(); | 1345 | int dh = QApplication::desktop()->height(); |
1345 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1346 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1346 | bar.show(); | 1347 | bar.show(); |
1347 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); | 1348 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); |
1348 | qApp->processEvents(); | 1349 | qApp->processEvents(); |
1349 | count = 0; | 1350 | count = 0; |
1350 | int addCount = 0; | 1351 | int addCount = 0; |
1351 | KCal::Attendee* a = 0; | 1352 | KCal::Attendee* a = 0; |
1352 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1353 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1353 | if ( ! bar.isVisible() ) | 1354 | if ( ! bar.isVisible() ) |
1354 | return false; | 1355 | return false; |
1355 | bar.setProgress( count++ ); | 1356 | bar.setProgress( count++ ); |
1356 | qApp->processEvents(); | 1357 | qApp->processEvents(); |
1357 | //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); | 1358 | //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); |
1358 | if ( (*it).birthday().date().isValid() ){ | 1359 | if ( (*it).birthday().date().isValid() ){ |
1359 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; | 1360 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; |
1360 | if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) | 1361 | if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) |
1361 | ++addCount; | 1362 | ++addCount; |
1362 | } | 1363 | } |
1363 | QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); | 1364 | QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); |
1364 | if ( anni.isValid() ){ | 1365 | if ( anni.isValid() ){ |
1365 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; | 1366 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; |
1366 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) | 1367 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) |
1367 | ++addCount; | 1368 | ++addCount; |
1368 | } | 1369 | } |
1369 | } | 1370 | } |
1370 | updateView(); | 1371 | updateView(); |
1371 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1372 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1373 | #endif | ||
1372 | return true; | 1374 | return true; |
1373 | } | 1375 | } |
1374 | 1376 | ||
1375 | bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) | 1377 | bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) |
1376 | { | 1378 | { |
1377 | //qDebug("addAnni "); | 1379 | //qDebug("addAnni "); |
1378 | Event * ev = new Event(); | 1380 | Event * ev = new Event(); |
1379 | if ( a ) { | 1381 | if ( a ) { |
1380 | ev->addAttendee( a ); | 1382 | ev->addAttendee( a ); |
1381 | } | 1383 | } |
1382 | QString kind; | 1384 | QString kind; |
1383 | if ( birthday ) | 1385 | if ( birthday ) |
1384 | kind = i18n( "Birthday" ); | 1386 | kind = i18n( "Birthday" ); |
1385 | else | 1387 | else |
1386 | kind = i18n( "Anniversary" ); | 1388 | kind = i18n( "Anniversary" ); |
1387 | ev->setSummary( name + " - " + kind ); | 1389 | ev->setSummary( name + " - " + kind ); |
1388 | ev->setOrganizer( "nobody@nowhere" ); | 1390 | ev->setOrganizer( "nobody@nowhere" ); |
1389 | ev->setCategories( kind ); | 1391 | ev->setCategories( kind ); |
1390 | ev->setDtStart( QDateTime(date) ); | 1392 | ev->setDtStart( QDateTime(date) ); |
1391 | ev->setDtEnd( QDateTime(date) ); | 1393 | ev->setDtEnd( QDateTime(date) ); |
1392 | ev->setFloats( true ); | 1394 | ev->setFloats( true ); |
1393 | Recurrence * rec = ev->recurrence(); | 1395 | Recurrence * rec = ev->recurrence(); |
1394 | rec->setYearly(Recurrence::rYearlyMonth,1,-1); | 1396 | rec->setYearly(Recurrence::rYearlyMonth,1,-1); |
1395 | rec->addYearlyNum( date.month() ); | 1397 | rec->addYearlyNum( date.month() ); |
1396 | if ( !mCalendar->addAnniversaryNoDup( ev ) ) { | 1398 | if ( !mCalendar->addAnniversaryNoDup( ev ) ) { |
1397 | delete ev; | 1399 | delete ev; |
1398 | return false; | 1400 | return false; |
1399 | } | 1401 | } |
1400 | return true; | 1402 | return true; |
1401 | 1403 | ||
1402 | } | 1404 | } |
1403 | bool CalendarView::importQtopia( const QString &categories, | 1405 | bool CalendarView::importQtopia( const QString &categories, |
1404 | const QString &datebook, | 1406 | const QString &datebook, |
1405 | const QString &todolist ) | 1407 | const QString &todolist ) |
1406 | { | 1408 | { |
1407 | 1409 | ||
1408 | QtopiaFormat qtopiaFormat; | 1410 | QtopiaFormat qtopiaFormat; |
1409 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); | 1411 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); |
1410 | if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); | 1412 | if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); |
1411 | if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); | 1413 | if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); |
1412 | if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); | 1414 | if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); |
1413 | 1415 | ||
1414 | updateView(); | 1416 | updateView(); |
1415 | return true; | 1417 | return true; |
1416 | 1418 | ||
1417 | #if 0 | 1419 | #if 0 |
1418 | mGlobalSyncMode = SYNC_MODE_QTOPIA; | 1420 | mGlobalSyncMode = SYNC_MODE_QTOPIA; |
1419 | mCurrentSyncDevice = "qtopia-XML"; | 1421 | mCurrentSyncDevice = "qtopia-XML"; |
1420 | if ( KOPrefs::instance()->mAskForPreferences ) | 1422 | if ( KOPrefs::instance()->mAskForPreferences ) |
1421 | edit_sync_options(); | 1423 | edit_sync_options(); |
1422 | qApp->processEvents(); | 1424 | qApp->processEvents(); |
1423 | CalendarLocal* calendar = new CalendarLocal(); | 1425 | CalendarLocal* calendar = new CalendarLocal(); |
1424 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1426 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1425 | bool syncOK = false; | 1427 | bool syncOK = false; |
1426 | QtopiaFormat qtopiaFormat; | 1428 | QtopiaFormat qtopiaFormat; |
1427 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); | 1429 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); |
1428 | bool loadOk = true; | 1430 | bool loadOk = true; |
1429 | if ( !categories.isEmpty() ) | 1431 | if ( !categories.isEmpty() ) |
1430 | loadOk = qtopiaFormat.load( calendar, categories ); | 1432 | loadOk = qtopiaFormat.load( calendar, categories ); |
1431 | if ( loadOk && !datebook.isEmpty() ) | 1433 | if ( loadOk && !datebook.isEmpty() ) |
1432 | loadOk = qtopiaFormat.load( calendar, datebook ); | 1434 | loadOk = qtopiaFormat.load( calendar, datebook ); |
1433 | if ( loadOk && !todolist.isEmpty() ) | 1435 | if ( loadOk && !todolist.isEmpty() ) |
1434 | loadOk = qtopiaFormat.load( calendar, todolist ); | 1436 | loadOk = qtopiaFormat.load( calendar, todolist ); |
1435 | 1437 | ||
1436 | if ( loadOk ) { | 1438 | if ( loadOk ) { |
1437 | getEventViewerDialog()->setSyncMode( true ); | 1439 | getEventViewerDialog()->setSyncMode( true ); |
1438 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); | 1440 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); |
1439 | getEventViewerDialog()->setSyncMode( false ); | 1441 | getEventViewerDialog()->setSyncMode( false ); |
1440 | qApp->processEvents(); | 1442 | qApp->processEvents(); |
1441 | if ( syncOK ) { | 1443 | if ( syncOK ) { |
1442 | if ( KOPrefs::instance()->mWriteBackFile ) | 1444 | if ( KOPrefs::instance()->mWriteBackFile ) |
1443 | { | 1445 | { |
1444 | // write back XML file | 1446 | // write back XML file |
1445 | 1447 | ||
1446 | } | 1448 | } |
1447 | setModified( true ); | 1449 | setModified( true ); |
1448 | } | 1450 | } |
1449 | } else { | 1451 | } else { |
1450 | QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; | 1452 | QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; |
1451 | QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), | 1453 | QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), |
1452 | question, i18n("Ok")) ; | 1454 | question, i18n("Ok")) ; |
1453 | } | 1455 | } |
1454 | delete calendar; | 1456 | delete calendar; |
1455 | updateView(); | 1457 | updateView(); |
1456 | return syncOK; | 1458 | return syncOK; |
1457 | 1459 | ||
1458 | 1460 | ||
1459 | #endif | 1461 | #endif |
1460 | 1462 | ||
1461 | } | 1463 | } |
1462 | 1464 | ||
1463 | void CalendarView::setSyncEventsReadOnly() | 1465 | void CalendarView::setSyncEventsReadOnly() |
1464 | { | 1466 | { |
1465 | Event * ev; | 1467 | Event * ev; |
1466 | QPtrList<Event> eL = mCalendar->rawEvents(); | 1468 | QPtrList<Event> eL = mCalendar->rawEvents(); |
1467 | ev = eL.first(); | 1469 | ev = eL.first(); |
1468 | while ( ev ) { | 1470 | while ( ev ) { |
1469 | if ( ev->uid().left(15) == QString("last-syncEvent-") ) | 1471 | if ( ev->uid().left(15) == QString("last-syncEvent-") ) |
1470 | ev->setReadOnly( true ); | 1472 | ev->setReadOnly( true ); |
1471 | ev = eL.next(); | 1473 | ev = eL.next(); |
1472 | } | 1474 | } |
1473 | } | 1475 | } |
1474 | bool CalendarView::openCalendar(QString filename, bool merge) | 1476 | bool CalendarView::openCalendar(QString filename, bool merge) |
1475 | { | 1477 | { |
1476 | 1478 | ||
1477 | if (filename.isEmpty()) { | 1479 | if (filename.isEmpty()) { |
1478 | return false; | 1480 | return false; |
1479 | } | 1481 | } |
1480 | 1482 | ||
1481 | if (!QFile::exists(filename)) { | 1483 | if (!QFile::exists(filename)) { |
1482 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); | 1484 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); |
1483 | return false; | 1485 | return false; |
1484 | } | 1486 | } |
1485 | 1487 | ||
1486 | globalFlagBlockAgenda = 1; | 1488 | globalFlagBlockAgenda = 1; |
1487 | if (!merge) mCalendar->close(); | 1489 | if (!merge) mCalendar->close(); |
1488 | 1490 | ||
1489 | mStorage->setFileName( filename ); | 1491 | mStorage->setFileName( filename ); |
1490 | 1492 | ||
1491 | if ( mStorage->load(KOPrefs::instance()->mUseQuicksave) ) { | 1493 | if ( mStorage->load(KOPrefs::instance()->mUseQuicksave) ) { |
1492 | if ( merge ) ;//setModified( true ); | 1494 | if ( merge ) ;//setModified( true ); |
1493 | else { | 1495 | else { |
1494 | //setModified( true ); | 1496 | //setModified( true ); |
1495 | mViewManager->setDocumentId( filename ); | 1497 | mViewManager->setDocumentId( filename ); |
1496 | mDialogManager->setDocumentId( filename ); | 1498 | mDialogManager->setDocumentId( filename ); |
1497 | mTodoList->setDocumentId( filename ); | 1499 | mTodoList->setDocumentId( filename ); |
1498 | } | 1500 | } |
1499 | globalFlagBlockAgenda = 2; | 1501 | globalFlagBlockAgenda = 2; |
1500 | // if ( getLastSyncEvent() ) | 1502 | // if ( getLastSyncEvent() ) |
1501 | // getLastSyncEvent()->setReadOnly( true ); | 1503 | // getLastSyncEvent()->setReadOnly( true ); |
1502 | mCalendar->reInitAlarmSettings(); | 1504 | mCalendar->reInitAlarmSettings(); |
1503 | setSyncEventsReadOnly(); | 1505 | setSyncEventsReadOnly(); |
1504 | updateUnmanagedViews(); | 1506 | updateUnmanagedViews(); |
1505 | updateView(); | 1507 | updateView(); |
1506 | if ( filename != MainWindow::defaultFileName() ) | 1508 | if ( filename != MainWindow::defaultFileName() ) |
1507 | saveCalendar( MainWindow::defaultFileName() ); | 1509 | saveCalendar( MainWindow::defaultFileName() ); |
1508 | loadedFileVersion = QDateTime::currentDateTime(); | 1510 | loadedFileVersion = QDateTime::currentDateTime(); |
1509 | return true; | 1511 | return true; |
1510 | } else { | 1512 | } else { |
1511 | // while failing to load, the calendar object could | 1513 | // while failing to load, the calendar object could |
1512 | // have become partially populated. Clear it out. | 1514 | // have become partially populated. Clear it out. |
1513 | if ( !merge ) mCalendar->close(); | 1515 | if ( !merge ) mCalendar->close(); |
1514 | 1516 | ||
1515 | KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); | 1517 | KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); |
1516 | 1518 | ||
1517 | globalFlagBlockAgenda = 2; | 1519 | globalFlagBlockAgenda = 2; |
1518 | updateView(); | 1520 | updateView(); |
1519 | } | 1521 | } |
1520 | return false; | 1522 | return false; |
1521 | } | 1523 | } |
1522 | void CalendarView::setLoadedFileVersion(QDateTime dt) | 1524 | void CalendarView::setLoadedFileVersion(QDateTime dt) |
1523 | { | 1525 | { |
1524 | loadedFileVersion = dt; | 1526 | loadedFileVersion = dt; |
1525 | } | 1527 | } |
1526 | bool CalendarView::checkFileChanged(QString fn) | 1528 | bool CalendarView::checkFileChanged(QString fn) |
1527 | { | 1529 | { |
1528 | QFileInfo finf ( fn ); | 1530 | QFileInfo finf ( fn ); |
1529 | if ( !finf.exists() ) | 1531 | if ( !finf.exists() ) |
1530 | return true; | 1532 | return true; |
1531 | QDateTime dt = finf.lastModified (); | 1533 | QDateTime dt = finf.lastModified (); |
1532 | if ( dt <= loadedFileVersion ) | 1534 | if ( dt <= loadedFileVersion ) |
1533 | return false; | 1535 | return false; |
1534 | return true; | 1536 | return true; |
1535 | 1537 | ||
1536 | } | 1538 | } |
1537 | bool CalendarView::checkFileVersion(QString fn) | 1539 | bool CalendarView::checkFileVersion(QString fn) |
1538 | { | 1540 | { |
1539 | QFileInfo finf ( fn ); | 1541 | QFileInfo finf ( fn ); |
1540 | if ( !finf.exists() ) | 1542 | if ( !finf.exists() ) |
1541 | return true; | 1543 | return true; |
1542 | QDateTime dt = finf.lastModified (); | 1544 | QDateTime dt = finf.lastModified (); |
1543 | //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); | 1545 | //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); |
1544 | //qDebug("file on disk version %s",dt.toString().latin1()); | 1546 | //qDebug("file on disk version %s",dt.toString().latin1()); |
1545 | if ( dt <= loadedFileVersion ) | 1547 | if ( dt <= loadedFileVersion ) |
1546 | return true; | 1548 | return true; |
1547 | int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, false)) , | 1549 | int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, false)) , |
1548 | i18n("KO/Pi Warning"),i18n("Overwrite"), | 1550 | i18n("KO/Pi Warning"),i18n("Overwrite"), |
1549 | i18n("Sync+save")); | 1551 | i18n("Sync+save")); |
1550 | 1552 | ||
1551 | if ( km == KMessageBox::Cancel ) | 1553 | if ( km == KMessageBox::Cancel ) |
1552 | return false; | 1554 | return false; |
1553 | if ( km == KMessageBox::Yes ) | 1555 | if ( km == KMessageBox::Yes ) |
1554 | return true; | 1556 | return true; |
1555 | 1557 | ||
1556 | setSyncDevice("deleteaftersync" ); | 1558 | setSyncDevice("deleteaftersync" ); |
1557 | KOPrefs::instance()->mAskForPreferences = true; | 1559 | KOPrefs::instance()->mAskForPreferences = true; |
1558 | KOPrefs::instance()->mSyncAlgoPrefs = 3; | 1560 | KOPrefs::instance()->mSyncAlgoPrefs = 3; |
1559 | KOPrefs::instance()->mWriteBackFile = false; | 1561 | KOPrefs::instance()->mWriteBackFile = false; |
1560 | KOPrefs::instance()->mWriteBackExistingOnly = false; | 1562 | KOPrefs::instance()->mWriteBackExistingOnly = false; |
1561 | KOPrefs::instance()->mShowSyncSummary = false; | 1563 | KOPrefs::instance()->mShowSyncSummary = false; |
1562 | syncCalendar( fn, 3 ); | 1564 | syncCalendar( fn, 3 ); |
1563 | Event * e = getLastSyncEvent(); | 1565 | Event * e = getLastSyncEvent(); |
1564 | mCalendar->deleteEvent ( e ); | 1566 | mCalendar->deleteEvent ( e ); |
1565 | updateView(); | 1567 | updateView(); |
1566 | return true; | 1568 | return true; |
1567 | } | 1569 | } |
1568 | 1570 | ||
1569 | bool CalendarView::saveCalendar( QString filename ) | 1571 | bool CalendarView::saveCalendar( QString filename ) |
1570 | { | 1572 | { |
1571 | 1573 | ||
1572 | // Store back all unsaved data into calendar object | 1574 | // Store back all unsaved data into calendar object |
1573 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); | 1575 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); |
1574 | if ( mViewManager->currentView() ) | 1576 | if ( mViewManager->currentView() ) |
1575 | mViewManager->currentView()->flushView(); | 1577 | mViewManager->currentView()->flushView(); |
1576 | 1578 | ||
1577 | //mStorage->setFileName( filename ); | 1579 | //mStorage->setFileName( filename ); |
1578 | 1580 | ||
1579 | mStorage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 1581 | mStorage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); |
1580 | mStorage->setFileName( filename ); | 1582 | mStorage->setFileName( filename ); |
1581 | bool success; | 1583 | bool success; |
1582 | success = mStorage->save(); | 1584 | success = mStorage->save(); |
1583 | if ( !success ) { | 1585 | if ( !success ) { |
1584 | return false; | 1586 | return false; |
1585 | } | 1587 | } |
1586 | 1588 | ||
1587 | return true; | 1589 | return true; |
1588 | } | 1590 | } |
1589 | 1591 | ||
1590 | void CalendarView::closeCalendar() | 1592 | void CalendarView::closeCalendar() |
1591 | { | 1593 | { |
1592 | 1594 | ||
1593 | // child windows no longer valid | 1595 | // child windows no longer valid |
1594 | emit closingDown(); | 1596 | emit closingDown(); |
1595 | 1597 | ||
1596 | mCalendar->close(); | 1598 | mCalendar->close(); |
1597 | setModified(false); | 1599 | setModified(false); |
1598 | updateView(); | 1600 | updateView(); |
1599 | } | 1601 | } |
1600 | 1602 | ||
1601 | void CalendarView::archiveCalendar() | 1603 | void CalendarView::archiveCalendar() |
1602 | { | 1604 | { |
1603 | mDialogManager->showArchiveDialog(); | 1605 | mDialogManager->showArchiveDialog(); |
1604 | } | 1606 | } |
1605 | 1607 | ||
1606 | 1608 | ||
1607 | void CalendarView::readSettings() | 1609 | void CalendarView::readSettings() |
1608 | { | 1610 | { |
1609 | 1611 | ||
1610 | 1612 | ||
1611 | // mViewManager->showAgendaView(); | 1613 | // mViewManager->showAgendaView(); |
1612 | QString str; | 1614 | QString str; |
1613 | //qDebug("CalendarView::readSettings() "); | 1615 | //qDebug("CalendarView::readSettings() "); |
1614 | // read settings from the KConfig, supplying reasonable | 1616 | // read settings from the KConfig, supplying reasonable |
1615 | // defaults where none are to be found | 1617 | // defaults where none are to be found |
1616 | KConfig *config = KOGlobals::config(); | 1618 | KConfig *config = KOGlobals::config(); |
1617 | #ifndef KORG_NOSPLITTER | 1619 | #ifndef KORG_NOSPLITTER |
1618 | config->setGroup("KOrganizer Geometry"); | 1620 | config->setGroup("KOrganizer Geometry"); |
1619 | 1621 | ||
1620 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 1622 | QValueList<int> sizes = config->readIntListEntry("Separator1"); |
1621 | if (sizes.count() != 2) { | 1623 | if (sizes.count() != 2) { |
1622 | sizes << mDateNavigator->minimumSizeHint().width(); | 1624 | sizes << mDateNavigator->minimumSizeHint().width(); |
1623 | sizes << 300; | 1625 | sizes << 300; |
1624 | } | 1626 | } |
1625 | mPanner->setSizes(sizes); | 1627 | mPanner->setSizes(sizes); |
1626 | 1628 | ||
1627 | sizes = config->readIntListEntry("Separator2"); | 1629 | sizes = config->readIntListEntry("Separator2"); |
1628 | if ( ( mResourceView && sizes.count() == 4 ) || | 1630 | if ( ( mResourceView && sizes.count() == 4 ) || |
1629 | ( !mResourceView && sizes.count() == 3 ) ) { | 1631 | ( !mResourceView && sizes.count() == 3 ) ) { |
1630 | mLeftSplitter->setSizes(sizes); | 1632 | mLeftSplitter->setSizes(sizes); |
1631 | } | 1633 | } |
1632 | #endif | 1634 | #endif |
1633 | globalFlagBlockAgenda = 1; | 1635 | globalFlagBlockAgenda = 1; |
1634 | mViewManager->showAgendaView(); | 1636 | mViewManager->showAgendaView(); |
1635 | //mViewManager->readSettings( config ); | 1637 | //mViewManager->readSettings( config ); |
1636 | mTodoList->restoreLayout(config,QString("Todo Layout")); | 1638 | mTodoList->restoreLayout(config,QString("Todo Layout")); |
1637 | readFilterSettings(config); | 1639 | readFilterSettings(config); |
1638 | config->setGroup( "Views" ); | 1640 | config->setGroup( "Views" ); |
1639 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 1641 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
1640 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1642 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1641 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1643 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1642 | else mNavigator->selectDates( dateCount ); | 1644 | else mNavigator->selectDates( dateCount ); |
1643 | // mViewManager->readSettings( config ); | 1645 | // mViewManager->readSettings( config ); |
1644 | updateConfig(); | 1646 | updateConfig(); |
1645 | globalFlagBlockAgenda = 2; | 1647 | globalFlagBlockAgenda = 2; |
1646 | mViewManager->readSettings( config ); | 1648 | mViewManager->readSettings( config ); |
1647 | #ifdef DESKTOP_VERSION | 1649 | #ifdef DESKTOP_VERSION |
1648 | config->setGroup("WidgetLayout"); | 1650 | config->setGroup("WidgetLayout"); |
1649 | QStringList list; | 1651 | QStringList list; |
1650 | list = config->readListEntry("MainLayout"); | 1652 | list = config->readListEntry("MainLayout"); |
1651 | int x,y,w,h; | 1653 | int x,y,w,h; |
1652 | if ( ! list.isEmpty() ) { | 1654 | if ( ! list.isEmpty() ) { |
1653 | x = list[0].toInt(); | 1655 | x = list[0].toInt(); |
1654 | y = list[1].toInt(); | 1656 | y = list[1].toInt(); |
1655 | w = list[2].toInt(); | 1657 | w = list[2].toInt(); |
1656 | h = list[3].toInt(); | 1658 | h = list[3].toInt(); |
1657 | topLevelWidget()->setGeometry(x,y,w,h); | 1659 | topLevelWidget()->setGeometry(x,y,w,h); |
1658 | 1660 | ||
1659 | } else { | 1661 | } else { |
1660 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 1662 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |
1661 | } | 1663 | } |
1662 | list = config->readListEntry("EditEventLayout"); | 1664 | list = config->readListEntry("EditEventLayout"); |
1663 | if ( ! list.isEmpty() ) { | 1665 | if ( ! list.isEmpty() ) { |
1664 | x = list[0].toInt(); | 1666 | x = list[0].toInt(); |
1665 | y = list[1].toInt(); | 1667 | y = list[1].toInt(); |
1666 | w = list[2].toInt(); | 1668 | w = list[2].toInt(); |
1667 | h = list[3].toInt(); | 1669 | h = list[3].toInt(); |
1668 | mEventEditor->setGeometry(x,y,w,h); | 1670 | mEventEditor->setGeometry(x,y,w,h); |
1669 | 1671 | ||
1670 | } | 1672 | } |
1671 | list = config->readListEntry("EditTodoLayout"); | 1673 | list = config->readListEntry("EditTodoLayout"); |
1672 | if ( ! list.isEmpty() ) { | 1674 | if ( ! list.isEmpty() ) { |
1673 | x = list[0].toInt(); | 1675 | x = list[0].toInt(); |
1674 | y = list[1].toInt(); | 1676 | y = list[1].toInt(); |
1675 | w = list[2].toInt(); | 1677 | w = list[2].toInt(); |
1676 | h = list[3].toInt(); | 1678 | h = list[3].toInt(); |
1677 | mTodoEditor->setGeometry(x,y,w,h); | 1679 | mTodoEditor->setGeometry(x,y,w,h); |
1678 | 1680 | ||
1679 | } | 1681 | } |
1680 | list = config->readListEntry("ViewerLayout"); | 1682 | list = config->readListEntry("ViewerLayout"); |
1681 | if ( ! list.isEmpty() ) { | 1683 | if ( ! list.isEmpty() ) { |
1682 | x = list[0].toInt(); | 1684 | x = list[0].toInt(); |
1683 | y = list[1].toInt(); | 1685 | y = list[1].toInt(); |
1684 | w = list[2].toInt(); | 1686 | w = list[2].toInt(); |
1685 | h = list[3].toInt(); | 1687 | h = list[3].toInt(); |
1686 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1688 | getEventViewerDialog()->setGeometry(x,y,w,h); |
1687 | } | 1689 | } |
1688 | #endif | 1690 | #endif |
1689 | 1691 | ||
1690 | } | 1692 | } |
1691 | 1693 | ||
1692 | 1694 | ||
1693 | void CalendarView::writeSettings() | 1695 | void CalendarView::writeSettings() |
1694 | { | 1696 | { |
1695 | // kdDebug() << "CalendarView::writeSettings" << endl; | 1697 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1696 | 1698 | ||
1697 | KConfig *config = KOGlobals::config(); | 1699 | KConfig *config = KOGlobals::config(); |
1698 | 1700 | ||
1699 | #ifndef KORG_NOSPLITTER | 1701 | #ifndef KORG_NOSPLITTER |
1700 | config->setGroup("KOrganizer Geometry"); | 1702 | config->setGroup("KOrganizer Geometry"); |
1701 | 1703 | ||
1702 | QValueList<int> list = mPanner->sizes(); | 1704 | QValueList<int> list = mPanner->sizes(); |
1703 | config->writeEntry("Separator1",list); | 1705 | config->writeEntry("Separator1",list); |
1704 | 1706 | ||
1705 | list = mLeftSplitter->sizes(); | 1707 | list = mLeftSplitter->sizes(); |
1706 | config->writeEntry("Separator2",list); | 1708 | config->writeEntry("Separator2",list); |
1707 | #endif | 1709 | #endif |
1708 | 1710 | ||
1709 | mViewManager->writeSettings( config ); | 1711 | mViewManager->writeSettings( config ); |
1710 | mTodoList->saveLayout(config,QString("Todo Layout")); | 1712 | mTodoList->saveLayout(config,QString("Todo Layout")); |
1711 | mDialogManager->writeSettings( config ); | 1713 | mDialogManager->writeSettings( config ); |
1712 | //KOPrefs::instance()->usrWriteConfig(); | 1714 | //KOPrefs::instance()->usrWriteConfig(); |
1713 | KOPrefs::instance()->writeConfig(); | 1715 | KOPrefs::instance()->writeConfig(); |
1714 | 1716 | ||
1715 | writeFilterSettings(config); | 1717 | writeFilterSettings(config); |
1716 | 1718 | ||
1717 | config->setGroup( "Views" ); | 1719 | config->setGroup( "Views" ); |
1718 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 1720 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1719 | 1721 | ||
1720 | #ifdef DESKTOP_VERSION | 1722 | #ifdef DESKTOP_VERSION |
1721 | config->setGroup("WidgetLayout"); | 1723 | config->setGroup("WidgetLayout"); |
1722 | QStringList list ;//= config->readListEntry("MainLayout"); | 1724 | QStringList list ;//= config->readListEntry("MainLayout"); |
1723 | int x,y,w,h; | 1725 | int x,y,w,h; |
1724 | QWidget* wid; | 1726 | QWidget* wid; |
1725 | wid = topLevelWidget(); | 1727 | wid = topLevelWidget(); |
1726 | x = wid->geometry().x(); | 1728 | x = wid->geometry().x(); |
1727 | y = wid->geometry().y(); | 1729 | y = wid->geometry().y(); |
1728 | w = wid->width(); | 1730 | w = wid->width(); |
1729 | h = wid->height(); | 1731 | h = wid->height(); |
1730 | list.clear(); | 1732 | list.clear(); |
1731 | list << QString::number( x ); | 1733 | list << QString::number( x ); |
1732 | list << QString::number( y ); | 1734 | list << QString::number( y ); |
1733 | list << QString::number( w ); | 1735 | list << QString::number( w ); |
1734 | list << QString::number( h ); | 1736 | list << QString::number( h ); |
1735 | config->writeEntry("MainLayout",list ); | 1737 | config->writeEntry("MainLayout",list ); |
1736 | 1738 | ||
1737 | wid = mEventEditor; | 1739 | wid = mEventEditor; |
1738 | x = wid->geometry().x(); | 1740 | x = wid->geometry().x(); |
1739 | y = wid->geometry().y(); | 1741 | y = wid->geometry().y(); |
1740 | w = wid->width(); | 1742 | w = wid->width(); |
1741 | h = wid->height(); | 1743 | h = wid->height(); |
1742 | list.clear(); | 1744 | list.clear(); |
1743 | list << QString::number( x ); | 1745 | list << QString::number( x ); |
1744 | list << QString::number( y ); | 1746 | list << QString::number( y ); |
1745 | list << QString::number( w ); | 1747 | list << QString::number( w ); |
1746 | list << QString::number( h ); | 1748 | list << QString::number( h ); |
1747 | config->writeEntry("EditEventLayout",list ); | 1749 | config->writeEntry("EditEventLayout",list ); |
1748 | 1750 | ||
1749 | wid = mTodoEditor; | 1751 | wid = mTodoEditor; |
1750 | x = wid->geometry().x(); | 1752 | x = wid->geometry().x(); |
1751 | y = wid->geometry().y(); | 1753 | y = wid->geometry().y(); |
1752 | w = wid->width(); | 1754 | w = wid->width(); |
1753 | h = wid->height(); | 1755 | h = wid->height(); |
1754 | list.clear(); | 1756 | list.clear(); |
1755 | list << QString::number( x ); | 1757 | list << QString::number( x ); |
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp index f3bd09f..50e3077 100644 --- a/korganizer/incomingdialog.cpp +++ b/korganizer/incomingdialog.cpp | |||
@@ -1,437 +1,438 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlistview.h> | 20 | #include <qlistview.h> |
21 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qdir.h> | 22 | #include <qdir.h> |
23 | #include <qmap.h> | 23 | #include <qmap.h> |
24 | 24 | ||
25 | #include <kglobal.h> | 25 | #include <kglobal.h> |
26 | #include <klocale.h> | 26 | #include <klocale.h> |
27 | #include <kdebug.h> | 27 | #include <kdebug.h> |
28 | #include <kstandarddirs.h> | 28 | #include <kstandarddirs.h> |
29 | #include <kmessagebox.h> | 29 | #include <kmessagebox.h> |
30 | 30 | ||
31 | #include <libkcal/incidence.h> | 31 | #include <libkcal/incidence.h> |
32 | #include <libkcal/event.h> | 32 | #include <libkcal/event.h> |
33 | #include <libkcal/calendar.h> | 33 | #include <libkcal/calendar.h> |
34 | #include <libkcal/freebusy.h> | 34 | #include <libkcal/freebusy.h> |
35 | #include <libkcal/attendee.h> | 35 | #include <libkcal/attendee.h> |
36 | #include <libkcal/calendarresources.h> | 36 | #include <libkcal/calendarresources.h> |
37 | #include <libkcal/resourcecalendar.h> | 37 | #include <libkcal/resourcecalendar.h> |
38 | #include <kresources/resourceselectdialog.h> | 38 | #include <kresources/resourceselectdialog.h> |
39 | 39 | ||
40 | #ifndef KORG_NOMAIL | 40 | #ifndef KORG_NOMAIL |
41 | #include "mailscheduler.h" | 41 | #include "mailscheduler.h" |
42 | #else | 42 | #else |
43 | #include <libkcal/dummyscheduler.h> | 43 | #include <libkcal/dummyscheduler.h> |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | 46 | ||
47 | #include "incomingdialog.h" | 47 | #include "incomingdialog.h" |
48 | #include "koeventviewerdialog.h" | 48 | #include "koeventviewerdialog.h" |
49 | #include "kocounterdialog.h" | 49 | #include "kocounterdialog.h" |
50 | #include "koprefs.h" | 50 | #include "koprefs.h" |
51 | 51 | ||
52 | #ifndef KORG_NOKABC | 52 | #ifndef KORG_NOKABC |
53 | #include <kabc/stdaddressbook.h> | 53 | #define KORG_NOKABC |
54 | //#include <kabc/stdaddressbook.h> | ||
54 | #define size count | 55 | #define size count |
55 | #endif | 56 | #endif |
56 | 57 | ||
57 | 58 | ||
58 | ScheduleItemIn::ScheduleItemIn(QListView *parent,IncidenceBase *ev, | 59 | ScheduleItemIn::ScheduleItemIn(QListView *parent,IncidenceBase *ev, |
59 | Scheduler::Method method,ScheduleMessage::Status status) | 60 | Scheduler::Method method,ScheduleMessage::Status status) |
60 | : QListViewItem(parent) | 61 | : QListViewItem(parent) |
61 | { | 62 | { |
62 | mIncidence = ev; | 63 | mIncidence = ev; |
63 | mMethod = method; | 64 | mMethod = method; |
64 | mStatus = status; | 65 | mStatus = status; |
65 | setText(6,Scheduler::translatedMethodName(mMethod)+" "); | 66 | setText(6,Scheduler::translatedMethodName(mMethod)+" "); |
66 | setText(7,ScheduleMessage::statusName(status)); | 67 | setText(7,ScheduleMessage::statusName(status)); |
67 | } | 68 | } |
68 | 69 | ||
69 | 70 | ||
70 | /* Visitor */ | 71 | /* Visitor */ |
71 | ScheduleItemVisitor::ScheduleItemVisitor(ScheduleItemIn *item) | 72 | ScheduleItemVisitor::ScheduleItemVisitor(ScheduleItemIn *item) |
72 | { | 73 | { |
73 | mItem = item; | 74 | mItem = item; |
74 | } | 75 | } |
75 | 76 | ||
76 | ScheduleItemVisitor::~ScheduleItemVisitor() | 77 | ScheduleItemVisitor::~ScheduleItemVisitor() |
77 | { | 78 | { |
78 | } | 79 | } |
79 | 80 | ||
80 | bool ScheduleItemVisitor::visit(Event *e) | 81 | bool ScheduleItemVisitor::visit(Event *e) |
81 | { | 82 | { |
82 | mItem->setText(0,e->summary()); | 83 | mItem->setText(0,e->summary()); |
83 | mItem->setText(1,e->dtStartDateStr()); | 84 | mItem->setText(1,e->dtStartDateStr()); |
84 | if (e->doesFloat()) { | 85 | if (e->doesFloat()) { |
85 | mItem->setText(2,i18n("no time ")); | 86 | mItem->setText(2,i18n("no time ")); |
86 | mItem->setText(4,i18n("no time ")); | 87 | mItem->setText(4,i18n("no time ")); |
87 | } | 88 | } |
88 | else { | 89 | else { |
89 | mItem->setText(2,e->dtStartTimeStr()); | 90 | mItem->setText(2,e->dtStartTimeStr()); |
90 | mItem->setText(4,e->dtEndTimeStr()); | 91 | mItem->setText(4,e->dtEndTimeStr()); |
91 | } | 92 | } |
92 | if (e->hasEndDate()) { | 93 | if (e->hasEndDate()) { |
93 | mItem->setText(3,e->dtEndDateStr()); | 94 | mItem->setText(3,e->dtEndDateStr()); |
94 | } | 95 | } |
95 | else { | 96 | else { |
96 | mItem->setText(3,""); | 97 | mItem->setText(3,""); |
97 | } | 98 | } |
98 | mItem->setText(5,e->organizer()+" "); | 99 | mItem->setText(5,e->organizer()+" "); |
99 | 100 | ||
100 | return true; | 101 | return true; |
101 | } | 102 | } |
102 | 103 | ||
103 | bool ScheduleItemVisitor::visit(Todo *e) | 104 | bool ScheduleItemVisitor::visit(Todo *e) |
104 | { | 105 | { |
105 | mItem->setText(0,e->summary()); | 106 | mItem->setText(0,e->summary()); |
106 | if (e->hasStartDate()) { | 107 | if (e->hasStartDate()) { |
107 | mItem->setText(1,e->dtStartDateStr()); | 108 | mItem->setText(1,e->dtStartDateStr()); |
108 | if (!e->doesFloat()) { | 109 | if (!e->doesFloat()) { |
109 | mItem->setText(2,e->dtStartTimeStr()); | 110 | mItem->setText(2,e->dtStartTimeStr()); |
110 | } | 111 | } |
111 | } | 112 | } |
112 | if (e->hasDueDate()) { | 113 | if (e->hasDueDate()) { |
113 | mItem->setText(1,e->dtDueDateStr()); | 114 | mItem->setText(1,e->dtDueDateStr()); |
114 | if (!e->doesFloat()) { | 115 | if (!e->doesFloat()) { |
115 | mItem->setText(2,e->dtDueTimeStr()); | 116 | mItem->setText(2,e->dtDueTimeStr()); |
116 | } | 117 | } |
117 | } | 118 | } |
118 | mItem->setText(5,e->organizer()+" "); | 119 | mItem->setText(5,e->organizer()+" "); |
119 | 120 | ||
120 | return true; | 121 | return true; |
121 | } | 122 | } |
122 | 123 | ||
123 | bool ScheduleItemVisitor::visit(Journal *) | 124 | bool ScheduleItemVisitor::visit(Journal *) |
124 | { | 125 | { |
125 | return false; | 126 | return false; |
126 | } | 127 | } |
127 | 128 | ||
128 | 129 | ||
129 | /* | 130 | /* |
130 | * Constructs a IncomingDialog which is a child of 'parent', with the | 131 | * Constructs a IncomingDialog which is a child of 'parent', with the |
131 | * name 'name' and widget flags set to 'f' | 132 | * name 'name' and widget flags set to 'f' |
132 | * | 133 | * |
133 | * The dialog will by default be modeless, unless you set 'modal' to | 134 | * The dialog will by default be modeless, unless you set 'modal' to |
134 | * TRUE to construct a modal dialog. | 135 | * TRUE to construct a modal dialog. |
135 | */ | 136 | */ |
136 | IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, | 137 | IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, |
137 | QWidget* parent,const char* name,bool modal,WFlags fl) : | 138 | QWidget* parent,const char* name,bool modal,WFlags fl) : |
138 | IncomingDialog_base(parent,name,modal,fl) | 139 | IncomingDialog_base(parent,name,modal,fl) |
139 | { | 140 | { |
140 | mCalendar = calendar; | 141 | mCalendar = calendar; |
141 | mOutgoing = outgoing; | 142 | mOutgoing = outgoing; |
142 | #ifndef KORG_NOMAIL | 143 | #ifndef KORG_NOMAIL |
143 | mScheduler = new MailScheduler(mCalendar); | 144 | mScheduler = new MailScheduler(mCalendar); |
144 | #else | 145 | #else |
145 | mScheduler = new DummyScheduler(mCalendar); | 146 | mScheduler = new DummyScheduler(mCalendar); |
146 | #endif | 147 | #endif |
147 | mMessageListView->setColumnAlignment(1,AlignHCenter); | 148 | mMessageListView->setColumnAlignment(1,AlignHCenter); |
148 | mMessageListView->setColumnAlignment(2,AlignHCenter); | 149 | mMessageListView->setColumnAlignment(2,AlignHCenter); |
149 | mMessageListView->setColumnAlignment(3,AlignHCenter); | 150 | mMessageListView->setColumnAlignment(3,AlignHCenter); |
150 | mMessageListView->setColumnAlignment(4,AlignHCenter); | 151 | mMessageListView->setColumnAlignment(4,AlignHCenter); |
151 | QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), | 152 | QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), |
152 | this,SLOT(showEvent(QListViewItem *))); | 153 | this,SLOT(showEvent(QListViewItem *))); |
153 | retrieve(); | 154 | retrieve(); |
154 | } | 155 | } |
155 | 156 | ||
156 | /* | 157 | /* |
157 | * Destroys the object and frees any allocated resources | 158 | * Destroys the object and frees any allocated resources |
158 | */ | 159 | */ |
159 | IncomingDialog::~IncomingDialog() | 160 | IncomingDialog::~IncomingDialog() |
160 | { | 161 | { |
161 | // no need to delete child widgets, Qt does it all for us | 162 | // no need to delete child widgets, Qt does it all for us |
162 | } | 163 | } |
163 | 164 | ||
164 | void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing) | 165 | void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing) |
165 | { | 166 | { |
166 | mOutgoing = outgoing; | 167 | mOutgoing = outgoing; |
167 | } | 168 | } |
168 | 169 | ||
169 | void IncomingDialog::retrieve() | 170 | void IncomingDialog::retrieve() |
170 | { | 171 | { |
171 | QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); | 172 | QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); |
172 | 173 | ||
173 | ScheduleMessage *message; | 174 | ScheduleMessage *message; |
174 | for(message = messages.first();message;message = messages.next()) { | 175 | for(message = messages.first();message;message = messages.next()) { |
175 | IncidenceBase *inc = message->event(); | 176 | IncidenceBase *inc = message->event(); |
176 | Scheduler::Method method = (Scheduler::Method)message->method(); | 177 | Scheduler::Method method = (Scheduler::Method)message->method(); |
177 | ScheduleMessage::Status status = message->status(); | 178 | ScheduleMessage::Status status = message->status(); |
178 | 179 | ||
179 | ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status); | 180 | ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status); |
180 | if(inc->type()!="FreeBusy") { | 181 | if(inc->type()!="FreeBusy") { |
181 | Incidence *incidence = static_cast<Incidence *>(inc); | 182 | Incidence *incidence = static_cast<Incidence *>(inc); |
182 | ScheduleItemVisitor v(item); | 183 | ScheduleItemVisitor v(item); |
183 | if (!incidence->accept(v)) delete item; | 184 | if (!incidence->accept(v)) delete item; |
184 | } else { | 185 | } else { |
185 | FreeBusy *fb = static_cast<FreeBusy *>(item->event()); | 186 | FreeBusy *fb = static_cast<FreeBusy *>(item->event()); |
186 | item->setText(0, "FreeBusy"); | 187 | item->setText(0, "FreeBusy"); |
187 | item->setText(1, KGlobal::locale()->formatDate( fb->dtStart().date() ) ); | 188 | item->setText(1, KGlobal::locale()->formatDate( fb->dtStart().date() ) ); |
188 | item->setText(2, KGlobal::locale()->formatTime( fb->dtStart().time() ) ); | 189 | item->setText(2, KGlobal::locale()->formatTime( fb->dtStart().time() ) ); |
189 | item->setText(3, KGlobal::locale()->formatDate( fb->dtEnd().date() ) ); | 190 | item->setText(3, KGlobal::locale()->formatDate( fb->dtEnd().date() ) ); |
190 | item->setText(4, KGlobal::locale()->formatTime( fb->dtEnd().time() ) ); | 191 | item->setText(4, KGlobal::locale()->formatTime( fb->dtEnd().time() ) ); |
191 | item->setText(5, fb->organizer()); | 192 | item->setText(5, fb->organizer()); |
192 | } | 193 | } |
193 | automaticAction(item); | 194 | automaticAction(item); |
194 | } | 195 | } |
195 | emit numMessagesChanged(mMessageListView->childCount()); | 196 | emit numMessagesChanged(mMessageListView->childCount()); |
196 | } | 197 | } |
197 | 198 | ||
198 | void IncomingDialog::acceptAllMessages() | 199 | void IncomingDialog::acceptAllMessages() |
199 | { | 200 | { |
200 | bool success = false; | 201 | bool success = false; |
201 | 202 | ||
202 | ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->firstChild(); | 203 | ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->firstChild(); |
203 | while(item) { | 204 | while(item) { |
204 | ScheduleItemIn *nextitem = (ScheduleItemIn *)(item->nextSibling()); | 205 | ScheduleItemIn *nextitem = (ScheduleItemIn *)(item->nextSibling()); |
205 | if (acceptMessage(item)) success = true; | 206 | if (acceptMessage(item)) success = true; |
206 | item = nextitem; | 207 | item = nextitem; |
207 | } | 208 | } |
208 | 209 | ||
209 | if (success) emit calendarUpdated(); | 210 | if (success) emit calendarUpdated(); |
210 | } | 211 | } |
211 | 212 | ||
212 | void IncomingDialog::acceptMessage() | 213 | void IncomingDialog::acceptMessage() |
213 | { | 214 | { |
214 | ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem(); | 215 | ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem(); |
215 | if (item) { | 216 | if (item) { |
216 | if (acceptMessage(item)) emit calendarUpdated(); | 217 | if (acceptMessage(item)) emit calendarUpdated(); |
217 | } | 218 | } |
218 | } | 219 | } |
219 | 220 | ||
220 | bool IncomingDialog::acceptMessage(ScheduleItemIn *item) | 221 | bool IncomingDialog::acceptMessage(ScheduleItemIn *item) |
221 | { | 222 | { |
222 | switch (item->method()) { | 223 | switch (item->method()) { |
223 | case Scheduler::Refresh: | 224 | case Scheduler::Refresh: |
224 | return incomeRefresh(item); | 225 | return incomeRefresh(item); |
225 | break; | 226 | break; |
226 | case Scheduler::Counter: | 227 | case Scheduler::Counter: |
227 | return incomeCounter(item); | 228 | return incomeCounter(item); |
228 | break; | 229 | break; |
229 | case Scheduler::Declinecounter: | 230 | case Scheduler::Declinecounter: |
230 | return incomeDeclineCounter(item); | 231 | return incomeDeclineCounter(item); |
231 | break; | 232 | break; |
232 | case Scheduler::Add: | 233 | case Scheduler::Add: |
233 | return incomeAdd(item); | 234 | return incomeAdd(item); |
234 | break; | 235 | break; |
235 | case Scheduler::Request: | 236 | case Scheduler::Request: |
236 | return incomeRequest(item); | 237 | return incomeRequest(item); |
237 | break; | 238 | break; |
238 | default: | 239 | default: |
239 | return incomeDefault(item); | 240 | return incomeDefault(item); |
240 | } | 241 | } |
241 | return false; | 242 | return false; |
242 | } | 243 | } |
243 | 244 | ||
244 | void IncomingDialog::rejectMessage() | 245 | void IncomingDialog::rejectMessage() |
245 | { | 246 | { |
246 | ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem(); | 247 | ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem(); |
247 | if (item) { | 248 | if (item) { |
248 | mScheduler->deleteTransaction(item->event()); | 249 | mScheduler->deleteTransaction(item->event()); |
249 | delete item; | 250 | delete item; |
250 | emit numMessagesChanged(mMessageListView->childCount()); | 251 | emit numMessagesChanged(mMessageListView->childCount()); |
251 | } | 252 | } |
252 | } | 253 | } |
253 | 254 | ||
254 | void IncomingDialog::showEvent(QListViewItem *item) | 255 | void IncomingDialog::showEvent(QListViewItem *item) |
255 | { | 256 | { |
256 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); | 257 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); |
257 | if( incidence && incidence->type() == "Event" ) { | 258 | if( incidence && incidence->type() == "Event" ) { |
258 | Event *event = static_cast<Event *>(incidence); | 259 | Event *event = static_cast<Event *>(incidence); |
259 | KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); | 260 | KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); |
260 | eventViewer->setEvent(event); | 261 | eventViewer->setEvent(event); |
261 | eventViewer->show(); | 262 | eventViewer->show(); |
262 | } | 263 | } |
263 | } | 264 | } |
264 | 265 | ||
265 | bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) | 266 | bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) |
266 | { | 267 | { |
267 | Event *ev = mCalendar->event(item->event()->uid()); | 268 | Event *ev = mCalendar->event(item->event()->uid()); |
268 | if (ev) { | 269 | if (ev) { |
269 | //user interaction before?? | 270 | //user interaction before?? |
270 | Attendee *att; | 271 | Attendee *att; |
271 | QPtrList<Attendee> attlist = ev->attendees(); | 272 | QPtrList<Attendee> attlist = ev->attendees(); |
272 | for (att=attlist.first(); att; att=attlist.next()) { | 273 | for (att=attlist.first(); att; att=attlist.next()) { |
273 | Event *event = new Event(*ev); | 274 | Event *event = new Event(*ev); |
274 | mOutgoing->addMessage(event,Scheduler::Request,att->email()); | 275 | mOutgoing->addMessage(event,Scheduler::Request,att->email()); |
275 | delete(event); | 276 | delete(event); |
276 | } | 277 | } |
277 | mScheduler->deleteTransaction(item->event()); | 278 | mScheduler->deleteTransaction(item->event()); |
278 | delete item; | 279 | delete item; |
279 | emit numMessagesChanged(mMessageListView->childCount()); | 280 | emit numMessagesChanged(mMessageListView->childCount()); |
280 | return true; | 281 | return true; |
281 | } | 282 | } |
282 | mScheduler->deleteTransaction(item->event()); | 283 | mScheduler->deleteTransaction(item->event()); |
283 | delete item; | 284 | delete item; |
284 | emit numMessagesChanged(mMessageListView->childCount()); | 285 | emit numMessagesChanged(mMessageListView->childCount()); |
285 | return false; | 286 | return false; |
286 | } | 287 | } |
287 | 288 | ||
288 | bool IncomingDialog::incomeCounter(ScheduleItemIn *item) | 289 | bool IncomingDialog::incomeCounter(ScheduleItemIn *item) |
289 | { | 290 | { |
290 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); | 291 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); |
291 | // currently only events supportet - attetion at insertion below! | 292 | // currently only events supportet - attetion at insertion below! |
292 | if ( incidence->type() != "Event" ) return false; | 293 | if ( incidence->type() != "Event" ) return false; |
293 | 294 | ||
294 | Event *counterEvent = static_cast<Event *>( incidence ); | 295 | Event *counterEvent = static_cast<Event *>( incidence ); |
295 | 296 | ||
296 | Event *even = mCalendar->event(counterEvent->uid()); | 297 | Event *even = mCalendar->event(counterEvent->uid()); |
297 | 298 | ||
298 | KOCounterDialog *eventViewer = new KOCounterDialog(this); | 299 | KOCounterDialog *eventViewer = new KOCounterDialog(this); |
299 | eventViewer->addText(i18n("counter proposal event","<b>Counter-event:</b><p>")); | 300 | eventViewer->addText(i18n("counter proposal event","<b>Counter-event:</b><p>")); |
300 | eventViewer->addEvent(counterEvent); | 301 | eventViewer->addEvent(counterEvent); |
301 | eventViewer->addText("<hr>"); | 302 | eventViewer->addText("<hr>"); |
302 | eventViewer->addText(i18n("<b>Original event:</b><p>")); | 303 | eventViewer->addText(i18n("<b>Original event:</b><p>")); |
303 | if (even) eventViewer->addEvent(even); | 304 | if (even) eventViewer->addEvent(even); |
304 | else eventViewer->addText(i18n("A corresponding event is missing in your calendar!")); | 305 | else eventViewer->addText(i18n("A corresponding event is missing in your calendar!")); |
305 | eventViewer->addText("<hr>"); | 306 | eventViewer->addText("<hr>"); |
306 | eventViewer->addText(i18n("If this counter-event is a good proposal for your event, press 'Accept'. All Attendees will then get the new version of this event")); | 307 | eventViewer->addText(i18n("If this counter-event is a good proposal for your event, press 'Accept'. All Attendees will then get the new version of this event")); |
307 | eventViewer->show(); | 308 | eventViewer->show(); |
308 | 309 | ||
309 | eventViewer->exec(); | 310 | eventViewer->exec(); |
310 | if (eventViewer->result()) { | 311 | if (eventViewer->result()) { |
311 | kdDebug() << "IncomingDialog::Counter:Accept" << endl; | 312 | kdDebug() << "IncomingDialog::Counter:Accept" << endl; |
312 | int revision = 0; | 313 | int revision = 0; |
313 | if (even) { | 314 | if (even) { |
314 | revision = even->revision(); | 315 | revision = even->revision(); |
315 | mCalendar->deleteEvent(even); | 316 | mCalendar->deleteEvent(even); |
316 | } | 317 | } |
317 | mCalendar->addIncidence(counterEvent); | 318 | mCalendar->addIncidence(counterEvent); |
318 | 319 | ||
319 | even = mCalendar->event(item->event()->uid()); | 320 | even = mCalendar->event(item->event()->uid()); |
320 | if (even) { | 321 | if (even) { |
321 | if (revision < even->revision()) | 322 | if (revision < even->revision()) |
322 | even->setRevision(even->revision()+1); | 323 | even->setRevision(even->revision()+1); |
323 | else | 324 | else |
324 | even->setRevision(revision+1); | 325 | even->setRevision(revision+1); |
325 | Event *ev = new Event(*even); | 326 | Event *ev = new Event(*even); |
326 | mOutgoing->addMessage(ev,Scheduler::Request); | 327 | mOutgoing->addMessage(ev,Scheduler::Request); |
327 | delete(ev); | 328 | delete(ev); |
328 | } | 329 | } |
329 | mScheduler->deleteTransaction(item->event()); | 330 | mScheduler->deleteTransaction(item->event()); |
330 | delete item; | 331 | delete item; |
331 | emit numMessagesChanged(mMessageListView->childCount()); | 332 | emit numMessagesChanged(mMessageListView->childCount()); |
332 | return true; | 333 | return true; |
333 | } else { | 334 | } else { |
334 | kdDebug() << "IncomingDialog::Counter:Decline" << endl; | 335 | kdDebug() << "IncomingDialog::Counter:Decline" << endl; |
335 | //the counter-sender's email is missing... | 336 | //the counter-sender's email is missing... |
336 | //now every attendee gets an declinecounter :-( | 337 | //now every attendee gets an declinecounter :-( |
337 | mOutgoing->addMessage(counterEvent,Scheduler::Declinecounter); | 338 | mOutgoing->addMessage(counterEvent,Scheduler::Declinecounter); |
338 | delete item; | 339 | delete item; |
339 | emit numMessagesChanged(mMessageListView->childCount()); | 340 | emit numMessagesChanged(mMessageListView->childCount()); |
340 | mScheduler->deleteTransaction(item->event()); | 341 | mScheduler->deleteTransaction(item->event()); |
341 | delete item; | 342 | delete item; |
342 | emit numMessagesChanged(mMessageListView->childCount()); | 343 | emit numMessagesChanged(mMessageListView->childCount()); |
343 | return true; | 344 | return true; |
344 | } | 345 | } |
345 | //mScheduler->deleteTransaction(item->event()); | 346 | //mScheduler->deleteTransaction(item->event()); |
346 | delete item; | 347 | delete item; |
347 | emit numMessagesChanged(mMessageListView->childCount()); | 348 | emit numMessagesChanged(mMessageListView->childCount()); |
348 | return false; | 349 | return false; |
349 | } | 350 | } |
350 | 351 | ||
351 | bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item) | 352 | bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item) |
352 | { | 353 | { |
353 | Event *even = mCalendar->event(item->event()->uid()); | 354 | Event *even = mCalendar->event(item->event()->uid()); |
354 | if (even) { | 355 | if (even) { |
355 | mOutgoing->addMessage(even,Scheduler::Refresh); | 356 | mOutgoing->addMessage(even,Scheduler::Refresh); |
356 | mScheduler->deleteTransaction(item->event()); | 357 | mScheduler->deleteTransaction(item->event()); |
357 | delete item; | 358 | delete item; |
358 | emit numMessagesChanged(mMessageListView->childCount()); | 359 | emit numMessagesChanged(mMessageListView->childCount()); |
359 | return true; | 360 | return true; |
360 | } | 361 | } |
361 | mScheduler->deleteTransaction(item->event()); | 362 | mScheduler->deleteTransaction(item->event()); |
362 | delete item; | 363 | delete item; |
363 | emit numMessagesChanged(mMessageListView->childCount()); | 364 | emit numMessagesChanged(mMessageListView->childCount()); |
364 | return false; | 365 | return false; |
365 | } | 366 | } |
366 | 367 | ||
367 | bool IncomingDialog::incomeAdd(ScheduleItemIn *item) | 368 | bool IncomingDialog::incomeAdd(ScheduleItemIn *item) |
368 | { | 369 | { |
369 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); | 370 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); |
370 | if (incidence->type() == "Event" ) { | 371 | if (incidence->type() == "Event" ) { |
371 | Event *refr = static_cast<Event *>( incidence ); | 372 | Event *refr = static_cast<Event *>( incidence ); |
372 | mOutgoing->addMessage(refr,Scheduler::Refresh); | 373 | mOutgoing->addMessage(refr,Scheduler::Refresh); |
373 | mScheduler->deleteTransaction( incidence ); | 374 | mScheduler->deleteTransaction( incidence ); |
374 | delete item; | 375 | delete item; |
375 | emit numMessagesChanged(mMessageListView->childCount()); | 376 | emit numMessagesChanged(mMessageListView->childCount()); |
376 | return true; | 377 | return true; |
377 | } | 378 | } |
378 | else { | 379 | else { |
379 | kdDebug() << "IncomingDialog::incomeAdd - only Events are supportet yet" << endl; | 380 | kdDebug() << "IncomingDialog::incomeAdd - only Events are supportet yet" << endl; |
380 | mScheduler->deleteTransaction( incidence ); | 381 | mScheduler->deleteTransaction( incidence ); |
381 | delete item; | 382 | delete item; |
382 | emit numMessagesChanged(mMessageListView->childCount()); | 383 | emit numMessagesChanged(mMessageListView->childCount()); |
383 | return false; | 384 | return false; |
384 | } | 385 | } |
385 | } | 386 | } |
386 | 387 | ||
387 | bool IncomingDialog::incomeDefault(ScheduleItemIn *item) | 388 | bool IncomingDialog::incomeDefault(ScheduleItemIn *item) |
388 | { | 389 | { |
389 | if (mScheduler->acceptTransaction(item->event(),item->method(),item->status())) { | 390 | if (mScheduler->acceptTransaction(item->event(),item->method(),item->status())) { |
390 | delete item; | 391 | delete item; |
391 | emit numMessagesChanged(mMessageListView->childCount()); | 392 | emit numMessagesChanged(mMessageListView->childCount()); |
392 | return true; | 393 | return true; |
393 | } | 394 | } |
394 | else { | 395 | else { |
395 | KMessageBox::error(this,i18n("Unable to accept the IMIP-message. It may be a problem with the email addresses.")); | 396 | KMessageBox::error(this,i18n("Unable to accept the IMIP-message. It may be a problem with the email addresses.")); |
396 | kdDebug() << "IncomingDialog::acceptMessage(): Error!" << endl; | 397 | kdDebug() << "IncomingDialog::acceptMessage(): Error!" << endl; |
397 | return false; | 398 | return false; |
398 | } | 399 | } |
399 | return false; | 400 | return false; |
400 | } | 401 | } |
401 | 402 | ||
402 | bool IncomingDialog::incomeRequest(ScheduleItemIn *item) | 403 | bool IncomingDialog::incomeRequest(ScheduleItemIn *item) |
403 | { | 404 | { |
404 | if (item->event()->type()=="FreeBusy") { | 405 | if (item->event()->type()=="FreeBusy") { |
405 | //handel freebusy request | 406 | //handel freebusy request |
406 | IncidenceBase *inc = item->event(); | 407 | IncidenceBase *inc = item->event(); |
407 | QDateTime start = inc->dtStart(); | 408 | QDateTime start = inc->dtStart(); |
408 | QDateTime end = start.addDays(inc->duration()/86400); | 409 | QDateTime end = start.addDays(inc->duration()/86400); |
409 | 410 | ||
410 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); | 411 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); |
411 | freebusy->setOrganizer(inc->organizer()); | 412 | freebusy->setOrganizer(inc->organizer()); |
412 | Attendee *att = new Attendee(KOPrefs::instance()->fullName(), | 413 | Attendee *att = new Attendee(KOPrefs::instance()->fullName(), |
413 | KOPrefs::instance()->email()); | 414 | KOPrefs::instance()->email()); |
414 | freebusy->addAttendee(att); | 415 | freebusy->addAttendee(att); |
415 | 416 | ||
416 | kdDebug() << "calendarview: schedule_publish_freebusy: startDate: " | 417 | kdDebug() << "calendarview: schedule_publish_freebusy: startDate: " |
417 | << KGlobal::locale()->formatDateTime( start ) << " End Date: " | 418 | << KGlobal::locale()->formatDateTime( start ) << " End Date: " |
418 | << KGlobal::locale()->formatDateTime( end ) << endl; | 419 | << KGlobal::locale()->formatDateTime( end ) << endl; |
419 | 420 | ||
420 | if (mOutgoing->addMessage(freebusy,Scheduler::Reply)) { | 421 | if (mOutgoing->addMessage(freebusy,Scheduler::Reply)) { |
421 | delete item; | 422 | delete item; |
422 | emit numMessagesChanged(mMessageListView->childCount()); | 423 | emit numMessagesChanged(mMessageListView->childCount()); |
423 | delete(freebusy); | 424 | delete(freebusy); |
424 | return true; | 425 | return true; |
425 | } | 426 | } |
426 | return false; | 427 | return false; |
427 | } else { | 428 | } else { |
428 | return incomeDefault(item); | 429 | return incomeDefault(item); |
429 | } | 430 | } |
430 | return false; | 431 | return false; |
431 | } | 432 | } |
432 | 433 | ||
433 | bool IncomingDialog::automaticAction(ScheduleItemIn *item) | 434 | bool IncomingDialog::automaticAction(ScheduleItemIn *item) |
434 | { | 435 | { |
435 | bool autoAction = false; | 436 | bool autoAction = false; |
436 | IncidenceBase *inc = item->event(); | 437 | IncidenceBase *inc = item->event(); |
437 | Scheduler::Method method = item->method(); | 438 | Scheduler::Method method = item->method(); |
diff --git a/korganizer/korganizerE.pro b/korganizer/korganizerE.pro index 4247838..d841193 100644 --- a/korganizer/korganizerE.pro +++ b/korganizer/korganizerE.pro | |||
@@ -1,155 +1,157 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | TARGET = kopi | 3 | TARGET = kopi |
4 | OBJECTS_DIR = obj/$(PLATFORM) | 4 | OBJECTS_DIR = obj/$(PLATFORM) |
5 | MOC_DIR = moc/$(PLATFORM) | 5 | MOC_DIR = moc/$(PLATFORM) |
6 | DESTDIR=$(QPEDIR)/bin | 6 | DESTDIR=$(QPEDIR)/bin |
7 | 7 | ||
8 | INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/libkdepim interfaces $(KDEPIMDIR)/kabc $(QPEDIR)/include | 8 | INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/libkdepim interfaces $(KDEPIMDIR)/kabc $(QPEDIR)/include |
9 | 9 | ||
10 | DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL | 10 | DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL |
11 | DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 11 | DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
12 | DEFINES += KORG_NOLVALTERNATION | 12 | DEFINES += KORG_NOLVALTERNATION |
13 | #KORG_NOKABC | 13 | #KORG_NOKABC |
14 | LIBS += -lmicrokdepim | 14 | LIBS += -lmicrokdepim |
15 | LIBS += -lmicrokcal | 15 | LIBS += -lmicrokcal |
16 | LIBS += -lmicrokde | 16 | LIBS += -lmicrokde |
17 | LIBS += -lmicroqtcompat | 17 | LIBS += -lmicroqtcompat |
18 | LIBS += -lmicrokabc | 18 | #LIBS += -lmicrokabc |
19 | 19 | ||
20 | #LIBS += $(QPEDIR)/lib/gammu | 20 | #LIBS += $(QPEDIR)/lib/gammu |
21 | #LIBS += -lmicrogammu | 21 | #LIBS += -lmicrogammu |
22 | #LIBS += -lbluetooth | 22 | #LIBS += -lbluetooth |
23 | #LIBS += -lsdp | 23 | #LIBS += -lsdp |
24 | LIBS += $(GCC3EXTRALIB1) | ||
25 | LIBS += $(GCC3EXTRALIB2) | ||
24 | 26 | ||
25 | 27 | ||
26 | LIBS += -lqpe | 28 | LIBS += -lqpe |
27 | LIBS += -ljpeg | 29 | LIBS += -ljpeg |
28 | LIBS += $(QTOPIALIB) | 30 | LIBS += $(QTOPIALIB) |
29 | LIBS += -L$(QPEDIR)/lib | 31 | LIBS += -L$(QPEDIR)/lib |
30 | 32 | ||
31 | INTERFACES = kofilterview_base.ui | 33 | INTERFACES = kofilterview_base.ui |
32 | #filteredit_base.ui | 34 | #filteredit_base.ui |
33 | 35 | ||
34 | HEADERS = \ | 36 | HEADERS = \ |
35 | wordsgerman.h \ | 37 | wordsgerman.h \ |
36 | filteredit_base.h \ | 38 | filteredit_base.h \ |
37 | alarmclient.h \ | 39 | alarmclient.h \ |
38 | calendarview.h \ | 40 | calendarview.h \ |
39 | customlistviewitem.h \ | 41 | customlistviewitem.h \ |
40 | datenavigator.h \ | 42 | datenavigator.h \ |
41 | docprefs.h \ | 43 | docprefs.h \ |
42 | filtereditdialog.h \ | 44 | filtereditdialog.h \ |
43 | incomingdialog.h \ | 45 | incomingdialog.h \ |
44 | incomingdialog_base.h \ | 46 | incomingdialog_base.h \ |
45 | interfaces/korganizer/baseview.h \ | 47 | interfaces/korganizer/baseview.h \ |
46 | interfaces/korganizer/calendarviewbase.h \ | 48 | interfaces/korganizer/calendarviewbase.h \ |
47 | journalentry.h \ | 49 | journalentry.h \ |
48 | kdateedit.h \ | 50 | kdateedit.h \ |
49 | kdatenavigator.h \ | 51 | kdatenavigator.h \ |
50 | koagenda.h \ | 52 | koagenda.h \ |
51 | koagendaitem.h \ | 53 | koagendaitem.h \ |
52 | koagendaview.h \ | 54 | koagendaview.h \ |
53 | kocounterdialog.h \ | 55 | kocounterdialog.h \ |
54 | kodaymatrix.h \ | 56 | kodaymatrix.h \ |
55 | kodialogmanager.h \ | 57 | kodialogmanager.h \ |
56 | koeditordetails.h \ | 58 | koeditordetails.h \ |
57 | koeditorgeneral.h \ | 59 | koeditorgeneral.h \ |
58 | koeditorgeneralevent.h \ | 60 | koeditorgeneralevent.h \ |
59 | koeditorgeneraltodo.h \ | 61 | koeditorgeneraltodo.h \ |
60 | koeditorrecurrence.h \ | 62 | koeditorrecurrence.h \ |
61 | koeventeditor.h \ | 63 | koeventeditor.h \ |
62 | koeventpopupmenu.h \ | 64 | koeventpopupmenu.h \ |
63 | koeventview.h \ | 65 | koeventview.h \ |
64 | koeventviewer.h \ | 66 | koeventviewer.h \ |
65 | koeventviewerdialog.h \ | 67 | koeventviewerdialog.h \ |
66 | kofilterview.h \ | 68 | kofilterview.h \ |
67 | koglobals.h \ | 69 | koglobals.h \ |
68 | koincidenceeditor.h \ | 70 | koincidenceeditor.h \ |
69 | kojournalview.h \ | 71 | kojournalview.h \ |
70 | kolistview.h \ | 72 | kolistview.h \ |
71 | kolocationbox.h \ | 73 | kolocationbox.h \ |
72 | komonthview.h \ | 74 | komonthview.h \ |
73 | koprefs.h \ | 75 | koprefs.h \ |
74 | koprefsdialog.h \ | 76 | koprefsdialog.h \ |
75 | kotimespanview.h \ | 77 | kotimespanview.h \ |
76 | kotodoeditor.h \ | 78 | kotodoeditor.h \ |
77 | kotodoview.h \ | 79 | kotodoview.h \ |
78 | kotodoviewitem.h \ | 80 | kotodoviewitem.h \ |
79 | koviewmanager.h \ | 81 | koviewmanager.h \ |
80 | kowhatsnextview.h \ | 82 | kowhatsnextview.h \ |
81 | ktimeedit.h \ | 83 | ktimeedit.h \ |
82 | lineview.h \ | 84 | lineview.h \ |
83 | mainwindow.h \ | 85 | mainwindow.h \ |
84 | navigatorbar.h \ | 86 | navigatorbar.h \ |
85 | outgoingdialog.h \ | 87 | outgoingdialog.h \ |
86 | outgoingdialog_base.h \ | 88 | outgoingdialog_base.h \ |
87 | publishdialog.h \ | 89 | publishdialog.h \ |
88 | publishdialog_base.h \ | 90 | publishdialog_base.h \ |
89 | savetemplatedialog.h \ | 91 | savetemplatedialog.h \ |
90 | searchdialog.h \ | 92 | searchdialog.h \ |
91 | simplealarmclient.h \ | 93 | simplealarmclient.h \ |
92 | statusdialog.h \ | 94 | statusdialog.h \ |
93 | timeline.h \ | 95 | timeline.h \ |
94 | timespanview.h \ | 96 | timespanview.h \ |
95 | version.h \ | 97 | version.h \ |
96 | ../kalarmd/alarmdialog.h | 98 | ../kalarmd/alarmdialog.h |
97 | 99 | ||
98 | SOURCES = \ | 100 | SOURCES = \ |
99 | filteredit_base.cpp \ | 101 | filteredit_base.cpp \ |
100 | calendarview.cpp \ | 102 | calendarview.cpp \ |
101 | datenavigator.cpp \ | 103 | datenavigator.cpp \ |
102 | docprefs.cpp \ | 104 | docprefs.cpp \ |
103 | filtereditdialog.cpp \ | 105 | filtereditdialog.cpp \ |
104 | incomingdialog.cpp \ | 106 | incomingdialog.cpp \ |
105 | incomingdialog_base.cpp \ | 107 | incomingdialog_base.cpp \ |
106 | journalentry.cpp \ | 108 | journalentry.cpp \ |
107 | kdatenavigator.cpp \ | 109 | kdatenavigator.cpp \ |
108 | koagenda.cpp \ | 110 | koagenda.cpp \ |
109 | koagendaitem.cpp \ | 111 | koagendaitem.cpp \ |
110 | koagendaview.cpp \ | 112 | koagendaview.cpp \ |
111 | kocounterdialog.cpp \ | 113 | kocounterdialog.cpp \ |
112 | kodaymatrix.cpp \ | 114 | kodaymatrix.cpp \ |
113 | kodialogmanager.cpp \ | 115 | kodialogmanager.cpp \ |
114 | koeditordetails.cpp \ | 116 | koeditordetails.cpp \ |
115 | koeditorgeneral.cpp \ | 117 | koeditorgeneral.cpp \ |
116 | koeditorgeneralevent.cpp \ | 118 | koeditorgeneralevent.cpp \ |
117 | koeditorgeneraltodo.cpp \ | 119 | koeditorgeneraltodo.cpp \ |
118 | koeditorrecurrence.cpp \ | 120 | koeditorrecurrence.cpp \ |
119 | koeventeditor.cpp \ | 121 | koeventeditor.cpp \ |
120 | koeventpopupmenu.cpp \ | 122 | koeventpopupmenu.cpp \ |
121 | koeventview.cpp \ | 123 | koeventview.cpp \ |
122 | koeventviewer.cpp \ | 124 | koeventviewer.cpp \ |
123 | koeventviewerdialog.cpp \ | 125 | koeventviewerdialog.cpp \ |
124 | kofilterview.cpp \ | 126 | kofilterview.cpp \ |
125 | koglobals.cpp \ | 127 | koglobals.cpp \ |
126 | koincidenceeditor.cpp \ | 128 | koincidenceeditor.cpp \ |
127 | kojournalview.cpp \ | 129 | kojournalview.cpp \ |
128 | kolistview.cpp \ | 130 | kolistview.cpp \ |
129 | kolocationbox.cpp \ | 131 | kolocationbox.cpp \ |
130 | komonthview.cpp \ | 132 | komonthview.cpp \ |
131 | koprefs.cpp \ | 133 | koprefs.cpp \ |
132 | koprefsdialog.cpp \ | 134 | koprefsdialog.cpp \ |
133 | kotimespanview.cpp \ | 135 | kotimespanview.cpp \ |
134 | kotodoeditor.cpp \ | 136 | kotodoeditor.cpp \ |
135 | kotodoview.cpp \ | 137 | kotodoview.cpp \ |
136 | kotodoviewitem.cpp \ | 138 | kotodoviewitem.cpp \ |
137 | koviewmanager.cpp \ | 139 | koviewmanager.cpp \ |
138 | kowhatsnextview.cpp \ | 140 | kowhatsnextview.cpp \ |
139 | ktimeedit.cpp \ | 141 | ktimeedit.cpp \ |
140 | lineview.cpp \ | 142 | lineview.cpp \ |
141 | main.cpp \ | 143 | main.cpp \ |
142 | mainwindow.cpp \ | 144 | mainwindow.cpp \ |
143 | navigatorbar.cpp \ | 145 | navigatorbar.cpp \ |
144 | outgoingdialog.cpp \ | 146 | outgoingdialog.cpp \ |
145 | outgoingdialog_base.cpp \ | 147 | outgoingdialog_base.cpp \ |
146 | publishdialog.cpp \ | 148 | publishdialog.cpp \ |
147 | publishdialog_base.cpp \ | 149 | publishdialog_base.cpp \ |
148 | savetemplatedialog.cpp \ | 150 | savetemplatedialog.cpp \ |
149 | searchdialog.cpp \ | 151 | searchdialog.cpp \ |
150 | simplealarmclient.cpp \ | 152 | simplealarmclient.cpp \ |
151 | statusdialog.cpp \ | 153 | statusdialog.cpp \ |
152 | timeline.cpp \ | 154 | timeline.cpp \ |
153 | timespanview.cpp \ | 155 | timespanview.cpp \ |
154 | ../kalarmd/alarmdialog.cpp | 156 | ../kalarmd/alarmdialog.cpp |
155 | 157 | ||
diff --git a/korganizer/publishdialog.cpp b/korganizer/publishdialog.cpp index 4323b91..2ae6720 100644 --- a/korganizer/publishdialog.cpp +++ b/korganizer/publishdialog.cpp | |||
@@ -1,150 +1,151 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | #include <kdebug.h> | 25 | #include <kdebug.h> |
26 | 26 | ||
27 | #include <kglobal.h> | 27 | #include <kglobal.h> |
28 | #include <klocale.h> | 28 | #include <klocale.h> |
29 | #ifndef KORG_NOKABC | 29 | #ifndef KORG_NOKABC |
30 | #include <kabc/addresseedialog.h> | 30 | #define KORG_NOKABC |
31 | //#include <kabc/addresseedialog.h> | ||
31 | #endif | 32 | #endif |
32 | 33 | ||
33 | #include "koprefs.h" | 34 | #include "koprefs.h" |
34 | #include "publishdialog.h" | 35 | #include "publishdialog.h" |
35 | 36 | ||
36 | PublishDialog::PublishDialog(QWidget* parent, const char* name, | 37 | PublishDialog::PublishDialog(QWidget* parent, const char* name, |
37 | bool modal, WFlags fl) | 38 | bool modal, WFlags fl) |
38 | : PublishDialog_base(parent,name,modal,fl) | 39 | : PublishDialog_base(parent,name,modal,fl) |
39 | { | 40 | { |
40 | setCaption(i18n("Select Addresses")); | 41 | setCaption(i18n("Select Addresses")); |
41 | mNameLineEdit->setEnabled(false); | 42 | mNameLineEdit->setEnabled(false); |
42 | mEmailLineEdit->setEnabled(false); | 43 | mEmailLineEdit->setEnabled(false); |
43 | connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)), | 44 | connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)), |
44 | SLOT(updateInput())); | 45 | SLOT(updateInput())); |
45 | } | 46 | } |
46 | 47 | ||
47 | PublishDialog::~PublishDialog() | 48 | PublishDialog::~PublishDialog() |
48 | { | 49 | { |
49 | } | 50 | } |
50 | 51 | ||
51 | void PublishDialog::addAttendee(Attendee *attendee) | 52 | void PublishDialog::addAttendee(Attendee *attendee) |
52 | { | 53 | { |
53 | mNameLineEdit->setEnabled(true); | 54 | mNameLineEdit->setEnabled(true); |
54 | mEmailLineEdit->setEnabled(true); | 55 | mEmailLineEdit->setEnabled(true); |
55 | QListViewItem *item = new QListViewItem(mAddressListView); | 56 | QListViewItem *item = new QListViewItem(mAddressListView); |
56 | item->setText(0,attendee->name()); | 57 | item->setText(0,attendee->name()); |
57 | item->setText(1,attendee->email()); | 58 | item->setText(1,attendee->email()); |
58 | mAddressListView->insertItem(item); | 59 | mAddressListView->insertItem(item); |
59 | } | 60 | } |
60 | 61 | ||
61 | QString PublishDialog::addresses() | 62 | QString PublishDialog::addresses() |
62 | { | 63 | { |
63 | QString to = ""; | 64 | QString to = ""; |
64 | QListViewItem *item; | 65 | QListViewItem *item; |
65 | int i, count; | 66 | int i, count; |
66 | count = mAddressListView->childCount(); | 67 | count = mAddressListView->childCount(); |
67 | for (i=0;i<count;i++) { | 68 | for (i=0;i<count;i++) { |
68 | item = mAddressListView->firstChild(); | 69 | item = mAddressListView->firstChild(); |
69 | mAddressListView->takeItem(item); | 70 | mAddressListView->takeItem(item); |
70 | to += item->text(1); | 71 | to += item->text(1); |
71 | if (i<count-1) { | 72 | if (i<count-1) { |
72 | to += ", "; | 73 | to += ", "; |
73 | } | 74 | } |
74 | } | 75 | } |
75 | return to; | 76 | return to; |
76 | } | 77 | } |
77 | 78 | ||
78 | void PublishDialog::addItem() | 79 | void PublishDialog::addItem() |
79 | { | 80 | { |
80 | mNameLineEdit->setEnabled(true); | 81 | mNameLineEdit->setEnabled(true); |
81 | mEmailLineEdit->setEnabled(true); | 82 | mEmailLineEdit->setEnabled(true); |
82 | QListViewItem *item = new QListViewItem(mAddressListView); | 83 | QListViewItem *item = new QListViewItem(mAddressListView); |
83 | mAddressListView->insertItem(item); | 84 | mAddressListView->insertItem(item); |
84 | mAddressListView->setSelected(item,true); | 85 | mAddressListView->setSelected(item,true); |
85 | mNameLineEdit->setText(i18n("(EmptyName)")); | 86 | mNameLineEdit->setText(i18n("(EmptyName)")); |
86 | mEmailLineEdit->setText(i18n("(EmptyEmail)")); | 87 | mEmailLineEdit->setText(i18n("(EmptyEmail)")); |
87 | } | 88 | } |
88 | 89 | ||
89 | void PublishDialog::removeItem() | 90 | void PublishDialog::removeItem() |
90 | { | 91 | { |
91 | QListViewItem *item; | 92 | QListViewItem *item; |
92 | item = mAddressListView->selectedItem(); | 93 | item = mAddressListView->selectedItem(); |
93 | if (!item) return; | 94 | if (!item) return; |
94 | mAddressListView->takeItem(item); | 95 | mAddressListView->takeItem(item); |
95 | item = mAddressListView->selectedItem(); | 96 | item = mAddressListView->selectedItem(); |
96 | if (!item) { | 97 | if (!item) { |
97 | mNameLineEdit->setText(""); | 98 | mNameLineEdit->setText(""); |
98 | mEmailLineEdit->setText(""); | 99 | mEmailLineEdit->setText(""); |
99 | mNameLineEdit->setEnabled(false); | 100 | mNameLineEdit->setEnabled(false); |
100 | mEmailLineEdit->setEnabled(false); | 101 | mEmailLineEdit->setEnabled(false); |
101 | } | 102 | } |
102 | if (mAddressListView->childCount() == 0) { | 103 | if (mAddressListView->childCount() == 0) { |
103 | mNameLineEdit->setEnabled(false); | 104 | mNameLineEdit->setEnabled(false); |
104 | mEmailLineEdit->setEnabled(false); | 105 | mEmailLineEdit->setEnabled(false); |
105 | } | 106 | } |
106 | } | 107 | } |
107 | 108 | ||
108 | void PublishDialog::openAddressbook() | 109 | void PublishDialog::openAddressbook() |
109 | { | 110 | { |
110 | #ifndef KORG_NOKABC | 111 | #ifndef KORG_NOKABC |
111 | KABC::Addressee::List addressList; | 112 | KABC::Addressee::List addressList; |
112 | addressList = KABC::AddresseeDialog::getAddressees(this); | 113 | addressList = KABC::AddresseeDialog::getAddressees(this); |
113 | //KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); | 114 | //KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); |
114 | KABC::Addressee a = addressList.first(); | 115 | KABC::Addressee a = addressList.first(); |
115 | if (!a.isEmpty()) { | 116 | if (!a.isEmpty()) { |
116 | uint i; | 117 | uint i; |
117 | for (i=0;i<addressList.count();i++) { | 118 | for (i=0;i<addressList.count();i++) { |
118 | a = addressList[i]; | 119 | a = addressList[i]; |
119 | mNameLineEdit->setEnabled(true); | 120 | mNameLineEdit->setEnabled(true); |
120 | mEmailLineEdit->setEnabled(true); | 121 | mEmailLineEdit->setEnabled(true); |
121 | QListViewItem *item = new QListViewItem(mAddressListView); | 122 | QListViewItem *item = new QListViewItem(mAddressListView); |
122 | mAddressListView->setSelected(item,true); | 123 | mAddressListView->setSelected(item,true); |
123 | mNameLineEdit->setText(a.realName()); | 124 | mNameLineEdit->setText(a.realName()); |
124 | mEmailLineEdit->setText(a.preferredEmail()); | 125 | mEmailLineEdit->setText(a.preferredEmail()); |
125 | mAddressListView->insertItem(item); | 126 | mAddressListView->insertItem(item); |
126 | } | 127 | } |
127 | } | 128 | } |
128 | #endif | 129 | #endif |
129 | } | 130 | } |
130 | 131 | ||
131 | void PublishDialog::updateItem() | 132 | void PublishDialog::updateItem() |
132 | { | 133 | { |
133 | QListViewItem *item; | 134 | QListViewItem *item; |
134 | item = mAddressListView->selectedItem(); | 135 | item = mAddressListView->selectedItem(); |
135 | if (!item) return; | 136 | if (!item) return; |
136 | item->setText(0,mNameLineEdit->text()); | 137 | item->setText(0,mNameLineEdit->text()); |
137 | item->setText(1,mEmailLineEdit->text()); | 138 | item->setText(1,mEmailLineEdit->text()); |
138 | } | 139 | } |
139 | 140 | ||
140 | void PublishDialog::updateInput() | 141 | void PublishDialog::updateInput() |
141 | { | 142 | { |
142 | QListViewItem *item; | 143 | QListViewItem *item; |
143 | item = mAddressListView->selectedItem(); | 144 | item = mAddressListView->selectedItem(); |
144 | if (!item) return; | 145 | if (!item) return; |
145 | mNameLineEdit->setEnabled(true); | 146 | mNameLineEdit->setEnabled(true); |
146 | mEmailLineEdit->setEnabled(true); | 147 | mEmailLineEdit->setEnabled(true); |
147 | QString mail = item->text(1); | 148 | QString mail = item->text(1); |
148 | mNameLineEdit->setText(item->text(0)); | 149 | mNameLineEdit->setText(item->text(0)); |
149 | mEmailLineEdit->setText(mail); | 150 | mEmailLineEdit->setText(mail); |
150 | } | 151 | } |
diff --git a/libkdepim/libkdepim.pro b/libkdepim/libkdepim.pro index 060145e..f5de653 100644 --- a/libkdepim/libkdepim.pro +++ b/libkdepim/libkdepim.pro | |||
@@ -1,59 +1,57 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
3 | DEFINES +=KORG_NOKABC | 3 | DEFINES +=KORG_NOKABC |
4 | TARGET = microkdepim | 4 | TARGET = microkdepim |
5 | INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. | 5 | INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. |
6 | DESTDIR=../bin | 6 | DESTDIR=../bin |
7 | 7 | ||
8 | DEFINES += DESKTOP_VERSION | 8 | DEFINES += DESKTOP_VERSION |
9 | include( ../variables.pri ) | 9 | include( ../variables.pri ) |
10 | unix : { | 10 | unix : { |
11 | OBJECTS_DIR = obj/unix | 11 | OBJECTS_DIR = obj/unix |
12 | MOC_DIR = moc/unix | 12 | MOC_DIR = moc/unix |
13 | } | 13 | } |
14 | win32: { | 14 | win32: { |
15 | DEFINES += _WIN32_ | 15 | DEFINES += _WIN32_ |
16 | OBJECTS_DIR = obj/win | 16 | OBJECTS_DIR = obj/win |
17 | MOC_DIR = moc/win | 17 | MOC_DIR = moc/win |
18 | } | 18 | } |
19 | INTERFACES = \ | 19 | INTERFACES = \ |
20 | 20 | ||
21 | HEADERS = \ | 21 | HEADERS = \ |
22 | categoryeditdialog.h \ | 22 | categoryeditdialog.h \ |
23 | categoryeditdialog_base.h \ | 23 | categoryeditdialog_base.h \ |
24 | categoryselectdialog.h \ | 24 | categoryselectdialog.h \ |
25 | categoryselectdialog_base.h \ | 25 | categoryselectdialog_base.h \ |
26 | externalapphandler.h \ | 26 | externalapphandler.h \ |
27 | kdateedit.h \ | 27 | kdateedit.h \ |
28 | kdatepicker.h \ | 28 | kdatepicker.h \ |
29 | kinputdialog.h \ | 29 | kinputdialog.h \ |
30 | kincidenceformatter.h \ | 30 | kincidenceformatter.h \ |
31 | kpimprefs.h \ | 31 | kpimprefs.h \ |
32 | kpimglobalprefs.h \ | 32 | kpimglobalprefs.h \ |
33 | kprefsdialog.h \ | 33 | kprefsdialog.h \ |
34 | addresseeview.h \ | ||
35 | ksyncprofile.h \ | 34 | ksyncprofile.h \ |
36 | ksyncprefsdialog.h \ | 35 | ksyncprefsdialog.h \ |
37 | kcmconfigs/kcmkdepimconfig.h \ | 36 | kcmconfigs/kcmkdepimconfig.h \ |
38 | kcmconfigs/kdepimconfigwidget.h | 37 | kcmconfigs/kdepimconfigwidget.h |
39 | 38 | ||
40 | SOURCES = \ | 39 | SOURCES = \ |
41 | categoryeditdialog.cpp \ | 40 | categoryeditdialog.cpp \ |
42 | categoryeditdialog_base.cpp \ | 41 | categoryeditdialog_base.cpp \ |
43 | categoryselectdialog.cpp \ | 42 | categoryselectdialog.cpp \ |
44 | categoryselectdialog_base.cpp \ | 43 | categoryselectdialog_base.cpp \ |
45 | externalapphandler.cpp \ | 44 | externalapphandler.cpp \ |
46 | kdateedit.cpp \ | 45 | kdateedit.cpp \ |
47 | kdatepicker.cpp \ | 46 | kdatepicker.cpp \ |
48 | kinputdialog.cpp \ | 47 | kinputdialog.cpp \ |
49 | kincidenceformatter.cpp \ | 48 | kincidenceformatter.cpp \ |
50 | kpimprefs.cpp \ | 49 | kpimprefs.cpp \ |
51 | kpimglobalprefs.cpp \ | 50 | kpimglobalprefs.cpp \ |
52 | kprefsdialog.cpp \ | 51 | kprefsdialog.cpp \ |
53 | addresseeview.cpp \ | ||
54 | ksyncprofile.cpp \ | 52 | ksyncprofile.cpp \ |
55 | ksyncprefsdialog.cpp \ | 53 | ksyncprefsdialog.cpp \ |
56 | kcmconfigs/kcmkdepimconfig.cpp \ | 54 | kcmconfigs/kcmkdepimconfig.cpp \ |
57 | kcmconfigs/kdepimconfigwidget.cpp | 55 | kcmconfigs/kdepimconfigwidget.cpp |
58 | 56 | ||
59 | 57 | ||
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro index b455a3e..102d827 100644 --- a/libkdepim/libkdepimE.pro +++ b/libkdepim/libkdepimE.pro | |||
@@ -1,53 +1,51 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | TARGET = microkdepim | 3 | TARGET = microkdepim |
4 | INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include | 4 | INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include |
5 | LIBS += -lmicrokde | 5 | LIBS += -lmicrokde |
6 | LIBS += -lmicrokcal | 6 | LIBS += -lmicrokcal |
7 | LIBS += -L$(QPEDIR)/lib | 7 | LIBS += -L$(QPEDIR)/lib |
8 | OBJECTS_DIR = obj/$(PLATFORM) | 8 | OBJECTS_DIR = obj/$(PLATFORM) |
9 | MOC_DIR = moc/$(PLATFORM) | 9 | MOC_DIR = moc/$(PLATFORM) |
10 | DESTDIR=$(QPEDIR)/lib | 10 | DESTDIR=$(QPEDIR)/lib |
11 | 11 | ||
12 | 12 | ||
13 | INTERFACES = \ | 13 | INTERFACES = \ |
14 | 14 | ||
15 | HEADERS = \ | 15 | HEADERS = \ |
16 | categoryeditdialog.h \ | 16 | categoryeditdialog.h \ |
17 | categoryeditdialog_base.h \ | 17 | categoryeditdialog_base.h \ |
18 | categoryselectdialog.h \ | 18 | categoryselectdialog.h \ |
19 | categoryselectdialog_base.h \ | 19 | categoryselectdialog_base.h \ |
20 | externalapphandler.h \ | 20 | externalapphandler.h \ |
21 | kdateedit.h \ | 21 | kdateedit.h \ |
22 | kdatepicker.h \ | 22 | kdatepicker.h \ |
23 | kinputdialog.h \ | 23 | kinputdialog.h \ |
24 | kincidenceformatter.h \ | 24 | kincidenceformatter.h \ |
25 | kpimprefs.h \ | 25 | kpimprefs.h \ |
26 | kpimglobalprefs.h \ | 26 | kpimglobalprefs.h \ |
27 | kprefsdialog.h \ | 27 | kprefsdialog.h \ |
28 | addresseeview.h \ | ||
29 | ksyncprofile.h \ | 28 | ksyncprofile.h \ |
30 | ksyncprefsdialog.h \ | 29 | ksyncprefsdialog.h \ |
31 | kcmconfigs/kcmkdepimconfig.h \ | 30 | kcmconfigs/kcmkdepimconfig.h \ |
32 | kcmconfigs/kdepimconfigwidget.h | 31 | kcmconfigs/kdepimconfigwidget.h |
33 | 32 | ||
34 | 33 | ||
35 | 34 | ||
36 | SOURCES = \ | 35 | SOURCES = \ |
37 | categoryeditdialog.cpp \ | 36 | categoryeditdialog.cpp \ |
38 | categoryeditdialog_base.cpp \ | 37 | categoryeditdialog_base.cpp \ |
39 | categoryselectdialog.cpp \ | 38 | categoryselectdialog.cpp \ |
40 | categoryselectdialog_base.cpp \ | 39 | categoryselectdialog_base.cpp \ |
41 | externalapphandler.cpp \ | 40 | externalapphandler.cpp \ |
42 | kdateedit.cpp \ | 41 | kdateedit.cpp \ |
43 | kinputdialog.cpp \ | 42 | kinputdialog.cpp \ |
44 | kdatepicker.cpp \ | 43 | kdatepicker.cpp \ |
45 | kincidenceformatter.cpp \ | 44 | kincidenceformatter.cpp \ |
46 | kpimprefs.cpp \ | 45 | kpimprefs.cpp \ |
47 | kpimglobalprefs.cpp \ | 46 | kpimglobalprefs.cpp \ |
48 | kprefsdialog.cpp \ | 47 | kprefsdialog.cpp \ |
49 | addresseeview.cpp \ | ||
50 | ksyncprofile.cpp \ | 48 | ksyncprofile.cpp \ |
51 | ksyncprefsdialog.cpp \ | 49 | ksyncprefsdialog.cpp \ |
52 | kcmconfigs/kcmkdepimconfig.cpp \ | 50 | kcmconfigs/kcmkdepimconfig.cpp \ |
53 | kcmconfigs/kdepimconfigwidget.cpp | 51 | kcmconfigs/kdepimconfigwidget.cpp |