application/src/PodcastSettingsView.cpp
author teknolog
Sat, 03 Apr 2010 21:28:44 +0100
changeset 107 af6475fdf8d6
parent 106 83752b9e3cb6
child 110 403412eb5292
permissions -rw-r--r--
Improved error handling; Implemented support for more than 2 flash drives also for import/export feeds
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 "PodcastSettingsView.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 "Podcast.hrh"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
#include <aknlists.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    23
#include <aknsettingitemlist.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    24
#include <aknnavide.h> 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    25
#include <podcast.rsg>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    26
#include "SettingsEngine.h"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
105
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
    28
#include <akncommondialogsdynmem.h> 
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    29
#include <pathinfo.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    31
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
class CIapSetting: public CAknEnumeratedTextPopupSettingItem 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
{ 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
public:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
	CIapSetting(TInt aResourceId, TInt& aValue, CPodcastModel &aPodcastModel) :
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    36
		CAknEnumeratedTextPopupSettingItem(aResourceId, aValue), iPodcastModel(aPodcastModel), iIap(aValue)
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
	~CIapSetting()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    41
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    42
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    43
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
	void RefreshConnectionListL()
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
		CArrayPtr< CAknEnumeratedText > * enumeratedArr = EnumeratedTextArray();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
		CArrayPtr< HBufC > * poppedUpTextArray = PoppedUpTextArray();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
		enumeratedArr->ResetAndDestroy();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
		poppedUpTextArray->ResetAndDestroy();		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
			
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
		CDesCArrayFlat *iapArray = iPodcastModel.IAPNames();
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
		TBool valueExists = EFalse;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
		DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
		for (int i=0;i<iapArray->Count();i++) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
		HBufC *buf = (*iapArray)[i].AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    57
		poppedUpTextArray->AppendL(buf);
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
		TInt iapId = iPodcastModel.IAPIds()[i].iIapId;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
		DP2("IAP name='%S', id=%d", buf, iapId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    61
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
		if (iapId == ExternalValue()) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
		valueExists = ETrue;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    64
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
		// both arrays destroy themselves, so we need two copies to prevent USER 44
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
		HBufC *buf2 = (*iapArray)[i].AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    68
		CAknEnumeratedText *enumerated = new CAknEnumeratedText(iapId, buf2);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
		enumeratedArr->AppendL(enumerated);
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
		DP1("valueExists=%d", valueExists);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
		if (!valueExists && iPodcastModel.IAPIds().Count() > 0 ) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
		DP1("Setting iIap=%d", iPodcastModel.IAPIds()[0].iIapId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
		iIap = iPodcastModel.IAPIds()[0].iIapId;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
		LoadL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
		DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    78
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    79
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    80
		TRAPD(err, HandleTextArrayUpdateL());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    81
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    82
		if (err != KErrNone) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    83
		DP1("Leave in HandleTextArrayUpdateL, err=%d", err);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    84
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    85
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    86
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    87
	void CompleteConstructionL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    88
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    89
		DP("CIapSetting::CompleteConstructionL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    90
		CAknEnumeratedTextPopupSettingItem::CompleteConstructionL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    91
		RefreshConnectionListL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    92
		DP("CIapSetting::CompleteConstructionL END");
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    95
	void EditItemL(TBool aCalledFromMenu)
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
		DP("CIapSetting::EditItemL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    98
		LoadL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    99
		CAknEnumeratedTextPopupSettingItem::EditItemL(aCalledFromMenu);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   100
		StoreL();		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
		DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   102
		DP("CIapSetting::EditItemL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
	void HandleSettingPageEventL(CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType)
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
		DP("CIapSetting::HandleSettingPageEventL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
		CAknSettingItem::HandleSettingPageEventL(aSettingPage, aEventType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
		/*if (aEventType == EEventSettingOked) 
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
			DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
			StoreL();
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
		DP("CIapSetting::HandleSettingPageEventL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
		}
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
protected:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   118
  	CPodcastModel& iPodcastModel;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   119
  	TInt& iIap;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   120
};
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   121
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   122
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
class CConnectionSetting: public CAknEnumeratedTextPopupSettingItem 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
{ 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
public:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
	CConnectionSetting(TInt aResourceId, TInt& aValue, CPodcastModel &aPodcastModel) :
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
		CAknEnumeratedTextPopupSettingItem(aResourceId, aValue), iPodcastModel(aPodcastModel)
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
		}
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
	~CConnectionSetting()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
		}
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
	void RefreshConnectionListL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   136
		{	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   137
		CArrayPtr< CAknEnumeratedText > * enumeratedArr = EnumeratedTextArray();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
		CArrayPtr< HBufC > * poppedUpTextArray = PoppedUpTextArray();						
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   139
			
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   140
		CDesCArrayFlat *snapArray = iPodcastModel.SNAPNames();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   141
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   142
		TBool valueExists = EFalse;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   143
		DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
		for (int i=0;i<snapArray->Count();i++) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   145
			HBufC *buf = (*snapArray)[i].AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   146
			poppedUpTextArray->InsertL(EConnectionUseNetwork+i,buf);
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
			TInt snapId = iPodcastModel.SNAPIds()[i].iIapId;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   149
			DP2("SNAP name='%S', id=%d", buf, snapId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   150
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   151
			if (snapId == ExternalValue()) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   152
			valueExists = ETrue;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   153
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   154
		// both arrays destroy themselves, so we need two copies to prevent USER 44
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   155
		HBufC *buf2 = (*snapArray)[i].AllocL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   156
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   157
		CAknEnumeratedText *enumerated = new CAknEnumeratedText(EConnectionUseNetwork+i, buf2);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   158
		enumeratedArr->InsertL(EConnectionUseNetwork+i, enumerated);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   159
		}
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
		DP1("valueExists=%d", valueExists);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   162
		if (!valueExists && iPodcastModel.SNAPIds().Count() > 0 ) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   163
		DP1("Setting i=%d", iPodcastModel.SNAPIds()[0].iIapId);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   164
		LoadL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   165
		DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   168
		TRAPD(err, HandleTextArrayUpdateL());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   169
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   170
		if (err != KErrNone) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   171
		DP1("Leave in HandleTextArrayUpdateL, err=%d", err);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   172
		}
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   175
	void CompleteConstructionL()
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
		DP("CIapSetting::CompleteConstructionL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   178
		CAknEnumeratedTextPopupSettingItem::CompleteConstructionL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   179
		RefreshConnectionListL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   180
		DP("CIapSetting::CompleteConstructionL END");
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
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
	void EditItemL(TBool aCalledFromMenu)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
		DP("CIapSetting::EditItemL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   186
		LoadL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
		CAknEnumeratedTextPopupSettingItem::EditItemL(aCalledFromMenu);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   188
		StoreL();		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   189
		DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   190
		DP("CIapSetting::EditItemL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   192
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   193
	void HandleSettingPageEventL(CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   194
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
		DP("CIapSetting::HandleSettingPageEventL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   196
		CAknSettingItem::HandleSettingPageEventL(aSettingPage, aEventType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   197
		/*if (aEventType == EEventSettingOked) 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   198
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
			DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
			StoreL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
			}*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   202
		DP("CIapSetting::HandleSettingPageEventL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   203
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   204
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   205
protected:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   206
  	CPodcastModel& iPodcastModel;  
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   207
};
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
class CPodcastSettingItemList:public CAknSettingItemList
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   210
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   211
public:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   212
	CPodcastSettingItemList(CPodcastModel& aPodcastModel) : iPodcastModel(aPodcastModel)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   213
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
		}
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
	~CPodcastSettingItemList()
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
		DP("CPodcastSettingItemList~");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   219
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   220
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   221
	void StoreSettings() {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   222
		DP("StoreSettings BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   223
		StoreSettingsL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   224
		CSettingsEngine &se = iPodcastModel.SettingsEngine();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   225
		se.SetBaseDir(iShowDir);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   226
		DP1("Base Dir: %S", &iShowDir);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   227
		se.SetUpdateAutomatically((TAutoUpdateSetting)iAutoUpdate);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   228
		DP1("Update automatically: %d", iAutoUpdate);		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   229
		switch(iConnection)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   230
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   231
			case EConnectionDefault:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   232
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   233
				DP("Specific IAP: 0 Ask user");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   234
				se.SetSpecificIAP(0);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   235
				}break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   236
			case EConnectionAlwaysAsk:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   237
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
				DP("Specific IAP: -1 Ask user");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   239
				se.SetSpecificIAP(-1);		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   240
				}break;
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
			case EConnectionUseIap:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
				{		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   244
				DP1("Specific NETWORK: %d", iIap);		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
				se.SetSpecificIAP((iIap|KUseIAPFlag));	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   246
				}break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   247
			default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   248
			case EConnectionUseNetwork:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   249
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   250
				DP1("Specific IAP: %d", iIap);		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   251
				TInt snapIndex = iConnection-EConnectionUseNetwork;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   252
				se.SetSpecificIAP(iPodcastModel.SNAPIds()[snapIndex].iIapId);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   253
				}break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   254
			}		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   255
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   256
		DP1("Download automatically: %d", iAutoDownload);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   257
		se.SetDownloadAutomatically(iAutoDownload);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   258
		se.SaveSettingsL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   259
		DP("StoreSettings END");
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
	void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   263
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   264
		DP1("CPodcastSettingItemList::HandleListBoxEventL event %d", aEventType)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   265
		CAknSettingItemList::HandleListBoxEventL(aListBox, aEventType);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   266
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   267
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   268
	void UpdateSettingVisibility()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   269
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   270
		DP("UpdateSettingVisibility BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   271
		LoadSettingsL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   272
		TBool dimAutoUpdate = iConnection == EConnectionAlwaysAsk;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   273
		TBool dimIAP = iConnection < EConnectionUseIap;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   274
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   275
		iSettingAutoUpdate->SetHidden(dimAutoUpdate);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   276
		iSettingIAP->SetHidden(dimIAP);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   277
		if(!dimIAP)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   278
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   279
			iSettingIAP->RefreshConnectionListL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   280
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   281
		ListBox()->ScrollToMakeItemVisible(0);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   282
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   283
		TRAP_IGNORE(HandleChangeInItemArrayOrVisibilityL());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   284
		DP("UpdateSettingVisibility END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   285
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   286
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   287
	void  EditItemL (TInt aIndex, TBool aCalledFromMenu)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   288
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   289
		DP("EditItemL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   290
		if (aIndex == 0) {
105
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   291
			TFileName selectedFolder;
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   292
			selectedFolder.Copy(iShowDir);
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   293
			TFileName startFolder;
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   294
			startFolder.Zero();
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   295
			TInt types = AknCommonDialogsDynMem::EMemoryTypePhone | AknCommonDialogsDynMem::EMemoryTypeMMC |AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| AknCommonDialogsDynMem::EMemoryTypeRemote;
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   296
			
107
af6475fdf8d6 Improved error handling; Implemented support for more than 2 flash drives also for import/export feeds
teknolog
parents: 106
diff changeset
   297
			HBufC *title = iCoeEnv->AllocReadResourceLC(R_PODCAST_SELECT_FOLDER);
105
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   298
			if (AknCommonDialogsDynMem::RunFolderSelectDlgLD (types, selectedFolder,
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   299
					startFolder, NULL, NULL, *title))
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   300
				{
105
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   301
				_LIT(KPodcastsDir, "Podcasts");
106
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   302
				TInt pos = selectedFolder.Find(KPodcastsDir);
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   303
				if (pos == KErrNotFound || pos != selectedFolder.Length()-9)
105
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   304
					{
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   305
					// append "Podcasts" if the folder isn't already called this
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   306
					selectedFolder.Append(KPodcastsDir);
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   307
					}
106
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   308
				
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   309
				if (selectedFolder[selectedFolder.Length()-1] != '\\')
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   310
					{
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   311
					selectedFolder.Append(_L("\\"));
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   312
					}
83752b9e3cb6 Fix for regression in icon handling. Minor fix for trailing backslash in podcast dir in settings pane. New udeb SISs.
teknolog
parents: 105
diff changeset
   313
				
105
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   314
				iShowDir.Copy(selectedFolder);
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   315
				LoadSettingsL();
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   316
				}
105
236022094302 Fix for bug 2338 - Podcatcher doesn't know about disk F:
teknolog
parents: 49
diff changeset
   317
			CleanupStack::PopAndDestroy(title);
2
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
		else {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   320
			CAknSettingItemList::EditItemL(aIndex,aCalledFromMenu);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   321
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   322
			StoreSettingsL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   323
			UpdateSettingVisibility();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   324
		DP("EditItemL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   325
		}
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
	/**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   328
	 * Framework method to create a setting item based upon the user id aSettingId. The 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   329
	 * client code decides what type to contruct. new (ELeave) must then be used and the resulting 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   330
	 * pointer returned. Ownership is thereafter base class's responsiblity.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   331
	 *
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   332
	 * @param aSettingId	ID to use to determine the type of the setting item
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   333
	 * @return a constructed (not 2nd-stage constructed) setting item.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   334
	 */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   335
	CAknSettingItem* CreateSettingItemL( TInt aSettingId )
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
		DP1("CreateSettingItemL BEGIN, aSettingId=%d", aSettingId);
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
		CSettingsEngine &se = iPodcastModel.SettingsEngine();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   340
		iShowDir.Copy(se.BaseDir());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   341
		iAutoUpdate = se.UpdateAutomatically();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   342
		iIap = se.SpecificIAP();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   343
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   344
		if( iIap == 0)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   345
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   346
			iConnection = EConnectionDefault;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   347
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   348
		else if ( iIap == -1)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   349
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   350
			iConnection = EConnectionAlwaysAsk;	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   351
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   352
		else if ( (iIap & KUseIAPFlag))
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   353
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   354
			iConnection = EConnectionUseIap;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   355
			iIap = iIap& KUseIAPMask;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   356
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   357
		else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   358
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   359
			TInt snapIndex = 0;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   360
			TInt cnt = iPodcastModel.SNAPIds().Count();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   361
			while(snapIndex < cnt && ((TInt)iPodcastModel.SNAPIds()[snapIndex].iIapId) != iIap)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   362
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   363
				snapIndex++;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   364
				}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   365
			
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   366
			if(snapIndex != cnt)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   367
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   368
				iConnection = EConnectionUseNetwork+snapIndex;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   369
				}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   370
			else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   371
				{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   372
				iConnection = EConnectionAlwaysAsk;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   373
				}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   374
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   375
									
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   376
		iAutoDownload = se.DownloadAutomatically();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   377
			
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   378
		switch(aSettingId)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   379
			{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   380
			case EPodcastSettingShowDir:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   381
				DP("EPodcastSettingShowDir");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   382
				return new (ELeave) CAknTextSettingItem(aSettingId, iShowDir);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   383
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   384
			case EPodcastSettingAutoUpdate:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   385
				DP("EPodcastSettingAutoUpdate");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   386
				iSettingAutoUpdate = new (ELeave) CAknEnumeratedTextPopupSettingItem(aSettingId, iAutoUpdate);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   387
				return iSettingAutoUpdate;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   388
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   389
			case EPodcastSettingConnection:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   390
				DP("EPodcastSettingConnection");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   391
				return new (ELeave) CConnectionSetting (aSettingId, iConnection, iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   392
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   393
			case EPodcastSettingIAPList:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   394
				DP("EPodcastSettingIAPList");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   395
				iSettingIAP = new (ELeave) CIapSetting (aSettingId, iIap, iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   396
				return iSettingIAP;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   397
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   398
			case EPodcastSettingAutoDownload:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   399
				DP("EPodcastSettingAutoDownload");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   400
				iSettingAutoDownload = new (ELeave) CAknBinaryPopupSettingItem (aSettingId, iAutoDownload);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   401
				return iSettingAutoDownload;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   402
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   403
			default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   404
				return CAknSettingItemList::CreateSettingItemL(aSettingId);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   405
				break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   406
			}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   407
		DP("CreateSettingItemL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   408
		return NULL;	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   409
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   410
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   411
	TFileName iShowDir;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   412
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   413
	TInt iAutoUpdate;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   414
	CAknSettingItem *iSettingAutoUpdate;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   415
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   416
	TInt iAutoDownload;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   417
	CAknSettingItem *iSettingAutoDownload; 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   418
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   419
	TInt iConnection;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   420
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   421
	TInt iIap;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   422
	CIapSetting *iSettingIAP; 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   423
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   424
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   425
	CPodcastModel &iPodcastModel;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   426
	};
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   427
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   428
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   429
CPodcastSettingsView* CPodcastSettingsView::NewL(CPodcastModel& aPodcastModel)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   430
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   431
    CPodcastSettingsView* self = CPodcastSettingsView::NewLC(aPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   432
    CleanupStack::Pop( self );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   433
    return self;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   434
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   435
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   436
CPodcastSettingsView* CPodcastSettingsView::NewLC(CPodcastModel& aPodcastModel)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   437
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   438
    CPodcastSettingsView* self = new ( ELeave ) CPodcastSettingsView(aPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   439
    CleanupStack::PushL( self );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   440
    self->ConstructL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   441
    return self;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   442
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   443
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   444
CPodcastSettingsView::CPodcastSettingsView(CPodcastModel& aPodcastModel):iPodcastModel(aPodcastModel)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   445
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   446
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   447
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   448
void CPodcastSettingsView::ConstructL()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   449
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   450
	BaseConstructL(R_PODCAST_SETTINGSVIEW);	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   451
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   452
    
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   453
CPodcastSettingsView::~CPodcastSettingsView()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   454
    {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   455
    DP("CPodcastSettingsView::~CPodcastSettingsView()");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   456
	delete iListbox;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   457
    }
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   458
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   459
TUid CPodcastSettingsView::Id() const
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   460
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   461
	return KUidPodcastSettingsViewID;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   462
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   463
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   464
void CPodcastSettingsView::DoActivateL(const TVwsViewId& aPrevViewId,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   465
	                                  TUid /*aCustomMessageId*/,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   466
	                                  const TDesC8& /*aCustomMessage*/)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   467
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   468
	DP("CPodcastSettingsView::DoActivateL BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   469
	iPreviousView = aPrevViewId;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   470
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   471
	if (iListbox) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   472
		delete iListbox;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   473
		iListbox = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   474
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   475
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   476
	DP("Creating listbox");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   477
	iPodcastModel.UpdateSNAPListL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   478
	iPodcastModel.UpdateIAPListL();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   479
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   480
	iListbox =new (ELeave) CPodcastSettingItemList(iPodcastModel);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   481
	iListbox->SetMopParent( this );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   482
	iListbox->ConstructFromResourceL(R_PODCAST_SETTINGS);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   483
	iListbox->SetRect(ClientRect());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   484
	iListbox->ActivateL();   
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   485
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   486
	DP("Creating navipane");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   487
	iNaviPane =( CAknNavigationControlContainer * ) StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   488
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   489
	HBufC *titleBuffer = iEikonEnv->AllocReadResourceL(R_SETTINGS_TITLE);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   490
	iNaviDecorator  = iNaviPane->CreateNavigationLabelL(*titleBuffer);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   491
	delete titleBuffer;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   492
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   493
	DP("Updating listbox");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   494
	AppUi()->AddToStackL(*this, iListbox);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   495
	iListbox->UpdateSettingVisibility();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   496
	iListbox->MakeVisible(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   497
	iListbox->DrawNow();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   498
	iListbox->SetFocus(ETrue);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   499
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   500
	if(iNaviDecorator && iNaviPane)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   501
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   502
		iNaviPane->PushL(*iNaviDecorator);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   503
		}
49
43e204e6ae2e Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents: 2
diff changeset
   504
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   505
	DP("CPodcastSettingsView::DoActivateL END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   506
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   507
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   508
void CPodcastSettingsView::DoDeactivate()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   509
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   510
	DP("CPodcastSettingsView::DoDeactivate BEGIN");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   511
	if (iListbox) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   512
		iListbox->MakeVisible(EFalse);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   513
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   514
		AppUi()->RemoveFromViewStack( *this, iListbox );
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   515
		
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   516
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   517
	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   518
	if(iNaviDecorator && iNaviPane)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   519
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   520
		iNaviPane->Pop(iNaviDecorator);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   521
		delete iNaviDecorator;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   522
		iNaviDecorator = NULL;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   523
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   524
	DP("CPodcastSettingsView::DoDeactivate END");
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   525
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   526
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   527
/** 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   528
* Command handling function intended for overriding by sub classes. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   529
* Default implementation is empty.  
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   530
* @param aCommand ID of the command to respond to. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   531
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   532
void CPodcastSettingsView::HandleCommandL(TInt aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   533
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   534
	CAknView::HandleCommandL(aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   535
	DP1("CPodcastListView::HandleCommandL=%d", aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   536
	switch(aCommand)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   537
	{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   538
	case EAknSoftkeyBack:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   539
		{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   540
		iListbox->StoreSettings();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   541
		AppUi()->ActivateViewL(iPreviousView);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   542
		}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   543
		break;	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   544
	default:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   545
		AppUi()->HandleCommandL(aCommand);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   546
		break;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   547
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   548
}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   549
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   550
void CPodcastSettingsView::HandleStatusPaneSizeChange()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   551
{
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   552
	CAknView::HandleStatusPaneSizeChange();
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   553
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   554
	DP2("CPodcastSettingsView::HandleStatusPaneSizeChange() width=%d, height=%d", ClientRect().Width(), ClientRect().Height());
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   555
	if (iListbox) {
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   556
		iListbox->SetRect( ClientRect());	
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   557
	}
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   558
}