author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 13:29:51 +0300 | |
changeset 7 | 446dc0e90e84 |
parent 5 | 1c5fe9af5d39 |
child 8 | d57cb15a05fb |
child 9 | aa22d2c19e57 |
child 11 | 96bf8c13fa72 |
--- a/ftuapplication/inc/ftufirsttimeuse.h Thu May 27 12:45:45 2010 +0300 +++ b/ftuapplication/inc/ftufirsttimeuse.h Fri Jun 11 13:29:51 2010 +0300 @@ -26,7 +26,6 @@ FTU_TEST_CLASS(FtuFirstTimeUseTest) class QStateMachine; -class XQSettingsManager; /** * @ingroup group_ftuapplication @@ -122,8 +121,6 @@ */ QStateMachine* mRuntime; - XQSettingsManager* mSettingsManager; - FTU_TEST_FRIEND_CLASS(FtuFirstTimeUseTest) };
--- a/ftuapplication/src/ftufirsttimeuse.cpp Thu May 27 12:45:45 2010 +0300 +++ b/ftuapplication/src/ftufirsttimeuse.cpp Fri Jun 11 13:29:51 2010 +0300 @@ -26,8 +26,6 @@ #include <QDir> #include <QApplication> -#include "xqsettingskey.h" -#include "xqpublishandsubscribeutils.h" QTM_USE_NAMESPACE @@ -39,8 +37,6 @@ // -#include <xqpublishandsubscribeutils.h> -#include <xqpublishandsubscribesecuritypolicy.h> #include <QList> FtuFirstTimeUse::FtuFirstTimeUse(QObject* aParent) : @@ -75,13 +71,6 @@ FTUTEST_FUNC_EXIT("FTU::FtuFirstTimeUse::FtuFirstTimeUse"); - const quint32 KDefaultKey = 0x00000001; - const qint32 KFtuUidProperty = {0x20026F95}; //SID of FirstTimeUseApplication - - mSettingsManager = new XQSettingsManager(this); - XQPublishAndSubscribeUtils utils(*mSettingsManager); - XQPublishAndSubscribeSettingsKey pAndSKey(KFtuUidProperty, KDefaultKey); - bool err = utils.defineProperty(pAndSKey, XQSettingsManager::TypeInt); } // ---------------------------------------------------------------------------
--- a/stateproviders/ftustateprovider/inc/ftuwizardactivatedstate.h Thu May 27 12:45:45 2010 +0300 +++ b/stateproviders/ftustateprovider/inc/ftuwizardactivatedstate.h Fri Jun 11 13:29:51 2010 +0300 @@ -49,13 +49,6 @@ class FtuWizardActivatedState : public QState { Q_OBJECT -public: - /* - * The plugin's display mode enumeration. - * FullScreen means menustrip is not shown. - * PartialScreen means menustrip is shown. - */ - enum PluginDisplayMode{FullScreen, PartialScreen}; public: @@ -101,12 +94,6 @@ HbMainWindow* mainWindow(); /** - * Creates the menustrip. - * @since S60 ?S60_version. - */ - void constructGrid(); - - /** * Connects signals and slots for active wizard. * @since S60 ?S60_version. */ @@ -128,21 +115,17 @@ void handleBackEvent(); /** + * Signalled when plugin emits wizardDeactivated signal. + * @since S60 ?S60_version. + */ + void handleGotoToC(); + + /** * @copydoc FtuWizard::onViewChanged */ void changeWizardView(FtuWizard *caller, QGraphicsWidget* viewWidget); /** - * @copydoc FtuWizard::fullScreenModeRequested - */ - void enableFullScreenMode(FtuWizard *caller); - - /** - * @copydoc FtuWizard::partialScreenModeRequested - */ - void enablePartialScreenMode(FtuWizard *caller); - - /** * @copydoc FtuWizard::onInfoTextUpdated */ void updateInfoText(FtuWizard *caller, QString text); @@ -208,11 +191,6 @@ HbAction* mBackAction; /** - * The menustrip component. - */ - HbGridView* mMenustrip; - - /** * Plugin's previously activated view. */ QGraphicsWidget* mPreviousView; @@ -222,10 +200,6 @@ */ QGraphicsWidget* mCurrentView; - /** - * The Plugin's display mode. - */ - PluginDisplayMode mPluginDisplayMode; FTU_TEST_FRIEND_CLASS(FtuStateProviderTest) };
--- a/stateproviders/ftustateprovider/resources/ftustateprovider.docml Thu May 27 12:45:45 2010 +0300 +++ b/stateproviders/ftustateprovider/resources/ftustateprovider.docml Fri Jun 11 13:29:51 2010 +0300 @@ -1,19 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> -<hbdocument version="0.5"> +<hbdocument version="1.1"> <widget name="tocView" type="HbView"> <widget name="content" role="HbView:widget" type="HbWidget"> <widget name="tocInfoTextLabel" type="HbLabel"> - <sizehint height="5un" type="PREFERRED" width="45.97015un"/> + <real name="z" value="1"/> <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/> - <zvalue value="1.0"/> + <sizehint height="5un" type="PREFERRED" width="45.97015un"/> </widget> <widget name="tocListView" type="HbListView"> - <sizehint height="81.04478un" type="PREFERRED" width="51.64179un"/> + <real name="z" value="2"/> <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/> - <zvalue value="2.0"/> + <sizehint height="81.04478un" type="PREFERRED" width="51.64179un"/> </widget> - <zvalue value="0.0"/> - <layout type="anchor" widget="content"> + <real name="z" value="0"/> + <layout type="anchor"> <anchoritem dst="tocInfoTextLabel" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/> <anchoritem dst="tocInfoTextLabel" dstEdge="TOP" spacing="1un" src="" srcEdge="TOP"/> <anchoritem dst="tocInfoTextLabel" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/> @@ -26,35 +26,29 @@ </widget> <widget name="wizardView" type="HbView"> <widget name="content_2" role="HbView:widget" type="HbWidget"> - <widget name="wizardGridView" type="HbGridView"> - <sizehint height="10un" type="PREFERRED" width="51.64179un"/> - <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/> - <zvalue value="1.0"/> - </widget> <widget name="wizardInfoTextLabel" type="HbLabel"> + <real name="z" value="2"/> <sizehint height="5un" type="PREFERRED" width="51.64179un"/> - <zvalue value="2.0"/> </widget> <widget name="wizardStackedWidget" type="HbStackedWidget"> + <real name="z" value="3"/> <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/> - <zvalue value="3.0"/> </widget> - <string name="id" value="content_2"/> - <zvalue value="0.0"/> - <layout type="anchor" widget="content_2"> - <anchoritem dst="wizardGridView" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/> - <anchoritem dst="wizardGridView" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/> - <anchoritem dst="wizardGridView" dstEdge="BOTTOM" spacing="-1un" src="" srcEdge="BOTTOM"/> + <real name="z" value="0"/> + <layout type="anchor"> <anchoritem dst="wizardInfoTextLabel" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/> <anchoritem dst="wizardInfoTextLabel" dstEdge="TOP" spacing="1un" src="" srcEdge="TOP"/> <anchoritem dst="wizardInfoTextLabel" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/> <anchoritem dst="wizardStackedWidget" dstEdge="LEFT" spacing="1un" src="" srcEdge="LEFT"/> <anchoritem dst="wizardStackedWidget" dstEdge="TOP" spacing="6un" src="" srcEdge="TOP"/> <anchoritem dst="wizardStackedWidget" dstEdge="RIGHT" spacing="-1un" src="" srcEdge="RIGHT"/> - <anchoritem dst="wizardStackedWidget" dstEdge="BOTTOM" spacing="-11un" src="" srcEdge="BOTTOM"/> + <anchoritem dst="wizardStackedWidget" dstEdge="BOTTOM" spacing="-1un" src="" srcEdge="BOTTOM"/> </layout> </widget> - <zvalue value="1.0"/> + <real name="z" value="1"/> </widget> - <metadata display="QHD portrait" unit="un"/> + <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un"> + <uistate name="Common ui state" sections="#common"/> + <dummydata objectName="tocListView" section="#common" value="app_list_template5"/> + </metadata> </hbdocument>
--- a/stateproviders/ftustateprovider/src/ftuwizardactivatedstate.cpp Thu May 27 12:45:45 2010 +0300 +++ b/stateproviders/ftustateprovider/src/ftuwizardactivatedstate.cpp Fri Jun 11 13:29:51 2010 +0300 @@ -36,7 +36,6 @@ #include <QDir> #include <hbmenu.h> -const int gridRowCount = 1; const char *FTUSTATEPROVIDER_DOCML2 = ":/xml/ftustateprovider.docml"; const char *WIZARD_VIEW = "wizardView"; @@ -67,10 +66,8 @@ mPluginTitleLabel(NULL), mWizardStackedWidget(NULL), mBackAction(NULL), - mMenustrip(NULL), mPreviousView(NULL), - mCurrentView(NULL), - mPluginDisplayMode(PartialScreen) + mCurrentView(NULL) { mMainWindow = hbInstance->allMainWindows().at(0); mDocumentLoader = new HbDocumentLoader(); @@ -123,13 +120,6 @@ mActiveWizard = content()->wizard(activeIndex); mPluginView->setNavigationAction(mBackAction); - // Make menustrip for testing purposes. - if(!mMenustrip) - { - constructGrid(); - } - mMenustrip->setVisible(true); - connect(mBackAction, SIGNAL(triggered()), this, SLOT(handleBackEvent())); @@ -152,22 +142,21 @@ QState::onExit(event); mMainWindow->currentView()->takeMenu(); disconnect(mBackAction, SIGNAL(triggered()), - this, SLOT(handleBackEvent())); + this, SLOT(handleBackEvent())); + + + disconnect(mActiveWizard, SIGNAL(wizardDeactivated(FtuWizard *)), + this, SLOT(handleGotoToC())); disconnect(mActiveWizard, SIGNAL(viewChanged(FtuWizard *, QGraphicsWidget* )), this, SLOT(changeWizardView(FtuWizard*, QGraphicsWidget*))); - disconnect(mActiveWizard, SIGNAL(fullScreenModeRequested(FtuWizard *)), - this, SLOT(enableFullScreenMode(FtuWizard*))); - - disconnect(mActiveWizard, SIGNAL(partialScreenModeRequested(FtuWizard * )), - this, SLOT(enablePartialScreenMode(FtuWizard*))); disconnect(mActiveWizard, SIGNAL(infoTextUpdated(FtuWizard *, QString )), this, SLOT(updateInfoText(FtuWizard *, QString))); - //disconnect from the existing existing wizard's updateMainMenu signal + //disconnect from the existing wizard's updateMainMenu signal disconnect(mActiveWizard,SIGNAL(updateMainMenu(FtuWizard *, HbMenu * )), this,SLOT(updateMainMenu(FtuWizard *, HbMenu * ))); } @@ -179,16 +168,13 @@ void FtuWizardActivatedState::setActiveWizardConnections() { // first disconnect possible old connections with active wizard + disconnect(mActiveWizard, SIGNAL(wizardDeactivated(FtuWizard *)), + this, SLOT(handleGotoToC())); + disconnect(mActiveWizard, SIGNAL(viewChanged(FtuWizard *, QGraphicsWidget* )), this, SLOT(changeWizardView(FtuWizard*, QGraphicsWidget*))); - disconnect(mActiveWizard, SIGNAL(fullScreenModeRequested(FtuWizard *)), - this, SLOT(enableFullScreenMode(FtuWizard*))); - - disconnect(mActiveWizard, SIGNAL(partialScreenModeRequested(FtuWizard * )), - this, SLOT(enablePartialScreenMode(FtuWizard*))); - disconnect(mActiveWizard, SIGNAL(infoTextUpdated(FtuWizard *, QString )), this, SLOT(updateInfoText(FtuWizard *, QString))); @@ -200,18 +186,15 @@ connect(mActiveWizard, SIGNAL(viewChanged(FtuWizard *, QGraphicsWidget* )), this, SLOT(changeWizardView(FtuWizard*, QGraphicsWidget*))); - connect(mActiveWizard, SIGNAL(fullScreenModeRequested(FtuWizard *)), - this, SLOT(enableFullScreenMode(FtuWizard*))); - - connect(mActiveWizard, SIGNAL(partialScreenModeRequested(FtuWizard * )), - this, SLOT(enablePartialScreenMode(FtuWizard*))); - connect(mActiveWizard, SIGNAL(infoTextUpdated(FtuWizard *, QString )), this, SLOT(updateInfoText(FtuWizard *, QString))); // connect to the updateMainMenu wizard signal connect(mActiveWizard,SIGNAL(updateMainMenu(FtuWizard *, HbMenu * )), this,SLOT(updateMainMenu(FtuWizard *, HbMenu * ))); + + connect(mActiveWizard, SIGNAL(wizardDeactivated(FtuWizard *)), + this, SLOT(handleGotoToC())); } // --------------------------------------------------------------------------- @@ -236,6 +219,10 @@ } } +void FtuWizardActivatedState::handleGotoToC() + { + emit backEventTriggered(); + } // --------------------------------------------------------------------------- // FtuWizardActivatedState::updateMainMenu @@ -281,45 +268,10 @@ // temp solution to skip edge indexes - start if (index == 0) { index++; } if (index == wizards.count()-1) { index--; } - // temp solution to skip edge indexes - end - - // create model index for active wizard - QModelIndex modelIndex = mMenustrip->model()->index(index, 0); - // scroll to correct position in menustrip - HbAbstractItemView::ScrollHint hint = HbAbstractItemView::PositionAtCenter; - mMenustrip->scrollTo(modelIndex, hint); } } } -// --------------------------------------------------------------------------- -// FtuWizardActivatedState::enableFullScreenMode -// --------------------------------------------------------------------------- -// -void FtuWizardActivatedState::enableFullScreenMode(FtuWizard *caller) -{ - if(caller == mActiveWizard) - { - mPluginDisplayMode = FullScreen; - // Remove menustrip - mMenustrip->setVisible(false); - caller->resizeWizard(calculateWizardGeometry()); - } -} - -// --------------------------------------------------------------------------- -// FtuWizardActivatedState::enablePartialScreenMode -// --------------------------------------------------------------------------- -// -void FtuWizardActivatedState::enablePartialScreenMode(FtuWizard *caller) -{ - if(caller == mActiveWizard) - { - mPluginDisplayMode = PartialScreen; - mMenustrip->setVisible(true); - caller->resizeWizard(calculateWizardGeometry()); - } -} // --------------------------------------------------------------------------- // FtuWizardActivatedState::updateInfoText @@ -344,49 +296,6 @@ } // --------------------------------------------------------------------------- -// FtuWizardActivatedState::constructGrid -// --------------------------------------------------------------------------- -// -void FtuWizardActivatedState::constructGrid() -{ - // fetch grid view from docml - mMenustrip = qobject_cast<HbGridView *>(mDocumentLoader->findWidget(WIZARD_GRID_VIEW)); - // set row amount for grid - mMenustrip->setRowCount(gridRowCount); - - mMenustrip->setScrollDirections(Qt::Horizontal); - - FtuContentService* ftuContentService = content(); - // get wizards - QList<FtuWizard*> wizards = ftuContentService->wizards(); - - QStandardItemModel* model = new QStandardItemModel(this); - - for(int i = 0 ; i < wizards.size() ; ++i) - { - // get wizard settings - const FtuWizardSetting& settings = wizards.at(i)->wizardSettings(); - QStandardItem* item = new QStandardItem(); - HbIcon icon(settings.mMenustripDefaultIcon.absoluteFilePath()); - -// item->setBackground(QBrush(Qt::lightGray)); - item->setData(icon, Qt::DecorationRole); - - QStringList data; - data << settings.mMenustripLabel; - - item->setData(QVariant(data), Qt::DisplayRole); - - model->appendRow(item); - } - // set above defined model for menustrip - mMenustrip->setModel(model); - - connect(mMenustrip, SIGNAL(activated(const QModelIndex)), - this, SLOT(activateWizard(const QModelIndex))); -} - -// --------------------------------------------------------------------------- // FtuWizardActivatedState::activateWizard // --------------------------------------------------------------------------- // @@ -425,16 +334,6 @@ mActiveWizard->activateWizard(); } } - - // temp solution to skip edge indexes - start - if (wizardIndex == 0) { wizardIndex++; } - if (wizardIndex == content()->wizards().count()-1) { wizardIndex--; } - QModelIndex modelIndex = mMenustrip->model()->index(wizardIndex, 0); - // temp solution to skip edge indexes - end - - HbAbstractItemView::ScrollHint hint = HbAbstractItemView::PositionAtCenter; - // scroll to correct position in menustrip - mMenustrip->scrollTo(modelIndex, hint); } } @@ -446,17 +345,7 @@ { QRectF widgetRect = mWizardStackedWidget->geometry(); QRectF pluginRect = mPluginView->geometry(); - if(mPluginDisplayMode == FullScreen) - { - pluginRect.setSize(QSizeF(widgetRect.width(), - (widgetRect.height() + - mMenustrip->geometry().height()))); - } - else - { - pluginRect.setSize(QSizeF(widgetRect.width(), - widgetRect.height())); - } - + pluginRect.setSize(QSizeF(widgetRect.width(), + widgetRect.height())); return pluginRect; }
--- a/wizardproviders/ftuwizardprovider/conf/ftuwizardprovider.confml Thu May 27 12:45:45 2010 +0300 +++ b/wizardproviders/ftuwizardprovider/conf/ftuwizardprovider.confml Fri Jun 11 13:29:51 2010 +0300 @@ -53,9 +53,9 @@ </feature> <data> <KCrUidFtuWizardProvider> - <KFtuNumberOfWizardPlugins>2</KFtuNumberOfWizardPlugins> - <KFtuWizardPluginPlaceholder1>ftudatetimewizard.manifest</KFtuWizardPluginPlaceholder1> - <KFtuWizardPluginPlaceholder2>dataimportftuwizard.manifest</KFtuWizardPluginPlaceholder2> + <KFtuNumberOfWizardPlugins>1</KFtuNumberOfWizardPlugins> + <KFtuWizardPluginPlaceholder1>dataimportftuwizard.manifest</KFtuWizardPluginPlaceholder1> + <KFtuWizardPluginPlaceholder2></KFtuWizardPluginPlaceholder2> <KFtuWizardPluginPlaceholder3></KFtuWizardPluginPlaceholder3> <KFtuWizardPluginPlaceholder4></KFtuWizardPluginPlaceholder4> <KFtuWizardPluginPlaceholder5></KFtuWizardPluginPlaceholder5>