-rw-r--r-- | korganizer/mainwindow.cpp | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 5d26d35..88dbd4f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -798,7 +798,7 @@ void MainWindow::initActions() | |||
798 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 798 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
799 | 799 | ||
800 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 800 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
801 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 801 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); |
802 | mShowAction->addTo( mCurrentItemMenu ); | 802 | mShowAction->addTo( mCurrentItemMenu ); |
803 | connect( mShowAction, SIGNAL( activated() ), | 803 | connect( mShowAction, SIGNAL( activated() ), |
804 | mView, SLOT( showIncidence() ) ); | 804 | mView, SLOT( showIncidence() ) ); |
@@ -822,10 +822,12 @@ void MainWindow::initActions() | |||
822 | mMoveAction->addTo( mCurrentItemMenu ); | 822 | mMoveAction->addTo( mCurrentItemMenu ); |
823 | connect( mMoveAction, SIGNAL( activated() ), | 823 | connect( mMoveAction, SIGNAL( activated() ), |
824 | mView, SLOT( moveIncidence() ) ); | 824 | mView, SLOT( moveIncidence() ) ); |
825 | #ifndef DESKTOP_VERSION | ||
825 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 826 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
826 | mBeamAction->addTo(mCurrentItemMenu ); | 827 | mBeamAction->addTo(mCurrentItemMenu ); |
827 | connect( mBeamAction, SIGNAL( activated() ), | 828 | connect( mBeamAction, SIGNAL( activated() ), |
828 | mView, SLOT( beamIncidence() ) ); | 829 | mView, SLOT( beamIncidence() ) ); |
830 | #endif | ||
829 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 831 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
830 | mCancelAction->addTo( mCurrentItemMenu ); | 832 | mCancelAction->addTo( mCurrentItemMenu ); |
831 | connect( mCancelAction, SIGNAL( activated() ), | 833 | connect( mCancelAction, SIGNAL( activated() ), |
@@ -1647,35 +1649,27 @@ void MainWindow::updateWeekNum(const DateList &selectedDates) | |||
1647 | } | 1649 | } |
1648 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1650 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1649 | { | 1651 | { |
1650 | |||
1651 | if ( !incidence ) { | 1652 | if ( !incidence ) { |
1653 | mShowAction->setMenuText( i18n("Show") ); | ||
1652 | enableIncidenceActions( false ); | 1654 | enableIncidenceActions( false ); |
1653 | |||
1654 | mNewSubTodoAction->setEnabled( false ); | 1655 | mNewSubTodoAction->setEnabled( false ); |
1655 | setCaptionToDates(); | 1656 | setCaptionToDates(); |
1656 | return; | 1657 | return; |
1657 | |||
1658 | } | 1658 | } |
1659 | |||
1660 | //KGlobal::locale()->formatDateTime(nextA, true); | ||
1661 | QString startString = ""; | 1659 | QString startString = ""; |
1662 | if ( incidence->typeID() != todoID ) { | 1660 | if ( incidence->typeID() != todoID ) { |
1663 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1661 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1664 | if ( incidence->doesFloat() ) { | 1662 | if ( incidence->doesFloat() ) { |
1665 | startString += ": "+incidence->dtStartDateStr( true ); | 1663 | startString += ": "+incidence->dtStartDateStr( true ); |
1666 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1664 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1667 | |||
1668 | } else { | 1665 | } else { |
1669 | startString = ": "+incidence->dtStartStr(true); | 1666 | startString = ": "+incidence->dtStartStr(true); |
1670 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1667 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1671 | |||
1672 | } | 1668 | } |
1673 | |||
1674 | } else { | 1669 | } else { |
1675 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1670 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1676 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1671 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1677 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1672 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1678 | |||
1679 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1673 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1680 | bool ok; | 1674 | bool ok; |
1681 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1675 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
@@ -1687,33 +1681,21 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1687 | else | 1681 | else |
1688 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1682 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1689 | } | 1683 | } |
1690 | |||
1691 | } | 1684 | } |
1692 | else | 1685 | else |
1693 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1686 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1694 | if ( !incidence->location().isEmpty() ) | 1687 | if ( !incidence->location().isEmpty() ) |
1695 | startString += " (" +incidence->location()+")"; | 1688 | startString += " (" +incidence->location()+")"; |
1696 | setCaption( incidence->summary()+startString); | 1689 | setCaption( incidence->summary()+startString); |
1697 | |||
1698 | enableIncidenceActions( true ); | 1690 | enableIncidenceActions( true ); |
1699 | |||
1700 | if ( incidence->typeID() == eventID ) { | 1691 | if ( incidence->typeID() == eventID ) { |
1701 | mShowAction->setText( i18n("Show Event...") ); | 1692 | mShowAction->setMenuText( i18n("Show Event") ); |
1702 | mEditAction->setText( i18n("Edit Event...") ); | ||
1703 | mDeleteAction->setText( i18n("Delete Event...") ); | ||
1704 | |||
1705 | mNewSubTodoAction->setEnabled( false ); | 1693 | mNewSubTodoAction->setEnabled( false ); |
1706 | } else if ( incidence->typeID() == todoID ) { | 1694 | } else if ( incidence->typeID() == todoID ) { |
1707 | mShowAction->setText( i18n("Show Todo...") ); | 1695 | mShowAction->setMenuText( i18n("Show Todo") ); |
1708 | mEditAction->setText( i18n("Edit Todo...") ); | ||
1709 | mDeleteAction->setText( i18n("Delete Todo...") ); | ||
1710 | |||
1711 | mNewSubTodoAction->setEnabled( true ); | 1696 | mNewSubTodoAction->setEnabled( true ); |
1712 | } else { | 1697 | } else { |
1713 | mShowAction->setText( i18n("Show...") ); | 1698 | mShowAction->setMenuText( i18n("Show") ); |
1714 | mShowAction->setText( i18n("Edit...") ); | ||
1715 | mShowAction->setText( i18n("Delete...") ); | ||
1716 | |||
1717 | mNewSubTodoAction->setEnabled( false ); | 1699 | mNewSubTodoAction->setEnabled( false ); |
1718 | } | 1700 | } |
1719 | } | 1701 | } |
@@ -1726,7 +1708,9 @@ void MainWindow::enableIncidenceActions( bool enabled ) | |||
1726 | 1708 | ||
1727 | mCloneAction->setEnabled( enabled ); | 1709 | mCloneAction->setEnabled( enabled ); |
1728 | mMoveAction->setEnabled( enabled ); | 1710 | mMoveAction->setEnabled( enabled ); |
1711 | #ifndef DESKTOP_VERSION | ||
1729 | mBeamAction->setEnabled( enabled ); | 1712 | mBeamAction->setEnabled( enabled ); |
1713 | #endif | ||
1730 | mCancelAction->setEnabled( enabled ); | 1714 | mCancelAction->setEnabled( enabled ); |
1731 | } | 1715 | } |
1732 | 1716 | ||