summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2004-10-28 11:03:42 (UTC)
committer zautrix <zautrix>2004-10-28 11:03:42 (UTC)
commit01cd4ef94b8604532181c390e9abd560aebaf372 (patch) (unidiff)
tree96ca1a524512ae2e2868f0bd3df03e4da5c445f9 /korganizer
parent61d9eb436349a841410559f51e2601a34ceb5794 (diff)
downloadkdepimpi-01cd4ef94b8604532181c390e9abd560aebaf372.zip
kdepimpi-01cd4ef94b8604532181c390e9abd560aebaf372.tar.gz
kdepimpi-01cd4ef94b8604532181c390e9abd560aebaf372.tar.bz2
added howto to menus
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp12
-rw-r--r--korganizer/mainwindow.cpp48
-rw-r--r--korganizer/mainwindow.h2
3 files changed, 42 insertions, 20 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 6e61351..4667918 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1101,310 +1101,316 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1101 if ( uid.left(15) == QString("last-syncEvent-") ) 1101 if ( uid.left(15) == QString("last-syncEvent-") )
1102 skipIncidence = true; 1102 skipIncidence = true;
1103 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) 1103 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" )
1104 skipIncidence = true; 1104 skipIncidence = true;
1105 if ( !skipIncidence ) { 1105 if ( !skipIncidence ) {
1106 inR = remote->incidence( uid ); 1106 inR = remote->incidence( uid );
1107 if ( ! inR ) { 1107 if ( ! inR ) {
1108 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1108 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1109 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1109 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1110 checkExternSyncEvent(eventLSyncSharp, inL); 1110 checkExternSyncEvent(eventLSyncSharp, inL);
1111 local->deleteIncidence( inL ); 1111 local->deleteIncidence( inL );
1112 ++deletedEventL; 1112 ++deletedEventL;
1113 } else { 1113 } else {
1114 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1114 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1115 inL->removeID(mCurrentSyncDevice ); 1115 inL->removeID(mCurrentSyncDevice );
1116 ++addedEventR; 1116 ++addedEventR;
1117 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1117 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1118 inL->setLastModified( modifiedCalendar ); 1118 inL->setLastModified( modifiedCalendar );
1119 inR = inL->clone(); 1119 inR = inL->clone();
1120 inR->setIDStr( ":" ); 1120 inR->setIDStr( ":" );
1121 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1121 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1122 remote->addIncidence( inR ); 1122 remote->addIncidence( inR );
1123 } 1123 }
1124 } 1124 }
1125 } else { 1125 } else {
1126 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1126 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1127 checkExternSyncEvent(eventLSyncSharp, inL); 1127 checkExternSyncEvent(eventLSyncSharp, inL);
1128 local->deleteIncidence( inL ); 1128 local->deleteIncidence( inL );
1129 ++deletedEventL; 1129 ++deletedEventL;
1130 } else { 1130 } else {
1131 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1131 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1132 ++addedEventR; 1132 ++addedEventR;
1133 inL->setLastModified( modifiedCalendar ); 1133 inL->setLastModified( modifiedCalendar );
1134 inR = inL->clone(); 1134 inR = inL->clone();
1135 inR->setIDStr( ":" ); 1135 inR->setIDStr( ":" );
1136 remote->addIncidence( inR ); 1136 remote->addIncidence( inR );
1137 } 1137 }
1138 } 1138 }
1139 } 1139 }
1140 } 1140 }
1141 } 1141 }
1142 inL = el.next(); 1142 inL = el.next();
1143 } 1143 }
1144 int delFut = 0; 1144 int delFut = 0;
1145 int remRem = 0; 1145 int remRem = 0;
1146 if ( mSyncManager->mWriteBackInFuture ) { 1146 if ( mSyncManager->mWriteBackInFuture ) {
1147 er = remote->rawIncidences(); 1147 er = remote->rawIncidences();
1148 remRem = er.count(); 1148 remRem = er.count();
1149 inR = er.first(); 1149 inR = er.first();
1150 QDateTime dt; 1150 QDateTime dt;
1151 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1151 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1152 QDateTime end = cur.addDays( (mSyncManager->mWriteBackInFuture +1 ) *7 ); 1152 QDateTime end = cur.addDays( (mSyncManager->mWriteBackInFuture +1 ) *7 );
1153 while ( inR ) { 1153 while ( inR ) {
1154 if ( inR->type() == "Todo" ) { 1154 if ( inR->type() == "Todo" ) {
1155 Todo * t = (Todo*)inR; 1155 Todo * t = (Todo*)inR;
1156 if ( t->hasDueDate() ) 1156 if ( t->hasDueDate() )
1157 dt = t->dtDue(); 1157 dt = t->dtDue();
1158 else 1158 else
1159 dt = cur.addSecs( 62 ); 1159 dt = cur.addSecs( 62 );
1160 } 1160 }
1161 else if (inR->type() == "Event" ) { 1161 else if (inR->type() == "Event" ) {
1162 bool ok; 1162 bool ok;
1163 dt = inR->getNextOccurence( cur, &ok ); 1163 dt = inR->getNextOccurence( cur, &ok );
1164 if ( !ok ) 1164 if ( !ok )
1165 dt = cur.addSecs( -62 ); 1165 dt = cur.addSecs( -62 );
1166 } 1166 }
1167 else 1167 else
1168 dt = inR->dtStart(); 1168 dt = inR->dtStart();
1169 if ( dt < cur || dt > end ) { 1169 if ( dt < cur || dt > end ) {
1170 remote->deleteIncidence( inR ); 1170 remote->deleteIncidence( inR );
1171 ++delFut; 1171 ++delFut;
1172 } 1172 }
1173 inR = er.next(); 1173 inR = er.next();
1174 } 1174 }
1175 } 1175 }
1176 bar.hide(); 1176 bar.hide();
1177 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1177 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1178 eventLSync->setReadOnly( false ); 1178 eventLSync->setReadOnly( false );
1179 eventLSync->setDtStart( mLastCalendarSync ); 1179 eventLSync->setDtStart( mLastCalendarSync );
1180 eventRSync->setDtStart( mLastCalendarSync ); 1180 eventRSync->setDtStart( mLastCalendarSync );
1181 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1181 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1182 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1182 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1183 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1183 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1184 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1184 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1185 eventLSync->setReadOnly( true ); 1185 eventLSync->setReadOnly( true );
1186 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1186 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1187 remote->addEvent( eventRSync ); 1187 remote->addEvent( eventRSync );
1188 else 1188 else
1189 delete eventRSync; 1189 delete eventRSync;
1190 QString mes; 1190 QString mes;
1191 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 ); 1191 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 );
1192 QString delmess; 1192 QString delmess;
1193 if ( delFut ) { 1193 if ( delFut ) {
1194 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut); 1194 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut);
1195 mes += delmess; 1195 mes += delmess;
1196 } 1196 }
1197 mCalendar->checkAlarmForIncidence( 0, true );
1198 qDebug( mes );
1197 if ( mSyncManager->mShowSyncSummary ) { 1199 if ( mSyncManager->mShowSyncSummary ) {
1198 KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); 1200 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1201 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1202 qDebug("cancelled ");
1203 return false;
1204 }
1199 } 1205 }
1200 qDebug( mes );
1201 mCalendar->checkAlarmForIncidence( 0, true );
1202 return syncOK; 1206 return syncOK;
1203} 1207}
1204 1208
1205void CalendarView::setSyncDevice( QString s ) 1209void CalendarView::setSyncDevice( QString s )
1206{ 1210{
1207 mCurrentSyncDevice= s; 1211 mCurrentSyncDevice= s;
1208} 1212}
1209void CalendarView::setSyncName( QString s ) 1213void CalendarView::setSyncName( QString s )
1210{ 1214{
1211 mCurrentSyncName= s; 1215 mCurrentSyncName= s;
1212} 1216}
1213bool CalendarView::syncCalendar(QString filename, int mode) 1217bool CalendarView::syncCalendar(QString filename, int mode)
1214{ 1218{
1215 //qDebug("syncCalendar %s ", filename.latin1()); 1219 //qDebug("syncCalendar %s ", filename.latin1());
1216 mGlobalSyncMode = SYNC_MODE_NORMAL; 1220 mGlobalSyncMode = SYNC_MODE_NORMAL;
1217 CalendarLocal* calendar = new CalendarLocal(); 1221 CalendarLocal* calendar = new CalendarLocal();
1218 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1222 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1219 FileStorage* storage = new FileStorage( calendar ); 1223 FileStorage* storage = new FileStorage( calendar );
1220 bool syncOK = false; 1224 bool syncOK = false;
1221 storage->setFileName( filename ); 1225 storage->setFileName( filename );
1222 // qDebug("loading ... "); 1226 // qDebug("loading ... ");
1223 if ( storage->load() ) { 1227 if ( storage->load() ) {
1224 getEventViewerDialog()->setSyncMode( true ); 1228 getEventViewerDialog()->setSyncMode( true );
1225 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1229 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1226 getEventViewerDialog()->setSyncMode( false ); 1230 getEventViewerDialog()->setSyncMode( false );
1227 if ( syncOK ) { 1231 if ( syncOK ) {
1228 if ( mSyncManager->mWriteBackFile ) 1232 if ( mSyncManager->mWriteBackFile )
1229 { 1233 {
1230 storage->setSaveFormat( new ICalFormat() ); 1234 storage->setSaveFormat( new ICalFormat() );
1231 storage->save(); 1235 storage->save();
1232 } 1236 }
1233 } 1237 }
1234 setModified( true ); 1238 setModified( true );
1235 } 1239 }
1236 delete storage; 1240 delete storage;
1237 delete calendar; 1241 delete calendar;
1238 if ( syncOK ) 1242 if ( syncOK )
1239 updateView(); 1243 updateView();
1240 return syncOK; 1244 return syncOK;
1241} 1245}
1242 1246
1243void CalendarView::syncExternal( int mode ) 1247void CalendarView::syncExternal( int mode )
1244{ 1248{
1245 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1249 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1246 1250
1247 qApp->processEvents(); 1251 qApp->processEvents();
1248 CalendarLocal* calendar = new CalendarLocal(); 1252 CalendarLocal* calendar = new CalendarLocal();
1249 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1253 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1250 bool syncOK = false; 1254 bool syncOK = false;
1251 bool loadSuccess = false; 1255 bool loadSuccess = false;
1252 PhoneFormat* phoneFormat = 0; 1256 PhoneFormat* phoneFormat = 0;
1253 emit tempDisableBR(true); 1257 emit tempDisableBR(true);
1254#ifndef DESKTOP_VERSION 1258#ifndef DESKTOP_VERSION
1255 SharpFormat* sharpFormat = 0; 1259 SharpFormat* sharpFormat = 0;
1256 if ( mode == 0 ) { // sharp 1260 if ( mode == 0 ) { // sharp
1257 sharpFormat = new SharpFormat () ; 1261 sharpFormat = new SharpFormat () ;
1258 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1262 loadSuccess = sharpFormat->load( calendar, mCalendar );
1259 1263
1260 } else 1264 } else
1261#endif 1265#endif
1262 if ( mode == 1 ) { // phone 1266 if ( mode == 1 ) { // phone
1263 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1267 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1264 mSyncManager->mPhoneDevice, 1268 mSyncManager->mPhoneDevice,
1265 mSyncManager->mPhoneConnection, 1269 mSyncManager->mPhoneConnection,
1266 mSyncManager->mPhoneModel); 1270 mSyncManager->mPhoneModel);
1267 loadSuccess = phoneFormat->load( calendar,mCalendar); 1271 loadSuccess = phoneFormat->load( calendar,mCalendar);
1268 1272
1269 } else { 1273 } else {
1270 emit tempDisableBR(false); 1274 emit tempDisableBR(false);
1271 return; 1275 return;
1272 } 1276 }
1273 if ( loadSuccess ) { 1277 if ( loadSuccess ) {
1274 getEventViewerDialog()->setSyncMode( true ); 1278 getEventViewerDialog()->setSyncMode( true );
1275 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1279 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1276 getEventViewerDialog()->setSyncMode( false ); 1280 getEventViewerDialog()->setSyncMode( false );
1277 qApp->processEvents(); 1281 qApp->processEvents();
1278 if ( syncOK ) { 1282 if ( syncOK ) {
1279 if ( mSyncManager->mWriteBackFile ) 1283 if ( mSyncManager->mWriteBackFile )
1280 { 1284 {
1281 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1285 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1282 Incidence* inc = iL.first(); 1286 Incidence* inc = iL.first();
1283 if ( phoneFormat ) { 1287 if ( phoneFormat ) {
1284 while ( inc ) { 1288 while ( inc ) {
1285 inc->removeID(mCurrentSyncDevice); 1289 inc->removeID(mCurrentSyncDevice);
1286 inc = iL.next(); 1290 inc = iL.next();
1287 } 1291 }
1288 } 1292 }
1289#ifndef DESKTOP_VERSION 1293#ifndef DESKTOP_VERSION
1290 if ( sharpFormat ) 1294 if ( sharpFormat )
1291 sharpFormat->save(calendar); 1295 sharpFormat->save(calendar);
1292#endif 1296#endif
1293 if ( phoneFormat ) 1297 if ( phoneFormat )
1294 phoneFormat->save(calendar); 1298 phoneFormat->save(calendar);
1295 iL = calendar->rawIncidences(); 1299 iL = calendar->rawIncidences();
1296 inc = iL.first(); 1300 inc = iL.first();
1297 Incidence* loc; 1301 Incidence* loc;
1298 while ( inc ) { 1302 while ( inc ) {
1299 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1303 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1300 loc = mCalendar->incidence(inc->uid() ); 1304 loc = mCalendar->incidence(inc->uid() );
1301 if ( loc ) { 1305 if ( loc ) {
1302 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1306 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1303 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1307 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1304 } 1308 }
1305 } 1309 }
1306 inc = iL.next(); 1310 inc = iL.next();
1307 } 1311 }
1308 Incidence* lse = getLastSyncEvent(); 1312 Incidence* lse = getLastSyncEvent();
1309 if ( lse ) { 1313 if ( lse ) {
1310 lse->setReadOnly( false ); 1314 lse->setReadOnly( false );
1311 lse->setDescription( "" ); 1315 lse->setDescription( "" );
1312 lse->setReadOnly( true ); 1316 lse->setReadOnly( true );
1313 } 1317 }
1314 } 1318 }
1319 } else {
1320 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1315 } 1321 }
1316 setModified( true ); 1322 setModified( true );
1317 } else { 1323 } else {
1318 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1324 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1319 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1325 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1320 question, i18n("Ok")) ; 1326 question, i18n("Ok")) ;
1321 1327
1322 } 1328 }
1323 delete calendar; 1329 delete calendar;
1324 updateView(); 1330 updateView();
1325 emit tempDisableBR(false); 1331 emit tempDisableBR(false);
1326 return ;//syncOK; 1332 return ;//syncOK;
1327 1333
1328} 1334}
1329 1335
1330bool CalendarView::importBday() 1336bool CalendarView::importBday()
1331{ 1337{
1332#ifndef KORG_NOKABC 1338#ifndef KORG_NOKABC
1333 1339
1334#ifdef DESKTOP_VERSION 1340#ifdef DESKTOP_VERSION
1335 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1341 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1336 KABC::AddressBook::Iterator it; 1342 KABC::AddressBook::Iterator it;
1337 int count = 0; 1343 int count = 0;
1338 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1344 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1339 ++count; 1345 ++count;
1340 } 1346 }
1341 QProgressBar bar(count,0 ); 1347 QProgressBar bar(count,0 );
1342 int w = 300; 1348 int w = 300;
1343 if ( QApplication::desktop()->width() < 320 ) 1349 if ( QApplication::desktop()->width() < 320 )
1344 w = 220; 1350 w = 220;
1345 int h = bar.sizeHint().height() ; 1351 int h = bar.sizeHint().height() ;
1346 int dw = QApplication::desktop()->width(); 1352 int dw = QApplication::desktop()->width();
1347 int dh = QApplication::desktop()->height(); 1353 int dh = QApplication::desktop()->height();
1348 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1354 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1349 bar.show(); 1355 bar.show();
1350 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1356 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1351 qApp->processEvents(); 1357 qApp->processEvents();
1352 count = 0; 1358 count = 0;
1353 int addCount = 0; 1359 int addCount = 0;
1354 KCal::Attendee* a = 0; 1360 KCal::Attendee* a = 0;
1355 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1361 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1356 if ( ! bar.isVisible() ) 1362 if ( ! bar.isVisible() )
1357 return false; 1363 return false;
1358 bar.setProgress( count++ ); 1364 bar.setProgress( count++ );
1359 qApp->processEvents(); 1365 qApp->processEvents();
1360 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1366 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1361 if ( (*it).birthday().date().isValid() ){ 1367 if ( (*it).birthday().date().isValid() ){
1362 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1368 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1363 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1369 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1364 ++addCount; 1370 ++addCount;
1365 } 1371 }
1366 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1372 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1367 if ( anni.isValid() ){ 1373 if ( anni.isValid() ){
1368 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1374 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1369 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1375 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1370 ++addCount; 1376 ++addCount;
1371 } 1377 }
1372 } 1378 }
1373 updateView(); 1379 updateView();
1374 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1380 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1375#else //DESKTOP_VERSION 1381#else //DESKTOP_VERSION
1376 1382
1377 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1383 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1378 // the result should now arrive through method insertBirthdays 1384 // the result should now arrive through method insertBirthdays
1379 1385
1380#endif //DESKTOP_VERSION 1386#endif //DESKTOP_VERSION
1381 1387
1382#endif //KORG_NOKABC 1388#endif //KORG_NOKABC
1383 1389
1384 1390
1385 return true; 1391 return true;
1386} 1392}
1387 1393
1388// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1394// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1389void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1395void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1390 const QStringList& anniversaryList, const QStringList& realNameList, 1396 const QStringList& anniversaryList, const QStringList& realNameList,
1391 const QStringList& emailList, const QStringList& assembledNameList, 1397 const QStringList& emailList, const QStringList& assembledNameList,
1392 const QStringList& uidList) 1398 const QStringList& uidList)
1393{ 1399{
1394 qDebug("CalendarView::insertBirthdays"); 1400 qDebug("CalendarView::insertBirthdays");
1395 if (uid == this->name()) 1401 if (uid == this->name())
1396 { 1402 {
1397 int count = birthdayList.count(); 1403 int count = birthdayList.count();
1398 int addCount = 0; 1404 int addCount = 0;
1399 KCal::Attendee* a = 0; 1405 KCal::Attendee* a = 0;
1400 1406
1401 qDebug("CalView 1 %i", count); 1407 qDebug("CalView 1 %i", count);
1402 1408
1403 QProgressBar bar(count,0 ); 1409 QProgressBar bar(count,0 );
1404 int w = 300; 1410 int w = 300;
1405 if ( QApplication::desktop()->width() < 320 ) 1411 if ( QApplication::desktop()->width() < 320 )
1406 w = 220; 1412 w = 220;
1407 int h = bar.sizeHint().height() ; 1413 int h = bar.sizeHint().height() ;
1408 int dw = QApplication::desktop()->width(); 1414 int dw = QApplication::desktop()->width();
1409 int dh = QApplication::desktop()->height(); 1415 int dh = QApplication::desktop()->height();
1410 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1416 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index fc2d59b..65566b5 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -756,234 +756,241 @@ void MainWindow::initActions()
756 action->addTo( importMenu ); 756 action->addTo( importMenu );
757 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 757 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
758 importMenu->insertSeparator(); 758 importMenu->insertSeparator();
759 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 759 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
760 this ); 760 this );
761 action->addTo( importMenu ); 761 action->addTo( importMenu );
762 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 762 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
763#ifndef DESKTOP_VERSION 763#ifndef DESKTOP_VERSION
764 importMenu->insertSeparator(); 764 importMenu->insertSeparator();
765 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 765 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
766 this ); 766 this );
767 action->addTo( importMenu ); 767 action->addTo( importMenu );
768 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 768 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
769#else 769#else
770#ifdef _WIN32_ 770#ifdef _WIN32_
771 importMenu->insertSeparator(); 771 importMenu->insertSeparator();
772 action = new QAction( "import_ol", i18n("Import from OL"), 0, 772 action = new QAction( "import_ol", i18n("Import from OL"), 0,
773 this ); 773 this );
774 action->addTo( importMenu ); 774 action->addTo( importMenu );
775 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 775 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
776#endif 776#endif
777#endif 777#endif
778 778
779 importMenu->insertSeparator(); 779 importMenu->insertSeparator();
780 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 780 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
781 this ); 781 this );
782 action->addTo( importMenu ); 782 action->addTo( importMenu );
783 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 783 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
784 784
785 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 785 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
786 this ); 786 this );
787 action->addTo( importMenu ); 787 action->addTo( importMenu );
788 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 788 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
789 789
790 importMenu->insertSeparator(); 790 importMenu->insertSeparator();
791 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 791 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
792 this ); 792 this );
793 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 793 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
794 794
795 795
796 //LR 796 //LR
797 QPopupMenu *ex2phone = new QPopupMenu( this ); 797 QPopupMenu *ex2phone = new QPopupMenu( this );
798 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 798 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
799 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 799 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
800 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 800 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
801 importMenu->insertItem( i18n("Export to phone"), ex2phone ); 801 importMenu->insertItem( i18n("Export to phone"), ex2phone );
802 802
803 importMenu->insertSeparator(); 803 importMenu->insertSeparator();
804 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 804 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
805 this ); 805 this );
806 action->addTo( importMenu ); 806 action->addTo( importMenu );
807 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 807 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
808#ifndef DESKTOP_VERSION 808#ifndef DESKTOP_VERSION
809 importMenu->insertSeparator(); 809 importMenu->insertSeparator();
810 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 810 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
811 this ); 811 this );
812 brAction->addTo( importMenu ); 812 brAction->addTo( importMenu );
813 brAction->setToggleAction (true ) ; 813 brAction->setToggleAction (true ) ;
814 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 814 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
815 815
816 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 816 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
817 this ); 817 this );
818 action->addTo( importMenu ); 818 action->addTo( importMenu );
819 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 819 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
820 820
821 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 821 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
822 this ); 822 this );
823 action->addTo( importMenu ); 823 action->addTo( importMenu );
824 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 824 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
825#else 825#else
826 importMenu->insertSeparator(); 826 importMenu->insertSeparator();
827 icon = loadPixmap( pathString + "print" ); 827 icon = loadPixmap( pathString + "print" );
828 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 828 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
829 action->addTo( importMenu ); 829 action->addTo( importMenu );
830 connect( action, SIGNAL( activated() ), 830 connect( action, SIGNAL( activated() ),
831 this, SLOT( printCal() ) ); 831 this, SLOT( printCal() ) );
832 832
833 icon = loadPixmap( pathString + "print" ); 833 icon = loadPixmap( pathString + "print" );
834 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 834 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
835 action->addTo( importMenu ); 835 action->addTo( importMenu );
836 connect( action, SIGNAL( activated() ), 836 connect( action, SIGNAL( activated() ),
837 this, SLOT( printSel() ) ); 837 this, SLOT( printSel() ) );
838#endif 838#endif
839 importMenu->insertSeparator(); 839 importMenu->insertSeparator();
840 action = new QAction( "beam all", i18n("Save"), 0, 840 action = new QAction( "beam all", i18n("Save"), 0,
841 this ); 841 this );
842 action->addTo( importMenu ); 842 action->addTo( importMenu );
843 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 843 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
844 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 844 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
845 this ); 845 this );
846 action->addTo( importMenu ); 846 action->addTo( importMenu );
847 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 847 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
848 848
849 //menuBar->insertItem( "Configure",configureMenu ); 849 //menuBar->insertItem( "Configure",configureMenu );
850 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 850 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
851 icon = loadPixmap( "korganizer/korganizer" ); 851 icon = loadPixmap( "korganizer/korganizer" );
852 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 852
853 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
853 action->addTo( helpMenu ); 854 action->addTo( helpMenu );
854 connect( action, SIGNAL( activated() ), 855 connect( action, SIGNAL( activated() ),
855 SLOT( keyBindings() ) ); 856 SLOT( whatsNew() ) );
856 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 857 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
857 action->addTo( helpMenu ); 858 action->addTo( helpMenu );
858 connect( action, SIGNAL( activated() ), 859 connect( action, SIGNAL( activated() ),
859 SLOT( features() ) ); 860 SLOT( features() ) );
861 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
862 action->addTo( helpMenu );
863 connect( action, SIGNAL( activated() ),
864 SLOT( keyBindings() ) );
865 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
866 action->addTo( helpMenu );
867 connect( action, SIGNAL( activated() ),
868 SLOT( synchowto() ) );
869 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
870 action->addTo( helpMenu );
871 connect( action, SIGNAL( activated() ),
872 SLOT( kdesynchowto() ) );
873 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
874 action->addTo( helpMenu );
875 connect( action, SIGNAL( activated() ),
876 SLOT( multisynchowto() ) );
860 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 877 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
861 action->addTo( helpMenu ); 878 action->addTo( helpMenu );
862 connect( action, SIGNAL( activated() ), 879 connect( action, SIGNAL( activated() ),
863 SLOT( aboutAutoSaving() ) ); 880 SLOT( aboutAutoSaving() ) );
864 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 881 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
865 action->addTo( helpMenu ); 882 action->addTo( helpMenu );
866 connect( action, SIGNAL( activated() ), 883 connect( action, SIGNAL( activated() ),
867 SLOT( aboutKnownBugs() ) ); 884 SLOT( aboutKnownBugs() ) );
868 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 885 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
869 action->addTo( helpMenu ); 886 action->addTo( helpMenu );
870 connect( action, SIGNAL( activated() ), 887 connect( action, SIGNAL( activated() ),
871 SLOT( usertrans() ) ); 888 SLOT( usertrans() ) );
872 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
873 action->addTo( helpMenu );
874 connect( action, SIGNAL( activated() ),
875 SLOT( synchowto() ) );
876 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
877 action->addTo( helpMenu );
878 connect( action, SIGNAL( activated() ),
879 SLOT( whatsNew() ) );
880 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 889 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
881 action->addTo( helpMenu ); 890 action->addTo( helpMenu );
882 connect( action, SIGNAL( activated() ), 891 connect( action, SIGNAL( activated() ),
883 SLOT( faq() ) ); 892 SLOT( faq() ) );
884
885
886 action = new QAction( "about", i18n("About..."), 0, this );
887 action->addTo( helpMenu );
888 connect( action, SIGNAL( activated() ),
889 SLOT( about() ) );
890 action = new QAction( "licence", i18n("Licence..."), 0, this ); 893 action = new QAction( "licence", i18n("Licence..."), 0, this );
891 action->addTo( helpMenu ); 894 action->addTo( helpMenu );
892 connect( action, SIGNAL( activated() ), 895 connect( action, SIGNAL( activated() ),
893 SLOT( licence() ) ); 896 SLOT( licence() ) );
897 action = new QAction( "about", i18n("About..."), 0, this );
898 action->addTo( helpMenu );
899 connect( action, SIGNAL( activated() ),
900 SLOT( about() ) );
894 //menuBar->insertSeparator(); 901 //menuBar->insertSeparator();
895 902
896 // ****************************************************** 903 // ******************************************************
897 // menubar icons 904 // menubar icons
898 905
899 906
900 iconToolBar->setHorizontalStretchable (true ); 907 iconToolBar->setHorizontalStretchable (true );
901 //menuBar->insertItem( iconToolBar ); 908 //menuBar->insertItem( iconToolBar );
902 //xdays_action 909 //xdays_action
903 if (p-> mShowIconNewEvent) 910 if (p-> mShowIconNewEvent)
904 ne_action->addTo( iconToolBar ); 911 ne_action->addTo( iconToolBar );
905 if (p->mShowIconNewTodo ) 912 if (p->mShowIconNewTodo )
906 nt_action->addTo( iconToolBar ); 913 nt_action->addTo( iconToolBar );
907 if (p-> mShowIconSearch) 914 if (p-> mShowIconSearch)
908 search_action->addTo( iconToolBar ); 915 search_action->addTo( iconToolBar );
909 if (p-> mShowIconNext) 916 if (p-> mShowIconNext)
910 whatsnext_action->addTo( iconToolBar ); 917 whatsnext_action->addTo( iconToolBar );
911 if (p-> mShowIconNextDays) 918 if (p-> mShowIconNextDays)
912 xdays_action->addTo( iconToolBar ); 919 xdays_action->addTo( iconToolBar );
913 if (p-> mShowIconList) 920 if (p-> mShowIconList)
914 showlist_action->addTo( iconToolBar ); 921 showlist_action->addTo( iconToolBar );
915 if (p-> mShowIconDay1) 922 if (p-> mShowIconDay1)
916 day1_action->addTo( iconToolBar ); 923 day1_action->addTo( iconToolBar );
917 if (p-> mShowIconDay5) 924 if (p-> mShowIconDay5)
918 day5_action->addTo( iconToolBar ); 925 day5_action->addTo( iconToolBar );
919 if (p-> mShowIconDay7) 926 if (p-> mShowIconDay7)
920 day7_action->addTo( iconToolBar ); 927 day7_action->addTo( iconToolBar );
921 if (p-> mShowIconMonth) 928 if (p-> mShowIconMonth)
922 month_action->addTo( iconToolBar ); 929 month_action->addTo( iconToolBar );
923 if (p-> mShowIconTodoview) 930 if (p-> mShowIconTodoview)
924 todoview_action->addTo( iconToolBar ); 931 todoview_action->addTo( iconToolBar );
925 if (p-> mShowIconJournal) 932 if (p-> mShowIconJournal)
926 viewjournal_action->addTo( iconToolBar ); 933 viewjournal_action->addTo( iconToolBar );
927 icon = loadPixmap( pathString + "2leftarrowB" ); 934 icon = loadPixmap( pathString + "2leftarrowB" );
928 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 935 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
929 if (p-> mShowIconBackFast) { 936 if (p-> mShowIconBackFast) {
930 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 937 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
931 connect( action, SIGNAL( activated() ), 938 connect( action, SIGNAL( activated() ),
932 mView, SLOT( goPreviousMonth() ) ); 939 mView, SLOT( goPreviousMonth() ) );
933 action->addTo( iconToolBar ); 940 action->addTo( iconToolBar );
934 } 941 }
935 icon = loadPixmap( pathString + "1leftarrowB" ); 942 icon = loadPixmap( pathString + "1leftarrowB" );
936 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 943 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
937 if (p-> mShowIconBack) { 944 if (p-> mShowIconBack) {
938 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 945 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
939 connect( action, SIGNAL( activated() ), 946 connect( action, SIGNAL( activated() ),
940 mView, SLOT( goPrevious() ) ); 947 mView, SLOT( goPrevious() ) );
941 action->addTo( iconToolBar ); 948 action->addTo( iconToolBar );
942 } 949 }
943 if (p-> mShowIconToday) 950 if (p-> mShowIconToday)
944 today_action->addTo( iconToolBar ); 951 today_action->addTo( iconToolBar );
945 icon = loadPixmap( pathString + "1rightarrowB" ); 952 icon = loadPixmap( pathString + "1rightarrowB" );
946 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 953 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
947 if (p-> mShowIconForward) { 954 if (p-> mShowIconForward) {
948 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 955 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
949 connect( action, SIGNAL( activated() ), 956 connect( action, SIGNAL( activated() ),
950 mView, SLOT( goNext() ) ); 957 mView, SLOT( goNext() ) );
951 action->addTo( iconToolBar ); 958 action->addTo( iconToolBar );
952 } 959 }
953 icon = loadPixmap( pathString + "2rightarrowB" ); 960 icon = loadPixmap( pathString + "2rightarrowB" );
954 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 961 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
955 if (p-> mShowIconForwardFast) { 962 if (p-> mShowIconForwardFast) {
956 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 963 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
957 connect( action, SIGNAL( activated() ), 964 connect( action, SIGNAL( activated() ),
958 mView, SLOT( goNextMonth() ) ); 965 mView, SLOT( goNextMonth() ) );
959 action->addTo( iconToolBar ); 966 action->addTo( iconToolBar );
960 } 967 }
961 968
962 969
963 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 970 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
964 971
965 if (p-> mShowIconNewEvent) 972 if (p-> mShowIconNewEvent)
966 configureToolBarMenu->setItemChecked( 10, true ); 973 configureToolBarMenu->setItemChecked( 10, true );
967 if (p->mShowIconNewTodo ) 974 if (p->mShowIconNewTodo )
968 configureToolBarMenu->setItemChecked( 20, true ); 975 configureToolBarMenu->setItemChecked( 20, true );
969 if (p-> mShowIconSearch) 976 if (p-> mShowIconSearch)
970 configureToolBarMenu->setItemChecked( 120, true ); 977 configureToolBarMenu->setItemChecked( 120, true );
971 if (p-> mShowIconList) 978 if (p-> mShowIconList)
972 configureToolBarMenu->setItemChecked( 30, true ); 979 configureToolBarMenu->setItemChecked( 30, true );
973 if (p-> mShowIconDay1) 980 if (p-> mShowIconDay1)
974 configureToolBarMenu->setItemChecked( 40, true ); 981 configureToolBarMenu->setItemChecked( 40, true );
975 if (p-> mShowIconDay5) 982 if (p-> mShowIconDay5)
976 configureToolBarMenu->setItemChecked( 50, true ); 983 configureToolBarMenu->setItemChecked( 50, true );
977 if (p-> mShowIconDay7) 984 if (p-> mShowIconDay7)
978 configureToolBarMenu->setItemChecked( 60, true ); 985 configureToolBarMenu->setItemChecked( 60, true );
979 if (p-> mShowIconMonth) 986 if (p-> mShowIconMonth)
980 configureToolBarMenu->setItemChecked( 70, true ); 987 configureToolBarMenu->setItemChecked( 70, true );
981 if (p-> mShowIconTodoview) 988 if (p-> mShowIconTodoview)
982 configureToolBarMenu->setItemChecked( 80, true ); 989 configureToolBarMenu->setItemChecked( 80, true );
983 if (p-> mShowIconBackFast) 990 if (p-> mShowIconBackFast)
984 configureToolBarMenu->setItemChecked( 200, true ); 991 configureToolBarMenu->setItemChecked( 200, true );
985 if (p-> mShowIconBack) 992 if (p-> mShowIconBack)
986 configureToolBarMenu->setItemChecked( 210, true ); 993 configureToolBarMenu->setItemChecked( 210, true );
987 if (p-> mShowIconToday) 994 if (p-> mShowIconToday)
988 configureToolBarMenu->setItemChecked( 130, true ); 995 configureToolBarMenu->setItemChecked( 130, true );
989 if (p-> mShowIconForward) 996 if (p-> mShowIconForward)
@@ -1054,195 +1061,202 @@ void MainWindow::exportToPhone( int mode )
1054 QDateTime dt; 1061 QDateTime dt;
1055 if ( incidence->type() == "Todo" ) { 1062 if ( incidence->type() == "Todo" ) {
1056 Todo * t = (Todo*)incidence; 1063 Todo * t = (Todo*)incidence;
1057 if ( t->hasDueDate() ) 1064 if ( t->hasDueDate() )
1058 dt = t->dtDue(); 1065 dt = t->dtDue();
1059 else 1066 else
1060 dt = cur.addSecs( 62 ); 1067 dt = cur.addSecs( 62 );
1061 } 1068 }
1062 else { 1069 else {
1063 bool ok; 1070 bool ok;
1064 dt = incidence->getNextOccurence( cur, &ok ); 1071 dt = incidence->getNextOccurence( cur, &ok );
1065 if ( !ok ) 1072 if ( !ok )
1066 dt = cur.addSecs( -62 ); 1073 dt = cur.addSecs( -62 );
1067 } 1074 }
1068 if ( dt < cur || dt > end ) { 1075 if ( dt < cur || dt > end ) {
1069 add = false; 1076 add = false;
1070 } 1077 }
1071 } 1078 }
1072 if ( add ) { 1079 if ( add ) {
1073 Incidence *in = incidence->clone(); 1080 Incidence *in = incidence->clone();
1074 cal->addIncidence( in ); 1081 cal->addIncidence( in );
1075 } 1082 }
1076 } 1083 }
1077 incidence = delSel.next(); 1084 incidence = delSel.next();
1078 } 1085 }
1079 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1086 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1080 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1087 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1081 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1088 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1082 1089
1083 setCaption( i18n("Writing to phone...")); 1090 setCaption( i18n("Writing to phone..."));
1084 if ( PhoneFormat::writeToPhone( cal ) ) 1091 if ( PhoneFormat::writeToPhone( cal ) )
1085 setCaption( i18n("Export to phone successful!")); 1092 setCaption( i18n("Export to phone successful!"));
1086 else 1093 else
1087 setCaption( i18n("Error exporting to phone!")); 1094 setCaption( i18n("Error exporting to phone!"));
1088 delete cal; 1095 delete cal;
1089} 1096}
1090 1097
1091 1098
1092void MainWindow::setDefaultPreferences() 1099void MainWindow::setDefaultPreferences()
1093{ 1100{
1094 KOPrefs *p = KOPrefs::instance(); 1101 KOPrefs *p = KOPrefs::instance();
1095 1102
1096 p->mCompactDialogs = true; 1103 p->mCompactDialogs = true;
1097 p->mConfirm = true; 1104 p->mConfirm = true;
1098 // p->mEnableQuickTodo = false; 1105 // p->mEnableQuickTodo = false;
1099 1106
1100} 1107}
1101 1108
1102QString MainWindow::resourcePath() 1109QString MainWindow::resourcePath()
1103{ 1110{
1104 return KGlobal::iconLoader()->iconPath(); 1111 return KGlobal::iconLoader()->iconPath();
1105} 1112}
1106 1113
1107void MainWindow::displayText( QString text ,QString cap ) 1114void MainWindow::displayText( QString text ,QString cap )
1108{ 1115{
1109 QDialog dia( this, "name", true ); ; 1116 QDialog dia( this, "name", true ); ;
1110 dia.setCaption( cap ); 1117 dia.setCaption( cap );
1111 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1118 QVBoxLayout* lay = new QVBoxLayout( &dia );
1112 lay->setSpacing( 3 ); 1119 lay->setSpacing( 3 );
1113 lay->setMargin( 3 ); 1120 lay->setMargin( 3 );
1114 QTextBrowser tb ( &dia ); 1121 QTextBrowser tb ( &dia );
1115 lay->addWidget( &tb ); 1122 lay->addWidget( &tb );
1116 tb.setText( text ); 1123 tb.setText( text );
1117#ifdef DESKTOP_VERSION 1124#ifdef DESKTOP_VERSION
1118 dia.resize( 640, 480); 1125 dia.resize( 640, 480);
1119#else 1126#else
1120 dia.showMaximized(); 1127 dia.showMaximized();
1121#endif 1128#endif
1122 dia.exec(); 1129 dia.exec();
1123} 1130}
1124void MainWindow::displayFile( QString fn, QString cap ) 1131void MainWindow::displayFile( QString fn, QString cap )
1125{ 1132{
1126 QString fileName = resourcePath() + fn; 1133 QString fileName = resourcePath() + fn;
1127 QString text; 1134 QString text;
1128 QFile file( fileName ); 1135 QFile file( fileName );
1129 if (!file.open( IO_ReadOnly ) ) { 1136 if (!file.open( IO_ReadOnly ) ) {
1130 return ; 1137 return ;
1131 1138
1132 } 1139 }
1133 QTextStream ts( &file ); 1140 QTextStream ts( &file );
1134 text = ts.read(); 1141 text = ts.read();
1135 file.close(); 1142 file.close();
1136 displayText( text, cap); 1143 displayText( text, cap);
1137} 1144}
1138void MainWindow::features() 1145void MainWindow::features()
1139{ 1146{
1140 1147
1141 displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); 1148 displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") );
1142} 1149}
1143 1150
1144void MainWindow::usertrans() 1151void MainWindow::usertrans()
1145{ 1152{
1146 1153
1147 displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); 1154 displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") );
1148} 1155}
1149 1156
1157void MainWindow::kdesynchowto()
1158{
1159 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1160}
1161void MainWindow::multisynchowto()
1162{
1163 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1164}
1150void MainWindow::synchowto() 1165void MainWindow::synchowto()
1151{ 1166{
1152
1153 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1167 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1154} 1168}
1155void MainWindow::faq() 1169void MainWindow::faq()
1156{ 1170{
1157 displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); 1171 displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") );
1158 1172
1159} 1173}
1160void MainWindow::whatsNew() 1174void MainWindow::whatsNew()
1161{ 1175{
1162 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1176 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1163 1177
1164} 1178}
1165void MainWindow::licence() 1179void MainWindow::licence()
1166{ 1180{
1167 KApplication::showLicence(); 1181 KApplication::showLicence();
1168 1182
1169} 1183}
1170void MainWindow::about() 1184void MainWindow::about()
1171{ 1185{
1172 QString version; 1186 QString version;
1173#include <../version> 1187#include <../version>
1174 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1188 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1175 i18n("KOrganizer/Platform-independent\n") + 1189 i18n("KOrganizer/Platform-independent\n") +
1176 "(KO/Pi) " + version + " - " + 1190 "(KO/Pi) " + version + " - " +
1177 1191
1178#ifdef DESKTOP_VERSION 1192#ifdef DESKTOP_VERSION
1179 i18n("Desktop Edition\n") + 1193 i18n("Desktop Edition\n") +
1180#else 1194#else
1181 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + 1195 i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") +
1182#endif 1196#endif
1183 i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); 1197 i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") );
1184} 1198}
1185void MainWindow::keyBindings() 1199void MainWindow::keyBindings()
1186{ 1200{
1187 QString cap = i18n("Key bindings KOrganizer/Pi"); 1201 QString cap = i18n("Key bindings KOrganizer/Pi");
1188 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1202 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1189 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1203 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1190 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1204 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1191 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1205 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1192 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1206 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1193 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1207 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1194 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1208 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1195 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1209 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+
1196 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1210 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1197 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1211 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1198 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1212 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1199 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1213 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1200 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1214 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1201 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ 1215 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+
1202 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1216 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1203 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1217 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1204 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1218 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1205 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1219 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1206 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1220 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1207 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1221 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1208 i18n("<p><h3>In agenda view:</h3></p>\n") + 1222 i18n("<p><h3>In agenda view:</h3></p>\n") +
1209 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1223 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1210 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1224 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1211 i18n("<p><h3>In todo view:</h3></p>\n") + 1225 i18n("<p><h3>In todo view:</h3></p>\n") +
1212 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1226 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1213 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1227 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1214 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1228 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1215 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1229 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1216 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1230 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1217 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1231 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1218 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1232 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1219 i18n("<p><h3>In list view:</h3></p>\n") + 1233 i18n("<p><h3>In list view:</h3></p>\n") +
1220 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1234 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1221 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1235 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1222 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1236 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1223 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1237 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1224 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1238 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1225 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1239 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1226 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1240 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1227 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1241 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1228 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1242 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1229 i18n("<p><b>E</b>: Edit item</p>\n") + 1243 i18n("<p><b>E</b>: Edit item</p>\n") +
1230 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1244 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1231 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1245 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1232 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1246 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1233 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1247 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1234 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1248 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1235 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1249 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1236 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1250 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1237 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1251 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1238 i18n("<p><b>White</b>: Item readonly</p>\n"); 1252 i18n("<p><b>White</b>: Item readonly</p>\n");
1239 displayText( text, cap); 1253 displayText( text, cap);
1240 1254
1241} 1255}
1242void MainWindow::aboutAutoSaving() 1256void MainWindow::aboutAutoSaving()
1243{ 1257{
1244 QMessageBox* msg; 1258 QMessageBox* msg;
1245 msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), 1259 msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"),
1246 i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon, 1260 i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"), QMessageBox::NoIcon,
1247 QMessageBox::Ok, 1261 QMessageBox::Ok,
1248 QMessageBox::NoButton, 1262 QMessageBox::NoButton,
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 0926313..ed65d36 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,138 +1,140 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qtextstream.h> 8#include <qtextstream.h>
9#include <qregexp.h> 9#include <qregexp.h>
10 10
11#include <libkcal/incidence.h> 11#include <libkcal/incidence.h>
12#include "simplealarmclient.h" 12#include "simplealarmclient.h"
13#include <ksyncmanager.h> 13#include <ksyncmanager.h>
14#ifndef DESKTOP_VERSION 14#ifndef DESKTOP_VERSION
15#include <qcopchannel_qws.h> 15#include <qcopchannel_qws.h>
16#endif 16#endif
17class QAction; 17class QAction;
18class CalendarView; 18class CalendarView;
19class KSyncProfile; 19class KSyncProfile;
20#ifdef DESKTOP_VERSION 20#ifdef DESKTOP_VERSION
21 21
22#define QPEToolBar QToolBar 22#define QPEToolBar QToolBar
23#define QPEMenuBar QMenuBar 23#define QPEMenuBar QMenuBar
24#endif 24#endif
25class QPEToolBar; 25class QPEToolBar;
26 26
27 27
28namespace KCal { 28namespace KCal {
29class CalendarLocal; 29class CalendarLocal;
30} 30}
31 31
32using namespace KCal; 32using namespace KCal;
33 33
34class MainWindow : public QMainWindow 34class MainWindow : public QMainWindow
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
38 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); 38 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = "");
39 ~MainWindow(); 39 ~MainWindow();
40 bool beamReceiveEnabled(); 40 bool beamReceiveEnabled();
41 public slots: 41 public slots:
42 virtual void showMaximized (); 42 virtual void showMaximized ();
43 void configureAgenda( int ); 43 void configureAgenda( int );
44 void recieve( const QCString& msg, const QByteArray& data ); 44 void recieve( const QCString& msg, const QByteArray& data );
45 static QString defaultFileName(); 45 static QString defaultFileName();
46 static QString syncFileName(); 46 static QString syncFileName();
47 static QString resourcePath(); 47 static QString resourcePath();
48 protected slots: 48 protected slots:
49 void setCaptionToDates(); 49 void setCaptionToDates();
50 void about(); 50 void about();
51 void licence(); 51 void licence();
52 void faq(); 52 void faq();
53 void usertrans(); 53 void usertrans();
54 void features(); 54 void features();
55 void synchowto(); 55 void synchowto();
56 void kdesynchowto();
57 void multisynchowto();
56 void whatsNew(); 58 void whatsNew();
57 void keyBindings(); 59 void keyBindings();
58 void aboutAutoSaving();; 60 void aboutAutoSaving();;
59 void aboutKnownBugs(); 61 void aboutKnownBugs();
60 62
61 void processIncidenceSelection( Incidence * ); 63 void processIncidenceSelection( Incidence * );
62 64
63 void importQtopia(); 65 void importQtopia();
64 void importBday(); 66 void importBday();
65 void importOL(); 67 void importOL();
66 void importIcal(); 68 void importIcal();
67 void importFile( QString, bool ); 69 void importFile( QString, bool );
68 void quickImportIcal(); 70 void quickImportIcal();
69 71
70 void slotModifiedChanged( bool ); 72 void slotModifiedChanged( bool );
71 73
72 void save(); 74 void save();
73 void configureToolBar( int ); 75 void configureToolBar( int );
74 void printSel(); 76 void printSel();
75 void printCal(); 77 void printCal();
76 void saveCalendar(); 78 void saveCalendar();
77 void loadCalendar(); 79 void loadCalendar();
78 void exportVCalendar(); 80 void exportVCalendar();
79 void fillFilterMenu(); 81 void fillFilterMenu();
80 void selectFilter( int ); 82 void selectFilter( int );
81 void exportToPhone( int ); 83 void exportToPhone( int );
82 void toggleBeamReceive(); 84 void toggleBeamReceive();
83 void disableBR(bool); 85 void disableBR(bool);
84 86
85 87
86 protected: 88 protected:
87 void displayText( QString, QString); 89 void displayText( QString, QString);
88 void displayFile( QString, QString); 90 void displayFile( QString, QString);
89 91
90 void enableIncidenceActions( bool ); 92 void enableIncidenceActions( bool );
91 93
92 private slots: 94 private slots:
93 QSocket* piSocket; 95 QSocket* piSocket;
94 QString piFileString; 96 QString piFileString;
95 QTime piTime; 97 QTime piTime;
96 void getFile( bool ); 98 void getFile( bool );
97 void syncFileRequest(); 99 void syncFileRequest();
98 private: 100 private:
99 bool mBRdisabled; 101 bool mBRdisabled;
100#ifndef DESKTOP_VERSION 102#ifndef DESKTOP_VERSION
101 QCopChannel* infrared; 103 QCopChannel* infrared;
102#endif 104#endif
103 QAction* brAction; 105 QAction* brAction;
104 KSyncManager* mSyncManager; 106 KSyncManager* mSyncManager;
105 bool mClosed; 107 bool mClosed;
106 void saveOnClose(); 108 void saveOnClose();
107 bool mFlagKeyPressed; 109 bool mFlagKeyPressed;
108 bool mBlockAtStartup; 110 bool mBlockAtStartup;
109 QPEToolBar *iconToolBar; 111 QPEToolBar *iconToolBar;
110 void initActions(); 112 void initActions();
111 void setDefaultPreferences(); 113 void setDefaultPreferences();
112 void keyPressEvent ( QKeyEvent * ) ; 114 void keyPressEvent ( QKeyEvent * ) ;
113 void keyReleaseEvent ( QKeyEvent * ) ; 115 void keyReleaseEvent ( QKeyEvent * ) ;
114 QPopupMenu *configureToolBarMenu; 116 QPopupMenu *configureToolBarMenu;
115 QPopupMenu *selectFilterMenu; 117 QPopupMenu *selectFilterMenu;
116 QPopupMenu *configureAgendaMenu, *syncMenu; 118 QPopupMenu *configureAgendaMenu, *syncMenu;
117 CalendarLocal *mCalendar; 119 CalendarLocal *mCalendar;
118 CalendarView *mView; 120 CalendarView *mView;
119 QAction *mNewSubTodoAction; 121 QAction *mNewSubTodoAction;
120 122
121 QAction *mShowAction; 123 QAction *mShowAction;
122 QAction *mEditAction; 124 QAction *mEditAction;
123 QAction *mDeleteAction; 125 QAction *mDeleteAction;
124 QAction *mCloneAction; 126 QAction *mCloneAction;
125 QAction *mMoveAction; 127 QAction *mMoveAction;
126 QAction *mBeamAction; 128 QAction *mBeamAction;
127 QAction *mCancelAction; 129 QAction *mCancelAction;
128 130
129 void closeEvent( QCloseEvent* ce ); 131 void closeEvent( QCloseEvent* ce );
130 SimpleAlarmClient mAlarmClient; 132 SimpleAlarmClient mAlarmClient;
131 QTimer mSaveTimer; 133 QTimer mSaveTimer;
132 //bool mBlockSaveFlag; 134 //bool mBlockSaveFlag;
133 bool mCalendarModifiedFlag; 135 bool mCalendarModifiedFlag;
134 QPixmap loadPixmap( QString ); 136 QPixmap loadPixmap( QString );
135}; 137};
136 138
137 139
138#endif 140#endif