# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286140009 -10800 # Node ID 208ec88db289a1a4e0a1f92bbbcc271c3769b0a0 # Parent 4956c89a3c3f8553a30289360a1ef7624d79d330 Revision: 201037 Kit: 201039 diff -r 4956c89a3c3f -r 208ec88db289 stateproviders/ftustateprovider/inc/ftuwizardmenustate.h --- a/stateproviders/ftustateprovider/inc/ftuwizardmenustate.h Fri Sep 17 08:27:43 2010 +0300 +++ b/stateproviders/ftustateprovider/inc/ftuwizardmenustate.h Mon Oct 04 00:06:49 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include "ftutest_global.h" +#include FTU_TEST_CLASS(FtuStateProviderTest) @@ -38,6 +39,7 @@ class FtuStateCenrepHandler; class HbMenu; class HbTranslator; +class HbGroupBox; /** @ingroup group_ftustateprovider * @brief The state where wizard menu is shown @@ -124,6 +126,15 @@ */ void updateProgress(FtuWizard *caller, bool show, int progress); + /** + * Signalled when user changes WizardSettings + */ + void changeWizardSettings(FtuWizard *caller); + + /** + * changes the streching style of the list + */ + void changeListStrechingStyle(Qt::Orientation); signals: /** @@ -136,7 +147,7 @@ HbMainWindow* mMainWindow; HbView* mTocView; - HbLabel* mInfoText; + HbGroupBox* mInfoText; HbListView* mListView; HbDocumentLoader* mDocumentLoader; diff -r 4956c89a3c3f -r 208ec88db289 stateproviders/ftustateprovider/resources/ftustateprovider.docml --- a/stateproviders/ftustateprovider/resources/ftustateprovider.docml Fri Sep 17 08:27:43 2010 +0300 +++ b/stateproviders/ftustateprovider/resources/ftustateprovider.docml Mon Oct 04 00:06:49 2010 +0300 @@ -2,25 +2,21 @@ - - - - - + + + + + + - - - - - - - - + + + diff -r 4956c89a3c3f -r 208ec88db289 stateproviders/ftustateprovider/src/ftuwizardmenustate.cpp --- a/stateproviders/ftustateprovider/src/ftuwizardmenustate.cpp Fri Sep 17 08:27:43 2010 +0300 +++ b/stateproviders/ftustateprovider/src/ftuwizardmenustate.cpp Mon Oct 04 00:06:49 2010 +0300 @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -79,7 +81,7 @@ for(int counter = 0; counter < registeredPlugins; counter ++){ mCompletedWizardList << mCenrepHandler->getPluginInfo(counter); } - + connect(mMainWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(changeListStrechingStyle(Qt::Orientation))); } // --------------------------------------------------------------------------- @@ -183,6 +185,10 @@ connect(addedWizard, SIGNAL(progressUpdated(FtuWizard *, bool, int)), this, SLOT(updateProgress(FtuWizard *, bool, int))); + connect(addedWizard, SIGNAL(wizardSettingsChanged(FtuWizard*)), + this, SLOT(changeWizardSettings(FtuWizard*))); + + const FtuWizardSetting& settings = addedWizard->wizardSettings(); QStandardItem* newItem = new QStandardItem(); QList iconList; @@ -192,17 +198,14 @@ QStringList data; data << settings.mTocLabel; + data << settings.mTocSecondaryLabel; QDate date = addedWizard->wizardCompletedDate(); - if(date.isNull()) - { - data << emptyLine; - } - else + if(!date.isNull()) { //Plugin has already completed, Append tick mark on right side iconList.append(rightIcon); - data << updatedAsString(date); } + newItem->setData(iconList, Qt::DecorationRole); newItem->setData(QVariant(data), Qt::DisplayRole); @@ -237,8 +240,8 @@ // void FtuWizardMenuState::createInfoText() { - mInfoText = qobject_cast(mDocumentLoader->findWidget(TOC_INFOTEXT_LABEL)); - mInfoText->setPlainText(hbTrId("txt_ftu_subhead_select_setting_you_want_to_edit")); + mInfoText = qobject_cast(mDocumentLoader->findWidget(TOC_INFOTEXT_LABEL)); + mInfoText->setHeading(hbTrId("txt_ftu_subhead_select_setting_you_want_to_edit")); } // --------------------------------------------------------------------------- @@ -288,17 +291,11 @@ if(progress < progressCompelete) { - QString progressStr; - QString progressNumber; - progressNumber.setNum(progress); - progressStr = hbTrId("txt_ftu_list_progress_status").arg(progressNumber); - data << progressStr; + data << wizards[index]->wizardSettings().mTocSecondaryLabel; } else - { - QDate date = wizards[index]->wizardCompletedDate(); - data << updatedAsString(date); - + { + data << wizards[index]->wizardSettings().mTocSecondaryLabel; //Plugin has completed 100%, Append tick mark on right side iconList.append(rightIcon); @@ -315,3 +312,58 @@ mModel->item(index)->setData(iconList, Qt::DecorationRole); } } + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::changeWizardSettings +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::changeWizardSettings(FtuWizard* caller) + { + QList wizards = content()->wizards(); + int index = -1; + + // Get the index of the wizard + for(int i = 0 ; i < wizards.size() ; ++i) + { + if(caller == wizards[i]) + { + QDEBUG("::changeWizardSettings wizard found at: " << i;) + index = i; + } + } + if(index != -1) + { + + QStringList data; + data << wizards[index]->wizardSettings().mTocLabel; + data << wizards[index]->wizardSettings().mTocSecondaryLabel; + QList iconList; + HbIcon icon (wizards[index]->wizardSettings().mTocDefaultIcon.filePath()); + iconList.append(icon); + HbIcon rightIcon(QString("qtg_small_tick")); + if(true == mCompletedWizardList[index]) + { + iconList.append(rightIcon); + } + mModel->item(index)->setData(QVariant(data), Qt::DisplayRole); + mModel->item(index)->setData(iconList, Qt::DecorationRole); + } + } + +// --------------------------------------------------------------------------- +// FtuWizardMenuState::changeListStrechingStyle +// --------------------------------------------------------------------------- +// +void FtuWizardMenuState::changeListStrechingStyle(Qt::Orientation orientation) +{ + HbListViewItem *prototypeItem = mListView->listItemPrototype(); + if (orientation == Qt::Vertical) { + // change the streching style of list to no strech + prototypeItem->setStretchingStyle(HbListViewItem::NoStretching ); + + } else if (orientation == Qt::Horizontal) { + // change the streching style of list to landscape strech + prototypeItem->setStretchingStyle(HbListViewItem::StretchLandscape); + } +} +