199 profileSettings.mRingTone = stringFromDescriptor(setTones.RingingTone1()); |
199 profileSettings.mRingTone = stringFromDescriptor(setTones.RingingTone1()); |
200 profileSettings.mMessageTone = stringFromDescriptor(setTones.MessageAlertTone()); |
200 profileSettings.mMessageTone = stringFromDescriptor(setTones.MessageAlertTone()); |
201 profileSettings.mEmailTone = stringFromDescriptor(extTones.EmailAlertTone()); |
201 profileSettings.mEmailTone = stringFromDescriptor(extTones.EmailAlertTone()); |
202 profileSettings.mReminderTone = stringFromDescriptor(extTones.ReminderTone()); |
202 profileSettings.mReminderTone = stringFromDescriptor(extTones.ReminderTone()); |
203 profileSettings.mNotificationTone = toneSettings.iWarningAndGameTones; |
203 profileSettings.mNotificationTone = toneSettings.iWarningAndGameTones; |
|
204 // only use Keypad Volume as a base value for display in key & touch screen setting option |
204 profileSettings.mKeyTouchScreenTone = toneSettings.iKeypadVolume; |
205 profileSettings.mKeyTouchScreenTone = toneSettings.iKeypadVolume; |
205 |
206 |
206 profileSettings.mRingAlertVibra = vibraSettings.RingAlertVibra(); |
207 profileSettings.mRingAlertVibra = vibraSettings.RingAlertVibra(); |
207 profileSettings.mMessageVibra = vibraSettings.MessageAlertVibra(); |
208 profileSettings.mMessageVibra = vibraSettings.MessageAlertVibra(); |
208 profileSettings.mEmailVibra = vibraSettings.EmailAlertVibra(); |
209 profileSettings.mEmailVibra = vibraSettings.EmailAlertVibra(); |
209 profileSettings.mReminderAlertVibra = vibraSettings.ReminderAlarmVibra(); |
210 profileSettings.mReminderAlertVibra = vibraSettings.ReminderAlarmVibra(); |
210 profileSettings.mNotificationVibra = vibraSettings.InformationVibra(); |
211 profileSettings.mNotificationVibra = vibraSettings.InformationVibra(); |
211 profileSettings.mKeyTouchScreenVibra = feedbackSettings.TactileFeedback(); |
212 profileSettings.mKeyTouchScreenVibra = feedbackSettings.TactileFeedback(); |
212 |
213 |
213 } |
214 } |
|
215 /*! |
|
216 set profile settings |
|
217 \param profileId identify the profile |
|
218 \param profileSettings value of profile options |
|
219 */ |
214 int CpProfileModelPrivate::setProfileSettings(int profileId, CpProfileSettings& profileSettings) |
220 int CpProfileModelPrivate::setProfileSettings(int profileId, CpProfileSettings& profileSettings) |
215 { |
221 { |
216 MProfileExtended2 *profileExtend = mProfileList.value(profileId); |
222 MProfileExtended2 *profileExtend = mProfileList.value(profileId); |
217 MProfileSetTones &setTones = profileExtend->ProfileSetTones(); |
223 MProfileSetTones &setTones = profileExtend->ProfileSetTones(); |
218 TProfileToneSettings &toneSettings = setTones.SetToneSettings(); |
224 TProfileToneSettings &toneSettings = setTones.SetToneSettings(); |
222 profileExtend->ProfileSetVibraSettings(); |
228 profileExtend->ProfileSetVibraSettings(); |
223 MProfileSetExtraSettings &extraSettings = |
229 MProfileSetExtraSettings &extraSettings = |
224 profileExtend->ProfileSetExtraSettings(); |
230 profileExtend->ProfileSetExtraSettings(); |
225 MProfileSetFeedbackSettings &setFeedbackSettings = |
231 MProfileSetFeedbackSettings &setFeedbackSettings = |
226 extraSettings.ProfileSetFeedbackSettings(); |
232 extraSettings.ProfileSetFeedbackSettings(); |
227 // ignore here, wait for the exception deal framework of qt-symbian |
233 |
228 TRAP_IGNORE( |
234 TRAP_IGNORE( |
229 setTones.SetRingingTone1L(*descriptorFromString( |
235 setTones.SetRingingTone1L(*descriptorFromString( |
230 profileSettings.mRingTone)); |
236 profileSettings.mRingTone)); |
231 setTones.SetMessageAlertToneL(*descriptorFromString( |
237 setTones.SetMessageAlertToneL(*descriptorFromString( |
232 profileSettings.mMessageTone)); |
238 profileSettings.mMessageTone)); |
235 setExtTones.SetReminderToneL(*descriptorFromString( |
241 setExtTones.SetReminderToneL(*descriptorFromString( |
236 profileSettings.mReminderTone)); |
242 profileSettings.mReminderTone)); |
237 ) |
243 ) |
238 toneSettings.iWarningAndGameTones |
244 toneSettings.iWarningAndGameTones |
239 = profileSettings.mNotificationTone; |
245 = profileSettings.mNotificationTone; |
|
246 // Change the keypad volume and touch screen tone together |
240 toneSettings.iKeypadVolume |
247 toneSettings.iKeypadVolume |
241 = static_cast<TProfileKeypadVolume> (profileSettings.mKeyTouchScreenTone); |
248 = static_cast<TProfileKeypadVolume> (profileSettings.mKeyTouchScreenTone); |
|
249 setFeedbackSettings.SetAudioFeedback( |
|
250 static_cast<TProfileAudioFeedback> (profileSettings.mKeyTouchScreenTone)); |
|
251 |
242 setVibraSettings.SetRingAlertVibra(profileSettings.mRingAlertVibra); |
252 setVibraSettings.SetRingAlertVibra(profileSettings.mRingAlertVibra); |
243 setVibraSettings.SetMessageAlertVibra(profileSettings.mMessageVibra); |
253 setVibraSettings.SetMessageAlertVibra(profileSettings.mMessageVibra); |
244 setVibraSettings.SetEmailAlertVibra(profileSettings.mEmailVibra); |
254 setVibraSettings.SetEmailAlertVibra(profileSettings.mEmailVibra); |
245 setVibraSettings.SetReminderAlarmVibra( |
255 setVibraSettings.SetReminderAlarmVibra( |
246 profileSettings.mReminderAlertVibra); |
256 profileSettings.mReminderAlertVibra); |
427 toneSettings.iWarningAndGameTones = isActive; |
437 toneSettings.iWarningAndGameTones = isActive; |
428 TRAP_IGNORE( |
438 TRAP_IGNORE( |
429 mEngine->CommitChangeL(*profileExtend); |
439 mEngine->CommitChangeL(*profileExtend); |
430 ) |
440 ) |
431 } |
441 } |
432 |
442 /*! |
|
443 return key & touch screen tone's value |
|
444 \sa setKeyTouchScreenTone |
|
445 */ |
433 int CpProfileModelPrivate::keyTouchScreenTone(int profileId) const |
446 int CpProfileModelPrivate::keyTouchScreenTone(int profileId) const |
434 { |
447 { |
435 MProfileExtended2 *profileExtend = mProfileList.value(profileId); |
448 MProfileExtended2 *profileExtend = mProfileList.value(profileId); |
436 |
449 |
437 const MProfileTones &setTones = profileExtend->ProfileTones(); |
450 const MProfileTones &setTones = profileExtend->ProfileTones(); |
438 const TProfileToneSettings &toneSettings = setTones.ToneSettings(); |
451 const TProfileToneSettings &toneSettings = setTones.ToneSettings(); |
439 |
452 |
440 int keyTouchScreenTone = toneSettings.iKeypadVolume; |
453 int keyTouchScreenTone = toneSettings.iKeypadVolume; |
441 return keyTouchScreenTone; |
454 return keyTouchScreenTone; |
442 } |
455 } |
443 |
456 /*! |
|
457 set key & touch screen tone |
|
458 \param profileId identify the profile |
|
459 \param level 0-5 |
|
460 \sa keyTouchScreenTone |
|
461 */ |
444 void CpProfileModelPrivate::setKeyTouchScreenTone(int profileId, int level) |
462 void CpProfileModelPrivate::setKeyTouchScreenTone(int profileId, int level) |
445 { |
463 { |
446 MProfileExtended2 *profileExtend = mProfileList.value(profileId); |
464 MProfileExtended2 *profileExtend = mProfileList.value(profileId); |
447 MProfileSetTones &setTones = |
465 MProfileSetTones &setTones = |
448 profileExtend->ProfileSetTones(); |
466 profileExtend->ProfileSetTones(); |
449 TProfileToneSettings &toneSettings = |
467 TProfileToneSettings &toneSettings = |
450 setTones.SetToneSettings(); |
468 setTones.SetToneSettings(); |
451 |
469 |
|
470 MProfileSetExtraSettings &extraSettings = |
|
471 profileExtend->ProfileSetExtraSettings(); |
|
472 MProfileSetFeedbackSettings &setFeedbackSettings = |
|
473 extraSettings.ProfileSetFeedbackSettings(); |
|
474 |
452 toneSettings.iKeypadVolume |
475 toneSettings.iKeypadVolume |
453 = static_cast<TProfileKeypadVolume> (level); |
476 = static_cast<TProfileKeypadVolume> (level); |
|
477 |
|
478 setFeedbackSettings.SetAudioFeedback( |
|
479 static_cast<TProfileAudioFeedback> (level)); |
454 TRAP_IGNORE ( |
480 TRAP_IGNORE ( |
455 mEngine->CommitChangeL(*profileExtend); |
481 mEngine->CommitChangeL(*profileExtend); |
456 ) |
482 ) |
457 } |
483 } |
458 |
484 |