summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 53b65b2..481eab4 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1311,53 +1311,53 @@ void MainWindow::exportToPhone( int mode )
1311 if ( mode == 2 ) 1311 if ( mode == 2 )
1312 ex2phone.setCaption(i18n("Export filtered calendar")); 1312 ex2phone.setCaption(i18n("Export filtered calendar"));
1313 1313
1314 if ( !ex2phone.exec() ) { 1314 if ( !ex2phone.exec() ) {
1315 return; 1315 return;
1316 } 1316 }
1317 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1317 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1318 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1318 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1319 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1319 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1320 1320
1321 int inFuture = 0; 1321 int inFuture = 0;
1322 if ( ex2phone.mWriteBackFuture->isChecked() ) 1322 if ( ex2phone.mWriteBackFuture->isChecked() )
1323 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1323 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1324 QPtrList<Incidence> delSel; 1324 QPtrList<Incidence> delSel;
1325 if ( mode == 1 ) 1325 if ( mode == 1 )
1326 delSel = mCalendar->rawIncidences(); 1326 delSel = mCalendar->rawIncidences();
1327 if ( mode == 2 ) 1327 if ( mode == 2 )
1328 delSel = mCalendar->incidences(); 1328 delSel = mCalendar->incidences();
1329 CalendarLocal* cal = new CalendarLocal(); 1329 CalendarLocal* cal = new CalendarLocal();
1330 cal->setLocalTime(); 1330 cal->setLocalTime();
1331 Incidence *incidence = delSel.first(); 1331 Incidence *incidence = delSel.first();
1332 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1332 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1333 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1333 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1334 while ( incidence ) { 1334 while ( incidence ) {
1335 if ( incidence->type() != "Journal" ) { 1335 if ( incidence->typeID() != journalID ) {
1336 bool add = true; 1336 bool add = true;
1337 if ( inFuture ) { 1337 if ( inFuture ) {
1338 QDateTime dt; 1338 QDateTime dt;
1339 if ( incidence->type() == "Todo" ) { 1339 if ( incidence->typeID() == todoID ) {
1340 Todo * t = (Todo*)incidence; 1340 Todo * t = (Todo*)incidence;
1341 if ( t->hasDueDate() ) 1341 if ( t->hasDueDate() )
1342 dt = t->dtDue(); 1342 dt = t->dtDue();
1343 else 1343 else
1344 dt = cur.addSecs( 62 ); 1344 dt = cur.addSecs( 62 );
1345 } 1345 }
1346 else { 1346 else {
1347 bool ok; 1347 bool ok;
1348 dt = incidence->getNextOccurence( cur, &ok ); 1348 dt = incidence->getNextOccurence( cur, &ok );
1349 if ( !ok ) 1349 if ( !ok )
1350 dt = cur.addSecs( -62 ); 1350 dt = cur.addSecs( -62 );
1351 } 1351 }
1352 if ( dt < cur || dt > end ) { 1352 if ( dt < cur || dt > end ) {
1353 add = false; 1353 add = false;
1354 } 1354 }
1355 } 1355 }
1356 if ( add ) { 1356 if ( add ) {
1357 Incidence *in = incidence->clone(); 1357 Incidence *in = incidence->clone();
1358 cal->addIncidence( in ); 1358 cal->addIncidence( in );
1359 } 1359 }
1360 } 1360 }
1361 incidence = delSel.next(); 1361 incidence = delSel.next();
1362 } 1362 }
1363 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1363 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
@@ -1575,93 +1575,93 @@ void MainWindow::updateWeek(QDate seda)
1575 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1575 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1576 p.end(); 1576 p.end();
1577 QIconSet icon3 ( mWeekPixmap ); 1577 QIconSet icon3 ( mWeekPixmap );
1578 mWeekAction->setIconSet ( icon3 ); 1578 mWeekAction->setIconSet ( icon3 );
1579 1579
1580} 1580}
1581void MainWindow::updateWeekNum(const DateList &selectedDates) 1581void MainWindow::updateWeekNum(const DateList &selectedDates)
1582{ 1582{
1583 updateWeek( selectedDates.first() ); 1583 updateWeek( selectedDates.first() );
1584} 1584}
1585void MainWindow::processIncidenceSelection( Incidence *incidence ) 1585void MainWindow::processIncidenceSelection( Incidence *incidence )
1586{ 1586{
1587 1587
1588 if ( !incidence ) { 1588 if ( !incidence ) {
1589 enableIncidenceActions( false ); 1589 enableIncidenceActions( false );
1590 1590
1591 mNewSubTodoAction->setEnabled( false ); 1591 mNewSubTodoAction->setEnabled( false );
1592 setCaptionToDates(); 1592 setCaptionToDates();
1593 return; 1593 return;
1594 1594
1595 } 1595 }
1596 1596
1597 //KGlobal::locale()->formatDateTime(nextA, true); 1597 //KGlobal::locale()->formatDateTime(nextA, true);
1598 QString startString = ""; 1598 QString startString = "";
1599 if ( incidence->type() != "Todo" ) { 1599 if ( incidence->typeID() != todoID ) {
1600 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1600 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1601 if ( incidence->doesFloat() ) { 1601 if ( incidence->doesFloat() ) {
1602 startString += ": "+incidence->dtStartDateStr( true ); 1602 startString += ": "+incidence->dtStartDateStr( true );
1603 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1603 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1604 1604
1605 } else { 1605 } else {
1606 startString = ": "+incidence->dtStartStr(true); 1606 startString = ": "+incidence->dtStartStr(true);
1607 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1607 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1608 1608
1609 } 1609 }
1610 1610
1611 } else { 1611 } else {
1612 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1612 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1613 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1613 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1614 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1614 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1615 1615
1616 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1616 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1617 bool ok; 1617 bool ok;
1618 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1618 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1619 if ( ok ) { 1619 if ( ok ) {
1620 int years = noc.date().year() - incidence->dtStart().date().year(); 1620 int years = noc.date().year() - incidence->dtStart().date().year();
1621 startString += i18n(" (%1 y.)"). arg( years ); 1621 startString += i18n(" (%1 y.)"). arg( years );
1622 } 1622 }
1623 } 1623 }
1624 else 1624 else
1625 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1625 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1626 } 1626 }
1627 1627
1628 } 1628 }
1629 else 1629 else
1630 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1630 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1631 if ( !incidence->location().isEmpty() ) 1631 if ( !incidence->location().isEmpty() )
1632 startString += " (" +incidence->location()+")"; 1632 startString += " (" +incidence->location()+")";
1633 setCaption( incidence->summary()+startString); 1633 setCaption( incidence->summary()+startString);
1634 1634
1635 enableIncidenceActions( true ); 1635 enableIncidenceActions( true );
1636 1636
1637 if ( incidence->type() == "Event" ) { 1637 if ( incidence->typeID() == eventID ) {
1638 mShowAction->setText( i18n("Show Event...") ); 1638 mShowAction->setText( i18n("Show Event...") );
1639 mEditAction->setText( i18n("Edit Event...") ); 1639 mEditAction->setText( i18n("Edit Event...") );
1640 mDeleteAction->setText( i18n("Delete Event...") ); 1640 mDeleteAction->setText( i18n("Delete Event...") );
1641 1641
1642 mNewSubTodoAction->setEnabled( false ); 1642 mNewSubTodoAction->setEnabled( false );
1643 } else if ( incidence->type() == "Todo" ) { 1643 } else if ( incidence->typeID() == todoID ) {
1644 mShowAction->setText( i18n("Show Todo...") ); 1644 mShowAction->setText( i18n("Show Todo...") );
1645 mEditAction->setText( i18n("Edit Todo...") ); 1645 mEditAction->setText( i18n("Edit Todo...") );
1646 mDeleteAction->setText( i18n("Delete Todo...") ); 1646 mDeleteAction->setText( i18n("Delete Todo...") );
1647 1647
1648 mNewSubTodoAction->setEnabled( true ); 1648 mNewSubTodoAction->setEnabled( true );
1649 } else { 1649 } else {
1650 mShowAction->setText( i18n("Show...") ); 1650 mShowAction->setText( i18n("Show...") );
1651 mShowAction->setText( i18n("Edit...") ); 1651 mShowAction->setText( i18n("Edit...") );
1652 mShowAction->setText( i18n("Delete...") ); 1652 mShowAction->setText( i18n("Delete...") );
1653 1653
1654 mNewSubTodoAction->setEnabled( false ); 1654 mNewSubTodoAction->setEnabled( false );
1655 } 1655 }
1656} 1656}
1657 1657
1658void MainWindow::enableIncidenceActions( bool enabled ) 1658void MainWindow::enableIncidenceActions( bool enabled )
1659{ 1659{
1660 mShowAction->setEnabled( enabled ); 1660 mShowAction->setEnabled( enabled );
1661 mEditAction->setEnabled( enabled ); 1661 mEditAction->setEnabled( enabled );
1662 mDeleteAction->setEnabled( enabled ); 1662 mDeleteAction->setEnabled( enabled );
1663 1663
1664 mCloneAction->setEnabled( enabled ); 1664 mCloneAction->setEnabled( enabled );
1665 mMoveAction->setEnabled( enabled ); 1665 mMoveAction->setEnabled( enabled );
1666 mBeamAction->setEnabled( enabled ); 1666 mBeamAction->setEnabled( enabled );
1667 mCancelAction->setEnabled( enabled ); 1667 mCancelAction->setEnabled( enabled );