Work to handle tabs in search view
authorteknolog
Thu, 25 Feb 2010 18:26:52 +0000
changeset 11 f6c975c3b702
parent 10 121100939521
child 12 47c8595ffc70
Work to handle tabs in search view
application/inc/PodcastAppui.h
application/src/PodcastAppui.cpp
application/src/PodcastFeedView.cpp
application/src/PodcastSearchView.cpp
--- a/application/inc/PodcastAppui.h	Thu Feb 25 17:56:45 2010 +0000
+++ b/application/inc/PodcastAppui.h	Thu Feb 25 18:26:52 2010 +0000
@@ -108,6 +108,7 @@
        void UpdateQueueTab(TInt aQueueLength);
        void TabLeft();
        void TabRight();
+       void SetTabsVisibleL(TBool aVisible);
     private:
         // From MEikMenuObserver
         void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
@@ -132,7 +133,7 @@
 		CAknNavigationDecorator* iNaviDecorator;
 		CAknTabGroup* iTabGroup;
 		CAknNavigationControlContainer* iNaviPane;
-		
+		TBool iTabsVisible;
 		CTimeout* iStartTimer;
     };
 
--- a/application/src/PodcastAppui.cpp	Thu Feb 25 17:56:45 2010 +0000
+++ b/application/src/PodcastAppui.cpp	Thu Feb 25 18:26:52 2010 +0000
@@ -171,13 +171,18 @@
 	iTabGroup->SetObserver(this);
 
 	iNaviPane->Pop();
-	iNaviPane->PushL(*iNaviDecorator);
+	SetTabsVisibleL(ETrue);
 	}
 
 void CPodcastAppUi::TabChangedL (TInt aIndex)
 	{
 	DP("CPodcastListView::TabChangedL ");
 	
+	if (!iTabsVisible)
+		{
+		return;
+		}
+	
 	TUid newview = TUid::Uid(0);
 	TUid messageUid = TUid::Uid(0);
 	
@@ -226,6 +231,11 @@
 
 void CPodcastAppUi::TabLeft()
 	{
+	if (!iTabsVisible)
+		{
+		return;
+		}
+	
 	TInt ati = iTabGroup->ActiveTabIndex();
 	if(ati > 0) {
 		SetActiveTab(ati-1);
@@ -235,10 +245,30 @@
 
 void CPodcastAppUi::TabRight()
 	{
+	if (!iTabsVisible)
+		{
+		return;
+		}
+	
 	TInt ati = iTabGroup->ActiveTabIndex();
-	
 	if(ati < iTabGroup->TabCount()-1) {
 		SetActiveTab(ati+1);
 		TabChangedL(ati+1);
 	}
 	}
+
+void CPodcastAppUi::SetTabsVisibleL(TBool aVisible)
+	{
+	if (aVisible)
+		{
+		if(!iTabsVisible && iNaviDecorator)
+			{
+			iNaviPane->PushL(*iNaviDecorator);
+			}
+		}
+	else if (iTabsVisible) {
+		iNaviPane->Pop(iNaviDecorator);
+	}
+	
+	iTabsVisible=aVisible;
+	}
--- a/application/src/PodcastFeedView.cpp	Thu Feb 25 17:56:45 2010 +0000
+++ b/application/src/PodcastFeedView.cpp	Thu Feb 25 18:26:52 2010 +0000
@@ -177,7 +177,7 @@
 	UpdateToolbar();
 	
 	CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
-	
+
 	if (iFirstActivateAfterLaunch)
 		{
 		iFirstActivateAfterLaunch = EFalse;
@@ -918,6 +918,7 @@
 					}
 				else
 					{
+					((CPodcastAppUi*)AppUi())->SetTabsVisibleL(EFalse);
 					AppUi()->ActivateLocalViewL(KUidPodcastSearchViewID,  TUid::Uid(0), KNullDesC8());
 					}
 				iOpmlState = EOpmlIdle;
--- a/application/src/PodcastSearchView.cpp	Thu Feb 25 17:56:45 2010 +0000
+++ b/application/src/PodcastSearchView.cpp	Thu Feb 25 18:26:52 2010 +0000
@@ -147,6 +147,7 @@
 	CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
 		     ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
 	titlePane->SetTextToDefaultL();
+	((CPodcastAppUi*)AppUi())->SetTabsVisibleL(ETrue);
 }