author | zautrix <zautrix> | 2005-07-29 18:10:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-29 18:10:22 (UTC) |
commit | 48a8fa71f1985fea9df4981808796ef65f0f974a (patch) (unidiff) | |
tree | 960705d669093b067b9ce06456e2aea5aeb92958 | |
parent | 9553b882522708477d131d0d9a2c581724940ba3 (diff) | |
download | kdepimpi-48a8fa71f1985fea9df4981808796ef65f0f974a.zip kdepimpi-48a8fa71f1985fea9df4981808796ef65f0f974a.tar.gz kdepimpi-48a8fa71f1985fea9df4981808796ef65f0f974a.tar.bz2 |
fix
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
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 | |||
@@ -1704,132 +1704,132 @@ void MainWindow::updateWeek(QDate seda) | |||
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 | } |
1709 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1709 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1710 | { | 1710 | { |
1711 | updateWeek( selectedDates.first() ); | 1711 | updateWeek( selectedDates.first() ); |
1712 | } | 1712 | } |
1713 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1713 | void 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 | ||
1783 | void MainWindow::enableIncidenceActions( bool enabled ) | 1783 | void 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 | ||
1799 | void MainWindow::importOL() | 1799 | void 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 | } |
1810 | void MainWindow::importBday() | 1810 | void 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 | } |
1823 | void MainWindow::importQtopia() | 1823 | void 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"); |