375 |
375 |
376 // ---------------------------------------------------------------------------- |
376 // ---------------------------------------------------------------------------- |
377 // MsgServiceViewManager::handleSmsMmsMsg |
377 // MsgServiceViewManager::handleSmsMmsMsg |
378 // @see header |
378 // @see header |
379 // ---------------------------------------------------------------------------- |
379 // ---------------------------------------------------------------------------- |
380 void MsgServiceViewManager::handleSmsMmsMsg(int msgId) |
380 void MsgServiceViewManager::handleSmsMmsMsg(int msgId,int msgType) |
381 { |
381 { |
382 if (!mUniViewer) { |
382 if(mStoreHandler->isDraftMessage(msgId)) |
383 mUniViewer = new UnifiedViewer(msgId); |
383 { |
384 mUniViewer->setNavigationAction(mBackAction); |
384 ConvergedMessageId convergedMsgId = ConvergedMessageId(msgId); |
385 mMainWindow->addView(mUniViewer); |
385 ConvergedMessage message; |
386 connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, |
386 message.setMessageType((ConvergedMessage::MessageType) msgType); |
387 SLOT(switchView(const QVariantList&))); |
387 message.setMessageId(convergedMsgId); |
388 } |
388 |
389 mUniViewer->populateContent(msgId, true, 1); |
389 // Launch uni-editor view |
390 |
390 QByteArray dataArray; |
391 mMainWindow->setCurrentView(mUniViewer); |
391 QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
392 |
392 message.serialize(messageStream); |
393 // set current view as viewer |
393 |
394 mCurrentView = MsgBaseView::UNIVIEWER; |
394 QVariantList params; |
395 } |
395 params << MsgBaseView::UNIEDITOR; // target view |
|
396 params << MsgBaseView::SERVICE; // source view |
|
397 |
|
398 params << dataArray; |
|
399 |
|
400 // except first 2 parameters pass other parameters |
|
401 QVariantList editorData; |
|
402 for(int a = 2; a < params.length(); ++a) |
|
403 { |
|
404 editorData << params.at(a); |
|
405 } |
|
406 // construct |
|
407 if (!mUniEditor) { |
|
408 mUniEditor = new MsgUnifiedEditorView(); |
|
409 mMainWindow->addView(mUniEditor); |
|
410 mUniEditor->setNavigationAction(mBackAction); |
|
411 connect(mUniEditor, SIGNAL(switchView(const QVariantList&)), this, |
|
412 SLOT(switchView(const QVariantList&))); |
|
413 } |
|
414 |
|
415 // check if additional data for unieditor's consumption is available |
|
416 mUniEditor->openDraftsMessage(editorData); |
|
417 |
|
418 mMainWindow->setCurrentView(mUniEditor); |
|
419 mCurrentView = MsgBaseView::UNIEDITOR; |
|
420 } |
|
421 else |
|
422 { |
|
423 if (!mUniViewer) { |
|
424 mUniViewer = new UnifiedViewer(msgId); |
|
425 mUniViewer->setNavigationAction(mBackAction); |
|
426 mMainWindow->addView(mUniViewer); |
|
427 connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, |
|
428 SLOT(switchView(const QVariantList&))); |
|
429 } |
|
430 mUniViewer->populateContent(msgId, true, 1); |
|
431 |
|
432 mMainWindow->setCurrentView(mUniViewer); |
|
433 |
|
434 // set current view as viewer |
|
435 mCurrentView = MsgBaseView::UNIVIEWER; |
|
436 } |
|
437 } |
396 |
438 |
397 // ---------------------------------------------------------------------------- |
439 // ---------------------------------------------------------------------------- |
398 // MsgServiceViewManager::handleRingtoneMsg |
440 // MsgServiceViewManager::handleRingtoneMsg |
399 // @see header |
441 // @see header |
400 // ---------------------------------------------------------------------------- |
442 // ---------------------------------------------------------------------------- |