diff -r 579cc610882e -r ef813d54df51 calendarui/agendaeventviewer/src/agendaeventview.cpp --- a/calendarui/agendaeventviewer/src/agendaeventview.cpp Tue Jul 06 14:14:56 2010 +0300 +++ b/calendarui/agendaeventviewer/src/agendaeventview.cpp Wed Aug 18 09:47:38 2010 +0300 @@ -45,17 +45,24 @@ #include //maptile service #include #include -#include +#include + +#include "calenagendautils.h" #include "agendaeventview.h" #include "agendaeventviewerdocloader.h" #include "agendaeventviewercommon.h" #include "agendaeventviewer_p.h" #include "agendaeventvieweritem.h" #include "calendateutils.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "agendaeventviewTraces.h" +#endif + // Constants -#define CHARACTER_HYPHEN "-" #define CHARACTER_SPACE " " -#define CHARACTER_NEW_LINE "\n" +#define CHARACTER_HYPHEN " - " + //This Property is use for setting a primary left icon static const char *primaryLeftIconItem("leftPrimaryIconItem"); @@ -89,7 +96,8 @@ mMaptileStatus(-1), mNotesPluginLoaded(false) { - + OstTraceFunctionEntry0( AGENDAEVENTVIEW_AGENDAEVENTVIEW_ENTRY ); + mTranslator->loadCommon(); mDocLoader = new AgendaEventViewerDocLoader; // Load to-do viewer's docml. @@ -148,6 +156,7 @@ } + OstTraceFunctionExit0( AGENDAEVENTVIEW_AGENDAEVENTVIEW_EXIT ); } /*! @@ -155,6 +164,7 @@ */ AgendaEventView::~AgendaEventView() { + OstTraceFunctionEntry0( DUP1_AGENDAEVENTVIEW_AGENDAEVENTVIEW_ENTRY ); // Remove the translator if (mTranslator) { @@ -188,6 +198,7 @@ mProgressTimer = NULL; } + OstTraceFunctionExit0( DUP1_AGENDAEVENTVIEW_AGENDAEVENTVIEW_EXIT ); } /*! @@ -198,6 +209,7 @@ void AgendaEventView::execute(AgendaEntry entry, AgendaEventViewer::Actions action) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_EXECUTE_ENTRY ); mOriginalAgendaEntry = entry; mAgendaEntry = entry; @@ -247,6 +259,7 @@ connect(mBackAction, SIGNAL(triggered()), this, SLOT(close())); + OstTraceFunctionExit0( AGENDAEVENTVIEW_EXECUTE_EXIT ); } /*! @@ -254,6 +267,7 @@ */ void AgendaEventView::addViewerData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDVIEWERDATA_ENTRY ); // Add the title to event viewer. addGroupBoxData(); @@ -289,6 +303,7 @@ // Set the description. addDescriptionData(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDVIEWERDATA_EXIT ); } /*! @@ -296,6 +311,7 @@ */ void AgendaEventView::addMenuItem() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDMENUITEM_ENTRY ); if (mAgendaEntry.type() == AgendaEntry::TypeTodo) { @@ -313,6 +329,7 @@ SLOT(markTodoStatus())); menu->addAction(mMarkTodoAction); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDMENUITEM_EXIT ); } /*! @@ -320,6 +337,7 @@ */ void AgendaEventView::addToolBarItem(AgendaEventViewer::Actions action) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDTOOLBARITEM_ENTRY ); HbToolBar *toolBar = qobject_cast ( mDocLoader->findWidget(AGENDA_EVENT_VIEWER_TOOLBAR)); @@ -350,6 +368,7 @@ toolBar->addAction(saveAction); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDTOOLBARITEM_EXIT ); } /*! @@ -357,6 +376,7 @@ */ void AgendaEventView::addGroupBoxData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDGROUPBOXDATA_ENTRY ); HbGroupBox *groupBox = qobject_cast ( mDocLoader->findWidget(AGENDA_EVENT_VIEWER_GROUPBOX)); @@ -364,13 +384,13 @@ AgendaEntry::Type entryType = mAgendaEntry.type(); if (entryType == AgendaEntry::TypeTodo) { groupBox->setHeading(hbTrId("txt_calendar_subhead_to_do")); + } else if (CalenAgendaUtils::isAlldayEvent(mAgendaEntry)) { + groupBox->setHeading(hbTrId("txt_calendar_subhead_all_day_event")); } else if (entryType == AgendaEntry::TypeAppoinment) { groupBox->setHeading(hbTrId("txt_calendar_subhead_meeting")); - }else if (entryType == AgendaEntry::TypeEvent) { - //TODO: Add text id once available - groupBox->setHeading(hbTrId("All day event")); - } + } + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDGROUPBOXDATA_EXIT ); } /*! @@ -378,6 +398,7 @@ */ void AgendaEventView::addSubjectAndPriorityData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDSUBJECTANDPRIORITYDATA_ENTRY ); QStringList itemList; itemList.append(hbTrId("txt_calendar_dblist_subject")); @@ -401,6 +422,7 @@ mSubjectWidget->setEventViewerItemData(itemList, Qt::DecorationRole); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDSUBJECTANDPRIORITYDATA_EXIT ); } /*! @@ -408,6 +430,7 @@ */ void AgendaEventView::addDateTimeData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDDATETIMEDATA_ENTRY ); QStringList itemData; HbExtendedLocale systemLocale = HbExtendedLocale::system(); @@ -418,7 +441,7 @@ itemData.append(QString::null); itemData.append("qtg_small_calendar"); - mDateTimeWidget->setProperty(primaryLeftIconItem, false); + mDateTimeWidget->setProperty(primaryLeftIconItem, false); mDateTimeWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); @@ -431,56 +454,61 @@ QString data; // Add agenda entry specific fields to the viewer + switch (mAgendaEntry.type()) { case AgendaEntry::TypeAppoinment: - - startTimeText.append(systemLocale.format( - startDateTime.time(), r_qtn_time_usual_with_zero)); - - endTimeText.append(systemLocale.format(endDateTime.time(), - r_qtn_time_usual_with_zero)); - startDateText.append( - systemLocale.format(startDateTime.date(), - r_qtn_date_usual_with_zero)); - if (CalenDateUtils::onSameDay(startDateTime, endDateTime)) { - data.append(hbTrId("txt_calendar_dblist_start_end_time").arg( - startTimeText).arg(endTimeText)); - data.append(CHARACTER_SPACE); - data.append(hbTrId("txt_calendar_dblist_meeting_date").arg( - startDateText)); - } else { - data.append(hbTrId("txt_calendar_dblist_start_time_date").arg( - startTimeText).arg(startDateText)); - QString endDateText; - endDateText.append( - systemLocale.format(endDateTime.date(), - r_qtn_date_usual_with_zero)); - data.append(hbTrId("txt_calendar_dblist_end_time_date").arg( - endTimeText).arg(endDateText)); - } + case AgendaEntry::TypeEvent: + // Check if entry is an all-day + if (CalenAgendaUtils::isAlldayEvent(mAgendaEntry)) { + dateTimeText.append(systemLocale.format(startDateTime.date(), + r_qtn_date_usual_with_zero)); + if (CalenDateUtils::onSameDay(startDateTime, endDateTime.addSecs(-60))) { + data.append(dateTimeText); + } else { + QString endDate; + endDate.append( + systemLocale.format(endDateTime.addSecs(-60).date(), + r_qtn_date_usual_with_zero)); + data.append(dateTimeText); + data.append(" - "); + data.append(endDate); + } + } else { + startTimeText.append(systemLocale.format( + startDateTime.time(), r_qtn_time_usual_with_zero)); + + endTimeText.append(systemLocale.format(endDateTime.time(), + r_qtn_time_usual_with_zero)); + startDateText.append( + systemLocale.format(startDateTime.date(), + r_qtn_date_usual_with_zero)); + if (CalenDateUtils::onSameDay(startDateTime, endDateTime)) { + data.append(startTimeText); + data.append(CHARACTER_HYPHEN); + data.append(endTimeText); + data.append(CHARACTER_SPACE); + data.append(startDateText); + } else { + // If both start and end time of a meeting are on different dates + data.append(startTimeText); + data.append(CHARACTER_SPACE); + data.append(startDateText); + QString endDateText; + endDateText.append( + systemLocale.format(endDateTime.date(), + r_qtn_date_usual_with_zero)); + data.append(CHARACTER_HYPHEN); + data.append(endTimeText); + data.append(CHARACTER_SPACE); + data.append(endDateText); + } + } break; case AgendaEntry::TypeAnniversary: case AgendaEntry::TypeTodo: dateTimeText.append(systemLocale.format(endDateTime.date(), - r_qtn_date_usual_with_zero)); - data.append(hbTrId( - "txt_calendar_dblist_meeting_date").arg(dateTimeText)); - break; - case AgendaEntry::TypeEvent: - - dateTimeText.append(systemLocale.format(startDateTime.date(), - r_qtn_date_usual_with_zero)); - if (CalenDateUtils::onSameDay(startDateTime, endDateTime.addSecs(-60))) { - data.append(hbTrId("txt_calendar_dblist_meeting_date").arg( - dateTimeText)); - } else { - QString endDate; - endDate.append( - systemLocale.format(endDateTime.addSecs(-60).date(), - r_qtn_date_usual_with_zero)); - data.append(hbTrId("txt_calendar_dblist_start_end_time").arg( - dateTimeText).arg(endDate)); - } + r_qtn_date_usual_with_zero)); + data.append(dateTimeText); break; default: break; @@ -488,6 +516,7 @@ itemData.append(data); mDateTimeWidget->setEventViewerItemData(itemData, Qt::DisplayRole); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDDATETIMEDATA_EXIT ); } /*! @@ -495,10 +524,11 @@ */ void AgendaEventView::addLocationData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDLOCATIONDATA_ENTRY ); QStringList itemData; QString progressIcon(QString::null); if ( mLocationFeatureEnabled ) { - getProgressIndicatorstatus(progressIcon); + getProgressIndicatorstatus(progressIcon); } if( progressIcon.isNull() ) { itemData.append(QString::null); @@ -517,6 +547,7 @@ itemData.append(QString::null); itemData.append(mAgendaEntry.location()); mLocationWidget->setEventViewerItemData(itemData, Qt::DisplayRole); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDLOCATIONDATA_EXIT ); } /*! @@ -524,18 +555,25 @@ */ void AgendaEventView::addMapTileImage() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDMAPTILEIMAGE_ENTRY ); if (mLocationFeatureEnabled && !mAgendaEntry.location().isEmpty() && !mMaptilePath.isEmpty()) { HbIcon maptile(mMaptilePath); mMaptileLabel->setIcon(maptile); - mMaptileLabel->setPreferredSize(QSizeF(maptile.width(), maptile.height())); + //get the margin size + qreal left, bottom; + mMaptileLabel->getContentsMargins( &left, 0, 0, &bottom ); + mMaptileLabel->setPreferredSize( + QSizeF( maptile.width() + left, maptile.height() + bottom ) ); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDMAPTILEIMAGE_EXIT ); } /*! Add reminder data to Event viewer */ void AgendaEventView::addReminderData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDREMINDERDATA_ENTRY ); QStringList itemData; itemData.append(QString::null); itemData.append(QString::null); @@ -546,20 +584,23 @@ itemData.append(QString::null); itemData.append(alarmTimeText()); mReminderWidget->setEventViewerItemData(itemData, Qt::DisplayRole); - } + mReminderWidgetAdded = true; + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDREMINDERDATA_EXIT ); +} /*! Add completed to-do data to Event viewer */ void AgendaEventView::addCompletedTodoData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDCOMPLETEDTODODATA_ENTRY ); QStringList itemData; - QString completedText; - HbExtendedLocale systemLocale = HbExtendedLocale::system();; - itemData.append(QString::null); + QString completedText; + HbExtendedLocale systemLocale = HbExtendedLocale::system();; itemData.append(QString::null); itemData.append(QString::null); - mReminderWidget->setProperty(primaryLeftIconItem, false); + itemData.append(QString::null); + mReminderWidget->setProperty(primaryLeftIconItem, true); mReminderWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); completedText = systemLocale.format(mAgendaEntry.completedDateTime().date(), @@ -567,6 +608,7 @@ itemData.append(hbTrId("txt_calendar_dblist_completed_date")); itemData.append(completedText); mReminderWidget->setEventViewerItemData(itemData, Qt::DisplayRole); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDCOMPLETEDTODODATA_EXIT ); } /*! @@ -574,16 +616,22 @@ */ void AgendaEventView::addRepeatData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDREPEATDATA_ENTRY ); QStringList itemData; itemData.append(QString::null); itemData.append(QString::null); - itemData.append("qtg_small_repeat"); + if(!mAgendaEntry.recurrenceId().isNull()) { + itemData.append("qtg_small_repeat_exception"); + }else { + itemData.append("qtg_small_repeat"); + } mRepeatWidget->setProperty(primaryLeftIconItem, false); mRepeatWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); itemData.append(QString::null); itemData.append(repeatRule()); mRepeatWidget->setEventViewerItemData(itemData, Qt::DisplayRole); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDREPEATDATA_EXIT ); } /*! @@ -591,16 +639,18 @@ */ void AgendaEventView::addDescriptionData() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDDESCRIPTIONDATA_ENTRY ); QStringList itemData; itemData.append(QString::null); itemData.append(QString::null); itemData.append(QString::null); - mDescriptionWidget->setProperty(primaryLeftIconItem, false); + mDescriptionWidget->setProperty(primaryLeftIconItem, true); mDescriptionWidget->setEventViewerItemData(itemData, Qt::DecorationRole); itemData.clear(); itemData.append(hbTrId("txt_calendar_dblist_description")); itemData.append(mAgendaEntry.description()); mDescriptionWidget->setEventViewerItemData(itemData, Qt::DisplayRole); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDDESCRIPTIONDATA_EXIT ); } /*! @@ -608,6 +658,7 @@ */ void AgendaEventView::getPriorityIcon(int priority, QString &priorityIcon) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_GETPRIORITYICON_ENTRY ); switch(priority) { case 1:priorityIcon.append("qtg_small_priority_high"); @@ -618,16 +669,27 @@ break; } + OstTraceFunctionExit0( AGENDAEVENTVIEW_GETPRIORITYICON_EXIT ); } /*! Returns repeat rule */ -QString AgendaEventView::repeatRule() const +QString AgendaEventView::repeatRule() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_REPEATRULE_ENTRY ); QString repeatRule; - AgendaRepeatRule agendaRepeatRule = mAgendaEntry.repeatRule(); + AgendaRepeatRule agendaRepeatRule; + if (mAgendaEntry.isRepeating()) { + agendaRepeatRule = mAgendaEntry.repeatRule(); + } else { + if (!mAgendaEntry.recurrenceId().isNull()) { + AgendaEntry parentEntry= mOwner->mAgendaUtil->parentEntry(mAgendaEntry); + agendaRepeatRule = parentEntry.repeatRule(); + } + } + if (agendaRepeatRule.type() != AgendaRepeatRule::InvalidRule) { switch (agendaRepeatRule.type()) { @@ -636,7 +698,8 @@ break; case AgendaRepeatRule::WeeklyRule: if (AgendaUtil::isWorkdaysRepeatingEntry(agendaRepeatRule)) { - repeatRule.append(hbTrId("txt_calendar_dblist_repeats_workdays")); + repeatRule.append( + hbTrId("txt_calendar_dblist_repeats_workdays")); } else { if (agendaRepeatRule.interval() == 2) { repeatRule.append( @@ -658,16 +721,17 @@ default: break; } - repeatRule.append(CHARACTER_NEW_LINE); + repeatRule.append(CHARACTER_SPACE); HbExtendedLocale systemLocale = HbExtendedLocale::system(); QString untilDateString = systemLocale.format( - mAgendaEntry.repeatRule().until().date(), - r_qtn_date_usual_with_zero); + agendaRepeatRule.until().date(), + r_qtn_date_usual_with_zero); repeatRule.append( hbTrId("txt_calendar_dblist_repeats_daily_val_until_1"). arg(untilDateString)); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_REPEATRULE_EXIT ); return repeatRule; } @@ -678,6 +742,7 @@ */ QString AgendaEventView::alarmTimeText() const { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ALARMTIMETEXT_ENTRY ); QString alarmDateTimeText; QDateTime startTime; @@ -694,14 +759,17 @@ alarmDateTime = startTime.addSecs(-alarmTimeOffsetInMinutes * 60); HbExtendedLocale systemLocale = HbExtendedLocale::system(); - alarmDateTimeText.append( - hbTrId("txt_calendar_list_reminder_time_date").arg( - systemLocale.format(alarmDateTime.time(), - r_qtn_time_usual_with_zero)).arg( - systemLocale.format(alarmDateTime.date(), - r_qtn_date_usual_with_zero))); + alarmDateTimeText.append(systemLocale.format(alarmDateTime.time(), + r_qtn_time_usual_with_zero)); + // Show the alarm date only if its not on the same day of the entry + if (!CalenDateUtils::onSameDay(alarmDateTime, startTime)) { + alarmDateTimeText.append(CHARACTER_SPACE); + alarmDateTimeText.append(systemLocale.format(alarmDateTime.date(), + r_qtn_date_usual_with_zero)); + } } + OstTraceFunctionExit0( AGENDAEVENTVIEW_ALARMTIMETEXT_EXIT ); return alarmDateTimeText; } @@ -710,6 +778,7 @@ */ void AgendaEventView::removeWidget() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_REMOVEWIDGET_ENTRY ); if (mAgendaEntry.location().isEmpty()) { mLocationWidget->hide(); @@ -717,9 +786,9 @@ } QFile file(mMaptilePath); - if ( !mLocationFeatureEnabled || !file.exists() - || mAgendaEntry.location().isEmpty()){ - //code added to hide and remove maptile image + if (!mLocationFeatureEnabled || !file.exists() + || mAgendaEntry.location().isEmpty()) { + //code added to hide and remove maptile image mMaptileLabel->hide(); mLinearLayout->removeItem(mMaptileLabel); } @@ -739,7 +808,16 @@ } } - if (mAgendaEntry.repeatRule().type() == AgendaRepeatRule::InvalidRule) { + // Check whether the entry is a completed To-do. if so then remove the + // time and date widget. + if (mAgendaEntry.type() == AgendaEntry::TypeTodo && + AgendaEntry::TodoCompleted == mAgendaEntry.status()) { + mDateTimeWidget->hide(); + mLinearLayout->removeItem(mDateTimeWidget); + } + + if ((mAgendaEntry.repeatRule().type() == AgendaRepeatRule::InvalidRule) && + (mAgendaEntry.recurrenceId().isNull())) { mRepeatWidget->hide(); mLinearLayout->removeItem(mRepeatWidget); } @@ -752,16 +830,26 @@ mLinearLayout->invalidate(); mLinearLayout->activate(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_REMOVEWIDGET_EXIT ); } /*! - Update the completed to-do or reminder data to event viewer. + Update all the fields according to to-do status change.. */ -void AgendaEventView::updateCompletedReminderData() +void AgendaEventView::updateFieldsforTodoStatus() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_UPDATEFIELDSFORTODOSTATUS_ENTRY ); if (AgendaEntry::TodoCompleted == mAgendaEntry.status()) { + + // For completed to-do due date and time should be removed. + mDateTimeWidget->hide(); + mLinearLayout->removeItem(mDateTimeWidget); + + // Fill the completed data information. addCompletedTodoData(); + + // Add the completed date to thte viewer. if (!mReminderWidgetAdded) { mReminderWidget->show(); mLinearLayout->insertItem(2, mReminderWidget); @@ -769,6 +857,10 @@ } } else { + // Add the date and time widget to the viewer. + mDateTimeWidget->show(); + mLinearLayout->insertItem(1, mDateTimeWidget); + if (!mAgendaEntry.alarm().isNull()) { addReminderData(); if (!mReminderWidgetAdded) { @@ -777,6 +869,7 @@ mReminderWidgetAdded = true; } } else { + // Remove the completed date from the viewer. if (mReminderWidgetAdded) { mReminderWidget->hide(); mLinearLayout->removeItem(mReminderWidget); @@ -785,9 +878,12 @@ } } + // The To-do icon changes according to the To-do status change. + updateSubjectandPriorityData(); mLinearLayout->invalidate(); mLinearLayout->activate(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_UPDATEFIELDSFORTODOSTATUS_EXIT ); } /*! @@ -795,6 +891,7 @@ */ void AgendaEventView::removeAllWidgets() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_REMOVEALLWIDGETS_ENTRY ); for (int i = 2; i < mLinearLayout->count(); i++) { mLinearLayout->removeAt(i); @@ -802,6 +899,7 @@ mLinearLayout->invalidate(); mLinearLayout->activate(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_REMOVEALLWIDGETS_EXIT ); } /*! @@ -809,6 +907,7 @@ */ void AgendaEventView::addAllWidgets() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_ADDALLWIDGETS_ENTRY ); mLinearLayout->addItem(mLocationWidget); mLocationWidget->show(); @@ -824,6 +923,7 @@ mLinearLayout->invalidate(); mLinearLayout->activate(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_ADDALLWIDGETS_EXIT ); } /*! @@ -831,6 +931,7 @@ */ void AgendaEventView::showDeleteOccurencePopup() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_SHOWDELETEOCCURENCEPOPUP_ENTRY ); HbDialog *popUp = new HbDialog(); popUp->setDismissPolicy(HbDialog::NoDismiss); popUp->setTimeout(HbDialog::NoTimeout); @@ -859,11 +960,12 @@ connect(deleteButtonList, SIGNAL(itemSelected(int)), popUp, SLOT(close())); popUp->addAction(new HbAction( - hbTrId("txt_calendar_button_softkey1_cancel"))); + hbTrId("txt_common_button_cancel_singledialog"))); // Show the popup popUp->open(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_SHOWDELETEOCCURENCEPOPUP_EXIT ); } /*! @@ -871,6 +973,7 @@ */ void AgendaEventView::showDeleteConfirmationQuery() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_SHOWDELETECONFIRMATIONQUERY_ENTRY ); HbMessageBox *popup = new HbMessageBox(HbMessageBox::MessageTypeQuestion); popup->setDismissPolicy(HbDialog::NoDismiss); @@ -882,9 +985,15 @@ switch (mAgendaEntry.type()) { case AgendaEntry::TypeAppoinment: case AgendaEntry::TypeEvent: { - text.append(hbTrId("txt_calendar_info_delete_meeting")); - break; - } + // Check for all-day + if (CalenAgendaUtils::isAlldayEvent(mAgendaEntry)) { + text.append(hbTrId("txt_calendar_info_delete_allday_event")); + } else { + text.append(hbTrId("txt_calendar_info_delete_meeting")); + } + + break; + } case AgendaEntry::TypeAnniversary: { text.append(hbTrId("txt_calendar_info_delete_anniversary")); break; @@ -910,8 +1019,9 @@ popup->addAction(deleteAction); connect(deleteAction, SIGNAL(triggered()), this , SLOT(handleDeleteAction())); - popup->addAction(new HbAction(hbTrId("txt_calendar_button_cancel"), popup)); + popup->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popup)); popup->open(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_SHOWDELETECONFIRMATIONQUERY_EXIT ); } /*! @@ -919,6 +1029,7 @@ */ void AgendaEventView::handleDeleteAction() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLEDELETEACTION_ENTRY ); // If delete button is pressed delete the entry // To notify client that deleting Started // Calendar Application changing state from viewing to deleting. @@ -926,6 +1037,7 @@ // Delete the entry. mOwner->mAgendaUtil->deleteEntry(mAgendaEntry.id()); + OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLEDELETEACTION_EXIT ); } /*! @@ -933,6 +1045,7 @@ */ void AgendaEventView::markTodoStatus() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_MARKTODOSTATUS_ENTRY ); QDateTime currentDateTime = QDateTime::currentDateTime(); @@ -951,8 +1064,9 @@ mOwner->mAgendaUtil->setCompleted(mAgendaEntry, false, currentDateTime); } - updateCompletedReminderData(); + updateFieldsforTodoStatus(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_MARKTODOSTATUS_EXIT ); } /*! @@ -960,6 +1074,7 @@ */ void AgendaEventView::edit() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_EDIT_ENTRY ); mOwner->editingStarted(); @@ -998,6 +1113,7 @@ } + OstTraceFunctionExit0( AGENDAEVENTVIEW_EDIT_EXIT ); } /*! @@ -1005,6 +1121,7 @@ */ void AgendaEventView::deleteAgendaEntry() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_DELETEAGENDAENTRY_ENTRY ); // Before we do anything, check in the entry is repeating // OR its a child item @@ -1019,6 +1136,7 @@ showDeleteConfirmationQuery(); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_DELETEAGENDAENTRY_EXIT ); } /*! @@ -1026,18 +1144,21 @@ */ void AgendaEventView::saveAgendaEntry() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_SAVEAGENDAENTRY_ENTRY ); // Save entry to calendar. - mOwner->mAgendaUtil->addEntry(mAgendaEntry); + mOwner->mAgendaUtil->store(mAgendaEntry); // Close the agenda entry viewer close(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_SAVEAGENDAENTRY_EXIT ); } /*! Closes the event viewer */ void AgendaEventView::close() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_CLOSE_ENTRY ); // Remove the view from main window. HbMainWindow *window = hbInstance->allMainWindows().first(); @@ -1048,8 +1169,13 @@ this, SLOT(close())); window->removeView(mViewer); + if (AgendaEntry::TypeTodo == mAgendaEntry.type()) { + mAgendaEntry.setStartAndEndTime( + CalenDateUtils::today(), CalenDateUtils::today()); + } mOwner->viewingCompleted(mAgendaEntry.startTime().date()); + OstTraceFunctionExit0( AGENDAEVENTVIEW_CLOSE_EXIT ); } /*! @@ -1057,6 +1183,7 @@ */ void AgendaEventView::handleEntryUpdation(ulong id) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLEENTRYUPDATION_ENTRY ); AgendaEntry updatedEntry = mOwner->mAgendaUtil->fetchById(id); @@ -1064,9 +1191,13 @@ if (!updatedEntry.isNull()) { mAgendaEntry = updatedEntry; - - if (updatedEntry.isRepeating() && mAgendaEntry.type() - != AgendaEntry::TypeTodo) { + + // If the updated entry's & original entry's repeat rule mismatches than + // show the parent entry. + if (updatedEntry.isRepeating() && + mAgendaEntry.type() != AgendaEntry::TypeTodo && + mOriginalAgendaEntry.repeatRule() == + updatedEntry.repeatRule()) { // if start date of original entry is between start date of updated // entry and until date of updated entry then only update time. if (mOriginalAgendaEntry.startTime().date() @@ -1102,6 +1233,7 @@ close(); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLEENTRYUPDATION_EXIT ); } /*! @@ -1109,6 +1241,7 @@ */ void AgendaEventView::handleEntryDeletion(ulong id) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLEENTRYDELETION_ENTRY ); if (id == mAgendaEntry.id()) { // Close the agenda entry viewer @@ -1116,6 +1249,7 @@ mOwner->deletingCompleted(); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLEENTRYDELETION_EXIT ); } /*! @@ -1123,6 +1257,7 @@ */ void AgendaEventView::handleNoteEditorClosed(bool status) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLENOTEEDITORCLOSED_ENTRY ); Q_UNUSED(status); // To avoid loading the plugin again for editing, @@ -1130,6 +1265,7 @@ mOwner->editingCompleted(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLENOTEEDITORCLOSED_EXIT ); } /*! @@ -1137,11 +1273,13 @@ */ void AgendaEventView::handleCalendarEditorClosed() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_ENTRY ); // Cleanup. mCalenEditor->deleteLater(); mOwner->editingCompleted(); + OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_EXIT ); } /*! @@ -1149,6 +1287,7 @@ */ void AgendaEventView::handleDeleteOccurence(int index) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLEDELETEOCCURENCE_ENTRY ); // To notify client that deleting Started // Calendar Application changing state from viewing to deleting. @@ -1168,6 +1307,7 @@ break; } + OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLEDELETEOCCURENCE_EXIT ); } /*! @@ -1175,20 +1315,26 @@ */ void AgendaEventView::getSubjectIcon(AgendaEntry::Type type, QString &subjectIcon) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_GETSUBJECTICON_ENTRY ); switch(type) { case AgendaEntry::TypeAppoinment: + case AgendaEntry::TypeEvent: { - subjectIcon.append("qtg_small_meeting"); + // Check for all-day + if (CalenAgendaUtils::isAlldayEvent(mAgendaEntry)) { + subjectIcon.append("qtg_small_day"); + } else { + subjectIcon.append("qtg_small_meeting"); + } } break; case AgendaEntry::TypeTodo: { - subjectIcon.append("qtg_small_todo"); + if (AgendaEntry::TodoCompleted == mAgendaEntry.status()) { + subjectIcon.append("qtg_small_todo_done"); + } else { + subjectIcon.append("qtg_small_todo"); } - break; - case AgendaEntry::TypeEvent: - { - subjectIcon.append("qtg_small_day"); } break; case AgendaEntry::TypeAnniversary: @@ -1200,6 +1346,7 @@ break; } + OstTraceFunctionExit0( AGENDAEVENTVIEW_GETSUBJECTICON_EXIT ); } /*! @@ -1207,6 +1354,7 @@ */ void AgendaEventView::updateProgressIndicator() { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_UPDATEPROGRESSINDICATOR_ENTRY ); if (!mMaptileStatusReceived) { QString iconName("qtg_anim_small_loading_"); mProgressIconCount = mProgressIconCount % 10 + 1; @@ -1256,6 +1404,7 @@ } } + OstTraceFunctionExit0( AGENDAEVENTVIEW_UPDATEPROGRESSINDICATOR_EXIT ); } /*! @@ -1263,11 +1412,13 @@ */ void AgendaEventView::receiveMapTileStatus(int entryid,int addressType, int status) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_RECEIVEMAPTILESTATUS_ENTRY ); if (mAgendaEntry.id() == entryid && addressType == MapTileService::AddressPlain) { mMaptileStatusReceived = true; mMaptileStatus = status; updateProgressIndicator(); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_RECEIVEMAPTILESTATUS_EXIT ); } /*! @@ -1275,6 +1426,7 @@ */ void AgendaEventView::getProgressIndicatorstatus(QString &progressIcon) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_GETPROGRESSINDICATORSTATUS_ENTRY ); MapTileService::AddressType addressType; addressType = MapTileService::AddressPlain; int eventId = mAgendaEntry.id(); @@ -1305,17 +1457,40 @@ int ,int)), this, SLOT(receiveMapTileStatus(int,int,int))); progressIcon.append(QString::null); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_GETPROGRESSINDICATORSTATUS_EXIT ); } + +/*! + Updates the To-do icon for the changes in to-do status. + */ +void AgendaEventView::updateSubjectandPriorityData() +{ + OstTraceFunctionEntry0( AGENDAEVENTVIEW_UPDATESUBJECTANDPRIORITYDATA_ENTRY ); + QStringList itemList; + QString priorityIcon(QString::null); + QString subjectIcon(QString::null); + getPriorityIcon(mAgendaEntry.priority(), priorityIcon); + getSubjectIcon(mAgendaEntry.type(),subjectIcon); + itemList.append(subjectIcon); + itemList.append(priorityIcon); + itemList.append(QString::null); + + mSubjectWidget->setEventViewerItemData(itemList, Qt::DecorationRole); + OstTraceFunctionExit0( AGENDAEVENTVIEW_UPDATESUBJECTANDPRIORITYDATA_EXIT ); +} + /*! Reload the maptile image on system orientation change. */ void AgendaEventView::changedOrientation(Qt::Orientation orientation) { + OstTraceFunctionEntry0( AGENDAEVENTVIEW_CHANGEDORIENTATION_ENTRY ); if (mMaptileStatus == MapTileService::MapTileFetchingCompleted) { mMaptilePath.clear(); mMaptileService->getMapTileImage(mAgendaEntry.id(), MapTileService::AddressPlain, mMaptilePath,orientation); addMapTileImage(); } + OstTraceFunctionExit0( AGENDAEVENTVIEW_CHANGEDORIENTATION_EXIT ); } // End of file