summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/korganizer.pro1
2 files changed, 1 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7444bad..db07713 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1110,1537 +1110,1537 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1110 inL->setLastModified( modifiedCalendar ); 1110 inL->setLastModified( modifiedCalendar );
1111 remote->addIncidence( inL->clone() ); 1111 remote->addIncidence( inL->clone() );
1112 } 1112 }
1113 } 1113 }
1114 } 1114 }
1115 } 1115 }
1116 } 1116 }
1117 inL = el.next(); 1117 inL = el.next();
1118 } 1118 }
1119 1119
1120 bar.hide(); 1120 bar.hide();
1121 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1121 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1122 eventLSync->setReadOnly( false ); 1122 eventLSync->setReadOnly( false );
1123 eventLSync->setDtStart( mLastCalendarSync ); 1123 eventLSync->setDtStart( mLastCalendarSync );
1124 eventRSync->setDtStart( mLastCalendarSync ); 1124 eventRSync->setDtStart( mLastCalendarSync );
1125 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1125 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1126 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1126 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1127 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1127 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1128 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1128 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1129 eventLSync->setReadOnly( true ); 1129 eventLSync->setReadOnly( true );
1130 if ( mGlobalSyncMode == SYNC_MODE_NORMAL) 1130 if ( mGlobalSyncMode == SYNC_MODE_NORMAL)
1131 remote->addEvent( eventRSync ); 1131 remote->addEvent( eventRSync );
1132 QString mes; 1132 QString mes;
1133 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 ); 1133 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 );
1134 if ( KOPrefs::instance()->mShowSyncSummary ) { 1134 if ( KOPrefs::instance()->mShowSyncSummary ) {
1135 KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); 1135 KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") );
1136 } 1136 }
1137 qDebug( mes ); 1137 qDebug( mes );
1138 mCalendar->checkAlarmForIncidence( 0, true ); 1138 mCalendar->checkAlarmForIncidence( 0, true );
1139 return syncOK; 1139 return syncOK;
1140} 1140}
1141 1141
1142void CalendarView::setSyncDevice( QString s ) 1142void CalendarView::setSyncDevice( QString s )
1143{ 1143{
1144 mCurrentSyncDevice= s; 1144 mCurrentSyncDevice= s;
1145} 1145}
1146void CalendarView::setSyncName( QString s ) 1146void CalendarView::setSyncName( QString s )
1147{ 1147{
1148 mCurrentSyncName= s; 1148 mCurrentSyncName= s;
1149} 1149}
1150bool CalendarView::syncCalendar(QString filename, int mode) 1150bool CalendarView::syncCalendar(QString filename, int mode)
1151{ 1151{
1152 mGlobalSyncMode = SYNC_MODE_NORMAL; 1152 mGlobalSyncMode = SYNC_MODE_NORMAL;
1153 CalendarLocal* calendar = new CalendarLocal(); 1153 CalendarLocal* calendar = new CalendarLocal();
1154 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 1154 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
1155 FileStorage* storage = new FileStorage( calendar ); 1155 FileStorage* storage = new FileStorage( calendar );
1156 bool syncOK = false; 1156 bool syncOK = false;
1157 storage->setFileName( filename ); 1157 storage->setFileName( filename );
1158 // qDebug("loading ... "); 1158 // qDebug("loading ... ");
1159 if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { 1159 if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) {
1160 getEventViewerDialog()->setSyncMode( true ); 1160 getEventViewerDialog()->setSyncMode( true );
1161 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1161 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1162 getEventViewerDialog()->setSyncMode( false ); 1162 getEventViewerDialog()->setSyncMode( false );
1163 if ( syncOK ) { 1163 if ( syncOK ) {
1164 if ( KOPrefs::instance()->mWriteBackFile ) 1164 if ( KOPrefs::instance()->mWriteBackFile )
1165 { 1165 {
1166 storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); 1166 storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
1167 storage->save(); 1167 storage->save();
1168 } 1168 }
1169 } 1169 }
1170 setModified( true ); 1170 setModified( true );
1171 } 1171 }
1172 delete storage; 1172 delete storage;
1173 delete calendar; 1173 delete calendar;
1174 if ( syncOK ) 1174 if ( syncOK )
1175 updateView(); 1175 updateView();
1176 return syncOK; 1176 return syncOK;
1177} 1177}
1178void CalendarView::syncPhone() 1178void CalendarView::syncPhone()
1179{ 1179{
1180 syncExternal( 1 ); 1180 syncExternal( 1 );
1181} 1181}
1182void CalendarView::syncExternal( int mode ) 1182void CalendarView::syncExternal( int mode )
1183{ 1183{
1184 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1184 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1185 //mCurrentSyncDevice = "sharp-DTM"; 1185 //mCurrentSyncDevice = "sharp-DTM";
1186 if ( KOPrefs::instance()->mAskForPreferences ) 1186 if ( KOPrefs::instance()->mAskForPreferences )
1187 edit_sync_options(); 1187 edit_sync_options();
1188 qApp->processEvents(); 1188 qApp->processEvents();
1189 CalendarLocal* calendar = new CalendarLocal(); 1189 CalendarLocal* calendar = new CalendarLocal();
1190 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 1190 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
1191 bool syncOK = false; 1191 bool syncOK = false;
1192 bool loadSuccess = false; 1192 bool loadSuccess = false;
1193 PhoneFormat* phoneFormat = 0; 1193 PhoneFormat* phoneFormat = 0;
1194#ifndef DESKTOP_VERSION 1194#ifndef DESKTOP_VERSION
1195 SharpFormat* sharpFormat = 0; 1195 SharpFormat* sharpFormat = 0;
1196 if ( mode == 0 ) { // sharp 1196 if ( mode == 0 ) { // sharp
1197 sharpFormat = new SharpFormat () ; 1197 sharpFormat = new SharpFormat () ;
1198 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1198 loadSuccess = sharpFormat->load( calendar, mCalendar );
1199 1199
1200 } else 1200 } else
1201#endif 1201#endif
1202 if ( mode == 1 ) { // phone 1202 if ( mode == 1 ) { // phone
1203 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1203 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1204 KOPrefs::instance()->mPhoneDevice, 1204 KOPrefs::instance()->mPhoneDevice,
1205 KOPrefs::instance()->mPhoneConnection, 1205 KOPrefs::instance()->mPhoneConnection,
1206 KOPrefs::instance()->mPhoneModel); 1206 KOPrefs::instance()->mPhoneModel);
1207 loadSuccess = phoneFormat->load( calendar,mCalendar); 1207 loadSuccess = phoneFormat->load( calendar,mCalendar);
1208 1208
1209 } else 1209 } else
1210 return; 1210 return;
1211 if ( loadSuccess ) { 1211 if ( loadSuccess ) {
1212 getEventViewerDialog()->setSyncMode( true ); 1212 getEventViewerDialog()->setSyncMode( true );
1213 syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); 1213 syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs );
1214 getEventViewerDialog()->setSyncMode( false ); 1214 getEventViewerDialog()->setSyncMode( false );
1215 qApp->processEvents(); 1215 qApp->processEvents();
1216 if ( syncOK ) { 1216 if ( syncOK ) {
1217 if ( KOPrefs::instance()->mWriteBackFile ) 1217 if ( KOPrefs::instance()->mWriteBackFile )
1218 { 1218 {
1219 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1219 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1220 Incidence* inc = iL.first(); 1220 Incidence* inc = iL.first();
1221 /* obsolete 1221 /* obsolete
1222 while ( inc ) { 1222 while ( inc ) {
1223 inc->setZaurusStat( inc->revision () ); 1223 inc->setZaurusStat( inc->revision () );
1224 inc = iL.next(); 1224 inc = iL.next();
1225 } 1225 }
1226 */ 1226 */
1227#ifndef DESKTOP_VERSION 1227#ifndef DESKTOP_VERSION
1228 if ( sharpFormat ) 1228 if ( sharpFormat )
1229 sharpFormat->save(calendar); 1229 sharpFormat->save(calendar);
1230#endif 1230#endif
1231 if ( phoneFormat ) 1231 if ( phoneFormat )
1232 phoneFormat->save(calendar); 1232 phoneFormat->save(calendar);
1233 iL = calendar->rawIncidences(); 1233 iL = calendar->rawIncidences();
1234 inc = iL.first(); 1234 inc = iL.first();
1235 Incidence* loc; 1235 Incidence* loc;
1236 while ( inc ) { 1236 while ( inc ) {
1237 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1237 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1238 loc = mCalendar->incidence(inc->uid() ); 1238 loc = mCalendar->incidence(inc->uid() );
1239 if ( loc ) { 1239 if ( loc ) {
1240 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1240 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1241 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1241 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1242 } 1242 }
1243 } 1243 }
1244 inc = iL.next(); 1244 inc = iL.next();
1245 } 1245 }
1246 Incidence* lse = getLastSyncEvent(); 1246 Incidence* lse = getLastSyncEvent();
1247 if ( lse ) { 1247 if ( lse ) {
1248 lse->setReadOnly( false ); 1248 lse->setReadOnly( false );
1249 lse->setDescription( "" ); 1249 lse->setDescription( "" );
1250 lse->setReadOnly( true ); 1250 lse->setReadOnly( true );
1251 } 1251 }
1252 } 1252 }
1253 } 1253 }
1254 setModified( true ); 1254 setModified( true );
1255 } else { 1255 } else {
1256 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1256 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1257 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1257 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1258 question, i18n("Ok")) ; 1258 question, i18n("Ok")) ;
1259 1259
1260 } 1260 }
1261 delete calendar; 1261 delete calendar;
1262 updateView(); 1262 updateView();
1263 return ;//syncOK; 1263 return ;//syncOK;
1264 1264
1265} 1265}
1266void CalendarView::syncSharp() 1266void CalendarView::syncSharp()
1267{ 1267{
1268 syncExternal( 0 ); 1268 syncExternal( 0 );
1269 1269
1270} 1270}
1271 1271
1272 1272
1273#include <kabc/stdaddressbook.h> 1273#include <kabc/stdaddressbook.h>
1274bool CalendarView::importBday() 1274bool CalendarView::importBday()
1275{ 1275{
1276 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1276 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1277 KABC::AddressBook::Iterator it; 1277 KABC::AddressBook::Iterator it;
1278 int count = 0; 1278 int count = 0;
1279 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1279 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1280 ++count; 1280 ++count;
1281 } 1281 }
1282 QProgressBar bar(count,0 ); 1282 QProgressBar bar(count,0 );
1283 int w = 300; 1283 int w = 300;
1284 if ( QApplication::desktop()->width() < 320 ) 1284 if ( QApplication::desktop()->width() < 320 )
1285 w = 220; 1285 w = 220;
1286 int h = bar.sizeHint().height() ; 1286 int h = bar.sizeHint().height() ;
1287 int dw = QApplication::desktop()->width(); 1287 int dw = QApplication::desktop()->width();
1288 int dh = QApplication::desktop()->height(); 1288 int dh = QApplication::desktop()->height();
1289 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1289 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1290 bar.show(); 1290 bar.show();
1291 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1291 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1292 qApp->processEvents(); 1292 qApp->processEvents();
1293 count = 0; 1293 count = 0;
1294 int addCount = 0; 1294 int addCount = 0;
1295 KCal::Attendee* a = 0; 1295 KCal::Attendee* a = 0;
1296 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1296 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1297 if ( ! bar.isVisible() ) 1297 if ( ! bar.isVisible() )
1298 return false; 1298 return false;
1299 bar.setProgress( count++ ); 1299 bar.setProgress( count++ );
1300 qApp->processEvents(); 1300 qApp->processEvents();
1301 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1301 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1302 if ( (*it).birthday().date().isValid() ){ 1302 if ( (*it).birthday().date().isValid() ){
1303 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1303 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1304 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1304 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1305 ++addCount; 1305 ++addCount;
1306 } 1306 }
1307 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1307 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1308 if ( anni.isValid() ){ 1308 if ( anni.isValid() ){
1309 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1309 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1310 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1310 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1311 ++addCount; 1311 ++addCount;
1312 } 1312 }
1313 } 1313 }
1314 updateView(); 1314 updateView();
1315 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1315 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1316 return true; 1316 return true;
1317} 1317}
1318 1318
1319bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1319bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1320{ 1320{
1321 //qDebug("addAnni "); 1321 //qDebug("addAnni ");
1322 Event * ev = new Event(); 1322 Event * ev = new Event();
1323 if ( a ) { 1323 if ( a ) {
1324 ev->addAttendee( a ); 1324 ev->addAttendee( a );
1325 } 1325 }
1326 QString kind; 1326 QString kind;
1327 if ( birthday ) 1327 if ( birthday )
1328 kind = i18n( "Birthday" ); 1328 kind = i18n( "Birthday" );
1329 else 1329 else
1330 kind = i18n( "Anniversary" ); 1330 kind = i18n( "Anniversary" );
1331 ev->setSummary( name + " - " + kind ); 1331 ev->setSummary( name + " - " + kind );
1332 ev->setOrganizer( "nobody@nowhere" ); 1332 ev->setOrganizer( "nobody@nowhere" );
1333 ev->setCategories( kind ); 1333 ev->setCategories( kind );
1334 ev->setDtStart( QDateTime(date) ); 1334 ev->setDtStart( QDateTime(date) );
1335 ev->setDtEnd( QDateTime(date) ); 1335 ev->setDtEnd( QDateTime(date) );
1336 ev->setFloats( true ); 1336 ev->setFloats( true );
1337 Recurrence * rec = ev->recurrence(); 1337 Recurrence * rec = ev->recurrence();
1338 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1338 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1339 rec->addYearlyNum( date.month() ); 1339 rec->addYearlyNum( date.month() );
1340 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1340 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1341 delete ev; 1341 delete ev;
1342 return false; 1342 return false;
1343 } 1343 }
1344 return true; 1344 return true;
1345 1345
1346} 1346}
1347bool CalendarView::importQtopia( const QString &categories, 1347bool CalendarView::importQtopia( const QString &categories,
1348 const QString &datebook, 1348 const QString &datebook,
1349 const QString &todolist ) 1349 const QString &todolist )
1350{ 1350{
1351 1351
1352 QtopiaFormat qtopiaFormat; 1352 QtopiaFormat qtopiaFormat;
1353 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1353 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1354 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1354 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1355 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1355 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1356 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1356 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1357 1357
1358 updateView(); 1358 updateView();
1359 return true; 1359 return true;
1360 1360
1361#if 0 1361#if 0
1362 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1362 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1363 mCurrentSyncDevice = "qtopia-XML"; 1363 mCurrentSyncDevice = "qtopia-XML";
1364 if ( KOPrefs::instance()->mAskForPreferences ) 1364 if ( KOPrefs::instance()->mAskForPreferences )
1365 edit_sync_options(); 1365 edit_sync_options();
1366 qApp->processEvents(); 1366 qApp->processEvents();
1367 CalendarLocal* calendar = new CalendarLocal(); 1367 CalendarLocal* calendar = new CalendarLocal();
1368 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 1368 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
1369 bool syncOK = false; 1369 bool syncOK = false;
1370 QtopiaFormat qtopiaFormat; 1370 QtopiaFormat qtopiaFormat;
1371 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1371 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1372 bool loadOk = true; 1372 bool loadOk = true;
1373 if ( !categories.isEmpty() ) 1373 if ( !categories.isEmpty() )
1374 loadOk = qtopiaFormat.load( calendar, categories ); 1374 loadOk = qtopiaFormat.load( calendar, categories );
1375 if ( loadOk && !datebook.isEmpty() ) 1375 if ( loadOk && !datebook.isEmpty() )
1376 loadOk = qtopiaFormat.load( calendar, datebook ); 1376 loadOk = qtopiaFormat.load( calendar, datebook );
1377 if ( loadOk && !todolist.isEmpty() ) 1377 if ( loadOk && !todolist.isEmpty() )
1378 loadOk = qtopiaFormat.load( calendar, todolist ); 1378 loadOk = qtopiaFormat.load( calendar, todolist );
1379 1379
1380 if ( loadOk ) { 1380 if ( loadOk ) {
1381 getEventViewerDialog()->setSyncMode( true ); 1381 getEventViewerDialog()->setSyncMode( true );
1382 syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); 1382 syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs );
1383 getEventViewerDialog()->setSyncMode( false ); 1383 getEventViewerDialog()->setSyncMode( false );
1384 qApp->processEvents(); 1384 qApp->processEvents();
1385 if ( syncOK ) { 1385 if ( syncOK ) {
1386 if ( KOPrefs::instance()->mWriteBackFile ) 1386 if ( KOPrefs::instance()->mWriteBackFile )
1387 { 1387 {
1388 // write back XML file 1388 // write back XML file
1389 1389
1390 } 1390 }
1391 setModified( true ); 1391 setModified( true );
1392 } 1392 }
1393 } else { 1393 } else {
1394 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 1394 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1395 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 1395 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1396 question, i18n("Ok")) ; 1396 question, i18n("Ok")) ;
1397 } 1397 }
1398 delete calendar; 1398 delete calendar;
1399 updateView(); 1399 updateView();
1400 return syncOK; 1400 return syncOK;
1401 1401
1402 1402
1403#endif 1403#endif
1404 1404
1405} 1405}
1406 1406
1407void CalendarView::setSyncEventsReadOnly() 1407void CalendarView::setSyncEventsReadOnly()
1408{ 1408{
1409 Event * ev; 1409 Event * ev;
1410 QPtrList<Event> eL = mCalendar->rawEvents(); 1410 QPtrList<Event> eL = mCalendar->rawEvents();
1411 ev = eL.first(); 1411 ev = eL.first();
1412 while ( ev ) { 1412 while ( ev ) {
1413 if ( ev->uid().left(15) == QString("last-syncEvent-") ) 1413 if ( ev->uid().left(15) == QString("last-syncEvent-") )
1414 ev->setReadOnly( true ); 1414 ev->setReadOnly( true );
1415 ev = eL.next(); 1415 ev = eL.next();
1416 } 1416 }
1417} 1417}
1418bool CalendarView::openCalendar(QString filename, bool merge) 1418bool CalendarView::openCalendar(QString filename, bool merge)
1419{ 1419{
1420 1420
1421 if (filename.isEmpty()) { 1421 if (filename.isEmpty()) {
1422 return false; 1422 return false;
1423 } 1423 }
1424 1424
1425 if (!QFile::exists(filename)) { 1425 if (!QFile::exists(filename)) {
1426 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1426 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1427 return false; 1427 return false;
1428 } 1428 }
1429 1429
1430 globalFlagBlockAgenda = 1; 1430 globalFlagBlockAgenda = 1;
1431 if (!merge) mCalendar->close(); 1431 if (!merge) mCalendar->close();
1432 1432
1433 mStorage->setFileName( filename ); 1433 mStorage->setFileName( filename );
1434 1434
1435 if ( mStorage->load(KOPrefs::instance()->mUseQuicksave) ) { 1435 if ( mStorage->load(KOPrefs::instance()->mUseQuicksave) ) {
1436 if ( merge ) ;//setModified( true ); 1436 if ( merge ) ;//setModified( true );
1437 else { 1437 else {
1438 //setModified( true ); 1438 //setModified( true );
1439 mViewManager->setDocumentId( filename ); 1439 mViewManager->setDocumentId( filename );
1440 mDialogManager->setDocumentId( filename ); 1440 mDialogManager->setDocumentId( filename );
1441 mTodoList->setDocumentId( filename ); 1441 mTodoList->setDocumentId( filename );
1442 } 1442 }
1443 globalFlagBlockAgenda = 2; 1443 globalFlagBlockAgenda = 2;
1444 // if ( getLastSyncEvent() ) 1444 // if ( getLastSyncEvent() )
1445 // getLastSyncEvent()->setReadOnly( true ); 1445 // getLastSyncEvent()->setReadOnly( true );
1446 mCalendar->reInitAlarmSettings(); 1446 mCalendar->reInitAlarmSettings();
1447 setSyncEventsReadOnly(); 1447 setSyncEventsReadOnly();
1448 updateUnmanagedViews(); 1448 updateUnmanagedViews();
1449 updateView(); 1449 updateView();
1450 if ( filename != MainWindow::defaultFileName() ) 1450 if ( filename != MainWindow::defaultFileName() )
1451 saveCalendar( MainWindow::defaultFileName() ); 1451 saveCalendar( MainWindow::defaultFileName() );
1452 loadedFileVersion = QDateTime::currentDateTime(); 1452 loadedFileVersion = QDateTime::currentDateTime();
1453 return true; 1453 return true;
1454 } else { 1454 } else {
1455 // while failing to load, the calendar object could 1455 // while failing to load, the calendar object could
1456 // have become partially populated. Clear it out. 1456 // have become partially populated. Clear it out.
1457 if ( !merge ) mCalendar->close(); 1457 if ( !merge ) mCalendar->close();
1458 1458
1459 KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 1459 KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
1460 1460
1461 globalFlagBlockAgenda = 2; 1461 globalFlagBlockAgenda = 2;
1462 updateView(); 1462 updateView();
1463 } 1463 }
1464 return false; 1464 return false;
1465} 1465}
1466void CalendarView::setLoadedFileVersion(QDateTime dt) 1466void CalendarView::setLoadedFileVersion(QDateTime dt)
1467{ 1467{
1468 loadedFileVersion = dt; 1468 loadedFileVersion = dt;
1469} 1469}
1470bool CalendarView::checkFileChanged(QString fn) 1470bool CalendarView::checkFileChanged(QString fn)
1471{ 1471{
1472 QFileInfo finf ( fn ); 1472 QFileInfo finf ( fn );
1473 if ( !finf.exists() ) 1473 if ( !finf.exists() )
1474 return true; 1474 return true;
1475 QDateTime dt = finf.lastModified (); 1475 QDateTime dt = finf.lastModified ();
1476 if ( dt <= loadedFileVersion ) 1476 if ( dt <= loadedFileVersion )
1477 return false; 1477 return false;
1478 return true; 1478 return true;
1479 1479
1480} 1480}
1481bool CalendarView::checkFileVersion(QString fn) 1481bool CalendarView::checkFileVersion(QString fn)
1482{ 1482{
1483 QFileInfo finf ( fn ); 1483 QFileInfo finf ( fn );
1484 if ( !finf.exists() ) 1484 if ( !finf.exists() )
1485 return true; 1485 return true;
1486 QDateTime dt = finf.lastModified (); 1486 QDateTime dt = finf.lastModified ();
1487 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); 1487 //qDebug("loaded file version %s",loadedFileVersion.toString().latin1());
1488 //qDebug("file on disk version %s",dt.toString().latin1()); 1488 //qDebug("file on disk version %s",dt.toString().latin1());
1489 if ( dt <= loadedFileVersion ) 1489 if ( dt <= loadedFileVersion )
1490 return true; 1490 return true;
1491 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)) , 1491 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)) ,
1492 i18n("KO/Pi Warning"),i18n("Overwrite"), 1492 i18n("KO/Pi Warning"),i18n("Overwrite"),
1493 i18n("Sync+save")); 1493 i18n("Sync+save"));
1494 1494
1495 if ( km == KMessageBox::Cancel ) 1495 if ( km == KMessageBox::Cancel )
1496 return false; 1496 return false;
1497 if ( km == KMessageBox::Yes ) 1497 if ( km == KMessageBox::Yes )
1498 return true; 1498 return true;
1499 1499
1500 setSyncDevice("deleteaftersync" ); 1500 setSyncDevice("deleteaftersync" );
1501 KOPrefs::instance()->mAskForPreferences = true; 1501 KOPrefs::instance()->mAskForPreferences = true;
1502 KOPrefs::instance()->mSyncAlgoPrefs = 3; 1502 KOPrefs::instance()->mSyncAlgoPrefs = 3;
1503 KOPrefs::instance()->mWriteBackFile = false; 1503 KOPrefs::instance()->mWriteBackFile = false;
1504 KOPrefs::instance()->mWriteBackExistingOnly = false; 1504 KOPrefs::instance()->mWriteBackExistingOnly = false;
1505 KOPrefs::instance()->mShowSyncSummary = false; 1505 KOPrefs::instance()->mShowSyncSummary = false;
1506 syncCalendar( fn, 3 ); 1506 syncCalendar( fn, 3 );
1507 Event * e = getLastSyncEvent(); 1507 Event * e = getLastSyncEvent();
1508 mCalendar->deleteEvent ( e ); 1508 mCalendar->deleteEvent ( e );
1509 updateView(); 1509 updateView();
1510 return true; 1510 return true;
1511} 1511}
1512 1512
1513bool CalendarView::saveCalendar( QString filename ) 1513bool CalendarView::saveCalendar( QString filename )
1514{ 1514{
1515 1515
1516 // Store back all unsaved data into calendar object 1516 // Store back all unsaved data into calendar object
1517 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 1517 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
1518 if ( mViewManager->currentView() ) 1518 if ( mViewManager->currentView() )
1519 mViewManager->currentView()->flushView(); 1519 mViewManager->currentView()->flushView();
1520 1520
1521 //mStorage->setFileName( filename ); 1521 //mStorage->setFileName( filename );
1522 1522
1523 mStorage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); 1523 mStorage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
1524 mStorage->setFileName( filename ); 1524 mStorage->setFileName( filename );
1525 bool success; 1525 bool success;
1526 success = mStorage->save(); 1526 success = mStorage->save();
1527 if ( !success ) { 1527 if ( !success ) {
1528 return false; 1528 return false;
1529 } 1529 }
1530 1530
1531 return true; 1531 return true;
1532} 1532}
1533 1533
1534void CalendarView::closeCalendar() 1534void CalendarView::closeCalendar()
1535{ 1535{
1536 1536
1537 // child windows no longer valid 1537 // child windows no longer valid
1538 emit closingDown(); 1538 emit closingDown();
1539 1539
1540 mCalendar->close(); 1540 mCalendar->close();
1541 setModified(false); 1541 setModified(false);
1542 updateView(); 1542 updateView();
1543} 1543}
1544 1544
1545void CalendarView::archiveCalendar() 1545void CalendarView::archiveCalendar()
1546{ 1546{
1547 mDialogManager->showArchiveDialog(); 1547 mDialogManager->showArchiveDialog();
1548} 1548}
1549 1549
1550 1550
1551void CalendarView::readSettings() 1551void CalendarView::readSettings()
1552{ 1552{
1553 1553
1554 1554
1555 // mViewManager->showAgendaView(); 1555 // mViewManager->showAgendaView();
1556 QString str; 1556 QString str;
1557 //qDebug("CalendarView::readSettings() "); 1557 //qDebug("CalendarView::readSettings() ");
1558 // read settings from the KConfig, supplying reasonable 1558 // read settings from the KConfig, supplying reasonable
1559 // defaults where none are to be found 1559 // defaults where none are to be found
1560 KConfig *config = KOGlobals::config(); 1560 KConfig *config = KOGlobals::config();
1561#ifndef KORG_NOSPLITTER 1561#ifndef KORG_NOSPLITTER
1562 config->setGroup("KOrganizer Geometry"); 1562 config->setGroup("KOrganizer Geometry");
1563 1563
1564 QValueList<int> sizes = config->readIntListEntry("Separator1"); 1564 QValueList<int> sizes = config->readIntListEntry("Separator1");
1565 if (sizes.count() != 2) { 1565 if (sizes.count() != 2) {
1566 sizes << mDateNavigator->minimumSizeHint().width(); 1566 sizes << mDateNavigator->minimumSizeHint().width();
1567 sizes << 300; 1567 sizes << 300;
1568 } 1568 }
1569 mPanner->setSizes(sizes); 1569 mPanner->setSizes(sizes);
1570 1570
1571 sizes = config->readIntListEntry("Separator2"); 1571 sizes = config->readIntListEntry("Separator2");
1572 if ( ( mResourceView && sizes.count() == 4 ) || 1572 if ( ( mResourceView && sizes.count() == 4 ) ||
1573 ( !mResourceView && sizes.count() == 3 ) ) { 1573 ( !mResourceView && sizes.count() == 3 ) ) {
1574 mLeftSplitter->setSizes(sizes); 1574 mLeftSplitter->setSizes(sizes);
1575 } 1575 }
1576#endif 1576#endif
1577 globalFlagBlockAgenda = 1; 1577 globalFlagBlockAgenda = 1;
1578 mViewManager->showAgendaView(); 1578 mViewManager->showAgendaView();
1579 //mViewManager->readSettings( config ); 1579 //mViewManager->readSettings( config );
1580 mTodoList->restoreLayout(config,QString("Todo Layout")); 1580 mTodoList->restoreLayout(config,QString("Todo Layout"));
1581 readFilterSettings(config); 1581 readFilterSettings(config);
1582 config->setGroup( "Views" ); 1582 config->setGroup( "Views" );
1583 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 1583 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
1584 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 1584 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
1585 else if ( dateCount == 7 ) mNavigator->selectWeek(); 1585 else if ( dateCount == 7 ) mNavigator->selectWeek();
1586 else mNavigator->selectDates( dateCount ); 1586 else mNavigator->selectDates( dateCount );
1587 // mViewManager->readSettings( config ); 1587 // mViewManager->readSettings( config );
1588 updateConfig(); 1588 updateConfig();
1589 globalFlagBlockAgenda = 2; 1589 globalFlagBlockAgenda = 2;
1590 mViewManager->readSettings( config ); 1590 mViewManager->readSettings( config );
1591#ifdef DESKTOP_VERSION 1591#ifdef DESKTOP_VERSION
1592 config->setGroup("WidgetLayout"); 1592 config->setGroup("WidgetLayout");
1593 QStringList list; 1593 QStringList list;
1594 list = config->readListEntry("MainLayout"); 1594 list = config->readListEntry("MainLayout");
1595 int x,y,w,h; 1595 int x,y,w,h;
1596 if ( ! list.isEmpty() ) { 1596 if ( ! list.isEmpty() ) {
1597 x = list[0].toInt(); 1597 x = list[0].toInt();
1598 y = list[1].toInt(); 1598 y = list[1].toInt();
1599 w = list[2].toInt(); 1599 w = list[2].toInt();
1600 h = list[3].toInt(); 1600 h = list[3].toInt();
1601 topLevelWidget()->setGeometry(x,y,w,h); 1601 topLevelWidget()->setGeometry(x,y,w,h);
1602 1602
1603 } else { 1603 } else {
1604 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 1604 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
1605 } 1605 }
1606 list = config->readListEntry("EditEventLayout"); 1606 list = config->readListEntry("EditEventLayout");
1607 if ( ! list.isEmpty() ) { 1607 if ( ! list.isEmpty() ) {
1608 x = list[0].toInt(); 1608 x = list[0].toInt();
1609 y = list[1].toInt(); 1609 y = list[1].toInt();
1610 w = list[2].toInt(); 1610 w = list[2].toInt();
1611 h = list[3].toInt(); 1611 h = list[3].toInt();
1612 mEventEditor->setGeometry(x,y,w,h); 1612 mEventEditor->setGeometry(x,y,w,h);
1613 1613
1614 } 1614 }
1615 list = config->readListEntry("EditTodoLayout"); 1615 list = config->readListEntry("EditTodoLayout");
1616 if ( ! list.isEmpty() ) { 1616 if ( ! list.isEmpty() ) {
1617 x = list[0].toInt(); 1617 x = list[0].toInt();
1618 y = list[1].toInt(); 1618 y = list[1].toInt();
1619 w = list[2].toInt(); 1619 w = list[2].toInt();
1620 h = list[3].toInt(); 1620 h = list[3].toInt();
1621 mTodoEditor->setGeometry(x,y,w,h); 1621 mTodoEditor->setGeometry(x,y,w,h);
1622 1622
1623 } 1623 }
1624 list = config->readListEntry("ViewerLayout"); 1624 list = config->readListEntry("ViewerLayout");
1625 if ( ! list.isEmpty() ) { 1625 if ( ! list.isEmpty() ) {
1626 x = list[0].toInt(); 1626 x = list[0].toInt();
1627 y = list[1].toInt(); 1627 y = list[1].toInt();
1628 w = list[2].toInt(); 1628 w = list[2].toInt();
1629 h = list[3].toInt(); 1629 h = list[3].toInt();
1630 getEventViewerDialog()->setGeometry(x,y,w,h); 1630 getEventViewerDialog()->setGeometry(x,y,w,h);
1631 } 1631 }
1632#endif 1632#endif
1633 1633
1634} 1634}
1635 1635
1636 1636
1637void CalendarView::writeSettings() 1637void CalendarView::writeSettings()
1638{ 1638{
1639 // kdDebug() << "CalendarView::writeSettings" << endl; 1639 // kdDebug() << "CalendarView::writeSettings" << endl;
1640 1640
1641 KConfig *config = KOGlobals::config(); 1641 KConfig *config = KOGlobals::config();
1642 1642
1643#ifndef KORG_NOSPLITTER 1643#ifndef KORG_NOSPLITTER
1644 config->setGroup("KOrganizer Geometry"); 1644 config->setGroup("KOrganizer Geometry");
1645 1645
1646 QValueList<int> list = mPanner->sizes(); 1646 QValueList<int> list = mPanner->sizes();
1647 config->writeEntry("Separator1",list); 1647 config->writeEntry("Separator1",list);
1648 1648
1649 list = mLeftSplitter->sizes(); 1649 list = mLeftSplitter->sizes();
1650 config->writeEntry("Separator2",list); 1650 config->writeEntry("Separator2",list);
1651#endif 1651#endif
1652 1652
1653 mViewManager->writeSettings( config ); 1653 mViewManager->writeSettings( config );
1654 mTodoList->saveLayout(config,QString("Todo Layout")); 1654 mTodoList->saveLayout(config,QString("Todo Layout"));
1655 mDialogManager->writeSettings( config ); 1655 mDialogManager->writeSettings( config );
1656 //KOPrefs::instance()->usrWriteConfig(); 1656 //KOPrefs::instance()->usrWriteConfig();
1657 KOPrefs::instance()->writeConfig(); 1657 KOPrefs::instance()->writeConfig();
1658 1658
1659 writeFilterSettings(config); 1659 writeFilterSettings(config);
1660 1660
1661 config->setGroup( "Views" ); 1661 config->setGroup( "Views" );
1662 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 1662 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
1663 1663
1664#ifdef DESKTOP_VERSION 1664#ifdef DESKTOP_VERSION
1665 config->setGroup("WidgetLayout"); 1665 config->setGroup("WidgetLayout");
1666 QStringList list ;//= config->readListEntry("MainLayout"); 1666 QStringList list ;//= config->readListEntry("MainLayout");
1667 int x,y,w,h; 1667 int x,y,w,h;
1668 QWidget* wid; 1668 QWidget* wid;
1669 wid = topLevelWidget(); 1669 wid = topLevelWidget();
1670 x = wid->geometry().x(); 1670 x = wid->geometry().x();
1671 y = wid->geometry().y(); 1671 y = wid->geometry().y();
1672 w = wid->width(); 1672 w = wid->width();
1673 h = wid->height(); 1673 h = wid->height();
1674 list.clear(); 1674 list.clear();
1675 list << QString::number( x ); 1675 list << QString::number( x );
1676 list << QString::number( y ); 1676 list << QString::number( y );
1677 list << QString::number( w ); 1677 list << QString::number( w );
1678 list << QString::number( h ); 1678 list << QString::number( h );
1679 config->writeEntry("MainLayout",list ); 1679 config->writeEntry("MainLayout",list );
1680 1680
1681 wid = mEventEditor; 1681 wid = mEventEditor;
1682 x = wid->geometry().x(); 1682 x = wid->geometry().x();
1683 y = wid->geometry().y(); 1683 y = wid->geometry().y();
1684 w = wid->width(); 1684 w = wid->width();
1685 h = wid->height(); 1685 h = wid->height();
1686 list.clear(); 1686 list.clear();
1687 list << QString::number( x ); 1687 list << QString::number( x );
1688 list << QString::number( y ); 1688 list << QString::number( y );
1689 list << QString::number( w ); 1689 list << QString::number( w );
1690 list << QString::number( h ); 1690 list << QString::number( h );
1691 config->writeEntry("EditEventLayout",list ); 1691 config->writeEntry("EditEventLayout",list );
1692 1692
1693 wid = mTodoEditor; 1693 wid = mTodoEditor;
1694 x = wid->geometry().x(); 1694 x = wid->geometry().x();
1695 y = wid->geometry().y(); 1695 y = wid->geometry().y();
1696 w = wid->width(); 1696 w = wid->width();
1697 h = wid->height(); 1697 h = wid->height();
1698 list.clear(); 1698 list.clear();
1699 list << QString::number( x ); 1699 list << QString::number( x );
1700 list << QString::number( y ); 1700 list << QString::number( y );
1701 list << QString::number( w ); 1701 list << QString::number( w );
1702 list << QString::number( h ); 1702 list << QString::number( h );
1703 config->writeEntry("EditTodoLayout",list ); 1703 config->writeEntry("EditTodoLayout",list );
1704 wid = getEventViewerDialog(); 1704 wid = getEventViewerDialog();
1705 x = wid->geometry().x(); 1705 x = wid->geometry().x();
1706 y = wid->geometry().y(); 1706 y = wid->geometry().y();
1707 w = wid->width(); 1707 w = wid->width();
1708 h = wid->height(); 1708 h = wid->height();
1709 list.clear(); 1709 list.clear();
1710 list << QString::number( x ); 1710 list << QString::number( x );
1711 list << QString::number( y ); 1711 list << QString::number( y );
1712 list << QString::number( w ); 1712 list << QString::number( w );
1713 list << QString::number( h ); 1713 list << QString::number( h );
1714 config->writeEntry("ViewerLayout",list ); 1714 config->writeEntry("ViewerLayout",list );
1715 wid = mDialogManager->getSearchDialog(); 1715 wid = mDialogManager->getSearchDialog();
1716 if ( wid ) { 1716 if ( wid ) {
1717 x = wid->geometry().x(); 1717 x = wid->geometry().x();
1718 y = wid->geometry().y(); 1718 y = wid->geometry().y();
1719 w = wid->width(); 1719 w = wid->width();
1720 h = wid->height(); 1720 h = wid->height();
1721 list.clear(); 1721 list.clear();
1722 list << QString::number( x ); 1722 list << QString::number( x );
1723 list << QString::number( y ); 1723 list << QString::number( y );
1724 list << QString::number( w ); 1724 list << QString::number( w );
1725 list << QString::number( h ); 1725 list << QString::number( h );
1726 config->writeEntry("SearchLayout",list ); 1726 config->writeEntry("SearchLayout",list );
1727 } 1727 }
1728#endif 1728#endif
1729 1729
1730 1730
1731 config->sync(); 1731 config->sync();
1732} 1732}
1733 1733
1734void CalendarView::readFilterSettings(KConfig *config) 1734void CalendarView::readFilterSettings(KConfig *config)
1735{ 1735{
1736 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 1736 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
1737 1737
1738 mFilters.clear(); 1738 mFilters.clear();
1739 1739
1740 config->setGroup("General"); 1740 config->setGroup("General");
1741 QStringList filterList = config->readListEntry("CalendarFilters"); 1741 QStringList filterList = config->readListEntry("CalendarFilters");
1742 1742
1743 QStringList::ConstIterator it = filterList.begin(); 1743 QStringList::ConstIterator it = filterList.begin();
1744 QStringList::ConstIterator end = filterList.end(); 1744 QStringList::ConstIterator end = filterList.end();
1745 while(it != end) { 1745 while(it != end) {
1746 // kdDebug() << " filter: " << (*it) << endl; 1746 // kdDebug() << " filter: " << (*it) << endl;
1747 1747
1748 CalFilter *filter; 1748 CalFilter *filter;
1749 filter = new CalFilter(*it); 1749 filter = new CalFilter(*it);
1750 config->setGroup("Filter_" + (*it)); 1750 config->setGroup("Filter_" + (*it));
1751 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 1751 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
1752 filter->setCriteria(config->readNumEntry("Criteria",0)); 1752 filter->setCriteria(config->readNumEntry("Criteria",0));
1753 filter->setCategoryList(config->readListEntry("CategoryList")); 1753 filter->setCategoryList(config->readListEntry("CategoryList"));
1754 mFilters.append(filter); 1754 mFilters.append(filter);
1755 1755
1756 ++it; 1756 ++it;
1757 } 1757 }
1758 1758
1759 if (mFilters.count() == 0) { 1759 if (mFilters.count() == 0) {
1760 CalFilter *filter = new CalFilter(i18n("Default")); 1760 CalFilter *filter = new CalFilter(i18n("Default"));
1761 mFilters.append(filter); 1761 mFilters.append(filter);
1762 } 1762 }
1763 mFilterView->updateFilters(); 1763 mFilterView->updateFilters();
1764 config->setGroup("FilterView"); 1764 config->setGroup("FilterView");
1765 1765
1766 mFilterView->blockSignals(true); 1766 mFilterView->blockSignals(true);
1767 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 1767 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
1768 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 1768 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
1769 mFilterView->blockSignals(false); 1769 mFilterView->blockSignals(false);
1770 // We do it manually to avoid it being done twice by the above calls 1770 // We do it manually to avoid it being done twice by the above calls
1771 updateFilter(); 1771 updateFilter();
1772} 1772}
1773 1773
1774void CalendarView::writeFilterSettings(KConfig *config) 1774void CalendarView::writeFilterSettings(KConfig *config)
1775{ 1775{
1776 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 1776 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
1777 1777
1778 QStringList filterList; 1778 QStringList filterList;
1779 1779
1780 CalFilter *filter = mFilters.first(); 1780 CalFilter *filter = mFilters.first();
1781 while(filter) { 1781 while(filter) {
1782 // kdDebug() << " fn: " << filter->name() << endl; 1782 // kdDebug() << " fn: " << filter->name() << endl;
1783 filterList << filter->name(); 1783 filterList << filter->name();
1784 config->setGroup("Filter_" + filter->name()); 1784 config->setGroup("Filter_" + filter->name());
1785 config->writeEntry("Criteria",filter->criteria()); 1785 config->writeEntry("Criteria",filter->criteria());
1786 config->writeEntry("CategoryList",filter->categoryList()); 1786 config->writeEntry("CategoryList",filter->categoryList());
1787 filter = mFilters.next(); 1787 filter = mFilters.next();
1788 } 1788 }
1789 config->setGroup("General"); 1789 config->setGroup("General");
1790 config->writeEntry("CalendarFilters",filterList); 1790 config->writeEntry("CalendarFilters",filterList);
1791 1791
1792 config->setGroup("FilterView"); 1792 config->setGroup("FilterView");
1793 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 1793 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
1794 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 1794 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
1795} 1795}
1796 1796
1797 1797
1798void CalendarView::goToday() 1798void CalendarView::goToday()
1799{ 1799{
1800 mNavigator->selectToday(); 1800 mNavigator->selectToday();
1801} 1801}
1802 1802
1803void CalendarView::goNext() 1803void CalendarView::goNext()
1804{ 1804{
1805 mNavigator->selectNext(); 1805 mNavigator->selectNext();
1806} 1806}
1807 1807
1808void CalendarView::goPrevious() 1808void CalendarView::goPrevious()
1809{ 1809{
1810 mNavigator->selectPrevious(); 1810 mNavigator->selectPrevious();
1811} 1811}
1812void CalendarView::goNextMonth() 1812void CalendarView::goNextMonth()
1813{ 1813{
1814 mNavigator->selectNextMonth(); 1814 mNavigator->selectNextMonth();
1815} 1815}
1816 1816
1817void CalendarView::goPreviousMonth() 1817void CalendarView::goPreviousMonth()
1818{ 1818{
1819 mNavigator->selectPreviousMonth(); 1819 mNavigator->selectPreviousMonth();
1820} 1820}
1821void CalendarView::writeLocale() 1821void CalendarView::writeLocale()
1822{ 1822{
1823 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); 1823 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
1824 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); 1824 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
1825 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); 1825 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
1826 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); 1826 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
1827 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1827 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1828 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 1828 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
1829 dummy = KOPrefs::instance()->mUserDateFormatShort; 1829 dummy = KOPrefs::instance()->mUserDateFormatShort;
1830 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 1830 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
1831 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, 1831 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
1832 KOPrefs::instance()->mDaylightsavingStart, 1832 KOPrefs::instance()->mDaylightsavingStart,
1833 KOPrefs::instance()->mDaylightsavingEnd ); 1833 KOPrefs::instance()->mDaylightsavingEnd );
1834 KGlobal::locale()->setTimezone( KOPrefs::instance()->mTimeZoneId ); 1834 KGlobal::locale()->setTimezone( KOPrefs::instance()->mTimeZoneId );
1835} 1835}
1836void CalendarView::updateConfig() 1836void CalendarView::updateConfig()
1837{ 1837{
1838 writeLocale(); 1838 writeLocale();
1839 if ( KOPrefs::instance()->mUseAppColors ) 1839 if ( KOPrefs::instance()->mUseAppColors )
1840 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 1840 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
1841 emit configChanged(); 1841 emit configChanged();
1842 mTodoList->updateConfig(); 1842 mTodoList->updateConfig();
1843 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 1843 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
1844 mCalendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 1844 mCalendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
1845 // To make the "fill window" configurations work 1845 // To make the "fill window" configurations work
1846 //mViewManager->raiseCurrentView(); 1846 //mViewManager->raiseCurrentView();
1847} 1847}
1848 1848
1849 1849
1850void CalendarView::eventChanged(Event *event) 1850void CalendarView::eventChanged(Event *event)
1851{ 1851{
1852 changeEventDisplay(event,KOGlobals::EVENTEDITED); 1852 changeEventDisplay(event,KOGlobals::EVENTEDITED);
1853 //updateUnmanagedViews(); 1853 //updateUnmanagedViews();
1854} 1854}
1855 1855
1856void CalendarView::eventAdded(Event *event) 1856void CalendarView::eventAdded(Event *event)
1857{ 1857{
1858 changeEventDisplay(event,KOGlobals::EVENTADDED); 1858 changeEventDisplay(event,KOGlobals::EVENTADDED);
1859} 1859}
1860 1860
1861void CalendarView::eventToBeDeleted(Event *) 1861void CalendarView::eventToBeDeleted(Event *)
1862{ 1862{
1863 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 1863 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
1864} 1864}
1865 1865
1866void CalendarView::eventDeleted() 1866void CalendarView::eventDeleted()
1867{ 1867{
1868 changeEventDisplay(0,KOGlobals::EVENTDELETED); 1868 changeEventDisplay(0,KOGlobals::EVENTDELETED);
1869} 1869}
1870void CalendarView::changeTodoDisplay(Todo *which, int action) 1870void CalendarView::changeTodoDisplay(Todo *which, int action)
1871{ 1871{
1872 changeIncidenceDisplay((Incidence *)which, action); 1872 changeIncidenceDisplay((Incidence *)which, action);
1873 mDateNavigator->updateView(); 1873 mDateNavigator->updateView();
1874 //mDialogManager->updateSearchDialog(); 1874 //mDialogManager->updateSearchDialog();
1875 1875
1876 if (which) { 1876 if (which) {
1877 mViewManager->currentView()->updateView(); 1877 mViewManager->currentView()->updateView();
1878 mTodoList->updateView(); 1878 //mTodoList->updateView();
1879 } 1879 }
1880 1880
1881} 1881}
1882 1882
1883void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 1883void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
1884{ 1884{
1885 updateUnmanagedViews(); 1885 updateUnmanagedViews();
1886 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 1886 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
1887 if ( action == KOGlobals::EVENTDELETED ) { //delete 1887 if ( action == KOGlobals::EVENTDELETED ) { //delete
1888 mCalendar->checkAlarmForIncidence( 0, true ); 1888 mCalendar->checkAlarmForIncidence( 0, true );
1889 if ( mEventViewerDialog ) 1889 if ( mEventViewerDialog )
1890 mEventViewerDialog->hide(); 1890 mEventViewerDialog->hide();
1891 } 1891 }
1892 else 1892 else
1893 mCalendar->checkAlarmForIncidence( which , false ); 1893 mCalendar->checkAlarmForIncidence( which , false );
1894} 1894}
1895 1895
1896// most of the changeEventDisplays() right now just call the view's 1896// most of the changeEventDisplays() right now just call the view's
1897// total update mode, but they SHOULD be recoded to be more refresh-efficient. 1897// total update mode, but they SHOULD be recoded to be more refresh-efficient.
1898void CalendarView::changeEventDisplay(Event *which, int action) 1898void CalendarView::changeEventDisplay(Event *which, int action)
1899{ 1899{
1900 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 1900 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
1901 changeIncidenceDisplay((Incidence *)which, action); 1901 changeIncidenceDisplay((Incidence *)which, action);
1902 mDateNavigator->updateView(); 1902 mDateNavigator->updateView();
1903 //mDialogManager->updateSearchDialog(); 1903 //mDialogManager->updateSearchDialog();
1904 1904
1905 if (which) { 1905 if (which) {
1906 // If there is an event view visible update the display 1906 // If there is an event view visible update the display
1907 mViewManager->currentView()->changeEventDisplay(which,action); 1907 mViewManager->currentView()->changeEventDisplay(which,action);
1908 // TODO: check, if update needed 1908 // TODO: check, if update needed
1909 // if (which->getTodoStatus()) { 1909 // if (which->getTodoStatus()) {
1910 mTodoList->updateView(); 1910 mTodoList->updateView();
1911 // } 1911 // }
1912 } else { 1912 } else {
1913 mViewManager->currentView()->updateView(); 1913 mViewManager->currentView()->updateView();
1914 } 1914 }
1915} 1915}
1916 1916
1917 1917
1918void CalendarView::updateTodoViews() 1918void CalendarView::updateTodoViews()
1919{ 1919{
1920 1920
1921 mTodoList->updateView(); 1921 mTodoList->updateView();
1922 mViewManager->currentView()->updateView(); 1922 mViewManager->currentView()->updateView();
1923 1923
1924} 1924}
1925 1925
1926 1926
1927void CalendarView::updateView(const QDate &start, const QDate &end) 1927void CalendarView::updateView(const QDate &start, const QDate &end)
1928{ 1928{
1929 mTodoList->updateView(); 1929 mTodoList->updateView();
1930 mViewManager->updateView(start, end); 1930 mViewManager->updateView(start, end);
1931 //mDateNavigator->updateView(); 1931 //mDateNavigator->updateView();
1932} 1932}
1933 1933
1934void CalendarView::updateView() 1934void CalendarView::updateView()
1935{ 1935{
1936 DateList tmpList = mNavigator->selectedDates(); 1936 DateList tmpList = mNavigator->selectedDates();
1937 1937
1938 // We assume that the navigator only selects consecutive days. 1938 // We assume that the navigator only selects consecutive days.
1939 updateView( tmpList.first(), tmpList.last() ); 1939 updateView( tmpList.first(), tmpList.last() );
1940} 1940}
1941 1941
1942void CalendarView::updateUnmanagedViews() 1942void CalendarView::updateUnmanagedViews()
1943{ 1943{
1944 mDateNavigator->updateDayMatrix(); 1944 mDateNavigator->updateDayMatrix();
1945} 1945}
1946 1946
1947int CalendarView::msgItemDelete() 1947int CalendarView::msgItemDelete()
1948{ 1948{
1949 return KMessageBox::warningContinueCancel(this, 1949 return KMessageBox::warningContinueCancel(this,
1950 i18n("This item will be\npermanently deleted."), 1950 i18n("This item will be\npermanently deleted."),
1951 i18n("KO/Pi Confirmation"),i18n("Delete")); 1951 i18n("KO/Pi Confirmation"),i18n("Delete"));
1952} 1952}
1953 1953
1954 1954
1955void CalendarView::edit_cut() 1955void CalendarView::edit_cut()
1956{ 1956{
1957 Event *anEvent=0; 1957 Event *anEvent=0;
1958 1958
1959 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 1959 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
1960 1960
1961 if (mViewManager->currentView()->isEventView()) { 1961 if (mViewManager->currentView()->isEventView()) {
1962 if ( incidence && incidence->type() == "Event" ) { 1962 if ( incidence && incidence->type() == "Event" ) {
1963 anEvent = static_cast<Event *>(incidence); 1963 anEvent = static_cast<Event *>(incidence);
1964 } 1964 }
1965 } 1965 }
1966 1966
1967 if (!anEvent) { 1967 if (!anEvent) {
1968 KNotifyClient::beep(); 1968 KNotifyClient::beep();
1969 return; 1969 return;
1970 } 1970 }
1971 DndFactory factory( mCalendar ); 1971 DndFactory factory( mCalendar );
1972 factory.cutEvent(anEvent); 1972 factory.cutEvent(anEvent);
1973 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 1973 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
1974} 1974}
1975 1975
1976void CalendarView::edit_copy() 1976void CalendarView::edit_copy()
1977{ 1977{
1978 Event *anEvent=0; 1978 Event *anEvent=0;
1979 1979
1980 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 1980 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
1981 1981
1982 if (mViewManager->currentView()->isEventView()) { 1982 if (mViewManager->currentView()->isEventView()) {
1983 if ( incidence && incidence->type() == "Event" ) { 1983 if ( incidence && incidence->type() == "Event" ) {
1984 anEvent = static_cast<Event *>(incidence); 1984 anEvent = static_cast<Event *>(incidence);
1985 } 1985 }
1986 } 1986 }
1987 1987
1988 if (!anEvent) { 1988 if (!anEvent) {
1989 KNotifyClient::beep(); 1989 KNotifyClient::beep();
1990 return; 1990 return;
1991 } 1991 }
1992 DndFactory factory( mCalendar ); 1992 DndFactory factory( mCalendar );
1993 factory.copyEvent(anEvent); 1993 factory.copyEvent(anEvent);
1994} 1994}
1995 1995
1996void CalendarView::edit_paste() 1996void CalendarView::edit_paste()
1997{ 1997{
1998 QDate date = mNavigator->selectedDates().first(); 1998 QDate date = mNavigator->selectedDates().first();
1999 1999
2000 DndFactory factory( mCalendar ); 2000 DndFactory factory( mCalendar );
2001 Event *pastedEvent = factory.pasteEvent( date ); 2001 Event *pastedEvent = factory.pasteEvent( date );
2002 2002
2003 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2003 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2004} 2004}
2005 2005
2006void CalendarView::edit_options() 2006void CalendarView::edit_options()
2007{ 2007{
2008 mDialogManager->showOptionsDialog(); 2008 mDialogManager->showOptionsDialog();
2009 //writeSettings(); 2009 //writeSettings();
2010} 2010}
2011void CalendarView::edit_sync_options() 2011void CalendarView::edit_sync_options()
2012{ 2012{
2013 //mDialogManager->showSyncOptions(); 2013 //mDialogManager->showSyncOptions();
2014 //KOPrefs::instance()->mSyncAlgoPrefs 2014 //KOPrefs::instance()->mSyncAlgoPrefs
2015 QDialog dia( this, "dia", true ); 2015 QDialog dia( this, "dia", true );
2016 dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); 2016 dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice );
2017 QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); 2017 QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia);
2018 QVBoxLayout lay ( &dia ); 2018 QVBoxLayout lay ( &dia );
2019 lay.setSpacing( 2 ); 2019 lay.setSpacing( 2 );
2020 lay.setMargin( 3 ); 2020 lay.setMargin( 3 );
2021 lay.addWidget(&gr); 2021 lay.addWidget(&gr);
2022 QRadioButton loc ( i18n("Take local entry on conflict"), &gr ); 2022 QRadioButton loc ( i18n("Take local entry on conflict"), &gr );
2023 QRadioButton rem ( i18n("Take remote entry on conflict"), &gr ); 2023 QRadioButton rem ( i18n("Take remote entry on conflict"), &gr );
2024 QRadioButton newest( i18n("Take newest entry on conflict"), &gr ); 2024 QRadioButton newest( i18n("Take newest entry on conflict"), &gr );
2025 QRadioButton ask( i18n("Ask for every entry on conflict"), &gr ); 2025 QRadioButton ask( i18n("Ask for every entry on conflict"), &gr );
2026 QRadioButton f_loc( i18n("Force: Take local entry always"), &gr ); 2026 QRadioButton f_loc( i18n("Force: Take local entry always"), &gr );
2027 QRadioButton f_rem( i18n("Force: Take remote entry always"), &gr ); 2027 QRadioButton f_rem( i18n("Force: Take remote entry always"), &gr );
2028 //QRadioButton both( i18n("Take both on conflict"), &gr ); 2028 //QRadioButton both( i18n("Take both on conflict"), &gr );
2029 QPushButton pb ( "OK", &dia); 2029 QPushButton pb ( "OK", &dia);
2030 lay.addWidget( &pb ); 2030 lay.addWidget( &pb );
2031 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); 2031 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
2032 switch ( KOPrefs::instance()->mSyncAlgoPrefs ) { 2032 switch ( KOPrefs::instance()->mSyncAlgoPrefs ) {
2033 case 0: 2033 case 0:
2034 loc.setChecked( true); 2034 loc.setChecked( true);
2035 break; 2035 break;
2036 case 1: 2036 case 1:
2037 rem.setChecked( true ); 2037 rem.setChecked( true );
2038 break; 2038 break;
2039 case 2: 2039 case 2:
2040 newest.setChecked( true); 2040 newest.setChecked( true);
2041 break; 2041 break;
2042 case 3: 2042 case 3:
2043 ask.setChecked( true); 2043 ask.setChecked( true);
2044 break; 2044 break;
2045 case 4: 2045 case 4:
2046 f_loc.setChecked( true); 2046 f_loc.setChecked( true);
2047 break; 2047 break;
2048 case 5: 2048 case 5:
2049 f_rem.setChecked( true); 2049 f_rem.setChecked( true);
2050 break; 2050 break;
2051 case 6: 2051 case 6:
2052 // both.setChecked( true); 2052 // both.setChecked( true);
2053 break; 2053 break;
2054 default: 2054 default:
2055 break; 2055 break;
2056 } 2056 }
2057 if ( dia.exec() ) { 2057 if ( dia.exec() ) {
2058 KOPrefs::instance()->mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; 2058 KOPrefs::instance()->mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ;
2059 } 2059 }
2060 2060
2061} 2061}
2062 2062
2063void CalendarView::slotSelectPickerDate( QDate d) 2063void CalendarView::slotSelectPickerDate( QDate d)
2064{ 2064{
2065 mDateFrame->hide(); 2065 mDateFrame->hide();
2066 if ( mDatePickerMode == 1 ) { 2066 if ( mDatePickerMode == 1 ) {
2067 mNavigator->slotDaySelect( d ); 2067 mNavigator->slotDaySelect( d );
2068 } else if ( mDatePickerMode == 2 ) { 2068 } else if ( mDatePickerMode == 2 ) {
2069 if ( mMoveIncidence->type() == "Todo" ) { 2069 if ( mMoveIncidence->type() == "Todo" ) {
2070 Todo * to = (Todo *) mMoveIncidence; 2070 Todo * to = (Todo *) mMoveIncidence;
2071 QTime tim; 2071 QTime tim;
2072 if ( to->hasDueDate() ) 2072 if ( to->hasDueDate() )
2073 tim = to->dtDue().time(); 2073 tim = to->dtDue().time();
2074 else { 2074 else {
2075 tim = QTime ( 0,0,0 ); 2075 tim = QTime ( 0,0,0 );
2076 to->setFloats( true ); 2076 to->setFloats( true );
2077 to->setHasDueDate( true ); 2077 to->setHasDueDate( true );
2078 } 2078 }
2079 QDateTime dt ( d,tim ); 2079 QDateTime dt ( d,tim );
2080 to->setDtDue( dt ); 2080 to->setDtDue( dt );
2081 todoChanged( to ); 2081 todoChanged( to );
2082 } else { 2082 } else {
2083 QTime tim = mMoveIncidence->dtStart().time(); 2083 QTime tim = mMoveIncidence->dtStart().time();
2084 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2084 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2085 QDateTime dt ( d,tim ); 2085 QDateTime dt ( d,tim );
2086 mMoveIncidence->setDtStart( dt ); 2086 mMoveIncidence->setDtStart( dt );
2087 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2087 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2088 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2088 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2089 } 2089 }
2090 2090
2091 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2091 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2092 } 2092 }
2093} 2093}
2094 2094
2095void CalendarView::removeCategories() 2095void CalendarView::removeCategories()
2096{ 2096{
2097 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2097 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2098 QStringList catList = KOPrefs::instance()->mCustomCategories; 2098 QStringList catList = KOPrefs::instance()->mCustomCategories;
2099 QStringList catIncList; 2099 QStringList catIncList;
2100 QStringList newCatList; 2100 QStringList newCatList;
2101 Incidence* inc = incList.first(); 2101 Incidence* inc = incList.first();
2102 int i; 2102 int i;
2103 int count = 0; 2103 int count = 0;
2104 while ( inc ) { 2104 while ( inc ) {
2105 newCatList.clear(); 2105 newCatList.clear();
2106 catIncList = inc->categories() ; 2106 catIncList = inc->categories() ;
2107 for( i = 0; i< catIncList.count(); ++i ) { 2107 for( i = 0; i< catIncList.count(); ++i ) {
2108 if ( catList.contains (catIncList[i])) 2108 if ( catList.contains (catIncList[i]))
2109 newCatList.append( catIncList[i] ); 2109 newCatList.append( catIncList[i] );
2110 } 2110 }
2111 newCatList.sort(); 2111 newCatList.sort();
2112 inc->setCategories( newCatList.join(",") ); 2112 inc->setCategories( newCatList.join(",") );
2113 inc = incList.next(); 2113 inc = incList.next();
2114 } 2114 }
2115} 2115}
2116 2116
2117int CalendarView::addCategories() 2117int CalendarView::addCategories()
2118{ 2118{
2119 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2119 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2120 QStringList catList = KOPrefs::instance()->mCustomCategories; 2120 QStringList catList = KOPrefs::instance()->mCustomCategories;
2121 QStringList catIncList; 2121 QStringList catIncList;
2122 Incidence* inc = incList.first(); 2122 Incidence* inc = incList.first();
2123 int i; 2123 int i;
2124 int count = 0; 2124 int count = 0;
2125 while ( inc ) { 2125 while ( inc ) {
2126 catIncList = inc->categories() ; 2126 catIncList = inc->categories() ;
2127 for( i = 0; i< catIncList.count(); ++i ) { 2127 for( i = 0; i< catIncList.count(); ++i ) {
2128 if ( !catList.contains (catIncList[i])) { 2128 if ( !catList.contains (catIncList[i])) {
2129 catList.append( catIncList[i] ); 2129 catList.append( catIncList[i] );
2130 //qDebug("add cat %s ", catIncList[i].latin1()); 2130 //qDebug("add cat %s ", catIncList[i].latin1());
2131 ++count; 2131 ++count;
2132 } 2132 }
2133 } 2133 }
2134 inc = incList.next(); 2134 inc = incList.next();
2135 } 2135 }
2136 catList.sort(); 2136 catList.sort();
2137 KOPrefs::instance()->mCustomCategories = catList; 2137 KOPrefs::instance()->mCustomCategories = catList;
2138 return count; 2138 return count;
2139} 2139}
2140 2140
2141void CalendarView::manageCategories() 2141void CalendarView::manageCategories()
2142{ 2142{
2143 KOCatPrefs* cp = new KOCatPrefs(); 2143 KOCatPrefs* cp = new KOCatPrefs();
2144 cp->show(); 2144 cp->show();
2145 int w =cp->sizeHint().width() ; 2145 int w =cp->sizeHint().width() ;
2146 int h = cp->sizeHint().height() ; 2146 int h = cp->sizeHint().height() ;
2147 int dw = QApplication::desktop()->width(); 2147 int dw = QApplication::desktop()->width();
2148 int dh = QApplication::desktop()->height(); 2148 int dh = QApplication::desktop()->height();
2149 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2149 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2150 if ( !cp->exec() ) { 2150 if ( !cp->exec() ) {
2151 delete cp; 2151 delete cp;
2152 return; 2152 return;
2153 } 2153 }
2154 int count = 0; 2154 int count = 0;
2155 if ( cp->addCat() ) { 2155 if ( cp->addCat() ) {
2156 count = addCategories(); 2156 count = addCategories();
2157 if ( count ) { 2157 if ( count ) {
2158 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2158 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2159 writeSettings(); 2159 writeSettings();
2160 } 2160 }
2161 } else { 2161 } else {
2162 removeCategories(); 2162 removeCategories();
2163 updateView(); 2163 updateView();
2164 } 2164 }
2165 delete cp; 2165 delete cp;
2166} 2166}
2167 2167
2168void CalendarView::beamIncidence(Incidence * Inc) 2168void CalendarView::beamIncidence(Incidence * Inc)
2169{ 2169{
2170 QPtrList<Incidence> delSel ; 2170 QPtrList<Incidence> delSel ;
2171 delSel.append(Inc); 2171 delSel.append(Inc);
2172 beamIncidenceList( delSel ); 2172 beamIncidenceList( delSel );
2173} 2173}
2174void CalendarView::beamCalendar() 2174void CalendarView::beamCalendar()
2175{ 2175{
2176 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2176 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2177 //qDebug("beamCalendar() "); 2177 //qDebug("beamCalendar() ");
2178 beamIncidenceList( delSel ); 2178 beamIncidenceList( delSel );
2179} 2179}
2180void CalendarView::beamFilteredCalendar() 2180void CalendarView::beamFilteredCalendar()
2181{ 2181{
2182 QPtrList<Incidence> delSel = mCalendar->incidences(); 2182 QPtrList<Incidence> delSel = mCalendar->incidences();
2183 //qDebug("beamFilteredCalendar() "); 2183 //qDebug("beamFilteredCalendar() ");
2184 beamIncidenceList( delSel ); 2184 beamIncidenceList( delSel );
2185} 2185}
2186void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2186void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2187{ 2187{
2188 if ( beamDialog->exec () == QDialog::Rejected ) 2188 if ( beamDialog->exec () == QDialog::Rejected )
2189 return; 2189 return;
2190 2190
2191 QString fn = "/tmp/kopibeamfile"; 2191 QString fn = "/tmp/kopibeamfile";
2192 QString mes; 2192 QString mes;
2193 bool createbup = true; 2193 bool createbup = true;
2194 if ( createbup ) { 2194 if ( createbup ) {
2195 QString description = "\n"; 2195 QString description = "\n";
2196 CalendarLocal* cal = new CalendarLocal(); 2196 CalendarLocal* cal = new CalendarLocal();
2197 if ( beamDialog->beamLocal() ) 2197 if ( beamDialog->beamLocal() )
2198 cal->setLocalTime(); 2198 cal->setLocalTime();
2199 else 2199 else
2200 cal->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 2200 cal->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
2201 Incidence *incidence = delSel.first(); 2201 Incidence *incidence = delSel.first();
2202 bool addText = false; 2202 bool addText = false;
2203 if ( delSel.count() < 10 ) 2203 if ( delSel.count() < 10 )
2204 addText = true; 2204 addText = true;
2205 else { 2205 else {
2206 description.sprintf(i18n(" %d items?"),delSel.count() ); 2206 description.sprintf(i18n(" %d items?"),delSel.count() );
2207 } 2207 }
2208 while ( incidence ) { 2208 while ( incidence ) {
2209 Incidence *in = incidence->clone(); 2209 Incidence *in = incidence->clone();
2210 if ( addText ) 2210 if ( addText )
2211 description += in->summary() + "\n"; 2211 description += in->summary() + "\n";
2212 cal->addIncidence( in ); 2212 cal->addIncidence( in );
2213 incidence = delSel.next(); 2213 incidence = delSel.next();
2214 } 2214 }
2215 if ( beamDialog->beamVcal() ) { 2215 if ( beamDialog->beamVcal() ) {
2216 fn += ".vcs"; 2216 fn += ".vcs";
2217 FileStorage storage( cal, fn, new VCalFormat ); 2217 FileStorage storage( cal, fn, new VCalFormat );
2218 storage.save(); 2218 storage.save();
2219 } else { 2219 } else {
2220 fn += ".ics"; 2220 fn += ".ics";
2221 FileStorage storage( cal, fn, new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); 2221 FileStorage storage( cal, fn, new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
2222 storage.save(); 2222 storage.save();
2223 } 2223 }
2224 delete cal; 2224 delete cal;
2225 mes = i18n("KO/Pi: Ready for beaming"); 2225 mes = i18n("KO/Pi: Ready for beaming");
2226 setCaption(mes); 2226 setCaption(mes);
2227 2227
2228#ifndef DESKTOP_VERSION 2228#ifndef DESKTOP_VERSION
2229 Ir *ir = new Ir( this ); 2229 Ir *ir = new Ir( this );
2230 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2230 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2231 ir->send( fn, description, "text/x-vCalendar" ); 2231 ir->send( fn, description, "text/x-vCalendar" );
2232#endif 2232#endif
2233 } 2233 }
2234} 2234}
2235void CalendarView::beamDone( Ir *ir ) 2235void CalendarView::beamDone( Ir *ir )
2236{ 2236{
2237#ifndef DESKTOP_VERSION 2237#ifndef DESKTOP_VERSION
2238 delete ir; 2238 delete ir;
2239#endif 2239#endif
2240} 2240}
2241 2241
2242void CalendarView::moveIncidence(Incidence * inc ) 2242void CalendarView::moveIncidence(Incidence * inc )
2243{ 2243{
2244 if ( !inc ) return; 2244 if ( !inc ) return;
2245 // qDebug("showDatePickerForIncidence( ) "); 2245 // qDebug("showDatePickerForIncidence( ) ");
2246 if ( mDateFrame->isVisible() ) 2246 if ( mDateFrame->isVisible() )
2247 mDateFrame->hide(); 2247 mDateFrame->hide();
2248 else { 2248 else {
2249 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; 2249 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
2250 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; 2250 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
2251 int dw = QApplication::desktop()->width(); 2251 int dw = QApplication::desktop()->width();
2252 int dh = QApplication::desktop()->height(); 2252 int dh = QApplication::desktop()->height();
2253 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2253 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2254 mDateFrame->show(); 2254 mDateFrame->show();
2255 } 2255 }
2256 mDatePickerMode = 2; 2256 mDatePickerMode = 2;
2257 mMoveIncidence = inc ; 2257 mMoveIncidence = inc ;
2258 QDate da; 2258 QDate da;
2259 if ( mMoveIncidence->type() == "Todo" ) { 2259 if ( mMoveIncidence->type() == "Todo" ) {
2260 Todo * to = (Todo *) mMoveIncidence; 2260 Todo * to = (Todo *) mMoveIncidence;
2261 if ( to->hasDueDate() ) 2261 if ( to->hasDueDate() )
2262 da = to->dtDue().date(); 2262 da = to->dtDue().date();
2263 else 2263 else
2264 da = QDate::currentDate(); 2264 da = QDate::currentDate();
2265 } else { 2265 } else {
2266 da = mMoveIncidence->dtStart().date(); 2266 da = mMoveIncidence->dtStart().date();
2267 } 2267 }
2268 mDatePicker->setDate( da ); 2268 mDatePicker->setDate( da );
2269} 2269}
2270void CalendarView::showDatePicker( ) 2270void CalendarView::showDatePicker( )
2271{ 2271{
2272 //qDebug("CalendarView::showDatePicker( ) "); 2272 //qDebug("CalendarView::showDatePicker( ) ");
2273 if ( mDateFrame->isVisible() ) 2273 if ( mDateFrame->isVisible() )
2274 mDateFrame->hide(); 2274 mDateFrame->hide();
2275 else { 2275 else {
2276 int w =mDatePicker->sizeHint().width() ; 2276 int w =mDatePicker->sizeHint().width() ;
2277 int h = mDatePicker->sizeHint().height() ; 2277 int h = mDatePicker->sizeHint().height() ;
2278 int dw = QApplication::desktop()->width(); 2278 int dw = QApplication::desktop()->width();
2279 int dh = QApplication::desktop()->height(); 2279 int dh = QApplication::desktop()->height();
2280 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2280 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2281 mDateFrame->show(); 2281 mDateFrame->show();
2282 } 2282 }
2283 mDatePickerMode = 1; 2283 mDatePickerMode = 1;
2284 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2284 mDatePicker->setDate( mNavigator->selectedDates().first() );
2285} 2285}
2286 2286
2287void CalendarView::showEventEditor() 2287void CalendarView::showEventEditor()
2288{ 2288{
2289#ifdef DESKTOP_VERSION 2289#ifdef DESKTOP_VERSION
2290 mEventEditor->show(); 2290 mEventEditor->show();
2291#else 2291#else
2292 mEventEditor->showMaximized(); 2292 mEventEditor->showMaximized();
2293#endif 2293#endif
2294} 2294}
2295void CalendarView::showTodoEditor() 2295void CalendarView::showTodoEditor()
2296{ 2296{
2297#ifdef DESKTOP_VERSION 2297#ifdef DESKTOP_VERSION
2298 mTodoEditor->show(); 2298 mTodoEditor->show();
2299#else 2299#else
2300 mTodoEditor->showMaximized(); 2300 mTodoEditor->showMaximized();
2301#endif 2301#endif
2302} 2302}
2303void CalendarView::cancelIncidence(Incidence * inc ) 2303void CalendarView::cancelIncidence(Incidence * inc )
2304{ 2304{
2305 inc->setCancelled( ! inc->cancelled() ); 2305 inc->setCancelled( ! inc->cancelled() );
2306 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 2306 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
2307 updateView(); 2307 updateView();
2308} 2308}
2309void CalendarView::cloneIncidence(Incidence * orgInc ) 2309void CalendarView::cloneIncidence(Incidence * orgInc )
2310{ 2310{
2311 Incidence * newInc = orgInc->clone(); 2311 Incidence * newInc = orgInc->clone();
2312 newInc->recreate(); 2312 newInc->recreate();
2313 2313
2314 if ( newInc->type() == "Todo" ) { 2314 if ( newInc->type() == "Todo" ) {
2315 Todo* t = (Todo*) newInc; 2315 Todo* t = (Todo*) newInc;
2316 mTodoEditor->editTodo( t ); 2316 mTodoEditor->editTodo( t );
2317 showTodoEditor(); 2317 showTodoEditor();
2318 if ( mTodoEditor->exec() ) { 2318 if ( mTodoEditor->exec() ) {
2319 mCalendar->addTodo( t ); 2319 mCalendar->addTodo( t );
2320 updateView(); 2320 updateView();
2321 } else { 2321 } else {
2322 delete t; 2322 delete t;
2323 } 2323 }
2324 } 2324 }
2325 else { 2325 else {
2326 Event* e = (Event*) newInc; 2326 Event* e = (Event*) newInc;
2327 mEventEditor->editEvent( e ); 2327 mEventEditor->editEvent( e );
2328 showEventEditor(); 2328 showEventEditor();
2329 if ( mEventEditor->exec() ) { 2329 if ( mEventEditor->exec() ) {
2330 mCalendar->addEvent( e ); 2330 mCalendar->addEvent( e );
2331 updateView(); 2331 updateView();
2332 } else { 2332 } else {
2333 delete e; 2333 delete e;
2334 } 2334 }
2335 } 2335 }
2336} 2336}
2337 2337
2338void CalendarView::newEvent() 2338void CalendarView::newEvent()
2339{ 2339{
2340 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 2340 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
2341 KOAgendaView *aView = mViewManager->agendaView(); 2341 KOAgendaView *aView = mViewManager->agendaView();
2342 if (aView) { 2342 if (aView) {
2343 if (aView->selectionStart().isValid()) { 2343 if (aView->selectionStart().isValid()) {
2344 if (aView->selectedIsAllDay()) { 2344 if (aView->selectedIsAllDay()) {
2345 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 2345 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
2346 } else { 2346 } else {
2347 newEvent(aView->selectionStart(),aView->selectionEnd()); 2347 newEvent(aView->selectionStart(),aView->selectionEnd());
2348 } 2348 }
2349 return; 2349 return;
2350 } 2350 }
2351 } 2351 }
2352 2352
2353 QDate date = mNavigator->selectedDates().first(); 2353 QDate date = mNavigator->selectedDates().first();
2354 QDateTime current = QDateTime::currentDateTime(); 2354 QDateTime current = QDateTime::currentDateTime();
2355 if ( date <= current.date() ) { 2355 if ( date <= current.date() ) {
2356 int hour = current.time().hour() +1; 2356 int hour = current.time().hour() +1;
2357 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 2357 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
2358 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2358 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2359 } else 2359 } else
2360 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 2360 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
2361 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 2361 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
2362 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2362 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2363} 2363}
2364 2364
2365void CalendarView::newEvent(QDateTime fh) 2365void CalendarView::newEvent(QDateTime fh)
2366{ 2366{
2367 newEvent(fh, 2367 newEvent(fh,
2368 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 2368 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
2369} 2369}
2370 2370
2371void CalendarView::newEvent(QDate dt) 2371void CalendarView::newEvent(QDate dt)
2372{ 2372{
2373 newEvent(QDateTime(dt, QTime(0,0,0)), 2373 newEvent(QDateTime(dt, QTime(0,0,0)),
2374 QDateTime(dt, QTime(0,0,0)), true); 2374 QDateTime(dt, QTime(0,0,0)), true);
2375} 2375}
2376 2376
2377void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 2377void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
2378{ 2378{
2379 2379
2380 mEventEditor->newEvent(fromHint,toHint,allDay); 2380 mEventEditor->newEvent(fromHint,toHint,allDay);
2381 if ( mFilterView->filtersEnabled() ) { 2381 if ( mFilterView->filtersEnabled() ) {
2382 CalFilter *filter = mFilterView->selectedFilter(); 2382 CalFilter *filter = mFilterView->selectedFilter();
2383 if (filter && filter->showCategories()) { 2383 if (filter && filter->showCategories()) {
2384 mEventEditor->setCategories(filter->categoryList().join(",") ); 2384 mEventEditor->setCategories(filter->categoryList().join(",") );
2385 } 2385 }
2386 if ( filter ) 2386 if ( filter )
2387 mEventEditor->setSecrecy( filter->getSecrecy() ); 2387 mEventEditor->setSecrecy( filter->getSecrecy() );
2388 } 2388 }
2389 showEventEditor(); 2389 showEventEditor();
2390} 2390}
2391void CalendarView::todoAdded(Todo * t) 2391void CalendarView::todoAdded(Todo * t)
2392{ 2392{
2393 2393
2394 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 2394 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
2395 updateTodoViews(); 2395 updateTodoViews();
2396} 2396}
2397void CalendarView::todoChanged(Todo * t) 2397void CalendarView::todoChanged(Todo * t)
2398{ 2398{
2399 emit todoModified( t, 4 ); 2399 emit todoModified( t, 4 );
2400 // updateTodoViews(); 2400 // updateTodoViews();
2401} 2401}
2402void CalendarView::todoToBeDeleted(Todo *) 2402void CalendarView::todoToBeDeleted(Todo *)
2403{ 2403{
2404 //qDebug("todoToBeDeleted(Todo *) "); 2404 //qDebug("todoToBeDeleted(Todo *) ");
2405 updateTodoViews(); 2405 updateTodoViews();
2406} 2406}
2407void CalendarView::todoDeleted() 2407void CalendarView::todoDeleted()
2408{ 2408{
2409 //qDebug(" todoDeleted()"); 2409 //qDebug(" todoDeleted()");
2410 updateTodoViews(); 2410 updateTodoViews();
2411} 2411}
2412 2412
2413 2413
2414 2414
2415void CalendarView::newTodo() 2415void CalendarView::newTodo()
2416{ 2416{
2417 2417
2418 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); 2418 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true);
2419 if ( mFilterView->filtersEnabled() ) { 2419 if ( mFilterView->filtersEnabled() ) {
2420 CalFilter *filter = mFilterView->selectedFilter(); 2420 CalFilter *filter = mFilterView->selectedFilter();
2421 if (filter && filter->showCategories()) { 2421 if (filter && filter->showCategories()) {
2422 mTodoEditor->setCategories(filter->categoryList().join(",") ); 2422 mTodoEditor->setCategories(filter->categoryList().join(",") );
2423 } 2423 }
2424 if ( filter ) 2424 if ( filter )
2425 mTodoEditor->setSecrecy( filter->getSecrecy() ); 2425 mTodoEditor->setSecrecy( filter->getSecrecy() );
2426 } 2426 }
2427 showTodoEditor(); 2427 showTodoEditor();
2428} 2428}
2429 2429
2430void CalendarView::newSubTodo() 2430void CalendarView::newSubTodo()
2431{ 2431{
2432 Todo *todo = selectedTodo(); 2432 Todo *todo = selectedTodo();
2433 if ( todo ) newSubTodo( todo ); 2433 if ( todo ) newSubTodo( todo );
2434} 2434}
2435 2435
2436void CalendarView::newSubTodo(Todo *parentEvent) 2436void CalendarView::newSubTodo(Todo *parentEvent)
2437{ 2437{
2438 2438
2439 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); 2439 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
2440 showTodoEditor(); 2440 showTodoEditor();
2441} 2441}
2442 2442
2443void CalendarView::newFloatingEvent() 2443void CalendarView::newFloatingEvent()
2444{ 2444{
2445 DateList tmpList = mNavigator->selectedDates(); 2445 DateList tmpList = mNavigator->selectedDates();
2446 QDate date = tmpList.first(); 2446 QDate date = tmpList.first();
2447 2447
2448 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 2448 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
2449 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 2449 QDateTime( date, QTime( 12, 0, 0 ) ), true );
2450} 2450}
2451 2451
2452 2452
2453void CalendarView::editEvent( Event *event ) 2453void CalendarView::editEvent( Event *event )
2454{ 2454{
2455 2455
2456 if ( !event ) return; 2456 if ( !event ) return;
2457 if ( event->isReadOnly() ) { 2457 if ( event->isReadOnly() ) {
2458 showEvent( event ); 2458 showEvent( event );
2459 return; 2459 return;
2460 } 2460 }
2461 mEventEditor->editEvent( event , mFlagEditDescription); 2461 mEventEditor->editEvent( event , mFlagEditDescription);
2462 showEventEditor(); 2462 showEventEditor();
2463} 2463}
2464void CalendarView::editJournal( Journal *jour ) 2464void CalendarView::editJournal( Journal *jour )
2465{ 2465{
2466 if ( !jour ) return; 2466 if ( !jour ) return;
2467 mDialogManager->hideSearchDialog(); 2467 mDialogManager->hideSearchDialog();
2468 mViewManager->showJournalView(); 2468 mViewManager->showJournalView();
2469 mNavigator->slotDaySelect( jour->dtStart().date() ); 2469 mNavigator->slotDaySelect( jour->dtStart().date() );
2470} 2470}
2471void CalendarView::editTodo( Todo *todo ) 2471void CalendarView::editTodo( Todo *todo )
2472{ 2472{
2473 if ( !todo ) return; 2473 if ( !todo ) return;
2474 2474
2475 if ( todo->isReadOnly() ) { 2475 if ( todo->isReadOnly() ) {
2476 showTodo( todo ); 2476 showTodo( todo );
2477 return; 2477 return;
2478 } 2478 }
2479 mTodoEditor->editTodo( todo ,mFlagEditDescription); 2479 mTodoEditor->editTodo( todo ,mFlagEditDescription);
2480 showTodoEditor(); 2480 showTodoEditor();
2481 2481
2482} 2482}
2483 2483
2484KOEventViewerDialog* CalendarView::getEventViewerDialog() 2484KOEventViewerDialog* CalendarView::getEventViewerDialog()
2485{ 2485{
2486 if ( !mEventViewerDialog ) { 2486 if ( !mEventViewerDialog ) {
2487 mEventViewerDialog = new KOEventViewerDialog(this); 2487 mEventViewerDialog = new KOEventViewerDialog(this);
2488 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 2488 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
2489 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 2489 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
2490 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 2490 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
2491 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 2491 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
2492 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 2492 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
2493 viewManager(), SLOT( showAgendaView( bool ) ) ); 2493 viewManager(), SLOT( showAgendaView( bool ) ) );
2494 mEventViewerDialog->resize( 640, 480 ); 2494 mEventViewerDialog->resize( 640, 480 );
2495 2495
2496 } 2496 }
2497 return mEventViewerDialog; 2497 return mEventViewerDialog;
2498} 2498}
2499void CalendarView::showEvent(Event *event) 2499void CalendarView::showEvent(Event *event)
2500{ 2500{
2501 getEventViewerDialog()->setEvent(event); 2501 getEventViewerDialog()->setEvent(event);
2502 getEventViewerDialog()->showMe(); 2502 getEventViewerDialog()->showMe();
2503} 2503}
2504 2504
2505void CalendarView::showTodo(Todo *event) 2505void CalendarView::showTodo(Todo *event)
2506{ 2506{
2507 getEventViewerDialog()->setTodo(event); 2507 getEventViewerDialog()->setTodo(event);
2508 getEventViewerDialog()->showMe(); 2508 getEventViewerDialog()->showMe();
2509} 2509}
2510void CalendarView::showJournal( Journal *jour ) 2510void CalendarView::showJournal( Journal *jour )
2511{ 2511{
2512 getEventViewerDialog()->setJournal(jour); 2512 getEventViewerDialog()->setJournal(jour);
2513 getEventViewerDialog()->showMe(); 2513 getEventViewerDialog()->showMe();
2514 2514
2515} 2515}
2516// void CalendarView::todoModified (Todo *event, int changed) 2516// void CalendarView::todoModified (Todo *event, int changed)
2517// { 2517// {
2518// // if (mDialogList.find (event) != mDialogList.end ()) { 2518// // if (mDialogList.find (event) != mDialogList.end ()) {
2519// // kdDebug() << "Todo modified and open" << endl; 2519// // kdDebug() << "Todo modified and open" << endl;
2520// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 2520// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
2521// // temp->modified (changed); 2521// // temp->modified (changed);
2522 2522
2523// // } 2523// // }
2524 2524
2525// mViewManager->updateView(); 2525// mViewManager->updateView();
2526// } 2526// }
2527 2527
2528void CalendarView::appointment_show() 2528void CalendarView::appointment_show()
2529{ 2529{
2530 Event *anEvent = 0; 2530 Event *anEvent = 0;
2531 2531
2532 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2532 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2533 2533
2534 if (mViewManager->currentView()->isEventView()) { 2534 if (mViewManager->currentView()->isEventView()) {
2535 if ( incidence && incidence->type() == "Event" ) { 2535 if ( incidence && incidence->type() == "Event" ) {
2536 anEvent = static_cast<Event *>(incidence); 2536 anEvent = static_cast<Event *>(incidence);
2537 } 2537 }
2538 } 2538 }
2539 2539
2540 if (!anEvent) { 2540 if (!anEvent) {
2541 KNotifyClient::beep(); 2541 KNotifyClient::beep();
2542 return; 2542 return;
2543 } 2543 }
2544 2544
2545 showEvent(anEvent); 2545 showEvent(anEvent);
2546} 2546}
2547 2547
2548void CalendarView::appointment_edit() 2548void CalendarView::appointment_edit()
2549{ 2549{
2550 Event *anEvent = 0; 2550 Event *anEvent = 0;
2551 2551
2552 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2552 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2553 2553
2554 if (mViewManager->currentView()->isEventView()) { 2554 if (mViewManager->currentView()->isEventView()) {
2555 if ( incidence && incidence->type() == "Event" ) { 2555 if ( incidence && incidence->type() == "Event" ) {
2556 anEvent = static_cast<Event *>(incidence); 2556 anEvent = static_cast<Event *>(incidence);
2557 } 2557 }
2558 } 2558 }
2559 2559
2560 if (!anEvent) { 2560 if (!anEvent) {
2561 KNotifyClient::beep(); 2561 KNotifyClient::beep();
2562 return; 2562 return;
2563 } 2563 }
2564 2564
2565 editEvent(anEvent); 2565 editEvent(anEvent);
2566} 2566}
2567 2567
2568void CalendarView::appointment_delete() 2568void CalendarView::appointment_delete()
2569{ 2569{
2570 Event *anEvent = 0; 2570 Event *anEvent = 0;
2571 2571
2572 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2572 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2573 2573
2574 if (mViewManager->currentView()->isEventView()) { 2574 if (mViewManager->currentView()->isEventView()) {
2575 if ( incidence && incidence->type() == "Event" ) { 2575 if ( incidence && incidence->type() == "Event" ) {
2576 anEvent = static_cast<Event *>(incidence); 2576 anEvent = static_cast<Event *>(incidence);
2577 } 2577 }
2578 } 2578 }
2579 2579
2580 if (!anEvent) { 2580 if (!anEvent) {
2581 KNotifyClient::beep(); 2581 KNotifyClient::beep();
2582 return; 2582 return;
2583 } 2583 }
2584 2584
2585 deleteEvent(anEvent); 2585 deleteEvent(anEvent);
2586} 2586}
2587 2587
2588void CalendarView::todo_unsub(Todo *anTodo ) 2588void CalendarView::todo_unsub(Todo *anTodo )
2589{ 2589{
2590 // Todo *anTodo = selectedTodo(); 2590 // Todo *anTodo = selectedTodo();
2591 if (!anTodo) return; 2591 if (!anTodo) return;
2592 if (!anTodo->relatedTo()) return; 2592 if (!anTodo->relatedTo()) return;
2593 anTodo->relatedTo()->removeRelation(anTodo); 2593 anTodo->relatedTo()->removeRelation(anTodo);
2594 anTodo->setRelatedTo(0); 2594 anTodo->setRelatedTo(0);
2595 anTodo->updated(); 2595 anTodo->updated();
2596 anTodo->setRelatedToUid(""); 2596 anTodo->setRelatedToUid("");
2597 setModified(true); 2597 setModified(true);
2598 updateView(); 2598 updateView();
2599} 2599}
2600 2600
2601void CalendarView::deleteTodo(Todo *todo) 2601void CalendarView::deleteTodo(Todo *todo)
2602{ 2602{
2603 if (!todo) { 2603 if (!todo) {
2604 KNotifyClient::beep(); 2604 KNotifyClient::beep();
2605 return; 2605 return;
2606 } 2606 }
2607 if (KOPrefs::instance()->mConfirm) { 2607 if (KOPrefs::instance()->mConfirm) {
2608 switch (msgItemDelete()) { 2608 switch (msgItemDelete()) {
2609 case KMessageBox::Continue: // OK 2609 case KMessageBox::Continue: // OK
2610 if (!todo->relations().isEmpty()) { 2610 if (!todo->relations().isEmpty()) {
2611 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2611 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2612 i18n("Delete To-Do")); 2612 i18n("Delete To-Do"));
2613 } else { 2613 } else {
2614 checkExternalId( todo ); 2614 checkExternalId( todo );
2615 calendar()->deleteTodo(todo); 2615 calendar()->deleteTodo(todo);
2616 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2616 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2617 updateView(); 2617 updateView();
2618 } 2618 }
2619 break; 2619 break;
2620 } // switch 2620 } // switch
2621 } else { 2621 } else {
2622 if (!todo->relations().isEmpty()) { 2622 if (!todo->relations().isEmpty()) {
2623 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2623 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2624 i18n("Delete To-Do")); 2624 i18n("Delete To-Do"));
2625 } else { 2625 } else {
2626 checkExternalId( todo ); 2626 checkExternalId( todo );
2627 mCalendar->deleteTodo(todo); 2627 mCalendar->deleteTodo(todo);
2628 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2628 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2629 updateView(); 2629 updateView();
2630 } 2630 }
2631 } 2631 }
2632 emit updateSearchDialog(); 2632 emit updateSearchDialog();
2633} 2633}
2634void CalendarView::deleteJournal(Journal *jour) 2634void CalendarView::deleteJournal(Journal *jour)
2635{ 2635{
2636 if (!jour) { 2636 if (!jour) {
2637 KNotifyClient::beep(); 2637 KNotifyClient::beep();
2638 return; 2638 return;
2639 } 2639 }
2640 if (KOPrefs::instance()->mConfirm) { 2640 if (KOPrefs::instance()->mConfirm) {
2641 switch (msgItemDelete()) { 2641 switch (msgItemDelete()) {
2642 case KMessageBox::Continue: // OK 2642 case KMessageBox::Continue: // OK
2643 calendar()->deleteJournal(jour); 2643 calendar()->deleteJournal(jour);
2644 updateView(); 2644 updateView();
2645 break; 2645 break;
2646 } // switch 2646 } // switch
diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro
index 9fdcd2f..543db86 100644
--- a/korganizer/korganizer.pro
+++ b/korganizer/korganizer.pro
@@ -1,193 +1,192 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on 2 CONFIG = qt warn_on
3 TARGET = kopi 3 TARGET = kopi
4OBJECTS_DIR = _obj/ 4OBJECTS_DIR = _obj/
5MOC_DIR = _moc 5MOC_DIR = _moc
6DESTDIR= ../bin 6DESTDIR= ../bin
7 7
8include( ../variables.pri ) 8include( ../variables.pri )
9 9
10INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim 10INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim
11#../qtcompat 11#../qtcompat
12DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL 12DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL
13DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER 13DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
14#KORG_NOPRINTER KORG_NOKABC 14#KORG_NOPRINTER KORG_NOKABC
15DEFINES += KORG_NOLVALTERNATION 15DEFINES += KORG_NOLVALTERNATION
16DEFINES += DESKTOP_VERSION 16DEFINES += DESKTOP_VERSION
17unix : { 17unix : {
18LIBS += ../bin/libmicrokdepim.so 18LIBS += ../bin/libmicrokdepim.so
19LIBS += ../bin/libmicrokcal.so 19LIBS += ../bin/libmicrokcal.so
20LIBS += ../bin/libmicrokde.so 20LIBS += ../bin/libmicrokde.so
21LIBS += ../bin/libmicrokabc.so 21LIBS += ../bin/libmicrokabc.so
22LIBS += ../bin/libmicrogammu.so
23LIBS += -lbluetooth 22LIBS += -lbluetooth
24LIBS += -lsdp 23LIBS += -lsdp
25 24
26LIBS += -lldap 25LIBS += -lldap
27OBJECTS_DIR = obj/unix 26OBJECTS_DIR = obj/unix
28MOC_DIR = moc/unix 27MOC_DIR = moc/unix
29} 28}
30win32: { 29win32: {
31DEFINES += _WIN32_ 30DEFINES += _WIN32_
32LIBS += ../bin/microkdepim.lib 31LIBS += ../bin/microkdepim.lib
33LIBS += ../bin/microkcal.lib 32LIBS += ../bin/microkcal.lib
34LIBS += ../bin/microkde.lib 33LIBS += ../bin/microkde.lib
35LIBS += ../bin/microkabc.lib 34LIBS += ../bin/microkabc.lib
36LIBS += ../libical/lib/ical.lib 35LIBS += ../libical/lib/ical.lib
37LIBS += ../libical/lib/icalss.lib 36LIBS += ../libical/lib/icalss.lib
38#LIBS += atls.lib 37#LIBS += atls.lib
39LIBS += mfc71u.lib 38LIBS += mfc71u.lib
40QMAKE_LINK += /NODEFAULTLIB:LIBC 39QMAKE_LINK += /NODEFAULTLIB:LIBC
41#QMAKE_LINK += /NODEFAULTLIB:MSVCRT 40#QMAKE_LINK += /NODEFAULTLIB:MSVCRT
42#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib 41#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib
43OBJECTS_DIR = obj/win 42OBJECTS_DIR = obj/win
44MOC_DIR = moc/win 43MOC_DIR = moc/win
45} 44}
46 45
47 46
48INTERFACES = kofilterview_base.ui 47INTERFACES = kofilterview_base.ui
49# filteredit_base.ui 48# filteredit_base.ui
50 49
51# kdateedit.h \ 50# kdateedit.h \
52 51
53HEADERS = \ 52HEADERS = \
54 filteredit_base.h \ 53 filteredit_base.h \
55 alarmclient.h \ 54 alarmclient.h \
56 calendarview.h \ 55 calendarview.h \
57 customlistviewitem.h \ 56 customlistviewitem.h \
58 datenavigator.h \ 57 datenavigator.h \
59 docprefs.h \ 58 docprefs.h \
60 filtereditdialog.h \ 59 filtereditdialog.h \
61 incomingdialog.h \ 60 incomingdialog.h \
62 incomingdialog_base.h \ 61 incomingdialog_base.h \
63 interfaces/korganizer/baseview.h \ 62 interfaces/korganizer/baseview.h \
64 interfaces/korganizer/calendarviewbase.h \ 63 interfaces/korganizer/calendarviewbase.h \
65 journalentry.h \ 64 journalentry.h \
66 kdatenavigator.h \ 65 kdatenavigator.h \
67 koagenda.h \ 66 koagenda.h \
68 koagendaitem.h \ 67 koagendaitem.h \
69 koagendaview.h \ 68 koagendaview.h \
70 kocounterdialog.h \ 69 kocounterdialog.h \
71 kodaymatrix.h \ 70 kodaymatrix.h \
72 kodialogmanager.h \ 71 kodialogmanager.h \
73 koeditordetails.h \ 72 koeditordetails.h \
74 koeditorgeneral.h \ 73 koeditorgeneral.h \
75 koeditorgeneralevent.h \ 74 koeditorgeneralevent.h \
76 koeditorgeneraltodo.h \ 75 koeditorgeneraltodo.h \
77 koeditorrecurrence.h \ 76 koeditorrecurrence.h \
78 koeventeditor.h \ 77 koeventeditor.h \
79 koeventpopupmenu.h \ 78 koeventpopupmenu.h \
80 koeventview.h \ 79 koeventview.h \
81 koeventviewer.h \ 80 koeventviewer.h \
82 koeventviewerdialog.h \ 81 koeventviewerdialog.h \
83 kofilterview.h \ 82 kofilterview.h \
84 koglobals.h \ 83 koglobals.h \
85 koincidenceeditor.h \ 84 koincidenceeditor.h \
86 kojournalview.h \ 85 kojournalview.h \
87 kolistview.h \ 86 kolistview.h \
88 kolocationbox.h \ 87 kolocationbox.h \
89 komonthview.h \ 88 komonthview.h \
90 koprefs.h \ 89 koprefs.h \
91 koprefsdialog.h \ 90 koprefsdialog.h \
92 kotimespanview.h \ 91 kotimespanview.h \
93 kotodoeditor.h \ 92 kotodoeditor.h \
94 kotodoview.h \ 93 kotodoview.h \
95 kotodoviewitem.h \ 94 kotodoviewitem.h \
96 koviewmanager.h \ 95 koviewmanager.h \
97 kowhatsnextview.h \ 96 kowhatsnextview.h \
98 ktimeedit.h \ 97 ktimeedit.h \
99 lineview.h \ 98 lineview.h \
100 mainwindow.h \ 99 mainwindow.h \
101 navigatorbar.h \ 100 navigatorbar.h \
102 outgoingdialog.h \ 101 outgoingdialog.h \
103 outgoingdialog_base.h \ 102 outgoingdialog_base.h \
104 publishdialog.h \ 103 publishdialog.h \
105 publishdialog_base.h \ 104 publishdialog_base.h \
106 savetemplatedialog.h \ 105 savetemplatedialog.h \
107 searchdialog.h \ 106 searchdialog.h \
108 simplealarmclient.h \ 107 simplealarmclient.h \
109 statusdialog.h \ 108 statusdialog.h \
110 timeline.h \ 109 timeline.h \
111 timespanview.h \ 110 timespanview.h \
112 version.h \ 111 version.h \
113 ../kalarmd/alarmdialog.h \ 112 ../kalarmd/alarmdialog.h \
114 113
115 114
116SOURCES = \ 115SOURCES = \
117filteredit_base.cpp \ 116filteredit_base.cpp \
118 calendarview.cpp \ 117 calendarview.cpp \
119 datenavigator.cpp \ 118 datenavigator.cpp \
120 docprefs.cpp \ 119 docprefs.cpp \
121 filtereditdialog.cpp \ 120 filtereditdialog.cpp \
122 incomingdialog.cpp \ 121 incomingdialog.cpp \
123 incomingdialog_base.cpp \ 122 incomingdialog_base.cpp \
124 journalentry.cpp \ 123 journalentry.cpp \
125 kdatenavigator.cpp \ 124 kdatenavigator.cpp \
126 koagenda.cpp \ 125 koagenda.cpp \
127 koagendaitem.cpp \ 126 koagendaitem.cpp \
128 koagendaview.cpp \ 127 koagendaview.cpp \
129 kocounterdialog.cpp \ 128 kocounterdialog.cpp \
130 kodaymatrix.cpp \ 129 kodaymatrix.cpp \
131 kodialogmanager.cpp \ 130 kodialogmanager.cpp \
132 koeditordetails.cpp \ 131 koeditordetails.cpp \
133 koeditorgeneral.cpp \ 132 koeditorgeneral.cpp \
134 koeditorgeneralevent.cpp \ 133 koeditorgeneralevent.cpp \
135 koeditorgeneraltodo.cpp \ 134 koeditorgeneraltodo.cpp \
136 koeditorrecurrence.cpp \ 135 koeditorrecurrence.cpp \
137 koeventeditor.cpp \ 136 koeventeditor.cpp \
138 koeventpopupmenu.cpp \ 137 koeventpopupmenu.cpp \
139 koeventview.cpp \ 138 koeventview.cpp \
140 koeventviewer.cpp \ 139 koeventviewer.cpp \
141 koeventviewerdialog.cpp \ 140 koeventviewerdialog.cpp \
142 kofilterview.cpp \ 141 kofilterview.cpp \
143 koglobals.cpp \ 142 koglobals.cpp \
144 koincidenceeditor.cpp \ 143 koincidenceeditor.cpp \
145 kojournalview.cpp \ 144 kojournalview.cpp \
146 kolistview.cpp \ 145 kolistview.cpp \
147 kolocationbox.cpp \ 146 kolocationbox.cpp \
148 komonthview.cpp \ 147 komonthview.cpp \
149 koprefs.cpp \ 148 koprefs.cpp \
150 koprefsdialog.cpp \ 149 koprefsdialog.cpp \
151 kotimespanview.cpp \ 150 kotimespanview.cpp \
152 kotodoeditor.cpp \ 151 kotodoeditor.cpp \
153 kotodoview.cpp \ 152 kotodoview.cpp \
154 kotodoviewitem.cpp \ 153 kotodoviewitem.cpp \
155 koviewmanager.cpp \ 154 koviewmanager.cpp \
156 kowhatsnextview.cpp \ 155 kowhatsnextview.cpp \
157 ktimeedit.cpp \ 156 ktimeedit.cpp \
158 lineview.cpp \ 157 lineview.cpp \
159 main.cpp \ 158 main.cpp \
160 mainwindow.cpp \ 159 mainwindow.cpp \
161 navigatorbar.cpp \ 160 navigatorbar.cpp \
162 outgoingdialog.cpp \ 161 outgoingdialog.cpp \
163 outgoingdialog_base.cpp \ 162 outgoingdialog_base.cpp \
164 publishdialog.cpp \ 163 publishdialog.cpp \
165 publishdialog_base.cpp \ 164 publishdialog_base.cpp \
166 savetemplatedialog.cpp \ 165 savetemplatedialog.cpp \
167 searchdialog.cpp \ 166 searchdialog.cpp \
168 simplealarmclient.cpp \ 167 simplealarmclient.cpp \
169 statusdialog.cpp \ 168 statusdialog.cpp \
170 timeline.cpp \ 169 timeline.cpp \
171 timespanview.cpp \ 170 timespanview.cpp \
172 ../kalarmd/alarmdialog.cpp 171 ../kalarmd/alarmdialog.cpp
173 172
174HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h 173HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h
175INTERFACES += calprintdayconfig_base.ui \ 174INTERFACES += calprintdayconfig_base.ui \
176 calprintmonthconfig_base.ui \ 175 calprintmonthconfig_base.ui \
177 calprinttodoconfig_base.ui \ 176 calprinttodoconfig_base.ui \
178 calprintweekconfig_base.ui 177 calprintweekconfig_base.ui
179SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp 178SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp
180 179
181 180
182 181
183win32: { 182win32: {
184HEADERS += ../outport/msoutl9.h \ 183HEADERS += ../outport/msoutl9.h \
185 koimportoldialog.h 184 koimportoldialog.h
186 185
187 186
188SOURCES += ../outport/msoutl9.cpp \ 187SOURCES += ../outport/msoutl9.cpp \
189 koimportoldialog.cpp 188 koimportoldialog.cpp
190 189
191 190
192} 191}
193 192