69 iCrossLineBReady(false), |
69 iCrossLineBReady(false), |
70 iCrossLineEnable(true), |
70 iCrossLineEnable(true), |
71 iCrossLineShowing(false), |
71 iCrossLineShowing(false), |
72 iCrossLineTimer(NULL), |
72 iCrossLineTimer(NULL), |
73 iExitTimer(NULL), |
73 iExitTimer(NULL), |
74 iExiting(false) |
74 iExiting(false), |
|
75 iIsEmbedded(XQServiceUtil::isEmbedded()) |
75 { |
76 { |
76 iBackAction = new HbAction(Hb::BackNaviAction, this); |
77 iBackAction = new HbAction(Hb::BackNaviAction, this); |
77 connect(iBackAction, SIGNAL(triggered()), this, SLOT(backToPreviousView())); |
78 connect(iBackAction, SIGNAL(triggered()), this, SLOT(backToPreviousView())); |
78 |
79 |
79 iExitAction = new HbAction(Hb::QuitNaviAction, this); |
80 iExitAction = new HbAction(Hb::QuitNaviAction, this); |
80 connect(iExitAction, SIGNAL(triggered()), this, SLOT(lower())); |
81 |
|
82 if( !iIsEmbedded ) |
|
83 { |
|
84 connect(iExitAction, SIGNAL(triggered()), this, SLOT(lower())); |
|
85 } |
81 |
86 |
82 connect(this, SIGNAL(viewReady()), this, SLOT(handleViewReady())); |
87 connect(this, SIGNAL(viewReady()), this, SLOT(handleViewReady())); |
83 connect(this, SIGNAL(currentViewChanged(HbView*)), this, SLOT(handleCurrentViewChanged(HbView*))); |
88 connect(this, SIGNAL(currentViewChanged(HbView*)), this, SLOT(handleCurrentViewChanged(HbView*))); |
84 |
89 |
85 iCrossLineTimer = new QTimer(this); |
90 iCrossLineTimer = new QTimer(this); |
98 } |
103 } |
99 |
104 |
100 void IRViewManager::setApplication(IRApplication *aApplication) |
105 void IRViewManager::setApplication(IRApplication *aApplication) |
101 { |
106 { |
102 iApplication = aApplication; |
107 iApplication = aApplication; |
|
108 |
|
109 if( iIsEmbedded ) |
|
110 { |
|
111 connect(iExitAction, SIGNAL(triggered()), iApplication, SIGNAL(quit())); |
|
112 } |
103 } |
113 } |
104 |
114 |
105 /* |
115 /* |
106 * Description : get a pointer to a specified view. If the view is not created yet, |
116 * Description : get a pointer to a specified view. If the view is not created yet, |
107 * view manager can create it and then return pointer to it. |
117 * view manager can create it and then return pointer to it. |
367 void IRViewManager::saveActivity() |
377 void IRViewManager::saveActivity() |
368 { |
378 { |
369 HbActivityManager *activityManager = qobject_cast<HbApplication*>(qApp)->activityManager(); |
379 HbActivityManager *activityManager = qobject_cast<HbApplication*>(qApp)->activityManager(); |
370 |
380 |
371 //for embedded applications, don't publish activity. If backup activity is available, need to restore |
381 //for embedded applications, don't publish activity. If backup activity is available, need to restore |
372 if (XQServiceUtil::isEmbedded()) |
382 if ( iIsEmbedded ) |
373 { |
383 { |
374 if (!iActivityBackup.activityId.isEmpty()) |
384 if (!iActivityBackup.activityId.isEmpty()) |
375 { |
385 { |
376 QVariantHash metadata; |
386 QVariantHash metadata; |
377 metadata.insert("screenshot", iActivityBackup.screenShot); |
387 metadata.insert("screenshot", iActivityBackup.screenShot); |
413 break; |
423 break; |
414 } |
424 } |
415 } |
425 } |
416 |
426 |
417 void IRViewManager::removeActivity() |
427 void IRViewManager::removeActivity() |
418 { |
428 { |
419 if (XQServiceUtil::isEmbedded()) |
429 if ( iIsEmbedded ) |
420 { |
430 { |
421 backupActivity(); |
431 backupActivity(); |
422 } |
432 } |
423 |
433 |
424 HbActivityManager *activityManager = qobject_cast<HbApplication*>(qApp)->activityManager(); |
434 HbActivityManager *activityManager = qobject_cast<HbApplication*>(qApp)->activityManager(); |
425 activityManager->removeActivity(KActivityMainView); |
435 activityManager->removeActivity(KActivityMainView); |
426 activityManager->removeActivity(KActivityPlayingView); |
436 activityManager->removeActivity(KActivityPlayingView); |
427 } |
437 } |
428 |
438 |
429 void IRViewManager::backupActivity() |
439 void IRViewManager::backupActivity() |
430 { |
440 { |
431 HbApplication *hbApp = qobject_cast<HbApplication*>(qApp); |
441 HbApplication *hbApp = qobject_cast<HbApplication*>(qApp); |
432 HbActivityManager *activityManager = hbApp->activityManager(); |
442 HbActivityManager *activityManager = hbApp->activityManager(); |
695 void IRViewManager::exitTimeout() |
705 void IRViewManager::exitTimeout() |
696 { |
706 { |
697 crossLineReset(); |
707 crossLineReset(); |
698 viewport()->repaint(); |
708 viewport()->repaint(); |
699 #ifdef SUBTITLE_STR_BY_LOCID |
709 #ifdef SUBTITLE_STR_BY_LOCID |
700 HbMessageBox::information(hbTrId("txt_common_info_exiting"), (QObject*)NULL, NULL); |
710 HbMessageBox::information(hbTrId("txt_common_info_exiting"), (QObject*)NULL, NULL, HbMessageBox::Ok); |
701 #else |
711 #else |
702 HbMessageBox::information(hbTrId("Exiting..."), (QObject*)NULL, NULL); |
712 HbMessageBox::information(hbTrId("Exiting..."), (QObject*)NULL, NULL, HbMessageBox::Ok); |
703 #endif |
713 #endif |
704 qApp->quit(); |
714 qApp->quit(); |
705 iExiting = true; |
715 iExiting = true; |
706 } |
716 } |
707 |
717 |