--- a/inc/videoactivitystate.h Thu Jul 08 13:05:19 2010 +0300
+++ b/inc/videoactivitystate.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#3 %
+// Version : %version: da1mmcf#4 %
#ifndef __VIDEOACTIVITYSTATE_H__
#define __VIDEOACTIVITYSTATE_H__
@@ -30,6 +30,9 @@
// last position of the last played media clip (int)
static const QString KEY_LAST_PLAY_POSITION_ID = "_VideoActivity_last_play_position_id_";
+// TMPXId of the last played media file
+static const QString KEY_LAST_PLAYED_MEDIA_ID = "_VideoActivity_last_played_media_id_";
+
// name of the media clip last played (QString)
static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_";
--- a/mediasettings/videosettingsplugin/src/videosettingsgroup.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/mediasettings/videosettingsplugin/src/videosettingsgroup.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -100,45 +100,39 @@
// Access point in use
mAccessPointItem = new VideoSettingsAccessPointEntry(itemDataHelper,
hbTrId("txt_videos_dblist_access_point"), this);
- this->appendChild(mAccessPointItem);
// Lowest UDP port
mLowestUDPPortItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_min_udp_port"));
+ hbTrId("txt_videos_dblist_min_udp_port"), this);
mLowestUDPPortItem->setContentWidgetData(QString("maxRows"), 1);
mItemDataHelper.addConnection(mLowestUDPPortItem, SIGNAL(editingFinished()),
this, SLOT(lowestUdpPortEditingFinished()));
- this->appendChild(mLowestUDPPortItem);
// Highest UDP port
mHighestUDPPortItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_max_udp_port"));
+ hbTrId("txt_videos_dblist_max_udp_port"), this);
mHighestUDPPortItem->setContentWidgetData(QString("maxRows"), 1);
mItemDataHelper.addConnection(mHighestUDPPortItem, SIGNAL(editingFinished()),
this, SLOT(highestUdpPortEditingFinished()));
- this->appendChild(mHighestUDPPortItem);
// Use proxy
- mUseProxyItem = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, QString());
+ mUseProxyItem = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, QString(), this);
mUseProxyItem->setContentWidgetData(QString("text"), hbTrId("txt_videos_formlabel_proxy_in_use"));
- this->appendChild(mUseProxyItem);
// Proxy server address
mProxyServerItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_proxy_host_name"));
+ hbTrId("txt_videos_dblist_proxy_host_name"), this);
mProxyServerItem->setContentWidgetData(QString("maxRows"), 1);
mProxyServerItem->setContentWidgetData(QString("placeholderText"), hbTrId("txt_videos_dblist_none"));
mItemDataHelper.addConnection(mProxyServerItem, SIGNAL(editingFinished()),
this, SLOT(proxyServerEditingFinished()));
- this->appendChild(mProxyServerItem);
// Proxy port number
mProxyPortItem = new CpSettingFormItemData(HbDataFormModelItem::TextItem,
- hbTrId("txt_videos_dblist_proxy_port"));
+ hbTrId("txt_videos_dblist_proxy_port"), this);
mProxyPortItem->setContentWidgetData(QString("maxRows"), 1);
mItemDataHelper.addConnection(mProxyPortItem, SIGNAL(editingFinished()),
this, SLOT(proxyPortEditingFinished()));
- this->appendChild(mProxyPortItem);
loadSettings();
}
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/src/testvideosettingsgroup.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/src/testvideosettingsgroup.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -26,7 +26,7 @@
#include "testvideosettingsgroup.h"
#include "videosettingsaccesspointentry.h"
-#include "mpsettingsmodel.h"
+#include "stub/inc/mpsettingsmodel.h"
#include "hbdataformmodel.h"
#include "cpitemdatahelper.h"
#include "hbvalidator.h"
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/mpsettingsmodel.h Thu Jul 08 13:05:19 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/mpsettingsmodel.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 2 %
+// Version : %version: 3 %
@@ -85,13 +85,13 @@
* EConfigDefault: Load default values
* EConfigUser: Load user values
*/
- void LoadSettingsL(TInt aConfigVersion);
+ virtual void LoadSettingsL(TInt aConfigVersion);
/**
* Writes settings to MMF controller.
* @since 2.0
*/
- void StoreSettingsL();
+ virtual void StoreSettingsL();
/**
* Sets proxy mode..
@@ -99,7 +99,7 @@
* @param aMode Proxy mode.
* @return Error value.
*/
- TInt SetProxyMode(TInt aMode);
+ virtual TInt SetProxyMode(TInt aMode);
/**
* Returns proxy mode.
@@ -109,7 +109,7 @@
* 1: Enabled
* @return Error value.
*/
- TInt GetProxyMode(TInt& aMode);
+ virtual TInt GetProxyMode(TInt& aMode);
/**
* Sets Proxy host name.
@@ -117,7 +117,7 @@
* @param aHostName Proxy host name.
* @return Error value.
*/
- TInt SetProxyHostNameL(const TDesC& aHostName);
+ virtual TInt SetProxyHostNameL(const TDesC& aHostName);
/**
* Returns proxy host name.
@@ -125,7 +125,7 @@
* @param aHostName Proxy host name.
* @return Error value.
*/
- TInt GetProxyHostName(TDes& aHostName);
+ virtual TInt GetProxyHostName(TDes& aHostName);
/**
* Sets proxy port number.
@@ -133,7 +133,7 @@
* @param aPort Proxy port number.
* @return Error value.
*/
- TInt SetProxyPort(TInt aPort);
+ virtual TInt SetProxyPort(TInt aPort);
/**
* Returns proxy port number..
@@ -141,7 +141,7 @@
* @return Integer: Proxy port number.
* @return Error value.
*/
- TInt GetProxyPort(TInt& aPort);
+ virtual TInt GetProxyPort(TInt& aPort);
/**
* Sets default access point.
@@ -149,7 +149,7 @@
* @param aApId Access point ID.
* @return Error value.
*/
- TInt SetDefaultAp(TUint32 aApId);
+ virtual TInt SetDefaultAp(TUint32 aApId);
/**
* Returns default access point ID.
@@ -157,7 +157,7 @@
* @param aApId Access point ID.
* @return Error value.
*/
- TInt GetDefaultAp(TUint32& aApId);
+ virtual TInt GetDefaultAp(TUint32& aApId);
/**
* Sets minimum UDP port number.
@@ -165,7 +165,7 @@
* @param aPort minimum port number.
* @return Error value.
*/
- TInt SetMinUDPPort(TInt aPort);
+ virtual TInt SetMinUDPPort(TInt aPort);
/**
* Returns minimum UDP port number.
@@ -173,7 +173,7 @@
* @param aPort minimum UDP port number in minutes.
* @return Error value.
*/
- TInt GetMinUDPPort(TInt& aPort);
+ virtual TInt GetMinUDPPort(TInt& aPort);
/**
* Sets maximum UDP port number.
@@ -181,7 +181,7 @@
* @param aPort maximum port number.
* @return Error value.
*/
- TInt SetMaxUDPPort(TInt aPort);
+ virtual TInt SetMaxUDPPort(TInt aPort);
/**
* Returns maximum UDP port number.
@@ -189,7 +189,7 @@
* @param aPort maximum UDP port number in minutes.
* @return Error value.
*/
- TInt GetMaxUDPPort(TInt& aPort);
+ virtual TInt GetMaxUDPPort(TInt& aPort);
public:
static TUid mImplUid;
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/mpsettingsmodel.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/mpsettingsmodel.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -16,7 +16,7 @@
*/
// INCLUDE FILES
-#include "mpsettingsmodel.h"
+#include "stub/inc/mpsettingsmodel.h"
#include <qglobal.h>
#include <xqconversions.h>
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/videosettingsaccesspointentry.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/stub/src/videosettingsaccesspointentry.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -16,6 +16,7 @@
*/
#include "videosettingsaccesspointentry.h"
+#include "videosettingsgroup.h"
#include <cpitemdatahelper.h>
// ---------------------------------------------------------------------------
@@ -30,6 +31,7 @@
mText(text),
mParent(parent)
{
+ mParent->appendChild(this);
Q_UNUSED(itemDataHelper);
}
--- a/mediasettings/videosettingsplugin/tsrc/testgroup/testvideosettingsgroup.pro Thu Jul 08 13:05:19 2010 +0300
+++ b/mediasettings/videosettingsplugin/tsrc/testgroup/testvideosettingsgroup.pro Fri Jul 23 11:10:06 2010 +0300
@@ -21,11 +21,24 @@
inc \
src
-INCLUDEPATH += inc \
- stub/inc \
- ../../inc \
- ../../../mediasettingsengine/inc \
- ../../../../inc \
+INCLUDEPATH = inc \
+ stub/inc \
+ ../../inc \
+ ../../../mediasettingsengine/inc \
+ ../../../../inc \
+ /epoc32/include \
+ /epoc32/include/stdapis \
+ /epoc32/include/stdapis/sys \
+ /epoc32/include/platform/mw \
+ /epoc32/include/platform \
+ /epoc32/include/platform/loc \
+ /epoc32/include/platform/mw/loc \
+ /epoc32/include/platform/loc/sc \
+ /epoc32/include/platform/mw/loc/sc \
+ /epoc32/include/mw/hb/hbcore \
+ /epoc32/include/mw/hb/hbwidgets \
+ /epoc32/include/mw/hb/hbutils \
+ /epoc32/include/stdapis/stlportv5 \
CONFIG += qtestlib \
Hb \
--- a/videocollection/videocollectionview/data/collectionview.docml Thu Jul 08 13:05:19 2010 +0300
+++ b/videocollection/videocollectionview/data/collectionview.docml Fri Jul 23 11:10:06 2010 +0300
@@ -36,15 +36,20 @@
</widget>
<widget name="content" role="HbView:widget" type="HbWidget">
<widget name="vc:mStackedLayout" type="HbWidget">
- <widget name="vc:mListWidget" type="VideoListWidget">
+ <widget name="vc:mListStacked" type="HbWidget">
<sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <widget name="vc:mHintWidget" type="VideoHintWidget">
+ <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
<bool name="visible" value="FALSE"/>
- </widget>
+ </widget>
<real name="z" value="0"/>
<sizehint height="72un" type="PREFERRED" width="53.6un"/>
<bool name="visible" value="TRUE"/>
<layout type="stacked">
- <stackitem itemname="vc:mListWidget"/>
+ <stackitem itemname="vc:mListStacked"/>
+ <stackitem itemname="vc:mHintWidget"/>
</layout>
</widget>
<widget name="vc:mBanner" type="HbGroupBox">
@@ -65,83 +70,63 @@
</widget>
</widget>
<section name="hintSection">
- <widget name="view" type="VideoListView">
- <widget name="content" role="HbView:widget" type="HbWidget">
- <widget name="vc:mStackedLayout" type="HbWidget">
- <widget name="vc:mHintWidget" type="VideoHintWidget">
- <widget name="vc:mNoVideosLabel" type="HbLabel">
- <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <sizehint height="6un" type="PREFERRED"/>
- <sizehint height="6un" type="MAXIMUM" width="2504062.01158un"/>
- <bool name="visible" value="FALSE"/>
- <string locid="txt_videos_info_no_videos" name="plainText" value="(No videos)"/>
- </widget>
- <widget name="vc:mHintButtonLayout" type="HbWidget">
- <widget name="vc:mHintButton" type="HbPushButton">
- <real name="z" value="1"/>
- <sizehint type="PREFERRED"/>
- <sizehint height="6un" type="MAXIMUM" width="2504062.01158un"/>
- <bool name="visible" value="FALSE"/>
- <string name="state" value="normal"/>
- </widget>
- <real name="z" value="0"/>
- <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
- <layout orientation="Horizontal" type="linear">
- <stretchitem stretchfactor="1"/>
- <linearitem itemname="vc:mHintButton"/>
- <stretchitem stretchfactor="1"/>
- </layout>
- </widget>
- <real name="z" value="0"/>
- <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
- <bool name="visible" value="FALSE"/>
- <layout orientation="Vertical" type="linear">
- <stretchitem stretchfactor="1"/>
- <linearitem itemname="vc:mNoVideosLabel"/>
- <linearitem itemname="vc:mHintButtonLayout"/>
- <stretchitem stretchfactor="1"/>
- </layout>
- </widget>
- <real name="z" value="0"/>
- <layout type="stacked">
- <stackitem itemname="vc:mListWidget"/>
- <stackitem itemname="vc:mHintWidget"/>
- </layout>
+ <widget name="vc:mHintWidget" type="VideoHintWidget">
+ <widget name="vc:mNoVideosLabel" type="HbLabel">
+ <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+ <sizehint height="6un" type="PREFERRED"/>
+ <sizehint height="6un" type="MAXIMUM" width="2504062.01158un"/>
+ <bool name="visible" value="FALSE"/>
+ <string locid="txt_videos_info_no_videos" name="plainText" value="(No videos)"/>
+ <fontspec name="fontSpec" role="Primary" textheight="26.8"/>
+ </widget>
+ <widget name="vc:mHintButtonLayout" type="HbWidget">
+ <widget name="vc:mHintButton" type="HbPushButton">
+ <real name="z" value="1"/>
+ <sizehint type="PREFERRED"/>
+ <sizehint height="6un" type="MAXIMUM" width="2504062.01158un"/>
+ <bool name="visible" value="FALSE"/>
+ <string name="state" value="normal"/>
</widget>
+ <real name="z" value="0"/>
+ <sizehint height="11.9403un" type="PREFERRED" width="23.8806un"/>
+ <layout orientation="Horizontal" type="linear">
+ <stretchitem stretchfactor="1"/>
+ <linearitem itemname="vc:mHintButton"/>
+ <stretchitem stretchfactor="1"/>
+ </layout>
</widget>
- </widget>
+ <real name="z" value="0"/>
+ <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+ <bool name="visible" value="FALSE"/>
+ <layout orientation="Vertical" type="linear">
+ <stretchitem stretchfactor="1"/>
+ <linearitem itemname="vc:mNoVideosLabel"/>
+ <linearitem itemname="vc:mHintButtonLayout"/>
+ <stretchitem stretchfactor="1"/>
+ </layout>
+ </widget>
</section>
<section name="listsSection">
- <widget name="view" type="VideoListView">
- <widget name="content" role="HbView:widget" type="HbWidget">
- <widget name="vc:mStackedLayout" type="HbWidget">
- <widget name="vc:mCollectionWidget" type="VideoListWidget">
- <sizehint height="72un" type="PREFERRED" width="53.6un"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <widget name="vc:mCollectionContentWidget" type="VideoListWidget">
- <sizehint height="72un" type="PREFERRED" width="53.6un"/>
- <bool name="visible" value="FALSE"/>
- </widget>
- <real name="z" value="0"/>
- <layout type="stacked">
- <stackitem itemname="vc:mListWidget"/>
- <stackitem itemname="vc:mCollectionWidget"/>
- <stackitem itemname="vc:mCollectionContentWidget"/>
- </layout>
- </widget>
- <real name="z" value="0"/>
- <layout type="anchor">
- <anchoritem dst="vc:mBanner" dstEdge="LEFT" spacing="var(hb-param-margin-view-right)" src="" srcEdge="LEFT"/>
- <anchoritem dst="vc:mBanner" dstEdge="TOP" spacing="var(hb-param-margin-view-top)" src="" srcEdge="TOP"/>
- <anchoritem dst="vc:mBanner" dstEdge="RIGHT" spacing="var(hb-param-margin-view-left)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="LEFT" spacing="var(hb-param-margin-view-left)" src="" srcEdge="LEFT"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="RIGHT" spacing="var(hb-param-margin-view-right)" src="" srcEdge="RIGHT"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="TOP" spacing="var(hb-param-margin-view-top)" src="vc:mBanner" srcEdge="BOTTOM"/>
- <anchoritem dst="vc:mStackedLayout" dstEdge="BOTTOM" spacing="var(hb-param-margin-view-bottom)" src="" srcEdge="BOTTOM"/>
- </layout>
+ <widget name="vc:mListStacked" type="HbWidget">
+ <widget name="vc:mListWidget" type="VideoListWidget">
+ <sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="vc:mCollectionWidget" type="VideoListWidget">
+ <sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="FALSE"/>
</widget>
- </widget>
+ <widget name="vc:mCollectionContentWidget" type="VideoListWidget">
+ <sizehint height="72un" type="PREFERRED" width="53.6un"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <real name="z" value="0"/>
+ <layout type="stacked">
+ <stackitem itemname="vc:mListWidget"/>
+ <stackitem itemname="vc:mCollectionWidget"/>
+ <stackitem itemname="vc:mCollectionContentWidget"/>
+ </layout>
+ </widget>
</section>
<metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
--- a/videocollection/videocollectionview/src/videolistview.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistview.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 113.1.1 %
+// Version : %version: 113.1.4 %
// INCLUDE FILES
#include <xqserviceutil.h>
@@ -164,6 +164,7 @@
params.append(VideoCollectionUiLoaderParam(
DOCML_NAME_VC_VIDEOLISTWIDGET,
DOCML_VIDEOCOLLECTIONVIEW_FILE,
+ DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
true,
videoListPhase));
@@ -274,8 +275,6 @@
DOCML_NAME_VC_COLLECTIONWIDGET );
}
-
-
return 0;
}
@@ -1411,32 +1410,20 @@
const TMPXItemId &collectionId)
{
FUNC_LOG;
-
- // clear toolbar actions.
- toolBar()->clearActions();
+
+ // update / clear collection name
+ mCollectionName = collection;
- VideoListWidget *collectionContentWidget =
- mUiLoader->findWidget<VideoListWidget>(
- DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
-
- if(!collectionContentWidget)
- {
- return;
- }
- // update collection specific information
- mCollectionName = collection;
-
- // disable collection content animations during widget change
- HbAbstractItemView::ItemAnimations animationState = collectionContentWidget->enabledAnimations();
- collectionContentWidget->setEnabledAnimations(HbAbstractItemView::None);
-
if(openingCollection)
{
- // open album view
- if (collectionId == TMPXItemId::InvalidId() || mCurrentList == collectionContentWidget)
+ VideoListWidget *collectionContentWidget =
+ mUiLoader->findWidget<VideoListWidget>(
+ DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
+ // open album view, mCurrentList might be NULL at this point
+ if (!collectionContentWidget || mCurrentList == collectionContentWidget)
{
- // no currentlist or currentlist is already collection content -list
- collectionContentWidget->setEnabledAnimations(animationState);
+ // collection widget cannot be loaded or
+ // currentlist is already collection content -list
return;
}
@@ -1453,18 +1440,21 @@
}
else
{
- collectionContentWidget->setEnabledAnimations(animationState);
return;
}
-
- // Start fetching content before changing.
+
VideoSortFilterProxyModel *model = collectionContentWidget->getModel();
if(!model)
{
// no model for content widget, cannot activate
- collectionContentWidget->setEnabledAnimations(animationState);
return;
}
+
+ // disable collection content animations during widget change
+ HbAbstractItemView::ItemAnimations animationState = collectionContentWidget->enabledAnimations();
+ collectionContentWidget->setEnabledAnimations(HbAbstractItemView::None);
+
+ // Start fetching content before changing list widget
model->openItem(collectionId);
// deactivat current widget.
@@ -1478,31 +1468,40 @@
mCurrentList->activate(level);
updateSubLabel();
-
- model->invalidate();
// update hint widget for correct content
mModelReady = model->rowCount() > 0;
setHintLevel(VideoHintWidget::Collection);
- // update toolbar for albums, default categories don't have one.
- if(level == VideoCollectionCommon::ELevelAlbum &&
+ // update toolbar for albums, default categories don't have one. Neither does services.
+ toolBar()->clearActions();
+ if(!mVideoServices && level == VideoCollectionCommon::ELevelAlbum &&
mToolbarCollectionActionGroup && mToolbarActions.contains(ETBActionCollections))
{
mToolbarActions[ETBActionCollections]->setChecked(false);
toolBar()->addActions(mToolbarCollectionActionGroup->actions());
+ setItemVisible(Hb::ToolBarItem, true);
}
+ else
+ {
+ setItemVisible(Hb::ToolBarItem, false);
+ }
+ // restore animations for collection content widget
+ collectionContentWidget->setEnabledAnimations(animationState);
}
else
{
+ // clear actions to make sure there is no wrong toolbar in case main
+ // toolbar actiongroup actiongroup is missing
+ toolBar()->clearActions();
// open collection view
- openCollectionViewSlot();
-
+ openCollectionViewSlot();
// update toolbar
if(mToolbarViewsActionGroup && mToolbarActions.contains(ETBActionCollections))
- {
+ {
toolBar()->addActions(mToolbarViewsActionGroup->actions());
mToolbarActions[ETBActionCollections]->setChecked(true);
+ setItemVisible(Hb::ToolBarItem, true);
if(mToolbarServiceExtension)
{
@@ -1511,9 +1510,7 @@
action->setIcon(icon);
}
}
- }
- // restore animations for collection content widget
- collectionContentWidget->setEnabledAnimations(animationState);
+ }
if(!mVideoServices)
{
// save / clear collection related activity data
--- a/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/inc/testlistview.h Fri Jul 23 11:10:06 2010 +0300
@@ -21,6 +21,7 @@
// INCLUDES
#include <QtTest/QtTest>
+#include <mpxitemid.h>
#include "hbmessagebox.h"
#include "hbeffect.h"
@@ -206,7 +207,7 @@
void testLayoutChangedSignal();
- void testCollectionOpenedSignal(bool, const QString&, const QModelIndex&);
+ void testCollectionOpenedSignal(bool, const QString&, const TMPXItemId&);
void testStatusSignal(int, QVariant&);
--- a/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videocollection/videocollectionview/tsrc/testlistview/src/testlistview.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 48 %
+// Version : %version: 50 %
#define private public
#include "videoservices.h"
@@ -1198,71 +1198,119 @@
//
void TestListView::testCollectionOpenedSlot()
{
- QString testString;
-
- // View is not initialized.
+ QString testString("");
+ TMPXItemId itemId = TMPXItemId::InvalidId();
+ int listWidgetActivateCount = 0;
+
init(false);
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(false, testString, QModelIndex());
- cleanup();
-
- // No toolbar actions.
- init(true);
- mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET); // load model
- QModelIndex index = VideoCollectionWrapperData::mCollectionsModel->index(0, 0);
- // Clear actions.
- QMap<VideoListView::TViewActionIds, HbAction*> backupActions =
- QMap<VideoListView::TViewActionIds, HbAction*>(mTestView->mToolbarActions);
- mTestView->mToolbarActions.clear();
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(true, testString, index);
- mTestView->mToolbarActions.unite(backupActions);
- cleanup();
-
- // index is invalid
- init();
- emit testCollectionOpenedSignal(true, testString, QModelIndex());
+ // collection content widget does not exist
+ VideoCollectionUiLoaderData::mFindFailure = true;
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const TMPXItemId &)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId &)));
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ VideoCollectionUiLoaderData::mFindFailure = false;
+ QVERIFY(!mTestView->mCurrentList);
cleanup();
- // current list is null
- init();
- VideoListWidget *tmpList = mTestView->mCurrentList;
- emit testCollectionOpenedSignal(true, testString, index);
- mTestView->mCurrentList = tmpList;
- cleanup();
+ init(true);
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const TMPXItemId &)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId &)));
+ QVERIFY(mTestView->mCurrentList->getLevel() < VideoCollectionCommon::ELevelDefaultColl );
+ VideoListWidget *listWidget = mTestView->mCurrentList;
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+
+ // id is invalid
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(mTestView->mCurrentList == listWidget);
+ QVERIFY(mTestView->mCurrentList->getLevel() < VideoCollectionCommon::ELevelDefaultColl );
+ QVERIFY(listWidgetActivateCount == VideoListWidgetData::mActivateCount);
+ itemId = TMPXItemId(1,1);
+ listWidget->activate();
+ listWidget->getModel()->open(VideoCollectionCommon::ELevelDefaultColl);
+
+ VideoListWidget *collectionContent = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
- // current list is collectioncontentwidget
- init();
- cleanup();
+ // current list is collection content
+ VideoListWidget *tmpList = mTestView->mCurrentList;
+ mTestView->mCurrentList = collectionContent;
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(listWidgetActivateCount == VideoListWidgetData::mActivateCount);
+ mTestView->mCurrentList = tmpList;
- // index is for video item and not for collection.
- init();
+ // collection list widget has no model
+ VideoSortFilterProxyModel *nullModel = 0;
+ VideoSortFilterProxyModel *tempModel = collectionContent->getModel();
+ collectionContent->initialize(*nullModel, false, VideoCollectionCommon::ELevelDefaultColl);
+ listWidget = mTestView->mCurrentList;
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(listWidgetActivateCount == VideoListWidgetData::mActivateCount);
+ QVERIFY(mTestView->mCurrentList == listWidget);
+ QVERIFY(mTestView->mCurrentList->getLevel() < VideoCollectionCommon::ELevelDefaultColl );
cleanup();
-
- // non-error cases:
- testString = "Test text string";
-
+ init(true);
+ itemId = TMPXItemId::InvalidId();
+ VideoCollectionViewUtilsData::mWidgetLevel = VideoCollectionCommon::ELevelCategory;
+ mTestView->activateView(itemId);
+ connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const TMPXItemId &)),
+ mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId &)));
+
+ collectionContent = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
// Collection opened with default collection.
- init();
- mTestView->mCurrentList = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
- index = VideoCollectionWrapperData::mCollectionsModel->index(0, 0);
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(true, testString, index);
- // Verify checkable and visible toolbar actions.
- cleanup();
-
- // Collection opened with userdefined album.
- init();
- cleanup();
-
- // Collection closed.
- init();
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
- emit testCollectionOpenedSignal(false, testString, QModelIndex());
+ itemId = TMPXItemId(1,1);
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(VideoListWidgetData::mActivateCount == listWidgetActivateCount + 1);
+ QVERIFY(mTestView->mCurrentList == collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl );
+ QVERIFY(!HbView::mSetItemVisibleLast);
+
+ // returning collection widget
+ emit testCollectionOpenedSignal(false, testString, itemId);
+ QVERIFY(mTestView->mCurrentList != collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory );
+ QVERIFY(HbView::mSetItemVisibleLast);
+
+ // Collection opened with album.
+ itemId = TMPXItemId(1,2);
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(VideoListWidgetData::mActivateCount == listWidgetActivateCount + 1);
+ QVERIFY(mTestView->mCurrentList == collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelAlbum );
+ QVERIFY(HbView::mSetItemVisibleLast);
+
+ // returning collection widget (no mToolbarViewsActionGroup for coverage)
+ HbView::mSetItemVisibleLast = false;
+ QActionGroup *tmpActionGroup = mTestView->mToolbarViewsActionGroup;
+ mTestView->mToolbarViewsActionGroup = 0;
+ emit testCollectionOpenedSignal(false, testString, itemId);
+ QVERIFY(mTestView->mCurrentList != collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory );
+ QVERIFY(!HbView::mSetItemVisibleLast);
+ mTestView->mToolbarViewsActionGroup = tmpActionGroup;
+
+ // service
+ VideoServices *tmpService = VideoServices::instance();
+ mTestView->mVideoServices = tmpService;
+ itemId = TMPXItemId(1,1);
+ listWidgetActivateCount = VideoListWidgetData::mActivateCount;
+ emit testCollectionOpenedSignal(true, testString, itemId);
+ QVERIFY(VideoListWidgetData::mActivateCount == listWidgetActivateCount + 1);
+ QVERIFY(mTestView->mCurrentList == collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl );
+ QVERIFY(!HbView::mSetItemVisibleLast);
+
+ // returning collection widget (no mToolbarServiceExtension for coverage)
+ HbToolBarExtension *tmpExtension = mTestView->mToolbarServiceExtension;
+ mTestView->mToolbarServiceExtension = 0;
+ emit testCollectionOpenedSignal(false, testString, itemId);
+ QVERIFY(mTestView->mCurrentList != collectionContent);
+ QVERIFY(mTestView->mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory );
+ QVERIFY(HbView::mSetItemVisibleLast);
+ mTestView->mToolbarServiceExtension = tmpExtension;
+
cleanup();
}
@@ -1276,8 +1324,6 @@
setRowCount(1);
mTestView->mModelReady = true;
connect(this, SIGNAL(testLayoutChangedSignal()), mTestView, SLOT(layoutChangedSlot()));
- connect(this, SIGNAL(testCollectionOpenedSignal(bool, const QString&, const QModelIndex&)),
- mTestView, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&)));
VideoListWidget *videoListWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET);
VideoListWidget *collectionWidget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET);
--- a/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videolistdatamodel_p.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 38.1.1 %
+// Version : %version: 38.1.2 %
// INCLUDE FILES
#include <hbglobal.h>
@@ -431,7 +431,9 @@
return;
}
QSet<TMPXItemId> items;
-
+
+ int oldCount = mAlbumData[albumId].count();
+
// remove existing
mAlbumData.remove(albumId);
@@ -450,11 +452,14 @@
mAlbumData[albumId] = items;
- // signal that album has been updated
- emit q_ptr->albumChanged();
+ if(oldCount != items.count())
+ {
+ // signal that album has been updated
+ emit q_ptr->albumChanged();
- // signal that model has changed.
- emit q_ptr->modelChanged();
+ // signal that model has changed.
+ emit q_ptr->modelChanged();
+ }
}
--- a/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videosortfilterproxymodel.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 66 %
+// Version : %version: 66.1.5 %
// INCLUDE FILES
#include <qstringlist.h>
@@ -96,13 +96,9 @@
bool VideoSortFilterProxyModel::connectSignals()
{
FUNC_LOG_ADDR(this);
- if(!connect(mModel, SIGNAL(modelReady()),
- this, SIGNAL(modelReady())))
- {
- return false;
- }
+
if(!connect(mModel, SIGNAL(modelChanged()),
- this, SIGNAL(modelChanged())))
+ this, SLOT(invalidate())))
{
return false;
}
@@ -132,8 +128,7 @@
void VideoSortFilterProxyModel::disconnectSignals()
{
FUNC_LOG_ADDR(this);
- disconnect(mModel, SIGNAL(modelReady()), this, SIGNAL(modelReady()));
- disconnect(mModel, SIGNAL(modelChanged()), this, SIGNAL(modelChanged()));
+ disconnect(mModel, SIGNAL(modelChanged()), this, SLOT(invalidate()));
if(mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
disconnect(mModel, SIGNAL(albumChanged()), this, SLOT(albumChangedSlot()));
@@ -158,12 +153,16 @@
{
return -1;
}
-
+
if(mLevel != level)
{
- INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening different level, invalidating.", this);
- mLevel = level;
- invalidateFilter();
+ INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening different level, invalidating.", this);
+ mLevel = level;
+ invalidateFilter();
+ // sorting call required here to setup correct sort order in cases where source model allready
+ // contains items but proxy is not yet updated. (invalidate -call does not work since it updates proxy and
+ // calls sort in different order for us to use)
+ sort(0, mWantedSortOrder);
}
// need to call open every time to make sure all items are
// inserted to UI ( recent open might have been cancelled)
@@ -276,6 +275,10 @@
mModel->setAlbumInUse(mediaId);
INFO_1("VideoSortFilterProxyModel::open() [0x%x] opening album or category, invalidating.", this);
invalidateFilter();
+ // sorting call required here to setup correct sort order in cases where source model allready
+ // contains items but proxy is not yet updated. (invalidate -call does not work since it updates proxy and
+ // calls sort in different order for us to use)
+ sort(0, mWantedSortOrder);
}
return 0;
}
@@ -704,6 +707,7 @@
invalidateFilter();
err = 0;
}
+
}
return err;
}
@@ -794,9 +798,9 @@
if (mType == VideoCollectionCommon::EModelTypeCollectionContent)
{
INFO_1("VideoSortFilterProxyModel::albumChangedSlot() [0x%x] invalidating.", this);
- // sort and invalidate filtering, otherwise newle created album content won't sort
+ // sort and invalidate filtering, otherwise newly created album content won't sort
invalidateFilter();
- setSortRole(mWantedSortRole);
+ setSortRole(mWantedSortRole);
sort(0, mWantedSortOrder);
}
}
--- a/videoplayback/inc/videobaseplaybackview.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/inc/videobaseplaybackview.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#19 %
+// Version : %version: da1mmcf#20 %
@@ -91,7 +91,7 @@
void initializeVideoPlaybackView();
- void showDialog( const QString& qString, bool closeView = true );
+ void showDialog( const QString& string, bool closeView = true );
virtual void handleClosePlaybackView();
@@ -102,7 +102,7 @@
void gestureEvent( QGestureEvent* event );
private:
-
+
void saveActivityData();
protected: // data
--- a/videoplayback/videoplaybackview/controlinc/videoplaybackfiledetailswidget.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackfiledetailswidget.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 12 %
+// Version : %version: 13 %
@@ -41,13 +41,14 @@
public:
void updateWithFileDetails( VideoPlaybackViewFileDetails* details );
- private:
+ private:
void makeTitleItem( VideoPlaybackViewFileDetails* details );
void makeSizeItem( VideoPlaybackViewFileDetails* details );
void makeBitRateItem( VideoPlaybackViewFileDetails* details );
void makeDateTimeItem( VideoPlaybackViewFileDetails* details );
void addItemToListWidget( QString item, QString text );
-
+ void makeDurationItem( VideoPlaybackViewFileDetails* details );
+
private:
VideoPlaybackControlsController *mController;
HbListWidget *mListWidget;
--- a/videoplayback/videoplaybackview/controlinc/videoplaybackprogressbar.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/controlinc/videoplaybackprogressbar.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#15 %
+// Version : %version: da1mmcf#16 %
@@ -23,6 +23,7 @@
#define VIDEOPLAYBACKPROGRESSBAR_H_
#include <QObject>
+#include <hbextendedlocale.h>
#include <mpxplaybackframeworkdefs.h>
class QTimer;
@@ -58,7 +59,7 @@
private:
VideoPlaybackControlsController *mController;
- HbProgressSlider *mProgressSlider;
+ HbProgressSlider *mProgressSlider;
int mDuration;
int mDraggingPosition;
@@ -71,6 +72,7 @@
bool mLiveStreaming;
QTimer *mSeekingTimer;
+ HbExtendedLocale mLocale;
};
#endif /*VIDEOPLAYBACKPROGRESSBAR_H_*/
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolscontroller.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#46 %
+// Version : %version: da1mmcf#48 %
@@ -76,6 +76,7 @@
, mVideoServices( 0 )
, mViewTransitionIsGoingOn( false )
, mIsAttachOperation( false )
+ , mFileDetailsAdded( false )
, mThumbNailState( EThumbNailEmpty )
, mState( EPbStateNotInitialised )
, mViewMode( EFullScreenView )
@@ -292,6 +293,8 @@
{
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::addFileDetails"));
+ mFileDetailsAdded = true;
+
mFileDetails = details;
mFileDetails->mRNFormat = realFormat( mFileDetails->mClipName );
@@ -727,7 +730,7 @@
case EDetailsView:
{
//
- // ignore the tap for 'Pause' action for non-pausable stream in
+ // ignore the tap for 'Pause' action for non-pausable stream in
// 'Details' view during 'Playing' state
//
if ( mState != EPbStatePlaying || mFileDetails->mPausableStream )
@@ -1410,11 +1413,11 @@
QGraphicsWidget *tvOutBitmap = mLoader->findWidget( "tvOutBitmap" );
HbLabel *tvOutLabel = qobject_cast<HbLabel*>( tvOutBitmap );
- QIcon *qicon = new QIcon( tnData );
+ QIcon qicon( tnData );
- HbIcon *hbIcon = new HbIcon( *qicon );
- hbIcon->setSize( tvOutBitmap->size() );
- tvOutLabel->setIcon( *hbIcon );
+ HbIcon hbIcon( qicon );
+ hbIcon.setSize( tvOutBitmap->size() );
+ tvOutLabel->setIcon( hbIcon );
mThumbNailState = EThumbNailSet;
}
@@ -1460,11 +1463,6 @@
_L("file = %s"), mFileDetails->mClipName.data() );
//
- // pause playback
- //
- handleCommand( EMPXPbvCmdPause );
-
- //
// send video to shareUI
//
ShareUi dlg;
@@ -1573,13 +1571,13 @@
MPX_ENTER_EXIT(_L("VideoPlaybackControlsController::shouldShowRNLogo()"));
bool showRNLogo = false;
-
- if ( mFileDetails->mRNFormat &&
+
+ if ( mFileDetails->mRNFormat &&
!mViewWrapper->IsResumingPlaybackAfterTermination() )
{
showRNLogo = true;
}
-
+
return showRNLogo;
}
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybackfiledetailswidget.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackfiledetailswidget.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 27 %
+// Version : %version: 28 %
#include <QDir>
@@ -107,19 +107,7 @@
//
// Duration
//
- if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 )
- {
- int value = (qreal)details->mDuration / (qreal)KPbMilliMultiplier;
- QString hour = locale.toString( value / 3600 );
- value = value % 3600;
- QString min = locale.toString( value / 60 );
- value = value % 60;
- QString sec = locale.toString( value );
-
- addItemToListWidget(
- hbTrId( "txt_videos_list_duration" ),
- hbTrId( "txt_videos_list_l1l2l3" ).arg( hour ).arg( min ).arg( sec ) );
- }
+ makeDurationItem( details );
//
// Date/Time
@@ -451,4 +439,49 @@
}
}
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackFileDetailsWidget::makeDurationItem
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackFileDetailsWidget::makeDurationItem( VideoPlaybackViewFileDetails* details )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackFileDetailsWidget::makeDurationItem"));
+
+ if ( details->mPlaybackMode != EMPXVideoLiveStreaming && details->mDuration > 0 )
+ {
+ HbExtendedLocale locale = HbExtendedLocale::system();
+ QString hourString, minString, secString;
+
+ int value = (qreal)details->mDuration / (qreal)KPbMilliMultiplier;
+
+ int hours = value / 3600;
+ value = value % 3600;
+ int mins = value / 60;
+ value = value % 60;
+ int secs = value;
+
+ //
+ // Put "0" if it is less than 10 (0:00:03)
+ //
+ hourString = locale.toString( hours );
+
+ if ( mins < 10 )
+ {
+ minString = locale.toString( 0 );
+ }
+ minString.append( locale.toString( mins ) );
+
+ if ( secs < 10 )
+ {
+ secString = locale.toString( 0 );
+ }
+ secString.append( locale.toString( secs ) );
+
+ addItemToListWidget(
+ hbTrId( "txt_videos_list_duration" ),
+ hbTrId( "txt_videos_list_l1l2l3" )
+ .arg( hourString ).arg( minString ).arg( secString ) );
+ }
+}
+
//End of file
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybackprogressbar.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackprogressbar.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,20 +15,16 @@
*
*/
-// Version : %version: da1mmcf#28 %
+// Version : %version: da1mmcf#30 %
-#include <QTime>
#include <QTimer>
-#include <QGraphicsSceneMouseEvent>
-#include <hblabel.h>
#include <hbframeitem.h>
#include <hbframedrawer.h>
#include <hbprogressslider.h>
-#include <hbextendedlocale.h>
#include "mpxvideo_debug.h"
#include "videoplaybackprogressbar.h"
@@ -86,6 +82,7 @@
{
MPX_ENTER_EXIT(_L("VideoPlaybackProgressBar::initialize()"));
+ HbExtendedLocale mLocale = HbExtendedLocale::system();
VideoPlaybackDocumentLoader *loader = mController->layoutLoader();
//
@@ -115,6 +112,8 @@
connect( mProgressSlider, SIGNAL( sliderPressed() ), this, SLOT( handleSliderPressed() ) );
connect( mProgressSlider, SIGNAL( sliderReleased() ), this, SLOT( handleSliderReleased() ) );
connect( mProgressSlider, SIGNAL( sliderMoved( int ) ), this, SLOT( handleSliderMoved( int ) ) );
+ connect( mProgressSlider, SIGNAL( trackPressed() ), this ,SLOT( handleSliderPressed() ) );
+ connect( mProgressSlider, SIGNAL( trackReleased() ), this ,SLOT( handleSliderReleased() ) );
//
// If we init the progress bar after pp sends the duration informatin
@@ -224,24 +223,43 @@
{
MPX_DEBUG(_L("VideoPlaybackControlsController::valueToReadableFormat value = %d"), value);
- int hour = value / 3600;
+ QString str, hourString, minString, secString;
+
+ int hours = value / 3600;
value = value % 3600;
- int minutes = value / 60;
+ int mins = value / 60;
value = value % 60;
- int second = value;
+ int secs = value;
- QTime time( hour ,minutes ,second );
- QString str;
+ //
+ // show like this
+ // 0:03, 10:03, 0:05:03, 12:12:12
+ //
+ if ( mins < 10 && mLongTimeFormat )
+ {
+ minString = mLocale.toString( 0 );
+ }
+ minString.append( mLocale.toString( mins ) );
- HbExtendedLocale locale = HbExtendedLocale::system();
+ if ( secs < 10 )
+ {
+ secString = mLocale.toString( 0 );
+ }
+ secString.append( mLocale.toString( secs ) );
+ //
+ // Formatting
+ //
if ( mLongTimeFormat )
{
- str = locale.format( time, r_qtn_time_durat_long );
+ hourString = mLocale.toString( hours );
+
+ str = hbTrId( "txt_videos_slidervalue_l1l2l3_2" )
+ .arg( hourString ).arg( minString ).arg( secString );
}
else
{
- str = locale.format( time, r_qtn_time_durat_min_sec );
+ str = hbTrId( "txt_videos_slidervalue_l1l2" ).arg( minString ).arg( secString );
}
return str;
@@ -362,7 +380,7 @@
VideoPlaybackViewFileDetails* details )
{
Q_UNUSED( details );
-
+
MPX_DEBUG(_L("VideoPlaybackProgressBar::updateControlsWithFileDetails()"));
setEnableProgressSlider( true );
--- a/videoplayback/videoplaybackview/controlsrc/videoplaybackstatuspanecontrol.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackstatuspanecontrol.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 21 %
+// Version : %version: 22 %
@@ -111,7 +111,10 @@
if ( mController->viewMode() == EFullScreenView ||
mController->viewMode() == EDetailsView )
{
- mTitleLayout->setVisible( true );
+ if ( mTitleLayout )
+ {
+ mTitleLayout->setVisible( true );
+ }
}
}
else
@@ -120,7 +123,10 @@
mController->view()->setTitleBarVisible( false );
mController->view()->setStatusBarVisible( false );
- mTitleLayout->setVisible( false );
+ if ( mTitleLayout )
+ {
+ mTitleLayout->setVisible( false );
+ }
}
}
@@ -171,7 +177,7 @@
{
MPX_DEBUG(_L("VideoPlaybackStatusPaneControl::updateControlsWithFileDetails()"));
- if ( ! mTitleLabel )
+ if ( mController->isFileDetailsAdded() && ! mTitleLabel )
{
//
// If title is not available, show clip name
@@ -218,8 +224,11 @@
HbView::ViewTitleBarTransparent |
HbView::ViewStatusBarTransparent );
- mTitleLabel->setVisible( true );
- mTitleGroupBox->setVisible( false );
+ if ( mTitleLayout )
+ {
+ mTitleLabel->setVisible( true );
+ mTitleGroupBox->setVisible( false );
+ }
break;
}
@@ -233,8 +242,11 @@
mController->view()->setViewFlags( HbView::ViewFlagNone );
- mTitleGroupBox->setVisible( true );
- mTitleLabel->setVisible( false );
+ if ( mTitleLayout )
+ {
+ mTitleLabel->setVisible( false );
+ mTitleGroupBox->setVisible( true );
+ }
break;
}
--- a/videoplayback/videoplaybackview/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/inc/videoplaybackcontrolscontroller.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#23 %
+// Version : %version: da1mmcf#24 %
@@ -149,8 +149,10 @@
inline bool isAttachOperation();
+ inline bool isFileDetailsAdded();
+
bool isRNLogoBitmapInControlList();
-
+
bool shouldShowRNLogo();
private:
@@ -228,12 +230,12 @@
* Check whether this clip is real format or not for local/progressive donwload
*/
bool realFormatForLocal();
-
+
/**
* Handle errors
*/
- void handleErrors();
-
+ void handleErrors();
+
/**
* Return true if control is visible
*/
@@ -242,7 +244,7 @@
/**
* Handle tvout connected/disconnected event
*/
- void handleTvOutEvent( bool connected,
+ void handleTvOutEvent( bool connected,
TVideoPlaybackControlCommandIds event );
void updateVideoRect( bool transitionEffect = true );
@@ -296,7 +298,8 @@
bool mViewTransitionIsGoingOn;
bool mIsAttachOperation;
-
+ bool mFileDetailsAdded;
+
TThumbNailState mThumbNailState;
TMPXPlaybackState mState;
@@ -374,13 +377,26 @@
//
inline
bool VideoPlaybackControlsController::isAttachOperation()
-{
- MPX_DEBUG(_L("VideoPlaybackControlsController::isAttachOperation() ret %d"),
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isAttachOperation() ret %d"),
mIsAttachOperation );
-
+
return mIsAttachOperation;
}
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::viewMode
+// -------------------------------------------------------------------------------------------------
+//
+inline
+bool VideoPlaybackControlsController::isFileDetailsAdded()
+{
+ MPX_DEBUG(_L("VideoPlaybackControlsController::isFileDetailsAdded() ret %d"),
+ mFileDetailsAdded );
+
+ return mFileDetailsAdded;
+}
+
#endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
// End of File
--- a/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/inc/testcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/inc/testcontrolscontroller.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
#ifndef __TESTCONTROLSCONTROLLER_H__
#define __TESTCONTROLSCONTROLLER_H__
@@ -71,6 +71,7 @@
void testHandleEventTvOutDisconnected();
void testHandleEventHandleErrors();
void testHandleEventShowVolumeControls();
+ void testIsFileDetailsAdded();
//
// test handleCommand()
@@ -100,8 +101,8 @@
//
// test private slot skipToPreviousVideoItem()
//
- void testslot_skipToPreviousVideoItem();
-
+ void testslot_skipToPreviousVideoItem();
+
//
// test private slot attachVideo()
//
--- a/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/src/testcontrolscontroller.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testcontrolscontroller/src/testcontrolscontroller.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 13 %
+// Version : %version: 14 %
#include <e32err.h>
#include <w32std.h>
@@ -1114,11 +1114,6 @@
emit commandSignal();
//
- // verify command EMPXPbvCmdClose has been issued
- //
- QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
-
- //
// disconnect signal
//
disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
@@ -1287,4 +1282,27 @@
cleanup();
}
+// -------------------------------------------------------------------------------------------------
+// TestControlsController::testIsFileDetailsAdded
+// -------------------------------------------------------------------------------------------------
+//
+void TestControlsController::testIsFileDetailsAdded()
+{
+ MPX_DEBUG(_L("TestControlsController::testIsFileDetailsAdded()"));
+
+ init();
+
+ QVERIFY( ! mController->isFileDetailsAdded() );
+
+ mFileDetails = new VideoPlaybackViewFileDetails();
+ mFileDetails->mClipName = QString( "testClip.rm" );
+ mFileDetails->mMimeType = QString( "video/x-pn-realvideo" );
+
+ mController->addFileDetails( mFileDetails );
+
+ QVERIFY( mController->isFileDetailsAdded() );
+
+ cleanup();
+}
+
// End of file
--- a/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/src/testfiledetailswidget.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/src/testfiledetailswidget.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in TestFileDetailsWidget
-*
+*
*/
-// Version : %version: 5 %
+// Version : %version: 6 %
#include <QDateTime>
@@ -55,9 +55,9 @@
pass[0] = argv[0];
pass[1] = "-o";
pass[2] = "c:\\data\\testfiledetailswidget.txt";
-
+
int res = QTest::qExec(&tv, 3, pass);
-
+
return res;
}
@@ -70,7 +70,7 @@
{
MPX_ENTER_EXIT(_L("TestFileDetailsWidget::init()"));
- mController = new VideoPlaybackControlsController();
+ mController = new VideoPlaybackControlsController();
mWidget = new VideoPlaybackFileDetailsWidget( mController );
}
@@ -154,7 +154,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mDescription = "This is for unit test";
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Description", true, details->mDescription );
@@ -179,10 +179,10 @@
//
details->mPlaybackMode = EMPXVideoLocal;
details->mDuration = 3700000;
-
+
mWidget->updateWithFileDetails( details );
- verifyResult( "Duration", true, "1 hr 1 min 40 sec" );
+ verifyResult( "Duration", true, "1:01:40" );
cleanup();
}
@@ -198,16 +198,16 @@
init();
VideoPlaybackViewFileDetails *details = mController->fileDetails();
-
+
QDateTime dateTime;
QString created("");
QString modified("");
details->mClipName = KFILEPATH;
- QFileInfo fileInfo( details->mClipName );
-
+ QFileInfo fileInfo( details->mClipName );
+
//
// If it is streaming case, we don't show size information
- //
+ //
details->mPlaybackMode = EMPXVideoStreaming;
mWidget->updateWithFileDetails( details );
@@ -235,26 +235,26 @@
dateTime = fileInfo.created();
created = dateTimeStringFormat( dateTime );
verifyResult( "Date", true, created, true );
-
+
//
// compare and verify 'Modified' for non-metadata local clip
//
dateTime = fileInfo.lastModified();
modified = dateTimeStringFormat( dateTime );
verifyResult( "Modified", true, modified, true );
-
+
//
// clear the widget list
//
mWidget->mListWidget->clear();
mWidget->mFileDetailsUpdated = false;
-
+
//
- // local clip, with date/time metadata
+ // local clip, with date/time metadata
//
details->mPlaybackMode = EMPXVideoLocal;
details->mCreationTime = 1242367251; // POSIX creation time
- details->mModificationTime = 1270773249; // POSIX modification time
+ details->mModificationTime = 1270773249; // POSIX modification time
mWidget->updateWithFileDetails( details );
//
@@ -263,11 +263,11 @@
dateTime.setTime_t( details->mCreationTime );
created = dateTimeStringFormat( dateTime );
verifyResult( "Date", true, created, true );
-
+
//
// compare and verify 'Modified' for metadata local clip
//
- dateTime.setTime_t( details->mModificationTime );
+ dateTime.setTime_t( details->mModificationTime );
modified = dateTimeStringFormat( dateTime );
verifyResult( "Modified", true, modified, true );
@@ -289,7 +289,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mLocation = "C:\\data\\Videos\\";
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Location", true, details->mLocation );
@@ -309,7 +309,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mArtist = "Fusion";
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Author", true, details->mArtist );
@@ -329,7 +329,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mCopyright = "Fusion team";
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Copyright", true, details->mCopyright );
@@ -349,7 +349,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mLanguage = "English";
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Language", true, details->mLanguage );
@@ -369,7 +369,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mKeywords = "QTest";
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Keywords", true, details->mKeywords );
@@ -407,7 +407,7 @@
//
details->mPlaybackMode = EMPXVideoLocal;
mWidget->updateWithFileDetails( details );
-
+
verifyResult( "Size", true, "", false );
cleanup();
@@ -429,7 +429,7 @@
// If it is audio only clip, don't need to show resolution
//
details->mVideoEnabled = false;
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Resolution", false );
@@ -466,7 +466,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mMimeType = "Nothing";
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Format", true, details->mMimeType );
@@ -487,7 +487,7 @@
VideoPlaybackViewFileDetails *details = mController->fileDetails();
details->mBitRate = 512;
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Bitrate", true, "512 kbps" );
@@ -512,7 +512,7 @@
//
details->mPlaybackMode = EMPXVideoStreaming;
details->mClipName = KFILEPATH;
-
+
mWidget->updateWithFileDetails( details );
verifyResult( "Collection", false );
@@ -537,12 +537,12 @@
// verifyResult
// ---------------------------------------------------------------------------
//
-void TestFileDetailsWidget::verifyResult(
+void TestFileDetailsWidget::verifyResult(
QString primaryText, bool exist, QString expectedSecondaryText, bool needToBeCompared )
{
MPX_DEBUG(_L("TestFileDetailsWidget::verifyResult(%s, %d, %s, %d)"),
primaryText.data(), exist, expectedSecondaryText.data(), needToBeCompared );
-
+
QString secondaryText = "";
int i = 0;
@@ -566,14 +566,14 @@
{
MPX_DEBUG(_L("TestFileDetailsWidget::verifyResult() : secondaryText(%s)"),
secondaryText.data() );
-
+
QVERIFY( expectedSecondaryText == secondaryText );
}
else
{
MPX_DEBUG(_L("TestFileDetailsWidget::verifyResult() : i(%d) count(%d)"),
i, mWidget->mListWidget->count() );
-
+
//
// Doens't need to compare the secondary text. Just make sure it's in the list
//
@@ -601,11 +601,11 @@
QString date = locale.format( dateTime.date(), r_qtn_date_usual );
QString time = locale.format( dateTime.time(), r_qtn_time_long_with_zero );
QString dateTimeString( date + " " + time );
-
+
MPX_DEBUG(_L("TestFileDetailsWidget::dateTimeStringFormat() ret '%s'"),
dateTimeString.data() );
-
- return dateTimeString;
+
+ return dateTimeString;
}
// End of file
--- a/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/src/hbglobal.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testfiledetailswidget/stub/src/hbglobal.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 3 %
+// Version : %version: 4 %
@@ -91,7 +91,7 @@
}
else if ( string == "txt_videos_list_l1l2l3" )
{
- loc = "%L1 hr %L2 min %L3 sec";
+ loc = "%L1:%L2:%L3";
}
else if ( string == "txt_videos_list_l1_kb" )
{
--- a/videoplayback/videoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/src/testprogressbar.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
#include <qdebug>
@@ -329,12 +329,33 @@
setup();
- int duration = 120;
+ int duration = 121;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "2:01" );
+
+ duration = 730;
mProgBar->durationChanged( duration );
QVERIFY( mProgBar->mDuration == duration );
QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
- QVERIFY( mProgBar->mProgressSlider->maxText() == "2:00" );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "12:10" );
+
+ duration = 7413;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "2:03:33" );
+
+ duration = 37803;
+ mProgBar->durationChanged( duration );
+
+ QVERIFY( mProgBar->mDuration == duration );
+ QVERIFY( mProgBar->mProgressSlider->maximum() == duration );
+ QVERIFY( mProgBar->mProgressSlider->maxText() == "10:30:03" );
cleanup();
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/inc/hbglobal.h Fri Jul 23 11:10:06 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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: class for HbGlobal
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#ifndef HBGLOBAL_H
+#define HBGLOBAL_H
+
+#include <QtGlobal>
+
+#ifdef BUILD_HB_CORE
+# define HB_CORE_EXPORT Q_DECL_EXPORT
+# define HB_CORE_PRIVATE_EXPORT Q_DECL_EXPORT
+#else
+# define HB_CORE_EXPORT Q_DECL_IMPORT
+# define HB_CORE_PRIVATE_EXPORT Q_DECL_IMPORT
+#endif // BUILD_HB_CORE
+
+#ifdef BUILD_HB_WIDGETS
+# define HB_WIDGETS_EXPORT Q_DECL_EXPORT
+# define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_EXPORT
+#else
+# define HB_WIDGETS_EXPORT Q_DECL_IMPORT
+# define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_IMPORT
+#endif // BUILD_HB_WIDGETS
+
+
+QString hbTrId( QString string, int n = -1 );
+
+
+#endif // HBGLOBAL_H
--- a/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/inc/hbprogressslider.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/inc/hbprogressslider.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
@@ -61,6 +61,8 @@
void sliderPressed();
void sliderReleased();
void sliderMoved( int value );
+ void trackPressed();
+ void trackReleased();
public:
int mSliderValue;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/stub/src/hbglobal.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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: class for HbGlobal
+*
+*/
+
+// Version : %version: 1 %
+
+
+
+#include "hbglobal.h"
+#include <qstring>
+
+
+QString hbTrId( QString string, int n )
+{
+ Q_UNUSED( n );
+
+ QString loc = "";
+
+
+ if ( string == "txt_videos_slidervalue_l1l2l3_2" )
+ {
+ loc = "%L1:%L2:%L3";
+ }
+ else if ( string == "txt_videos_slidervalue_l1l2" )
+ {
+ loc = "%L1:%L2";
+ }
+ return loc;
+}
+
+//End of file
--- a/videoplayback/videoplaybackview/tsrc/testprogressbar/testprogressbar.pro Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testprogressbar/testprogressbar.pro Fri Jul 23 11:10:06 2010 +0300
@@ -14,7 +14,7 @@
# Description: Project file for building testprogressbar
#
#
-# Version : %version: 3 %
+# Version : %version: 4 %
TEMPLATE = app
TARGET = testprogressbar
@@ -33,6 +33,7 @@
videoplaybackdocumentloader.h \
videoplaybackviewfiledetails.h \
hbprogressslider.h \
+ hbglobal.h \
../../controlinc/videoplaybackprogressbar.h
SOURCES += testprogressbar.cpp \
@@ -40,4 +41,5 @@
videoplaybackdocumentloader.cpp \
videoplaybackviewfiledetails.cpp \
hbprogressslider.cpp \
+ hbglobal.cpp \
../../controlsrc/videoplaybackprogressbar.cpp
--- a/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/src/teststatuspanecontrol.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -1,5 +1,5 @@
/**
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
@@ -12,10 +12,10 @@
* Contributors:
*
* Description: tester for methods in status pane control
-*
+*
*/
-// Version : %version: 8 %
+// Version : %version: 9 %
#include <hbapplication.h>
@@ -43,9 +43,9 @@
#undef private
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// main
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
int main(int argc, char *argv[])
{
@@ -53,52 +53,52 @@
HbApplication app(argc, argv);
HbMainWindow window;
-
+
TestStatusPaneControl tv;
char *pass[3];
pass[0] = argv[0];
pass[1] = "-o";
pass[2] = "c:\\data\\teststatuspanecontrol.txt";
-
+
int res = QTest::qExec(&tv, 3, pass);
-
+
return res;
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// init
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::init()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::init()"));
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// main
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::setup()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::setup()"));
mBaseVideoView = new VideoBasePlaybackView();
-
- mFileDetails = new VideoPlaybackViewFileDetails();
-
- mControlsController = new VideoPlaybackControlsController( mBaseVideoView,
+
+ mFileDetails = new VideoPlaybackViewFileDetails();
+
+ mControlsController = new VideoPlaybackControlsController( mBaseVideoView,
mFileDetails );
- mStatusPane = new VideoPlaybackStatusPaneControl( mControlsController,
+ mStatusPane = new VideoPlaybackStatusPaneControl( mControlsController,
EStatusPane,
- NULL,
+ NULL,
0 );
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// cleanup
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::cleanup()
{
@@ -107,88 +107,112 @@
if ( mStatusPane )
{
delete mStatusPane;
- mStatusPane = NULL;
+ mStatusPane = NULL;
}
if ( mBaseVideoView )
{
delete mBaseVideoView;
- mBaseVideoView = NULL;
+ mBaseVideoView = NULL;
}
-
+
if ( mFileDetails )
{
delete mFileDetails;
- mFileDetails = NULL;
+ mFileDetails = NULL;
}
-
+
if ( mControlsController )
{
delete mControlsController;
- mControlsController = NULL;
+ mControlsController = NULL;
}
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testSetMenu
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testSetMenu()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetMenu()"));
- setup();
-
+ setup();
+
mFileDetails->mTvOutConnected = false;
mFileDetails->mVideoEnabled = true;
-
+
mStatusPane->setMenu( mFileDetails );
-
+
QVERIFY( mControlsController->view()->menu()->isEmpty() );
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testSetVisible
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testSetVisible()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisible()"));
- setup();
+ setup();
+
+ mStatusPane->mController->mFileDetailsAdded = true;
mStatusPane->updateControlsWithFileDetails( mFileDetails );
+ //
// 1. Set visible
- mStatusPane->setVisible( true );
- QVERIFY( mControlsController->view()->mStatusBarVisible );
- QVERIFY( mControlsController->view()->mTitleBarVisible );
- QVERIFY( mStatusPane->mTitleLayout->isVisible() );
+ //
+ mStatusPane->setVisible( true );
+ QVERIFY( mControlsController->view()->mStatusBarVisible );
+ QVERIFY( mControlsController->view()->mTitleBarVisible );
+ QVERIFY( mStatusPane->mTitleLayout->isVisible() );
+ //
// 2. Set invisible
+ //
mStatusPane->setVisible( false );
- QVERIFY( mControlsController->view()->menu()->isEmpty() );
- QVERIFY( ! mControlsController->view()->mStatusBarVisible );
- QVERIFY( ! mControlsController->view()->mTitleBarVisible );
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+ QVERIFY( ! mControlsController->view()->mStatusBarVisible );
+ QVERIFY( ! mControlsController->view()->mTitleBarVisible );
QVERIFY( ! mStatusPane->mTitleLayout->isVisible() );
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testUpdateControlsWithFileDetails
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testUpdateControlsWithFileDetails()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testUpdateControlsWithFileDetails()"));
- setup();
+ setup();
QString title = "Title";
- // 1. test for full creen mode
+ //
+ // 1-1. test for full screen mode + file details hasn't arrived
+ //
+ mStatusPane->mController->mFileDetailsAdded = false;
+
+ mControlsController->mViewMode = EFullScreenView;
+ mControlsController->mFileDetails->mTitle = title;
+ mStatusPane->updateControlsWithFileDetails( mFileDetails );
+
+ QVERIFY( mStatusPane->mTitleLabel == NULL );
+ QVERIFY( mStatusPane->mTitleGroupBox == NULL );
+ QVERIFY( mControlsController->view()->viewFlags() ==
+ HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ));
+
+ //
+ // 1-2. test for full screen mode + file details has arrived
+ //
+ mStatusPane->mController->mFileDetailsAdded = true;
+
mControlsController->mViewMode = EFullScreenView;
mControlsController->mFileDetails->mTitle = title;
mStatusPane->updateControlsWithFileDetails( mFileDetails );
@@ -197,18 +221,22 @@
QVERIFY( mStatusPane->mTitleGroupBox->mString == title );
QVERIFY( mStatusPane->mTitleLabel->isVisible() );
QVERIFY( ! mStatusPane->mTitleGroupBox->isVisible() );
- QVERIFY( mControlsController->view()->viewFlags() ==
+ QVERIFY( mControlsController->view()->viewFlags() ==
HbView::HbViewFlags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent ));
- // 2. test for detial view mode
- mControlsController->mViewMode = EDetailsView;
+ //
+ // 2. test for detial view mode
+ //
+ mControlsController->mViewMode = EDetailsView;
mStatusPane->updateControlsWithFileDetails( mFileDetails );
QVERIFY( mControlsController->view()->viewFlags() == HbView::ViewFlagNone );
- QVERIFY( ! mStatusPane->mTitleLabel->isVisible() );
+ QVERIFY( ! mStatusPane->mTitleLabel->isVisible() );
QVERIFY( mStatusPane->mTitleGroupBox->isVisible() );
- // 3. test for audio only mode
+ //
+ // 3. test for audio only mode
+ //
mControlsController->mViewMode = EAudioOnlyView;
mStatusPane->updateControlsWithFileDetails( mFileDetails );
@@ -217,102 +245,102 @@
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testSetVisibility
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testSetVisibility()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSetVisibility()"));
- setup();
-
+ setup();
+
// 1. test for first block of cases:
- mStatusPane->setVisibility( EPbStatePaused );
- QVERIFY( mControlsController->view()->menu()->isEmpty() );
-
+ mStatusPane->setVisibility( EPbStatePaused );
+ QVERIFY( mControlsController->view()->menu()->isEmpty() );
+
// 2. test for second block of cases:
- mStatusPane->setVisibility( EPbStateInitialising );
+ mStatusPane->setVisibility( EPbStateInitialising );
QVERIFY( mControlsController->view()->menu()->isEmpty() );
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testControlListUpdated
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testControlListUpdated()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testControlListUpdated()"));
- setup();
-
- mStatusPane->controlListUpdated( mFileDetails );
-
+ setup();
+
+ mStatusPane->controlListUpdated( mFileDetails );
+
QVERIFY( mControlsController->view()->menu()->isEmpty() );
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testSlot_handleAboutToShow
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testSlot_handleAboutToShow()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_handleAboutToShow()"));
- setup();
-
+ setup();
+
connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) );
-
- emit commandSignal();
-
- QVERIFY( mControlsController->mTimerAction == ETimerCancel );
-
+
+ emit commandSignal();
+
+ QVERIFY( mControlsController->mTimerAction == ETimerCancel );
+
disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToShow() ) );
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testSlot_handleAboutToHide
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testSlot_handleAboutToHide()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_handleAboutToHide()"));
- setup();
-
+ setup();
+
connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
-
- emit commandSignal();
-
- QVERIFY( mControlsController->mTimerAction == ETimerReset );
-
+
+ emit commandSignal();
+
+ QVERIFY( mControlsController->mTimerAction == ETimerReset );
+
disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( handleAboutToHide() ) );
cleanup();
}
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
// testSlot_openFullScreenView
-// ---------------------------------------------------------------------------
+// -------------------------------------------------------------------------------------------------
//
void TestStatusPaneControl::testSlot_openFullScreenView()
{
MPX_ENTER_EXIT(_L("TestStatusPaneControl::testSlot_openFullScreenView()"));
- setup();
-
+ setup();
+
connect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) );
-
- emit commandSignal();
-
- QVERIFY( mControlsController->mViewMode == EFullScreenView );
-
+
+ emit commandSignal();
+
+ QVERIFY( mControlsController->mViewMode == EFullScreenView );
+
disconnect( this, SIGNAL( commandSignal() ), mStatusPane, SLOT( openFullScreenView() ) );
cleanup();
--- a/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/videoplaybackcontrolscontroller.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/teststatuspanecontrol/stub/inc/videoplaybackcontrolscontroller.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 4 %
+// Version : %version: 5 %
@@ -94,9 +94,11 @@
VideoPlaybackDocumentLoader* layoutLoader();
inline VideoBasePlaybackView* view();
-
+
+ inline bool isFileDetailsAdded();
+
void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
-
+
TPlaybackViewMode viewMode();
public:
@@ -130,8 +132,8 @@
TMPXPlaybackState mState;
TPlaybackViewMode mViewMode;
- TTimerAction mTimerAction;
-
+ TTimerAction mTimerAction;
+ bool mFileDetailsAdded;
};
// INLINE METHODS
@@ -165,6 +167,16 @@
return mView;
}
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlsController::view
+// -------------------------------------------------------------------------------------------------
+//
+inline
+bool VideoPlaybackControlsController::isFileDetailsAdded()
+{
+ return mFileDetailsAdded;
+}
+
#endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
// End of File
--- a/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/mpxvideoviewwrapper.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 7 %
+// Version : %version: 8 %
@@ -28,6 +28,7 @@
#include <e32base.h> // CBase
#include <e32std.h> // TBuf
+#include <mpxcollectionobserver.h>
#include "videoplaybackcontrol.hrh"
@@ -37,11 +38,15 @@
// Forward Declarations
class VideoBasePlaybackView;
class VideoPlaybackViewFileDetails;
+class CMPXCollectionUtility;
+class CMPXMedia;
+class CMPXCollectionPlaylist;
// Class Definitions
-class CMPXVideoViewWrapper : public CBase
+class CMPXVideoViewWrapper : public CBase,
+ public MMPXCollectionObserver
{
public:
static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
@@ -69,6 +74,17 @@
void ActivateClosePlayerActiveObject();
void IssueVideoAppForegroundCmdL( TBool aForeground );
+
+ inline void HandleOpenL( const CMPXMedia& /*aEntries*/,
+ TInt /*aIndex*/,
+ TBool /*aComplete*/,
+ TInt /*aError*/ ) {}
+
+ inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {}
+
+ inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {}
+
+ TInt GetMediaId();
public: // data
--- a/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/videoactivitystate.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/inc/videoactivitystate.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 1 %
+// Version : %version: 2 %
#ifndef __VIDEOACTIVITYSTATE_H__
#define __VIDEOACTIVITYSTATE_H__
@@ -30,6 +30,9 @@
// last position of the last played media clip (int)
static const QString KEY_LAST_PLAY_POSITION_ID = "_VideoActivity_last_play_position_id_";
+// TMPXId of the last played media file
+static const QString KEY_LAST_PLAYED_MEDIA_ID = "_VideoActivity_last_played_media_id_";
+
// name of the media clip last played (QString)
static const QString KEY_LAST_PLAYED_CLIP = "_VideoActivity_last_played_clip_";
--- a/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/tsrc/testvideoplaybackview/stub/src/mpxvideoviewwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 9 %
+// Version : %version: 10 %
@@ -219,4 +219,13 @@
iForeground = aForeground;
}
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::GetMediaId()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoViewWrapper::GetMediaId()
+{
+ return 0;
+}
+
// EOF
--- a/videoplayback/videoplaybackview/viewinc/mpxvideoviewwrapper.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/viewinc/mpxvideoviewwrapper.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#20 %
+// Version : %version: da1mmcf#21 %
@@ -265,7 +265,9 @@
TBool IsInMemoryPlugin();
void UpdatePbPluginMediaL( TBool aSeek );
-
+
+ TInt GetMediaId();
+
protected: // data
MMPXPlaybackUtility* iPlaybackUtility;
MMPXCollectionUtility* iCollectionUtility;
--- a/videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/viewsrc/mpxvideoviewwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#41 %
+// Version : %version: da1mmcf#42 %
@@ -35,6 +35,7 @@
#include <mpxplaybackutility.h>
#include <mmf/common/mmferrors.h>
#include <mpxcollectionutility.h>
+#include <mpxcollectionpath.h>
#include <mpxcollectionplaylist.h>
#include <mpxmediageneralextdefs.h>
#include <vcxmyvideosuids.h>
@@ -1664,5 +1665,18 @@
return iView->mStayPaused;
}
+// -------------------------------------------------------------------------------------------------
+// CMPXVideoViewWrapper::GetItemId()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMPXVideoViewWrapper::GetMediaId()
+{
+ MPX_DEBUG(_L("CMPXVideoViewWrapper::GetItemId()"));
+
+ CMPXCollectionPath* path = iCollectionUtility->Collection().PathL();
+ TInt itemId = path->Id().iId1;
+
+ return itemId;
+}
// EOF
--- a/videoplayback/videoplaybackview/viewsrc/videobaseplaybackview.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayback/videoplaybackview/viewsrc/videobaseplaybackview.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#45 %
+// Version : %version: da1mmcf#47 %
@@ -46,8 +46,8 @@
#include "mpxvideoviewwrapper.h"
#include "mpxvideoplaybackuids.hrh"
#include "videobaseplaybackview.h"
-#include "videoactivitystate.h"
-#include "videoplaybackviewfiledetails.h"
+#include "videoactivitystate.h"
+#include "videoplaybackviewfiledetails.h"
#include "mpxcommonvideoplaybackview.hrh"
@@ -83,23 +83,23 @@
mTimerForClosingView->setSingleShot( true );
mTimerForClosingView->setInterval( 10 );
connect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
-
+
//
// Read activity data ...
// If last playback was forced to terminate due to low memory (GOOM, etc.)
- // then the clip needs to be restored to the last played position
+ // then the clip needs to be restored to the last played position
// and the state needs to be paused, since forced termination can only occur for
// background apps - so if this happened Video Player must have been in background
// which implies paused state
- //
- int lastViewType = VideoActivityState::instance().getActivityData(KEY_VIEWPLUGIN_TYPE).toInt();
- if ( lastViewType == MpxHbVideoCommon::PlaybackView )
+ //
+ int lastViewType = VideoActivityState::instance().getActivityData(KEY_VIEWPLUGIN_TYPE).toInt();
+ if ( lastViewType == MpxHbVideoCommon::PlaybackView )
{
QVariant data = VideoActivityState::instance().getActivityData(KEY_LAST_PLAY_POSITION_ID);
- mLastPlayPosition = data.toInt();
-
+ mLastPlayPosition = data.toInt();
+
mStayPaused = true;
- }
+ }
}
// -------------------------------------------------------------------------------------------------
@@ -170,7 +170,7 @@
MPX_ENTER_EXIT(_L("VideoBasePlaybackView::handleDeactivateView()"));
saveActivityData();
-
+
mActivated = false;
QCoreApplication::instance()->removeEventFilter( this );
@@ -198,17 +198,20 @@
//
void VideoBasePlaybackView::saveActivityData()
{
- MPX_DEBUG( _L("VideoBasePlaybackView::saveActivityData()") );
-
+ MPX_DEBUG( _L("VideoBasePlaybackView::saveActivityData()") );
+
// save the activity data
QVariant data = QString( mVideoMpxWrapper->iFileDetails->mClipName );
- VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAYED_CLIP);
-
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAYED_CLIP);
+
data = int( mVideoMpxWrapper->iPlayPosition );
VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAY_POSITION_ID);
-
+
data = bool( mVideoMpxWrapper->iFileDetails->mPlaybackMode == EMPXVideoLocal );
- VideoActivityState::instance().setActivityData(data, KEY_LAST_LOCAL_PLAYBACK);
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_LOCAL_PLAYBACK);
+
+ data = uint ( mVideoMpxWrapper->GetMediaId() );
+ VideoActivityState::instance().setActivityData(data, KEY_LAST_PLAYED_MEDIA_ID);
}
// -------------------------------------------------------------------------------------------------
@@ -296,9 +299,9 @@
// VideoBasePlaybackView::showDialog
// -------------------------------------------------------------------------------------------------
//
-void VideoBasePlaybackView::showDialog( const QString& qString, bool closeView )
+void VideoBasePlaybackView::showDialog( const QString& string, bool closeView )
{
- MPX_DEBUG(_L("VideoBasePlaybackView::showDialog( %s, %d )"), qString.data(), closeView );
+ MPX_DEBUG(_L("VideoBasePlaybackView::showDialog( %s, %d )"), string.data(), closeView );
//
// create pop-up dialog for error notes,
@@ -308,9 +311,6 @@
QRectF screenRect = hbInstance->allMainWindows()[0]->rect();
HbNotificationDialog* dlg = new HbNotificationDialog();
dlg->setAttribute( Qt::WA_DeleteOnClose );
- dlg->setMinimumSize( QSizeF(200, 100) );
- dlg->setPreferredPos( QPointF( screenRect.height()/2, screenRect.width()/2 ),
- HbPopup::Center );
if ( closeView )
{
@@ -321,16 +321,7 @@
connect( dlg, SIGNAL( aboutToClose() ), this, SLOT( handleClosePopupDialog() ) );
}
- //
- // convert string to label so text alignment can be set
- //
- HbLabel *label = new HbLabel( qString );
- label->setAlignment( Qt::AlignCenter );
-
- //
- // set label as content widget and show pop-up dialog
- //
- dlg->setContentWidget( label );
+ dlg->setTitle( string );
dlg->show();
}
--- a/videoplayerapp/bwins/videoplayerengineu.def Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/bwins/videoplayerengineu.def Fri Jul 23 11:10:06 2010 +0300
@@ -60,4 +60,6 @@
?shouldExit@VideoPlayerEngine@@AAE_NXZ @ 59 NONAME ; bool VideoPlayerEngine::shouldExit(void)
?instance@VideoServices@@SAPAV1@PAVVideoPlayerEngine@@@Z @ 60 NONAME ; class VideoServices * VideoServices::instance(class VideoPlayerEngine *)
??_EVideoPlayerEngine@@UAE@I@Z @ 61 NONAME ; VideoPlayerEngine::~VideoPlayerEngine(unsigned int)
+ ?applicationReady@VideoPlayerEngine@@IAEXXZ @ 62 NONAME ; void VideoPlayerEngine::applicationReady(void)
+ ?viewReadySlot@VideoPlayerEngine@@QAEXXZ @ 63 NONAME ; void VideoPlayerEngine::viewReadySlot(void)
--- a/videoplayerapp/eabi/videoplayerengineu.def Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/eabi/videoplayerengineu.def Fri Jul 23 11:10:06 2010 +0300
@@ -64,4 +64,6 @@
_ZTV13VideoServices @ 63 NONAME
_ZTV17VideoPlayerEngine @ 64 NONAME
_ZTV18VideoActivityState @ 65 NONAME
+ _ZN17VideoPlayerEngine13viewReadySlotEv @ 66 NONAME
+ _ZN17VideoPlayerEngine16applicationReadyEv @ 67 NONAME
--- a/videoplayerapp/inc/videoplayerengine.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/inc/videoplayerengine.h Fri Jul 23 11:10:06 2010 +0300
@@ -58,9 +58,12 @@
void playMedia( QString filePath );
void playMedia( RFile file );
void setEmbedded();
-
+ signals:
+ void applicationReady();
+
public slots:
void handleCommand( int commandCode );
+ void viewReadySlot();
private slots:
void handleQuit();
--- a/videoplayerapp/videoplayer/sis/videoplayer_stub.pkg Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayer/sis/videoplayer_stub.pkg Fri Jul 23 11:10:06 2010 +0300
@@ -41,9 +41,9 @@
;
; Video playback view
;
-"" - "z:\sys\bin\hbvideoplaybackview.dll"
-"" - "z:\sys\bin\hbvideoplaybackviewplugin.dll"
-"" - "z:\resource\plugins\hbvideoplaybackviewplugin.r*"
+"" - "z:\sys\bin\videoplaybackview.dll"
+"" - "z:\sys\bin\videoplaybackviewplugin.dll"
+"" - "z:\resource\plugins\videoplaybackviewplugin.r*"
;
; Collection view and wrapper
--- a/videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayer/sis/videoplayer_udeb.pkg Fri Jul 23 11:10:06 2010 +0300
@@ -59,6 +59,6 @@
"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
-"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
-"/epoc32/release/armv5/udeb/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
-"/epoc32/release/armv5/udeb/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
+"/epoc32/data/z/resource/plugins/videoplaybackviewplugin.rsc" - "!:/resource/plugins/videoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/udeb/videoplaybackview.dll" - "!:/sys/bin/videoplaybackview.dll"
+"/epoc32/release/armv5/udeb/videoplaybackviewplugin.dll" - "!:/sys/bin/videoplaybackviewplugin.dll"
--- a/videoplayerapp/videoplayer/sis/videoplayer_urel.pkg Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayer/sis/videoplayer_urel.pkg Fri Jul 23 11:10:06 2010 +0300
@@ -59,6 +59,6 @@
"/epoc32/data/z/private/10003a3f/import/apps/videoplayer_reg.rsc" - "!:/private/10003a3f/import/apps/videoplayer_reg.rsc"
"/epoc32/data/z/resource/qt/translations/videos_en.qm" - "!:/resource/qt/translations/videos.qm"
-"/epoc32/data/z/resource/plugins/hbvideoplaybackviewplugin.rsc" - "!:/resource/plugins/hbvideoplaybackviewplugin.rsc"
-"/epoc32/release/armv5/urel/hbvideoplaybackview.dll" - "!:/sys/bin/hbvideoplaybackview.dll"
-"/epoc32/release/armv5/urel/hbvideoplaybackviewplugin.dll" - "!:/sys/bin/hbvideoplaybackviewplugin.dll"
+"/epoc32/data/z/resource/plugins/videoplaybackviewplugin.rsc" - "!:/resource/plugins/videoplaybackviewplugin.rsc"
+"/epoc32/release/armv5/urel/videoplaybackview.dll" - "!:/sys/bin/videoplaybackview.dll"
+"/epoc32/release/armv5/urel/videoplaybackviewplugin.dll" - "!:/sys/bin/videoplaybackviewplugin.dll"
--- a/videoplayerapp/videoplayer/src/main.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayer/src/main.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -57,6 +57,7 @@
HbMainWindow mainWindow( 0, Hb::WindowFlagTransparent );
VideoPlayerEngine *engine = new VideoPlayerEngine( isService );
+ QObject::connect(&mainWindow, SIGNAL(viewReady()), engine, SLOT(viewReadySlot()));
engine->initialize();
mainWindow.show();
return app.exec();
--- a/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/mpxvideoplayerappuiengine.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -200,6 +200,8 @@
* @since 10.1
*/
void LateInitL();
+
+ TInt ReplayAfterPriorTermination(const TDesC& aFileName);
private:
/**
@@ -247,6 +249,8 @@
void UpdatePbPluginMediaL();
void ActivateVideoPlaybackView();
+
+ void ReadActivityData();
private: // data
@@ -267,6 +271,7 @@
TBool iUpdateSeekInfo;
VideoPlaybackWrapper* iPlaybackWrapper;
+ TUint32 iLastPlayedItemId;
};
//
--- a/videoplayerapp/videoplayerengine/inc/videoplaybackwrapper.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayerengine/inc/videoplaybackwrapper.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
@@ -42,6 +42,7 @@
int playMedia( RFile aFile );
void openPlaybackView() ;
void lateInit();
+ int replayMedia( QString aFilename );
private:
void initializePlugins();
--- a/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/mpxvideoplayerappuiengine.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 10 %
+// Version : %version: 11 %
@@ -39,11 +39,14 @@
#include <coeutils.h>
#include <videoplaylistutility.h>
#include <mpxvideoplaybackdefs.h>
+#include <mpxmediacontainerdefs.h>
+#include <mpxmediaarray.h>
#include "mpxvideoplayerappuiengine.h"
#include "mpxvideoplayerconstants.h"
#include "videoplaybackwrapper.h"
#include "mpxhbvideocommondefs.h"
+#include "videoactivitystate.h"
#include "mpxvideo_debug.h"
@@ -739,5 +742,51 @@
CleanupStack::PopAndDestroy( cmd );
}
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerAppUiEngine::ReplayAfterPriorTermination()
+// -------------------------------------------------------------------------------------------------
+//
+TInt CMpxVideoPlayerAppUiEngine::ReplayAfterPriorTermination(const TDesC& aFileName)
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ReplayAfterPriorTermination()"));
+
+ ReadActivityData();
+ TMPXItemId mpxItemId(iLastPlayedItemId);
+
+ TInt error = KErrNone;
+
+ MPX_TRAP( error,
+ CMPXMedia* media = CMPXMedia::NewL();
+ CleanupStack::PushL(media);
+
+ media->SetTObjectValueL<TMPXGeneralType>(KMPXMediaGeneralType, EMPXItem );
+ media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, mpxItemId );
+ media->SetTextValueL( KMPXMediaGeneralTitle, aFileName );
+ media->SetTextValueL( KMPXMediaGeneralUri, aFileName );
+
+ OpenMediaL( *media );
+
+ CleanupStack::PopAndDestroy( media );
+ );
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// CMpxVideoPlayerAppUiEngine::ReadActivityData()
+// -------------------------------------------------------------------------------------------------
+//
+void CMpxVideoPlayerAppUiEngine::ReadActivityData()
+{
+ MPX_DEBUG(_L("CMpxVideoPlayerAppUiEngine::ReadActivityData()"));
+
+ iLastPlayedItemId =
+ VideoActivityState::instance().getActivityData(KEY_LAST_PLAYED_MEDIA_ID).toUInt();
+
+}
+
+
+
// EOF
--- a/videoplayerapp/videoplayerengine/src/videoplaybackwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplaybackwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: 6 %
+// Version : %version: 7 %
#include "mpxvideo_debug.h"
@@ -79,7 +79,22 @@
}
// -------------------------------------------------------------------------------------------------
-// VideoPlaybackWrapper::playMedia()
+// VideoPlaybackWrapper::replayMedia()
+// -------------------------------------------------------------------------------------------------
+//
+int VideoPlaybackWrapper::replayMedia( QString aFileName )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::replayMedia"));
+
+ TBuf<KMaxFileName> name( aFileName.utf16() );
+
+ int error = mUiEngine->ReplayAfterPriorTermination( name );
+
+ return error;
+}
+
+// -------------------------------------------------------------------------------------------------
+// QMpxVideoPlaybackWrapper::playMedia()
// -------------------------------------------------------------------------------------------------
//
int VideoPlaybackWrapper::playMedia( RFile aFile )
--- a/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayerengine/src/videoplayerengine.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#38 %
+// Version : %version: 40 %
#include <QApplication>
@@ -162,7 +162,14 @@
createPlaybackView();
viewType = MpxHbVideoCommon::MpxHbVideoViewType(typeGotten);
QVariant data = VideoActivityState::instance().getActivityData( KEY_LAST_PLAYED_CLIP );
- playMedia( data.toString() );
+ int error = mPlaybackWrapper->replayMedia( data.toString() );
+
+ // if replay fails, then activate collection view instead
+ if ( error != KErrNone )
+ {
+ loadPluginAndCreateView( MpxHbVideoCommon::CollectionView );
+ activateView( MpxHbVideoCommon::CollectionView );
+ }
}
else
{
@@ -225,6 +232,20 @@
}
// -------------------------------------------------------------------------------------------------
+// viewReadySlot()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlayerEngine::viewReadySlot()
+{
+ MPX_ENTER_EXIT(_L("VideoPlayerEngine::viewReady()"));
+ emit applicationReady();
+ // since we need to emit applicationReady only once at startup,
+ // disconnect the viewReady -signal from this object
+ disconnect(hbInstance->allMainWindows().value(0), SIGNAL(viewReady()),
+ this, SLOT(viewReadySlot()));
+}
+
+// -------------------------------------------------------------------------------------------------
// doDelayedLoad()
// -------------------------------------------------------------------------------------------------
//
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoplaybackwrapper.h Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoplaybackwrapper.h Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#6 %
+// Version : %version: da1mmcf#7 %
@@ -38,6 +38,7 @@
virtual ~VideoPlaybackWrapper();
int playMedia( QString aFileName );
int playMedia( RFile aFile );
+ int replayMedia( QString aFileName );
public:
void openPlaybackView() ;
--- a/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoplaybackwrapper.cpp Thu Jul 08 13:05:19 2010 +0300
+++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/videoplaybackwrapper.cpp Fri Jul 23 11:10:06 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-// Version : %version: da1mmcf#7 %
+// Version : %version: da1mmcf#8 %
#include "videoplaybackwrapper.h"
@@ -71,6 +71,15 @@
return 0;
}
+int VideoPlaybackWrapper::replayMedia( QString aFileName )
+{
+ MPX_ENTER_EXIT(_L("VideoPlaybackWrapper::replayMedia"));
+
+ Q_UNUSED( aFileName );
+ return 0;
+}
+
+
int VideoPlaybackWrapper::playMedia( RFile aFile )
{
MPX_DEBUG(_L("VideoPlaybackWrapper::playMedia( aFile )"));