# HG changeset patch # User hgs # Date 1281090996 -10800 # Node ID 1db7cc813a4e1e4d303e7316b28799c27e9acae1 # Parent 87476091b3f5bff5990f0c4f73d7c9401657f370 201031 diff -r 87476091b3f5 -r 1db7cc813a4e homescreen.pro --- a/homescreen.pro Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreen.pro Fri Aug 06 13:36:36 2010 +0300 @@ -16,7 +16,9 @@ TEMPLATE = subdirs -SUBDIRS = homescreenapp +SUBDIRS += homescreenapp \ + homescreen_plat + symbian:SUBDIRS += screensaver CONFIG += ordered diff -r 87476091b3f5 -r 1db7cc813a4e homescreen_plat/homescreen_plat.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/homescreen_plat.pro Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,24 @@ +# +# 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: +# + +TEMPLATE = subdirs +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " + +include(homescreenclient_api/homescreenclient_api.pri) + +for(filename,PLATFORM_HEADERS){ + BLD_INF_RULES.prj_exports *= "$$filename APP_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))" + } diff -r 87476091b3f5 -r 1db7cc813a4e homescreen_plat/homescreenclient_api/homescreenclient_api.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/homescreenclient_api/homescreenclient_api.pri Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,18 @@ +# +# 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: +# + +PLATFORM_HEADERS += \ + homescreenclient_api/hsmenuclient.h \ No newline at end of file diff -r 87476091b3f5 -r 1db7cc813a4e homescreen_plat/homescreenclient_api/hsmenuclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreen_plat/homescreenclient_api/hsmenuclient.h Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,72 @@ +/* + * 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: hsmenuclient.h + * + */ + +#ifndef HSMENUCLIENT_H +#define HSMENUCLIENT_H + +#include +#include +#include + +QTM_USE_NAMESPACE + +//mandatory keys +const QString hsItemName("item:name"); +// or for localized name +const QString hsItemLocName("item:locname"); + +const QString hsitemLaunchUri("item:launchuri"); +const QString hsitemPublisherId("item:publisherId"); + +//not mandatory +const QString hsItemWidgetUri("widget:uri"); +const QString hsItemDescription("item:description"); +// or for localized name +const QString hsItemLocDescription("item:locdescription"); + +//for icon - not mandatory +const QString hsIconFileName("icon:filename");//to display specific icon from file +const QString hsIconName("icon:name");// HbIcon +const QString hsIconApplicationId("icon:applicationid"); // icon from associated application + + +class HsMenuClientPrivate; + +class HsMenuClient : public QObject +{ + Q_OBJECT + +public: + HsMenuClient(QObject *parent = 0); + ~HsMenuClient(); +public slots: + bool add(const QVariantMap &entryPreference = QVariantMap()); + bool remove(const QVariantMap &queryPreference = QVariantMap()) const; + + QList getList(const QVariantMap &queryPreference = QVariantMap()); + +private: + Q_DISABLE_COPY(HsMenuClient) + /** + * Pointer to a private implementation. + */ + HsMenuClientPrivate * const m_d; +}; + + + +#endif // HSMENUCLIENT_H diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/common.pri --- a/homescreenapp/common.pri Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/common.pri Fri Aug 06 13:36:36 2010 +0300 @@ -1,4 +1,4 @@ -# + # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available @@ -97,10 +97,6 @@ qtplugins.path = $$PLUGIN_SUBDIR qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin - - message(Remove "contains(MOBILITY, serviceframework)" after the QtSF refactorig is done!) - - !contains(MOBILITY, serviceframework):qtplugins.sources += resource/$${TARGET}.manifest hs_public_plugin { contains(MOBILITY, serviceframework):BLD_INF_RULES.prj_exports += "resource/$${TARGET}.xml z:/private/20022F35/$${TARGET}.xml" @@ -136,11 +132,9 @@ } symbian { - !exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { - DEFINES += NO_QT_EXTENSIONS + exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager) { + DEFINES += QT_EXTENSIONS } -} else { - DEFINES += NO_QT_EXTENSIONS } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsapplication/conf/base/confml/homescreendb.confml --- a/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml Fri Aug 06 13:36:36 2010 +0300 @@ -36,7 +36,7 @@ 1hsclockwidgetplugin - 2hsdialerwidgetplugin + 2dialerwidgetplugin 3ftuhswidget 4hsshortcutwidgetplugin 5hsshortcutwidgetplugin @@ -115,11 +115,13 @@ snapTimeout100 snapForce30 snapGap6 - snapBorderGap0 + pageMargin0 snapLineFadeInDuration200 snapLineFadeOutDuration100 isSnapEffectsEnabledtrue sceneTypePageWallpapers + bounceAnimationEasingCurveLinear + pageChangeAnimationEasingCurveLinear diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsapplication/inc/hsstatemachine.h --- a/homescreenapp/hsapplication/inc/hsstatemachine.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsapplication/inc/hsstatemachine.h Fri Aug 06 13:36:36 2010 +0300 @@ -47,6 +47,7 @@ signals: void event_exit(); void event_toIdle(); + void event_toAppLib(); protected: bool eventFilter(QObject *watched, QEvent *event); @@ -59,6 +60,7 @@ void createContentServiceParts(); void createStates(); void updatePSKeys(); + void captureEndKey(bool enable); private slots: void onIdleStateEntered(); @@ -71,6 +73,7 @@ bool mHomeScreenActive; bool mIdleStateActive; + bool mEndKeyCaptured; QValueSpacePublisher *mPublisher; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsapplication/resource/resource_emulator/homescreen.db Binary file homescreenapp/hsapplication/resource/resource_emulator/homescreen.db has changed diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsapplication/resource/resource_win/homescreen.db Binary file homescreenapp/hsapplication/resource/resource_win/homescreen.db has changed diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsapplication/src/hshomescreen.cpp --- a/homescreenapp/hsapplication/src/hshomescreen.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsapplication/src/hshomescreen.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -140,8 +140,7 @@ QStringList pluginPaths; - pluginPaths << "private/20022F35"; - pluginPaths << "hsresources/plugins"; + pluginPaths << "private/20022F35"; QFileInfoList drives = QDir::drives(); foreach(const QString pluginPath, pluginPaths) { @@ -163,6 +162,12 @@ HSTEST_FUNC_EXIT("HS::HsHomeScreen::registerServicePlugins()"); } +#ifdef COVERAGE_MEASUREMENT +#ifndef Q_OS_SYMBIAN +#pragma CTC SKIP +#endif // Q_OS_SYMBIAN +#endif //COVERAGE_MEASUREMENT + /*! Recursively registers service plugins starting from given /a root directory. All directories containing plugins are added to @@ -195,3 +200,9 @@ } HSTEST_FUNC_EXIT("HS::HsHomeScreen::registerServicePlugins(const QString &)"); } + +#ifdef COVERAGE_MEASUREMENT +#ifndef Q_OS_SYMBIAN +#pragma CTC ENDSKIP +#endif // Q_OS_SYMBIAN +#endif //COVERAGE_MEASUREMENT \ No newline at end of file diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsapplication/src/hsstatemachine.cpp --- a/homescreenapp/hsapplication/src/hsstatemachine.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsapplication/src/hsstatemachine.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -49,12 +49,6 @@ QTM_USE_NAMESPACE #define hbApp qobject_cast(qApp) -#ifdef Q_OS_SYMBIAN -const static Qt::Key applicationKey = Qt::Key_Menu; -#else -const static Qt::Key applicationKey = Qt::Key_Home; -#endif - namespace { const char KHsRootStateInterface[] = "com.nokia.homescreen.state.HsRootState"; @@ -85,6 +79,7 @@ mContentService(0), mHomeScreenActive(false), mIdleStateActive(false), + mEndKeyCaptured(false), mPublisher(NULL) #ifdef Q_OS_SYMBIAN ,keyCapture() @@ -162,30 +157,22 @@ switch (event->type()) { case QEvent::ApplicationActivate: qDebug() << "HsStateMachine::eventFilter: QEvent::ApplicationActivate"; -#ifdef Q_OS_SYMBIAN - keyCapture.captureKey(applicationKey); -#endif mHomeScreenActive = true; updatePSKeys(); break; case QEvent::ApplicationDeactivate: qDebug() << "HsStateMachine::eventFilter: QEvent::ApplicationDeactivate"; -#ifdef Q_OS_SYMBIAN - keyCapture.cancelCaptureKey(applicationKey); -#endif mHomeScreenActive = false; updatePSKeys(); break; default: break; } - - bool result = QStateMachine::eventFilter(watched, event); - // temporary hack as we should not register twice for events + + bool result = QStateMachine::eventFilter(watched, event); if (event->type() == QEvent::KeyPress ) { - QKeyEvent* ke = static_cast(event); - // Key_Launch0 should be removed when QT starts to send Key_Menu - result = (ke->key() == applicationKey) || ke->key() == Qt::Key_Launch0; + QKeyEvent* ke = static_cast(event); + result = (ke->key() == Qt::Key_Home); } return result; } @@ -314,34 +301,31 @@ HbMainWindow *window = hbInstance->allMainWindows().first(); +#ifndef Q_OS_SYMBIAN // key driven transition from idle to menu QKeyEventTransition *idleToMenuRootTransition = new QKeyEventTransition( - window, QEvent::KeyPress, applicationKey); + window, QEvent::KeyPress, Qt::Key_Home); idleToMenuRootTransition->setTargetState(menuRootState); idleState->addTransition(idleToMenuRootTransition); // key driven transition from menu to idle QKeyEventTransition *menuToIdleTransition = new QKeyEventTransition( - window, QEvent::KeyPress, applicationKey); + window, QEvent::KeyPress, Qt::Key_Home); menuToIdleTransition->setTargetState(idleState); menuRootState->addTransition(menuToIdleTransition); - - // transition for Key_Launch0 should be removed - // when OT starts to send Key_Menu (maybe wk14) - QKeyEventTransition *idleToMenuRootTransition2 = +#endif + // key driven transition from menu to idle + QKeyEventTransition *menuToIdleTransitionNoKey = new QKeyEventTransition( - window, QEvent::KeyPress, Qt::Key_Launch0); - idleToMenuRootTransition2->setTargetState(menuRootState); - idleState->addTransition(idleToMenuRootTransition2); - // key driven transition from menu to idle - QKeyEventTransition *menuToIdleTransition2 = - new QKeyEventTransition( - window, QEvent::KeyPress, Qt::Key_Launch0); - menuToIdleTransition2->setTargetState(idleState); - menuRootState->addTransition(menuToIdleTransition2); + window, QEvent::KeyPress, Qt::Key_No); + menuToIdleTransitionNoKey->setTargetState(idleState); + menuRootState->addTransition(menuToIdleTransitionNoKey); + // add transition to switch to idle menuRootState->addTransition( this, SIGNAL(event_toIdle()), idleState); + // add transition to switch to applib + idleState->addTransition( this, SIGNAL(event_toAppLib()), menuRootState); // transitions to child states // opening shortcut to a colleciton @@ -383,6 +367,28 @@ qDebug() << "HsStateMachine::updatePSKeys: EHomeScreenInactive"; mPublisher->setValue(HsStatePSKeySubPath, EHomeScreenInactive); } + + if (mHomeScreenActive && !mIdleStateActive) { + captureEndKey(true); + } else { + captureEndKey(false); + } +} + +/*! + capture End key +*/ +void HsStateMachine::captureEndKey(bool enable) +{ +#ifdef Q_OS_SYMBIAN + if (enable && !mEndKeyCaptured) { + mEndKeyCaptured = true; + keyCapture.captureKey(Qt::Key_No); + } else if (mEndKeyCaptured) { + mEndKeyCaptured = false; + keyCapture.cancelCaptureKey(Qt::Key_No); + } +#endif } /*! @@ -414,5 +420,7 @@ collectionDownloadedTypeName())); } else if (name == activityHsIdleView()) { emit event_toIdle(); + } else if (name == activityAppLibMainView()) { + emit event_toAppLib(); } } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsdomainmodel/inc/hsconfiguration.h --- a/homescreenapp/hsdomainmodel/inc/hsconfiguration.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hsconfiguration.h Fri Aug 06 13:36:36 2010 +0300 @@ -20,6 +20,7 @@ #include #include +#include #include @@ -78,6 +79,8 @@ Q_PROPERTY(int snapLineFadeOutDuration READ snapLineFadeOutDuration WRITE setSnapLineFadeOutDuration) Q_PROPERTY(bool isSnapEffectsEnabled READ isSnapEffectsEnabled WRITE setSnapEffectsEnabled) Q_PROPERTY(SceneType sceneType READ sceneType WRITE setSceneType) + Q_PROPERTY(QEasingCurve::Type bounceAnimationEasingCurve READ bounceAnimationEasingCurve WRITE setBounceAnimationEasingCurve) + Q_PROPERTY(QEasingCurve::Type pageChangeAnimationEasingCurve READ pageChangeAnimationEasingCurve WRITE setPageChangeAnimationEasingCurve) Q_ENUMS(SceneType) @@ -181,6 +184,11 @@ void setSnapEffectsEnabled(bool value) { SETVALUE(mIsSnapEffectsEnabled, "isSnapEffectsEnabled") } SceneType sceneType() const { return mSceneType; } void setSceneType(SceneType value) { SETVALUE(mSceneType, "sceneType") } + QEasingCurve::Type bounceAnimationEasingCurve() const { return mBounceAnimationEasingCurve; } + void setBounceAnimationEasingCurve(QEasingCurve::Type value) { SETVALUE(mBounceAnimationEasingCurve, "bounceAnimationEasingCurve") } + QEasingCurve::Type pageChangeAnimationEasingCurve() const { return mPageChangeAnimationEasingCurve; } + void setPageChangeAnimationEasingCurve(QEasingCurve::Type value) { SETVALUE(mPageChangeAnimationEasingCurve, "pageChangeAnimationEasingCurve") } + #undef SETVALUE QSizeF minimumWidgetSizeInUnits() const; @@ -245,7 +253,9 @@ int mSnapLineFadeOutDuration; bool mIsSnapEffectsEnabled; SceneType mSceneType; - + QEasingCurve::Type mBounceAnimationEasingCurve; + QEasingCurve::Type mPageChangeAnimationEasingCurve; + static HsConfiguration *mInstance; HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsdomainmodel/inc/hswidgethostvisual.h --- a/homescreenapp/hsdomainmodel/inc/hswidgethostvisual.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsdomainmodel/inc/hswidgethostvisual.h Fri Aug 06 13:36:36 2010 +0300 @@ -66,7 +66,6 @@ void setNewSize(const QSizeF &size); - private: HsWidgetTouchArea *mTouchArea; HsWidgetHost *mVisualModel; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsdomainmodel/src/hsconfiguration.cpp --- a/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -77,7 +77,9 @@ mSnapLineFadeInDuration(200), mSnapLineFadeOutDuration(100), mIsSnapEffectsEnabled(true), - mSceneType(PageWallpapers) + mSceneType(PageWallpapers), + mBounceAnimationEasingCurve(QEasingCurve::Linear), + mPageChangeAnimationEasingCurve(QEasingCurve::Linear) { } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsdomainmodel/src/hsgui.cpp --- a/homescreenapp/hsdomainmodel/src/hsgui.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsdomainmodel/src/hsgui.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -107,7 +107,8 @@ connect(mImpl->mNavigationAction, SIGNAL(triggered()), SIGNAL(navigateToApplibrary())); mImpl->mIdleView->setNavigationAction(mImpl->mNavigationAction); } - mImpl->mWindow->setCurrentView(mImpl->mIdleView); + bool animate = !mImpl->mWindow->isObscured(); + mImpl->mWindow->setCurrentView(mImpl->mIdleView, animate); } void HsGui::cleanupIdleUi() diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro --- a/homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsmenuclientplugin/hsmenuclientplugin.pro Fri Aug 06 13:36:36 2010 +0300 @@ -23,20 +23,17 @@ LIBS += -lcaclient -INCLUDEPATH += inc +INCLUDEPATH += inc \ + ../../homescreen_plat/homescreenclient_api -HEADERS += inc/hsmenuclient.h \ - inc/hsmenuclientplugin.h \ +HEADERS += ../../homescreen_plat/homescreenclient_api/hsmenuclient.h \ + inc/hsmenuclientplugin.h SOURCES += src/hsmenuclient.cpp \ - src/hsmenuclientplugin.cpp \ + src/hsmenuclientplugin.cpp symbian: { TARGET.UID3 = 0x20028715 -#export interface header to platform -BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " -BLD_INF_RULES.prj_exports += "inc/hsmenuclient.h \ - APP_LAYER_PLATFORM_EXPORT_PATH(hsmenuclient.h)" } include(../common.pri) diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsmenuclientplugin/inc/hsmenuclient.h --- a/homescreenapp/hsmenuclientplugin/inc/hsmenuclient.h Fri Jul 23 13:47:57 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* - * 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: hsmenuclient.h - * - */ - -#ifndef HSMENUCLIENT_H -#define HSMENUCLIENT_H - -#include -#include -#include - -QTM_USE_NAMESPACE - -//mandatory keys -const QString hsItemName("item:name"); -// or for localized name -const QString hsItemLocName("item:locname"); - -const QString hsitemLaunchUri("item:launchuri"); -const QString hsitemPublisherId("item:publisherId"); - -//not mandatory -const QString hsItemWidgetUri("widget:uri"); -const QString hsItemDescription("item:description"); -// or for localized name -const QString hsItemLocDescription("item:locdescription"); - -//for icon - not mandatory -const QString hsIconFileName("icon:filename");//to display specific icon from file -const QString hsIconName("icon:name");// HbIcon -const QString hsIconApplicationId("icon:applicationid"); // icon from associated application - - -class HsMenuClientPrivate; - -class HsMenuClient : public QObject -{ - Q_OBJECT - -public: - HsMenuClient(QObject *parent = 0); - ~HsMenuClient(); -public slots: - bool add(const QVariantMap &entryPreference = QVariantMap()); - bool remove(const QVariantMap &queryPreference = QVariantMap()) const; - - QList getList(const QVariantMap &queryPreference = QVariantMap()); - -private: - Q_DISABLE_COPY(HsMenuClient) - /** - * Pointer to a private implementation. - */ - HsMenuClientPrivate * const m_d; -}; - - - -#endif // HSMENUCLIENT_H diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsutils/inc/hspropertyanimationwrapper.h --- a/homescreenapp/hsutils/inc/hspropertyanimationwrapper.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsutils/inc/hspropertyanimationwrapper.h Fri Aug 06 13:36:36 2010 +0300 @@ -25,6 +25,8 @@ HOMESCREEN_TEST_CLASS(t_hsUtils) +class QEasingCurve; + struct HsPropertyAnimationWrapperImpl; class HSUTILS_EXPORT HsPropertyAnimationWrapper : public QObject { @@ -42,6 +44,7 @@ void setForward(); void setBackward(); bool isForward() const; + void setEasingCurve(const QEasingCurve &curve); signals: void finished(); diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/hsutils/src/hspropertyanimationwrapper.cpp --- a/homescreenapp/hsutils/src/hspropertyanimationwrapper.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/hsutils/src/hspropertyanimationwrapper.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -16,6 +16,7 @@ */ #include +#include #include "hspropertyanimationwrapper.h" /*! @@ -107,3 +108,11 @@ mImpl->mPropertyAnimation->stop(); } +/*! + +*/ +void HsPropertyAnimationWrapper::setEasingCurve(const QEasingCurve &curve) +{ + mImpl->mPropertyAnimation->setEasingCurve(curve); +} + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/inc/hsapp_defs.h --- a/homescreenapp/inc/hsapp_defs.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/inc/hsapp_defs.h Fri Aug 06 13:36:36 2010 +0300 @@ -42,6 +42,8 @@ inline const QString menuModeType(); inline const QString swTypeKey(); inline const QString javaSwType(); +static const char *const HS_CWRT_APP_TYPE="cwrt"; +static const char *const HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE="wrtwidgetuiplugin"; inline const QString packageTypeName(); inline const QString appSettingsPlugin(); inline const QString groupNameAttributeName(); @@ -87,7 +89,7 @@ const char SNAPENABLED[] = "snapenabled"; const char SNAPFORCE[] = "snapforce"; const char SNAPGAP[] = "snapgap"; -const char SNAPBORDERGAP[] = "snapbordergap"; +const char PAGEMARGIN[] = "pagemargin"; const char SNAPLINEFADEINDURATION[] = "snaplinefadeinduration"; const char SNAPLINEFADEOUTDURATION[] = "snaplinefadeoutduration"; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/inc/hsapp_defs.inl --- a/homescreenapp/inc/hsapp_defs.inl Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/inc/hsapp_defs.inl Fri Aug 06 13:36:36 2010 +0300 @@ -316,5 +316,13 @@ return key; } +/*! + \return homescreen activitity name to open applib iew +*/ +inline const QString activityAppLibMainView() +{ + static const QString key("AppLibMainView"); + return key; +} #endif diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro Fri Aug 06 13:36:36 2010 +0300 @@ -23,7 +23,8 @@ DEFINES += MENUSERVICE_LIB -LIBS += -lcaclient +LIBS += -lcaclient \ + -lcasoftwareregistry symbian::TARGET.UID3 = 0x20026FA9 !symbian:exportResources(./resource/*.png, resource) diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsiconsidleloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsiconsidleloader.h Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Menu All Applications state. + * + */ + +#ifndef HSICONSIDLELOADER_H_ +#define HSICONSIDLELOADER_H_ + +#include +#include "hsmenuservice_global.h" + +class QTimer; +class HsMenuItemModel; + + +class HsIconsIdleLoader: public QObject +{ + HS_SERVICE_TEST_FRIEND_CLASS(MenuServiceTest) + + Q_OBJECT +public: + + HsIconsIdleLoader(HsMenuItemModel *model, QObject *parent = 0); + ~HsIconsIdleLoader(); + +private slots: + void processWhenIdle(); + +private: + HsMenuItemModel *mModel; + QTimer *mTimer; +}; + +#endif /* HSICONSIDLELOADER_H_ */ diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuitemmodel.h --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuitemmodel.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/inc/hsmenuitemmodel.h Fri Aug 06 13:36:36 2010 +0300 @@ -27,10 +27,13 @@ #include "hsmenuservice_global.h" #include "hsmenuservice.h" +class CaUninstallNotifier; +class HsIconsIdleLoader; // Class declaration class MENUSERVICE_EXPORT HsMenuItemModel: public CaItemModel { - +HS_SERVICE_TEST_FRIEND_CLASS(MenuServiceTest) +Q_OBJECT public: // Data types @@ -47,6 +50,15 @@ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; bool newIconNeeded(const QModelIndex &index) const; + void preloadIcons(); +private slots: + void uninstallChange(int componentId, int valueOfProgress); + +private: + HsIconsIdleLoader* mIconsIdleLoader; + CaUninstallNotifier* mUninstallNotifier;//not own + int mComponentId; + QList mIds; }; #endif // HSMENUITEMMODEL_H diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsiconsidleloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsiconsidleloader.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Menu All Applications state. + * + */ + +#include +#include +#include "hsmenuitemmodel.h" +#include "hsiconsidleloader.h" + +/*! + Constructor + \param model with defined icons + \param pointer to parent object + */ +HsIconsIdleLoader::HsIconsIdleLoader(HsMenuItemModel *model, QObject *parent): + QObject(parent), + mModel(model), + mTimer(NULL) +{ + mTimer = new QTimer(this); + connect(mTimer, SIGNAL(timeout()), this, SLOT(processWhenIdle())); + mTimer->start(0); // NOTE: zero for idle +} + +/*! + Destructor + */ +HsIconsIdleLoader::~HsIconsIdleLoader() +{ + mTimer->stop(); +} + +/*! + Preloading icons if idle + \retval void + */ +void HsIconsIdleLoader::processWhenIdle() +{ + const QSize iconSize(mModel->getIconSize()); + for (int i=0; irowCount(); i++) { + QModelIndex idx = mModel->index(i); + mModel->entry(idx)->makeIcon(iconSize); + } + mTimer->stop(); // No more timing +} + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuentryremovedhandler.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -91,7 +91,7 @@ Q_UNUSED(entryId); // CaNotifier should care about matching id, skip it here if (changeType == RemoveChangeType) { + mNotifier.reset(0); emit notify(); - mNotifier.reset(0); } } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuitemmodel.cpp --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuitemmodel.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuitemmodel.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -16,9 +16,12 @@ */ #include +#include +#include #include "hsmenuitemmodel.h" #include "hsmenuserviceutils.h" +#include "hsiconsidleloader.h" // Constants const QSize smallIconSize(55, 55); @@ -29,9 +32,15 @@ \param pointer to parent object */ HsMenuItemModel::HsMenuItemModel(const CaQuery &query, QObject *parent) : - CaItemModel(query, parent) + CaItemModel(query, parent), + mIconsIdleLoader(NULL) { setIconSize(smallIconSize); + mComponentId = 0; + mUninstallNotifier = + CaSoftwareRegistry::create()->createUninstallNotifier(); + connect(mUninstallNotifier, SIGNAL(progressChange(int, int)), + this, SLOT(uninstallChange(int, int))); } /*! @@ -39,7 +48,9 @@ */ HsMenuItemModel::~HsMenuItemModel() { - + if (!mIds.isEmpty()) { + mIds.clear(); + } } /*! @@ -106,3 +117,35 @@ HSMENUTEST_FUNC_EXIT("HsMenuItemModel::newIconNeeded"); return result; } + +/*! + Updating uninstall progress with value for each item + \param componentId Component Id of installed item + \param valueOfProgress % value of current progress + */ +void HsMenuItemModel::uninstallChange(int componentId, int valueOfProgress) +{ + if (componentId!=mComponentId) { + if (!mIds.isEmpty()) { + mIds.clear(); + } + // get items list with same componentID + mIds = CaItemModel::getUninstallingEntriesIds(componentId); + mComponentId = componentId; + } + // update each item with progress value + foreach (int id, mIds) { + CaItemModel::updateProgress(id, valueOfProgress); + } +} + + +/*! + Start preloading icons if idle + \param entry entry representing an item + \retval void + */ +void HsMenuItemModel::preloadIcons() +{ + mIconsIdleLoader = new HsIconsIdleLoader(this, this); +} diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp --- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -35,6 +35,7 @@ // Initialization of a static member variable. int HsMenuService::mAllCollectionsId = 0; const char COLLECTION_TITLE_NAME[] = "title_name"; +const char COLLECTION_SHORT_NAME[] = "short_name"; /*! Returns all applications model \param sortAttribute :: SortAttribute @@ -236,7 +237,6 @@ CaEntry collection(GroupEntryRole); collection.setEntryTypeName(collectionTypeName()); collection.setText(name); - collection.setAttribute(COLLECTION_TITLE_NAME, name); collection.setAttribute(groupNameAttributeName(),name); CaIconDescription iconDescription; iconDescription.setFilename(defaultCollectionIconId()); @@ -272,6 +272,7 @@ collection->setText(newCollectionName); collection->setAttribute(COLLECTION_TITLE_NAME, newCollectionName); + collection->setAttribute(COLLECTION_SHORT_NAME, newCollectionName); result = CaService::instance()->updateEntry(*collection); } HSMENUTEST_FUNC_EXIT("HsMenuService::renameCollection"); diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/conf/CI_hsapplibrary.confml Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/CI_hsapplibrary.confml has changed diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.confml Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.confml has changed diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.implml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary.implml Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary_20022F97.crml Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/conf/hsapplibrary_20022F97.crml has changed diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.qm Binary file homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.qm has changed diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.ts --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.ts Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrary.ts Fri Aug 06 13:36:36 2010 +0300 @@ -9,17 +9,7 @@ qtl_dialog_softkey_2 common button - co - False - - - Heading for the mark mode dialog when selecting one or more apps to be added into a collection. - Select applications - Select applications - qtl_dialog_pri_heading - applib_01, applib_05, applib_09 - title - ap + common False @@ -29,7 +19,7 @@ qtl_menu_sec common opt - co + common False @@ -37,19 +27,9 @@ View installed applications View installed applications qtl_menu_pri - applib_03 + applib_01 opt - ap - False - - - Item specific menu item for an item showing the dowload progress. Resumes the download progress (toggles between the Pause command in the item menu) - Resume - Resume - qtl_menu_sec - applib_05 - menu - ap + applib False @@ -59,17 +39,7 @@ qtl_menu_pri applib_03, applib_09 opt - ap - False - - - Sub-menu item. Sorts by default order or user's own order when user has organised the list - Custom - Custom - qtl_menu_sec_add - applib_03, applib_09 - opt_3_sub - ap + applib False @@ -79,7 +49,17 @@ qtl_menu_sec_add applib_01, applib_03, applib_05, applib_07, applib_09 opt_3_sub - ap + applib + False + + + Sorting submenu item in Downloaded collection + Oldest on top + Oldest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib False @@ -89,27 +69,17 @@ qtl_dialog_softkey_2 common button - co + common False - - Sub-menu item. Sorts by installation time, latest first (default sort). - Latest on top - Latest on top - qtl_menu_sec_add - applib_05 - opt_3_sub - ap - False - - - Confirmation note for deleting a collection that has no shortcuts on Home Screen. - Delete %1? - Delete %1? - qtl_dialog_pri3 - applib_03, applib_09 - dialog - ap + + Second part of the confirmation note displayed if the user tries to delete an application that actually includes more than one application. + Following applications will be removed: + Following applications will be removed: + qtl_dialog_pri5 + applib_29 + info + applib False @@ -122,7 +92,7 @@ qtl_list_sec_large_graphic applib_03 dblist_1_val - ap + applib False @@ -132,27 +102,27 @@ qtl_menu_pri common opt - co + common False - - First option in a dialogue where user selects the target collection for an item. Opens an input field to name the new collection. - New collection - New collection - qtl_list_popup_pri_graphic - applib_01, applib_05, applib_09 - list - ap + + Sorting submenu item in Downloaded view + Latest on top + Latest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib False - - Confirmation note for deleting a collection, operation also deletes possible shortcuts on Home Screen. - Deletes %1 also from Home Screen. Continue? - Deletes %1 also from Home Screen. Continue? - qtl_dialog_pri5 - applib_03, applib_09 + + Shown in text entry of installed app in installation log dialog + Installed + Installed + qtl_dialog_sec + applib_20 dialog - ap + applib False @@ -162,7 +132,7 @@ qtl_menu_sec common menu - co + common False @@ -172,17 +142,27 @@ qtl_menu_sec_add applib_01, applib_03, applib_05, applib_07, applib_09 opt_3_sub - ap + applib + False + + + Confirmation note displayed if the user tries to delete an application. %1 is the application name. + Delete %1 and associated data? + Delete %1 and associated data? + qtl_dialog_pri5 + applib_29 + info + applib False Confirmation note for uninstalling an application or a widget that does not have shortcuts on HS or in collections. %1 will be removed from phone. Continue? %1 will be removed from phone. Continue? - qtl_dialog_pri5 - applib_01, applib_05, applib_07, applib_09 - dialog - ap + qtl_dialog_pri5_large_graphic + applib_27 + info + applib False @@ -192,7 +172,357 @@ qtl_menu_pri applib_09 opt - ap + applib + False + + + Name label shown in application details dialog + Name: + Name: + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Size field in app details dialog. App size shown in megabytes, shown after Size-label. + %L1 MB + %L1 MB + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Button in widget preview dialog + Add to Homescreen + Add to Homescreen + qtl_dialog_softkey_2 + applib_13 + button + applib + False + + + Shown after "Memory in use" header in Application details dialog + %1: Mass storage + %1: Mass storage + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Sub-menu item. Sorts by installation time in the Downloaded collection (latest first, default sort) + Installation time + Installation time + qtl_menu_sec_add + applib_05 + opt_3_sub + applib + False + + + Confirmation note displayed if the user tries to delete an application that actually includes more than one application, which has shortcuts. %1 is the application name. + Delete %1, all it's shortcuts and associated data? + Delete %1, all it's shortcuts and associated data? + qtl_dialog_pri5 + applib_29 + info + applib + False + + + List text shown on application item when the app is being uninstalled. %1 is the app name + Uninstalling %1 + Uninstalling %1 + qtl_list_pri_large_graphic + applib_21 + dblist_1 + applib + False + + + Title for all Application library views + Applications + Applications + qtl_titlebar + applib + title + applib + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Erases something completely from the phone, list, or memory card, for example. Delete should only be used when something in removed permanently. + Delete + Delete + qtl_menu_sec + common + menu + common + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Allows user to rename the selected item (file, folder, music track, image etc.). + Rename + Rename + qtl_menu_sec + common + menu + common + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Cancels the ongoing download. + Cancel download + Cancel download + qtl_menu_sec + common + menu + common + False + + + Heading for the Arrange dialog + Arrange + Arrange + qtl_dialog_pri_heading + applib_16 + title + applib + False + + + Options menu item for viewing installation log + Installation log + Installation log + qtl_menu_pri + applib_07 + opt + applib + False + + + Options list item. Opens sublist for sorting criteria + Sort by + Sort by + qtl_menu_pri_add + applib_01, applib_03, applib_05, applib_07, applib_09 + opt_3 + applib + False + + + Sub-menu item. Sorts by installation time, oldest first. + Oldest on top + Oldest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib + False + + + Options menu item. Opens the Task Switcher application. (Same command in Home Screen Options menu.) + Task Switcher + Task Switcher + qtl_menu_pri + applib_01, applib_03, applib_05, applib_07, applib_09, applib_11 + opt + applib + False + + + Text shown in widget preview dialog if no preview is available + (No preview available) + (No preview available) + qtl_dialog_pri5 + applib_30 + info + applib + False + + + Item specific menu item for an item showing the dowload progress. Cancels the ongoing installing progress + Cancel installing + Cancel installing + qtl_menu_sec + applib_05 + menu + applib + False + + + Options list item. Allows the user to add one or more applications into a virtual collection. Involves several steps, indicated by the ... at the end of the command. + Add to collection... + Add to collection... + qtl_menu_pri + applib_01 + opt + applib + False + + + Notification dialog shown after content (Widget or App shortcut) has been added from AppLib to Homescreen + Added to Homescreen + Added to Homescreen + qtl_notifdialog_pri + applib_18 + dpophead + applib + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a view where information about the item is given. + Details + Details + qtl_menu_sec + common + menu + common + False + + + Options list item. Launches SW Update application where user can view and select softwares to be updated. + Check software updates + Check software updates + qtl_menu_pri + applib_01 + opt + applib + False + + + Confirmation note displayed if the user tries to delete a java application that is active at the time. + %1 must be closed before deleting. Close now? + %1 must be closed before deleting. Close now? + qtl_dialog_pri5_large_graphic + applib_28 + info + applib + False + + + Default entry text when naming a new collection, where %L1 is the next available number differentiating between otherwise similar collection names. + Collection(%L1) + Collection(%L1) + qtl_list_pri_large_graphic + applib_15 + dialog_1_entry + applib + False + + + Button. Note! Use this text ID only if there are max. two buttons in the dialog. When this button is pressed, the focused item or operation will be selected or accepted. + OK + OK + qtl_dialog_softkey_2 + common + button + common + False + + + Item specific menu item for an item showing the dowload progress. Resumes the download progress (toggles between the Pause command in the item menu) + Resume + Resume + qtl_menu_sec + applib_05 + menu + applib + False + + + Sub-menu item. Sorts by default order or user's own order when user has organised the list + Custom + Custom + qtl_menu_sec_add + applib_03, applib_09 + opt_3_sub + applib + False + + + Sub-menu item. Sorts by installation time, latest first (default sort). + Latest on top + Latest on top + qtl_menu_sec_add + applib_05 + opt_3_sub + applib + False + + + Confirmation note for deleting a collection that has no shortcuts on Home Screen. + Delete %1? + Delete %1? + qtl_dialog_pri5_large_graphic + applib_24 + info + applib + False + + + If lauching an application fails, thie note is shown. %1 is error code. + Launching the application failed (error code %1) + Launching the application failed (error code %1) + qtl_dialog_pri5_large_graphic + applib_31 + info + applib + False + + + Format label of application details dialog. Format can be for example Symbian, Java or Widget + Format: + Format: + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Confirmation note for deleting a collection, operation also deletes possible shortcuts on Home Screen. + Deletes %1 also from Home Screen. Continue? + Deletes %1 also from Home Screen. Continue? + qtl_dialog_pri5_large_graphic + applib_25 + info + applib + False + + + Delete button + Delete + Delete + qtl_dialog_softkey_2 + common + button + common + False + + + Size field in app details dialog. App size shown in kilobytes, shown after Size-label. + %L1 KB + %L1 KB + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Description label of application details dialog. Free-form description of the purpose of the application. + Description: + Description: + qtl_dialog_sec + applib_17 + dialog + applib False @@ -200,9 +530,9 @@ Collection name: Collection name: qtl_dialog_sec - applib_01, applib_05, applib_09 + applib_15 dialog_1 - ap + applib False @@ -212,17 +542,17 @@ qtl_menu_sec common menu - co + common False - - Button in widget preview dialog - Add to Homescreen - Add to Homescreen - qtl_dialog_softkey_2 - applib_12 - button - ap + + Confirmation for a successful operation, app/widget added to a collection. (Use only when user is not inside the target collection.). %1 is the collection name. + Added to collection %1 + Added to collection %1 + qtl_notifdialog_pri2 + applib_32 + dpophead + applib False @@ -232,47 +562,27 @@ qtl_list_sec_large_graphic applib_03 dblist_1_val - ap - False - - - Sub-menu item. Sorts by installation time in the Downloaded collection (latest first, default sort) - Installation time - Installation time - qtl_menu_sec_add - applib_05 - opt_3_sub - ap + applib False - - Title for all Application library views - Applications - Applications - qtl_titlebar - applib - title - ap + + Dialog shown when uninstallation of an application fails + Uninstallation failed + Uninstallation failed + qtl_dialog_pri5_large_graphic + applib_08 + info + applib False - - Item specific menu item. Note! Only use this text ID if there are no icons. Erases something completely from the phone, list, or memory card, for example. Delete should only be used when something in removed permanently. - Delete - Delete - qtl_menu_sec - common - menu - co - False - - - Item specific menu item. Note! Only use this text ID if there are no icons. Allows user to rename the selected item (file, folder, music track, image etc.). - Rename - Rename - qtl_menu_sec - common - menu - co + + Shown in text entry of removed app in installation log dialog + Removed + Removed + qtl_dialog_sec + applib_20 + dialog + applib False @@ -280,39 +590,9 @@ File corrupted, unable to use widget. Delete widget? File corrupted, unable to use widget. Delete widget? qtl_dialog_pri5 - applib_01, applib_05, applib_09 - dialog - ap - False - - - Item specific menu item. Note! Only use this text ID if there are no icons. Cancels the ongoing download. - Cancel download - Cancel download - qtl_menu_sec - common - menu - co - False - - - Heading for the Arrange dialog - Arrange - Arrange - qtl_dialog_pri_heading - applib_03 - title - ap - False - - - Options list item. Opens sublist for sorting criteria - Sort by - Sort by - qtl_menu_pri_add - applib_01, applib_03, applib_05, applib_07, applib_09 - opt_3 - ap + applib_33 + info + applib False @@ -322,7 +602,7 @@ qtl_menu_sec common menu - co + common False @@ -332,37 +612,27 @@ qtl_menu_pri applib_03 opt - ap - False - - - Sub-menu item. Sorts by installation time, oldest first. - Oldest on top - Oldest on top - qtl_menu_sec_add - applib_05 - opt_3_sub - ap + applib False - - Options menu item. Opens the Task Switcher application. (Same command in Home Screen Options menu.) - Task Switcher - Task Switcher - qtl_menu_pri - applib_01, applib_03, applib_05, applib_07, applib_09, applib_11 - opt - ap + + Shown after "Memory in use" header in Application details dialog if the app is installed in memory card without name + %1: Memory card + %1: Memory card + qtl_dialog_sec + applib_17 + dialog + applib False - - Item specific menu item for an item showing the dowload progress. Cancels the ongoing installing progress - Cancel installing - Cancel installing - qtl_menu_sec - applib_05 - menu - ap + + Supplier label of application details dialog + Supplier: + Supplier: + qtl_dialog_sec + applib_17 + dialog + applib False @@ -372,17 +642,47 @@ qtl_menu_pri applib_01, applib_05, applib_09 menu - ap + applib + False + + + Text for empty view when searching and no results are found + No search results + No search results + qtl_dataform_pri + applib_19 + formlabel_1 + applib False - - Options list item. Allows the user to add one or more applications into a virtual collection. Involves several steps, indicated by the ... at the end of the command. - Add to collection... - Add to collection... - qtl_menu_pri - applib_01 - opt - ap + + Size label on application details dialog. Size of the app is shown after this label. + Size: + Size: + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Shown after "Memory in use" header in Application details dialog. %1 is the drive letter and %2 is the user-given + %1: %2 + %1: %2 + qtl_dialog_sec + applib_17 + dialog + applib + False + + + Shown after "Memory in use" header in Application details dialog + %1: Device memory + %1: Device memory + qtl_dialog_sec + applib_17 + dialog + applib False @@ -390,9 +690,19 @@ Add to: Add to: qtl_dialog_pri_heading - applib_01, applib_09 + applib_34 title - ap + applib + False + + + Heading for fullscreen Installation logs dialog + Installation logs + Installation logs + qtl_dialog_pri_heading + applib_20 + title + applib False @@ -402,37 +712,37 @@ qtl_menu_sec applib_01, applib_05, applib_09 menu - ap + applib False - - Item specific menu item. Note! Only use this text ID if there are no icons. Opens a view where information about the item is given. - Details - Details - qtl_menu_sec - common - menu - co + + Text for empty Collection + No content + No content + qtl_dataform_pri + applib_22 + formlabel_1 + applib False - - Options list item. Launches SW Update application where user can view and select softwares to be updated. - Check software updates - Check software updates - qtl_menu_pri - applib_01 - opt - ap + + Button for creating new collection + Create new + Create new + qtl_dialog_softkey_2 + applib_34 + button + applib False Confirmation note for uninstalling an application or a widget that has shortcuts on HS or in collections. %1 and all its shortcuts will be removed from phone. Continue? %1 and all its shortcuts will be removed from phone. Continue? - qtl_dialog_pri5 - applib_01, applib_05, applib_07, applib_09 - dialog - ap + qtl_dialog_pri5_large_graphic + applib_23 + info + applib False @@ -442,7 +752,7 @@ qtl_menu_sec applib_09 menu - ap + applib False @@ -452,37 +762,27 @@ qtl_menu_sec common opt - co - False - - - Confirmation note displayed if the user tries to delete a java application that is active at the time. - %1 must be closed before deleting. Close %1? - %1 must be closed before deleting. Close %1? - qtl_dialog_pri5 - applib_01, applib_05, applib_07, applib_09 - dialog - ap + common False - - Default entry text when naming a new collection, where %L1 is the next available number differentiating between otherwise similar collection names. - Collection(%L1) - Collection(%L1) - qtl_list_pri_large_graphic - applib_01, applib_05, applib_09 - dialog_1_entry - ap + + Memory in use label in application details dialog + Memory in use: + Memory in use: + qtl_dialog_sec + applib_17 + dialog + applib False - - Item specific menu item for an app/widget. adds application/widget to Homescreen - Add to Home Screen - Add to Home Screen - qtl_menu_sec - applib_01, applib_03, applib_05, applib_09 - menu - ap + + Shown in text entry of partially installed app in installation log dialog + Partially installed + Partially installed + qtl_dialog_sec + applib_20 + dialog + applib False @@ -492,7 +792,27 @@ qtl_menu_pri applib_03 opt - ap + applib + False + + + Item specific menu item for an app/widget. adds application/widget to Homescreen + Add to Home Screen + Add to Home Screen + qtl_menu_sec + applib_01, applib_03, applib_05, applib_09 + menu + applib + False + + + Confirmation for removing an app/widget from a collection. Does not delete the item from the device. + Remove %1 from collection? + Remove %1 from collection? + qtl_dialog_pri5 + applib_26 + info + applib False @@ -502,17 +822,27 @@ qtl_groupbox_simple_sec applib_07 subtitle - ap + applib False - - Confirmation for removing an app/widget from a collection. Does not delete the item from the device. - Remove %1 from collection? - Remove %1 from collection? - qtl_dialog_pri5 - applib_09 + + Protection domain label shown in application details dialog. The value of this field is retrieved from the value, not from platform. The value can be one of the following: Operator, Manufacturer, Trusted 3rd party, Untrusted 3rd party. + Protection domain: + Protection domain: + qtl_dialog_sec + applib_17 dialog - ap + applib + False + + + Heading for the mark mode dialog when selecting one or more apps to be added into a collection. + Select items: + Select items: + qtl_dialog_pri_heading + applib_35 + title + applib False @@ -520,29 +850,29 @@ Collection Collection qtl_list_pri_large_graphic - applib_01, applib_05, applib_09 + applib_15 dialog_1_entry - ap + applib False - - Confirmation for a successful operation, app/widget added to a collection. (Use only when user is not inside the target collection.) - Added to collection %1 - Added to collection %1 - qtl_dialog_pri3 - applib_01, applib_03, applib_05, applib_09 - info - ap + + Version label shown in application details dialog + Version: + Version: + qtl_dialog_sec + applib_17 + dialog + applib False - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. When this button is pressed, the focused item or operation will be selected or accepted. - OK - OK - qtl_dialog_softkey_2 - common - button - co + + Header of application details dialog + Details + Details + qtl_dialog_pri_heading + applib_17 + title + applib False diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc Fri Aug 06 13:36:36 2010 +0300 @@ -4,10 +4,8 @@ resource/common_objects.docml resource/emptylabeledview.docml resource/labeledlistview.docml - resource/labeledsearchview.docml resource/listview.docml - resource/searchlabeledlistview.docml - resource/searchlistview.docml + resource/searchview.docml resource/hsapplibrarystateplugin.css diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin_exports_to_rom.pri --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin_exports_to_rom.pri Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin_exports_to_rom.pri Fri Aug 06 13:36:36 2010 +0300 @@ -17,5 +17,7 @@ BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ "conf/hsapplibrary.confml APP_LAYER_CONFML(hsapplibrary.confml)" \ + "conf/CI_hsapplibrary.confml APP_LAYER_CONFML(CI_hsapplibrary.confml)" \ + "conf/hsapplibrary.implml APP_LAYER_CRML(hsapplibrary.implml)" \ "conf/hsapplibrary_20022F97.crml APP_LAYER_CRML(hsapplibrary_20022F97.crml)" diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsaddmodeproxymodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsaddmodeproxymodel.h Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Proxy model for view in add to homescreen mode. + * + */ + +#ifndef HSADDMODEPROXYMODEL_H +#define HSADDMODEPROXYMODEL_H + +#include +#include +#include + +#include "hsmenustates_global.h" + +class CaNotifier; + +class HsAddModeProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT + + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + + HsAddModeProxyModel(QObject *parent = 0); + ~HsAddModeProxyModel(); + void initilizeCwrtWidgetCache(); + +private slots: + + void updateCacheOnAddWidget(const QString &uri, const QVariantHash &preferences); + void updateCacheOnRemoveWidget(const QString &uri, const QVariantHash &preferences); + void updateEntryStatus(const CaEntry &entry, ChangeType changeType); + +private: + + virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; + static int findCwrtWidgetEntryId(const QVariantHash &preferences); + + QHash mCwrtWidgetCache; + CaQuery mQuery; + QScopedPointer mNotifier; +}; + +#endif //HSADDMODEPROXYMODEL_H + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallappsstate.h Fri Aug 06 13:36:36 2010 +0300 @@ -23,6 +23,7 @@ #include "hsmenumodewrapper.h" + HS_STATES_TEST_CLASS(MenuStatesTest) class HbView; @@ -55,6 +56,7 @@ void ascendingMenuAction(); void descendingMenuAction(); void normalModeEntered(); + void addModeEntered(); void stateExited(); void contextMenuAction(HbAction *action); private: @@ -64,6 +66,7 @@ void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags); private: + HsAddModeProxyModel *mAddModeProxyModel; HsSortAttribute mSortAttribute; }; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibstateutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsapplibstateutils.h Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Utils for application library state plugin. + * + */ + +#ifndef HSAPPLIBSTATEUTILS_H +#define HSAPPLIBSTATEUTILS_H + +#include + +#include "hsmenustates_global.h" + +class CaEntry; + +class HsAppLibStateUtils +{ + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + + static bool isCWRTWidgetOnHomeScreen(const CaEntry *entry); + +}; + +#endif //HSAPPLIBSTATEUTILS_H + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsbaseviewstate.h Fri Aug 06 13:36:36 2010 +0300 @@ -34,6 +34,7 @@ class CaNotifier; class HsMenuModeWrapper; class HsMainWindow; +class HsAddModeProxyModel; HS_STATES_TEST_CLASS(MenuStatesTest) @@ -60,6 +61,7 @@ virtual void stateEntered(); virtual void stateExited(); virtual void addModeEntered(); + virtual void addModeExited(); virtual void normalModeEntered(); virtual void normalModeExited(); virtual void launchItem(const QModelIndex &index); @@ -68,6 +70,7 @@ virtual int checkSoftwareUpdates(); virtual bool openTaskSwitcher(); virtual void closeContextMenu(); + protected: void initialize(HsMenuViewBuilder &menuViewBuilder, HsStateContext stateContext); @@ -75,15 +78,16 @@ void defineTransitions(); private: + virtual void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) = 0; virtual void setMenuOptions() = 0; - private: QPointer mApplicationLaunchFailMessage; protected: + HsMenuItemModel *mModel; QPointer mContextMenu; QModelIndex mContextModelIndex; @@ -91,6 +95,7 @@ QScopedPointer mMenuView; HsMenuModeWrapper *mMenuMode; HsMainWindow &mMainWindow; + HbMenu *mViewOptions; }; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h Fri Aug 06 13:36:36 2010 +0300 @@ -19,10 +19,21 @@ #define CUSTOMLISTVIEWITEM_H #include +#include #include "hsmenustates_global.h" -class HbProgressBar; +// TODO: this is only temporary class for show progress bar. +// It should be remove when fix from orbit will be in official platfrom. +class HsProgressBar: public HbProgressBar { +public: + HsProgressBar(QGraphicsItem *parent=0):HbProgressBar(parent) {} + +protected: + void paint ( QPainter * painter, + const QStyleOptionGraphicsItem * option, + QWidget * widget = 0 ); +}; HS_STATES_TEST_CLASS(MenuStatesTest) @@ -33,17 +44,18 @@ explicit HsListViewItem(QGraphicsItem* parent=0); virtual ~HsListViewItem(); - + virtual HbAbstractViewItem* createItem(); virtual void updateChildItems(); + protected: virtual void polish(HbStyleParameters& params); private: - - HbProgressBar *progress; + HsProgressBar *progress; bool isProgress; HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) }; + #endif // CUSTOMLISTVIEWITEM_H diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuview.h Fri Aug 06 13:36:36 2010 +0300 @@ -63,7 +63,8 @@ HbGroupBox *viewLabel() const; - void setModel(HsMenuItemModel *model); + void setModel(QAbstractItemModel *model); + QAbstractItemModel *model() const; void reset(HsOperationalContext operationalContext); signals: diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Fri Aug 06 13:36:36 2010 +0300 @@ -33,7 +33,6 @@ class HbGroupBox; class HbLineEdit; class HbListView; -class HbSearchPanel; class HbToolBar; class HbView; class HbWidget; @@ -50,7 +49,6 @@ enum HsOperationalContext { HsItemViewContext = 0, - HsSearchContext, HsButtonContext, HsEmptyLabelContext, InvalidOperationalContext @@ -81,7 +79,6 @@ // optional widgets accessors HbGroupBox *currentViewLabel(); - HbSearchPanel *currentSearchPanel(); HbPushButton *currentAddContentButton(); @@ -104,15 +101,12 @@ QSet mLoadedObjects; - const QString DOCUMENT_FILE_NAME; + const QString ALL_APPS_ACTION_NAME; const QString ALL_COLLECTIONS_ACTION_NAME; const QString SEARCH_ACTION_NAME; const QString OVI_STORE_ACTION_NAME; const QString OPERATOR_ACTION_NAME; - const QString SEARCH_PANEL_NAME; - const QString BUTTON_NAME; - const QString TOOL_BAR_NAME; QActionGroup *mToolBarActionGroup; HbToolBar *mToolBar; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler.h Fri Aug 06 13:36:36 2010 +0300 @@ -23,6 +23,7 @@ #include "hsmenustates_global.h" class HsOperatorHandlerPrivate; +class HbAction; class HsOperatorHandler: public QObject { @@ -33,10 +34,17 @@ public: HsOperatorHandler(QObject *parent = 0); virtual ~HsOperatorHandler(); - HbIcon icon(); + bool operatorStorePresent(); + bool oviStorePresent(); + bool operatorStoreFirst(); + HbAction *prepareOperatorStoreAction( + HbAction *const operatorAction); QString text(); -public slots: +private: + HbIcon icon(); + +private slots: void action(); private: diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler_p.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler_p.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsoperatorhandler_p.h Fri Aug 06 13:36:36 2010 +0300 @@ -14,18 +14,17 @@ * Description: Hs Operator Handler Private. * */ - #ifndef HSOPERATORHANDLER_P_H_ #define HSOPERATORHANDLER_P_H_ -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS #include +#include #include #include "hsmenustates_global.h" class CaEntry; -class XQSettingsManager; class HsOperatorHandlerPrivate: public QObject { @@ -34,23 +33,46 @@ HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) public: + + enum HsStoreType { + NoneType, + UrlType, + ApplicationType + }; + HsOperatorHandlerPrivate(QObject *parent = 0); virtual ~HsOperatorHandlerPrivate(); HbIcon icon(); QString text(); void action(); + bool oviStorePresent(); + bool operatorStorePresent(); + bool operatorStoreFirst(); private: + bool storeValue(XQSettingsManager *crManager, int storePresenceKey); + QVariant getVariantFromKey( + XQSettingsManager *crManager, + int crKey, + XQSettingsManager::Type type); + HsStoreType operatorStoreType(XQSettingsManager *crManager); + void readCentralRepository(); HbIcon createIcon(XQSettingsManager *crManager); - QString readText(XQSettingsManager *crManager); + QString operatorStoreTitle(XQSettingsManager *crManager); CaEntry *createAppEntry(XQSettingsManager *crManager); CaEntry *createUrlEntry(XQSettingsManager *crManager); + bool operatorStoreFirst(XQSettingsManager *crManager); private: + bool mOviStorePresent; + bool mOperatorStorePresent; + HsStoreType mStoreType; CaEntry *mOperatorEntry; HbIcon mIcon; - QString mText; + QString mOperatorStoreTitle; + bool mOperatorStoreFirst; + }; #endif diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchview.h Fri Aug 06 13:36:36 2010 +0300 @@ -25,6 +25,7 @@ #include "hsmenustates_global.h" #include "hsmenuviewbuilder.h" +#include "hssearchviewbuilder.h" class QSortFilterProxyModel; class HsMainWindow; @@ -49,8 +50,9 @@ ~HsSearchView(); void setSearchPanelVisible(bool visible); +private: + bool isActive() const; -private: QModelIndex firstVisibleItemIndex(const HbListView *view) const; void searchBegins(); @@ -70,15 +72,18 @@ public slots: void hideSearchPanel(); + +private slots: void activatedProxySlot(const QModelIndex &index); void longPressedProxySlot( HbAbstractViewItem *item, const QPointF &coords); private slots: void findItem(QString criteriaStr); + void setNoResultsVisibility(); + private: void setOriginatingContext(); - void setSearchContext(); void initSearchPanel(HbSearchPanel &searchPanel); HbLineEdit *searchPanelLineEdit(HbSearchPanel &searchPanel) const; @@ -97,6 +102,8 @@ HsMainWindow &mMainWindow; HbListView *mListView; QScopedPointer mVkbHost; + HsSearchViewBuilder mSearchViewBuilder; + bool mEmptyResultText; }; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchviewbuilder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hssearchviewbuilder.h Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Menu View Builder + * + */ + +#ifndef HSSEARCHVIEWBUILDER_H_ +#define HSSEARCHVIEWBUILDER_H_ + +#include +#include "hsmenustates_global.h" + +class HbSearchPanel; +class HbView; +class HbListView; +class HbGroupBox; + +HS_STATES_TEST_CLASS(MenuStatesTest) + +class HsSearchViewBuilder +{ + + HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + +public: + HsSearchViewBuilder(); + virtual ~HsSearchViewBuilder(); + + HbView *searchView(); + HbListView *searchListView(); + HbSearchPanel *searchPanel(); + HbGroupBox *searchViewLabel(); + void setSearchLabledContext(); + bool loadViewEmptySection(); + bool loadViewListSection(); + +private: + QSet mLoadedObjects; + QSharedPointer mLoader; + bool mLabledContext; +}; + +#endif /* HSSEARCHVIEWBUILDER_H_ */ diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml Fri Jul 23 13:47:57 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,500 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/emptylabeledview.docml Fri Aug 06 13:36:36 2010 +0300 @@ -13,7 +13,7 @@ - + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml Fri Aug 06 13:36:36 2010 +0300 @@ -1,50 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -74,5 +28,4 @@ - diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/labeledsearchview.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/labeledsearchview.docml Fri Jul 23 13:47:57 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/listview.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/listview.docml Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/listview.docml Fri Aug 06 13:36:36 2010 +0300 @@ -3,10 +3,7 @@ - - - - + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchlabeledlistview.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchlabeledlistview.docml Fri Jul 23 13:47:57 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchlistview.docml --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchlistview.docml Fri Jul 23 13:47:57 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/searchview.docml Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsaddmodeproxymodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsaddmodeproxymodel.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Proxy model for view in add to homescreen mode. + * + */ + +#include +#include + +#include "hscontentservice.h" +#include "hsaddmodeproxymodel.h" +#include "hsmenuitemmodel.h" +#include "hsapplibstateutils.h" + +/*! + \class HsAddModeProxyModel + \ingroup group_hsmenustateplugin + \brief Proxy Model for add to homescreen mode. + Filtering cwrt widgets to not displaing them in add mode when they are alredy present on HS. + \lib ?library + \see QSortFilterProxyModel + */ + +/*! + Constructor. + \param parent parent for object. + */ +HsAddModeProxyModel::HsAddModeProxyModel(QObject *parent) : + QSortFilterProxyModel(parent), + mCwrtWidgetCache(), + mQuery() +{ + initilizeCwrtWidgetCache(); + invalidateFilter(); + connect(HsContentService::instance(), + SIGNAL(widgetAdded(const QString &, const QVariantHash &)), + this, SLOT(updateCacheOnAddWidget(const QString&, const QVariantHash&))); + connect(HsContentService::instance(), + SIGNAL(widgetRemoved(const QString &, const QVariantHash &)), + this, SLOT(updateCacheOnRemoveWidget(const QString&, const QVariantHash&))); + // create notifier for a cwrt widgets with query created in initilizeCwrtWidgetCache + CaNotifierFilter filter(mQuery); + mNotifier.reset(CaService::instance()->createNotifier(filter)); + connect(mNotifier.data(), + SIGNAL(entryChanged(const CaEntry&, ChangeType)), + this, + SLOT(updateEntryStatus(const CaEntry&, ChangeType))); +} + +/* + Destructor. + */ +HsAddModeProxyModel::~HsAddModeProxyModel() +{ +} + +void HsAddModeProxyModel::initilizeCwrtWidgetCache() +{ + QStringList entryTypeNames; + entryTypeNames.append(applicationTypeName()); + mQuery.setEntryTypeNames(entryTypeNames); + mQuery.setAttribute(swTypeKey(), HS_CWRT_APP_TYPE); + mQuery.setAttribute(widgetUriAttributeName(), + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE); + QList< QSharedPointer > entries = + CaService::instance()->getEntries(mQuery); + foreach (QSharedPointer entry, entries) { + QVariantHash preferences; + QMap attributes = entry->attributes(); + QMapIterator i(attributes); + while (i.hasNext()) { + i.next(); + QString key(i.key()); + QString value(i.value()); + if (key.contains(widgetParam())) { + preferences.insert(key.remove(widgetParam()),value); + } + } + int count(0); + HsContentService::instance()->widgets( + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE,preferences,count); + mCwrtWidgetCache.insert(entry->id(), count > 0); + } + +} + +/*! + Return entryid for given Cwrt with mini view widget. + \param uri of a widget. + \param preferences widget preferences. + \retval int entry id or 0 for not cwrt with mini view widgets. + */ +int HsAddModeProxyModel::findCwrtWidgetEntryId(const QVariantHash &preferences) +{ + int result = 0; + CaQuery query; + QStringList entryTypeNames; + query.setEntryTypeNames(entryTypeNames); + query.setAttribute(swTypeKey(), HS_CWRT_APP_TYPE); + query.setAttribute(widgetUriAttributeName(), + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE); + foreach (QString key, preferences.keys()) { + query.setAttribute(widgetParam()+key, + preferences.value(key).toString()); + } + QList< QSharedPointer > entries = + CaService::instance()->getEntries(query); + if( entries.count() > 0 ) + { + result = entries[0]->id(); + } + return result; +} + +/* + Slot called when widget is added to homescreen. + If widget is removed we checkhow many instance of this widget is left on HS. + \param uri of a widget. + \param preferences widget preferences. + */ +void HsAddModeProxyModel::updateCacheOnAddWidget(const QString &uri, + const QVariantHash &preferences){ + if (uri == HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) { + int entryId = findCwrtWidgetEntryId(preferences); + if (!mCwrtWidgetCache.value(entryId) ) { + mCwrtWidgetCache.insert(entryId,true); + invalidateFilter(); + } + } +} + +/* + Slot called when widget is removed from homescreen. + If widget is removed we checkhow many instance of this widget is left on HS. + \param uri of a widget. + \param preferences widget preferences. +*/ +void HsAddModeProxyModel::updateCacheOnRemoveWidget(const QString &uri, + const QVariantHash &preferences) +{ + if (uri == HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) { + int entryId = findCwrtWidgetEntryId(preferences); + if (mCwrtWidgetCache.value(entryId)) { + mCwrtWidgetCache.insert(entryId,false); + invalidateFilter(); + } + } +} + +/* + Reimplementated from QSortFilterProxyModel. + \param source_row row in source model. + \param source_parent source parent index. + */ +bool HsAddModeProxyModel::filterAcceptsRow(int source_row, + const QModelIndex &source_parent) const +{ + QVariant entryId = sourceModel()->data( + sourceModel()->index(source_row,0,source_parent), + CaItemModel::IdRole); + return !mCwrtWidgetCache.value(entryId.toInt()); +} + +/* + Update cache if some cwrt widgets were install/uninstal/update or on mmc card. + \param entry changed entry. + \param changeType the type of the change. + */ +void HsAddModeProxyModel::updateEntryStatus(const CaEntry &entry, ChangeType changeType) +{ + if (changeType == RemoveChangeType) { + mCwrtWidgetCache.remove(entry.id()); + } else { + mCwrtWidgetCache.insert(entry.id(), + HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(&entry)); + } +} diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -36,6 +36,8 @@ #include "hsmenumodewrapper.h" #include "hsmenuviewbuilder.h" #include "hsmainwindow.h" +#include "hsaddmodeproxymodel.h" +#include "hsapplibstateutils.h" /*! \class HsAllAppsState @@ -63,10 +65,13 @@ HsMainWindow &mainWindow, QState *parent) : HsBaseViewState(mainWindow, menuMode, parent), + mAddModeProxyModel(0), mSortAttribute(AscendingNameHsSortAttribute) { initialize(menuViewBuilder, HsAllAppsContext); construct(); + mAddModeProxyModel = new HsAddModeProxyModel(this); + mAddModeProxyModel->setSourceModel(mModel); } /*! @@ -87,6 +92,8 @@ mModel = HsMenuService::getAllApplicationsModel(mSortAttribute); mMenuView->setModel(mModel); + mModel->preloadIcons(); + mMenuView->listView()->verticalScrollBar()->setInteractive(true); HbIndexFeedback *indexFeedback = new HbIndexFeedback(mMenuView->view()); indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); @@ -102,18 +109,18 @@ void HsAllAppsState::setMenuOptions() { HSMENUTEST_FUNC_ENTRY("HsAllAppsState::setMenuOptions"); - QScopedPointer viewOptions(new HbMenu); - viewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + mViewOptions->clearActions(); + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), static_cast(this), SLOT(openTaskSwitcher())); - viewOptions->addAction(hbTrId("txt_applib_opt_add_to_collection"), + mViewOptions->addAction(hbTrId("txt_applib_opt_add_to_collection"), this, SLOT(addToCollection())); - viewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), + mViewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"), static_cast(this), SLOT(checkSoftwareUpdates())); - HbMenu *const sortMenu = viewOptions->addMenu(hbTrId( + HbMenu *const sortMenu = mViewOptions->addMenu(hbTrId( "txt_applib_opt_sort_by")); //Grouped options are exclusive by default. - QActionGroup *sortGroup = new QActionGroup(viewOptions.data()); + QActionGroup *sortGroup = new QActionGroup(this); sortGroup->addAction( sortMenu->addAction(hbTrId("txt_applib_opt_sub_ascending"), @@ -122,7 +129,7 @@ sortMenu->addAction(hbTrId("txt_applib_opt_sub_descending"), this, SLOT(descendingMenuAction()))); - viewOptions->addAction(hbTrId("txt_applib_subtitle_installed"), + mViewOptions->addAction(hbTrId("txt_applib_opt_view_installed_applications"), this, SLOT(openInstalledView())); foreach(QAction *action, sortMenu->actions()) { @@ -142,7 +149,6 @@ if (currentSortingPosition >= 0) { sortGroup->actions().at(currentSortingPosition)->setChecked(true); } - mMenuView->view()->setMenu(viewOptions.take()); HSMENUTEST_FUNC_EXIT("HsAllAppsState::setMenuOptions"); } @@ -157,17 +163,31 @@ /*! - Slot invoked when add mode entered. + Slot invoked when normal mode entered. */ void HsAllAppsState::normalModeEntered() { HsBaseViewState::normalModeEntered(); + if (mMenuView->model() != mModel) { + mMenuView->setModel(mModel); + } connect(mMenuView.data(), SIGNAL(activated(QModelIndex)), static_cast(this), SLOT(launchItem(QModelIndex))); } /*! + Slot invoked when add mode entered. + */ +void HsAllAppsState::addModeEntered() +{ + HsBaseViewState::addModeEntered(); + if (mMenuView->model() != mAddModeProxyModel) { + mMenuView->setModel(mAddModeProxyModel); + } +} + +/*! Slot invoked when a state is exited. */ void HsAllAppsState::stateExited() @@ -337,6 +357,9 @@ if (!(flags & RemovableEntryFlag)) { uninstallAction->setVisible(false); } + + addToHomeScreenAction->setVisible( + !HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(entry.data())); } /*! diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallcollectionsstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -85,17 +85,15 @@ { HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::setMenuOptions"); - QScopedPointer viewOptions(new HbMenu); - - viewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + mViewOptions->clearActions(); + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), static_cast(this), SLOT(openTaskSwitcher())); - viewOptions->addAction(hbTrId("txt_applib_opt_new_collection"), + mViewOptions->addAction(hbTrId("txt_applib_opt_new_collection"), this, SLOT(createNewCollection())); - viewOptions->addAction(hbTrId("txt_applib_opt_arrange"), + mViewOptions->addAction(hbTrId("txt_applib_opt_arrange"), this, SLOT(createArrangeCollection())); - mMenuView->view()->setMenu(viewOptions.take()); HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::setMenuOptions"); } @@ -153,7 +151,7 @@ */ void HsAllCollectionsState::normalModeExited() { - mMenuView->view()->setMenu(NULL); + } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibrarystate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -118,7 +118,7 @@ mAllCollectionsState = new HsAllCollectionsState(mMenuViewBuilder, mMenuMode, mMainWindow, this); - + QState *initialState = new QState(this); setInitialState(initialState); @@ -135,12 +135,12 @@ this); connect(mCollectionState, SIGNAL(entered()),SLOT(clearToolbarLatch())); - + HsMenuEventTransition *openCollectionFromAppLibTransition = new HsMenuEventTransition(HsMenuEvent::OpenCollectionFromAppLibrary, this, mCollectionState); this->addTransition(openCollectionFromAppLibTransition); - + //It is called from: HsDefaultRuntime::activityRequested(const QString &name) HsMenuEventTransition *openCollectionAfterActivityRequest = new HsMenuEventTransition(HsMenuEvent::OpenCollection, @@ -183,7 +183,7 @@ connect(mAllCollectionsState, SIGNAL(entered()), this, SLOT(allCollectionsStateEntered())); - + HSMENUTEST_FUNC_EXIT("HsAppLibraryState::construct"); } @@ -197,19 +197,19 @@ HSMENUTEST_FUNC_ENTRY("HsAppLibraryState::onEntry"); QState::onEntry(event); - if (static_cast(event)->operation() != + if (static_cast(event)->operation() != HsMenuEvent::OpenCollectionFromAppLibrary) { // we are back from HS, scroll those views to top mAllAppsState->scrollToBeginning(); - mAllCollectionsState->scrollToBeginning(); + mAllCollectionsState->scrollToBeginning(); } - + if (event->type() == HsMenuEvent::eventType()) { HsMenuEvent *menuEvent = static_cast(event); QVariantMap data = menuEvent->data(); mMenuMode.setHsMenuMode( - static_cast(data.value(menuModeType()).toInt()), + static_cast(data.value(menuModeType()).toInt()), data.value(HOMESCREENDATA)); } else { mMenuMode.setHsMenuMode(NormalHsMenuMode); @@ -230,16 +230,14 @@ HsOperatorHandler *const operatorHandler = new HsOperatorHandler(this); - const bool operatorActionAvailable = !operatorHandler->icon().isNull(); - - if (operatorActionAvailable) { + if (operatorHandler->oviStorePresent() + && operatorHandler->operatorStorePresent()) { //TODO HbToolBarExtension is not supported in docml currently //should be changed in future bool loaded = HbStyleLoader::registerFilePath( ":/css/hsapplibrarystateplugin.css"); Q_ASSERT(loaded); - HbAction *const operatorAction(mMenuViewBuilder.operatorAction()); HbToolBarExtension *const extension( mMenuViewBuilder.toolBarExtension()); @@ -248,25 +246,31 @@ extensionAction->setIcon(HbIcon("qtg_mono_store")); - operatorAction->setIcon(operatorHandler->icon()); + HbAction *const operatorAction( + operatorHandler->prepareOperatorStoreAction( + mMenuViewBuilder.operatorAction())); operatorAction->setText(hbTrId(operatorHandler->text().toLatin1())); //TODO: no locstring for ovi store currently mMenuViewBuilder.oviStoreAction()->setText("Ovi Store"); - - connect(mMenuViewBuilder.operatorAction(), SIGNAL(triggered()), - operatorHandler, SLOT(action())); - - extension->addAction(mMenuViewBuilder.oviStoreAction()); - extension->addAction(operatorAction); - - } else { + if (operatorHandler->operatorStoreFirst()) { + extension->addAction(operatorAction); + extension->addAction(mMenuViewBuilder.oviStoreAction()); + } else { + extension->addAction(mMenuViewBuilder.oviStoreAction()); + extension->addAction(operatorAction); + } + } else if (operatorHandler->oviStorePresent()) { mMenuViewBuilder.toolBar()->addAction( mMenuViewBuilder.oviStoreAction()); + } else if (operatorHandler->operatorStorePresent()) { + mMenuViewBuilder.toolBar()->addAction( + operatorHandler->prepareOperatorStoreAction( + mMenuViewBuilder.operatorAction())); } - - HbAction *const allCollectionsAction(mMenuViewBuilder.allCollectionsAction()); + HbAction *const allCollectionsAction( + mMenuViewBuilder.allCollectionsAction()); mAllAppsState->addTransition( allCollectionsAction, SIGNAL(triggered()), mAllCollectionsState); @@ -308,12 +312,12 @@ int HsAppLibraryState::oviStoreAction() { HSMENUTEST_FUNC_ENTRY("HsAppLibraryState::oviStoreAction"); - + CaEntry oviEntry; oviEntry.setEntryTypeName(applicationTypeName()); - oviEntry.setAttribute( applicationUidEntryKey(), + oviEntry.setAttribute( applicationUidEntryKey(), QString::number(oviLauncherApplicationUid)); - + int result = CaService::instance()->executeCommand(oviEntry); if (result) { oviEntry.setEntryTypeName(urlTypeName()); @@ -321,7 +325,7 @@ QString("https://store.ovi.com/applications/")); result = CaService::instance()->executeCommand(oviEntry); } - + HSMENUTEST_FUNC_EXIT("HsAppLibraryState::oviStoreAction"); return result; } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibstateutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsapplibstateutils.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Utils for application library state plugin. + * + */ + +#include + +#include "hsapplibstateutils.h" +#include "hscontentservice.h" +#include "hsapp_defs.h" + +/*! + \class HsAppLibStateUtils + \ingroup group_hsmenustateplugin + \brief Utils. + Utils for application library state plugin. + */ + +/*! + Return true if given entry is cwrt widget and already on homescreen + */ +bool HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(const CaEntry *entry) +{ + bool result = false; + if (entry->entryTypeName() == applicationTypeName() && + entry->attribute(swTypeKey()) == HS_CWRT_APP_TYPE && + entry->attribute(widgetUriAttributeName()) == + HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE) { + QVariantHash preferences; + QMap attributes = entry->attributes(); + QMapIterator i(attributes); + while (i.hasNext()) { + i.next(); + QString key(i.key()); + QString value(i.value()); + if (key.contains(widgetParam())) { + preferences.insert(key.remove(widgetParam()),value); + } + } + int count(0); + HsContentService::instance()->widgets(HS_WIDGET_URI_ATTRIBUTE_CWRT_VALUE,preferences,count); + result = count > 0; + } + return result; +} diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsbaseviewstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -53,6 +53,7 @@ mMainWindow(mainWindow) { mBackKeyAction = new HbAction(Hb::BackNaviAction, this); + mViewOptions = new HbMenu; } /*! @@ -75,6 +76,7 @@ mMainWindow(mainWindow) { mBackKeyAction = new HbAction(Hb::BackNaviAction, this); + mViewOptions = new HbMenu; } /*! Initialize contained objects. @@ -87,6 +89,7 @@ { mMenuView.reset(new HsMenuView(menuViewBuilder, stateContext, mMainWindow)); mMenuView->view()->setNavigationAction(mBackKeyAction); + mMenuView->view()->setMenu(mViewOptions); connect(this, SIGNAL(entered()),SLOT(stateEntered())); connect(this, SIGNAL(exited()),SLOT(stateExited())); @@ -139,7 +142,7 @@ mMenuView->hideSearchPanel(); mMenuView->disconnect(this); - mMenuView->view()->setMenu(NULL); + mMenuView->inactivate(); if (!mApplicationLaunchFailMessage.isNull()) { mApplicationLaunchFailMessage->close(); @@ -153,6 +156,7 @@ */ void HsBaseViewState::addModeEntered() { + mViewOptions = mMenuView->view()->takeMenu(); connect(mMenuView.data(), SIGNAL(activated(QModelIndex)), SLOT(addActivated(QModelIndex))); @@ -162,7 +166,15 @@ } /*! - Slot invoked when add mode entered. + Add mode exited. + */ +void HsBaseViewState::addModeExited() +{ + mMenuView->view()->setMenu(mViewOptions); +} + +/*! + Slot invoked when normal mode entered. */ void HsBaseViewState::normalModeEntered() { @@ -182,6 +194,8 @@ HsBaseViewState::~HsBaseViewState() { delete mModel; + mViewOptions = mMenuView->view()->takeMenu(); + delete mViewOptions; } /*! @@ -193,15 +207,12 @@ HSMENUTEST_FUNC_ENTRY("HsBaseViewState::launchItem"); QSharedPointer entry = mModel->entry(index); - if (!entry.isNull()) { + if (!entry.isNull() && !(entry->flags() & UninstallEntryFlag)) { if (entry->entryTypeName() == widgetTypeName()) { - EntryFlags flags = entry->flags(); - if (!(flags & UninstallEntryFlag)) { - machine()->postEvent(HsMenuEventFactory::createPreviewHSWidgetEvent(entry->id(), - entry->entryTypeName(), entry->attribute(widgetUriAttributeName()), - entry->attribute(widgetLibraryAttributeName()))); - HsMenuService::touch(entry->id()); - } + machine()->postEvent(HsMenuEventFactory::createPreviewHSWidgetEvent(entry->id(), + entry->entryTypeName(), entry->attribute(widgetUriAttributeName()), + entry->attribute(widgetLibraryAttributeName()))); + HsMenuService::touch(entry->id()); } else { int errCode = HsMenuService::executeAction(entry->id()); @@ -320,6 +331,7 @@ QState *addModeState = new QState(this); connect(addModeState, SIGNAL(entered()),SLOT(addModeEntered())); + connect(addModeState, SIGNAL(exited()),SLOT(addModeExited())); QState *normalModeState = new QState(this); connect(normalModeState, SIGNAL(entered()),SLOT(normalModeEntered())); diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -36,6 +36,7 @@ #include "hsmenuitemmodel.h" #include "hscollectionstate.h" #include "hsaddappstocollectionstate.h" +#include "hsapplibstateutils.h" /*! \class HsCollectionState @@ -170,41 +171,41 @@ EntryFlags flags = mModel->root().data(CaItemModel::FlagsRole).value (); - QScopedPointer viewOptions(new HbMenu); + mViewOptions->clearActions(); - viewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), static_cast(this), SLOT(openTaskSwitcher())); if (flags & RemovableEntryFlag) { - viewOptions->addAction(hbTrId("txt_applib_opt_add_content"), this, + mViewOptions->addAction(hbTrId("txt_applib_opt_add_content"), this, SLOT(addAppsAction())); } - viewOptions->addAction(hbTrId("txt_applib_opt_add_to_home_screen"), + mViewOptions->addAction(hbTrId("txt_applib_opt_add_to_home_screen"), this, SLOT(addCollectionShortcutToHomeScreenAction())); if (flags & RemovableEntryFlag) { if (mModel->rowCount() > 0) { - viewOptions->addAction( + mViewOptions->addAction( hbTrId("txt_applib_opt_arrange"), this, SLOT(createArrangeCollection())); } - viewOptions->addAction( + mViewOptions->addAction( hbTrId("txt_common_opt_rename_item"), this, SLOT(renameAction())); - viewOptions->addAction( + mViewOptions->addAction( hbTrId("txt_common_opt_delete"), this, SLOT(deleteAction())); } if (mCollectionType == collectionDownloadedTypeName()) { - HbMenu *sortMenu = viewOptions->addMenu( + HbMenu *sortMenu = mViewOptions->addMenu( hbTrId("txt_applib_opt_sort_by")); //Grouped options are exclusive by default. - QActionGroup *sortGroup = new QActionGroup(viewOptions.data()); + QActionGroup *sortGroup = new QActionGroup(this); sortGroup->addAction( sortMenu->addAction( hbTrId("txt_applib_opt_sort_by_sub_latest_on_top"), @@ -221,7 +222,7 @@ static const int defaultSortingPosition = 0; sortGroup->actions().at(defaultSortingPosition)->setChecked(true); } - mMenuView->view()->setMenu(viewOptions.take()); + mMenuView->view()->setMenu(mViewOptions); HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::setMenuOptions"); } @@ -478,9 +479,9 @@ HbAction *openAction = mContextMenu->addAction(hbTrId( "txt_common_menu_open")); openAction->setData(OpenContextAction); - HbAction *addShortcutAction = mContextMenu->addAction(hbTrId( + HbAction *addToHomeScreenAction = mContextMenu->addAction(hbTrId( "txt_applib_menu_add_to_home_screen")); - addShortcutAction->setData(AddToHomeScreenContextAction); + addToHomeScreenAction->setData(AddToHomeScreenContextAction); HbAction *addToCollection = mContextMenu->addAction(hbTrId( "txt_applib_menu_add_to_collection")); addToCollection->setData(AddToCollectionContextAction); @@ -518,6 +519,9 @@ "txt_common_menu_details")); appDetailsAction->setData(AppDetailsContextAction); } + + addToHomeScreenAction->setVisible( + !HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(entry.data())); } /*! diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -79,15 +79,15 @@ void HsInstalledAppsState::setMenuOptions() { HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::setMenuOptions"); - HbMenu *const mOptions = new HbMenu(); - mOptions->setParent(this); + + mViewOptions->clearActions(); - mOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), + mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"), this, SLOT(openTaskSwitcher())); - mOptions->addAction(hbTrId("txt_applib_opt_installation_log"), + mViewOptions->addAction(hbTrId("txt_applib_opt_installation_log"), this, SLOT(openInstallationLog())); - mMenuView->view()->setMenu(mOptions); + mMenuView->view()->setMenu(mViewOptions); HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::setMenuOptions"); } @@ -149,7 +149,9 @@ mMenuView->listView()->scrollTo( mModel->index(0)); } + setMenuOptions(); + connect(mMenuView.data(), SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), SLOT(showContextMenu(HbAbstractViewItem *, QPointF))); diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -16,20 +16,58 @@ */ #include -#include - +#include #include +#include #include #include "hsmenuitemmodel.h" #include "hslistviewitem.h" + +// TODO: this is only temporary class for show progress bar. +// It should be remove when fix from orbit will be in official platfrom. +// Remove it from header too. + +#ifdef COVERAGE_MEASUREMENT +#pragma CTC SKIP +#endif //COVERAGE_MEASUREMENT +void HsProgressBar::paint(QPainter * painter, + const QStyleOptionGraphicsItem * option, + QWidget * widget) +{ + Q_UNUSED(widget) + QStyleOptionGraphicsItem pixmapOption(*option); + foreach (QGraphicsItem *child, childItems()) { + painter->save(); + painter->translate(child->pos()); + pixmapOption.exposedRect = child->boundingRect(); + child->paint(painter, &pixmapOption, 0); + + foreach (QGraphicsItem *child2, child->childItems()) { + if (child2->isVisible()) { + painter->save(); + painter->translate(child2->pos()); + pixmapOption.exposedRect = child2->boundingRect(); + child2->paint(painter, &pixmapOption, 0); + painter->restore(); + } + } + painter->restore(); + } +} +#ifdef COVERAGE_MEASUREMENT +#pragma CTC ENDSKIP +#endif //COVERAGE_MEASUREMENT + + HsListViewItem::HsListViewItem(QGraphicsItem* parent) : HbListViewItem(parent), progress(0), isProgress(false) { setGraphicsSize(LargeIcon); - HbStyleLoader::registerFilePath(":/layout/hslistviewitem.css"); - HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml"); + if (this == prototype()) { + HbStyleLoader::registerFilePath(":/layout/hslistviewitem.css"); + } } HsListViewItem::~HsListViewItem() @@ -44,41 +82,25 @@ { HbListViewItem::updateChildItems(); - // DisplayRoles - QVariant displayRole = modelIndex().data(Qt::DisplayRole); - QStringList stringList; - if (displayRole.isValid()) { - if (displayRole.canConvert()) { - stringList.append(displayRole.toString()); - } else if (displayRole.canConvert()) { - stringList = displayRole.toStringList(); - } - } EntryFlags flags = modelIndex().data( CaItemModel::FlagsRole).value (); isProgress = false; if (flags & UninstallEntryFlag) { isProgress = true; if (!progress) { - progress = new HbProgressBar(this); + progress = new HsProgressBar(this); + HbStyle::setItemName(progress, "progress"); progress->setRange(0, 100); - HbEffect::disable(progress); + HbEffect::disable(progress); repolish(); } int progresVal = modelIndex().data( CaItemModel::UninstalRole).toInt(); progress->setProgressValue(progresVal); - HbStyle::setItemName(progress, "progress"); - if (!progress->isVisible()) { - progress->setVisible(!progress->isVisible()); - repolish(); - } } else if (progress) { - HbStyle::setItemName(progress, ""); - if (progress->isVisible()) { - progress->setVisible(!progress->isVisible()); - repolish(); - } + delete progress; + progress = 0; + repolish(); } // hide text-2 if we have to foreach (QGraphicsItem * item, this->childItems()) { @@ -97,6 +119,13 @@ void HsListViewItem::polish(HbStyleParameters& params) { + if (isProgress) { + HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml"); + } HbListViewItem::setProperty("progress", isProgress); HbListViewItem::polish(params); + if (isProgress) { + HbStyleLoader::unregisterFilePath(":/layout/hslistviewitem.widgetml"); + } } + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -59,5 +59,6 @@ if (!hbW->views().contains(view)) { hbW->addView(view); } - hbW->setCurrentView(view); + bool animate = !hbW->isObscured(); + hbW->setCurrentView(view, animate); } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -76,7 +76,7 @@ connect(mListView, SIGNAL(longPressed(HbAbstractViewItem *, QPointF)), this, SIGNAL(longPressed(HbAbstractViewItem *, QPointF))); - + connect(mHsSearchView.data(), SIGNAL(activated(QModelIndex)), this, SIGNAL(activated(QModelIndex))); connect(mHsSearchView.data(), @@ -98,7 +98,7 @@ \param model Model the view is to represent in HsItemViewMode. */ -void HsMenuView::setModel(HsMenuItemModel *model) +void HsMenuView::setModel(QAbstractItemModel *model) { HSMENUTEST_FUNC_ENTRY("HsMenuView::setModel"); @@ -113,6 +113,7 @@ SIGNAL(listViewChange())); } + mListView->setItemPixmapCacheEnabled(true); // TODO: remove when enabled from default mListView->setModel(model, new HsListViewItem()); if (mListView->model()) { @@ -129,6 +130,13 @@ HSMENUTEST_FUNC_EXIT("HsMenuView::setModel"); } +/*! + Returns model for list item view. + */ +QAbstractItemModel *HsMenuView::model() const +{ + return mListView->model(); +} /*! \return View widget of the menu view. @@ -139,7 +147,7 @@ } /*! -\return List view widget of the menu view +\return List view widget of the menu view if available in the context or NULL otherwise. */ HbListView *HsMenuView::listView() const @@ -149,7 +157,7 @@ /*! Returns label appropriate for the view. - \return Pointer to the label + \return Pointer to the label if available in the context or NULL otherwise. */ HbGroupBox *HsMenuView::viewLabel() const @@ -158,7 +166,7 @@ } /*! -\return Collection button +\return Collection button if available in the context or NULL otherwise. */ HbPushButton *HsMenuView::contentButton() const @@ -281,21 +289,13 @@ HbAction *const backKeyAction(mView->navigationAction()); // now we can switch the context - - if (operationalContext != HsSearchContext) { - - mOperationalContext = operationalContext; - synchronizeCache(); + mOperationalContext = operationalContext; + synchronizeCache(); - if (mBuilder.currentViewLabel() != 0) { - mBuilder.currentViewLabel()->setHeading(viewLabelHeading); - } - - mView->setNavigationAction(backKeyAction); - - } else { - showSearchPanel(); + if (mBuilder.currentViewLabel() != 0) { + mBuilder.currentViewLabel()->setHeading(viewLabelHeading); } + mView->setNavigationAction(backKeyAction); } /*! @@ -304,7 +304,8 @@ it is in context matching the current HsMenuView. */ -void HsMenuView::switchBuilderContext() { +void HsMenuView::switchBuilderContext() +{ mBuilder.setStateContext(mStateContext); mBuilder.setOperationalContext(mOperationalContext); } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -36,14 +35,14 @@ static const char* DOCUMENT_BASE_NAME_MAP [InvalidStateContext][InvalidOperationalContext] = - /*HsItemViewContext, HsSearchContext, HsButtonContext, HsEmptyLabelContext*/ + /*HsItemViewContext, HsButtonContext, HsEmptyLabelContext*/ { -/*HsAllAppsContext*/ {"listview", "searchlistview", "listview", "listview"}, -/*HsAllCollectionsContext*/ {"listview", "searchlistview", "listview", "listview"}, +/*HsAllAppsContext*/ {"listview", "listview", "listview"}, +/*HsAllCollectionsContext*/ {"listview", "listview", "listview"}, /*HsInstalledAppsContext*/ {"labeledlistview", "labeledlistview", - "labeledlistview", "emptylabeledview"}, -/*HsCollectionContext*/ {"labeledlistview", "searchlabeledlistview", - "addcontentlabeledview", "emptylabeledview"} + "emptylabeledview"}, +/*HsCollectionContext*/ {"labeledlistview", "addcontentlabeledview", + "emptylabeledview"} }; static const QString DOCUMENT_NAME_PREFIX(QLatin1String(":/xml/")); @@ -53,7 +52,6 @@ static const QString VIEW_NAME(QLatin1String("view")); static const QString LIST_VIEW_NAME(QLatin1String("listView")); static const QString VIEW_LABEL_NAME(QLatin1String("label")); -static const QString SEARCH_PANEL_NAME(QLatin1String("searchPanel")); static const QString ADD_CONTENT_BUTTON_NAME(QLatin1String("addContentButton")); /*! @@ -71,7 +69,7 @@ /*! - \return Pointer to the view resulting from last \a build call or NULL if + \return Pointer to the view resulting from last \a build call or NULL if the \a build has not yet been called. Memory ownership is not changed. */ @@ -87,7 +85,7 @@ } /*! - \return Pointer to list view resulting from last \a build call or NULL if + \return Pointer to list view resulting from last \a build call or NULL if the \a build has not yet been called. The pointer is valid until the HsMenuViewBuilder instance is destroyed. Memory ownership is not changed. @@ -102,7 +100,7 @@ } /*! - \return Pointer to the view label resulting from last \a build call. It is + \return Pointer to the view label resulting from last \a build call. It is guaranteed to be not NULL if the \a build was called for the context related to view including label. The pointer is valid until the HsMenuViewBuilder instance is destroyed. @@ -118,22 +116,6 @@ } /*! - \return Pointer to the search panel resulting from last \a build call. It is - guaranteed to be not NULL if the \a build was called for the context - related to view including label. - The pointer is valid until the HsMenuViewBuilder instance is destroyed. - Memory ownership is not changed. - */ -HbSearchPanel *HsMenuViewBuilder::currentSearchPanel() -{ - HbSearchPanel *searchPanel = - qobject_cast(currentLoader()->findWidget( - SEARCH_PANEL_NAME)); - return searchPanel; - -} - -/*! \return Pointer to the 'Add content' button resulting from last \a build call. It is guaranteed to be not NULL if the \a build was called for the context @@ -252,15 +234,11 @@ Loads non-context sensitive objects. */ HsMenuViewBuilder::HsMenuViewBuilder(): - DOCUMENT_FILE_NAME(":/xml/applibrary.docml"), ALL_APPS_ACTION_NAME("allAppsAction"), ALL_COLLECTIONS_ACTION_NAME("allCollectionsAction"), SEARCH_ACTION_NAME("searchAction"), OVI_STORE_ACTION_NAME("oviStoreAction"), OPERATOR_ACTION_NAME("operatorAction"), - SEARCH_PANEL_NAME("searchPanel"), - BUTTON_NAME("collectionButton"), - TOOL_BAR_NAME("toolBar"), mToolBar(new HbToolBar), mToolBarExtension(new HbToolBarExtension), mStateContext(HsAllAppsContext), diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -16,12 +16,18 @@ */ #include "hsoperatorhandler.h" -#ifndef NO_QT_EXTENSIONS -#include "hsoperatorhandler_p.h" + +#include + +#ifdef QT_EXTENSIONS + #include "hsoperatorhandler_p.h" #else -#include + #include #endif + + + /*! \class HsOperatorHandler \ingroup group_hsmenustateplugin @@ -37,7 +43,7 @@ */ HsOperatorHandler::HsOperatorHandler(QObject *parent): QObject(parent), -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS m_q(new HsOperatorHandlerPrivate(this)) #else m_q(0) @@ -58,7 +64,7 @@ */ HbIcon HsOperatorHandler::icon() { -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS return m_q->icon(); #else return HbIcon(); @@ -71,7 +77,7 @@ */ QString HsOperatorHandler::text() { -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS return m_q->text(); #else return QString(); @@ -80,13 +86,64 @@ /*! - Open Operator application or related url + Open Operator application or related url action */ void HsOperatorHandler::action() { -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS m_q->action(); #endif } +/*! + Returns Operator Store presence value predefined in Central Repositoryicon + \retval true if Operator Store should be present in toolbar + */ +bool HsOperatorHandler::operatorStorePresent() +{ +#ifdef QT_EXTENSIONS + return m_q->operatorStorePresent(); +#else + return false; +#endif +} +/*! + Returns Ovi Store presence value predefined in Central Repositoryicon + \retval true if Ovi Store should be present in toolbar + */ +bool HsOperatorHandler::oviStorePresent() +{ +#ifdef QT_EXTENSIONS + return m_q->oviStorePresent(); +#else + return false; +#endif +} + +/*! + Returns if Operator Store should first in toolbar + \retval true if Operator Store should first in toolbar + */ +bool HsOperatorHandler::operatorStoreFirst() +{ +#ifdef QT_EXTENSIONS + return m_q->operatorStoreFirst(); +#else + return false; +#endif +} + +/*! + Prepares HbAction for Operator Store + \param HbAction to prepare + \retval HbAction prepared action + */ +HbAction *HsOperatorHandler::prepareOperatorStoreAction( + HbAction *const operatorAction) +{ + operatorAction->setIcon(icon()); + connect(operatorAction, SIGNAL(triggered()), this, SLOT(action())); + return operatorAction; +} + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler_p.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -14,21 +14,27 @@ * Description: hsoperatorhandler_p.cpp * */ -#ifndef NO_QT_EXTENSIONS +#ifdef QT_EXTENSIONS #include -#include #include #include "hsoperatorhandler_p.h" #include "hsmenuservice.h" #include "caentry.h" #include "caservice.h" -const int AppLibUid = 0x20022F97; -const int IconId = 0x00000001; -const int OperatorAppUid = 0x00000002; -const int OperatorUrl = 0x00000003; -const int OperatorText = 0x00000004; +const int AppLibUid = 0x20022F97; +const int IncludeOperatorStore = 0x00000001; +const int OperatorStoreType = 0x00000002; +const int OperatorStoreTitle = 0x00000003; +const int OperatorStoreURL = 0x00000004; +const int OperatorStoreIconSkinID = 0x00000005; +const int OperatorStoreApplication = 0x00000006; +const int OperatorStore1stPopUp = 0x00000007; +const int RemoveOviStore = 0x00000008; +const char *operatorStoreIconPath + = "z:/private/20022F35/customsvg/operatorstore.svg"; + // ======== MEMBER FUNCTIONS ======== @@ -38,9 +44,13 @@ */ HsOperatorHandlerPrivate::HsOperatorHandlerPrivate(QObject *parent): QObject(parent), + mOviStorePresent(false), + mOperatorStorePresent(false), + mStoreType(NoneType), mOperatorEntry(0), mIcon(), - mText() + mOperatorStoreTitle(), + mOperatorStoreFirst(false) { readCentralRepository(); } @@ -72,12 +82,39 @@ } /*! - Returns Operator icon predefined in Central Repositoryicon - \retval icon + Returns Operator title text predefined in Central Repositoryicon + \retval text */ QString HsOperatorHandlerPrivate::text() { - return mText; + return mOperatorStoreTitle; +} + +/*! + Returns Ovi Store presence value predefined in Central Repositoryicon + \retval true if Ovi Store should be present in toolbar + */ +bool HsOperatorHandlerPrivate::oviStorePresent() +{ + return mOviStorePresent; +} + +/*! + Returns Operator Store presence value predefined in Central Repositoryicon + \retval true if Operator Store should be present in toolbar + */ +bool HsOperatorHandlerPrivate::operatorStorePresent() +{ + return mOperatorStorePresent; +} + +/*! + Returns if Operator Store should first in toolbar + \retval true if Operator Store should first in toolbar + */ +bool HsOperatorHandlerPrivate::operatorStoreFirst() +{ + return mOperatorStoreFirst; } /*! @@ -87,41 +124,15 @@ */ HbIcon HsOperatorHandlerPrivate::createIcon(XQSettingsManager *crManager) { - qDebug("HsOperatorHandlerPrivate::createIcon"); - HbIcon icon; - - XQCentralRepositorySettingsKey iconKey(AppLibUid, IconId); - QVariant iconVarian = crManager->readItemValue( - iconKey, XQSettingsManager::TypeString); - - if (!iconVarian.isNull() && !iconVarian.toString().isEmpty()) { - qDebug() << "HsOperatorHandlerPrivate::createIcon" - << iconVarian.toString(); - icon = HbIcon(iconVarian.toString()); + QVariant variant = getVariantFromKey( + crManager, + OperatorStoreIconSkinID, + XQSettingsManager::TypeString); + if (!variant.isNull() && !variant.toString().isEmpty()) { + return HbIcon(variant.toString()); + } else { + return HbIcon(operatorStoreIconPath); } - return icon; -} - -/*! - Creates text based on Central Repository - \param crManager settings manager - \retval icon - */ -QString HsOperatorHandlerPrivate::readText(XQSettingsManager *crManager) -{ - qDebug("HsOperatorHandlerPrivate::readText"); - QString text; - - XQCentralRepositorySettingsKey textKey(AppLibUid, OperatorText); - QVariant textVariant = crManager->readItemValue( - textKey, XQSettingsManager::TypeString); - - if (!textVariant.isNull() && textVariant.isValid()) { - qDebug() << "HsOperatorHandlerPrivate::createIcon" - << textVariant.toString(); - text = textVariant.toString(); - } - return text; } /*! @@ -132,19 +143,14 @@ CaEntry *HsOperatorHandlerPrivate::createAppEntry( XQSettingsManager *crManager) { - qDebug("HsOperatorHandlerPrivate::createAppEntry"); - XQCentralRepositorySettingsKey appUidKey(AppLibUid, OperatorAppUid); - QVariant appUidVariant = crManager->readItemValue( - appUidKey, XQSettingsManager::TypeString); - - if (!appUidVariant.isNull() && !appUidVariant.toString().isEmpty()) { - qDebug() << "HsOperatorHandlerPrivate::createAppEntry" - << appUidVariant.toString(); - + QVariant variant = getVariantFromKey( + crManager, OperatorStoreApplication, XQSettingsManager::TypeString); + if (!variant.isNull()) { CaEntry *operatorEntry = new CaEntry; operatorEntry->setEntryTypeName(applicationTypeName()); operatorEntry->setAttribute( - applicationUidEntryKey(), appUidVariant.toString()); + applicationUidEntryKey(), variant.toString()); + return operatorEntry; } return NULL; @@ -158,20 +164,104 @@ CaEntry *HsOperatorHandlerPrivate::createUrlEntry( XQSettingsManager *crManager) { - qDebug("HsOperatorHandlerPrivate::createUrlEntry"); - CaEntry *operatorEntry = new CaEntry; + QVariant variant = getVariantFromKey( + crManager, OperatorStoreURL, XQSettingsManager::TypeString); + if (!variant.isNull()) { + CaEntry *operatorEntry = new CaEntry; + operatorEntry->setEntryTypeName(urlTypeName()); + operatorEntry->setAttribute(urlEntryKey(), variant.toString()); + + return operatorEntry; + } + return NULL; +} + - XQCentralRepositorySettingsKey urlKey(AppLibUid, OperatorUrl); - QVariant urlVariant = crManager->readItemValue( - urlKey, XQSettingsManager::TypeString); +/*! + Generic function to get stores presence values + \param crManager settings manager + \param storePresenceKey store key(Ovi or Operator) + \retval entry + */ +bool HsOperatorHandlerPrivate::storeValue( + XQSettingsManager *crManager, int storePresenceKey) +{ + QVariant variant = getVariantFromKey( + crManager, storePresenceKey, XQSettingsManager::TypeInt); + if (!variant.isNull()) { + return bool(variant.toInt()); + } + return false; +} + +/*! + Generic function to get QVariant for CR key + \param crManager settings manager + \param crKey CR key + \param type type of QVariant to be returned + \retval QVariant + */ +QVariant HsOperatorHandlerPrivate::getVariantFromKey( + XQSettingsManager *crManager, int crKey, XQSettingsManager::Type type) +{ + XQCentralRepositorySettingsKey presenceKey(AppLibUid, crKey); + QVariant presenceVariant = crManager->readItemValue( + presenceKey, type); - if (!urlVariant.isNull() && !urlVariant.toString().isEmpty()) { - operatorEntry->setEntryTypeName(urlTypeName()); - operatorEntry->setAttribute(urlEntryKey(), urlVariant.toString()); - qDebug() << "HsOperatorHandlerPrivate::createUrlEntry" - << urlVariant.toString(); + if (presenceVariant.isValid()) { + qDebug() << "HsOperatorHandlerPrivate::storePresent" + << presenceVariant.toInt(); + return presenceVariant; + } + return QVariant(); +} + +/*! + Generic function to get store type(Url/App) + \param crManager settings manager + \retval HsStoreType store type + */ +HsOperatorHandlerPrivate::HsStoreType + HsOperatorHandlerPrivate::operatorStoreType( + XQSettingsManager *crManager) +{ + QVariant variant = getVariantFromKey( + crManager, OperatorStoreType, XQSettingsManager::TypeInt); + if (!variant.isNull()) { + return HsOperatorHandlerPrivate::HsStoreType(variant.toInt()); } - return operatorEntry; + return NoneType; +} + +/*! + Creates text based on Central Repository + \param crManager settings manager + \retval icon + */ +QString HsOperatorHandlerPrivate::operatorStoreTitle(XQSettingsManager *crManager) +{ + QVariant variant = getVariantFromKey( + crManager, OperatorStoreTitle, XQSettingsManager::TypeString); + if (!variant.isNull()) { + return variant.toString(); + } + return QString(); +} + +/*! + Retrives information if Operator Store should first in toolbarbased + (from Central Repository) + \param crManager settings manager + \retval true if Operator Store should be first + */ +bool HsOperatorHandlerPrivate::operatorStoreFirst(XQSettingsManager *crManager) +{ + QVariant variant = getVariantFromKey( + crManager, OperatorStore1stPopUp, XQSettingsManager::TypeInt); + if (!variant.isNull()) { + return bool(variant.toInt()); + } + return false; } /*! @@ -180,12 +270,21 @@ void HsOperatorHandlerPrivate::readCentralRepository() { XQSettingsManager *crManager = new XQSettingsManager; + //this key indicates that ovi store should be removed + mOviStorePresent = !storeValue(crManager, RemoveOviStore); + //this key indicates that operator store should be added + mOperatorStorePresent = storeValue(crManager, IncludeOperatorStore); - mIcon = createIcon(crManager); - mText = readText(crManager); - mOperatorEntry = createAppEntry(crManager); - if (!mOperatorEntry) { - mOperatorEntry = createUrlEntry(crManager); + if (mOperatorStorePresent) { + mStoreType = operatorStoreType(crManager); + if (mStoreType == ApplicationType) { + mOperatorEntry = createAppEntry(crManager); + } else { + mOperatorEntry = createUrlEntry(crManager); + } + mOperatorStoreTitle = operatorStoreTitle(crManager); + mOperatorStoreFirst = operatorStoreFirst(crManager); + mIcon = createIcon(crManager); } delete crManager; } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchview.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -15,6 +15,8 @@ * */ +#include +#include #include #include @@ -23,8 +25,6 @@ #include #include #include -#include -#include #include @@ -40,11 +40,10 @@ */ HsSearchView::HsSearchView(HsMenuViewBuilder &builder, HsStateContext stateContext, HsMainWindow &mainWindow) : - mProxyModel(new QSortFilterProxyModel(this)), - mSearchView(NULL), + mProxyModel(new QSortFilterProxyModel(this)), mSearchView(NULL), mSearchListView(NULL), mSearchPanel(NULL), mStateContext(stateContext), mBuilder(builder), mMainWindow(mainWindow), mListView(NULL), - mVkbHost(NULL) + mVkbHost(NULL), mSearchViewBuilder(), mEmptyResultText(true) { mProxyModel->setFilterRole(CaItemModel::TextRole); mProxyModel->setFilterKeyColumn(1); @@ -70,17 +69,12 @@ HSMENUTEST_FUNC_ENTRY("HsMenuView::setSearchPanelVisible"); if (visible && !isActive()) { - searchBegins(); - connectSearchItemViewsSignals(); connectSearchPanelSignals(); - } else if (isActive()) { - disconnectSearchPanelSignals(); disconnectSearchItemViewsSignals(); - searchFinished(); } HSMENUTEST_FUNC_EXIT("HsMenuView::setSearchPanelVisible"); @@ -88,20 +82,16 @@ /*! \param view List view to operate on. - \return Index of F=first visible item of \a view if any + \return Index of F=first visible item of \a view if any or default QModelIndex otherwise. */ QModelIndex HsSearchView::firstVisibleItemIndex(const HbListView *view) const { - QModelIndex result; - - const QList array = - view->visibleItems(); - - if (array.count() >= 1) { - result = array[0]->modelIndex(); + const QList array = view->visibleItems(); + if (array.count()) { + return array[0]->modelIndex(); } - return result; + return QModelIndex(); } /*! @@ -121,37 +111,45 @@ mProxyModel->setFilterRegExp( QRegExp(QString(".*"), Qt::CaseInsensitive, QRegExp::RegExp)); - QString viewLabelHeading; - - if (mBuilder.currentViewLabel() != 0) { - viewLabelHeading = mBuilder.currentViewLabel()->heading(); - } - - setSearchContext(); - - mSearchView = mBuilder.currentView(); - mSearchListView = mBuilder.currentListView(); - mSearchPanel = mBuilder.currentSearchPanel(); + mSearchView = mSearchViewBuilder.searchView(); + mSearchListView = mSearchViewBuilder.searchListView(); + mSearchPanel = mSearchViewBuilder.searchPanel(); initSearchPanel(*mSearchPanel); mVkbHost.reset(new HbShrinkingVkbHost(mSearchView)); - if (mBuilder.currentViewLabel() != 0) { - mBuilder.currentViewLabel()->setHeading(viewLabelHeading); + if (mBuilder.currentViewLabel()) { + mSearchViewBuilder.searchViewLabel()->setHeading( + mBuilder.currentViewLabel()->heading()); + mSearchViewBuilder.setSearchLabledContext(); } - mSearchView->hideItems(Hb::AllItems); - mSearchListView->setModel(mProxyModel); - mSearchListView->setItemPrototype(new HsListViewItem()); + mSearchListView->setModel(mProxyModel, new HsListViewItem()); mMainWindow.setCurrentView(mSearchView); mSearchListView->scrollTo( mProxyModel->mapFromSource(mSearchViewInitialIndex), HbAbstractItemView::PositionAtTop); + + setNoResultsVisibility(); HSMENUTEST_FUNC_EXIT("HsSearchView::searchBegins"); } +/*! + Handles button visibility. + \param visibility indicates whether show or not to show 'empty' label. + */ +void HsSearchView::setNoResultsVisibility() +{ + if (mProxyModel->rowCount() && mEmptyResultText) { + mSearchViewBuilder.loadViewListSection(); + mEmptyResultText = false; + } else if (!mProxyModel->rowCount() && !mEmptyResultText) { + mSearchViewBuilder.loadViewEmptySection(); + mEmptyResultText = true; + } +} /* Connects \a activated and \a longPressed signals coming from search list @@ -197,6 +195,10 @@ */ void HsSearchView::connectSearchPanelSignals() { + connect(mProxyModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(setNoResultsVisibility())); + connect(mProxyModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(setNoResultsVisibility())); connect(mSearchPanel, SIGNAL(exitClicked()), this, SLOT(hideSearchPanel())); connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), @@ -210,10 +212,8 @@ */ void HsSearchView::disconnectSearchPanelSignals() { - disconnect(mSearchPanel, SIGNAL(exitClicked()), - this, SLOT(hideSearchPanel())); - disconnect(mSearchPanel, SIGNAL(criteriaChanged(QString)), - this, SLOT(findItem(QString))); + mProxyModel->disconnect(this); + mSearchPanel->disconnect(this); } /*! @@ -223,20 +223,21 @@ { HSMENUTEST_FUNC_ENTRY("HsSearchView::searchFinished"); - mIndexToScrollAfterSearchDone = - firstVisibleItemIndex(mSearchListView); + mIndexToScrollAfterSearchDone = firstVisibleItemIndex(mSearchListView); setOriginatingContext(); mMainWindow.setCurrentView(mBuilder.currentView()); - mListView->scrollTo(mProxyModel->mapToSource(mIndexToScrollAfterSearchDone), + mListView->scrollTo(mProxyModel->mapToSource( + mIndexToScrollAfterSearchDone), HbAbstractItemView::PositionAtTop); HbVkbHost::detachHost(mSearchView); mVkbHost.reset(NULL); mSearchListView = NULL; mSearchPanel = NULL; + mProxyModel->setSourceModel(NULL); HSMENUTEST_FUNC_EXIT("HsSearchView::searchFinished"); } @@ -249,8 +250,6 @@ qDebug() << "HsSearchView::findItem: " + criteriaStr; HSMENUTEST_FUNC_ENTRY("HsSearchView::findItem"); - mProxyModel->invalidate(); - mProxyModel->setSourceModel(mListView->model()); mProxyModel->setFilterRegExp( QRegExp("(^|\\b)" + criteriaStr, Qt::CaseInsensitive)); @@ -275,16 +274,16 @@ \param item Long pressed item. \param coords Coordinates of the long press action. */ -void HsSearchView::longPressedProxySlot(HbAbstractViewItem *item, - const QPointF &coords) +void HsSearchView::longPressedProxySlot( + HbAbstractViewItem *item, const QPointF &coords) { /* this is a kind of hack, introduced for reasons: item object should be reusable later, but orbit (or qt) prevents setting its index model to previous state */ - mSearchViewLongPressedIndex = - mProxyModel->mapToSource(item->modelIndex()); + mSearchViewLongPressedIndex = mProxyModel->mapToSource( + item->modelIndex()); QScopedPointer itemNew(item->createItem()); itemNew->setModelIndex(mSearchViewLongPressedIndex); emit longPressed(itemNew.data(), coords); @@ -301,8 +300,8 @@ lineEdit->setText(""); lineEdit->setFocus(); - lineEdit->setInputMethodHints(Qt::ImhNoPredictiveText | - Qt::ImhNoAutoUppercase); + lineEdit->setInputMethodHints( + Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase); } /*! @@ -315,15 +314,10 @@ HSMENUTEST_FUNC_ENTRY("HsSearchView::searchPanelLineEdit"); HbLineEdit *result(0); - foreach(QGraphicsItem *obj, searchPanel.childItems()) { - QGraphicsWidget *const widget = static_cast(obj); - if (widget != NULL) { - HbLineEdit *const lineEdit = qobject_cast(widget); - if (lineEdit != NULL) { result = lineEdit; break; @@ -346,15 +340,6 @@ } /*! - Sets the builder context to the one determined by \a mStateContext and - \a HsSearchContext. - */ -void HsSearchView::setSearchContext() -{ - mBuilder.setStateContext(mStateContext); - mBuilder.setOperationalContext(HsSearchContext); -} -/*! \retval true when search view is already invoked, \a false otherwise. */ bool HsSearchView::isActive() const diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchviewbuilder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hssearchviewbuilder.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Search View Builder + * + */ + +#include +#include +#include +#include +#include "hssearchviewbuilder.h" + +const char *searchDocmlFile = ":/xml/searchview.docml"; +const char *searchViewLabeledList = "searchViewLabeledList"; +const char *searchViewList = "searchViewList"; +const char *searchViewLabeledEmpty = "searchViewLabeledEmpty"; +const char *searchViewEmpty = "searchViewEmpty"; + + +/*! + \class HsSearchViewBuilder + \ingroup group_hsmenustateplugin + + \brief Search View Builder + + Reads UI object from Application Library Search docml + + \sa HsMenuView +*/ + +/*! + Constructor. Loads UI objects from docml. + */ +HsSearchViewBuilder::HsSearchViewBuilder() : mLoader(new HbDocumentLoader()), + mLabledContext(false) +{ + bool loadStatusOk(false); + mLoadedObjects = + mLoader->load(searchDocmlFile, &loadStatusOk).toSet(); + Q_ASSERT(loadStatusOk); +} + +/*! + Destructor. Deletes seto of loaded objects. + */ +HsSearchViewBuilder::~HsSearchViewBuilder() +{ + qDeleteAll(mLoadedObjects); +} + +/*! + \return Pointer to the view. + Memory ownership is not changed. + */ +HbView *HsSearchViewBuilder::searchView() +{ + return qobject_cast(mLoader->findWidget("view")); +} + +/*! + \return Pointer to list view. + The pointer is valid until the HsSearchViewBuilder instance is destroyed. + Memory ownership is not changed. + */ +HbListView *HsSearchViewBuilder::searchListView() +{ + return qobject_cast(mLoader->findWidget("listView")); +} + +/*! + \return Pointer to search panel. + The pointer is valid until the HsSearchViewBuilder instance is destroyed. + Memory ownership is not changed. + */ +HbSearchPanel *HsSearchViewBuilder::searchPanel() +{ + return qobject_cast(mLoader->findWidget("searchPanel")); +} + +/*! + \return Pointer to the view label. + The pointer is valid until the HsSearchViewBuilder instance is destroyed. + Memory ownership is not changed. + */ +HbGroupBox *HsSearchViewBuilder::searchViewLabel() +{ + return qobject_cast(mLoader->findWidget("label")); +} + +/*! + Switches HsSearchViewBuilder to labeled view layout. + */ +void HsSearchViewBuilder::setSearchLabledContext() +{ + mLabledContext = true; +} + +/*! + \return true if section was succesfull loaded. + Loads proper empty docml section. + */ +bool HsSearchViewBuilder::loadViewEmptySection() +{ + bool loadStatusOk(false); + if(mLabledContext) { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewLabeledEmpty, + &loadStatusOk).toSet(); + } else { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewEmpty, + &loadStatusOk).toSet(); + } + Q_ASSERT(loadStatusOk); + return loadStatusOk; +} + +/*! + \return true if section was succesfull loaded. + Loads proper list docml section. + */ +bool HsSearchViewBuilder::loadViewListSection() +{ + bool loadStatusOk(false); + if(mLabledContext) { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewLabeledList, + &loadStatusOk).toSet(); + } else { + mLoadedObjects |= mLoader->load( + searchDocmlFile, + searchViewList, + &loadStatusOk).toSet(); + } + Q_ASSERT(loadStatusOk); + return loadStatusOk; +} diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp --- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -336,6 +336,14 @@ animation->disconnect(this); animation->setEndValue(pageLayerXPos(targetPageIndex)); animation->setDuration(duration); + + if (abs(mDeltaX) < HSCONFIGURATION_GET(pageChangePanDistanceInPixels)) { + animation->setEasingCurve(HSCONFIGURATION_GET(bounceAnimationEasingCurve)); + } + else { + animation->setEasingCurve(HSCONFIGURATION_GET(pageChangeAnimationEasingCurve)); + } + connect(animation, SIGNAL(finished()), SLOT(pageChangeAnimationFinished()), diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamedialog.h --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamedialog.h Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hscollectionnamedialog.h Fri Aug 06 13:36:36 2010 +0300 @@ -35,9 +35,9 @@ virtual ~HsCollectionNameDialog(); - void open(QObject* receiver, const char* member ); - - QString newName(const QString &name, bool addLastName = false); + void open(QObject* receiver, const char* member); + + QString uniqueCollectionName() const; protected: void closeEvent( QCloseEvent * event ); @@ -47,6 +47,10 @@ void makeDisconnect(); + QString suggestedCollectionName(const QString &name); + + QString generateUniqueCollectionName(const QString &name) const; + private slots: void onTextChanged(const QString &text); @@ -58,13 +62,12 @@ /* * Collections names list from data model. */ - QStringList mCollectionsNames; + QStringList mOtherCollectionsNames; /* - * Last found collection name. + * Already suggested names. */ - QString mLastCollectionName; - + QStringList mSuggestedNames; }; #endif /* HS_INPUT_DIALOG_H */ diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsappchecklist.docml Fri Aug 06 13:36:36 2010 +0300 @@ -14,7 +14,7 @@ - + diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hscollectionslistdialog.docml Fri Aug 06 13:36:36 2010 +0300 @@ -7,6 +7,7 @@
+ diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml Fri Aug 06 13:36:36 2010 +0300 @@ -5,8 +5,8 @@ - + @@ -16,63 +16,62 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + @@ -92,8 +91,6 @@
- - @@ -103,81 +100,80 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + - + @@ -198,9 +194,18 @@ + + + + + + + +
- + +
diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -396,8 +396,8 @@ HbAction* finishedAction) { if (finishedAction == mEditorDialog->actions().value(0)) { - QString newName(mEditorDialog->newName( - mEditorDialog->value().toString(), true)); + QString newName( + mEditorDialog->uniqueCollectionName()); qDebug("HsAddAppsToCollectionState::newCollection() " "- emit collectionNameSelectedCl(newName)"); emit transitToSaveState(newName); @@ -499,7 +499,7 @@ HbNotificationDialog *notificationDialog = new HbNotificationDialog(); notificationDialog->setAttribute(Qt::WA_DeleteOnClose); notificationDialog->setTitle( - hbTrId("txt_applib_dpopinfo_added_to_collection_1") .arg( + hbTrId("txt_applib_dpophead_added_to_collection_1") .arg( HsMenuService::getName(id))); notificationDialog->show(); mShowConfirmation = false; diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -54,16 +54,22 @@ HsCollectionNameDialog::HsCollectionNameDialog(const int &itemId) { HSMENUTEST_FUNC_ENTRY("HsInputDialog::HsInputDialog"); - mCollectionsNames = HsMenuService::getCollectionNames(); + mOtherCollectionsNames = HsMenuService::getCollectionNames(); + + setInputMode(HbInputDialog::TextInput); setPromptText(hbTrId("txt_applib_title_collection_name")); lineEdit()->setMaxLength(qMaxStrLength); if (itemId) { - setValue(HsMenuService::getName(itemId)); - mCollectionsNames.removeOne(value().toString()); + const QString currentCollectionName( + HsMenuService::getName(itemId)); + setValue(currentCollectionName); + mOtherCollectionsNames.removeOne(currentCollectionName); + mSuggestedNames << currentCollectionName; } else { setValue(hbTrId("txt_applib_dialog_entry_collection")); } + HSMENUTEST_FUNC_EXIT("HsInputDialog::HsInputDialog"); } @@ -72,8 +78,8 @@ */ HsCollectionNameDialog::~HsCollectionNameDialog() { - mCollectionsNames.clear(); - mLastCollectionName.clear(); + mOtherCollectionsNames.clear(); + mSuggestedNames.clear(); } /*! @@ -95,6 +101,16 @@ } /*! + \return User input if it is unique collection name or an unique collection name being + a combination of user name and a suffix matching following regular expression: + "\([0-9][1-9]\)|\([1-9][0-9]+\)" + */ +QString HsCollectionNameDialog::uniqueCollectionName() const +{ + return generateUniqueCollectionName(value().toString()); +} + +/*! \reimp Disconnects signals and calls base class impl. which emits finished(HbAction*) */ @@ -106,41 +122,50 @@ } /*! - * Gets new collection's name. - \param name name of collection. - \param addLastName true - if last found name is need to add to validation - \retval new collection name. + \param name Input string which is to be basename + of resulting unique collection name. + \return Unique collection name. */ -QString HsCollectionNameDialog::newName(const QString &name, - bool addLastName) +QString HsCollectionNameDialog::generateUniqueCollectionName( + const QString &name) const { HSMENUTEST_FUNC_ENTRY("HsInputDialog::newName"); + QString newName(name); - int numToAppend(1); - if (addLastName && mLastCollectionName.length() > 0 - && !mCollectionsNames.contains(mLastCollectionName)) { - mCollectionsNames << mLastCollectionName; + + unsigned int numToAppend(1); + + while (mOtherCollectionsNames.contains(newName)) { + newName = + name + + QString("(%1)").arg(numToAppend, 2, 10, QLatin1Char('0')); + numToAppend++; } - while (mCollectionsNames.contains(newName)) { + + HSMENUTEST_FUNC_EXIT("HsInputDialog::newName"); + return newName; +} +/*! + \param name Input string which is to be basename + for suggested collection name. + \return Unique collection name if it was not yet proposed during lifetime of the dialog + or \a name otherwise. + */ +QString HsCollectionNameDialog::suggestedCollectionName(const QString &name) +{ + HSMENUTEST_FUNC_ENTRY("HsInputDialog::processInput"); + + QString newName = generateUniqueCollectionName(name); + + if (mSuggestedNames.contains(newName)) { newName = name; - newName.append("("); - if (numToAppend < 10) { - newName.append("0"); - } - newName.append(QString::number(numToAppend)); - newName.append(")"); - numToAppend++; - if (!addLastName) { - if (mLastCollectionName.length() > 0 - && !mCollectionsNames.contains(mLastCollectionName)) { - mCollectionsNames << mLastCollectionName; - } - mCollectionsNames.removeOne(name); - mLastCollectionName = name; - } } - HSMENUTEST_FUNC_EXIT("HsInputDialog::newName"); + + if (newName != name) { + mSuggestedNames << newName; + } + + HSMENUTEST_FUNC_EXIT("HsInputDialog::validate"); return newName; } @@ -184,7 +209,7 @@ actions()[0]->setEnabled(true); } - QString newText = newName(text); + QString newText = suggestedCollectionName(text); if (newText != text) { makeDisconnect(); lineEdit()->setText(newText); diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -111,7 +111,7 @@ void HsCollectionNameState::dialogFinished(HbAction* finishedAction) { if (finishedAction == mCollectionNameDialog->actions().value(0)) { - QString newName(mCollectionNameDialog->newName(mCollectionNameDialog->value().toString(), true)); + QString newName(mCollectionNameDialog->uniqueCollectionName()); if (mItemId) { if (newName != HsMenuService::getName(mItemId)) { HsMenuService::renameCollection(mItemId, newName); diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -123,7 +123,7 @@ mPreviewDialog->open(this, SLOT(previewDialogFinished(HbAction*))); } - + HSMENUTEST_FUNC_EXIT("HsPreviewHSWidgetState::onEntry"); } @@ -134,15 +134,17 @@ void HsPreviewHSWidgetState::cleanUp() { if (mPreviewDialog != NULL) { - mPreviewDialog->close(); + mPreviewDialog->disconnect(); + mPreviewDialog ->close(); mPreviewDialog = NULL; } if (mCorruptedMessage != NULL) { + mCorruptedMessage->disconnect(); mCorruptedMessage->close(); mCorruptedMessage = NULL; } - mEntryObserver.reset(0); + mToken = NULL; } diff -r 87476091b3f5 -r 1db7cc813a4e homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp --- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp Fri Jul 23 13:47:57 2010 +0300 +++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp Fri Aug 06 13:36:36 2010 +0300 @@ -230,7 +230,7 @@ { QString message; message.append( - HbParameterLengthLimiter("txt_applib_info_remove_1_all_its_shortcuts_and").arg( + HbParameterLengthLimiter("txt_applib_dialog_1_will_be_removed_from_phone_c").arg( HsMenuService::getName(mItemId))); // create and show message box