# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1278414796 -10800 # Node ID 5554410e16f58f176d4c0be749f3c24fb9ebbaaa # Parent 53c1c4459a94b737907251185f4f32917d8c94bd Revision: 201025 Kit: 2010127 diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/inc/lceffecthandler.h --- a/mmsharing/livecommsui/lcui/inc/lceffecthandler.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/inc/lceffecthandler.h Tue Jul 06 14:13:16 2010 +0300 @@ -74,7 +74,6 @@ private: void startEffect( HbWidget* widget, const char *effectId, const char *callBack = "" ); - const char* selectSwapEffect( HbWidget* widget ); bool isSharedVideoAtTop() const; bool videosSideBySide() const; void handleSwapCompletion(); diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/inc/lcuicomponentrepository.h --- a/mmsharing/livecommsui/lcui/inc/lcuicomponentrepository.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/inc/lcuicomponentrepository.h Tue Jul 06 14:13:16 2010 +0300 @@ -27,7 +27,6 @@ class HbProgressDialog; class HbDialog; class LcUiEngine; -class HbZoomSliderPopup; class HbMenu; class HbMessageBox; @@ -54,7 +53,6 @@ HbProgressDialog* waitingNote(); HbDialog* recipientQuery(); HbDialog* shareOwnVideoQuery(); - HbZoomSliderPopup* zoomSlider(); void sharedVideoContextMenuActions( HbMenu* menu, LcView& view ); bool loadLayout( const QString& layoutName ); // returns the currently loaded layout name @@ -100,7 +98,6 @@ HbProgressDialog* mInvitingNote; HbProgressDialog* mWaitingNote; HbDialog* mRecipientQuery; - HbZoomSliderPopup* mZoomSlider; HbMessageBox* mShareOwnVideoQuery; QString mLayout; diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/inc/lcuidefs.h --- a/mmsharing/livecommsui/lcui/inc/lcuidefs.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/inc/lcuidefs.h Tue Jul 06 14:13:16 2010 +0300 @@ -87,7 +87,6 @@ //widget ids const char lcIconContactId[] = "lc_icon_contact"; -const char lcIconBrandId[] = "lc_icon_brand"; const char lcLabelRecipientId[] = "lc_label_recipient"; const char lcLabelDurationId[] = "lc_label_duration"; const char lcWidgetRecvVideoId[] = "lc_widget_recvvideo"; @@ -111,7 +110,6 @@ const char lcActAdjustVideoId[] = "lc_act_adjustvideo"; const char lcActShareImageId[] = "lc_act_shareimage"; const char lcActSwapViewsId[] = "lc_act_swapviews"; -const char lcActZoomId[] = "lc_act_zoom"; const char lcActSwitchToVoiceCallId[] = "lc_act_switchtovoicecall"; const char lcActDisableCameraId[] = "lc_act_disablecamera"; const char lcActMenuDisableCameraId[] = "lc_act_menu_disablecamera"; @@ -120,10 +118,8 @@ //layouts ids -const char lcLayoutPortraitDefaultId[] = "portrait"; //Main window - received content const char lcLayoutLandscapeDefaultId[] = "landscape"; //Main window - received content const char lcLayoutFullscreenId[] = "fullscreen"; -const char lcLayoutPortraitSwappedId[] = "lc_layout_portrait_swapped"; //Main window - sent content const char lcLayoutLandscapeSwappedId[] = "lc_layout_landscape_swapped";//Main window - sent content const char lcLayoutLandscapeDialpadId[] = "lc_layout_landscape_dialpad"; // Dialpad layout @@ -162,5 +158,4 @@ const char lcEffectWinDefaultCallback[] = "windowDisappearComplete"; - #endif /* LCUIDEFS_H_ */ diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/inc/lcview.h --- a/mmsharing/livecommsui/lcui/inc/lcview.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/inc/lcview.h Tue Jul 06 14:13:16 2010 +0300 @@ -31,12 +31,12 @@ class HbMessageBox; class HbAction; class HbPushButton; -class HbZoomSliderPopup; class HbTransparentWindow; class HbMenu; class LcVideoWidget; class LcEffectHandler; class Dialpad; +class DialpadVtKeyHandler; class LcView : public HbView { @@ -64,7 +64,6 @@ void changeCamera(); void switchToVoiceCall(); void speaker(); - void showZoom(); void updateVideoRects(); void swap(); void shareImage(); @@ -108,13 +107,14 @@ private: void createNotSupportedNote(); void createContextMenu(); - bool isLandscapeOrientation(); QRectF translateRectForOrientation(const QRectF& origRect); QPointF translatePointForOrientation(const QPointF& origPoint); void setVisibility( QGraphicsItem* item, bool visible ); void addOptionsMenuActions(); void gestureLongPress( QPointF coords ); void gestureShortPress(); + bool isVideoPositionedCorrectly( LcVideoWidget* mVideoWidget ); + bool isPositioned(); private://not owned @@ -122,8 +122,7 @@ LcUiComponentRepository& mRepository; HbLabel* mRecipient; HbLabel* mDuration; - HbLabel* mContactIcon; - HbLabel* mBrandIcon; + HbLabel* mContactIcon; LcVideoWidget* mSharedVideoWidget; LcVideoWidget* mReceivedVideoWidget; HbAction* mChangeCameraAction; @@ -132,7 +131,6 @@ HbAction* mDisableCameraAction; HbAction* mDisableCameraMenuAction; HbMessageBox* mNotSupportedNote; - HbZoomSliderPopup* mZoomSlider; HbPushButton* mEndCallButton; LcVideoWidget* mReceivedVideoEffectOverlay; @@ -143,9 +141,10 @@ HbMenu* mItemContextMenu; bool mIsOptionMenuOpen; - HbAction* mSoftKeyBackAction; Dialpad* mDialpad; // Not owned + DialpadVtKeyHandler* mDialpadVtKeyHandler; int timerId; + bool isViewReady; }; diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/inc/lcviewmanager_p.h --- a/mmsharing/livecommsui/lcui/inc/lcviewmanager_p.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/inc/lcviewmanager_p.h Tue Jul 06 14:13:16 2010 +0300 @@ -67,7 +67,6 @@ public slots: void changeView(); //for layout switch - void updateLayout(); void prepareOrientationChange(); private slots: diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/resources/lcviews.uip Binary file mmsharing/livecommsui/lcui/resources/lcviews.uip has changed diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/resources/lcviews/lcsendview.docml --- a/mmsharing/livecommsui/lcui/resources/lcviews/lcsendview.docml Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lcsendview.docml Tue Jul 06 14:13:16 2010 +0300 @@ -27,9 +27,6 @@ - - - @@ -79,7 +76,6 @@ - diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/resources/lcviews/lctwowayview.docml --- a/mmsharing/livecommsui/lcui/resources/lcviews/lctwowayview.docml Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lctwowayview.docml Tue Jul 06 14:13:16 2010 +0300 @@ -27,9 +27,6 @@ - - - @@ -83,7 +80,6 @@ - diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/resources/lcviews/lcvtview.docml --- a/mmsharing/livecommsui/lcui/resources/lcviews/lcvtview.docml Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lcvtview.docml Tue Jul 06 14:13:16 2010 +0300 @@ -1,44 +1,30 @@ - - - - + - - - - + + + + - - + - - + - - - - - - - - - - + @@ -53,16 +39,8 @@ - - - - - - - - - + @@ -72,8 +50,6 @@ - - @@ -81,88 +57,29 @@ + - - - - - - - + - - + + - - - - + + + + -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- + @@ -177,9 +94,6 @@ - - - @@ -191,14 +105,12 @@ - - - - - + + + @@ -207,29 +119,29 @@ - + - + - + - +
- + @@ -243,9 +155,6 @@ - - - @@ -257,14 +166,12 @@ - - - - - + + + @@ -273,78 +180,25 @@ - + - + - + - +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -359,9 +213,6 @@ - - - @@ -369,10 +220,10 @@ - - - - + + + + @@ -383,11 +234,11 @@ - + - + @@ -400,7 +251,6 @@
- diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/src/lceffecthandler.cpp --- a/mmsharing/livecommsui/lcui/src/lceffecthandler.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/src/lceffecthandler.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -181,8 +181,6 @@ LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::swap()" ) } - - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -194,11 +192,8 @@ mSwapSharedCompleted = false; mSwapReceivedCompleted = false; - const char* effect = selectSwapEffect( mSharedVideo ); - startEffect( mSharedVideoOverlay, effect, "windowSwapSharedComplete" ); - - effect = selectSwapEffect( mReceivedVideo ); - startEffect( mReceivedVideoOverlay, effect, "windowSwapReceivedComplete" ); + startEffect( mSharedVideoOverlay, lcEffectWinDisappearId, "windowSwapSharedComplete" ); + startEffect( mReceivedVideoOverlay, lcEffectWinDisappearId, "windowSwapReceivedComplete" ); mSharedVideo->hide(); mReceivedVideo->hide(); @@ -206,40 +201,6 @@ } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const char* LcEffectHandler::selectSwapEffect( HbWidget* widget ) -{ - LC_QDEBUG("livecomms [UI] -> LcEffectHandler::selectSwapEffect()") - const char* effect = lcEffectWinDisappearId; - - if ( mSharedVideo && - mReceivedVideo && - HbInstance::instance()->allMainWindows().at(0)->orientation() == Qt::Vertical && - !videosSideBySide() ) { - if( widget == mSharedVideo ) { - if ( isSharedVideoAtTop() ) { - effect = lcEffectWinSwapDownId; - } else { - effect = lcEffectWinSwapUpId; - } - LC_QDEBUG_2("livecomms [UI] shared video effect:", effect) - } else if( widget == mReceivedVideo ) { - if ( isSharedVideoAtTop() ) { - effect = lcEffectWinSwapUpId; - } else { - effect = lcEffectWinSwapDownId; - } - LC_QDEBUG_2("livecomms [UI] received video effect:", effect) - } - } - LC_QDEBUG("livecomms [UI] <- LcEffectHandler::selectSwapEffect()") - return effect; -} - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -258,7 +219,6 @@ LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::startEffect()" ) } - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/src/lcuicomponentrepository.cpp --- a/mmsharing/livecommsui/lcui/src/lcuicomponentrepository.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/src/lcuicomponentrepository.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -57,7 +56,6 @@ mInvitingNote(0), mWaitingNote(0), mRecipientQuery(0), - mZoomSlider(0), mShareOwnVideoQuery(0) { LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::LcUiComponentRepository()" ) @@ -75,7 +73,6 @@ mSlots->insert( lcActAdjustVideoId, SLOT( notSupported() ) ); mSlots->insert( lcActShareImageId, SLOT( notSupported() ) ); mSlots->insert( lcActSwapViewsId, SLOT( swap() ) ); - mSlots->insert( lcActZoomId, SLOT( notSupported() ) ); mSlots->insert( lcActSwitchToVoiceCallId, SLOT( switchToVoiceCall() ) ); mSlots->insert( lcActOpenKeypadId, SLOT( openDialpad() ) ); mSlots->insert( lcActDisableCameraId, SLOT( disableCamera() ) ); @@ -108,7 +105,6 @@ delete mInvitingNote; delete mWaitingNote; delete mRecipientQuery; - delete mZoomSlider; delete mShareOwnVideoQuery; LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::~LcUiComponentRepository()" ) @@ -390,6 +386,7 @@ if ( !mShareOwnVideoQuery ) { mShareOwnVideoQuery = new HbMessageBox( HbMessageBox::MessageTypeQuestion ); + mShareOwnVideoQuery->setStandardButtons( HbMessageBox::Yes | HbMessageBox::No ); mShareOwnVideoQuery->setText( hbTrId( "txt_vt_info_allow_own_image_to_be_sent" )); mShareOwnVideoQuery->setZValue(LC_NOTE_ON_TOP); mShareOwnVideoQuery->setTimeout( HbDialog::NoTimeout ); @@ -401,28 +398,6 @@ } // ----------------------------------------------------------------------------- -// LcUiComponentRepository::zoomSlider -// ----------------------------------------------------------------------------- -// -HbZoomSliderPopup* LcUiComponentRepository::zoomSlider() -{ - LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::zoomSlider()" ); - - if ( !mZoomSlider ) { - mZoomSlider = new HbZoomSliderPopup(); - mZoomSlider->setDismissPolicy(HbDialog::TapOutside); - mZoomSlider->setTimeout(HbDialog::StandardTimeout); - mZoomSlider->hide(); - QObject::connect( mZoomSlider, SIGNAL(valueChanged(int)), - &mEngine, SLOT(zoom(int)) ); - - } - - LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::zoomSlider()" ); - return mZoomSlider; -} - -// ----------------------------------------------------------------------------- // LcUiComponentRepository::sharedVideoContextMenuActions // ----------------------------------------------------------------------------- // @@ -436,27 +411,32 @@ //due stubs in unit tests, qobject_cast cannot be used. //Using static_cast instead HbAction* swap = static_cast( findObject( lcActSwapViewsId ) ); - HbAction* zoom = static_cast( findObject( lcActZoomId ) ); HbAction* changeCamera = static_cast( findObject( lcActMenuChangeCameraId ) ); + HbAction* disableCamera = static_cast( findObject( lcActMenuDisableCameraId ) ); + HbAction* enableCamera = + static_cast( findObject( lcActEnableCameraId ) ); if ( swap ) { LC_QDEBUG_2( "Adding ", swap->text() ); menu->addAction( swap ); } - if ( zoom ) { - LC_QDEBUG_2( "Adding ", zoom->text() ); - menu->addAction( zoom ); - } if ( changeCamera ) { LC_QDEBUG_2( "Adding ", changeCamera->text() ); menu->addAction( changeCamera ); } - if ( disableCamera ) { - LC_QDEBUG_2( "Adding ", disableCamera->text() ); - menu->addAction( disableCamera ); + if ( mEngine.isLocalPlayerPlaying() ) { + if ( disableCamera ) { + LC_QDEBUG_2( "Adding ", disableCamera->text() ); + menu->addAction( disableCamera ); + } + } else { + if ( enableCamera ) { + LC_QDEBUG_2( "Adding ", enableCamera->text() ); + menu->addAction( enableCamera ); + } } @@ -473,7 +453,7 @@ const QString& xmlFile ) { LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::loadView()" ); - + LcView* view = 0; bool ok( false ); // Load the XML file @@ -481,32 +461,27 @@ if ( !ok ) { LC_QCRITICAL_3( "! loading of XML file ", xmlFile , " failed !" ) - return 0; + return 0; } + mLastLoadedView = xmlFile; - // Load default layout for the current device orientation - if ( !HbInstance::instance()->allMainWindows().isEmpty() && - HbInstance::instance()->allMainWindows().at(0)->orientation() == Qt::Horizontal ) { - ok = loadLayout( lcLayoutLandscapeDefaultId ); - - } else { - ok = loadLayout( lcLayoutPortraitDefaultId ); - } + ok = loadLayout( lcLayoutLandscapeDefaultId ); if ( !ok ) { LC_QCRITICAL( "! loading of layout failed !" ) - return 0; - } + return 0; + } view = qobject_cast( findWidget( viewId ) ); if ( view ) { - connectActions( *view ); - view->init(); - } + connectActions( *view ); + view->init(); + } LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::loadView()" ); return view; } + // ----------------------------------------------------------------------------- // LcUiComponentRepository::connectActions @@ -526,6 +501,8 @@ static_cast( findObject( lcActMenuChangeCameraId ) ); HbAction* disableCamera = static_cast( findObject( lcActMenuDisableCameraId ) ); + HbAction* enableCamera = + static_cast( findObject( lcActEnableCameraId ) ); QObject::connect( changeCamera, SIGNAL(triggered()), &view, SLOT(notSupported()) ); @@ -533,6 +510,9 @@ QObject::connect( disableCamera, SIGNAL(triggered()), &view, SLOT(disableCamera()) ); + QObject::connect( enableCamera, SIGNAL(triggered()), + &view, SLOT(disableCamera()) ); + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::connectActions()" ) } @@ -577,7 +557,6 @@ else{ mPreviousLayout = mLayout; mLayout = layoutName; - setObjectTree( objects ); } } else { LC_QCRITICAL( "! not loading layout, since view is not loaded!" ) diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/src/lcvideowidget.cpp --- a/mmsharing/livecommsui/lcui/src/lcvideowidget.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/src/lcvideowidget.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -50,23 +50,38 @@ QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(widget) + QPointF initialPosition(0,0); + + //Workaround: widgets positioning takes time, do not paint if they are not + //positioned correctly. + + if ( this->pos() != initialPosition ) { painter->save(); if ( mShowVideo ){ QPainter::CompositionMode origCompositionMode = painter->compositionMode(); painter->setCompositionMode(QPainter::CompositionMode_Source); + #if ( defined __WINSCW__ ) || ( defined __WINS__ ) + if( mLocalPlayer ){ + painter->setBrush(QColor(Qt::darkGreen)); + }else{ + painter->setBrush(QColor(Qt::darkRed)); + } + #else painter->setBrush(QColor(0,0,0,0)); + #endif painter->drawRoundedRect( option->exposedRect, lcVideoWidgetCornerRounding, lcVideoWidgetCornerRounding); painter->setCompositionMode(origCompositionMode); // restore - } else { - painter->setBrush(QColor(0,0,0,255)); - painter->drawRoundedRect( option->exposedRect, - lcVideoWidgetCornerRounding, lcVideoWidgetCornerRounding); + } else { + painter->setBrush(QColor(0,0,0,255)); + painter->drawRoundedRect( option->exposedRect, + lcVideoWidgetCornerRounding, lcVideoWidgetCornerRounding); + } + painter->restore(); } - painter->restore(); } // ----------------------------------------------------------------------------- diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/src/lcview.cpp --- a/mmsharing/livecommsui/lcui/src/lcview.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/src/lcview.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -33,13 +33,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include @@ -59,8 +59,7 @@ mRepository(repository), mRecipient(0), mDuration(0), - mContactIcon(0), - mBrandIcon(0), + mContactIcon(0), mSharedVideoWidget(0), mReceivedVideoWidget(0), mChangeCameraAction(0), @@ -69,16 +68,16 @@ mDisableCameraAction(0), mDisableCameraMenuAction(0), mNotSupportedNote(0), - mZoomSlider(0), mEndCallButton(0), mReceivedVideoEffectOverlay(0), mSharedVideoEffectOverlay(0), mEffectHandler(0), mItemContextMenu(0), mIsOptionMenuOpen(false), - mSoftKeyBackAction(0), mDialpad(0), - timerId(0) + timerId(0), + mDialpadVtKeyHandler(0), + isViewReady(0) { LC_QDEBUG( "livecomms [UI] -> LcView::LcView()" ) @@ -88,7 +87,7 @@ hideItems(Hb::DockWidgetItem); //Subscribe to the gesture events. - grabGesture(Qt::TapGesture); + grabGesture(Qt::TapGesture,Qt::DontStartGestureOnChildren); LC_QDEBUG( "livecomms [UI] <- LcView::LcView()" ) } @@ -107,6 +106,7 @@ delete mEffectHandler; delete mNotSupportedNote; + delete mDialpadVtKeyHandler; LC_QDEBUG( "livecomms [UI] <- LcView::~LcView()" ) } @@ -127,9 +127,7 @@ mDuration = static_cast( mRepository.findWidget( lcLabelDurationId ) ); mContactIcon = - static_cast( mRepository.findWidget( lcIconContactId ) ); - mBrandIcon = - static_cast( mRepository.findWidget( lcIconBrandId ) ); + static_cast( mRepository.findWidget( lcIconContactId ) ); mSharedVideoWidget = static_cast( mRepository.findWidget( lcWidgetSendVideoId ) ); @@ -152,11 +150,10 @@ static_cast( mRepository.findObject( lcButtonEndCall ) ); if ( mEndCallButton ) { - connect( mEndCallButton, SIGNAL(clicked()), SLOT(endVideoSession())); + connect( mEndCallButton, SIGNAL(clicked()), this, SLOT(endVideoSession())); } if ( mSharedVideoWidget ) { - mZoomSlider = mRepository.zoomSlider(); mSharedVideoEffectOverlay = static_cast( mRepository.findWidget( lcWidgetSendVideoId2 ) ); if ( mSharedVideoEffectOverlay ) { @@ -183,21 +180,40 @@ connect( menu(), SIGNAL(aboutToShow()), this, SLOT(menuAboutToShow()) ); connect( menu(), SIGNAL(aboutToHide()), this, SLOT(watchInactivity()) ); } - mSoftKeyBackAction = new HbAction(Hb::BackNaviAction, this); - connect(mSoftKeyBackAction, SIGNAL(triggered()), SLOT(back())); + + // Set up navigation action. + setNavigationAction(new HbAction(Hb::BackNaviAction, this)); + connect(navigationAction(), SIGNAL(triggered()), this, + SLOT(back())); // dialpad mDialpad = static_cast ( mRepository.findWidget("lc_label_dialpad") ); - connect( mDialpad, SIGNAL(aboutToClose()), SLOT(dialpadClosed()) ); - connect( mDialpad, SIGNAL(aboutToOpen()), SLOT(dialpadOpened()) ); - connect( &mDialpad->editor(), SIGNAL( contentsChanged() ), SLOT( dialpadEditorTextChanged() ) ); - - // inactivity - timerId = this->startTimer( inActivityTimeout ); - connect( this, SIGNAL( contentFullScreenChanged() ), SLOT( watchInactivity() ) ) ; + connect( mDialpad, SIGNAL(aboutToClose()), this, SLOT(dialpadClosed()) ); + connect( mDialpad, SIGNAL(aboutToOpen()), this, SLOT(dialpadOpened()) ); + connect( &mDialpad->editor(), SIGNAL( contentsChanged() ), this, SLOT( dialpadEditorTextChanged() ) ); + HbMainWindow* pWindow = HbInstance::instance()->allMainWindows().at(0); + if( pWindow && mDialpad ){ + mDialpadVtKeyHandler = new DialpadVtKeyHandler( mDialpad,*pWindow ); + } + + // inactivity + connect( this, SIGNAL( contentFullScreenChanged() ), this, SLOT( watchInactivity() ) ) ; - // activate fullscreen at beginning if inactivity timesout - toFullScreen( true ); + // deactivate fullscreen and it inturn starts inactivity timeout + toFullScreen( false ); + + if ( mSharedVideoWidget ) { + connect( mSharedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ), Qt::QueuedConnection ); + connect( mSharedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ) , Qt::QueuedConnection); + } + if ( mReceivedVideoWidget ) { + connect( mReceivedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ), Qt::QueuedConnection ); + connect( mReceivedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ), Qt::QueuedConnection ); + } LC_QDEBUG( "livecomms [UI] <- LcView::init()" ) } @@ -214,28 +230,33 @@ QRectF sharedContentRect; QRectF receivedContentRect; - if ( mSharedVideoWidget ) { - sharedContentRect = mSharedVideoWidget->geometry(); - sharedContentRect.moveTop( - sharedContentRect.y() + mapToParent(scenePos()).y()); - sharedContentRect = translateRectForOrientation(sharedContentRect); - mEffectHandler->setVisibility( - mSharedVideoWidget, mEngine.isLocalPlayerPlaying()); - } + //Workaround: widgets positioning takes time, do not inform to the + //engine for rendering if co-ordinates of the videos are incorrect. + + if ( isPositioned() ) { - if ( mReceivedVideoWidget ) { - receivedContentRect = mReceivedVideoWidget->geometry(); - receivedContentRect.moveTop( - receivedContentRect.y() + mapToParent(scenePos()).y()); - receivedContentRect = translateRectForOrientation(receivedContentRect); - mEffectHandler->setVisibility( - mReceivedVideoWidget, mEngine.isRemotePlayerPlaying()); + if ( mSharedVideoWidget ) { + sharedContentRect = mSharedVideoWidget->geometry(); + sharedContentRect.moveTop( + sharedContentRect.y() + mapToParent(scenePos()).y()); + sharedContentRect = translateRectForOrientation(sharedContentRect); + mEffectHandler->setVisibility( + mSharedVideoWidget, mEngine.isLocalPlayerPlaying()); + } + + if ( mReceivedVideoWidget ) { + receivedContentRect = mReceivedVideoWidget->geometry(); + receivedContentRect.moveTop( + receivedContentRect.y() + mapToParent(scenePos()).y()); + receivedContentRect = translateRectForOrientation(receivedContentRect); + mEffectHandler->setVisibility( + mReceivedVideoWidget, mEngine.isRemotePlayerPlaying()); + } + + mEngine.setContentAreas( sharedContentRect, receivedContentRect ); + mEngine.setOrientation( HbInstance::instance()->allMainWindows().at(0)->orientation() ); + mEngine.updateSession(); } - - mEngine.setContentAreas( sharedContentRect, receivedContentRect ); - mEngine.setOrientation( HbInstance::instance()->allMainWindows().at(0)->orientation() ); - mEngine.updateSession(); - LC_QDEBUG( "livecomms [UI] <- LcView::updateVideoRects()" ) } @@ -271,11 +292,6 @@ void LcView::activated() { LC_QDEBUG( "livecomms [UI] -> LcView::activated()" ) - - if ( navigationAction() != mSoftKeyBackAction ) { - setNavigationAction(mSoftKeyBackAction); - } - updateVideoRects(); //synchronize with engine @@ -440,7 +456,7 @@ mEffectHandler->setDissappearEffect( LcEffectHandler::NormalDissappear ); mEngine.toggleDisableCamera(); - toFullScreen( false ); + toFullScreen( mEngine.fullScreenMode() ); LC_QDEBUG( "livecomms [UI] <- LcView::disableCamera()" ) } @@ -502,32 +518,6 @@ } // ----------------------------------------------------------------------------- -// LcView::showZoom -// ----------------------------------------------------------------------------- -// -void LcView::showZoom() -{ - LC_QDEBUG("livecomms [UI] -> LcView::showZoom()") - - if ( !mZoomSlider ) { - return; - } - - LcControlValues values; - mEngine.zoomValues(values); - LC_QDEBUG_2("livecomms [UI] MinValue: ", values.mMinValue) - LC_QDEBUG_2("livecomms [UI] MaxValue: ", values.mMaxValue) - LC_QDEBUG_2("livecomms [UI] CurrentValue: ", values.mValue) - - mZoomSlider->setRange(values.mMinValue, values.mMaxValue); - mZoomSlider->setValue(values.mValue); - mZoomSlider->setSingleStep(1); - mZoomSlider->setVisible(true); - - LC_QDEBUG("livecomms [UI] <- LcView::showZoom()") -} - -// ----------------------------------------------------------------------------- // LcView::setCameraActionToMain // ----------------------------------------------------------------------------- // @@ -778,29 +768,16 @@ // QString LcView::currentLayout() { - QString layout( lcLayoutPortraitDefaultId ); - - if ( !isLandscapeOrientation() ) { - if ( mEffectHandler->isSwapInProgress() && - mSharedVideoWidget && - mReceivedVideoWidget && - mSharedVideoWidget->geometry().top() > mReceivedVideoWidget->geometry().top() ) { + QString layout( lcLayoutLandscapeDefaultId ); - layout = lcLayoutPortraitSwappedId; - } else { - layout = lcLayoutPortraitDefaultId; - } - } else { - if ( mEffectHandler->isSwapInProgress() && - mSharedVideoWidget && - mReceivedVideoWidget && - mSharedVideoWidget->geometry().left() > mReceivedVideoWidget->geometry().left() ) { + if ( mEffectHandler->isSwapInProgress() && + mSharedVideoWidget && + mReceivedVideoWidget && + mSharedVideoWidget->geometry().left() > mReceivedVideoWidget->geometry().left() ) { + + layout = lcLayoutLandscapeSwappedId; + } - layout = lcLayoutLandscapeSwappedId; - } else { - layout = lcLayoutLandscapeDefaultId; - } - } LC_QDEBUG_2( "livecomms [UI] -> LcView::currentLayout()", layout ) return layout; } @@ -818,16 +795,6 @@ } // ----------------------------------------------------------------------------- -// LcView::isLandscapeOrientation -// ----------------------------------------------------------------------------- -// -bool LcView::isLandscapeOrientation() -{ - return ( !HbInstance::instance()->allMainWindows().isEmpty() && - HbInstance::instance()->allMainWindows().at(0)->orientation() == Qt::Horizontal ); -} - -// ----------------------------------------------------------------------------- // LcView::translateRectForOrientation // Video windows at engine side do not change their coordinate system // when orientation at orbit UI changes. Therefore we need to convert video @@ -837,9 +804,6 @@ // QRectF LcView::translateRectForOrientation(const QRectF& origRect) { - if ( !isLandscapeOrientation() ){ - return origRect; - } QRectF newRect = origRect; QMatrix m; #if ( defined __WINSCW__ ) || ( defined __WINS__ ) @@ -860,9 +824,6 @@ // QPointF LcView::translatePointForOrientation(const QPointF& origPoint) { - if ( !isLandscapeOrientation() ) { - return origPoint; - } QPointF newPoint = origPoint; QMatrix m; #if ( defined __WINSCW__ ) || ( defined __WINS__ ) @@ -935,25 +896,17 @@ // void LcView::dialpadClosed() { - LC_QDEBUG("livecomms [UI] -> LcView::dialpadClosed()") + LC_QDEBUG("livecomms [UI] -> LcView::dialpadClosed()") + mDialpad->editor().setText(QString()); addOptionsMenuActions(); // switch back to the previous layout QString pLayout = mRepository.previousLayout(); QString layout; - bool isSwapped = ( pLayout == lcLayoutPortraitDefaultId || - pLayout == lcLayoutLandscapeDefaultId ) + bool isSwapped = (pLayout == lcLayoutLandscapeDefaultId) ? false : true; - // take care orientation changes - bool isLandscape = isLandscapeOrientation(); - if ( isLandscape ){ - layout = ( isSwapped ) ? lcLayoutLandscapeSwappedId - : lcLayoutLandscapeDefaultId; - - } - else { - layout = ( isSwapped ) ? lcLayoutPortraitSwappedId - : lcLayoutPortraitDefaultId; - } + layout = (isSwapped) ? + lcLayoutLandscapeSwappedId : lcLayoutLandscapeDefaultId; + mRepository.loadLayout( layout ); if ( mEffectHandler ){ mEffectHandler->startEffects(); @@ -969,9 +922,12 @@ void LcView::dialpadEditorTextChanged() { LC_QDEBUG_2("livecomms [UI] -> Dial Pad Field ", mDialpad->editor().text()); - LC_QDEBUG_2("livecomms [UI] -> Last Dialled Charcter ", mDialpad->editor().text().right(1)); - bool dialPadStatus = mEngine.SendDialTone(mDialpad->editor().text().right(1).at(0)); - LC_QDEBUG_2("livecomms [UI] -> Dialpad Send Tone Status ",dialPadStatus) + + if ( mDialpad->editor().text().length() > 0 ) { + LC_QDEBUG_2("livecomms [UI] -> Last Dialled Charcter ", mDialpad->editor().text().right(1)); + bool dialPadStatus = mEngine.SendDialTone(mDialpad->editor().text().right(1).at(0)); + LC_QDEBUG_2("livecomms [UI] -> Dialpad Send Tone Status ",dialPadStatus) + } } // ----------------------------------------------------------------------------- @@ -1010,7 +966,7 @@ // void LcView::watchInactivity() { - if( !mEngine.fullScreenMode()){ + if( !mEngine.fullScreenMode() && !( mDialpad && mDialpad->isOpen() ) ){ LC_QDEBUG("livecomms [UI] - LcView::watchInactivity() start watching inactivity") killTimer( timerId ); timerId = startTimer( inActivityTimeout ); @@ -1024,14 +980,62 @@ void LcView::toFullScreen( bool fullscreen ) { LC_QDEBUG_2("livecomms [UI] - LcView::toFullScreen(),",fullscreen) - if( menu()->isVisible() || mDialpad && mDialpad->isOpen() ) return; + if( menu()->isVisible() || ( mDialpad && mDialpad->isOpen() ) ) return; mEngine.setFullScreenMode( fullscreen ); setTitleBarVisible( !fullscreen ); + setStatusBarVisible( !fullscreen ); toolBar()->setVisible( !fullscreen ); - setVisibility( mEndCallButton, !fullscreen ); - setVisibility( mBrandIcon, !fullscreen ); + setVisibility( mEndCallButton, !fullscreen ); setVisibility( mDuration, !fullscreen ); setVisibility( mRecipient, !fullscreen ); emit contentFullScreenChanged(); } + + +// ----------------------------------------------------------------------------- +// LcView::isVideoPositionedCorrectly utility function +// ----------------------------------------------------------------------------- +// +bool LcView::isVideoPositionedCorrectly( LcVideoWidget* mVideoWidget ) +{ + LC_QDEBUG("livecomms [UI] -> LcView::isVideoPositionedCorrectly()") + LC_QDEBUG("livecomms [UI] <- LcView::isVideoPositionedCorrectly()") + QPointF initialPosition(0,0); + return ( !mVideoWidget || + (( mVideoWidget ) && ( mVideoWidget->pos()!= initialPosition ))); +} + +// ----------------------------------------------------------------------------- +// LcView::isPositioned utility function +// hack style since orbit give viewready much earlier and widgets do not have +// proper co-ordinates. +// ----------------------------------------------------------------------------- +// +bool LcView::isPositioned() +{ + LC_QDEBUG("livecomms [UI] -> LcView::isPositioned()") + // at first time check for video positions if they are not ready + // wait for x or y changed event and recheck position. + // After firsttime it will work. + if( !isViewReady ){ + isViewReady = isVideoPositionedCorrectly( mSharedVideoWidget ) && + isVideoPositionedCorrectly( mReceivedVideoWidget ); + if( isViewReady ){ + if ( mSharedVideoWidget ) { + disconnect( mSharedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ) ); + disconnect( mSharedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ) ); + } + if ( mReceivedVideoWidget ) { + disconnect( mReceivedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ) ); + disconnect( mReceivedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ) ); + } + } + } + LC_QDEBUG_2("livecomms [UI] - LcView::isPositioned(),",isViewReady) + return isViewReady; +} // End of file diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/src/lcviewmanager_p.cpp --- a/mmsharing/livecommsui/lcui/src/lcviewmanager_p.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/src/lcviewmanager_p.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -87,14 +87,6 @@ mEngine = new LcUiEngine( engineName, applicationDisplayName ); mRepository = new LcUiComponentRepository( *mEngine ); setCurrentView( true ); - - // TODO: ignore orientation change at the moment, enable later - /*connect( &mMainWindow, SIGNAL( orientationChanged(Qt::Orientation) ), - this, SLOT( updateLayout() ) ); - - connect( &mMainWindow, SIGNAL( aboutToChangeOrientation() ), - this, SLOT( prepareOrientationChange() ) ); - */ connect(&mMainWindow, SIGNAL(appFocusGained()), mEngine, SLOT(maximize())); connect(&mMainWindow, SIGNAL(appFocusLost()), mEngine, SLOT(minimize())); @@ -131,24 +123,6 @@ LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::terminateSession" ) } -// ----------------------------------------------------------------------------- -// LcViewManagerPrivate::updateLayout -// ----------------------------------------------------------------------------- -// -void LcViewManagerPrivate::updateLayout() -{ - LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::updateLayout()" ) - - if ( mMainWindow.currentView() ) { - LcView* currentView = static_cast( mMainWindow.currentView() ); - QString layout = currentView->currentLayout(); - mRepository->loadLayout( layout ); - currentView->setContentFullScreen( true ); - currentView->updateVideoRects(); - } - - LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::updateLayout()" ) -} // ----------------------------------------------------------------------------- // LcViewManagerPrivate::prepareOrientationChange diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengsessionmanager.cpp --- a/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengsessionmanager.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengsessionmanager.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -67,7 +67,7 @@ //iMsgSender = CMccDataSender::NewL(); MUS_LOG( "mus: [ENGINE] MsgQueue2 setup complete" ) iSession = CMusEngTwoWaySession::NewL(); - iSession->SetRemoteL( _L("WHAT") ); + iSession->SetRemoteL( _L("Homer Simpson") ); MUS_LOG( "mus: [ENGINE] <- CMusEngSessionManager::ConstructL()" ) } diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler.h Tue Jul 06 14:13:16 2010 +0300 @@ -0,0 +1,53 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dialpad key handler. +* +*/ + +#ifndef DIALPADVTKEYHANDLER_H +#define DIALPADVTKEYHANDLER_H + +#include + +class Dialpad; +class HbMainWindow; + +/*! + DialpadVtKeyHandler + Class provides key handling for dialpad component. + + @code + Dialpad *dialpad = new Dialpad(); + DialpadVtKeyHandler *keyhandler = new DialpadVtKeyHandler(dialpad, this); + @endcode + +*/ +class DialpadVtKeyHandler : public QObject +{ + Q_OBJECT + +public: + explicit DialpadVtKeyHandler(Dialpad *dialPad, HbMainWindow& mainWindow, QObject *parent = 0); + virtual ~DialpadVtKeyHandler(); + +private: + HbMainWindow& mMainWindow; + Dialpad* mDialPad; // not owned + +public: // helper + void contentChanged( QString chrs ); + +}; + +#endif // DIALPADVTKEYHANDLER_H diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler_stub.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -0,0 +1,45 @@ +/*! +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dialpad key handler. +* +*/ + +#include +#include +#include + +#define EMERGENCY_NUMBER "112" + +DialpadVtKeyHandler::DialpadVtKeyHandler(Dialpad *dialPad, HbMainWindow& mainWindow, QObject * parent) + : mMainWindow( mainWindow ), + mDialPad( dialPad ) +{ + Q_UNUSED(parent); +} + +DialpadVtKeyHandler::~DialpadVtKeyHandler() +{ + +} + +void DialpadVtKeyHandler::contentChanged( QString chrs ) +{ + if( mDialPad ){ + if( chrs == EMERGENCY_NUMBER ){ + mDialPad->setCallButtonEnabled(true); + }else{ + mDialPad->setCallButtonEnabled(false); + } + } +} diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmessagebox.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmessagebox.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmessagebox.h Tue Jul 06 14:13:16 2010 +0300 @@ -34,6 +34,26 @@ MessageTypeQuestion, MessageTypeWarning }; + + enum StandardButton { + NoButton = 0x00000000, + Ok = 0x00000400, + Save = 0x00000800, + Open = 0x00001000, + Yes = 0x00002000, + Continue = 0x00004000, + Delete = 0x00008000, + No = 0x00010000, + Retry = 0x00020000, + Close = 0x00040000, + Cancel = 0x00080000, + Help = 0x00100000, + Apply = 0x00200000, + Reset = 0x00400000 + }; + + Q_DECLARE_FLAGS(StandardButtons, StandardButton) + explicit HbMessageBox(MessageBoxType type=MessageTypeInformation,QGraphicsItem *parent = 0); explicit HbMessageBox(const QString &text,MessageBoxType type =MessageTypeInformation, QGraphicsItem *parent = 0); virtual ~HbMessageBox(); @@ -50,6 +70,9 @@ enum { Type = Hb::ItemType_MessageBox }; int type() const { return Type; } + void setStandardButtons(int buttons); + int standardButtons() const; + public: static bool launchQuestionMessageBox(const QString &questionText, const QString &primaryButtonText = tr("Yes"), diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbsliderpopup.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbsliderpopup.h Wed Jun 23 18:09:54 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: HbSliderPopup class definition. -* -*/ - - -#ifndef HB_SLIDERPOPUP_H -#define HB_SLIDERPOPUP_H - -//#include -#include - -class HbSliderPopup : public HbDialog -{ - -public: - explicit HbSliderPopup(QGraphicsItem *parent = 0); - virtual ~HbSliderPopup(); - - int maximum() const; - void setMaximum(int max); - - int minimum() const; - void setMinimum(int min); - - void setRange(int min, int max); - - int singleStep() const; - void setSingleStep(int step); - int value() const; - -public slots: - void setValue(int value); - -private: // Data added for the unit testing stub - int mMinValue; - int mMaxValue; - int mValue; - int mSingleStep; -}; - -#endif // HB_SLIDERPOPUP_H diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstub_helper.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstub_helper.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstub_helper.h Tue Jul 06 14:13:16 2010 +0300 @@ -28,6 +28,8 @@ static void reset(); static void setGestureState(int state); static void setGestureStyleHint(int style); + static bool isTitleBarVisible(); + static bool isStatusBarVisible(); }; #endif diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstubs.cpp --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstubs.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstubs.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include #include #include @@ -62,10 +60,12 @@ // No Gesture default state. Qt::GestureState testState = Qt::NoGesture; +HbTapGesture::TapStyleHint testStyleHint = HbTapGesture::Tap; -HbTapGesture::TapStyleHint testStyleHint = HbTapGesture::Tap; +// Title Bar and Status Bar Flags +bool titlebarVisible = true; +bool statusBarVisible = true; - // ----------------------------------------------------------------------------- // QCoreApplication::quit // ----------------------------------------------------------------------------- @@ -680,112 +680,6 @@ Q_UNUSED(text) } -// HbSliderPopup -// ----------------------------------------------------------------------------- -// HbSliderPopup::HbSliderPopup -// ----------------------------------------------------------------------------- -// - -HbSliderPopup::HbSliderPopup(QGraphicsItem *parent) - : HbDialog(parent) - -{ - -} - -// ----------------------------------------------------------------------------- -// HbSliderPopup::~HbSliderPopup -// ----------------------------------------------------------------------------- -// -HbSliderPopup::~HbSliderPopup() -{ -} - -// ----------------------------------------------------------------------------- -// HbSliderPopup::setRange -// ----------------------------------------------------------------------------- -// -void HbSliderPopup::setRange(int min,int max) -{ - mMinValue = min; - mMaxValue = max; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HbSliderPopup::minimum() const -{ - return mMinValue; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HbSliderPopup::maximum() const -{ - return mMaxValue; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HbSliderPopup::value() const -{ - return mValue; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -int HbSliderPopup::singleStep() const -{ - return mSingleStep; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void HbSliderPopup::setSingleStep(int step) - { - mSingleStep = step; - } - -// ----------------------------------------------------------------------------- -// HbSliderPopup::setValue -// ----------------------------------------------------------------------------- -// -void HbSliderPopup::setValue(int value) -{ - mValue = value; -} - - - -// HbZoomSliderPopup - -// ----------------------------------------------------------------------------- -// HbZoomSliderPopup::HbZoomSliderPopup -// ----------------------------------------------------------------------------- -// -HbZoomSliderPopup::HbZoomSliderPopup( ) : HbSliderPopup() -{ -} - -// ----------------------------------------------------------------------------- -// HbZoomSliderPopup::~HbZoomSliderPopup -// ----------------------------------------------------------------------------- -// -HbZoomSliderPopup::~HbZoomSliderPopup() -{ -} - - // ----------------------------------------------------------------------------- // HbToolBar::HbToolBar // ----------------------------------------------------------------------------- @@ -813,7 +707,6 @@ { mMenu = new HbMenu(this); mToolBar = new HbToolBar(this); - mTitlebarVisible = true; mDockWidgetVisible = true; } @@ -893,18 +786,20 @@ // void HbView::setTitleBarVisible(bool visible) { - mTitlebarVisible = visible; + titlebarVisible = visible; } + // ----------------------------------------------------------------------------- -// HbView::isTitleBarVisible +// HbView::setStatusBarVisible // ----------------------------------------------------------------------------- // -bool HbView::isTitleBarVisible() +void HbView::setStatusBarVisible(bool visible) { - return mTitlebarVisible; + statusBarVisible = visible; } + // ----------------------------------------------------------------------------- // HbView::setContentFullScreen // ----------------------------------------------------------------------------- @@ -965,9 +860,7 @@ const QString §ion , bool *ok ) { Q_UNUSED(fileName) - if ( section == lcLayoutPortraitDefaultId || - section == lcLayoutPortraitSwappedId || - section == lcLayoutLandscapeDefaultId || + if ( section == lcLayoutLandscapeDefaultId || section == lcLayoutLandscapeSwappedId || section == lcLayoutFullscreenId || section == lcLayoutLandscapeDialpadId ) { @@ -1005,8 +898,7 @@ } if (name == lcLabelRecipientId || name == lcLabelDurationId || - name == lcIconContactId || - name == lcIconBrandId || + name == lcIconContactId || name == lcWidgetSendVideoId2 || name == lcWidgetRecvVideoId2 ) { return mLabel; @@ -1015,6 +907,7 @@ QGraphicsWidget* createdWidget = static_cast(createObject(dummy,name)); if (createdWidget) { + createdWidget->setPos(QPointF(10,20)); mWidgets.append(createdWidget); } return createdWidget; @@ -1355,7 +1248,23 @@ return testStyleHint; } +// ----------------------------------------------------------------------------- +// HbMessageBox::setStandardButtons +// ----------------------------------------------------------------------------- +// +void HbMessageBox::setStandardButtons(int buttons) +{ + Q_UNUSED(buttons); +} +// ----------------------------------------------------------------------------- +// HbMessageBox::standardButtons +// ----------------------------------------------------------------------------- +// +int HbMessageBox::standardButtons() const +{ + return HbMessageBox::NoButton; +} // ----------------------------------------------------------------------------- // Stub Helper @@ -1377,4 +1286,15 @@ testState = Qt::NoGesture; } +bool HbStubHelper::isTitleBarVisible() +{ + return titlebarVisible; +} + +bool HbStubHelper::isStatusBarVisible() +{ + return statusBarVisible; +} + + // end of file diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbview.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbview.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbview.h Tue Jul 06 14:13:16 2010 +0300 @@ -37,9 +37,8 @@ void showItems(Hb::SceneItems items); void hideItems(Hb::SceneItems items); bool isItemVisible(Hb::SceneItem item) const; - void setTitleBarVisible(bool visible); - bool isTitleBarVisible(); + void setStatusBarVisible(bool visible); void setContentFullScreen(bool enable = true); HbAction *navigationAction() const; @@ -55,7 +54,6 @@ HbMenu* mMenu; HbToolBar* mToolBar; bool mDockWidgetVisible; - bool mTitlebarVisible; }; #endif // HBVIEW_H diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbzoomsliderpopup.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbzoomsliderpopup.h Wed Jun 23 18:09:54 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: HbZoomSliderPopup class definition. -* -*/ - - -#ifndef HBZOOM_SLIDERPOPUP_H -#define HBZOOM_SLIDERPOPUP_H - -#include - -class HbZoomSliderPopup : public HbSliderPopup -{ - -public: - - explicit HbZoomSliderPopup(); - virtual ~HbZoomSliderPopup(); - -}; - - -#endif // HBSLIDER_H diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lceffecthandler.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lceffecthandler.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lceffecthandler.h Tue Jul 06 14:13:16 2010 +0300 @@ -58,7 +58,6 @@ void testHideReceiveWindow(); void testEffectComplete(); void testStartEffect(); - void testSelectSwapEffect(); void testSetVisibility(); void testSetDissappearEffect(); diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcuicomponentrepository.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcuicomponentrepository.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcuicomponentrepository.h Tue Jul 06 14:13:16 2010 +0300 @@ -62,7 +62,6 @@ void testWaitingNote(); void testRecipientQuery(); void testShareOwnVideoQuery(); - void testZoomSlider(); void testSharedVideoContextMenu(); void testLoadView_FileNotFound(); void testConnect(); diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcview.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcview.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcview.h Tue Jul 06 14:13:16 2010 +0300 @@ -60,11 +60,11 @@ void testEndVideoSession(); void testMute(); void testChangeCamera(); - void testSwitchToVoiceCall(); - void testDisableCamera(); + void testSwitchToVoiceCall(); + void testDisableCameraWhenOnFullScreenMode(); + void testDisableCameraWhenNotOnFullScreenMode(); void testSpeaker(); void testSwap(); - void testShowZoom(); void testNotSupported(); void testSetCameraActionToMain(); void testSetCameraActionToSecondary(); @@ -96,6 +96,8 @@ void testToFullScreen(); void testWatchInactivity(); void testTimerEvent(); + void testIsVideoPositionedCorrectly(); + void testIsPositioned(); private: diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcviewmanager.h --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcviewmanager.h Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcviewmanager.h Tue Jul 06 14:13:16 2010 +0300 @@ -50,7 +50,6 @@ void testConstructor(); void testChangeView(); - void testUpdateLayout(); void testTerminateSession(); void testPrepareOrientationChange(); void testMainWindowEvent(); diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lceffecthandler.cpp --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lceffecthandler.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lceffecthandler.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -343,72 +343,6 @@ QCOMPARE( sharedVideoWidget->geometry(), sharedVideoWidget2->geometry() ); } -void UT_LcEffectHandler::testSelectSwapEffect() -{ - clearWidgets(); - - const char* effect; - - QRectF pos1 = QRectF(5,100, 200, 200); - QRectF pos2 = QRectF(5,300, 400, 400); - QRectF pos3 = QRectF(50,50, 100, 100); - QRectF pos4 = QRectF(100,100, 200, 200); - - - QVERIFY( !mEffectHandler->mSharedVideo ); - QVERIFY( !mEffectHandler->mReceivedVideo ); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mSharedVideo ); - QCOMPARE( effect, lcEffectWinDisappearId ); - - UT_SET_ORIENTATION( Qt::Vertical ); - QVERIFY( !mEffectHandler->mSharedVideo ); - QVERIFY( !mEffectHandler->mReceivedVideo ); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mSharedVideo ); - QCOMPARE( effect, lcEffectWinDisappearId ); - - setWidgets(); - - QVERIFY( mEffectHandler->mSharedVideo ); - QVERIFY( mEffectHandler->mReceivedVideo ); - - HbWidget* sharedVideoWidget = mEffectHandler->mSharedVideo; - HbWidget* receivedVideoWidget = mEffectHandler->mReceivedVideo; - - mEffectHandler->mSharedVideo = 0; - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mReceivedVideo ); - QCOMPARE( effect, lcEffectWinDisappearId ); - - mEffectHandler->mSharedVideo = sharedVideoWidget; - mEffectHandler->mReceivedVideo = 0; - mEffectHandler->selectSwapEffect( mEffectHandler->mSharedVideo ); - - mEffectHandler->mSharedVideo = sharedVideoWidget; - mEffectHandler->mReceivedVideo = receivedVideoWidget; - - mEffectHandler->mSharedVideo->setGeometry(pos1); - mEffectHandler->mReceivedVideo->setGeometry(pos1); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mSharedVideo ); - QCOMPARE( effect, lcEffectWinDisappearId ); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mReceivedVideo ); - QCOMPARE( effect, lcEffectWinDisappearId ); - - UT_SET_ORIENTATION( Qt::Vertical ); - mEffectHandler->mSharedVideo->setGeometry(pos1); - mEffectHandler->mReceivedVideo->setGeometry(pos2); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mSharedVideo ); - QCOMPARE( effect, lcEffectWinSwapDownId ); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mReceivedVideo ); - QCOMPARE( effect, lcEffectWinSwapUpId ); - - mEffectHandler->mSharedVideo->setGeometry(pos2); - mEffectHandler->mReceivedVideo->setGeometry(pos1); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mSharedVideo ); - QCOMPARE( effect, lcEffectWinSwapUpId ); - effect = mEffectHandler->selectSwapEffect( mEffectHandler->mReceivedVideo ); - QCOMPARE( effect, lcEffectWinSwapDownId ); -} - - void UT_LcEffectHandler::testSetVisibility() { setWidgets(); diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcuicomponentrepository.cpp --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcuicomponentrepository.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcuicomponentrepository.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -31,7 +31,6 @@ #include #include #include -#include #include #define UT_SET_ORIENTATION(orient) \ @@ -71,16 +70,14 @@ QVERIFY( !mRepository->mInvitingNote ); QVERIFY( !mRepository->mWaitingNote ); QVERIFY( !mRepository->mRecipientQuery ); - QVERIFY( !mRepository->mZoomSlider ); } void UT_LcUiComponentRepository::testIdleView() { // View not yet loaded - // Portrait layout - UT_SET_ORIENTATION( Qt::Vertical ); - QVERIFY( !mRepository->mIdleView ); + UT_SET_ORIENTATION( Qt::Horizontal ); + QVERIFY( !mRepository->mIdleView ); LcView* view = mRepository->idleView(); QVERIFY( mRepository->mIdleView ); QCOMPARE( view->objectName(), QString( lcViewIdleId ) ); @@ -149,23 +146,15 @@ void UT_LcUiComponentRepository::testAllInOneView() { // View not yet loaded - UT_SET_ORIENTATION( Qt::Vertical ); + UT_SET_ORIENTATION( Qt::Horizontal ); QVERIFY( !mRepository->mAllInOneView ); LcView* view = mRepository->allInOneView(); QVERIFY( mRepository->mAllInOneView ); QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); - QCOMPARE( mRepository->mLayoutSection, QString( lcLayoutPortraitDefaultId ) ); + QCOMPARE( mRepository->mLayoutSection, QString( lcLayoutLandscapeDefaultId ) ); // View loaded LcView* view2 = mRepository->allInOneView(); QVERIFY( view == view2 ); - - // Try fresh loading in landscape orientation - UT_SET_ORIENTATION( Qt::Horizontal ); - mRepository->mAllInOneView = 0; - view = mRepository->allInOneView(); - QVERIFY( mRepository->mAllInOneView ); - QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); - QCOMPARE( mRepository->mLayoutSection, QString( lcLayoutLandscapeDefaultId ) ); } void UT_LcUiComponentRepository::testAcceptQuery() @@ -242,24 +231,6 @@ QVERIFY( query2 == query ); } -void UT_LcUiComponentRepository::testZoomSlider() -{ - int sliderTimeout = 3000; // 3 Seconds Timeout - // slider created and returned - QVERIFY( !mRepository->mZoomSlider ); - HbDialog* slider = mRepository->zoomSlider(); - QVERIFY( mRepository->mZoomSlider ); - //QCOMPARE( slider, mRepository->mZoomSlider ); - QVERIFY( slider == mRepository->mZoomSlider ); - QVERIFY( !slider->isVisible() ); - QCOMPARE( sliderTimeout, slider->timeout() ); - - // Existing slider returned - HbDialog* slider2 = mRepository->zoomSlider(); - QVERIFY( slider2 == slider ); - -} - void UT_LcUiComponentRepository::testSharedVideoContextMenu() { HbMenu* menu = new HbMenu(); @@ -270,18 +241,18 @@ QVERIFY( mRepository->mAllInOneView ); QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); - HbAction zoom( lcActZoomId ); HbAction changeCamera( lcActChangeCameraId ); HbAction disableCam( lcActMenuDisableCameraId ); + HbAction enableCam( lcActEnableCameraId ); HbAction changeCam( lcActMenuChangeCameraId ); - mRepository->mActions.append( &zoom ); mRepository->mActions.append( &changeCamera ); mRepository->mActions.append( &disableCam ); + mRepository->mActions.append( &enableCam ); mRepository->mActions.append( &changeCam ); mRepository->sharedVideoContextMenuActions( menu, *view ); - //TBD stub implementation of void QGraphicsWidget::addAction(QAction *action); + //TODO: stub implementation of void QGraphicsWidget::addAction(QAction *action); //QVERIFY( !menu->isEmpty() ); } @@ -316,16 +287,18 @@ // View not yet loaded QVERIFY( mRepository->mLastLoadedView.length() == 0 ); - ok = mRepository->loadLayout( lcLayoutPortraitDefaultId ); + ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); QVERIFY( !ok ); // View is loaded mRepository->mLastLoadedView = lcIdleViewFile; - ok = mRepository->loadLayout( lcLayoutPortraitDefaultId ); + ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); QVERIFY( ok ); // Changing layout - ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); + ok = mRepository->loadLayout( lcLayoutLandscapeSwappedId ); + QVERIFY( ok ); + ok = mRepository->loadLayout( lcLayoutFullscreenId ); QVERIFY( ok ); // Loading non-existing section diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcvideowidget.cpp --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcvideowidget.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcvideowidget.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -66,6 +66,7 @@ { QPainter painter; QStyleOptionGraphicsItem style; + mVideoWidget->setPos(QPointF(10,100)); mVideoWidget->paint(&painter,&style,0); mVideoWidget2->paint(&painter,&style,0); } diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcview.cpp --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcview.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcview.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -34,12 +34,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include // Stub Helper @@ -95,6 +95,7 @@ void UT_LcView::testActivated() { + mView->init(); lcutStub_LcUiEngine_reset(); QVERIFY( lcutStub_LcUiEngine_getCurrentView() == 0 ); mView->activated(); @@ -130,14 +131,22 @@ mView->init(); QVERIFY( mView->mRecipient ); QVERIFY( !mView->mSharedVideoWidget ); - QVERIFY( !mView->mZoomSlider ); + QVERIFY( mView->mDialpad ); + QVERIFY( mView->mDialpadVtKeyHandler ); mRepository->mReturnSendVideo = true; mView->init(); QVERIFY( mView->mRecipient ); QVERIFY( mView->mSharedVideoWidget ); - QVERIFY( mView->mZoomSlider ); QVERIFY( mView->menu()); + QVERIFY( mView->mDialpad ); + QVERIFY( mView->mDialpadVtKeyHandler ); + + // emergency call + mView->mDialpadVtKeyHandler->contentChanged("112"); + QVERIFY( mView->mDialpad->mIsCallButtonEnabled ); + mView->mDialpadVtKeyHandler->contentChanged("100"); + QVERIFY( !mView->mDialpad->mIsCallButtonEnabled ); } void UT_LcView::testDeactivated() @@ -291,9 +300,19 @@ QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_stop ) ); } -void UT_LcView::testDisableCamera() +void UT_LcView::testDisableCameraWhenOnFullScreenMode() { - mView->init(); + mView->init(); + mEngine->setFullScreenMode(true); + mView->disableCamera(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_disableCamera ) ); + QVERIFY( mEngine->fullScreenMode() ); +} + +void UT_LcView::testDisableCameraWhenNotOnFullScreenMode() +{ + mView->init(); + mEngine->setFullScreenMode(false); mView->disableCamera(); QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_disableCamera ) ); QVERIFY( !mEngine->fullScreenMode() ); @@ -320,34 +339,6 @@ QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); } -void UT_LcView::testShowZoom() -{ - QVERIFY( !mView->mSharedVideoWidget ); - QVERIFY( !mView->mZoomSlider ); - mView->showZoom(); - QVERIFY( !mView->mZoomSlider ); - QVERIFY( !mView->mSharedVideoWidget ); - - LcVideoWidget sendVideo; - mView->mSharedVideoWidget = &sendVideo; - HbZoomSliderPopup zoomSlider; - mView->mZoomSlider = &zoomSlider; - - QVERIFY( mView->mSharedVideoWidget ); - QVERIFY( mView->mZoomSlider ); - mView->showZoom(); - QVERIFY( mView->mSharedVideoWidget ); - QVERIFY( mView->mZoomSlider ); - QVERIFY( mView->mZoomSlider->isVisible() ); - LcControlValues values; - mEngine->zoomValues( values ); - QCOMPARE( mView->mZoomSlider->value(), values.mValue ); - QCOMPARE( mView->mZoomSlider->minimum(), values.mMinValue ); - QCOMPARE( mView->mZoomSlider->maximum(), values.mMaxValue ); - -} - - void UT_LcView::testNotSupported() { HbMainWindow mainWin; @@ -404,29 +395,60 @@ mView->updateVideoRects(); QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); - QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + //Test: Shared video widgets and received video wigts are positioned at (0,0) + //It does not update. + lcutStub_LcUiEngine_reset(); + mView->isViewReady = false; + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + mView->mReceivedVideoWidget = receivedVideoWidget; + mView->mReceivedVideoWidget->setPos(QPointF(0,0)); + mView->updateVideoRects(); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + + //Test2: Shared video widgets positioned at (0,0) and other widgets is null + //It does not update. + lcutStub_LcUiEngine_reset(); + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + mView->mReceivedVideoWidget = 0; + mView->isViewReady = false; + mView->updateVideoRects(); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + //Test3: Shared video widgets positioned correctly and other widgets is null + //It update. + lcutStub_LcUiEngine_reset(); + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mSharedVideoWidget->setPos(QPointF(10,10)); + mView->mReceivedVideoWidget = 0; + mView->isViewReady = false; + mView->updateVideoRects(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); } void UT_LcView::testCurrentLayout() { mView->init(); QString layout; - - //1. Portrait layout - UT_SET_ORIENTATION( Qt::Vertical ); - layout = mView->currentLayout(); - QVERIFY( layout == lcLayoutPortraitDefaultId ); - //2. Landscape layout + //1. Landscape layout UT_SET_ORIENTATION( Qt::Horizontal ); layout = mView->currentLayout(); QVERIFY( layout == lcLayoutLandscapeDefaultId ); - //3. Landscape Swaped lcLayoutPortraitSwappedId - - // Shared window x cordintate is higher - // than Received windows x Cordinate. - + //2. Landscape swapped layout + // Shared window x coordinate is higher than Received windows x coordinate. + QRectF pos1 = QRectF(100,300, 400, 400); QRectF pos2 = QRectF(5,100, 200, 200); @@ -438,33 +460,11 @@ layout = mView->currentLayout(); QVERIFY( layout == lcLayoutLandscapeSwappedId ); - //4. If Its already Swaped Change to the normal Landscape Mode + //3. If it's already swapped, change to the normal landscape mode mView->mSharedVideoWidget->setGeometry(pos2); mView->mReceivedVideoWidget->setGeometry(pos1); layout = mView->currentLayout(); QVERIFY( layout == lcLayoutLandscapeDefaultId ); - - - //5. Portrait Swaped lcLayoutPortraitSwappedId - - // Shared window y cordintate is higher - // than Received windows y Cordinate. - - UT_SET_ORIENTATION( Qt::Vertical ); - mView->mEffectHandler->mSwapInProgress = true; - mView->mSharedVideoWidget->setGeometry(pos1); - mView->mReceivedVideoWidget->setGeometry(pos2); - - layout = mView->currentLayout(); - QVERIFY( layout == lcLayoutPortraitSwappedId ); - - //6. If its swaped in portait mode switch not normal portrait mode - mView->mEffectHandler->mSwapInProgress = true; - mView->mSharedVideoWidget->setGeometry(pos2); - mView->mReceivedVideoWidget->setGeometry(pos1); - layout = mView->currentLayout(); - QVERIFY( layout == lcLayoutPortraitDefaultId ); - } @@ -478,25 +478,28 @@ mView->menu()->setVisible( false ); mView->toFullScreen( true ); QVERIFY( mEngine->fullScreenMode() ); - QVERIFY( !mView->isTitleBarVisible() ); + // Use the helper function do not invent new one + QVERIFY( !HbStubHelper::isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isStatusBarVisible() ); QVERIFY( !mView->toolBar()->isVisible() ); - QVERIFY( !mView->mEndCallButton->isVisible()); - QVERIFY( !mView->mDuration->isVisible()); - QVERIFY( !mView->mRecipient->isVisible()); - QVERIFY( !mView->mBrandIcon->isVisible()); + QVERIFY( !mView->mEndCallButton->isVisible() ); + QVERIFY( !mView->mDuration->isVisible() ); + QVERIFY( !mView->mRecipient->isVisible() ); // Test2 : not in full screen mView->init(); mView->menu()->setVisible( false ); mView->toFullScreen( false ); - QVERIFY( !mEngine->fullScreenMode()); - QVERIFY( mView->isTitleBarVisible() ); + QVERIFY( !mEngine->fullScreenMode() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); QVERIFY( mView->toolBar()->isVisible() ); - QVERIFY( mView->mEndCallButton->isVisible()); - QVERIFY( mView->mDuration->isVisible()); - QVERIFY( mView->mRecipient->isVisible()); - QVERIFY( mView->mBrandIcon->isVisible()); - QVERIFY( mView->timerId ); + QVERIFY( mView->mEndCallButton->isVisible() ); + QVERIFY( mView->mDuration->isVisible() ); + QVERIFY( mView->mRecipient->isVisible() ); + int tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId != tId ); // Test3 : menu visible mView->init(); @@ -504,28 +507,32 @@ mView->toFullScreen( false ); mView->menu()->setVisible( true ); mView->toFullScreen( true ); - QVERIFY( !mEngine->fullScreenMode()); - QVERIFY( mView->isTitleBarVisible() ); + QVERIFY( !mEngine->fullScreenMode() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); QVERIFY( mView->toolBar()->isVisible() ); - QVERIFY( mView->mEndCallButton->isVisible()); - QVERIFY( mView->mDuration->isVisible()); - QVERIFY( mView->mRecipient->isVisible()); - QVERIFY( mView->mBrandIcon->isVisible()); - QVERIFY( mView->timerId ); + QVERIFY( mView->mEndCallButton->isVisible() ); + QVERIFY( mView->mDuration->isVisible() ); + QVERIFY( mView->mRecipient->isVisible() ); + tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId != tId ); // Test3 : dialpad visible mView->init(); delete mView->mDialpad; mView->mDialpad = new Dialpad(); mView->toFullScreen( true ); - QVERIFY( !mEngine->fullScreenMode()); - QVERIFY( mView->isTitleBarVisible() ); + QVERIFY( !mEngine->fullScreenMode() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); QVERIFY( mView->toolBar()->isVisible() ); - QVERIFY( mView->mEndCallButton->isVisible()); - QVERIFY( mView->mDuration->isVisible()); - QVERIFY( mView->mRecipient->isVisible()); - QVERIFY( mView->mBrandIcon->isVisible()); - QVERIFY( mView->timerId ); + QVERIFY( mView->mEndCallButton->isVisible() ); + QVERIFY( mView->mDuration->isVisible() ); + QVERIFY( mView->mRecipient->isVisible() ); + tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId == tId ); } void UT_LcView::testGestureEvent() @@ -533,12 +540,12 @@ mView->init(); mView->menu()->setVisible(false); UT_SET_ORIENTATION( Qt::Horizontal ); - mView->mItemContextMenu = 0; + mView->mSharedVideoWidget->setGeometry(QRectF(5,50, 100, 100)); mView->mReceivedVideoWidget->setGeometry(QRectF(5,200, 200, 400)); QList list; - - // Test1: Short tap Event anywhere on screen + + // Test1: Short tap Event toggle the full screen mode mEngine->setFullScreenMode(true); QPointF sharedVideoPos(10,60); QTapGesture *tapGesture = new QTapGesture(); @@ -549,30 +556,9 @@ QGestureEvent event1(list); mView->gestureEvent(&event1); QVERIFY( !mEngine->fullScreenMode()); - // no contet menu - QVERIFY( !mView->mItemContextMenu ); - mView->mItemContextMenu = 0; list.clear(); - // Test2: Long tap event on Shared Video Widget. - UT_SET_ORIENTATION( Qt::Vertical ); - QTapGesture *tapGesture1 = new QTapGesture(); - tapGesture1->setPosition(sharedVideoPos); - HbStubHelper::setGestureState(Qt::GestureUpdated); - HbStubHelper::setGestureStyleHint(HbTapGesture::TapAndHold); - list.append(tapGesture1); - QGestureEvent event2(list); - mEngine->setFullScreenMode(true); - mView->gestureEvent(&event2); - // No affect to the full screen mode it remains same - QVERIFY( mEngine->fullScreenMode()); - // Ensure context menu is created - QVERIFY( mView->mItemContextMenu ); - list.clear(); - mView->mItemContextMenu = 0; - - // Test3: Long tap event on Received Video Widget - UT_SET_ORIENTATION( Qt::Vertical ); + // Test2: Long tap event does not affect full screen mode. QTapGesture *tapGesture2 = new QTapGesture(); QPointF receivedVideoPos(10,210); tapGesture2->setPosition(receivedVideoPos); @@ -584,18 +570,16 @@ mView->gestureEvent(&event3); // Ensure it does not affect full screen mode. QVERIFY( mEngine->fullScreenMode()); - QVERIFY( !mView->mItemContextMenu ); - //Test4: Not Handled States. + //Test3: Not Handled States. HbStubHelper::setGestureState(Qt::GestureStarted); mEngine->setFullScreenMode(true); mView->gestureEvent(&event3); // Ensure its not handled everything remains same QVERIFY( mEngine->fullScreenMode()); - QVERIFY( !mView->mItemContextMenu ); list.clear(); - //Test5: Not Handled Event + //Test4: Not Handled Event QSwipeGesture *swipeGesture = new QSwipeGesture(); list.append(swipeGesture); QGestureEvent event4(list); @@ -603,8 +587,6 @@ mView->gestureEvent(&event4); // Ensure it does not affect full screen mode. QVERIFY( mEngine->fullScreenMode()); - QVERIFY( !mView->mItemContextMenu ); - } void UT_LcView::testContextMenu() @@ -674,12 +656,12 @@ mView->menu()->setVisible(false); mView->timerEvent( event ); QVERIFY( mEngine->fullScreenMode()); - QVERIFY( !mView->isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isStatusBarVisible() ); QVERIFY( !mView->toolBar()->isVisible() ); QVERIFY( !mView->mEndCallButton->isVisible()); QVERIFY( !mView->mDuration->isVisible()); - QVERIFY( !mView->mRecipient->isVisible()); - QVERIFY( !mView->mBrandIcon->isVisible()); + QVERIFY( !mView->mRecipient->isVisible()); delete event; // not a timer we want @@ -687,13 +669,12 @@ event = new QTimerEvent( 22222 ); // some number mView->timerEvent( event ); QVERIFY( !mEngine->fullScreenMode() ); - QVERIFY( mView->isTitleBarVisible() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); QVERIFY( mView->toolBar()->isVisible() ); QVERIFY( mView->mEndCallButton->isVisible()); QVERIFY( mView->mDuration->isVisible()); QVERIFY( mView->mRecipient->isVisible()); - QVERIFY( mView->mBrandIcon->isVisible()); - QVERIFY( mView->timerId); delete event; } @@ -713,12 +694,12 @@ mEngine->setFullScreenMode(true); mView->updateSwapLayout(); QVERIFY( mEngine->fullScreenMode()); - QVERIFY( !mView->isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isStatusBarVisible() ); QVERIFY( !mView->isItemVisible(Hb::DockWidgetItem ) ); QVERIFY( !mView->mEndCallButton->isVisible()); QVERIFY( !mView->mDuration->isVisible()); - QVERIFY( !mView->mRecipient->isVisible()); - QVERIFY( !mView->mBrandIcon->isVisible()); + QVERIFY( !mView->mRecipient->isVisible()); } void UT_LcView::testMenuAboutToShow() @@ -728,40 +709,32 @@ mView->toFullScreen( true ); mView->menuAboutToShow(); QVERIFY( !mEngine->fullScreenMode()); - QVERIFY( mView->isTitleBarVisible() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); QVERIFY( mView->toolBar()->isVisible() ); QVERIFY( mView->mEndCallButton->isVisible()); QVERIFY( mView->mDuration->isVisible()); QVERIFY( mView->mRecipient->isVisible()); - QVERIFY( mView->mBrandIcon->isVisible()); - QVERIFY( mView->timerId); + int tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId != tId ); } void UT_LcView::testTranslateRectForOrientation() { - UT_SET_ORIENTATION( Qt::Vertical ); + UT_SET_ORIENTATION( Qt::Horizontal ); QRectF origRect( 10, 10, 100, 200 ); - QRectF modRect = mView->translateRectForOrientation(origRect); - QVERIFY( origRect == modRect ); - - UT_SET_ORIENTATION( Qt::Horizontal ); - modRect = mView->translateRectForOrientation(origRect); QVERIFY( modRect.height() == origRect.width() ); QVERIFY( modRect.width() == origRect.height() ); } void UT_LcView::testTranslatePointForOrientation() { - UT_SET_ORIENTATION( Qt::Vertical ); + UT_SET_ORIENTATION( Qt::Horizontal ); QPointF origPoint( 10, 20 ); - QPointF modPoint = mView->translatePointForOrientation(origPoint); - QVERIFY( origPoint == modPoint ); - - UT_SET_ORIENTATION( Qt::Horizontal ); - modPoint = mView->translatePointForOrientation(origPoint); QVERIFY( origPoint != modPoint ); } @@ -782,7 +755,8 @@ QVERIFY(mView->mDialpad->isOpen()); QVERIFY(!mView->mDialpad->mIsCallButtonEnabled); QVERIFY(mView->mRepository.mLayoutSection == lcLayoutLandscapeDialpadId); - QVERIFY(mView->isTitleBarVisible()); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); QCOMPARE(mView->menu()->actions().size(), 0); QVERIFY(!mView->mEngine.fullScreenMode()); } @@ -801,10 +775,19 @@ HbMainWindow& window = *(HbInstance::instance()->allMainWindows().at(0)); window.setOrientation( Qt::Horizontal ); mView->openDialpad(); + + // Enter some dummy text + mView->mDialpad->editor().setText( QString("1") ); mView->dialpadClosed(); + // Ensure text is cleared. + + QCOMPARE(mView->mDialpad->editor().text(), QString::fromAscii("")); + QVERIFY(!mView->mDialpad->editor().text().length()); + // check that layout has changed QVERIFY(mView->mRepository.layout()!= lcLayoutLandscapeDialpadId); - QVERIFY(mView->isTitleBarVisible()); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); QVERIFY(mView->toolBar()->isVisible()); QVERIFY(mView->mEndCallButton->isVisible()); QVERIFY(mView->mRecipient->isVisible()); @@ -819,25 +802,12 @@ // check for swapped view appears QVERIFY( mView->mRepository.layout()== lcLayoutLandscapeSwappedId ); // check titlebar invisible - QVERIFY( mView->isTitleBarVisible() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); // check toolbar invisible QVERIFY( mView->toolBar()->isVisible() ); QVERIFY(!mView->mEngine.fullScreenMode()); - - // test : orientation to portrait - // swapped,fullscreen,landscape,open and close dialpad scenario - mView->mRepository.loadLayout( lcLayoutLandscapeSwappedId ); - mView->openDialpad(); - window.setOrientation( Qt::Vertical ); - mView->dialpadClosed(); - // check for swapped view appears - QVERIFY( mView->mRepository.layout()== lcLayoutPortraitSwappedId ); - // check titlebar visible - QVERIFY( mView->isTitleBarVisible() ); - // check toolbar visible - QVERIFY( mView->toolBar()->isVisible() ); - QVERIFY(!mView->mEngine.fullScreenMode()); - + } @@ -879,13 +849,70 @@ } void UT_LcView::testWatchInactivity() -{ +{ + mView->init(); + + // test : in fullscreen mode already, dont start timer again int tid = mView->timerId ; - mView->mEngine.setFullScreenMode( true ); + mView->mEngine.setFullScreenMode( true ); mView->watchInactivity(); QVERIFY( tid==mView->timerId ); + + // test : not in full screen but dialpad view. dont start timer + mView->mEngine.setFullScreenMode( false ); + QVERIFY( mView->mDialpad ); + mView->openDialpad(); + mView->watchInactivity(); + QVERIFY( tid==mView->timerId ); + // test : not in full screen and no dialpad , start timer mView->mEngine.setFullScreenMode( false ); + QVERIFY( mView->mDialpad ); + mView->mDialpad->closeDialpad(); mView->watchInactivity(); QVERIFY( tid!=mView->timerId ); + } + + + +void UT_LcView::testIsVideoPositionedCorrectly() +{ + //Test1: Null video Widget returns true + mRepository->mReturnSendVideo = false; + mView->init(); + QVERIFY( !mView->mSharedVideoWidget ); + QVERIFY(mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget)); + + //Test2: Valid Video widgets with correct position returns true: + mRepository->mReturnSendVideo = true; + mView->init(); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); + + //Test3: Vaild video widgets withi co-ordinates returns false. + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( !mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); +} + + +void UT_LcView::testIsPositioned() +{ + //Test: isViewReady is true and proper co-ordinates + mRepository->mReturnSendVideo = true; + mView->init(); + QVERIFY( !mView->isViewReady ); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); + mView->isPositioned(); + QVERIFY( mView->isViewReady ); + + //Test: isViewReady is false and its first time and co ordinates are 0,0 + mView->isViewReady = false; + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( !mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); + mView->isPositioned(); + QVERIFY( !mView->isViewReady ); +} diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcviewmanager.cpp --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcviewmanager.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcviewmanager.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -143,21 +143,6 @@ } -void UT_LcUiViewManager::testUpdateLayout() -{ - QVERIFY( mViewManager->mMainWindow.viewCount() == 1 ); - mViewManager->updateLayout(); - QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); - QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); - QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); - lcutStub_LcUiEngine_reset(); - - // No active view - mViewManager->mMainWindow.setCurrentView( 0 ); - mViewManager->updateLayout(); - QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); -} - void UT_LcUiViewManager::testTerminateSession() { QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcui/tsrc/ut_lcui/ut_lcui.pro --- a/mmsharing/livecommsui/lcui/tsrc/ut_lcui/ut_lcui.pro Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/ut_lcui.pro Tue Jul 06 14:13:16 2010 +0300 @@ -53,11 +53,13 @@ HEADERS += $$LCUI_DIR/inc/lcvideowidget.h HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine.h HEADERS += ./hbstubs/dialpad.h +HEADERS += ./hbstubs/dialpadvtkeyhandler.h HEADERS += ./hbstubs/hblineedit.h SOURCES += src/main.cpp SOURCES += hbstubs/hbstubs.cpp SOURCES += hbstubs/dialpad_stub.cpp +SOURCES += hbstubs/dialpadvtkeyhandler_stub.cpp SOURCES += src/ut_lcviewmanager.cpp SOURCES += $$LCUI_DIR/src/lcviewmanager.cpp SOURCES += $$LCUI_DIR/src/lcviewmanager_p.cpp diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcuiengine/src/lcuiengine_p.cpp --- a/mmsharing/livecommsui/lcuiengine/src/lcuiengine_p.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcuiengine/src/lcuiengine_p.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -269,6 +269,7 @@ // ----------------------------------------------------------------------------- // LcUiEnginePrivate::setOrientation +// Currently the only supported orientation is landscape. // ----------------------------------------------------------------------------- // bool LcUiEnginePrivate::setOrientation( Qt::Orientation orientation ) @@ -279,16 +280,13 @@ MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); MLcVideoPlayer* remotePlayer = session().RemoteVideoPlayer(); - MLcWindow::TLcWindowOrientation newOrientation( MLcWindow::EPortrait ); - if ( orientation == Qt::Horizontal ) { - newOrientation = MLcWindow::ELandscape; - } + Q_UNUSED(orientation); if ( localPlayer && localPlayer->LcWindow() ) { - TRAP(error1, localPlayer->LcWindow()->SetLcWindowOrientationL( newOrientation ) ); + TRAP(error1, localPlayer->LcWindow()->SetLcWindowOrientationL( MLcWindow::ELandscape ) ); } if ( remotePlayer && remotePlayer->LcWindow() ) { - TRAP(error2, remotePlayer->LcWindow()->SetLcWindowOrientationL( newOrientation )); + TRAP(error2, remotePlayer->LcWindow()->SetLcWindowOrientationL( MLcWindow::ELandscape )); } if ( (error1 == KErrNone) && (error2 == KErrNone) ) { @@ -1436,9 +1434,10 @@ { LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::stopLocalVideo()" ) MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); - if( localPlayer ){ + if( localPlayer ) { pause( localPlayer ); - enableWindow( localPlayer, false ); + enableWindow( localPlayer, false ); + completeAction( lcEngSignalNameCameraDisabled ); } LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::stopLocalVideo()" ) } @@ -1453,7 +1452,7 @@ MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); if( localPlayer ){ play( localPlayer ); - enableWindow( localPlayer, true ); + enableWindow( localPlayer, true ); } LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startLocalVideo()" ) } diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/ut_lcuiengine.cpp --- a/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/ut_lcuiengine.cpp Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/ut_lcuiengine.cpp Tue Jul 06 14:13:16 2010 +0300 @@ -594,8 +594,6 @@ //1. setting landscape QVERIFY( LC_SESSION( mEngine )->iLocalPlayer ); QVERIFY( LC_SESSION( mEngine )->iRemotePlayer ); - QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::EPortrait ); - QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::EPortrait ); ok = mEngine->d->setOrientation( Qt::Horizontal ); QVERIFY( ok ); @@ -603,16 +601,7 @@ QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::ELandscape ); QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::ELandscape ); - - //2. setting portrait - lcutStub_LcPlayer_reset(); - ok = mEngine->d->setOrientation( Qt::Vertical ); - QVERIFY( ok ); - QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcWindowOrientationL ) ); - QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::EPortrait ); - QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::EPortrait ); - - //3. setting layout failed + //2. setting layout failed // Leave lcutStub_LcEngine_setFailure( -1 ); lcutStub_LcPlayer_reset(); @@ -620,7 +609,7 @@ QVERIFY( !ok ); QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); - //4. setting layout with no players + //3. setting layout with no players lcutStub_LcEngine_reset(); lcutStub_LcPlayer_reset(); delete LC_SESSION( mEngine )->iLocalPlayer; @@ -633,6 +622,7 @@ QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); } + void UT_LcUiEngine::testToggleMute() { QSignalSpy mutedSpy(mEngine, SIGNAL(muted())); diff -r 53c1c4459a94 -r 5554410e16f5 mmsharing/mmshapp/mmshapp.pro --- a/mmsharing/mmshapp/mmshapp.pro Wed Jun 23 18:09:54 2010 +0300 +++ b/mmsharing/mmshapp/mmshapp.pro Tue Jul 06 14:13:16 2010 +0300 @@ -31,4 +31,5 @@ TARGET.UID2 = 0x100039CE TARGET.UID3 = 0x10282391 TARGET.CAPABILITY = CAP_APPLICATION NetworkControl SwEvent Location MultimediaDD + RSS_RULES += "hidden = KAppIsHidden;" } diff -r 53c1c4459a94 -r 5554410e16f5 tsrc/unittestrunner/unittest_qt_config.txt --- a/tsrc/unittestrunner/unittest_qt_config.txt Wed Jun 23 18:09:54 2010 +0300 +++ b/tsrc/unittestrunner/unittest_qt_config.txt Tue Jul 06 14:13:16 2010 +0300 @@ -1,3 +1,3 @@ -ut_lcuieng -noprompt,ut_lcui_lcUiEngine.xml +ut_lcuieng -noprompt,ut_lcui_lcUiEngine.xml,ut_lcui_lcactivitymanager.xml ut_lcui -noprompt,ut_lcui_LcViewManager.xml,ut_lcui_LcUiComponentRepository.xml,ut_lcui_LcView.xml,ut_lcui_LcEffectHandler.xml,ut_lcui_LcVideoWidget.xml ut_mmshapp -noprompt,ut_lcapplication.xml \ No newline at end of file