31 #include <hbgroupbox.h> |
31 #include <hbgroupbox.h> |
32 #include <hbmessagebox.h> |
32 #include <hbmessagebox.h> |
33 #include <hblabel.h> |
33 #include <hblabel.h> |
34 #include <dialpad.h> |
34 #include <dialpad.h> |
35 #include <hblineedit.h> |
35 #include <hblineedit.h> |
|
36 #include <hbnotificationdialog.h> |
|
37 #include <hbabstractviewitem.h> |
36 Q_DECLARE_METATYPE(LogsDetailsModel*) |
38 Q_DECLARE_METATYPE(LogsDetailsModel*) |
37 |
39 |
38 |
40 |
39 // ----------------------------------------------------------------------------- |
41 // ----------------------------------------------------------------------------- |
40 // |
42 // |
90 if (mViewName){ |
92 if (mViewName){ |
91 mViewName->setHeading(mDetailsModel->headerData(0, Qt::Vertical).toString()); |
93 mViewName->setHeading(mDetailsModel->headerData(0, Qt::Vertical).toString()); |
92 } |
94 } |
93 |
95 |
94 if ( mListView ){ |
96 if ( mListView ){ |
95 mListView->setModel( mDetailsModel );//ownership not transferred |
97 |
|
98 mListView->setModel( mDetailsModel, new LogsDetailsViewItem());//ownership not transferred |
96 } |
99 } |
97 |
100 |
98 updateMenu(); |
101 updateMenu(); |
99 |
102 |
100 scrollToTopItem(mListView); |
103 scrollToTopItem(mListView); |
|
104 |
|
105 LogsBaseView::activationCompleted(); |
101 |
106 |
102 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::activated()" ); |
107 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::activated()" ); |
103 } |
108 } |
104 |
109 |
105 // ----------------------------------------------------------------------------- |
110 // ----------------------------------------------------------------------------- |
212 this, SLOT(contactActionCompleted(bool)), |
217 this, SLOT(contactActionCompleted(bool)), |
213 Qt::QueuedConnection); |
218 Qt::QueuedConnection); |
214 mContact->open(); |
219 mContact->open(); |
215 } |
220 } |
216 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::openContact()" ); |
221 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::openContact()" ); |
|
222 } |
|
223 |
|
224 // ----------------------------------------------------------------------------- |
|
225 // LogsDetailsView::copyNumberToClipboard() |
|
226 // ----------------------------------------------------------------------------- |
|
227 // |
|
228 void LogsDetailsView::copyNumberToClipboard() |
|
229 { |
|
230 LOGS_QDEBUG( "logs [UI] -> LogsDetailsView::copyNumberToClipboard()" ); |
|
231 if ( isDialpadInput() ){ |
|
232 mDialpad->editor().setSelection(0, mDialpad->editor().text().length()); |
|
233 mDialpad->editor().copy(); |
|
234 mDialpad->editor().setSelection(0, 0); |
|
235 } else if ( mDetailsModel ) { |
|
236 mDetailsModel->getNumberToClipboard(); |
|
237 } |
|
238 QString infoMessage; |
|
239 infoMessage.append(hbTrId("txt_dialer_dpopinfo_number_copied")); |
|
240 HbNotificationDialog::launchDialog(infoMessage); |
|
241 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::copyNumberToClipboard()" ); |
217 } |
242 } |
218 |
243 |
219 // ----------------------------------------------------------------------------- |
244 // ----------------------------------------------------------------------------- |
220 // |
245 // |
221 // ----------------------------------------------------------------------------- |
246 // ----------------------------------------------------------------------------- |
325 mRepository.findObject( logsCommonMessageMenuActionId ) ); |
350 mRepository.findObject( logsCommonMessageMenuActionId ) ); |
326 HbAction* addToContactsAction = qobject_cast<HbAction*>( |
351 HbAction* addToContactsAction = qobject_cast<HbAction*>( |
327 mRepository.findObject( logsCommonAddToContactsMenuActionId ) ); |
352 mRepository.findObject( logsCommonAddToContactsMenuActionId ) ); |
328 HbAction* openContactAction = qobject_cast<HbAction*>( |
353 HbAction* openContactAction = qobject_cast<HbAction*>( |
329 mRepository.findObject( logsDetailsOpenContactMenuActionId ) ); |
354 mRepository.findObject( logsDetailsOpenContactMenuActionId ) ); |
|
355 HbAction* copyNumberAction = qobject_cast<HbAction*>( |
|
356 mRepository.findObject( logsDetailsCopyNumberMenuActionId ) ); |
|
357 |
|
358 |
330 |
359 |
331 bool voiceCallAvailable(false); |
360 bool voiceCallAvailable(false); |
332 bool videoCallAvailable(false); |
361 bool videoCallAvailable(false); |
333 bool internetCallAvailable(false); // Currently always disabled |
362 bool internetCallAvailable(false); // Currently always disabled |
334 if (mCall) { |
363 if (mCall) { |
355 } |
384 } |
356 if (mContact->allowedRequestType() == LogsContact::TypeLogsContactOpen){ |
385 if (mContact->allowedRequestType() == LogsContact::TypeLogsContactOpen){ |
357 contactCanBeOpened = true; |
386 contactCanBeOpened = true; |
358 } |
387 } |
359 } |
388 } |
|
389 bool copyNumberAllowed = !mDetailsModel->getLogsEvent().isRemotePartyPrivate(); |
360 |
390 |
361 toggleActionAvailability(voiceCallAction, voiceCallAvailable); |
391 toggleActionAvailability(voiceCallAction, voiceCallAvailable); |
362 toggleActionAvailability(videoCallAction, videoCallAvailable); |
392 toggleActionAvailability(videoCallAction, videoCallAvailable); |
363 toggleActionAvailability(internetCallAction, internetCallAvailable); |
393 toggleActionAvailability(internetCallAction, internetCallAvailable); |
364 toggleActionAvailability(messageAction, mMessage); |
394 toggleActionAvailability(messageAction, mMessage); |
365 toggleActionAvailability(addToContactsAction, contactCanBeAdded); |
395 toggleActionAvailability(addToContactsAction, contactCanBeAdded); |
366 toggleActionAvailability(openContactAction, contactCanBeOpened); |
396 toggleActionAvailability(openContactAction, contactCanBeOpened); |
367 |
397 toggleActionAvailability(copyNumberAction, copyNumberAllowed); |
368 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::updateMenu()" ); |
398 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::updateMenu()" ); |
369 } |
399 } |
370 |
400 |
371 // ----------------------------------------------------------------------------- |
401 // ----------------------------------------------------------------------------- |
372 // |
402 // |
394 updateListLayoutName(*mListView, true); |
424 updateListLayoutName(*mListView, true); |
395 updateListSize(*mListView); |
425 updateListSize(*mListView); |
396 } |
426 } |
397 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::updateWidgetsSizeAndLayout()" ); |
427 LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::updateWidgetsSizeAndLayout()" ); |
398 } |
428 } |
|
429 |
|
430 LogsDetailsViewItem::LogsDetailsViewItem() |
|
431 : HbListViewItem(0) |
|
432 { |
|
433 } |
|
434 |
|
435 LogsDetailsViewItem::~LogsDetailsViewItem( ) |
|
436 { |
|
437 } |
|
438 |
|
439 void LogsDetailsViewItem::pressStateChanged(bool value, bool animate) |
|
440 { |
|
441 Q_UNUSED(value); |
|
442 Q_UNUSED(animate); |
|
443 } |
|
444 |
|
445 HbAbstractViewItem *LogsDetailsViewItem::createItem() |
|
446 { |
|
447 return new LogsDetailsViewItem(*this); |
|
448 } |
|
449 |
|
450 void LogsDetailsViewItem::updateChildItems() |
|
451 { |
|
452 HbListViewItem::updateChildItems(); |
|
453 } |
|
454 |
|
455 |
|
456 |