# HG changeset patch # User hgs # Date 1287059063 -19800 # Node ID 0a8e959402e553b6e64a90f8d65e92c447f79f41 # Parent 27f2d7aec52a93880c037e7d180c2fbdbc5bd2ea 201041 diff -r 27f2d7aec52a -r 0a8e959402e5 commonutilities/common/cenrep/20007194.txt Binary file commonutilities/common/cenrep/20007194.txt has changed diff -r 27f2d7aec52a -r 0a8e959402e5 conf/photos.confml Binary file conf/photos.confml has changed diff -r 27f2d7aec52a -r 0a8e959402e5 engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp --- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -488,7 +488,6 @@ // CGlxDataSourceMde::HandleObjectNotification // --------------------------------------------------------------------------- // -///@todo AB test this void CGlxDataSourceMde::HandleObjectNotification(CMdESession& /*aSession*/, TObserverNotificationType aType, const RArray& aObjectIdArray) @@ -537,7 +536,6 @@ // CGlxDataSourceMde::HandleObjectPresentNotification // --------------------------------------------------------------------------- // -///@todo AB test this void CGlxDataSourceMde::HandleObjectPresentNotification(CMdESession& /*aSession*/, TBool aPresent, const RArray& aObjectIdArray) { @@ -556,7 +554,6 @@ // CGlxDataSourceMde::HandleRelationNotification // --------------------------------------------------------------------------- // -///@todo AB test this void CGlxDataSourceMde::HandleRelationNotification(CMdESession& /*aSession*/, TObserverNotificationType aType, const RArray& aRelationIdArray) @@ -569,7 +566,6 @@ // CGlxDataSourceMde::HandleRelationPresentNotification // --------------------------------------------------------------------------- // -///@todo AB test this void CGlxDataSourceMde::HandleRelationPresentNotification(CMdESession& /*aSession*/, TBool aPresent, const RArray& aRelationIdArray) { @@ -1155,7 +1151,11 @@ switch(aHarvesterEventState) { case EHEStateStarted: - GLX_LOG_INFO("CGlxDataSourceMde::HarvestingUpdated() - EHEStateStarted"); + { + GLX_LOG_INFO("CGlxDataSourceMde::HarvestingUpdated() - EHEStateStarted"); + iHarvestingOngoing = ETrue; + } + break; case EHEStateResumed: case EHEStateHarvesting: { diff -r 27f2d7aec52a -r 0a8e959402e5 inc/glxlocalisationstrings.h --- a/inc/glxlocalisationstrings.h Wed Oct 06 14:49:39 2010 +0530 +++ b/inc/glxlocalisationstrings.h Thu Oct 14 17:54:23 2010 +0530 @@ -121,7 +121,7 @@ #define GLX_ALBUM_NAME_COUNT_LABEL "txt_photos_subhead_1_l2" //to show the total image count in grid view -#define GLX_GRID_VIEW_COUNT_LABEL "txt_photos_subhead_all_l2" +#define GLX_GRID_VIEW_COUNT_LABEL "txt_photos_subhead_all_l1" //to show the total album count in Album list view #define GLX_ALBUM_LIST_COUNT_LABEL "txt_photos_subhead_albums_l2" @@ -236,7 +236,7 @@ #define GLX_BUTTON_HIDE hbTrId("txt_common_button_hide") -#define GLX_BUTTON_NEW hbTrId("txt_photos_button_new") +#define GLX_BUTTON_NEW hbTrId("txt_photos_button_new_album") #define GLX_BUTTON_PLAY hbTrId("txt_common_button_play_video") diff -r 27f2d7aec52a -r 0a8e959402e5 inc/glxlog.h --- a/inc/glxlog.h Wed Oct 06 14:49:39 2010 +0530 +++ b/inc/glxlog.h Thu Oct 14 17:54:23 2010 +0530 @@ -51,7 +51,7 @@ #define GLX_DEBUG3( s, i, j ) #define GLX_DEBUG4( s, i, j, k ) #define GLX_DEBUG5( s, i, j, k, l ) - + #define GLX_LOG_URI( s, i ) #else // only include headers if logging is enabled @@ -337,6 +337,16 @@ #define GLX_DEBUG5( s, i, j, k, l ) GLX_LOG_INFO4( s, i, j, k, l ) /** + * Logs a single line of information with two parameters + * Example usage: + * CFoo::SetImageUriL(const TDesC& aFileName) { + * GLX_LOG_URI( "CFoo::SetImageUriL(%S)", &aFileName ); } + * @param s, the string to be inserted to the log, plain compile time string, not a descriptor + * @param i, the string value to be inserted to the string + */ + #define GLX_LOG_URI( s, i ) RDebug::Print( _L( s ), i ) + + /** * TRAP instrumentation for Leave */ #undef TRAP_INSTRUMENTATION_LEAVE diff -r 27f2d7aec52a -r 0a8e959402e5 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlereditimage.cpp --- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlereditimage.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlereditimage.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -53,17 +53,17 @@ const QString operation = QLatin1String("view(QString,int)"); //Connect to service provider - if(mReq == NULL) + if( !mReq ) { mReq = mAppmgr.create(service, interface, operation, true); - mReq->setEmbedded(true); - mReq->setSynchronous(false); } - if(mReq == NULL) + if( !mReq ) { return; } + mReq->setEmbedded(true); + mReq->setSynchronous(false); connect(mReq, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); connect(mReq, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&))); diff -r 27f2d7aec52a -r 0a8e959402e5 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp --- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -100,8 +100,29 @@ { //rename the media TInt error = manager->RenameFile(media.Uri(), *modifiedName); - - if (error == KErrNone) + //reset the flag to 'false'! + iIsCmdActive = false; + + /* + 1. Photos renames the file with file system services + 2. Photos tries to update the title of the renamed images + -> Image object is opened for modifications + 3. MDS gets notification from the file server that the image has been renamed + -> Handling this fails with -22 KErrLocked as the same object is opened + by Photos for changing the title + -> MDS cannot update the the URI or Title for locked object + 4. Photos completes updating the title + -> title for xxx.jpg is set as A, but the uri is still xxx.jpg in + MDS DB as MDS could not modify the object-- + So Removing the manually changing of the title completely. + As MDS will update the title field automatically if it was originally + populated from the uri, changing the title manually after rename is complitely + unnecessary anyway. So let MDS do the updating by itself as it should, + and you will still get modified event from MDS when the update, including + the title, is complete + */ + /* + if (error == KErrNone) { path = aMediaList.PathLC( NGlxListDefs::EPathFocusOrSelection); @@ -109,7 +130,7 @@ *newMediaItemTitle, *path); CleanupStack::Pop(command); CleanupStack::PopAndDestroy(path); - } + }*/ } else { @@ -132,6 +153,11 @@ CleanupStack::PopAndDestroy(newMediaItemTitle); } } + else + { + // If cancel is pressed, reset the flag!! + iIsCmdActive = false; + } return command; } diff -r 27f2d7aec52a -r 0a8e959402e5 ui/inc/glxicondefs.h --- a/ui/inc/glxicondefs.h Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/inc/glxicondefs.h Thu Oct 14 17:54:23 2010 +0530 @@ -45,6 +45,8 @@ //DEFAULT ICON #define GLXICON_DEFAULT "qtg_mono_photos" +#define GLXICON_DEFAULT_ALBUMLIST "qtg_large_photo_collection" +#define GLXICON_DEFAULT_FAVOURITE "qtg_large_favourites" #define GLXICON_ADD_TO_FAV "qtg_graf_ratingslider_rated" #define GLXICON_REMOVE_FAV "qtg_graf_ratingslider_unrated" diff -r 27f2d7aec52a -r 0a8e959402e5 ui/uiengine/model/listmodel/inc/glxalbummodel.h --- a/ui/uiengine/model/listmodel/inc/glxalbummodel.h Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/uiengine/model/listmodel/inc/glxalbummodel.h Thu Oct 14 17:54:23 2010 +0530 @@ -82,6 +82,7 @@ GlxMLWrapper* mMLWrapper; GlxContextMode mContextMode; HbIcon* mDefaultIcon; + HbIcon* mDefaultfavIcon; QCache itemIconCache; int mTempVisibleWindowIndex; HbIcon* m_CorruptIcon; diff -r 27f2d7aec52a -r 0a8e959402e5 ui/uiengine/model/listmodel/src/glxalbummodel.cpp --- a/ui/uiengine/model/listmodel/src/glxalbummodel.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/uiengine/model/listmodel/src/glxalbummodel.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -25,6 +25,8 @@ #include "glxicondefs.h" //Contains the icon names/Ids +#define FAV_ROW_INDEX 1 + GlxAlbumModel::GlxAlbumModel(GlxModelParm & modelParm):mContextMode(GlxContextInvalid) { qDebug("GlxAlbumModel::GlxAlbumModel()"); @@ -36,7 +38,8 @@ mContextMode = GlxContextSelectionList; //todo get this Default icon from some generic path and not directly. - mDefaultIcon = new HbIcon(GLXICON_DEFAULT); + mDefaultIcon = new HbIcon(GLXICON_DEFAULT_ALBUMLIST); + mDefaultfavIcon = new HbIcon(GLXICON_DEFAULT_FAVOURITE); m_CorruptIcon = new HbIcon( GLXICON_CORRUPT ); int err = connect(mMLWrapper, SIGNAL(updateItem(int, GlxTBContextType)), this, SLOT(itemUpdated1(int, GlxTBContextType))); @@ -58,6 +61,8 @@ qDebug("GlxAlbumModel::~GlxAlbumModel()"); delete mDefaultIcon; mDefaultIcon = NULL; + delete mDefaultfavIcon; + mDefaultfavIcon = NULL; delete m_CorruptIcon; int err = disconnect(mMLWrapper, SIGNAL(updateItem(int, GlxTBContextType)), this, SLOT(itemUpdated1(int, GlxTBContextType))); err = disconnect(mMLWrapper, SIGNAL(insertItems(int, int)), this, SLOT(itemsAdded(int, int))); @@ -156,6 +161,9 @@ if ( mMLWrapper->isCorruptedImage( index.row() ) ) { return m_CorruptIcon ; } + if( index.row() == FAV_ROW_INDEX ){ + return mDefaultfavIcon; + } return mDefaultIcon ; } diff -r 27f2d7aec52a -r 0a8e959402e5 ui/viewmanagement/bwins/glxviewmanageru.def --- a/ui/viewmanagement/bwins/glxviewmanageru.def Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/viewmanagement/bwins/glxviewmanageru.def Thu Oct 14 17:54:23 2010 +0530 @@ -19,35 +19,34 @@ ?actionTriggered@GlxViewManager@@IAEXH@Z @ 18 NONAME ; void GlxViewManager::actionTriggered(int) ?getSubState@GlxViewManager@@AAEHXZ @ 19 NONAME ; int GlxViewManager::getSubState(void) ?launchView@GlxViewManager@@QAEXHPAVQAbstractItemModel@@W4GlxEffect@@W4GlxViewEffect@@@Z @ 20 NONAME ; void GlxViewManager::launchView(int, class QAbstractItemModel *, enum GlxEffect, enum GlxViewEffect) - ?handleMenuAction@GlxViewManager@@QAEXH@Z @ 21 NONAME ; void GlxViewManager::handleMenuAction(int) - ?externalCommand@GlxViewManager@@IAEXH@Z @ 22 NONAME ; void GlxViewManager::externalCommand(int) - ??0GlxViewManager@@QAE@XZ @ 23 NONAME ; GlxViewManager::GlxViewManager(void) - ?exitMarkingMode@GlxViewManager@@QAEXH@Z @ 24 NONAME ; void GlxViewManager::exitMarkingMode(int) - ?cancelTimer@GlxViewManager@@QAEXXZ @ 25 NONAME ; void GlxViewManager::cancelTimer(void) - ?setModel@GlxViewManager@@QAEXPAVQAbstractItemModel@@@Z @ 26 NONAME ; void GlxViewManager::setModel(class QAbstractItemModel *) - ?createToolBar@GlxViewManager@@AAEXXZ @ 27 NONAME ; void GlxViewManager::createToolBar(void) - ?removeConnection@GlxViewManager@@AAEXXZ @ 28 NONAME ; void GlxViewManager::removeConnection(void) - ?launchView@GlxViewManager@@QAEXHPAVQAbstractItemModel@@@Z @ 29 NONAME ; void GlxViewManager::launchView(int, class QAbstractItemModel *) - ?createMarkingModeActions@GlxViewManager@@AAEXXZ @ 30 NONAME ; void GlxViewManager::createMarkingModeActions(void) - ?qt_metacall@GlxViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 31 NONAME ; int GlxViewManager::qt_metacall(enum QMetaObject::Call, int, void * *) - ?deActivateView@GlxViewManager@@AAEXXZ @ 32 NONAME ; void GlxViewManager::deActivateView(void) - ?destroyView@GlxViewManager@@QAEXH@Z @ 33 NONAME ; void GlxViewManager::destroyView(int) - ?resolveView@GlxViewManager@@AAEPAVGlxView@@H@Z @ 34 NONAME ; class GlxView * GlxViewManager::resolveView(int) - ??1GlxViewManager@@UAE@XZ @ 35 NONAME ; GlxViewManager::~GlxViewManager(void) - ?getSelectionModel@GlxViewManager@@QAEPAVQItemSelectionModel@@H@Z @ 36 NONAME ; class QItemSelectionModel * GlxViewManager::getSelectionModel(int) - ?addConnection@GlxViewManager@@AAEXXZ @ 37 NONAME ; void GlxViewManager::addConnection(void) - ?hideProgressDialog@GlxViewManager@@AAEXXZ @ 38 NONAME ; void GlxViewManager::hideProgressDialog(void) - ?handleReadyView@GlxViewManager@@QAEXXZ @ 39 NONAME ; void GlxViewManager::handleReadyView(void) - ?orientation@GlxViewManager@@QBE?AW4Orientation@Qt@@XZ @ 40 NONAME ; enum Qt::Orientation GlxViewManager::orientation(void) const - ?createMarkingModeToolBar@GlxViewManager@@AAEXXZ @ 41 NONAME ; void GlxViewManager::createMarkingModeToolBar(void) - ?checkMarked@GlxViewManager@@AAEXXZ @ 42 NONAME ; void GlxViewManager::checkMarked(void) - ?itemSpecificMenuTriggered@GlxViewManager@@QAEXHVQPointF@@@Z @ 43 NONAME ; void GlxViewManager::itemSpecificMenuTriggered(int, class QPointF) - ?setupItems@GlxViewManager@@QAEXXZ @ 44 NONAME ; void GlxViewManager::setupItems(void) - ?actionProcess@GlxViewManager@@QAEXH@Z @ 45 NONAME ; void GlxViewManager::actionProcess(int) - ?deactivateCurrentView@GlxViewManager@@QAEXXZ @ 46 NONAME ; void GlxViewManager::deactivateCurrentView(void) - ?trUtf8@GlxViewManager@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString GlxViewManager::trUtf8(char const *, char const *, int) - ?trUtf8@GlxViewManager@@SA?AVQString@@PBD0@Z @ 48 NONAME ; class QString GlxViewManager::trUtf8(char const *, char const *) - ?launchApplication@GlxViewManager@@QAEXHPAVQAbstractItemModel@@@Z @ 49 NONAME ; void GlxViewManager::launchApplication(int, class QAbstractItemModel *) - ?tr@GlxViewManager@@SA?AVQString@@PBD0H@Z @ 50 NONAME ; class QString GlxViewManager::tr(char const *, char const *, int) - ?activateView@GlxViewManager@@AAEXXZ @ 51 NONAME ; void GlxViewManager::activateView(void) + ??0GlxViewManager@@QAE@XZ @ 21 NONAME ; GlxViewManager::GlxViewManager(void) + ?exitMarkingMode@GlxViewManager@@QAEXH@Z @ 22 NONAME ; void GlxViewManager::exitMarkingMode(int) + ?setModel@GlxViewManager@@QAEXPAVQAbstractItemModel@@@Z @ 23 NONAME ; void GlxViewManager::setModel(class QAbstractItemModel *) + ?createToolBar@GlxViewManager@@AAEXXZ @ 24 NONAME ; void GlxViewManager::createToolBar(void) + ?removeConnection@GlxViewManager@@AAEXXZ @ 25 NONAME ; void GlxViewManager::removeConnection(void) + ?launchView@GlxViewManager@@QAEXHPAVQAbstractItemModel@@@Z @ 26 NONAME ; void GlxViewManager::launchView(int, class QAbstractItemModel *) + ?createMarkingModeActions@GlxViewManager@@AAEXXZ @ 27 NONAME ; void GlxViewManager::createMarkingModeActions(void) + ?qt_metacall@GlxViewManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 28 NONAME ; int GlxViewManager::qt_metacall(enum QMetaObject::Call, int, void * *) + ?deActivateView@GlxViewManager@@AAEXXZ @ 29 NONAME ; void GlxViewManager::deActivateView(void) + ?destroyView@GlxViewManager@@QAEXH@Z @ 30 NONAME ; void GlxViewManager::destroyView(int) + ?resolveView@GlxViewManager@@AAEPAVGlxView@@H@Z @ 31 NONAME ; class GlxView * GlxViewManager::resolveView(int) + ??1GlxViewManager@@UAE@XZ @ 32 NONAME ; GlxViewManager::~GlxViewManager(void) + ?getSelectionModel@GlxViewManager@@QAEPAVQItemSelectionModel@@H@Z @ 33 NONAME ; class QItemSelectionModel * GlxViewManager::getSelectionModel(int) + ?addConnection@GlxViewManager@@AAEXXZ @ 34 NONAME ; void GlxViewManager::addConnection(void) + ?hideProgressDialog@GlxViewManager@@AAEXXZ @ 35 NONAME ; void GlxViewManager::hideProgressDialog(void) + ?handleReadyView@GlxViewManager@@QAEXXZ @ 36 NONAME ; void GlxViewManager::handleReadyView(void) + ?orientation@GlxViewManager@@QBE?AW4Orientation@Qt@@XZ @ 37 NONAME ; enum Qt::Orientation GlxViewManager::orientation(void) const + ?createMarkingModeToolBar@GlxViewManager@@AAEXXZ @ 38 NONAME ; void GlxViewManager::createMarkingModeToolBar(void) + ?checkMarked@GlxViewManager@@AAEXXZ @ 39 NONAME ; void GlxViewManager::checkMarked(void) + ?itemSpecificMenuTriggered@GlxViewManager@@QAEXHVQPointF@@@Z @ 40 NONAME ; void GlxViewManager::itemSpecificMenuTriggered(int, class QPointF) + ?setupItems@GlxViewManager@@QAEXXZ @ 41 NONAME ; void GlxViewManager::setupItems(void) + ?actionProcess@GlxViewManager@@QAEXH@Z @ 42 NONAME ; void GlxViewManager::actionProcess(int) + ?deactivateCurrentView@GlxViewManager@@QAEXXZ @ 43 NONAME ; void GlxViewManager::deactivateCurrentView(void) + ?trUtf8@GlxViewManager@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString GlxViewManager::trUtf8(char const *, char const *, int) + ?trUtf8@GlxViewManager@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString GlxViewManager::trUtf8(char const *, char const *) + ?cancelViewTransitionEffect@GlxViewManager@@QAEXXZ @ 46 NONAME ; void GlxViewManager::cancelViewTransitionEffect(void) + ?launchApplication@GlxViewManager@@QAEXHPAVQAbstractItemModel@@@Z @ 47 NONAME ; void GlxViewManager::launchApplication(int, class QAbstractItemModel *) + ?tr@GlxViewManager@@SA?AVQString@@PBD0H@Z @ 48 NONAME ; class QString GlxViewManager::tr(char const *, char const *, int) + ?activateView@GlxViewManager@@AAEXXZ @ 49 NONAME ; void GlxViewManager::activateView(void) + ?updateToolBarActionState@GlxViewManager@@QAEXH_N@Z @ 50 NONAME ; void GlxViewManager::updateToolBarActionState(int, bool) diff -r 27f2d7aec52a -r 0a8e959402e5 ui/viewmanagement/eabi/glxviewmanageru.def --- a/ui/viewmanagement/eabi/glxviewmanageru.def Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/viewmanagement/eabi/glxviewmanageru.def Thu Oct 14 17:54:23 2010 +0530 @@ -2,52 +2,51 @@ _ZN14GlxViewManager10launchViewEiP18QAbstractItemModel @ 1 NONAME _ZN14GlxViewManager10launchViewEiP18QAbstractItemModel9GlxEffect13GlxViewEffect @ 2 NONAME _ZN14GlxViewManager10setupItemsEv @ 3 NONAME - _ZN14GlxViewManager11cancelTimerEv @ 4 NONAME - _ZN14GlxViewManager11checkMarkedEv @ 5 NONAME - _ZN14GlxViewManager11destroyViewEi @ 6 NONAME - _ZN14GlxViewManager11getSubStateEv @ 7 NONAME - _ZN14GlxViewManager11qt_metacallEN11QMetaObject4CallEiPPv @ 8 NONAME - _ZN14GlxViewManager11qt_metacastEPKc @ 9 NONAME - _ZN14GlxViewManager11resolveViewEi @ 10 NONAME - _ZN14GlxViewManager12activateViewEv @ 11 NONAME - _ZN14GlxViewManager12handleActionEv @ 12 NONAME - _ZN14GlxViewManager13actionProcessEi @ 13 NONAME - _ZN14GlxViewManager13addConnectionEv @ 14 NONAME - _ZN14GlxViewManager13createActionsEv @ 15 NONAME - _ZN14GlxViewManager13createToolBarEv @ 16 NONAME - _ZN14GlxViewManager14deActivateViewEv @ 17 NONAME - _ZN14GlxViewManager14effectFinishedEv @ 18 NONAME - _ZN14GlxViewManager15actionTriggeredEi @ 19 NONAME - _ZN14GlxViewManager15exitMarkingModeEi @ 20 NONAME - _ZN14GlxViewManager15externalCommandEi @ 21 NONAME - _ZN14GlxViewManager15handleReadyViewEv @ 22 NONAME - _ZN14GlxViewManager16enterMarkingModeEii @ 23 NONAME - _ZN14GlxViewManager16handleMenuActionEi @ 24 NONAME - _ZN14GlxViewManager16handleUserActionEii @ 25 NONAME - _ZN14GlxViewManager16removeConnectionEv @ 26 NONAME - _ZN14GlxViewManager16staticMetaObjectE @ 27 NONAME DATA 16 - _ZN14GlxViewManager17getSelectionModelEi @ 28 NONAME - _ZN14GlxViewManager17launchApplicationEiP18QAbstractItemModel @ 29 NONAME - _ZN14GlxViewManager17updateToolBarIconEi @ 30 NONAME - _ZN14GlxViewManager18hideProgressDialogEv @ 31 NONAME - _ZN14GlxViewManager19getStaticMetaObjectEv @ 32 NONAME - _ZN14GlxViewManager20addBackSoftKeyActionEv @ 33 NONAME - _ZN14GlxViewManager20launchProgressDialogEi @ 34 NONAME - _ZN14GlxViewManager20updateProgressDialogEi @ 35 NONAME - _ZN14GlxViewManager21deactivateCurrentViewEv @ 36 NONAME - _ZN14GlxViewManager23setMarkingToolBarActionEi @ 37 NONAME - _ZN14GlxViewManager24createMarkingModeActionsEv @ 38 NONAME - _ZN14GlxViewManager24createMarkingModeToolBarEv @ 39 NONAME - _ZN14GlxViewManager25itemSpecificMenuTriggeredEi7QPointF @ 40 NONAME - _ZN14GlxViewManager8findViewEi @ 41 NONAME - _ZN14GlxViewManager8setModelEP18QAbstractItemModel @ 42 NONAME - _ZN14GlxViewManagerC1Ev @ 43 NONAME - _ZN14GlxViewManagerC2Ev @ 44 NONAME - _ZN14GlxViewManagerD0Ev @ 45 NONAME - _ZN14GlxViewManagerD1Ev @ 46 NONAME - _ZN14GlxViewManagerD2Ev @ 47 NONAME - _ZNK14GlxViewManager10metaObjectEv @ 48 NONAME - _ZNK14GlxViewManager11orientationEv @ 49 NONAME - _ZTI14GlxViewManager @ 50 NONAME - _ZTV14GlxViewManager @ 51 NONAME + _ZN14GlxViewManager11checkMarkedEv @ 4 NONAME + _ZN14GlxViewManager11destroyViewEi @ 5 NONAME + _ZN14GlxViewManager11getSubStateEv @ 6 NONAME + _ZN14GlxViewManager11qt_metacallEN11QMetaObject4CallEiPPv @ 7 NONAME + _ZN14GlxViewManager11qt_metacastEPKc @ 8 NONAME + _ZN14GlxViewManager11resolveViewEi @ 9 NONAME + _ZN14GlxViewManager12activateViewEv @ 10 NONAME + _ZN14GlxViewManager12handleActionEv @ 11 NONAME + _ZN14GlxViewManager13actionProcessEi @ 12 NONAME + _ZN14GlxViewManager13addConnectionEv @ 13 NONAME + _ZN14GlxViewManager13createActionsEv @ 14 NONAME + _ZN14GlxViewManager13createToolBarEv @ 15 NONAME + _ZN14GlxViewManager14deActivateViewEv @ 16 NONAME + _ZN14GlxViewManager14effectFinishedEv @ 17 NONAME + _ZN14GlxViewManager15actionTriggeredEi @ 18 NONAME + _ZN14GlxViewManager15exitMarkingModeEi @ 19 NONAME + _ZN14GlxViewManager15handleReadyViewEv @ 20 NONAME + _ZN14GlxViewManager16enterMarkingModeEii @ 21 NONAME + _ZN14GlxViewManager16handleUserActionEii @ 22 NONAME + _ZN14GlxViewManager16removeConnectionEv @ 23 NONAME + _ZN14GlxViewManager16staticMetaObjectE @ 24 NONAME DATA 16 + _ZN14GlxViewManager17getSelectionModelEi @ 25 NONAME + _ZN14GlxViewManager17launchApplicationEiP18QAbstractItemModel @ 26 NONAME + _ZN14GlxViewManager17updateToolBarIconEi @ 27 NONAME + _ZN14GlxViewManager18hideProgressDialogEv @ 28 NONAME + _ZN14GlxViewManager19getStaticMetaObjectEv @ 29 NONAME + _ZN14GlxViewManager20addBackSoftKeyActionEv @ 30 NONAME + _ZN14GlxViewManager20launchProgressDialogEi @ 31 NONAME + _ZN14GlxViewManager20updateProgressDialogEi @ 32 NONAME + _ZN14GlxViewManager21deactivateCurrentViewEv @ 33 NONAME + _ZN14GlxViewManager23setMarkingToolBarActionEi @ 34 NONAME + _ZN14GlxViewManager24createMarkingModeActionsEv @ 35 NONAME + _ZN14GlxViewManager24createMarkingModeToolBarEv @ 36 NONAME + _ZN14GlxViewManager25itemSpecificMenuTriggeredEi7QPointF @ 37 NONAME + _ZN14GlxViewManager26cancelViewTransitionEffectEv @ 38 NONAME + _ZN14GlxViewManager8findViewEi @ 39 NONAME + _ZN14GlxViewManager8setModelEP18QAbstractItemModel @ 40 NONAME + _ZN14GlxViewManagerC1Ev @ 41 NONAME + _ZN14GlxViewManagerC2Ev @ 42 NONAME + _ZN14GlxViewManagerD0Ev @ 43 NONAME + _ZN14GlxViewManagerD1Ev @ 44 NONAME + _ZN14GlxViewManagerD2Ev @ 45 NONAME + _ZNK14GlxViewManager10metaObjectEv @ 46 NONAME + _ZNK14GlxViewManager11orientationEv @ 47 NONAME + _ZTI14GlxViewManager @ 48 NONAME + _ZTV14GlxViewManager @ 49 NONAME + _ZN14GlxViewManager24updateToolBarActionStateEib @ 50 NONAME diff -r 27f2d7aec52a -r 0a8e959402e5 ui/viewmanagement/statehandler/src/glxstatemanager.cpp --- a/ui/viewmanagement/statehandler/src/glxstatemanager.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/viewmanagement/statehandler/src/glxstatemanager.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -131,11 +131,11 @@ void GlxStateManager::launchFetcher(int fetcherFilterType) { qDebug("GlxStateManager::launchFetcher"); - mCurrentState = createState(GLX_GRIDVIEW_ID); - mCurrentState->setState(FETCHER_ITEM_S); - mFetcherFilterType = (GlxFetcherFilterType)fetcherFilterType; - createModel(GLX_GRIDVIEW_ID); - mViewManager->launchApplication( GLX_GRIDVIEW_ID, mCurrentModel); + mCurrentState = createState( GLX_GRIDVIEW_ID ); + mCurrentState->setState( FETCHER_ITEM_S ); + mFetcherFilterType = ( GlxFetcherFilterType )fetcherFilterType; + createModel( GLX_GRIDVIEW_ID ); + mViewManager->launchApplication( GLX_GRIDVIEW_ID, mCurrentModel ); } void GlxStateManager::launchApplication() @@ -146,7 +146,6 @@ if( mActivation->reason() == Af::ActivationReasonActivity ) { activitySuccess = launchActivity(); - qDebug("GlxStateManager::launchApplication as Activity"); } if( !activitySuccess ) { @@ -154,7 +153,7 @@ mCurrentState->setState( ALL_ITEM_S ); int leftCount = mTNObserver->getTNLeftCount() ; - if ( leftCount > 0 ) { + if ( leftCount > 0 || leftCount == KErrNotReady ) { mViewManager->launchApplication( GLX_GRIDVIEW_ID, mCurrentModel ); launchProgressDialog(); } @@ -163,14 +162,9 @@ mViewManager->launchApplication( GLX_GRIDVIEW_ID, mCurrentModel ); } mTNObserver->startTNObserving() ; - } - + } - bool ok = mActivityStorage->removeActivity("PhotosMainView"); - if ( !ok ) - { - qDebug("launchapplication::Remove activity failed" ); - } + mActivityStorage->removeActivity( "PhotosMainView" ); } bool GlxStateManager::launchActivity() @@ -199,22 +193,15 @@ } bool GlxStateManager::validateActivityData() -{ - - if( (mSaveActivity.value("ID") == GLX_GRIDVIEW_ID) || - ( (mSaveActivity.value("ID") == GLX_LISTVIEW_ID) && (mSaveActivity.value("InternalState") == ALL_ITEM_S) ) || - (mSaveActivity.value("VisibleIndex") >= 0 ) ) { - qDebug("GlxStateManager::validation passed"); +{ + if( ( mSaveActivity.value("ID") == GLX_GRIDVIEW_ID ) || + ( ( mSaveActivity.value("ID") == GLX_LISTVIEW_ID ) && ( mSaveActivity.value("InternalState") == ALL_ITEM_S ) ) || + ( mSaveActivity.value("VisibleIndex") >= 0 ) ) { return true; } qDebug("GlxStateManager::Validation failed"); - qDebug("VIEW : %u", mSaveActivity.value("ID")); - qDebug("SUB STATE: %u", mSaveActivity.value("InternalState")); - qDebug("Visible Index: %u", mSaveActivity.value("VisibleIndex")); - - return false; - + return false; } @@ -243,16 +230,20 @@ { qDebug("GlxStateManager::setupItems()"); mActionHandler = new GlxActionHandler(); - connect ( mViewManager, SIGNAL(externalCommand(int )), this, SIGNAL(externalCommand(int )) ); mViewManager->setupItems(); - switch( mSaveActivity.value( "ID" ) ){ + + switch( mCurrentState->id() ){ case GLX_LISTVIEW_ID: - mViewManager->updateToolBarIcon(GLX_ALBUM_ACTION_ID); + mViewManager->updateToolBarIcon( GLX_ALBUM_ACTION_ID ); break; case GLX_GRIDVIEW_ID: + mViewManager->updateToolBarIcon( GLX_ALL_ACTION_ID ); + break; + default: - mViewManager->updateToolBarIcon(GLX_ALL_ACTION_ID); + mViewManager->updateToolBarIcon( GLX_ALL_ACTION_ID ); + break; } } @@ -263,9 +254,10 @@ // in the case of rename of an image or capture the single item // it is also launching the progress bar, to avoid this scenario add the check of count more than 5 if ( mCurrentModel && ( count > 5 ) ) { - goBack( GLX_GRIDVIEW_ID, ALL_ITEM_S ) ; - cleanAllModel(); - launchProgressDialog(); + mViewManager->cancelViewTransitionEffect(); + goBack( GLX_GRIDVIEW_ID, ALL_ITEM_S ) ; + cleanAllModel(); + launchProgressDialog(); } if ( isProgressbarRunning ){ @@ -318,33 +310,38 @@ } } -void GlxStateManager::nextState(qint32 state, int internalState) +void GlxStateManager::nextState( qint32 state, int internalState ) { qDebug("GlxStateManager::nextState next state = %u", state); + //no view transition is aloo during the progress dialog display + if( isProgressbarRunning ) { + return ; + } + GlxEffect effect = NO_EFFECT ; GlxViewEffect viewEffect = NO_VIEW ; - PERFORMANCE ( d1, State Creation Time ) { - mCurrentState = createState(state); //create a new state - mCurrentState->setState(internalState); + mCurrentState = createState( state ); //create a new state + mCurrentState->setState( internalState ); + createModel( state ); //model should created after the internal state was set. + + mCurrentState->setTranstionParameter( FORWARD_DIR, effect, viewEffect ); // to run the transtion effect + if ( viewEffect == NO_VIEW ) { + mViewManager->launchView( state, mCurrentModel ); } - - createModel(state); //model should created after the internal state was set. - - PERFORMANCE ( d2, view launch time ) { - mCurrentState->setTranstionParameter( FORWARD_DIR, effect, viewEffect); // to run the transtion effect - if ( viewEffect == NO_VIEW ) { - mViewManager->launchView( state, mCurrentModel ); - } - else { - mViewManager->launchView( state, mCurrentModel, effect, viewEffect); - } + else { + mViewManager->launchView( state, mCurrentModel, effect, viewEffect ); } } void GlxStateManager::previousState() { qDebug("GlxStateManager::previousState"); + //no view transition is aloo during the progress dialog display + if( isProgressbarRunning ) { + return ; + } + GlxEffect effect = NO_EFFECT ; GlxViewEffect viewEffect = NO_VIEW ; @@ -401,7 +398,11 @@ void GlxStateManager::goBack(qint32 stateId, int internalState) { qDebug("GlxStateManager::goBack()"); - + //no view transition is aloo during the progress dialog display + if( isProgressbarRunning ) { + return ; + } + //if current state and it internal state is same then no need to do any thing if ( mCurrentState->id() == stateId && mCurrentState->state() == internalState ) { return ; @@ -433,7 +434,11 @@ void GlxStateManager::changeState(qint32 stateId, int internalState) { qDebug("GlxStateManager::changeState %d", stateId); - + //no view transition is aloo during the progress dialog display + if( isProgressbarRunning ) { + return ; + } + GlxState *state = mCurrentState; GlxEffect effect = NO_EFFECT ; GlxViewEffect viewEffect = NO_VIEW ; @@ -536,6 +541,7 @@ case GLX_SLIDESHOWVIEW_ID : return new GlxSlideShowState( this, mCurrentState ); + case GLX_SLIDESHOWSETTINGSVIEW_ID : return new GlxSlideShowSettingsState(this, mCurrentState ); @@ -765,14 +771,16 @@ case EGlxCmdCameraOpen: { - QProcess::startDetached(QString("cxui.exe")); + QProcess::startDetached( QString( "cxui.exe" ) ); + mViewManager->updateToolBarActionState( GLX_CAMERA_ACTION_ID, false ); id = EGlxCmdHandled; } break; case EGlxCmdOviOpen: { - HbNotificationDialog::launchDialog("Not Implemented"); + HbNotificationDialog::launchDialog( "Not Implemented" ); + mViewManager->updateToolBarActionState( GLX_OVI_ACTION_ID, false ); id = EGlxCmdHandled; } break; @@ -824,7 +832,6 @@ qDebug("GlxStateManager::~GlxStateManager delete Model"); disconnect ( mViewManager, SIGNAL(actionTriggered(qint32 )), this, SLOT(actionTriggered(qint32 )) ); - disconnect ( mViewManager, SIGNAL(externalCommand(int )), this, SIGNAL(externalCommand(int )) ); disconnect ( mTNObserver, SIGNAL( leftTNCount( int ) ), this, SLOT( updateTNProgress( int ) ) ); disconnect ( this, SIGNAL( setupItemsSignal() ), this, SLOT( setupItems() ) ); disconnect ( qobject_cast(qApp), SIGNAL (aboutToQuit()), this, SLOT(saveData())); diff -r 27f2d7aec52a -r 0a8e959402e5 ui/viewmanagement/viewmanager/inc/glxviewmanager.h --- a/ui/viewmanagement/viewmanager/inc/glxviewmanager.h Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/viewmanagement/viewmanager/inc/glxviewmanager.h Thu Oct 14 17:54:23 2010 +0530 @@ -67,141 +67,189 @@ * Constructor */ GlxViewManager(); + /** * Destructor */ ~GlxViewManager(); + /** + * setupItems() - For initial setup of application after view is ready for drawing + */ void setupItems( ); /** - * launch application + * launchApplication() - Api to launch the photos application * @param id viewId * @param model model to be used for the view */ void launchApplication( qint32 id, QAbstractItemModel *model ); /** - * add back key action + * addBackSoftKeyAction() - add back key action */ void addBackSoftKeyAction(); /** - * This will return the orientation of main window + * orientation() - This will return the current orientation of device */ Qt::Orientation orientation() const; + + /** + * This function is used to launch the view + * @param view id + * @param pointer of data model + */ + void launchView ( qint32 id, QAbstractItemModel *model ); /** - * This will deactivate the current function + * It is over load slot and used to run the animation for view transition and launch the view + * @param view id + * @param pointer of data model + * @param + * @param View transtion id + * @param to play the animation on which views + */ + void launchView ( qint32 id, QAbstractItemModel *model, GlxEffect effect, GlxViewEffect viewEffect ); + + /** + * launchProgressDialog() - To launch the refreshing media progress dialog + * @param - number of item left to populate + */ + void launchProgressDialog( int maxValue ); + + /** + * updateProgressDialog() - To update the refreshing media progress dialog value + * @param - number of item left to populate + */ + void updateProgressDialog( int currentValue ); + + /** + * deactivateCurrentView() - This will deactivate the current function * to be used only in cases where External launch was done */ void deactivateCurrentView(); /** - * To update the tool bar enable and disable icon - * id = This should be selected toolbar tab id + * updateToolBarIcon() -To update the tool bar enable and disable icon + * @parma This should be selected toolbar tab id */ void updateToolBarIcon( int id ); + + /** + * updateToolBarActionState() - To update the tool bar action check state + * @param This should be selected toolbar tab id + * @param action check state + */ + void updateToolBarActionState( int id, bool isChecked ); /** - * Enable the marking mode of the view to select multiple item + * enterMarkingMode() - Enable the marking mode of the view to select multiple item + * @param view id + * @parma command id */ void enterMarkingMode( qint32 viewId, qint32 commandId ); /** - * Enable the normal mode of the view + * exitMarkingMode() - Enable the normal mode of the view + * @param view id */ void exitMarkingMode( qint32 viewId ); /** - * Pass the user action to the view + * handleUserAction() - Pass the user action to the view to process action + * @param view id + * @parma user action id ( command id ) */ void handleUserAction( qint32 viewId, qint32 commandId ); /** - * Return the selection model to the user + * getSelectionModel() Return the selection model to the user + * @param - view id of the current view + * @return - selection model of the view */ QItemSelectionModel * getSelectionModel( qint32 viewId ); /** - * To set the model of current view + * setModel() - To set the model of current view + * @param model pointer */ void setModel( QAbstractItemModel *model ); + + /** + * cancelViewTransitionEffect() - To cancel the current runing view transition + */ + void cancelViewTransitionEffect(); signals : /** - * emit the user action + * actionTriggered() - emit the signal of user action for state manager + * @param action or command id */ void actionTriggered( qint32 id ); - void externalCommand( int cmdId ); public slots: - /** - * This public slot is used to launch the view - */ - void launchView ( qint32 id, QAbstractItemModel *model ); - + /** - * It is over load slot and used to run the animation for view transition and launch the view - */ - void launchView ( qint32 id, QAbstractItemModel *model, GlxEffect effect, GlxViewEffect viewEffect ); - - void launchProgressDialog( int maxValue ); - void updateProgressDialog( int currentValue ); - - /** - * It will removed and deleted the view. - * Currently It is not used so may be in future, It will be removed. + * destroyView() - It will removed and deleted the view form the view list. + * Currently It is not used so may be in future, It will be removed. + * @param - view id of view which is suppose to destroy */ void destroyView ( qint32 id ); /** - * It will pass the user action to the state manager + * actionProcess() - It will pass the user action to the state manager + * @param action id to process */ void actionProcess( qint32 id ); /** - * It will pass the user selected menu action to state manager - * check for depricated with actionProcess api + * handleAction() - It will pass the user action ( tool bar + back ) to state manager */ - void handleMenuAction( qint32 commandId ); + void handleAction(); /** - * It will pass the user action ( tool bar + back ) to state manager - */ - void handleAction(); - void cancelTimer(); - - /** - * This is slot used for the animation finished call back + * effectFinished() -This is slot used for the transition animation finished call back */ void effectFinished( ); /** - * This will open the item specifc Menu + * itemSpecificMenuTriggered() - This will open the item specifc Menu + * @parma - view id + * @param - postion of the context menu */ void itemSpecificMenuTriggered( qint32, QPointF ); void handleReadyView(); private slots: - + /** + * checkMarked() - cheche the some item is marked or no item is marked + */ void checkMarked(); + + /** + * hideProgressDialog() - put the application into background + */ void hideProgressDialog(); private: /** - * It will create and return the view + * resolveView() - It will create and return the view + * @parma - view id + * @return the object of desired view or create the view if it is not created and return */ GlxView * resolveView ( qint32 id ); /** - * It will find a view from the view list and return it + * findView() - It will find a view from the view list and return it + * @parma - view id + * @return the object of desired view or null */ GlxView * findView ( qint32 id ); /** - * It will deativate the current view + * deActivateView() - It will deativate the current view */ void deActivateView(); @@ -211,61 +259,64 @@ void activateView(); /** - * It will create the grid and list view tool bar action + * activateView() - It will create the grid and list view tool bar action */ void createActions(); /** - * It will create the marking mode toll bar action + * createMarkingModeActions() - It will create the marking mode toll bar action */ void createMarkingModeActions(); /** - * It will create the grid and list view tool bar + * createToolBar() - It will create the grid and list view tool bar */ void createToolBar(); /** - * It will create the marking mode tool bar + * createMarkingModeToolBar() - It will create the marking mode tool bar */ void createMarkingModeToolBar(); /** * setMarkingToolBarAction() - set the toolbar action text + * @parma command id */ void setMarkingToolBarAction( qint32 commandId ); /** - * It will add all the view manager related connection + * addConnection() - It will add all the view manager related connection */ void addConnection(); /** - * It will remove all the view manager releted connection + * removeConnection() - It will remove all the view manager releted connection */ void removeConnection(); /** - * + * getSubState() - return the substate of state */ int getSubState(); private: - QList mViewList; //It contains all the view created by it self. - HbMainWindow *mMainWindow; //main window pointer, It have ownership only if - HbAction *mBackAction; // For back soft key - GlxMenuManager *mMenuManager; //Pointer of menu manger to add the menu in the view - GlxEffectEngine *mEffectEngine; //To run the animation in between view transition - QList mActionList; //Tool bar action list - QList mMarkingActionList; //marking mode tool bar action list - HbToolBar *mViewToolBar; //view tool bar - HbToolBar *mMarkingToolBar; //marking mode tool bar - GlxView *mView; - QAbstractItemModel *mModel; //no ownership - QItemSelectionModel * mSelectionModel; - HbProgressDialog *mProgressDialog; - GlxMainWindowEventFilter* mWindowEventFilter; - + QList mViewList; //It contains all the view created by it self. + HbMainWindow *mMainWindow; //main window pointer, It have ownership only if + HbAction *mBackAction; // For back soft key + GlxMenuManager *mMenuManager; //Pointer of menu manger to add the menu in the view + GlxEffectEngine *mEffectEngine; //To run the animation in between view transition + QList mActionList; //Tool bar action list + QList mMarkingActionList; //marking mode tool bar action list + HbToolBar *mViewToolBar; //view tool bar + HbToolBar *mMarkingToolBar; //marking mode tool bar + GlxView *mView; + QAbstractItemModel *mModel; //no ownership + QItemSelectionModel *mSelectionModel; + HbProgressDialog *mProgressDialog; + GlxMainWindowEventFilter *mWindowEventFilter; + bool mIsViewTransitionRunning; + GlxEffect mEffect; + QList< QGraphicsItem * > mItemList; }; diff -r 27f2d7aec52a -r 0a8e959402e5 ui/viewmanagement/viewmanager/src/glxviewmanager.cpp --- a/ui/viewmanagement/viewmanager/src/glxviewmanager.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/viewmanagement/viewmanager/src/glxviewmanager.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -50,7 +50,9 @@ mViewToolBar( NULL ), mMarkingToolBar( NULL ), mSelectionModel ( NULL ), - mProgressDialog( NULL ) + mProgressDialog( NULL ), + mIsViewTransitionRunning( false ), + mEffect( NO_EFFECT ) { qDebug("GlxViewManager::GlxViewManager() "); @@ -59,21 +61,46 @@ if(mMainWindow == NULL) { mMainWindow = new HbMainWindow(); } - connect(mMainWindow, SIGNAL( viewReady() ), this, SLOT( handleReadyView() )); + connect( mMainWindow, SIGNAL( viewReady() ), this, + SLOT( handleReadyView() ) ); + //Without this Zoom Does not work - mWindowEventFilter = new GlxMainWindowEventFilter; - mMainWindow->scene()->installEventFilter(mWindowEventFilter); - mMainWindow->viewport()->setAttribute(Qt::WA_AcceptTouchEvents); - mMainWindow->viewport()->grabGesture(Qt::PinchGesture); + mMainWindow->scene()->installEventFilter( mWindowEventFilter ); + mMainWindow->viewport()->setAttribute( Qt::WA_AcceptTouchEvents ); + mMainWindow->viewport()->grabGesture( Qt::PinchGesture ); - HbStyleLoader::registerFilePath(":/data/photos.css"); + HbStyleLoader::registerFilePath( ":/data/photos.css" ); } -void GlxViewManager::handleReadyView() +GlxViewManager::~GlxViewManager() { - emit actionTriggered( EGlxCmdSetupItem ); - disconnect( mMainWindow, SIGNAL( viewReady() ), this, SLOT( handleReadyView() ) ); + qDebug("GlxViewManager::~GlxViewManager"); + HbStyleLoader::unregisterFilePath(":/data/photos.css"); + removeConnection(); + + delete mMenuManager; + delete mViewToolBar; + delete mMarkingToolBar; + + while( mViewList.isEmpty( ) == FALSE){ + delete mViewList.takeLast() ; + } + + delete mBackAction; + delete mProgressDialog; + + if ( mEffectEngine ) { + mEffectEngine->deregistertransitionEffect(); + delete mEffectEngine; + } + + if( mMainWindow != GlxExternalUtility::instance()->getMainWindow() ){ + delete mMainWindow; + } + delete mWindowEventFilter; + + qDebug("GlxViewManager::~GlxViewManager Exit"); } void GlxViewManager::setupItems( ) @@ -108,11 +135,6 @@ mMainWindow->showFullScreen(); } -void GlxViewManager::handleMenuAction(qint32 commandId) -{ - emit actionTriggered(commandId); -} - void GlxViewManager::handleAction() { HbAction *action = qobject_cast(sender()); @@ -152,19 +174,19 @@ //In the case of no animation is play during the view transition just call launch view and return if ( viewEffect == NO_VIEW ) { - return launchView(id, model); + return launchView( id, model ); } //create and registered the effect if ( mEffectEngine == NULL ) { mEffectEngine = new GlxEffectEngine(); mEffectEngine->registerTransitionEffect(); - connect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinished() ), Qt::QueuedConnection ); + connect( mEffectEngine, SIGNAL( effectFinished() ), this, + SLOT( effectFinished() ), Qt::QueuedConnection ); } - QList< QGraphicsItem * > itemList; QGraphicsItem *item = NULL; - itemList.clear(); + mItemList.clear(); //partially clean the view so that animation run smoothly GlxView *curr_view = (GlxView *) mMainWindow->currentView(); @@ -177,21 +199,21 @@ mModel = model; if ( viewEffect == CURRENT_VIEW || viewEffect == BOTH_VIEW ) { - item = curr_view->getAnimationItem(effect); + item = curr_view->getAnimationItem( effect ); if ( item ) { - itemList.append(item); + mItemList.append(item); item = NULL; } } if ( viewEffect == LAUNCH_VIEW || viewEffect == BOTH_VIEW ) { - item = mView->getAnimationItem(effect); + item = mView->getAnimationItem( effect ); if ( item ) { //increase the z value and show the view to shown the view animation - mView->setZValue(curr_view->zValue() + 2); + mView->setZValue( curr_view->zValue() + 2 ); mView->show(); item->show(); - itemList.append(item); + mItemList.append( item ); } } @@ -200,9 +222,11 @@ } //error check - if ( itemList.count() > 0 ) { - mEffectEngine->runEffect(itemList, effect); + if ( mItemList.count() > 0 ) { + mEffectEngine->runEffect( mItemList, effect ); mMainWindow->grabMouse(); + mIsViewTransitionRunning = true; + mEffect = effect; } else { deActivateView(); @@ -221,7 +245,8 @@ if ( mProgressDialog == NULL ) { mProgressDialog = new HbProgressDialog( HbProgressDialog::ProgressDialog ); mProgressDialog->actions().at(0)->disconnect( SIGNAL( triggered() ) ); - connect ( mProgressDialog->actions().at(0), SIGNAL( triggered() ), this, SLOT( hideProgressDialog() ) ); + connect ( mProgressDialog->actions().at(0), SIGNAL( triggered() ), + this, SLOT( hideProgressDialog() ) ); mProgressDialog->setMinimum( 0 ); } mProgressDialog->setMaximum( maxValue ); @@ -300,6 +325,21 @@ } } +void GlxViewManager::updateToolBarActionState( int id, bool isChecked ) +{ + int toolBarActionId = (int) GLX_ALL_ACTION_ID; + int count = mActionList.count(); + + for ( int i = 0; i < count ; i++ ) { + //check and get the icon path + if ( ( id & toolBarActionId ) == toolBarActionId ) { + mActionList[i]->setChecked( isChecked ); + } + //to get it the next action id to verify it is selecter or not + toolBarActionId = toolBarActionId << 1; + } +} + void GlxViewManager::checkMarked() { qDebug("GlxViewManager::checkMarked"); @@ -327,31 +367,31 @@ if ( view ) { view->enableMarking(); view->takeToolBar(); - view->addToolBar(mMarkingToolBar); + view->addToolBar( mMarkingToolBar ); mSelectionModel = view->getSelectionModel(); - if(mSelectionModel) - { - connect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection& ) ), this, SLOT(checkMarked())); + if( mSelectionModel ) { + connect(mSelectionModel, SIGNAL( selectionChanged + ( const QItemSelection &, const QItemSelection& ) ), + this, SLOT( checkMarked() ) ); checkMarked(); } } - qDebug("GlxViewManager::enterMarkingMode view ID %d exit", viewId); } void GlxViewManager::exitMarkingMode( qint32 viewId ) { GlxView *view = findView ( viewId ); - qDebug("GlxViewManager::exitMarkingMode view ID %d", viewId); + qDebug( "GlxViewManager::exitMarkingMode view ID %d", viewId ); if ( view ) { view->disableMarking(); view->takeToolBar(); - view->addToolBar(mViewToolBar); - if(mSelectionModel) - { - disconnect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection& ) ), this, SLOT(checkMarked())); + view->addToolBar( mViewToolBar ); + if( mSelectionModel ) { + disconnect( mSelectionModel, SIGNAL( selectionChanged + ( const QItemSelection &, const QItemSelection& ) ), + this, SLOT( checkMarked() ) ); } } - qDebug("GlxViewManager::exitMarkingMode view ID %d exit", viewId); } void GlxViewManager::handleUserAction(qint32 viewId, qint32 commandId) @@ -383,6 +423,14 @@ } } +void GlxViewManager::cancelViewTransitionEffect() +{ + if( mIsViewTransitionRunning ) { + mEffectEngine->cancelEffect( mItemList, mEffect ); + effectFinished(); + } +} + GlxView * GlxViewManager::resolveView( qint32 id ) { qDebug("GlxViewManager::resolveView %d", id ); @@ -411,17 +459,23 @@ mMenuManager->ShowItemSpecificMenu(viewId,pos); } -void GlxViewManager::cancelTimer() +void GlxViewManager::handleReadyView() { - emit externalCommand(EGlxPluginCmdUserActivity); + emit actionTriggered( EGlxCmdSetupItem ); + disconnect( mMainWindow, SIGNAL( viewReady() ), this, + SLOT( handleReadyView() ) ); } void GlxViewManager::effectFinished( ) { qDebug("GlxViewManager::EffectFinished"); - mMainWindow->releaseMouse(); - deActivateView(); - activateView(); + if ( mIsViewTransitionRunning ) { + mMainWindow->releaseMouse(); + deActivateView(); + activateView(); + mIsViewTransitionRunning = false; + mItemList.clear(); + } } GlxView * GlxViewManager::findView(qint32 id) @@ -626,13 +680,17 @@ void GlxViewManager::addConnection() { - if ( mMenuManager ) - connect(mMenuManager, SIGNAL( commandTriggered(qint32 ) ), this, SLOT( handleMenuAction(qint32 ) )); - if ( mBackAction ) + if ( mMenuManager ) { + connect( mMenuManager, SIGNAL( commandTriggered(qint32 ) ), + this, SLOT( actionProcess(qint32 ) )); + } + if ( mBackAction ) { connect(mBackAction, SIGNAL( triggered() ), this, SLOT( handleAction() )); + } if ( mEffectEngine ) { - connect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinished() ), Qt::QueuedConnection ); + connect( mEffectEngine, SIGNAL( effectFinished() ), this, + SLOT( effectFinished() ), Qt::QueuedConnection ); } } @@ -655,8 +713,10 @@ mMenuManager->removeMenu( mViewList.at(i)->viewId(), mViewList.at(i)->menu() ) ; } - if ( mMenuManager ) - disconnect(mMenuManager, SIGNAL( commandTriggered(qint32 ) ), this, SLOT( handleMenuAction(qint32 ) )); + if ( mMenuManager ) { + disconnect( mMenuManager, SIGNAL( commandTriggered( qint32 ) ), + this, SLOT( actionProcess( qint32 ) ) ); + } if ( mBackAction ) disconnect(mBackAction, SIGNAL( triggered() ), this, SLOT( handleAction() )); @@ -680,41 +740,6 @@ emit actionTriggered(id); } -GlxViewManager::~GlxViewManager() -{ - qDebug("GlxViewManager::~GlxViewManager"); - HbStyleLoader::unregisterFilePath(":/data/photos.css"); - - removeConnection(); - - delete mMenuManager; - qDebug("GlxViewManager::~GlxViewManager deleted menu manager"); - delete mViewToolBar; - delete mMarkingToolBar; - qDebug("GlxViewManager::~GlxViewManager deleted toolbar"); - - while( mViewList.isEmpty( ) == FALSE){ - delete mViewList.takeLast() ; - } - qDebug("GlxViewManager::~GlxViewManager view deleted"); - - delete mBackAction; - delete mProgressDialog; - - if ( mEffectEngine ) { - mEffectEngine->deregistertransitionEffect(); - delete mEffectEngine; - } - - if( mMainWindow != GlxExternalUtility::instance()->getMainWindow() ){ - qDebug("GlxViewManager::~GlxViewManager delete mainwindow"); - delete mMainWindow; - } - delete mWindowEventFilter; - - qDebug("GlxViewManager::~GlxViewManager Exit"); -} - int GlxViewManager::getSubState() { int curSubstate = NO_GRID_S; diff -r 27f2d7aec52a -r 0a8e959402e5 ui/views/detailsview/src/glxdetailsview.cpp --- a/ui/views/detailsview/src/glxdetailsview.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/views/detailsview/src/glxdetailsview.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -50,10 +50,20 @@ //-------------------------------------------------------------------------------------------------------------------------------------------- //GlxDetailsView //-------------------------------------------------------------------------------------------------------------------------------------------- -GlxDetailsView::GlxDetailsView(HbMainWindow *window) : - GlxView(GLX_DETAILSVIEW_ID), mImageBackGround(NULL), mDetailsIcon(NULL), mView(NULL), mFavIcon( - NULL), mModel(NULL), mFavModel(NULL), mWindow(window), mSelIndex(0), mDocLoader(NULL), - mListView(NULL), mListModel(NULL), mShareButton(NULL) +GlxDetailsView::GlxDetailsView(HbMainWindow *window) + : GlxView( GLX_DETAILSVIEW_ID ), + mImageBackGround( NULL ), + mDetailsIcon(NULL), + mView(NULL), + mFavIcon( NULL), + mModel( NULL ), + mFavModel( NULL ), + mWindow( window ), + mSelIndex( 0 ), + mDocLoader( NULL ), + mListView( NULL ), + mListModel( NULL ), + mShareButton( NULL ) { GLX_LOG_INFO("GlxDetailsView::GlxDetailsView"); OstTraceFunctionEntry0( GLXDETAILSVIEW_GLXDETAILSVIEW_ENTRY ); @@ -201,6 +211,10 @@ { GLX_LOG_INFO("GlxDetailsView::deActivate"); OstTraceFunctionEntry0( GLXDETAILSVIEW_DEACTIVATE_ENTRY ); + + if ( mFavModel ){ + resetView(); + } mImageBackGround->hide(); mDetailsIcon->hide(); @@ -320,7 +334,6 @@ //-------------------------------------------------------------------------------------------------------------------------------------------- void GlxDetailsView::setConnections() { - connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(updateLayout(Qt::Orientation))); @@ -351,19 +364,12 @@ disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(updateLayout(Qt::Orientation))); - - if (mModel && getSubState() != IMAGEVIEWER_DETAIL_S) { - - disconnect((mListView->itemPrototypes()).at(0), SIGNAL(signalFromCustomWidget(int)), this, + disconnect((mListView->itemPrototypes()).at(0), SIGNAL(signalFromCustomWidget(int)), this, SLOT(triggerTheCommand(int))); - - disconnect(mShareButton, SIGNAL(released()), this, SLOT(launchShareDialog())); - - disconnect(mFavIcon, SIGNAL(updateFavourites()), this, SLOT(updateFavourites())); - - disconnect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, + disconnect(mShareButton, SIGNAL(released()), this, SLOT(launchShareDialog())); + disconnect(mFavIcon, SIGNAL(updateFavourites()), this, SLOT(updateFavourites())); + disconnect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) )); - } } //-------------------------------------------------------------------------------------------------------------------------------------------- @@ -433,6 +439,8 @@ //-------------------------------------------------------------------------------------------------------------------------------------------- void GlxDetailsView::modelDestroyed() { + delete mListModel; + mListModel = NULL; mModel = NULL; } diff -r 27f2d7aec52a -r 0a8e959402e5 ui/views/gridview/inc/glxgridview.h --- a/ui/views/gridview/inc/glxgridview.h Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/views/gridview/inc/glxgridview.h Thu Oct 14 17:54:23 2010 +0530 @@ -122,12 +122,12 @@ HbPushButton *mUiOnButton; bool mScrolling; HbIconItem *mIconItem; + HbIconItem *mBackGroundItem; HbCheckBox *mMarkCheckBox; // Mark All checkbox - HbGroupBox *mTotalImagesCount; // Item count of the grid + HbGroupBox *mTotalImagesCountGrpBox; // Item count of the grid HbGroupBox *mMarkSelectHeading; HbLabel *mMarkCountLabel; // Marked item count HbLabel *mZeroItemLabel; // zero itemcount - HbGroupBox *mAlbumNameHeading; QGraphicsLinearLayout *mMarkContainer; GlxSettingInterface *mSettings; HbWidget *mMarkingWidget; diff -r 27f2d7aec52a -r 0a8e959402e5 ui/views/gridview/src/glxgridview.cpp --- a/ui/views/gridview/src/glxgridview.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/views/gridview/src/glxgridview.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -50,24 +50,24 @@ #include "glxgridviewTraces.h" #endif -GlxGridView::GlxGridView(HbMainWindow *window) +GlxGridView::GlxGridView( HbMainWindow *window ) : GlxView ( GLX_GRIDVIEW_ID ), - mWindow(window), - mModel ( NULL), - mWidget(NULL), - mSelectionModel(NULL), - mModelWrapper(NULL), - mUiOnButton(NULL), - mScrolling(FALSE), - mIconItem(NULL), - mMarkCheckBox(NULL), - mTotalImagesCount(NULL), - mMarkSelectHeading(NULL), - mMarkCountLabel(NULL), - mZeroItemLabel(NULL), - mAlbumNameHeading(NULL), - mMarkContainer(NULL), - mMarkingWidget(NULL), + mWindow( window ), + mModel ( NULL ), + mWidget( NULL ), + mSelectionModel( NULL ), + mModelWrapper( NULL ), + mUiOnButton( NULL ), + mScrolling( FALSE ), + mIconItem( NULL ), + mBackGroundItem( NULL ), + mMarkCheckBox( NULL ), + mTotalImagesCountGrpBox( NULL ), + mMarkSelectHeading( NULL ), + mMarkCountLabel( NULL ), + mZeroItemLabel( NULL ), + mMarkContainer( NULL ), + mMarkingWidget( NULL ), mToolBar( NULL ), mCurrentToolBar( NULL ) { @@ -92,12 +92,12 @@ OstTraceFunctionEntry0( GLXGRIDVIEW_ACTIVATE_ENTRY ); loadGridView(); connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationchanged(Qt::Orientation)),Qt::UniqueConnection); - if(mTotalImagesCount == NULL) { - mTotalImagesCount = new HbGroupBox(this); - mTotalImagesCount->setObjectName( "Count" ); - mTotalImagesCount->hide(); + if(mTotalImagesCountGrpBox == NULL) { + mTotalImagesCountGrpBox = new HbGroupBox(this); + mTotalImagesCountGrpBox->setObjectName( "Count" ); + mTotalImagesCountGrpBox->hide(); } - mWidget->resetTransform(); + resetTransform(); OstTraceFunctionExit0( GLXGRIDVIEW_ACTIVATE_EXIT ); } @@ -114,11 +114,8 @@ mIconItem->setOpacity(0); mIconItem->setZValue(mIconItem->zValue()-20); } - if (mTotalImagesCount) { - mTotalImagesCount->hide(); - } - if (mAlbumNameHeading) { - mAlbumNameHeading->hide(); + if (mTotalImagesCountGrpBox) { + mTotalImagesCountGrpBox->hide(); } if(mZeroItemLabel) { mZeroItemLabel->hide(); @@ -345,17 +342,13 @@ showAlbumTitle(GLX_SELECT_IMAGE); } else if ( getSubState() == ALL_ITEM_S || ( getSubState() == FETCHER_ITEM_S)) { - if (mAlbumNameHeading) { - mAlbumNameHeading->hide(); - } - - text = HbParameterLengthLimiter(GLX_GRID_VIEW_COUNT_LABEL, count); - mTotalImagesCount->setHeading ( text ); - mTotalImagesCount->setGeometry(QRectF(0,0,screenSize.width(),deviceSize.height()/24)); - mTotalImagesCount->show(); + text = HbParameterLengthLimiter(GLX_GRID_VIEW_COUNT_LABEL).arg(count); + mTotalImagesCountGrpBox->setHeading ( text ); + mTotalImagesCountGrpBox->setGeometry(QRectF(0,0,screenSize.width(),deviceSize.height()/24)); + mTotalImagesCountGrpBox->show(); } - else if ( getSubState() == ALBUM_ITEM_S || (getSubState() == FETCHER_ALBUM_ITEM_S)) { - mTotalImagesCount->hide(); + else if ( getSubState() == ALBUM_ITEM_S || (getSubState() == FETCHER_ALBUM_ITEM_S) ) { + mTotalImagesCountGrpBox->hide(); QVariant variant = mModel->data(mModel->index(0,0),GlxViewTitle); if (variant.toString() != NULL) { showAlbumTitle(variant.toString()); @@ -363,11 +356,8 @@ } } else { - if (mTotalImagesCount) { - mTotalImagesCount->hide(); - } - if (mAlbumNameHeading) { - mAlbumNameHeading->hide(); + if (mTotalImagesCountGrpBox) { + mTotalImagesCountGrpBox->hide(); } } @@ -380,19 +370,22 @@ populated = variant.value(); } if(populated) { - if (mTotalImagesCount) { - mTotalImagesCount->hide(); - } - if (mAlbumNameHeading) { - mAlbumNameHeading->hide(); - } - showNoImageString(); - - if (getSubState() == ALBUM_ITEM_S) { - QVariant variant = mModel->data(mModel->index(0,0),GlxViewTitle); - if (variant.toString() != NULL) { - showAlbumTitle(variant.toString()); + if(!(XQServiceUtil::isService() && + (0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch"))))) + { + if( getSubState() == ALL_ITEM_S || getSubState() == FETCHER_ITEM_S) { + QString text; + text = HbParameterLengthLimiter(GLX_GRID_VIEW_COUNT_LABEL).arg(count); + mTotalImagesCountGrpBox->setHeading ( text ); + mTotalImagesCountGrpBox->setGeometry(QRectF(0,0,screenSize.width(),deviceSize.height()/24)); + mTotalImagesCountGrpBox->show(); + } + else if (getSubState() == ALBUM_ITEM_S || getSubState() == FETCHER_ALBUM_ITEM_S) { + QVariant variant = mModel->data(mModel->index(0,0),GlxViewTitle); + if (variant.toString() != NULL) { + showAlbumTitle(variant.toString()); + } } } } @@ -406,27 +399,22 @@ QSize deviceSize = HbDeviceProfile::current().logicalSize(); QSize screenSize = ( mWindow->orientation() == Qt::Vertical ) ? QSize( deviceSize.width(), deviceSize.height() ) : QSize( deviceSize.height(), deviceSize.width() ) ; - if (mAlbumNameHeading == NULL) - { - mAlbumNameHeading = new HbGroupBox(this); - mAlbumNameHeading->setObjectName("Album Name"); - } - //If fetcher service set only title text - if ((XQServiceUtil::isService()) && isItemVisible(Hb::TitleBarItem)) + if ((XQServiceUtil::isService()) && isItemVisible(Hb::TitleBarItem) && + (0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch")))) { - mAlbumNameHeading->setHeading(aTitle); - mAlbumNameHeading->setGeometry(QRectF(0, 0, screenSize.width(),deviceSize.height() / 24)); - mAlbumNameHeading->show(); + mTotalImagesCountGrpBox->setHeading(aTitle); + mTotalImagesCountGrpBox->setGeometry(QRectF(0, 0, screenSize.width(),deviceSize.height() / 24)); + mTotalImagesCountGrpBox->show(); } else { //handle album tiltle and count display logic here if (isItemVisible(Hb::TitleBarItem)) { QString text = HbParameterLengthLimiter(GLX_ALBUM_NAME_COUNT_LABEL).arg(aTitle).arg(count); - mAlbumNameHeading->setHeading(text); - mAlbumNameHeading->setGeometry(QRectF(0, 0, screenSize.width(),deviceSize.height()/24)); - mAlbumNameHeading->show(); + mTotalImagesCountGrpBox->setHeading(text); + mTotalImagesCountGrpBox->setGeometry(QRectF(0, 0, screenSize.width(),deviceSize.height()/24)); + mTotalImagesCountGrpBox->show(); } } } @@ -530,7 +518,13 @@ int selIndex = -1; if ( transitionEffect == FULLSCREEN_TO_GRID || transitionEffect == FULLSCREEN_TO_GRID_PORTRAIT ) { - return mWidget; + if ( !mBackGroundItem ) { + mBackGroundItem = new HbIconItem(); + setBackgroundItem( mBackGroundItem ); + } + HbIcon icon = HbIcon( mWindow->backgroundImageName( mWindow->orientation() ) ); + mBackGroundItem->setIcon( icon ); + return this; } if ( transitionEffect == GRID_TO_FULLSCREEN ) { @@ -570,7 +564,7 @@ } if ( transitionEffect == GRID_TO_ALBUMLIST || transitionEffect == ALBUMLIST_TO_GRID ) { - return mWidget; + return this; } OstTraceFunctionExit0( GLXGRIDVIEW_GETANIMATIONITEM_EXIT ); return NULL; @@ -588,14 +582,12 @@ mWidget->setObjectName( "Media Wall" ); mWidget->setLongPressEnabled(true); mWidget->setScrollBarPolicy(HgWidget::ScrollBarAutoHide); - if(XQServiceUtil::isService()) - { + if(XQServiceUtil::isService()) { mWidget->setEffect3dEnabled(EFalse); - } - else - { + } + else { mWidget->setEffect3dEnabled(mSettings->mediaWall3DEffect()); - } + } setWidget( mWidget ); addViewConnection(); } @@ -637,11 +629,8 @@ if (mUiOnButton) { mUiOnButton->hide(); } - if (mTotalImagesCount) { - mTotalImagesCount->hide(); - } - if (mAlbumNameHeading) { - mAlbumNameHeading->hide(); + if (mTotalImagesCountGrpBox) { + mTotalImagesCountGrpBox->hide(); } QSize deviceSize = HbDeviceProfile::current().logicalSize(); @@ -732,11 +721,8 @@ { mUiOnButton->hide(); } - if (mTotalImagesCount) { - mTotalImagesCount->hide(); - } - if (mAlbumNameHeading) { - mAlbumNameHeading->hide(); + if (mTotalImagesCountGrpBox) { + mTotalImagesCountGrpBox->hide(); } } @@ -781,8 +767,7 @@ } delete mIconItem; - delete mTotalImagesCount; - delete mAlbumNameHeading; + delete mTotalImagesCountGrpBox; delete mMarkSelectHeading; delete mMarkCheckBox; delete mMarkCountLabel; diff -r 27f2d7aec52a -r 0a8e959402e5 ui/views/listview/inc/glxlistview.h --- a/ui/views/listview/inc/glxlistview.h Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/views/listview/inc/glxlistview.h Thu Oct 14 17:54:23 2010 +0530 @@ -46,6 +46,7 @@ void itemSelected(const QModelIndex & index); void populated(); void showAlbumCount(); + void modelDestroyed(); private slots: void indicateLongPress( HbAbstractViewItem *item, QPointF coords ); @@ -68,7 +69,6 @@ HbMainWindow *mWindow; //no ownership QAbstractItemModel *mModel ; HbDocumentLoader *mDocLoader; //Docml loader to load the widgets from docml - bool mIsLongPress; }; #endif /* GLXLISTVIEW_H */ diff -r 27f2d7aec52a -r 0a8e959402e5 ui/views/listview/src/glxlistview.cpp --- a/ui/views/listview/src/glxlistview.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/views/listview/src/glxlistview.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -38,12 +38,11 @@ GlxListView::GlxListView(HbMainWindow *window) : GlxView ( GLX_LISTVIEW_ID ), - mListView(NULL), - mView(NULL), - mAlbumCount(NULL), - mWindow(window), - mModel ( NULL), - mIsLongPress( false ) + mListView( NULL ), + mView( NULL ), + mAlbumCount( NULL ), + mWindow( window ), + mModel ( NULL) { qDebug("GlxListView::GlxListView()"); mDocLoader = new HbDocumentLoader(); @@ -53,7 +52,7 @@ { qDebug("GlxListView::activate() %d", mWindow->orientation() ); - if (mListView == NULL) { + if ( !mListView ) { createListView(); } } @@ -70,12 +69,14 @@ disconnect(mModel, SIGNAL(listPopulated()), this, SLOT( populated())); disconnect( mModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( showAlbumCount() ) ); disconnect( mModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( showAlbumCount() ) ); + disconnect( mModel, SIGNAL( destroyed() ), this, SLOT( modelDestroyed() ) ); } mModel = model ; mListView->setModel(mModel); connect(mModel, SIGNAL(listPopulated()), this, SLOT( populated())); connect( mModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( showAlbumCount() ) ); connect( mModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( showAlbumCount() ) ); + connect( mModel, SIGNAL( destroyed() ), this, SLOT( modelDestroyed() ) ); showAlbumCount(); } @@ -88,7 +89,7 @@ { Q_UNUSED( preView ) qDebug("GlxListView::initializeView()"); - if ( mListView == NULL ) { + if ( !mListView ) { createListView(); } setModel( model ); @@ -97,7 +98,7 @@ QGraphicsItem * GlxListView::getAnimationItem( GlxEffect transtionEffect ) { if ( transtionEffect == GRID_TO_ALBUMLIST || transtionEffect == ALBUMLIST_TO_GRID ) { - return mListView; + return this; } return NULL; @@ -106,16 +107,16 @@ void GlxListView::addViewConnection () { qDebug("GlxListView::addViewConnection()"); - connect(mListView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); - connect(mListView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); + connect( mListView, SIGNAL( activated( const QModelIndex & ) ), this, SLOT( itemSelected( const QModelIndex & ) ) ); + connect( mListView, SIGNAL( longPressed( HbAbstractViewItem*, QPointF ) ), this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); connect( mListView, SIGNAL( scrollingEnded() ), this, SLOT( setVisvalWindowIndex() ) ); } void GlxListView::removeViewConnection() { qDebug("GlxListView::removeViewConnection()"); - disconnect(mListView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); - disconnect(mListView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); + disconnect( mListView, SIGNAL( activated( const QModelIndex & ) ), this, SLOT( itemSelected( const QModelIndex & ) ) ); + disconnect( mListView, SIGNAL( longPressed( HbAbstractViewItem*, QPointF ) ), this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); disconnect( mListView, SIGNAL( scrollingEnded() ), this, SLOT( setVisvalWindowIndex() ) ); } @@ -171,29 +172,29 @@ { qDebug("GlxListView::~GlxListView()"); - if(widget()) { + if( widget() ) { qDebug("GlxListView::~GlxListView() takeWidget"); takeWidget(); } removeViewConnection(); - if(mAlbumCount) { + if( mAlbumCount ) { delete mAlbumCount ; mAlbumCount = NULL; } - if(mListView) { + if( mListView ) { delete mListView; mListView = NULL; } - if(mView) { + if( mView ) { delete mView ; mView = NULL; } - if(mDocLoader) { + if( mDocLoader ) { delete mDocLoader; mDocLoader = NULL; } @@ -210,13 +211,16 @@ //Scroll To the Visible Index as mentioned in the AM. mListView->scrollTo(mModel->index(visualIndex, 0), HbAbstractItemView::PositionAtTop ); } + +void GlxListView::modelDestroyed() +{ + mModel = NULL ; +} + void GlxListView::itemSelected(const QModelIndex & index) { qDebug("GlxListView::itemSelected() index = %d", index.row() ); - if ( mIsLongPress ) { - mIsLongPress = false ; - return ; - } + if ( mModel ) { mModel->setData( index, index.row(), GlxFocusIndexRole ); } @@ -242,13 +246,12 @@ if ( mModel ) { mModel->setData( item->modelIndex(), item->modelIndex().row(), GlxFocusIndexRole ); } - mIsLongPress = true; emit itemSpecificMenuTriggered(viewId(),coords); } void GlxListView::showAlbumCount() { int albumCnt = mModel->rowCount(); - QString text = HbParameterLengthLimiter(GLX_ALBUM_LIST_COUNT_LABEL, albumCnt); + QString text = HbParameterLengthLimiter(GLX_ALBUM_LIST_COUNT_LABEL).arg(albumCnt); mAlbumCount->setHeading(text); } diff -r 27f2d7aec52a -r 0a8e959402e5 ui/views/viewsfactory/src/glxviewsfactory.cpp --- a/ui/views/viewsfactory/src/glxviewsfactory.cpp Wed Oct 06 14:49:39 2010 +0530 +++ b/ui/views/viewsfactory/src/glxviewsfactory.cpp Thu Oct 14 17:54:23 2010 +0530 @@ -35,10 +35,18 @@ { switch ( viewId ) { case GLX_GRIDVIEW_ID : - return new GlxGridView(window); + { + GlxGridView *gridView = new GlxGridView( window ); + gridView->toolBar(); + return gridView; + } case GLX_LISTVIEW_ID : - return new GlxListView ( window ); + { + GlxListView *listView = new GlxListView ( window ); + listView->toolBar(); + return listView; + } case GLX_FULLSCREENVIEW_ID : {