-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d959a7a..53b65b2 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1629,134 +1629,136 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
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->type() == "Event" ) { |
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->type() == "Todo" ) { |
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 | ||
1658 | void MainWindow::enableIncidenceActions( bool enabled ) | 1658 | void 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 ); |
1668 | } | 1668 | } |
1669 | 1669 | ||
1670 | void MainWindow::importOL() | 1670 | void MainWindow::importOL() |
1671 | { | 1671 | { |
1672 | #ifdef _OL_IMPORT_ | 1672 | #ifdef _OL_IMPORT_ |
1673 | mView->clearAllViews(); | 1673 | mView->clearAllViews(); |
1674 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1674 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1675 | id->exec(); | 1675 | id->exec(); |
1676 | delete id; | 1676 | delete id; |
1677 | mView->calendar()->checkAlarmForIncidence( 0, true ); | ||
1677 | mView->updateView(); | 1678 | mView->updateView(); |
1678 | #endif | 1679 | #endif |
1679 | } | 1680 | } |
1680 | void MainWindow::importBday() | 1681 | void MainWindow::importBday() |
1681 | { | 1682 | { |
1682 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1683 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1683 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1684 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1684 | i18n("Import!"), i18n("Cancel"), 0, | 1685 | i18n("Import!"), i18n("Cancel"), 0, |
1685 | 0, 1 ); | 1686 | 0, 1 ); |
1686 | if ( result == 0 ) { | 1687 | if ( result == 0 ) { |
1687 | mView->importBday(); | 1688 | mView->importBday(); |
1688 | 1689 | ||
1689 | } | 1690 | } |
1690 | 1691 | ||
1691 | 1692 | ||
1692 | } | 1693 | } |
1693 | void MainWindow::importQtopia() | 1694 | void MainWindow::importQtopia() |
1694 | { | 1695 | { |
1695 | //#ifndef DESKTOP_VERSION | 1696 | //#ifndef DESKTOP_VERSION |
1696 | 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"); | 1697 | 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"); |
1697 | #ifdef DESKTOP_VERSION | 1698 | #ifdef DESKTOP_VERSION |
1698 | 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"); | 1699 | 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"); |
1699 | #endif | 1700 | #endif |
1700 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1701 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1701 | i18n("Import!"), i18n("Cancel"), 0, | 1702 | i18n("Import!"), i18n("Cancel"), 0, |
1702 | 0, 1 ); | 1703 | 0, 1 ); |
1703 | if ( result == 0 ) { | 1704 | if ( result == 0 ) { |
1704 | #ifndef DESKTOP_VERSION | 1705 | #ifndef DESKTOP_VERSION |
1705 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1706 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1706 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1707 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1707 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1708 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1708 | #else | 1709 | #else |
1709 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1710 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1710 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1711 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1711 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1712 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1712 | #endif | 1713 | #endif |
1713 | mView->importQtopia( categories, datebook, todolist ); | 1714 | mView->importQtopia( categories, datebook, todolist ); |
1714 | } | 1715 | } |
1716 | mView->calendar()->reInitAlarmSettings(); | ||
1715 | #if 0 | 1717 | #if 0 |
1716 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1718 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1717 | i18n("Not supported \non desktop!\n"), | 1719 | i18n("Not supported \non desktop!\n"), |
1718 | i18n("Ok"), i18n("Cancel"), 0, | 1720 | i18n("Ok"), i18n("Cancel"), 0, |
1719 | 0, 1 ); | 1721 | 0, 1 ); |
1720 | 1722 | ||
1721 | #endif | 1723 | #endif |
1722 | } | 1724 | } |
1723 | 1725 | ||
1724 | void MainWindow::saveOnClose() | 1726 | void MainWindow::saveOnClose() |
1725 | { | 1727 | { |
1726 | KOPrefs *p = KOPrefs::instance(); | 1728 | KOPrefs *p = KOPrefs::instance(); |
1727 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1729 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1728 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | 1730 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); |
1729 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | 1731 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); |
1730 | if ( filterToolBar ) { | 1732 | if ( filterToolBar ) { |
1731 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | 1733 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); |
1732 | } | 1734 | } |
1733 | #ifdef DESKTOP_VERSION | 1735 | #ifdef DESKTOP_VERSION |
1734 | 1736 | ||
1735 | QPoint myP; | 1737 | QPoint myP; |
1736 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1738 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1737 | if ( p->mToolBarHor ) | 1739 | if ( p->mToolBarHor ) |
1738 | p->mToolBarUp = myP.y() > height()/2; | 1740 | p->mToolBarUp = myP.y() > height()/2; |
1739 | else | 1741 | else |
1740 | p->mToolBarUp = myP.x() > width()/2; | 1742 | p->mToolBarUp = myP.x() > width()/2; |
1741 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1743 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1742 | if ( p->mToolBarHorV ) | 1744 | if ( p->mToolBarHorV ) |
1743 | p->mToolBarUpV = myP.y() > height()/2; | 1745 | p->mToolBarUpV = myP.y() > height()/2; |
1744 | else | 1746 | else |
1745 | p->mToolBarUpV = myP.x() > width()/2 ; | 1747 | p->mToolBarUpV = myP.x() > width()/2 ; |
1746 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1748 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1747 | if ( p->mToolBarHorN ) | 1749 | if ( p->mToolBarHorN ) |
1748 | p->mToolBarUpN = myP.y() > height()/2; | 1750 | p->mToolBarUpN = myP.y() > height()/2; |
1749 | else | 1751 | else |
1750 | p->mToolBarUpN = myP.x() > width()/2 ; | 1752 | p->mToolBarUpN = myP.x() > width()/2 ; |
1751 | if ( filterToolBar ) { | 1753 | if ( filterToolBar ) { |
1752 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1754 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1753 | if ( p->mToolBarHorF ) | 1755 | if ( p->mToolBarHorF ) |
1754 | p->mToolBarUpF = myP.y() > height()/2; | 1756 | p->mToolBarUpF = myP.y() > height()/2; |
1755 | else | 1757 | else |
1756 | p->mToolBarUpF = myP.x() > width()/2 ; | 1758 | p->mToolBarUpF = myP.x() > width()/2 ; |
1757 | } | 1759 | } |
1758 | #else | 1760 | #else |
1759 | if ( p->mToolBarHor ) | 1761 | if ( p->mToolBarHor ) |
1760 | p->mToolBarUp = iconToolBar->y() > height()/2; | 1762 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1761 | else | 1763 | else |
1762 | p->mToolBarUp = iconToolBar->x() > width()/2; | 1764 | p->mToolBarUp = iconToolBar->x() > width()/2; |