106 { |
106 { |
107 if ( aResourceId == R_VPNUI_POLICIES_VIEW_MENU ) |
107 if ( aResourceId == R_VPNUI_POLICIES_VIEW_MENU ) |
108 { |
108 { |
109 TInt currentItem = iPolicyContainer->iListBox->CurrentItemIndex(); |
109 TInt currentItem = iPolicyContainer->iListBox->CurrentItemIndex(); |
110 |
110 |
111 // the policy list is empty all except Install and Exit is dimmed |
|
112 if ( currentItem == -1 ) |
111 if ( currentItem == -1 ) |
113 { |
112 { |
114 aMenuPane->SetItemDimmed( EVpnUiCmdPolicyDetails, ETrue ); |
113 aMenuPane->SetItemDimmed( EVpnUiCmdPolicyDetails, ETrue ); |
115 aMenuPane->SetItemDimmed( EVpnUiCmdDeletePolicy, ETrue ); |
114 aMenuPane->SetItemDimmed( EVpnUiCmdDeletePolicy, ETrue ); |
116 aMenuPane->SetItemDimmed( EVpnUiCmdUpdatePolicy, ETrue ); |
115 |
117 // NSSM support is discontinued |
116 } |
118 aMenuPane->SetItemDimmed( EVpnUiCmdInstallPolicies, ETrue ); |
117 |
119 } |
|
120 // at least one policy is installed, |
|
121 else |
|
122 { |
|
123 aMenuPane->SetItemDimmed( EVpnUiCmdInstallPolicies, ETrue ); |
|
124 // NSSM support is discontinued |
|
125 aMenuPane->SetItemDimmed( EVpnUiCmdUpdatePolicy, ETrue ); |
|
126 } |
|
127 } |
118 } |
128 } |
119 } |
129 |
120 |
130 // --------------------------------------------------------- |
121 // --------------------------------------------------------- |
131 // CVpnManagementUiPolicyView::Id() const |
122 // CVpnManagementUiPolicyView::Id() const |
142 // Handles Softkey and Options list commands |
133 // Handles Softkey and Options list commands |
143 // --------------------------------------------------------- |
134 // --------------------------------------------------------- |
144 // |
135 // |
145 void CVpnManagementUiPolicyView::HandleCommandL( TInt aCommand ) |
136 void CVpnManagementUiPolicyView::HandleCommandL( TInt aCommand ) |
146 { |
137 { |
147 TBool ffsLow; |
138 switch ( aCommand ) |
148 switch ( aCommand ) |
|
149 { |
139 { |
150 case EAknSoftkeyBack: |
140 case EAknSoftkeyBack: |
151 { |
141 { |
152 iLoader.ChangeViewL( KChangeViewPrevious ); |
142 iLoader.ChangeViewL( KChangeViewPrevious ); |
153 break; |
143 break; |
163 // Show details |
153 // Show details |
164 PolicyDetailsL(iPolicyContainer->iListBox->CurrentItemIndex()); |
154 PolicyDetailsL(iPolicyContainer->iListBox->CurrentItemIndex()); |
165 break; |
155 break; |
166 } |
156 } |
167 |
157 |
168 case EVpnUiCmdInstallPolicies: |
158 |
169 { |
|
170 ffsLow = iLoader.FFSSpaceBelowCriticalLevelL( ETrue, 0 ); |
|
171 if(!ffsLow) |
|
172 { |
|
173 iPolicyContainer->InstallPoliciesL(); |
|
174 } |
|
175 break; |
|
176 } |
|
177 case EVpnUiCmdUpdatePolicy: |
|
178 { |
|
179 ffsLow = iLoader.FFSSpaceBelowCriticalLevelL( ETrue, 0 ); |
|
180 if(!ffsLow) |
|
181 { |
|
182 iCurrentPosition = iPolicyContainer->iListBox->CurrentItemIndex(); |
|
183 //Save policy index for Connecting via note |
|
184 iLoader.iCurrentPolicyIndex = iCurrentPosition; |
|
185 //Save update operation for Connecting via note |
|
186 iLoader.iPolicyUpdate = ETrue; |
|
187 |
|
188 TVpnPolicyInfo policyInfo; |
|
189 policyInfo.iId = iLoader.VpnApiWrapperL().PolicyListL()->At( |
|
190 iCurrentPosition).iId; |
|
191 iPolicyContainer->UpdatePolicyL(policyInfo.iId); |
|
192 } |
|
193 break; |
|
194 } |
|
195 |
|
196 case EVpnUiCmdDeletePolicy: |
159 case EVpnUiCmdDeletePolicy: |
197 { |
160 { |
198 //confirmation query |
161 //confirmation query |
199 HBufC* temp; |
162 HBufC* temp; |
200 |
163 |
310 { |
273 { |
311 HBufC* text = HBufC::NewLC(KMaxLengthTextDetailsBody); |
274 HBufC* text = HBufC::NewLC(KMaxLengthTextDetailsBody); |
312 ReadResourceL(*text, aResourceId); |
275 ReadResourceL(*text, aResourceId); |
313 cbaGroup->RemoveCommandFromStack( |
276 cbaGroup->RemoveCommandFromStack( |
314 KVpnMSKControlId, EVpnUiCmdPolicyDetails); |
277 KVpnMSKControlId, EVpnUiCmdPolicyDetails); |
315 cbaGroup->RemoveCommandFromStack( |
|
316 KVpnMSKControlId, EVpnUiCmdInstallPolicies); |
|
317 cbaGroup->AddCommandToStackL( |
278 cbaGroup->AddCommandToStackL( |
318 KVpnMSKControlId, aCommandId, text->Des()); |
279 KVpnMSKControlId, aCommandId, text->Des()); |
319 CleanupStack::PopAndDestroy(text); |
280 CleanupStack::PopAndDestroy(text); |
320 } |
281 } |
321 } |
282 } |