101 CIAUpdateBGSoftNotification::~CIAUpdateBGSoftNotification() |
101 CIAUpdateBGSoftNotification::~CIAUpdateBGSoftNotification() |
102 { |
102 { |
103 |
103 |
104 delete iTitle; |
104 delete iTitle; |
105 delete iText; |
105 delete iText; |
106 |
|
107 delete iImagePath; |
|
108 |
106 |
109 delete iNotificationDialog; |
107 delete iNotificationDialog; |
110 |
108 |
111 } |
109 } |
112 |
110 |
113 // ----------------------------------------------------------------------------- |
111 // ----------------------------------------------------------------------------- |
114 // CIAUpdateBGSoftNotification::ShowSoftNotificationL |
112 // CIAUpdateBGSoftNotification::ShowNotificationL |
115 // Displays notification |
113 // Displays notification |
116 // ----------------------------------------------------------------------------- |
114 // ----------------------------------------------------------------------------- |
117 // |
115 // |
118 void CIAUpdateBGSoftNotification::ShowNotificationL() |
116 void CIAUpdateBGSoftNotification::ShowNotificationL() |
119 { |
117 { |
120 |
|
121 /* |
|
122 _LIT( KIcon, "C:\\qgn_note_swupdate_notification.svg" ); |
|
123 _LIT( KFirstTimeText, "Check for updates ?" ); |
|
124 _LIT( KNormalText, "Check for updates ?" ); |
|
125 _LIT( KTextRow2, "Tap to view" ); |
|
126 */ |
|
127 |
118 |
128 FLOG("[bgchecker] ShowNotificationL"); |
119 FLOG("[bgchecker] ShowNotificationL"); |
129 |
120 |
130 // crete dialog, id does not exist already |
121 // crete dialog, id does not exist already |
131 if (!iNotificationDialog) |
122 if (!iNotificationDialog) |
132 { |
123 { |
133 iNotificationDialog = CHbDeviceNotificationDialogSymbian::NewL( this ); |
124 iNotificationDialog = CHbDeviceNotificationDialogSymbian::NewL( this ); |
134 } |
125 } |
135 |
|
136 //CleanupStack::PushL( notificationDialog ); // --> memberiin - delete closessa/activaatiossa/destructorissa |
|
137 // + leave kiinni + tuhoaminen |
|
138 // save number of updates |
|
139 //SetNrOfUpdates ( aNrOfUpdates ); |
|
140 |
126 |
141 // enable indicator showing |
127 // enable indicator showing |
142 SetIndicatorEnabled( ETrue ); |
128 SetIndicatorEnabled( ETrue ); |
143 |
129 |
144 // fill texts, icon & behaviour parameters |
130 // fill texts, icon & behaviour parameters |
168 // Set indicator |
154 // Set indicator |
169 CHbSymbianVariant* varValue = CHbSymbianVariant::NewL( &value, |
155 CHbSymbianVariant* varValue = CHbSymbianVariant::NewL( &value, |
170 CHbSymbianVariant::EInt ); |
156 CHbSymbianVariant::EInt ); |
171 CleanupStack::PushL( varValue ); |
157 CleanupStack::PushL( varValue ); |
172 // Temporary removal |
158 // Temporary removal |
173 // ind->Activate( KIndicatorTypeBgc, varValue ); |
159 ind->Activate( KIndicatorTypeBgc, varValue ); |
174 CleanupStack::PopAndDestroy( varValue ); |
160 CleanupStack::PopAndDestroy( varValue ); |
175 CleanupStack::PopAndDestroy( ind ); |
161 CleanupStack::PopAndDestroy( ind ); |
176 |
162 |
177 return; |
163 return; |
178 |
164 |
189 FLOG("[bgchecker] RemoveIndicatorL"); |
175 FLOG("[bgchecker] RemoveIndicatorL"); |
190 |
176 |
191 CHbIndicatorSymbian *ind = CHbIndicatorSymbian::NewL(); |
177 CHbIndicatorSymbian *ind = CHbIndicatorSymbian::NewL(); |
192 CleanupStack::PushL( ind ); |
178 CleanupStack::PushL( ind ); |
193 // Temporary removal |
179 // Temporary removal |
194 // ind->Deactivate( KIndicatorTypeBgc ); |
180 ind->Deactivate( KIndicatorTypeBgc ); |
195 CleanupStack::PopAndDestroy(ind); |
181 CleanupStack::PopAndDestroy(ind); |
196 |
182 |
197 return; |
183 return; |
198 |
184 |
199 } |
185 } |
214 delete iText; |
200 delete iText; |
215 iText = txt; |
201 iText = txt; |
216 } |
202 } |
217 |
203 |
218 // ----------------------------------------------------------------------------- |
204 // ----------------------------------------------------------------------------- |
219 // CIAUpdateBGSoftNotification::SetImagePathL |
|
220 // Sets an image path for a soft notification |
|
221 // ----------------------------------------------------------------------------- |
|
222 // |
|
223 void CIAUpdateBGSoftNotification::SetImagePathL( const TDesC& aImage ) |
|
224 { |
|
225 HBufC* txt = aImage.AllocL(); |
|
226 delete iImagePath; |
|
227 iImagePath = txt; |
|
228 return; |
|
229 } |
|
230 |
|
231 // ----------------------------------------------------------------------------- |
|
232 // CIAUpdateBGSoftNotification::SetNrOfUpdates |
205 // CIAUpdateBGSoftNotification::SetNrOfUpdates |
233 // Sets an image path for a soft notification |
206 // Sets an image path for a soft notification |
234 // ----------------------------------------------------------------------------- |
207 // ----------------------------------------------------------------------------- |
235 // |
208 // |
236 void CIAUpdateBGSoftNotification::SetNrOfUpdates( const TInt& aNrOfUpdates) |
209 void CIAUpdateBGSoftNotification::SetNrOfUpdates( const TInt& aNrOfUpdates) |
276 } |
249 } |
277 |
250 |
278 if ( iText ) |
251 if ( iText ) |
279 { |
252 { |
280 iNotificationDialog->SetTextL(iText->Des()); |
253 iNotificationDialog->SetTextL(iText->Des()); |
281 } |
|
282 |
|
283 if ( iImagePath ) |
|
284 { |
|
285 iNotificationDialog->SetIconNameL(iImagePath->Des()); |
|
286 } |
254 } |
287 |
255 |
288 // set wrapping, timeout and touch |
256 // set wrapping, timeout and touch |
289 iNotificationDialog->SetTitleTextWrapping( |
257 iNotificationDialog->SetTitleTextWrapping( |
290 CHbDeviceNotificationDialogSymbian::TextWordWrap); |
258 CHbDeviceNotificationDialogSymbian::TextWordWrap); |
309 { |
277 { |
310 |
278 |
311 return iActivateIndicator; |
279 return iActivateIndicator; |
312 |
280 |
313 } |
281 } |
314 // ---------------------------------------------------------- |
|
315 // CIAUpdateBGSoftNotification::SetNrOfUpdates( TIAUpdateBGMode aNrOfUpdates ) |
|
316 // ---------------------------------------------------------- |
|
317 /* |
|
318 void CIAUpdateBGSoftNotification::SetNrOfUpdates( const int aNrOfUpdates ) |
|
319 { |
|
320 |
|
321 iNrOfUpdates = aNrOfUpdates; |
|
322 |
|
323 }*/ |
|
324 |
282 |
325 // ---------------------------------------------------------- |
283 // ---------------------------------------------------------- |
326 // CIAUpdateBGSoftNotification::GetNrOfUpdates() |
284 // CIAUpdateBGSoftNotification::GetNrOfUpdates() |
327 // ---------------------------------------------------------- |
285 // ---------------------------------------------------------- |
328 int CIAUpdateBGSoftNotification::GetNrOfUpdates() |
286 int CIAUpdateBGSoftNotification::GetNrOfUpdates() |