summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 88dbd4f..cbf6096 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1589,194 +1589,198 @@ void MainWindow::keyBindings()
1589 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1589 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1590 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1590 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1591 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1591 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1592 i18n("<p><b>White</b>: Item readonly</p>\n"); 1592 i18n("<p><b>White</b>: Item readonly</p>\n");
1593 displayText( text, cap); 1593 displayText( text, cap);
1594} 1594}
1595void MainWindow::aboutAutoSaving() 1595void MainWindow::aboutAutoSaving()
1596{ 1596{
1597 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"); 1597 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");
1598 1598
1599 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1599 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1600 1600
1601} 1601}
1602void MainWindow::aboutKnownBugs() 1602void MainWindow::aboutKnownBugs()
1603{ 1603{
1604 QMessageBox* msg; 1604 QMessageBox* msg;
1605 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1605 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1606 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")+ 1606 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")+
1607 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1607 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1608 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1608 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1609 i18n("\nor report them in the bugtracker on\n") + 1609 i18n("\nor report them in the bugtracker on\n") +
1610 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1610 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1611 QMessageBox::NoIcon, 1611 QMessageBox::NoIcon,
1612 QMessageBox::Ok, 1612 QMessageBox::Ok,
1613 QMessageBox::NoButton, 1613 QMessageBox::NoButton,
1614 QMessageBox::NoButton); 1614 QMessageBox::NoButton);
1615 msg->exec(); 1615 msg->exec();
1616 delete msg; 1616 delete msg;
1617 1617
1618} 1618}
1619 1619
1620QString MainWindow::defaultFileName() 1620QString MainWindow::defaultFileName()
1621{ 1621{
1622 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1622 return locateLocal( "data", "korganizer/mycalendar.ics" );
1623} 1623}
1624QString MainWindow::syncFileName() 1624QString MainWindow::syncFileName()
1625{ 1625{
1626#ifdef DESKTOP_VERSION 1626#ifdef DESKTOP_VERSION
1627 return locateLocal( "tmp", "synccalendar.ics" ); 1627 return locateLocal( "tmp", "synccalendar.ics" );
1628#else 1628#else
1629 return QString( "/tmp/synccalendar.ics" ); 1629 return QString( "/tmp/synccalendar.ics" );
1630#endif 1630#endif
1631} 1631}
1632#include "koglobals.h" 1632#include "koglobals.h"
1633#include <kcalendarsystem.h> 1633#include <kcalendarsystem.h>
1634void MainWindow::updateWeek(QDate seda) 1634void MainWindow::updateWeek(QDate seda)
1635{ 1635{
1636 int weekNum = KGlobal::locale()->weekNum ( seda ); 1636 int weekNum = KGlobal::locale()->weekNum ( seda );
1637 mWeekPixmap.fill( mWeekBgColor ); 1637 mWeekPixmap.fill( mWeekBgColor );
1638 QPainter p ( &mWeekPixmap ); 1638 QPainter p ( &mWeekPixmap );
1639 p.setFont( mWeekFont ); 1639 p.setFont( mWeekFont );
1640 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1640 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1641 p.end(); 1641 p.end();
1642 QIconSet icon3 ( mWeekPixmap ); 1642 QIconSet icon3 ( mWeekPixmap );
1643 mWeekAction->setIconSet ( icon3 ); 1643 mWeekAction->setIconSet ( icon3 );
1644 1644
1645} 1645}
1646void MainWindow::updateWeekNum(const DateList &selectedDates) 1646void MainWindow::updateWeekNum(const DateList &selectedDates)
1647{ 1647{
1648 updateWeek( selectedDates.first() ); 1648 updateWeek( selectedDates.first() );
1649} 1649}
1650void MainWindow::processIncidenceSelection( Incidence *incidence ) 1650void MainWindow::processIncidenceSelection( Incidence *incidence )
1651{ 1651{
1652 if ( !incidence ) { 1652 if ( !incidence ) {
1653 mShowAction->setMenuText( i18n("Show") ); 1653 mShowAction->setMenuText( i18n("Show") );
1654 enableIncidenceActions( false ); 1654 enableIncidenceActions( false );
1655 mNewSubTodoAction->setEnabled( false ); 1655 mNewSubTodoAction->setEnabled( false );
1656 setCaptionToDates(); 1656 setCaptionToDates();
1657 return; 1657 return;
1658 } 1658 }
1659 QString startString = ""; 1659 QString startString = "";
1660 if ( incidence->typeID() != todoID ) { 1660 if ( incidence->typeID() != todoID ) {
1661 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1661 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1662 if ( incidence->doesFloat() ) { 1662 if ( incidence->doesFloat() ) {
1663 startString += ": "+incidence->dtStartDateStr( true ); 1663 startString += ": "+incidence->dtStartDateStr( true );
1664 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1664 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1665 } else { 1665 } else {
1666 startString = ": "+incidence->dtStartStr(true); 1666 startString = ": "+incidence->dtStartStr(true);
1667 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1667 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1668 } 1668 }
1669 } else { 1669 } else {
1670 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1670 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1671 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1671 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1672 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1672 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1673 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1673 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1674 bool ok; 1674 bool ok;
1675 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1675 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1676 if ( ok ) { 1676 if ( ok ) {
1677 int years = noc.date().year() - incidence->dtStart().date().year(); 1677 int years = noc.date().year() - incidence->dtStart().date().year();
1678 startString += i18n(" (%1 y.)"). arg( years ); 1678 startString += i18n(" (%1 y.)"). arg( years );
1679 } 1679 }
1680 } 1680 }
1681 else 1681 else
1682 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1682 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1683 } 1683 }
1684 } 1684 }
1685 else {
1686 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 )
1687 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) );
1685 else 1688 else
1686 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1689 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1690 }
1687 if ( !incidence->location().isEmpty() ) 1691 if ( !incidence->location().isEmpty() )
1688 startString += " (" +incidence->location()+")"; 1692 startString += " (" +incidence->location()+")";
1689 setCaption( incidence->summary()+startString); 1693 setCaption( incidence->summary()+startString);
1690 enableIncidenceActions( true ); 1694 enableIncidenceActions( true );
1691 if ( incidence->typeID() == eventID ) { 1695 if ( incidence->typeID() == eventID ) {
1692 mShowAction->setMenuText( i18n("Show Event") ); 1696 mShowAction->setMenuText( i18n("Show Event") );
1693 mNewSubTodoAction->setEnabled( false ); 1697 mNewSubTodoAction->setEnabled( false );
1694 } else if ( incidence->typeID() == todoID ) { 1698 } else if ( incidence->typeID() == todoID ) {
1695 mShowAction->setMenuText( i18n("Show Todo") ); 1699 mShowAction->setMenuText( i18n("Show Todo") );
1696 mNewSubTodoAction->setEnabled( true ); 1700 mNewSubTodoAction->setEnabled( true );
1697 } else { 1701 } else {
1698 mShowAction->setMenuText( i18n("Show") ); 1702 mShowAction->setMenuText( i18n("Show") );
1699 mNewSubTodoAction->setEnabled( false ); 1703 mNewSubTodoAction->setEnabled( false );
1700 } 1704 }
1701} 1705}
1702 1706
1703void MainWindow::enableIncidenceActions( bool enabled ) 1707void MainWindow::enableIncidenceActions( bool enabled )
1704{ 1708{
1705 mShowAction->setEnabled( enabled ); 1709 mShowAction->setEnabled( enabled );
1706 mEditAction->setEnabled( enabled ); 1710 mEditAction->setEnabled( enabled );
1707 mDeleteAction->setEnabled( enabled ); 1711 mDeleteAction->setEnabled( enabled );
1708 1712
1709 mCloneAction->setEnabled( enabled ); 1713 mCloneAction->setEnabled( enabled );
1710 mMoveAction->setEnabled( enabled ); 1714 mMoveAction->setEnabled( enabled );
1711#ifndef DESKTOP_VERSION 1715#ifndef DESKTOP_VERSION
1712 mBeamAction->setEnabled( enabled ); 1716 mBeamAction->setEnabled( enabled );
1713#endif 1717#endif
1714 mCancelAction->setEnabled( enabled ); 1718 mCancelAction->setEnabled( enabled );
1715} 1719}
1716 1720
1717void MainWindow::importOL() 1721void MainWindow::importOL()
1718{ 1722{
1719#ifdef _OL_IMPORT_ 1723#ifdef _OL_IMPORT_
1720 mView->clearAllViews(); 1724 mView->clearAllViews();
1721 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1725 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1722 id->exec(); 1726 id->exec();
1723 delete id; 1727 delete id;
1724 mView->calendar()->checkAlarmForIncidence( 0, true ); 1728 mView->calendar()->checkAlarmForIncidence( 0, true );
1725 mView->updateView(); 1729 mView->updateView();
1726#endif 1730#endif
1727} 1731}
1728void MainWindow::importBday() 1732void MainWindow::importBday()
1729{ 1733{
1730 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1734 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1731 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1735 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1732 i18n("Import!"), i18n("Cancel"), 0, 1736 i18n("Import!"), i18n("Cancel"), 0,
1733 0, 1 ); 1737 0, 1 );
1734 if ( result == 0 ) { 1738 if ( result == 0 ) {
1735 mView->importBday(); 1739 mView->importBday();
1736 1740
1737 } 1741 }
1738 1742
1739 1743
1740} 1744}
1741void MainWindow::importQtopia() 1745void MainWindow::importQtopia()
1742{ 1746{
1743 //#ifndef DESKTOP_VERSION 1747 //#ifndef DESKTOP_VERSION
1744 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1748 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1745#ifdef DESKTOP_VERSION 1749#ifdef DESKTOP_VERSION
1746 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1750 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1747#endif 1751#endif
1748 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1752 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1749 i18n("Import!"), i18n("Cancel"), 0, 1753 i18n("Import!"), i18n("Cancel"), 0,
1750 0, 1 ); 1754 0, 1 );
1751 if ( result == 0 ) { 1755 if ( result == 0 ) {
1752#ifndef DESKTOP_VERSION 1756#ifndef DESKTOP_VERSION
1753 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1757 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1754 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1758 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1755 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1759 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1756#else 1760#else
1757 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1761 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1758 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1762 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1759 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1763 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1760#endif 1764#endif
1761 mView->importQtopia( categories, datebook, todolist ); 1765 mView->importQtopia( categories, datebook, todolist );
1762 } 1766 }
1763 mView->calendar()->reInitAlarmSettings(); 1767 mView->calendar()->reInitAlarmSettings();
1764#if 0 1768#if 0
1765 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1769 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1766 i18n("Not supported \non desktop!\n"), 1770 i18n("Not supported \non desktop!\n"),
1767 i18n("Ok"), i18n("Cancel"), 0, 1771 i18n("Ok"), i18n("Cancel"), 0,
1768 0, 1 ); 1772 0, 1 );
1769 1773
1770#endif 1774#endif
1771} 1775}
1772 1776
1773void MainWindow::saveOnClose() 1777void MainWindow::saveOnClose()
1774{ 1778{
1775 KOPrefs *p = KOPrefs::instance(); 1779 KOPrefs *p = KOPrefs::instance();
1776 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1780 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1777 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1781 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1778 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1782 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1779 if ( filterToolBar ) { 1783 if ( filterToolBar ) {
1780 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1784 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1781 } 1785 }
1782#ifdef DESKTOP_VERSION 1786#ifdef DESKTOP_VERSION