application/src/PodcastQueueView.cpp
author Sebastian Brannstrom <sebastianb@symbian.org>
Sun, 21 Nov 2010 20:11:07 +0000
branchRCL_3
changeset 383 931d0db6374d
parent 368 b131f7696342
child 387 422f96ee6672
permissions -rw-r--r--
Catchup with Symbian1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     1
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     2
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     3
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     4
* All rights reserved.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     5
* This component and the accompanying materials are made available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     6
* under the terms of the License "Eclipse Public License v1.0"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     7
* which accompanies this distribution, and is available
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     8
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     9
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    10
* Initial Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    11
* EmbedDev AB - initial contribution.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    12
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    13
* Contributors:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    14
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    15
* Description:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    16
*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    17
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    18
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    19
#include "PodcastQueueView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
#include "PodcastAppUi.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
#include "ShowEngine.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
#include "SettingsEngine.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    23
#include "PodcastApp.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    24
#include "Constants.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    25
#include "imagehandler.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    26
#include "PodcastShowsView.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    28
#include <podcast.rsg>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    29
#include <podcast.mbg>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
#include <gulicon.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    31
#include <barsread.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
#include <aknnotedialog.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
#include <aknmessagequerydialog.h>
367
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
    34
#include <akntitle.h>
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    36
#define KMaxMessageLength 200
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    37
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    39
CPodcastQueueView* CPodcastQueueView::NewL(CPodcastModel& aPodcastModel)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    41
	CPodcastQueueView* self = CPodcastQueueView::NewLC(aPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    42
	CleanupStack::Pop(self);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    43
	return self;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
CPodcastQueueView* CPodcastQueueView::NewLC(CPodcastModel& aPodcastModel)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
	CPodcastQueueView* self = new ( ELeave ) CPodcastQueueView(aPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
	CleanupStack::PushL(self);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
	self->ConstructL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
	return self;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    52
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    53
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
CPodcastQueueView::CPodcastQueueView(CPodcastModel& aPodcastModel) :
121
1cc7501102a8 CPodcastQueueView now inherits CPodcastShowsView instead of CPodcastListView. This removes the duplicated code between the two classes.
teknolog
parents: 117
diff changeset
    55
	CPodcastShowsView(aPodcastModel)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    57
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    59
void CPodcastQueueView::ConstructL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    61
	BaseConstructL(R_PODCAST_QUEUEVIEW);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
	CPodcastListView::ConstructL();
121
1cc7501102a8 CPodcastQueueView now inherits CPodcastShowsView instead of CPodcastListView. This removes the duplicated code between the two classes.
teknolog
parents: 117
diff changeset
    63
1cc7501102a8 CPodcastQueueView now inherits CPodcastShowsView instead of CPodcastListView. This removes the duplicated code between the two classes.
teknolog
parents: 117
diff changeset
    64
	CreateIconsL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
	iPodcastModel.FeedEngine().AddObserver(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
	iPodcastModel.ShowEngine().AddObserver(this);
126
c2f1ea38ec70 Import from FCL default branch
teknolog
parents: 121
diff changeset
    68
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
	SetEmptyTextL(R_PODCAST_EMPTY_QUEUE);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    70
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    71
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    72
TKeyResponse CPodcastQueueView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
	if (aType == EEventKey)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
		CShowInfo *activeShow = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    78
		TInt index = iListContainer->Listbox()->CurrentItemIndex();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    79
		if(index >= 0 && index < iPodcastModel.ActiveShowList().Count())
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    80
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    81
			activeShow = iPodcastModel.ActiveShowList()[index];
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    82
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    83
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    84
		if (activeShow != NULL) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    85
			DP1("aKeyEvent.iCode=%d", aKeyEvent.iCode);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    86
			switch (aKeyEvent.iCode) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    87
			case EKeyBackspace:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    88
			case EKeyDelete:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    89
				HandleCommandL(EPodcastRemoveDownload);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    90
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    91
			default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    92
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    93
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    94
			UpdateToolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    95
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    96
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    97
		return CPodcastListView::OfferKeyEventL(aKeyEvent, aType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    98
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    99
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   100
CPodcastQueueView::~CPodcastQueueView()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
	{
368
b131f7696342 Catch up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 367
diff changeset
   102
	DP("CPodcastQueueView::~CPodcastQueueView BEGIN");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
	iPodcastModel.ShowEngine().RemoveObserver(this);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
	iPodcastModel.FeedEngine().RemoveObserver(this);
368
b131f7696342 Catch up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 367
diff changeset
   105
	DP("CPodcastQueueView::~CPodcastQueueView END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   106
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
TUid CPodcastQueueView::Id() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   110
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   111
	return KUidPodcastQueueViewID;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   113
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   114
void CPodcastQueueView::DoActivateL(const TVwsViewId& aPrevViewId,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
		TUid aCustomMessageId, const TDesC8& aCustomMessage)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   117
	DP("CPodcastQueueView::DoActivateL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   118
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   119
	CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
45
56d4e0784e5d Nicer way to handle back from queue view to feed/show view
teknolog
parents: 36
diff changeset
   120
	iPreviousView = aPrevViewId;
367
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   121
	UpdateViewTitleL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   122
	UpdateFeedUpdateStateL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
	UpdateToolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
	DP("CPodcastQueueView::DoActivateL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
void CPodcastQueueView::DoDeactivate()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   129
	CPodcastListView::DoDeactivate();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   130
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
void CPodcastQueueView::HandleListBoxEventL(CEikListBox* /*aListBox*/,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
		TListBoxEvent aEventType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   134
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   135
	switch (aEventType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   136
		{
137
eefed4bda2e2 Minor fixes to comply with single tap technical solution description. By this I consider bug 2056 closed.
teknolog
parents: 126
diff changeset
   137
		case EEventItemSingleClicked:
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
		case EEventEnterKeyPressed:		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   139
		case EEventItemActioned:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   140
		case EEventItemDoubleClicked:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   141
			break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   142
		default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   143
			break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   145
		UpdateToolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   146
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   147
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   148
void CPodcastQueueView::UpdateListboxItemsL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   149
	{
367
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   150
	DP("CPodcastQueueView::UpdateListboxItemsL BEGIN");
185
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   151
	if (iListContainer->IsVisible() && !iDontUpdateList)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   152
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   153
		TListItemProperties itemProps;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   154
		TInt len = 0;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   155
8
aab3aa4acdd6 Checked all TRAP_IGNORE
teknolog
parents: 4
diff changeset
   156
		iPodcastModel.GetShowsDownloadingL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   157
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   158
		RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   159
		len = fItems.Count();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   160
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   161
		if (iListContainer->Listbox() != NULL)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   162
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   163
			TBool allUidsMatch = EFalse;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   164
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   165
			if (len == iListContainer->Listbox()->Model()->NumberOfItems())
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   166
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   167
				allUidsMatch = ETrue;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   168
				TUint itemId = 0;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   169
				for (TInt loop = 0; loop< len; loop++)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   170
					{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   171
					itemId = iItemIdArray[loop];
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   172
					if (fItems[loop]->Uid() != itemId)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   173
						{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   174
						allUidsMatch = EFalse;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   175
						break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   176
						}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   177
					}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   178
				}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   179
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   180
			if (allUidsMatch && len > 0)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   181
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   182
				for (TInt loop = 0; loop< len; loop++)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
					{					
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
					UpdateShowItemDataL(fItems[loop], loop);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
					}
265
72305c65726c Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 243
diff changeset
   186
				iListContainer->Listbox()->DrawNow();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
				}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   188
			else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   189
				{
317
5afc95a6ad83 Stability fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 316
diff changeset
   190
				//iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
				iListContainer->Listbox()->Reset();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   192
				iItemIdArray.Reset();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   193
				iItemArray->Reset();
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 314
diff changeset
   194
				iItemArrayShort->Reset();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   196
				if (len > 0)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   197
					{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   198
					for (TInt i=0; i<len; i++)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
						{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
						CShowInfo *si = fItems[i];
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
						FormatShowInfoListBoxItemL(*si);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   202
						iItemIdArray.Append(si->Uid());						
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   203
						iItemArray->AppendL(iListboxFormatbuffer);
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 314
diff changeset
   204
						iItemArrayShort->AppendL(iListboxFormatbufferShort);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   205
						}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   206
					}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   207
				else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   208
					{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   209
					iItemArray->Reset();
316
841ccfa933ac More cleanup
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 314
diff changeset
   210
					iItemArrayShort->Reset();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   211
					iItemIdArray.Reset();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   212
					
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   213
					itemProps.SetDimmed(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
					itemProps.SetHiddenSelection(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   215
					}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   216
				iListContainer->Listbox()->HandleItemAdditionL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   217
				}				
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   218
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   219
		}
367
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   220
	DP("CPodcastQueueView::UpdateListboxItemsL END");
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   221
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   222
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   223
/** 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   224
 * Command handling function intended for overriding by sub classes. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   225
 * Default implementation is empty.  
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   226
 * @param aCommand ID of the command to respond to. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   227
 */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   228
void CPodcastQueueView::HandleCommandL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   229
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   230
	switch (aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   231
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   232
		case EPodcastRemoveAllDownloads:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   233
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   234
			TBuf<KMaxMessageLength> msg;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   235
			iEikonEnv->ReadResourceL(msg, R_CLEAR_QUERY);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   236
												
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 23
diff changeset
   237
			if(ShowQueryMessageL(msg))
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
				{
35
66c5303f3610 A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents: 23
diff changeset
   239
				iPodcastModel.ShowEngine().RemoveAllDownloadsL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   240
				UpdateListboxItemsL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   241
				}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   242
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
			break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   244
		case EPodcastRemoveDownload:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   246
			TInt index = iListContainer->Listbox()->CurrentItemIndex();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   247
			if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   248
				{
185
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   249
				// this is an ugly hack to prevent UpdateListboxItemsL from being
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   250
				// triggered from the show engine, which causes focus to jump
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   251
				// around in an ugly fashion
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   252
				iDontUpdateList = ETrue;
116
a2e43aa1ad11 Fixed DEF files. Tested with Qt SQLite.
teknolog
parents: 115
diff changeset
   253
				TRAP_IGNORE(iPodcastModel.ShowEngine().RemoveDownloadL(iPodcastModel.ActiveShowList()[index]->Uid()));
185
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   254
				iDontUpdateList = EFalse;
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   255
				}
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   256
			UpdateListboxItemsL();
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   257
			if (index > 0)
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   258
				{
92eadaba67e6 Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 168
diff changeset
   259
				iListContainer->Listbox()->SetCurrentItemIndex(index - 1);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   260
				}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   261
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   262
			break;
151
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   263
		case EPodcastMoveDownloadUp:
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   264
			{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   265
			TInt index = iListContainer->Listbox()->CurrentItemIndex();
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   266
			TBool resumeAfterMove = EFalse;
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   267
			if (index == 1 && !iPodcastModel.SettingsEngine().DownloadSuspended())
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   268
				{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   269
				iPodcastModel.ShowEngine().SuspendDownloads();
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   270
				resumeAfterMove = ETrue;
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   271
				}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   272
			
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   273
			if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   274
				{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   275
				TRAP_IGNORE(iPodcastModel.ShowEngine().MoveDownloadUpL(iPodcastModel.ActiveShowList()[index]->Uid()));
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   276
				}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   277
			
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   278
			if(resumeAfterMove)
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   279
				{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   280
				iPodcastModel.ShowEngine().ResumeDownloadsL();
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   281
				}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   282
				
295
67f53e831ab0 Fix for bug 3876
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 265
diff changeset
   283
			UpdateListboxItemsL();
168
9d3b805af5ab Improvement to queue shifting function - move the highlight too.
Brendan Donegan <brendand@symbian.org>
parents: 163
diff changeset
   284
			iListContainer->Listbox()->SetCurrentItemIndex(index - 1);
151
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   285
			}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   286
			break;
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   287
		case EPodcastMoveDownloadDown:
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   288
			{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   289
			TInt index = iListContainer->Listbox()->CurrentItemIndex();
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   290
			TBool resumeAfterMove = EFalse;
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   291
			if (index == 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   292
				{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   293
				iPodcastModel.ShowEngine().SuspendDownloads();
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   294
				resumeAfterMove = ETrue;
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   295
				}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   296
			
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   297
			if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   298
				{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   299
				TRAP_IGNORE(iPodcastModel.ShowEngine().MoveDownloadDownL(iPodcastModel.ActiveShowList()[index]->Uid()));
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   300
				}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   301
			
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   302
			if(resumeAfterMove)
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   303
				{
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   304
				iPodcastModel.ShowEngine().ResumeDownloadsL();
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   305
				}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   306
			
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   307
			UpdateListboxItemsL();
368
b131f7696342 Catch up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 367
diff changeset
   308
			if (index < iPodcastModel.ActiveShowList().Count() -1)
b131f7696342 Catch up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 367
diff changeset
   309
				iListContainer->Listbox()->SetCurrentItemIndex(index + 1);
151
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   310
			}
17da6d3a5a4b Merge of fix for bug 2737 from Symbian1 branch
teknolog
parents: 137
diff changeset
   311
			break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   312
		case EPodcastSuspendDownloads:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   313
			{
265
72305c65726c Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 243
diff changeset
   314
			iDontUpdateList = ETrue;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   315
			iPodcastModel.ShowEngine().SuspendDownloads();
265
72305c65726c Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 243
diff changeset
   316
			iDontUpdateList = EFalse;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   317
			UpdateListboxItemsL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   318
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   319
			break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   320
		case EPodcastResumeDownloads:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   321
			{
265
72305c65726c Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 243
diff changeset
   322
			iDontUpdateList = ETrue;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   323
			iPodcastModel.ShowEngine().ResumeDownloadsL();
265
72305c65726c Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 243
diff changeset
   324
			iDontUpdateList = EFalse;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   325
			UpdateListboxItemsL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   326
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   327
			break;
301
f5af16df2425 Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 295
diff changeset
   328
		case EPodcastShowInfo:
f5af16df2425 Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 295
diff changeset
   329
			{
f5af16df2425 Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 295
diff changeset
   330
			DisplayShowInfoDialogL();
f5af16df2425 Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 295
diff changeset
   331
			}
f5af16df2425 Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 295
diff changeset
   332
			break;
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   333
		default:
368
b131f7696342 Catch up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 367
diff changeset
   334
			CPodcastShowsView::HandleCommandL(aCommand);
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   335
			break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   336
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   337
	UpdateToolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   338
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   339
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   340
void CPodcastQueueView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
163
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   341
	{
295
67f53e831ab0 Fix for bug 3876
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 265
diff changeset
   342
	if(aResourceId == R_PODCAST_QUEUEVIEW_MENU)
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   343
		{
243
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   344
		TBool dimDown = (iListContainer->Listbox()->CurrentItemIndex() >= iPodcastModel.ActiveShowList().Count() - 1 ?
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   345
				ETrue : EFalse);
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   346
		TBool dimUp = (iListContainer->Listbox()->CurrentItemIndex() <= 0 ?
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   347
				ETrue : EFalse);
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   348
		
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   349
		TInt index = iListContainer->Listbox()->CurrentItemIndex();
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   350
				
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   351
		if (index >= 0 && index < iPodcastModel.ActiveShowList().Count())
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   352
			{			
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   353
			aMenuPane->SetItemDimmed(EPodcastMoveDownloadDown, dimDown);
320
e3ec8e436951 Fix for Hide command in Queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 318
diff changeset
   354
			aMenuPane->SetItemDimmed(EPodcastMoveDownloadUp, dimUp);			
243
44d205147a83 Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 185
diff changeset
   355
			}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   356
		}
163
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   357
	}
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   358
13
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   359
void CPodcastQueueView::UpdateToolbar(TBool aVisible)
163
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   360
	{
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   361
	CAknToolbar* toolbar = Toolbar();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   362
	
163
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   363
	if (toolbar)
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   364
		{
13
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   365
		RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   366
		TInt itemCnt = fItems.Count();
163
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   367
		if (iListContainer->IsVisible()) 
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   368
			{
14
4e75731546eb Fix so toolbars only change visibility for the visible view
teknolog
parents: 13
diff changeset
   369
			toolbar->SetToolbarVisibility(aVisible);
163
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   370
			}
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   371
		
13
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   372
		toolbar->HideItem(EPodcastRemoveAllDownloads, EFalse, ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   373
		toolbar->SetItemDimmed(EPodcastRemoveAllDownloads, itemCnt == 0, ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   374
		toolbar->HideItem(EPodcastSuspendDownloads,iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue);
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   375
		toolbar->HideItem(EPodcastResumeDownloads,!iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue);	
383
931d0db6374d Catchup with Symbian1
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 368
diff changeset
   376
		toolbar->SetItemDimmed(EPodcastRemoveDownload, itemCnt == 0, ETrue);
931d0db6374d Catchup with Symbian1
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 368
diff changeset
   377
		toolbar->HideItem(EPodcastEmpty, EFalse, ETrue );
931d0db6374d Catchup with Symbian1
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 368
diff changeset
   378
		toolbar->SetItemDimmed(EPodcastEmpty, ETrue, ETrue);
931d0db6374d Catchup with Symbian1
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 368
diff changeset
   379
163
f94dbd678dda Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 151
diff changeset
   380
		}
13
f58e3c482bd9 Toolbars now hide when connection query appears
teknolog
parents: 8
diff changeset
   381
	}
367
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   382
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   383
void CPodcastQueueView::UpdateViewTitleL()
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   384
	{
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   385
	 CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   386
		      ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   387
		 
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   388
	HBufC *title = iEikonEnv->AllocReadResourceLC(R_DOWNLOAD_QUEUE);
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   389
	titlePane->SetTextL(*title);
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   390
	CleanupStack::PopAndDestroy(title);
4b75876aa85a Added new shows list
Sebastian Brannstrom <sebastianb@symbian.org>
parents: 320
diff changeset
   391
	}