14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 #include <aknnotewrappers.h> |
17 #include <aknnotewrappers.h> |
18 #include <akntextsettingpage.h> |
18 #include <akntextsettingpage.h> |
|
19 |
19 #include "cenrepeditorListbox2.h" |
20 #include "cenrepeditorListbox2.h" |
20 |
21 |
21 #include "cenrepeditorListbox2.h" |
|
22 #include <e32debug.h> |
|
23 |
22 |
24 CAknSettingItem* COtherResourcesListbox::CreateSettingItemL( TInt aIdentifier ) |
23 CAknSettingItem* COtherResourcesListbox::CreateSettingItemL( TInt aIdentifier ) |
25 { |
24 { |
26 CAknSettingItem* settingItem = NULL; |
25 CAknSettingItem* settingItem = NULL; |
27 |
26 |
47 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iEdgeDtmSupport); |
46 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iEdgeDtmSupport); |
48 break; |
47 break; |
49 case EOtherResourceSessionSetupMethod: |
48 case EOtherResourceSessionSetupMethod: |
50 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iSessionSetupMethod); |
49 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iSessionSetupMethod); |
51 break; |
50 break; |
52 case EOtherRResourcePrivacyVariationMode: |
|
53 settingItem=ConstructByValueL( aIdentifier, iOtherResources->iPrivacyVariation ); |
|
54 break; |
|
55 case EOtherResourceAutoRecord: |
51 case EOtherResourceAutoRecord: |
56 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iAutoRecord); |
52 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iAutoRecord); |
57 break; |
53 break; |
58 case EOtherResourceVideoLocation: |
54 case EOtherResourceVideoLocation: |
59 settingItem=new (ELeave) |
55 settingItem=new (ELeave) |
79 settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); |
75 settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); |
80 |
76 |
81 break; |
77 break; |
82 case EOtherResourceEncodingDevice: |
78 case EOtherResourceEncodingDevice: |
83 settingItem = new (ELeave) |
79 settingItem = new (ELeave) |
84 CAknTextSettingItem( aIdentifier, iOtherResources->iEncodingDeviceStr ); |
80 CAknTextSettingItem( aIdentifier, iOtherResources->iEncodingDeviceStr ); |
85 break; |
81 settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); |
|
82 break; |
|
83 case EOtherResourceAllowOnlyWithActiveCSCall: |
|
84 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iOnlyWithActiveCSCall ); |
|
85 break; |
|
86 case EOtherResourceAllowOnlyIn3GNetwork: |
|
87 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iOnlyIn3GNetwork ); |
|
88 break; |
|
89 case EOtherResourceCameraUsage: |
|
90 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iCameraUsage ); |
|
91 break; |
|
92 case EOtherResourceVideoDirection: |
|
93 settingItem=ConstructByValueL( aIdentifier,iOtherResources->iVideoDirection ); |
|
94 break; |
|
95 case EOtherResourceVideoBandwidth: |
|
96 settingItem = new (ELeave) |
|
97 CAknIntegerEdwinSettingItem( aIdentifier,iOtherResources->iVideoBandwidth ); |
|
98 break; |
|
99 case EOtherResourceFastMode: |
|
100 settingItem = ConstructByValueL( aIdentifier, iOtherResources->iFastMode ); |
|
101 break; |
86 default: |
102 default: |
87 break; |
103 break; |
88 } |
104 } |
89 return settingItem; |
105 return settingItem; |
90 } |
106 } |
102 ListBox()->SetRect(Rect()); |
118 ListBox()->SetRect(Rect()); |
103 } |
119 } |
104 } |
120 } |
105 |
121 |
106 |
122 |
107 // ------------------------------------------------------------------ |
123 CAknSettingItem* COtherResourcesListbox::ConstructByValueL( |
108 // CPhoneResourcesListbox::ConstructByValueL( aIdentifier, ) |
124 TInt aIdentifier, |
109 // ------------------------------------------------------------------ |
125 TInt& aVal) |
110 // |
|
111 |
|
112 CAknSettingItem* COtherResourcesListbox::ConstructByValueL( TInt aIdentifier, |
|
113 TInt& aVal ) |
|
114 { |
126 { |
115 CAknSettingItem* settingItem = NULL ; |
127 return new (ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier,aVal); |
116 if(aVal<0 ) |
|
117 { |
|
118 settingItem = new (ELeave) CAknSettingItem(aIdentifier); |
|
119 settingItem->SetProtectionState(CAknSettingItem::ESettingItemProtected); |
|
120 } |
|
121 else |
|
122 { |
|
123 settingItem = new (ELeave) |
|
124 CAknEnumeratedTextPopupSettingItem(aIdentifier,aVal); |
|
125 } |
|
126 return settingItem ; |
|
127 } |
128 } |
128 |
|
129 |
|
130 void COtherResourcesListbox::EditItemL(TInt aIndex, TBool aCalledFromMenu) |
|
131 { |
|
132 CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu); |
|
133 |
|
134 CAknSettingItem* currentItem = SettingItemArray()->At(aIndex); |
|
135 if ( currentItem->Identifier() == EOtherResourceEncodingDevice ) |
|
136 { |
|
137 TLex lex( currentItem->SettingTextL() ); |
|
138 TUint uid; |
|
139 TInt err = lex.Val(uid, EHex); |
|
140 |
|
141 if ( (err != KErrNone) || !lex.Eos() ) |
|
142 { |
|
143 currentItem->LoadL(); |
|
144 currentItem->UpdateListBoxTextL(); |
|
145 |
|
146 CAknWarningNote* warningNote = new (ELeave) CAknWarningNote; |
|
147 warningNote->ExecuteLD(_L("Invalid value")); |
|
148 } |
|
149 } |
|
150 } |
|