--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Thu Jun 24 13:11:40 2010 +0100
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Fri Jun 25 19:19:22 2010 +0300
@@ -26,6 +26,7 @@
#include <HbStyleLoader>
#include <hsmenueventtransition.h>
+
#include "hstest_global.h"
#include "hsapplibrarystate.h"
#include "hsallappsstate.h"
@@ -36,6 +37,7 @@
#include "hsmenuview.h"
#include "hsmenumodetransition.h"
+
/*!
\class HsAppLibraryState
\ingroup group_hsmenustateplugin
@@ -120,13 +122,10 @@
setObjectName("homescreen.nokia.com/state/applibrarystate");
mAllAppsState = new HsAllAppsState(mMenuViewBuilder, mMenuMode, mMainWindow, this);
- connect(this, SIGNAL(entered()),mAllAppsState, SLOT(scrollToBeginning()));
mAllCollectionsState = new HsAllCollectionsState(mMenuViewBuilder, mMenuMode,
mMainWindow, this);
- connect(this, SIGNAL(entered()),
- mAllCollectionsState, SLOT(scrollToBeginning()));
-
+
QState *initialState = new QState(this);
setInitialState(initialState);
@@ -143,11 +142,17 @@
this);
connect(mCollectionState, SIGNAL(entered()),SLOT(clearToolbarLatch()));
-
- HsMenuEventTransition *eventTransition =
- new HsMenuEventTransition(HsMenuEvent::OpenCollection,
+
+ HsMenuEventTransition *openCollectionFromAppLibTransition =
+ new HsMenuEventTransition(HsMenuEvent::OpenCollectionFromAppLibrary,
this, mCollectionState);
- this->addTransition(eventTransition);
+ this->addTransition(openCollectionFromAppLibTransition);
+
+ //It is called from: HsDefaultRuntime::activityRequested(const QString &name)
+ HsMenuEventTransition *openCollectionAfterActivityRequest =
+ new HsMenuEventTransition(HsMenuEvent::OpenCollection,
+ this, mCollectionState);
+ this->addTransition(openCollectionAfterActivityRequest);
HsMenuEventTransition *collectionDeletedTransition =
new HsMenuEventTransition(HsMenuEvent::CollectionDeleted,
@@ -190,7 +195,7 @@
connect(mAllCollectionsState, SIGNAL(entered()),
this, SLOT(allCollectionsStateEntered()));
-
+
HSMENUTEST_FUNC_EXIT("HsAppLibraryState::construct");
}
@@ -204,11 +209,20 @@
HSMENUTEST_FUNC_ENTRY("HsAppLibraryState::onEntry");
QState::onEntry(event);
+ if (static_cast<HsMenuEvent *>(event)->operation() !=
+ HsMenuEvent::OpenCollectionFromAppLibrary)
+ {
+ // we are back from HS, scroll those views to top
+ mAllAppsState->scrollToBeginning();
+ mAllCollectionsState->scrollToBeginning();
+ }
+
if (event->type() == HsMenuEvent::eventType()) {
HsMenuEvent *menuEvent = static_cast<HsMenuEvent *>(event);
QVariantMap data = menuEvent->data();
mMenuMode.setHsMenuMode(
- static_cast<HsMenuMode>(data.value(menuModeType()).toInt()));
+ static_cast<HsMenuMode>(data.value(menuModeType()).toInt()),
+ data.value(HOMESCREENDATA));
} else {
mMenuMode.setHsMenuMode(NormalHsMenuMode);
}
@@ -303,15 +317,23 @@
/*!
Ovi Store Action slot
*/
-bool HsAppLibraryState::oviStoreAction()
+int HsAppLibraryState::oviStoreAction()
{
HSMENUTEST_FUNC_ENTRY("HsAppLibraryState::oviStoreAction");
+
CaEntry oviEntry;
- oviEntry.setEntryTypeName(urlTypeName());
- oviEntry.setAttribute(urlEntryKey(),
+ oviEntry.setEntryTypeName(applicationTypeName());
+ oviEntry.setAttribute( applicationUidEntryKey(),
+ QString::number(oviLauncherApplicationUid));
+
+ int result = CaService::instance()->executeCommand(oviEntry);
+ if (result) {
+ oviEntry.setEntryTypeName(urlTypeName());
+ oviEntry.setAttribute(urlEntryKey(),
QString("https://store.ovi.com/applications/"));
-
- bool result = CaService::instance()->executeCommand(oviEntry);
+ result = CaService::instance()->executeCommand(oviEntry);
+ }
+
HSMENUTEST_FUNC_EXIT("HsAppLibraryState::oviStoreAction");
return result;
}
@@ -336,3 +358,4 @@
}
}
+