/*! Show delete confirmation query */ void AgendaEventView::showDeleteConfirmationQuery() { OstTraceFunctionEntry0( AGENDAEVENTVIEW_SHOWDELETECONFIRMATIONQUERY_ENTRY ); HbMessageBox *popup = new HbMessageBox(HbMessageBox::MessageTypeQuestion); // Set the parent for the dialog // Once the parent object is deleted the dialog will also be deleted popup->setParent(this); popup->setDismissPolicy(HbDialog::NoDismiss); popup->setTimeout(HbDialog::NoTimeout); popup->setAttribute( Qt::WA_DeleteOnClose, true ); QString text = 0; switch (mAgendaEntry.type()) { case AgendaEntry::TypeAppoinment: case AgendaEntry::TypeEvent: { // 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; } case AgendaEntry::TypeTodo: { text.append(hbTrId("txt_calendar_info_delete_todo_note")); break; } case AgendaEntry::TypeNote: { text.append(hbTrId("txt_calendar_info_delete_anniversary")); break; } } popup->setText(text); QList<QAction*> list = popup->actions(); for(int i=0; i < list.count(); i++) { popup->removeAction(list[i]); } HbAction *deleteAction = new HbAction(hbTrId("txt_common_button_delete"), popup); popup->addAction(deleteAction); connect(deleteAction, SIGNAL(triggered()), this , SLOT(handleDeleteAction())); popup->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popup)); popup->open(); OstTraceFunctionExit0( AGENDAEVENTVIEW_SHOWDELETECONFIRMATIONQUERY_EXIT ); }
/*! Helper function for showing error notes. @param[in] info Info string to be shown in note. */ void CpIapItem::showErrorNote(const QString &info) { OstTraceFunctionEntry0(CPIAPITEM_SHOWERRORNOTE_ENTRY); HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeInformation); note->clearActions(); note->setAttribute(Qt::WA_DeleteOnClose); note->setText(info); note->setTimeout(HbPopup::NoTimeout); HbAction *errorOk = new HbAction(hbTrId("txt_common_button_ok")); note->addAction(errorOk); note->show(); OstTraceFunctionExit0(CPIAPITEM_SHOWERRORNOTE_EXIT); }
/*! Shows confirmation query for access point deletion. */ void CpIapItem::showDeleteConfirmation() { OstTraceFunctionEntry0(CPIAPITEM_SHOWDELETECONFIRMATION_ENTRY); HbMessageBox *note = new HbMessageBox(HbMessageBox::MessageTypeQuestion); note->clearActions(); note->setAttribute(Qt::WA_DeleteOnClose); note->setText(HbParameterLengthLimiter( "txt_occ_info_delete_access_point_1").arg(mIapName)); HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_yes")); bool connected = connect( primaryAction, SIGNAL(triggered()), this, SLOT(deleteConfirmed())); Q_ASSERT(connected); note->addAction(primaryAction); note->addAction(new HbAction(hbTrId("txt_common_button_no"))); note->setTimeout(HbPopup::NoTimeout); note->show(); OstTraceFunctionExit0(CPIAPITEM_SHOWDELETECONFIRMATION_EXIT); }