diff -r 8192e5b5c935 -r c163ef0b758d tsrc/mpfetchertestapp/src/mpfetchertestappview.cpp --- a/tsrc/mpfetchertestapp/src/mpfetchertestappview.cpp Thu May 27 12:49:57 2010 +0300 +++ b/tsrc/mpfetchertestapp/src/mpfetchertestappview.cpp Fri Jun 11 13:36:36 2010 +0300 @@ -132,6 +132,27 @@ connect(viewButton, SIGNAL(clicked()), SLOT(viewSongCaged())); bottomLayout->addItem(viewButton); } + + HbPushButton* homeScreenButton = new HbPushButton("HS Widget MainView"); + if (homeScreenButton) + { + connect(homeScreenButton, SIGNAL(clicked()), SLOT(launchHomeScreen())); + bottomLayout->addItem(homeScreenButton); + } + + HbPushButton* homeScreenButtonNPV = new HbPushButton("HS Widget NowPlayingView"); + if (homeScreenButtonNPV) + { + connect(homeScreenButtonNPV, SIGNAL(clicked()), SLOT(launchHomeScreenNowPlaying())); + bottomLayout->addItem(homeScreenButtonNPV); + } + + HbPushButton* homeScreenButtonNPVS = new HbPushButton("HS Widget NPV Shuffle"); + if (homeScreenButtonNPVS) + { + connect(homeScreenButtonNPVS, SIGNAL(clicked()), SLOT(launchHomeScreenNPShuffle())); + bottomLayout->addItem(homeScreenButtonNPVS); + } layout->addItem(bottomLayout); } @@ -326,3 +347,93 @@ } + +void MpFetcherTestAppView::launchHomeScreen() +{ + QUrl url; + + url.setUrl("appto://10207C62?activityname=MusicMainView&launchtype=standalone"); + if(mReq){ + delete mReq; + mReq = 0; + } + mReq = mAppMgr.create(url); + if (mReq == NULL) + { + // No handlers for the URI + return; + } + + mReq->setBackground(false); + + // Send the request + bool res = mReq->send(); + if (!res) + { + // Request failed. + int error = mReq->lastError(); + + // Handle error + } + +} + +void MpFetcherTestAppView::launchHomeScreenNowPlaying() +{ + QUrl url; + + url.setUrl("appto://10207C62?activityname=MusicNowPlayingView&launchtype=standalone"); + if(mReq){ + delete mReq; + mReq = 0; + } + mReq = mAppMgr.create(url); + if (mReq == NULL) + { + // No handlers for the URI + return; + } + + mReq->setBackground(false); + + // Send the request + bool res = mReq->send(); + if (!res) + { + // Request failed. + int error = mReq->lastError(); + + // Handle error + } + +} + +void MpFetcherTestAppView::launchHomeScreenNPShuffle() +{ + QUrl url; + + url.setUrl("appto://10207C62?activityname=MusicNowPlayingView&launchtype=standalone&shuffle=yes"); + if(mReq){ + delete mReq; + mReq = 0; + } + mReq = mAppMgr.create(url); + if (mReq == NULL) + { + // No handlers for the URI + return; + } + + mReq->setBackground(false); + + // Send the request + bool res = mReq->send(); + if (!res) + { + // Request failed. + int error = mReq->lastError(); + + // Handle error + } + +}