calendarui/agendaeventviewer/src/agendaeventview.cpp
changeset 83 5aadd1120515
parent 81 ce92091cbd61
equal deleted inserted replaced
82:dcd0ca396fa1 83:5aadd1120515
    81 AgendaEventView::AgendaEventView(
    81 AgendaEventView::AgendaEventView(
    82 		AgendaEventViewerPrivate *owner, QObject *parent):
    82 		AgendaEventViewerPrivate *owner, QObject *parent):
    83 		QObject(parent),
    83 		QObject(parent),
    84 		mMainWindow(NULL),
    84 		mMainWindow(NULL),
    85 		mOwner(owner),
    85 		mOwner(owner),
    86 		mTranslator(new HbTranslator("caleneventviewer")),
    86 		mTranslator(new HbTranslator("eventviewer")),
    87 		mReminderWidgetAdded(true),
    87 		mReminderWidgetAdded(true),
    88 		mMaptilePath(NULL),
    88 		mMaptilePath(NULL),
    89 		mMaptileService(NULL),
    89 		mMaptileService(NULL),
    90 		mProgressTimer(NULL),
    90 		mProgressTimer(NULL),
    91 		mProgressIconCount(0),
    91 		mProgressIconCount(0),
   318 				mDocLoader->findWidget(AGENDA_EVENT_VIEWER_MENU));
   318 				mDocLoader->findWidget(AGENDA_EVENT_VIEWER_MENU));
   319 		
   319 		
   320 		mMarkTodoAction = new HbAction(this);
   320 		mMarkTodoAction = new HbAction(this);
   321 		if (mAgendaEntry.status() == AgendaEntry::TodoCompleted) {
   321 		if (mAgendaEntry.status() == AgendaEntry::TodoCompleted) {
   322 			mMarkTodoAction->setText(
   322 			mMarkTodoAction->setText(
   323 								hbTrId("txt_calendar_menu_mark_as_not_done"));
   323 								hbTrId("txt_calendar_opt_mark_as_not_done"));
   324 		} else {
   324 		} else {
   325 			mMarkTodoAction->setText(hbTrId("txt_calendar_menu_mark_as_done"));
   325 			mMarkTodoAction->setText(hbTrId("txt_calendar_opt_mark_as_done"));
   326 		}
   326 		}
   327 		connect(mMarkTodoAction, SIGNAL(triggered()), this,
   327 		connect(mMarkTodoAction, SIGNAL(triggered()), this,
   328 		        SLOT(markTodoStatus()));
   328 		        SLOT(markTodoStatus()));
   329 		menu->addAction(mMarkTodoAction);
   329 		menu->addAction(mMarkTodoAction);
   330 	}
   330 	}
  1003         }
  1003         }
  1004         case AgendaEntry::TypeTodo: {
  1004         case AgendaEntry::TypeTodo: {
  1005         text.append(hbTrId("txt_calendar_info_delete_todo_note"));
  1005         text.append(hbTrId("txt_calendar_info_delete_todo_note"));
  1006         break;
  1006         break;
  1007         }
  1007         }
  1008         case AgendaEntry::TypeNote: {
       
  1009         text.append(hbTrId("txt_calendar_info_delete_anniversary"));
       
  1010         break;
       
  1011         }
       
  1012     }
  1008     }
  1013     popup->setText(text);
  1009     popup->setText(text);
  1014     
  1010     
  1015     QList<QAction*> list = popup->actions();
  1011     QList<QAction*> list = popup->actions();
  1016     for(int i=0; i < list.count(); i++)
  1012     for(int i=0; i < list.count(); i++)
  1053 	QDateTime currentDateTime = QDateTime::currentDateTime();
  1049 	QDateTime currentDateTime = QDateTime::currentDateTime();
  1054 
  1050 
  1055 	// Set the to-do status using the agenda util.
  1051 	// Set the to-do status using the agenda util.
  1056 	if (AgendaEntry::TodoCompleted != mAgendaEntry.status()) {
  1052 	if (AgendaEntry::TodoCompleted != mAgendaEntry.status()) {
  1057 		// Update the menu text to mark to-do as undone.
  1053 		// Update the menu text to mark to-do as undone.
  1058 		mMarkTodoAction->setText(hbTrId("txt_calendar_menu_mark_as_not_done"));
  1054 		mMarkTodoAction->setText(hbTrId("txt_calendar_opt_mark_as_not_done"));
  1059 		mAgendaEntry.setStatus(AgendaEntry::TodoCompleted);
  1055 		mAgendaEntry.setStatus(AgendaEntry::TodoCompleted);
  1060 		mAgendaEntry.setCompletedDateTime(currentDateTime);
  1056 		mAgendaEntry.setCompletedDateTime(currentDateTime);
  1061 		mOwner->mAgendaUtil->setCompleted(mAgendaEntry, true, currentDateTime);
  1057 		mOwner->mAgendaUtil->setCompleted(mAgendaEntry, true, currentDateTime);
  1062 	} else {
  1058 	} else {
  1063 		
  1059 		
  1064 		// Update the menu text to mark to-do as done.
  1060 		// Update the menu text to mark to-do as done.
  1065 		mMarkTodoAction->setText(hbTrId("txt_calendar_menu_mark_as_done"));
  1061 		mMarkTodoAction->setText(hbTrId("txt_calendar_opt_mark_as_done"));
  1066 		mAgendaEntry.setStatus(AgendaEntry::TodoNeedsAction);
  1062 		mAgendaEntry.setStatus(AgendaEntry::TodoNeedsAction);
  1067 		mOwner->mAgendaUtil->setCompleted(mAgendaEntry, false, currentDateTime);
  1063 		mOwner->mAgendaUtil->setCompleted(mAgendaEntry, false, currentDateTime);
  1068 	}
  1064 	}
  1069 
  1065 
  1070 	updateFieldsforTodoStatus();
  1066 	updateFieldsforTodoStatus();