summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 2da592b..8e52968 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1433,123 +1433,101 @@ void MainWindow::keyBindings()
1433 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1433 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1434 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1434 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1435 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1435 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1436 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1436 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1437 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1437 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1438 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1438 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1439 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1439 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1440 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1440 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1441 i18n("<p><b>White</b>: Item readonly</p>\n"); 1441 i18n("<p><b>White</b>: Item readonly</p>\n");
1442 displayText( text, cap); 1442 displayText( text, cap);
1443} 1443}
1444void MainWindow::aboutAutoSaving() 1444void MainWindow::aboutAutoSaving()
1445{ 1445{
1446 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) 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"); 1446 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) 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");
1447 1447
1448 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1448 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1449 1449
1450} 1450}
1451void MainWindow::aboutKnownBugs() 1451void MainWindow::aboutKnownBugs()
1452{ 1452{
1453 QMessageBox* msg; 1453 QMessageBox* msg;
1454 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1454 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1455 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1455 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1456 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1456 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1457 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1457 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1458 i18n("\nor report them in the bugtracker on\n") + 1458 i18n("\nor report them in the bugtracker on\n") +
1459 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1459 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1460 QMessageBox::NoIcon, 1460 QMessageBox::NoIcon,
1461 QMessageBox::Ok, 1461 QMessageBox::Ok,
1462 QMessageBox::NoButton, 1462 QMessageBox::NoButton,
1463 QMessageBox::NoButton); 1463 QMessageBox::NoButton);
1464 msg->exec(); 1464 msg->exec();
1465 delete msg; 1465 delete msg;
1466 1466
1467} 1467}
1468 1468
1469QString MainWindow::defaultFileName() 1469QString MainWindow::defaultFileName()
1470{ 1470{
1471 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1471 return locateLocal( "data", "korganizer/mycalendar.ics" );
1472} 1472}
1473QString MainWindow::syncFileName() 1473QString MainWindow::syncFileName()
1474{ 1474{
1475#ifdef DESKTOP_VERSION 1475#ifdef DESKTOP_VERSION
1476 return locateLocal( "tmp", "synccalendar.ics" ); 1476 return locateLocal( "tmp", "synccalendar.ics" );
1477#else 1477#else
1478 return QString( "/tmp/synccalendar.ics" ); 1478 return QString( "/tmp/synccalendar.ics" );
1479#endif 1479#endif
1480} 1480}
1481#include "koglobals.h"
1482#include <kcalendarsystem.h>
1481void MainWindow::updateWeek(QDate seda) 1483void MainWindow::updateWeek(QDate seda)
1482{ 1484{
1483 int weekNum = 0; 1485 int weekNum = KGlobal::locale()->weekNum ( seda );
1484 QDate d = QDate ( seda.year(), 1,1);
1485 seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday
1486 if ( seda.addDays(6).year() != seda.year() ) {
1487 if ( seda.year() != d.year() ) {
1488 if ( d.dayOfWeek() > 4 )
1489 d = QDate ( seda.year(), 1,1);
1490 else
1491 weekNum = 1;
1492 } else {
1493 QDate dd( seda.year()+1, 1,1);
1494 if ( dd.dayOfWeek() <= 4 )
1495 weekNum = 1;
1496 }
1497 }
1498 if ( weekNum == 0 ){
1499 int dow = d.dayOfWeek();
1500 if ( dow <= 4 )
1501 d = d.addDays( 1-dow );
1502 else // 5,6,7
1503 d = d.addDays( 8-dow );
1504 // we have the first week of the year.we are on monday
1505 weekNum = d.daysTo( seda ) / 7 +1;
1506 }
1507
1508 mWeekPixmap.fill( mWeekBgColor ); 1486 mWeekPixmap.fill( mWeekBgColor );
1509 QPainter p ( &mWeekPixmap ); 1487 QPainter p ( &mWeekPixmap );
1510 p.setFont( mWeekFont ); 1488 p.setFont( mWeekFont );
1511 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1489 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1512 p.end(); 1490 p.end();
1513 QIconSet icon3 ( mWeekPixmap ); 1491 QIconSet icon3 ( mWeekPixmap );
1514 mWeekAction->setIconSet ( icon3 ); 1492 mWeekAction->setIconSet ( icon3 );
1515 1493
1516} 1494}
1517void MainWindow::updateWeekNum(const DateList &selectedDates) 1495void MainWindow::updateWeekNum(const DateList &selectedDates)
1518{ 1496{
1519 updateWeek( selectedDates.first() ); 1497 updateWeek( selectedDates.first() );
1520} 1498}
1521void MainWindow::processIncidenceSelection( Incidence *incidence ) 1499void MainWindow::processIncidenceSelection( Incidence *incidence )
1522{ 1500{
1523 1501
1524 if ( !incidence ) { 1502 if ( !incidence ) {
1525 enableIncidenceActions( false ); 1503 enableIncidenceActions( false );
1526 1504
1527 mNewSubTodoAction->setEnabled( false ); 1505 mNewSubTodoAction->setEnabled( false );
1528 setCaptionToDates(); 1506 setCaptionToDates();
1529 return; 1507 return;
1530 1508
1531 } 1509 }
1532 1510
1533 //KGlobal::locale()->formatDateTime(nextA, true); 1511 //KGlobal::locale()->formatDateTime(nextA, true);
1534 QString startString = ""; 1512 QString startString = "";
1535 if ( incidence->type() != "Todo" ) { 1513 if ( incidence->type() != "Todo" ) {
1536 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1514 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1537 if ( incidence->doesFloat() ) { 1515 if ( incidence->doesFloat() ) {
1538 startString += ": "+incidence->dtStartDateStr( true ); 1516 startString += ": "+incidence->dtStartDateStr( true );
1539 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1517 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1540 1518
1541 } else { 1519 } else {
1542 startString = ": "+incidence->dtStartStr(true); 1520 startString = ": "+incidence->dtStartStr(true);
1543 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1521 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1544 1522
1545 } 1523 }
1546 1524
1547 } else { 1525 } else {
1548 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1526 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1549 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1527 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1550 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1528 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1551 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { 1529 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) {
1552 bool ok; 1530 bool ok;
1553 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1531 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1554 if ( ok ) { 1532 if ( ok ) {
1555 int years = noc.date().year() - incidence->dtStart().date().year(); 1533 int years = noc.date().year() - incidence->dtStart().date().year();