summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 98a820d..7ce0251 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1672,196 +1672,196 @@ void MainWindow::aboutKnownBugs()
1672 i18n("\nor report them in the bugtracker on\n") + 1672 i18n("\nor report them in the bugtracker on\n") +
1673 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1673 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1674 QMessageBox::NoIcon, 1674 QMessageBox::NoIcon,
1675 QMessageBox::Ok, 1675 QMessageBox::Ok,
1676 QMessageBox::NoButton, 1676 QMessageBox::NoButton,
1677 QMessageBox::NoButton); 1677 QMessageBox::NoButton);
1678 msg->exec(); 1678 msg->exec();
1679 delete msg; 1679 delete msg;
1680 1680
1681} 1681}
1682 1682
1683QString MainWindow::defaultFileName() 1683QString MainWindow::defaultFileName()
1684{ 1684{
1685 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1685 return locateLocal( "data", "korganizer/mycalendar.ics" );
1686} 1686}
1687QString MainWindow::syncFileName() 1687QString MainWindow::syncFileName()
1688{ 1688{
1689#ifdef DESKTOP_VERSION 1689#ifdef DESKTOP_VERSION
1690 return locateLocal( "tmp", "synccalendar.ics" ); 1690 return locateLocal( "tmp", "synccalendar.ics" );
1691#else 1691#else
1692 return QString( "/tmp/synccalendar.ics" ); 1692 return QString( "/tmp/synccalendar.ics" );
1693#endif 1693#endif
1694} 1694}
1695#include "koglobals.h" 1695#include "koglobals.h"
1696#include <kcalendarsystem.h> 1696#include <kcalendarsystem.h>
1697void MainWindow::updateWeek(QDate seda) 1697void MainWindow::updateWeek(QDate seda)
1698{ 1698{
1699 int weekNum = KGlobal::locale()->weekNum ( seda ); 1699 int weekNum = KGlobal::locale()->weekNum ( seda );
1700 mWeekPixmap.fill( mWeekBgColor ); 1700 mWeekPixmap.fill( mWeekBgColor );
1701 QPainter p ( &mWeekPixmap ); 1701 QPainter p ( &mWeekPixmap );
1702 p.setFont( mWeekFont ); 1702 p.setFont( mWeekFont );
1703 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1703 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1704 p.end(); 1704 p.end();
1705 QIconSet icon3 ( mWeekPixmap ); 1705 QIconSet icon3 ( mWeekPixmap );
1706 mWeekAction->setIconSet ( icon3 ); 1706 mWeekAction->setIconSet ( icon3 );
1707 1707
1708} 1708}
1709void MainWindow::updateWeekNum(const DateList &selectedDates) 1709void MainWindow::updateWeekNum(const DateList &selectedDates)
1710{ 1710{
1711 updateWeek( selectedDates.first() ); 1711 updateWeek( selectedDates.first() );
1712} 1712}
1713void MainWindow::processIncidenceSelection( Incidence *incidence ) 1713void MainWindow::processIncidenceSelection( Incidence *incidence )
1714{ 1714{
1715 if ( !incidence ) { 1715 if ( !incidence ) {
1716 mShowAction->setMenuText( i18n("Show") ); 1716 mShowAction->setMenuText( i18n("Show") );
1717 enableIncidenceActions( false ); 1717 enableIncidenceActions( false );
1718 mNewSubTodoAction->setEnabled( false ); 1718 mNewSubTodoAction->setEnabled( false );
1719 setCaptionToDates(); 1719 setCaptionToDates();
1720 return; 1720 return;
1721 } 1721 }
1722 QString startString = ""; 1722 QString startString = "";
1723 if ( incidence->typeID() != todoID ) { 1723 if ( incidence->typeID() != todoID ) {
1724 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1724 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1725 if ( incidence->doesFloat() ) { 1725 if ( incidence->doesFloat() ) {
1726 startString += ": "+incidence->dtStartDateStr( true ); 1726 startString += ": "+incidence->dtStartDateStr( true );
1727 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1727 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1728 } else { 1728 } else {
1729 startString = ": "+incidence->dtStartStr(true); 1729 startString = ": "+incidence->dtStartStr(true);
1730 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1730 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1731 } 1731 }
1732 } else { 1732 } else {
1733 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1733 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1734 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1734 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1735 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1735 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1736 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1736 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1737 bool ok; 1737 bool ok;
1738 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1738 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1739 if ( ok ) { 1739 if ( ok ) {
1740 int years = noc.date().year() - incidence->dtStart().date().year(); 1740 int years = noc.date().year() - incidence->dtStart().date().year();
1741 startString += i18n(" (%1 y.)"). arg( years ); 1741 startString += i18n(" (%1 y.)"). arg( years );
1742 } 1742 }
1743 } 1743 }
1744 else 1744 else
1745 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1745 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1746 } 1746 }
1747 } 1747 }
1748 else { 1748 else {
1749 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) 1749 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 )
1750 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); 1750 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) );
1751 else 1751 else
1752 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1752 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1753 } 1753 }
1754 if ( !incidence->location().isEmpty() ) 1754 if ( !incidence->location().isEmpty() )
1755 startString += " (" +incidence->location()+")"; 1755 startString += " (" +incidence->location()+")";
1756 setCaption( incidence->summary()+startString); 1756 setCaption( incidence->summary()+startString);
1757 enableIncidenceActions( true ); 1757 enableIncidenceActions( true );
1758 if ( incidence->typeID() == eventID ) { 1758 if ( incidence->typeID() == eventID ) {
1759 mShowAction->setMenuText( i18n("Show Event") ); 1759 mShowAction->setMenuText( i18n("Show Event") );
1760 mNewSubTodoAction->setEnabled( false ); 1760 mNewSubTodoAction->setEnabled( false );
1761 } else if ( incidence->typeID() == todoID ) { 1761 } else if ( incidence->typeID() == todoID ) {
1762 mShowAction->setMenuText( i18n("Show Todo") ); 1762 mShowAction->setMenuText( i18n("Show Todo") );
1763 mNewSubTodoAction->setEnabled( true ); 1763 mNewSubTodoAction->setEnabled( true );
1764 } else { 1764 } else {
1765 mShowAction->setMenuText( i18n("Show") ); 1765 mShowAction->setMenuText( i18n("Show") );
1766 mNewSubTodoAction->setEnabled( false ); 1766 mNewSubTodoAction->setEnabled( false );
1767 } 1767 }
1768#ifdef DESKTOP_VERSION
1768 static QPixmap jP = SmallIcon( "journal" ); 1769 static QPixmap jP = SmallIcon( "journal" );
1769 static QPixmap eP = SmallIcon( "newevent" ); 1770 static QPixmap eP = SmallIcon( "newevent" );
1770 static QPixmap tP = SmallIcon( "newtodo" ); 1771 static QPixmap tP = SmallIcon( "newtodo" );
1771#ifdef DESKTOP_VERSION
1772 QIconSet icon; 1772 QIconSet icon;
1773 if ( incidence->typeID() == todoID ) 1773 if ( incidence->typeID() == todoID )
1774 icon = QIconSet ( tP ); 1774 icon = QIconSet ( tP );
1775 else if ( incidence->typeID() == eventID ) 1775 else if ( incidence->typeID() == eventID )
1776 icon = QIconSet ( eP ); 1776 icon = QIconSet ( eP );
1777 else if ( incidence->typeID() == journalID ) 1777 else if ( incidence->typeID() == journalID )
1778 icon = QIconSet ( jP ); 1778 icon = QIconSet ( jP );
1779 mPrintSelAction->setIconSet ( icon ); 1779 mPrintSelAction->setIconSet ( icon );
1780#endif 1780#endif
1781} 1781}
1782 1782
1783void MainWindow::enableIncidenceActions( bool enabled ) 1783void MainWindow::enableIncidenceActions( bool enabled )
1784{ 1784{
1785 mShowAction->setEnabled( enabled ); 1785 mShowAction->setEnabled( enabled );
1786 mEditAction->setEnabled( enabled ); 1786 mEditAction->setEnabled( enabled );
1787 mDeleteAction->setEnabled( enabled ); 1787 mDeleteAction->setEnabled( enabled );
1788 1788
1789 mCloneAction->setEnabled( enabled ); 1789 mCloneAction->setEnabled( enabled );
1790 mMoveAction->setEnabled( enabled ); 1790 mMoveAction->setEnabled( enabled );
1791#ifndef DESKTOP_VERSION 1791#ifndef DESKTOP_VERSION
1792 mBeamAction->setEnabled( enabled ); 1792 mBeamAction->setEnabled( enabled );
1793#else 1793#else
1794 mPrintSelAction->setEnabled( enabled ); 1794 mPrintSelAction->setEnabled( enabled );
1795#endif 1795#endif
1796 mCancelAction->setEnabled( enabled ); 1796 mCancelAction->setEnabled( enabled );
1797} 1797}
1798 1798
1799void MainWindow::importOL() 1799void MainWindow::importOL()
1800{ 1800{
1801#ifdef _OL_IMPORT_ 1801#ifdef _OL_IMPORT_
1802 mView->clearAllViews(); 1802 mView->clearAllViews();
1803 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1803 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1804 id->exec(); 1804 id->exec();
1805 delete id; 1805 delete id;
1806 mView->calendar()->checkAlarmForIncidence( 0, true ); 1806 mView->calendar()->checkAlarmForIncidence( 0, true );
1807 mView->updateView(); 1807 mView->updateView();
1808#endif 1808#endif
1809} 1809}
1810void MainWindow::importBday() 1810void MainWindow::importBday()
1811{ 1811{
1812 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1812 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1813 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1813 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1814 i18n("Import!"), i18n("Cancel"), 0, 1814 i18n("Import!"), i18n("Cancel"), 0,
1815 0, 1 ); 1815 0, 1 );
1816 if ( result == 0 ) { 1816 if ( result == 0 ) {
1817 mView->importBday(); 1817 mView->importBday();
1818 1818
1819 } 1819 }
1820 1820
1821 1821
1822} 1822}
1823void MainWindow::importQtopia() 1823void MainWindow::importQtopia()
1824{ 1824{
1825 //#ifndef DESKTOP_VERSION 1825 //#ifndef DESKTOP_VERSION
1826 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"); 1826 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");
1827#ifdef DESKTOP_VERSION 1827#ifdef DESKTOP_VERSION
1828 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"); 1828 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");
1829#endif 1829#endif
1830 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1830 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1831 i18n("Import!"), i18n("Cancel"), 0, 1831 i18n("Import!"), i18n("Cancel"), 0,
1832 0, 1 ); 1832 0, 1 );
1833 if ( result == 0 ) { 1833 if ( result == 0 ) {
1834#ifndef DESKTOP_VERSION 1834#ifndef DESKTOP_VERSION
1835 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1835 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1836 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1836 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1837 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1837 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1838#else 1838#else
1839 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1839 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1840 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1840 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1841 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1841 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1842#endif 1842#endif
1843 mView->importQtopia( categories, datebook, todolist ); 1843 mView->importQtopia( categories, datebook, todolist );
1844 } 1844 }
1845 mView->calendar()->reInitAlarmSettings(); 1845 mView->calendar()->reInitAlarmSettings();
1846#if 0 1846#if 0
1847 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1847 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1848 i18n("Not supported \non desktop!\n"), 1848 i18n("Not supported \non desktop!\n"),
1849 i18n("Ok"), i18n("Cancel"), 0, 1849 i18n("Ok"), i18n("Cancel"), 0,
1850 0, 1 ); 1850 0, 1 );
1851 1851
1852#endif 1852#endif
1853} 1853}
1854 1854
1855void MainWindow::saveOnClose() 1855void MainWindow::saveOnClose()
1856{ 1856{
1857 KOPrefs *p = KOPrefs::instance(); 1857 KOPrefs *p = KOPrefs::instance();
1858 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1858 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1859 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1859 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1860 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1860 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1861 if ( filterToolBar ) { 1861 if ( filterToolBar ) {
1862 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1862 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1863 } 1863 }
1864#ifdef DESKTOP_VERSION 1864#ifdef DESKTOP_VERSION
1865 1865
1866 QPoint myP; 1866 QPoint myP;
1867 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1867 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );