# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274953774 -10800 # Node ID ccec1994394347a89a4033f30697539b27c4a94b # Parent cd10d5b85554939667cff8538445d269d9878115 Revision: 201019 Kit: 2010121 diff -r cd10d5b85554 -r ccec19943943 locationpickerservice/inc/locationpickerpotraitview.h --- a/locationpickerservice/inc/locationpickerpotraitview.h Fri May 14 15:47:27 2010 +0300 +++ b/locationpickerservice/inc/locationpickerpotraitview.h Thu May 27 12:49:34 2010 +0300 @@ -63,6 +63,7 @@ private slots: //slot to handle list item actions void handleActivated( const QModelIndex &aIndex ); + void changeModel(); //slots to handle menu action items void sortDescending(); void sortAscending(); @@ -108,6 +109,8 @@ TViewType mViewType ; // get the collection/category id quint32 mCategoryId; + // model Index + QModelIndex mIndex; }; diff -r cd10d5b85554 -r ccec19943943 locationpickerservice/resources/locationpickerlandscape.docml --- a/locationpickerservice/resources/locationpickerlandscape.docml Fri May 14 15:47:27 2010 +0300 +++ b/locationpickerservice/resources/locationpickerlandscape.docml Thu May 27 12:49:34 2010 +0300 @@ -39,11 +39,6 @@ - - - - - diff -r cd10d5b85554 -r ccec19943943 locationpickerservice/resources/locationpickerpotrait.docml --- a/locationpickerservice/resources/locationpickerpotrait.docml Fri May 14 15:47:27 2010 +0300 +++ b/locationpickerservice/resources/locationpickerpotrait.docml Thu May 27 12:49:34 2010 +0300 @@ -36,11 +36,6 @@ - - - - - diff -r cd10d5b85554 -r ccec19943943 locationpickerservice/src/locationpickerlandscapeview.cpp --- a/locationpickerservice/src/locationpickerlandscapeview.cpp Fri May 14 15:47:27 2010 +0300 +++ b/locationpickerservice/src/locationpickerlandscapeview.cpp Thu May 27 12:49:34 2010 +0300 @@ -23,6 +23,7 @@ #include #include #include +#include #include "locationpickerproxymodel.h" #include "locationpickerdatamanager.h" @@ -107,13 +108,22 @@ //Get HbAction items mGridView = qobject_cast (mDocumentLoader->findObject(QString( "gridView"))); - //get the action items from docml - mAllAction = qobject_cast (mDocumentLoader->findObject(QString( - "allAction"))); - mCollectionAction = qobject_cast (mDocumentLoader->findObject( - QString("collectionAction"))); - mSearchAction = qobject_cast (mDocumentLoader->findObject(QString( - "searchAction"))); + HbToolBar* toolbar = new HbToolBar(); + //Create Action Items + mAllAction = new HbAction(); + mAllAction->setIcon(QString("qtg_mono_location")); + mAllAction->setCheckable(true); + mCollectionAction =new HbAction(); + mCollectionAction->setIcon(QString("qtg_mono_location_collection")); + mCollectionAction->setCheckable(true); + mSearchAction = new HbAction(); + mSearchAction->setIcon(QString("qtg_mono_search")); + + toolbar->addAction(mAllAction); + toolbar->addAction(mCollectionAction); + toolbar->addAction(mSearchAction); + this->setToolBar(toolbar); + mAscendingAction = qobject_cast (mDocumentLoader->findObject( QString("ascendingAction"))); mDescendingAction = qobject_cast (mDocumentLoader->findObject( @@ -143,7 +153,9 @@ connect(mGridView, SIGNAL(activated(const QModelIndex &)), this, SLOT(handleActivated(const QModelIndex &))); } - +// ----------------------------------------------------------------------------- +// LocationPickerLandscapeView::manageGridView() +// ----------------------------------------------------------------------------- void LocationPickerLandscapeView::manageGridView() { //set the appropriate model diff -r cd10d5b85554 -r ccec19943943 locationpickerservice/src/locationpickerpotraitview.cpp --- a/locationpickerservice/src/locationpickerpotraitview.cpp Fri May 14 15:47:27 2010 +0300 +++ b/locationpickerservice/src/locationpickerpotraitview.cpp Thu May 27 12:49:34 2010 +0300 @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "locationpickerproxymodel.h" #include "locationpickerdatamanager.h" @@ -115,13 +117,21 @@ //Get HbAction items mListView = qobject_cast (mDocumentLoader->findObject(QString( "ListView"))); - //get the action items from docml - mAllAction = qobject_cast (mDocumentLoader->findObject(QString( - "allAction"))); - mCollectionAction = qobject_cast (mDocumentLoader->findObject( - QString("collectionAction"))); - mSearchAction = qobject_cast (mDocumentLoader->findObject(QString( - "searchAction"))); + HbToolBar* toolbar = new HbToolBar(); + //Create Action Items + mAllAction = new HbAction(); + mAllAction->setIcon(QString("qtg_mono_location")); + mAllAction->setCheckable(true); + mCollectionAction =new HbAction(); + mCollectionAction->setIcon(QString("qtg_mono_location_collection")); + mCollectionAction->setCheckable(true); + mSearchAction = new HbAction(); + mSearchAction->setIcon(QString("qtg_mono_search")); + + toolbar->addAction(mAllAction); + toolbar->addAction(mCollectionAction); + toolbar->addAction(mSearchAction); + this->setToolBar(toolbar); mAscendingAction = qobject_cast (mDocumentLoader->findObject( QString("ascendingAction"))); mDescendingAction = qobject_cast (mDocumentLoader->findObject( @@ -195,7 +205,16 @@ // ----------------------------------------------------------------------------- // LocationPickerView::handleActivated() // ----------------------------------------------------------------------------- -void LocationPickerPotraitView::handleActivated( const QModelIndex &aIndex ) +void LocationPickerPotraitView::handleActivated(const QModelIndex &aIndex) +{ + mIndex = aIndex; + QTimer::singleShot(0, this, SLOT(changeModel())); +} + +// ----------------------------------------------------------------------------- +// LocationPickerPotraitView::changeModel() +// ----------------------------------------------------------------------------- +void LocationPickerPotraitView::changeModel() { //handle the activated signal according to model set switch(mViewType) @@ -207,7 +226,7 @@ break; } QModelIndex index = mProxyModel->mapToSource( - aIndex); + mIndex); quint32 lm = 0; QStandardItem* item = mModel->item( index.row(), index.column() ); QVariant var = item->data( Qt::UserRole ); @@ -219,7 +238,7 @@ case ELocationPickerCollectionListContent: { mLocationPickerCollectionListContent->getData( - aIndex, mCategoryId ); + mIndex, mCategoryId ); mViewType = ELocationPickerCollectionContent; //send categoryID to set the collection content emit sendCategoryID(mCategoryId); @@ -232,7 +251,7 @@ break; } QModelIndex index = mCollectionContent->getProxyModel()->mapToSource( - aIndex); + mIndex); quint32 lm = 0; mCollectionContent->getData(index, lm); //item selected, complete request @@ -245,7 +264,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::sortAscending() +// LocationPickerPotraitView::sortAscending() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::sortAscending() { @@ -261,7 +280,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::sortDescending() +// LocationPickerPotraitView::sortDescending() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::sortDescending() { @@ -277,7 +296,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::handleAllTab() +// LocationPickerPotraitView::handleAllTab() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::allTabTriggered() { @@ -314,7 +333,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::handleCollectionTab() +// LocationPickerPotraitView::handleCollectionTab() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::colectionTabTriggered() { @@ -336,7 +355,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::searchTabTriggered() +// LocationPickerPotraitView::searchTabTriggered() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::searchTabTriggered() { @@ -344,7 +363,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::setCollectionData() +// LocationPickerPotraitView::setCollectionData() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::setCollectionData( quint32 acategoryId ) { @@ -371,7 +390,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::setCategoryID() +// LocationPickerPotraitView::setCategoryID() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::setCategoryID( quint32 aCategoryId ) { @@ -379,7 +398,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::getViewType() +// LocationPickerPotraitView::getViewType() // ----------------------------------------------------------------------------- TViewType LocationPickerPotraitView::getViewType() { @@ -387,7 +406,7 @@ } // ----------------------------------------------------------------------------- -// LocationPickerView::setViewType() +// LocationPickerPotraitView::setViewType() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::setViewType(TViewType aViewType) { @@ -396,7 +415,7 @@ // ----------------------------------------------------------------------------- -// LocationPickerView::clearContentModel() +// LocationPickerPotraitView::clearContentModel() // ----------------------------------------------------------------------------- void LocationPickerPotraitView::clearContentModel() {