changeset 40 | 593f946f4fec |
parent 22 | a5692c68d772 |
22:a5692c68d772 | 40:593f946f4fec |
---|---|
34 #include <ProfileEngineInternalCRKeys.h> |
34 #include <ProfileEngineInternalCRKeys.h> |
35 |
35 |
36 CpProfileSettingForm::CpProfileSettingForm() |
36 CpProfileSettingForm::CpProfileSettingForm() |
37 : mModel(0), mItemDataHelper(new CpItemDataHelper( this )), |
37 : mModel(0), mItemDataHelper(new CpItemDataHelper( this )), |
38 mProfileModel(new CpProfileModel()), mFileIconProvider(new QFileIconProvider), |
38 mProfileModel(new CpProfileModel()), mFileIconProvider(new QFileIconProvider), |
39 mGeneralPage(0),mMeetingPage(0),mCurrentPage( 0 ), mSettingManager(0) |
39 mGeneralPage(0),mMeetingPage(0), mSettingManager(0), mCurrentPage(0) |
40 { |
40 { |
41 this->setHeading(hbTrId("txt_cp_button_advanced_settings")); |
41 this->setHeading(hbTrId("txt_cp_button_advanced_settings")); |
42 this->setDescription(hbTrId("txt_cp_info_select_tones_that_play_when_you_select")); |
42 this->setDescription(hbTrId("txt_cp_info_select_tones_that_play_when_you_select")); |
43 |
|
44 initModel(); |
43 initModel(); |
44 connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(onDataFormActivated(QModelIndex))); |
|
45 |
|
45 } |
46 } |
46 |
47 |
47 CpProfileSettingForm::~CpProfileSettingForm() |
48 CpProfileSettingForm::~CpProfileSettingForm() |
48 { |
49 { |
49 delete mModel; |
50 delete mModel; |
50 delete mProfileModel; |
51 delete mProfileModel; |
51 delete mFileIconProvider; |
52 delete mFileIconProvider; |
52 delete mSettingManager; |
53 delete mSettingManager; |
53 } |
54 } |
54 |
55 |
56 void CpProfileSettingForm::onDataFormActivated(const QModelIndex &index) |
|
57 { |
|
58 HbDataFormModelItem *item = mModel->itemFromIndex(index); |
|
59 mCurrentPage = item; |
|
60 } |
|
61 |
|
62 QString CpProfileSettingForm::currentPageProfileName() |
|
63 { |
|
64 return mCurrentPage->label(); |
|
65 } |
|
66 |
|
67 void CpProfileSettingForm::setCurrentPageProfileName(const QString &name) |
|
68 { |
|
69 mCurrentPage->setLabel(name); |
|
70 } |
|
71 |
|
72 void CpProfileSettingForm::updateModifiedProfileName(const QString &name) |
|
73 { |
|
74 if (mCurrentPage == mGeneralPage) { |
|
75 mProfileModel->setProfileName(EProfileWrapperGeneralId, name); |
|
76 } else if (mCurrentPage == mMeetingPage) { |
|
77 mProfileModel->setProfileName(EProfileWrapperMeetingId, name); |
|
78 } |
|
79 } |
|
80 |
|
55 void CpProfileSettingForm::initModel() |
81 void CpProfileSettingForm::initModel() |
56 { |
82 { |
57 mModel = new HbDataFormModel(); |
83 mModel = new HbDataFormModel(); |
58 |
84 |
59 QString generalString( mProfileModel->profileName( EProfileWrapperGeneralId ) ); |
85 QString generalString( mProfileModel->profileName( EProfileWrapperGeneralId ) ); |
75 |
101 |
76 mSettingManager->startMonitoring(key,XQSettingsManager::TypeInt); |
102 mSettingManager->startMonitoring(key,XQSettingsManager::TypeInt); |
77 connect(mSettingManager, SIGNAL(valueChanged (XQSettingsKey, QVariant)), |
103 connect(mSettingManager, SIGNAL(valueChanged (XQSettingsKey, QVariant)), |
78 this, SLOT(settingValueChanged(XQSettingsKey, QVariant))); |
104 this, SLOT(settingValueChanged(XQSettingsKey, QVariant))); |
79 |
105 |
80 mGeneralPage = mModel->appendDataFormPage( generalString ); |
106 mGeneralPage = mModel->appendDataFormPage( generalString ); |
107 mCurrentPage = mGeneralPage; |
|
81 initProfileItems(EProfileWrapperGeneralId,mGeneralPage); |
108 initProfileItems(EProfileWrapperGeneralId,mGeneralPage); |
82 |
109 |
83 //initGeneralTonesGroup(); |
110 //initGeneralTonesGroup(); |
84 |
111 |
85 //initGeneralVibraGroup(); |
112 //initGeneralVibraGroup(); |
135 modelItems.insert(ProfileItemReminderTone,modelItem); |
162 modelItems.insert(ProfileItemReminderTone,modelItem); |
136 |
163 |
137 //notification tones item |
164 //notification tones item |
138 modelItem= mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),parent); |
165 modelItem= mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),parent); |
139 modelItem->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones")); |
166 modelItem->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones")); |
140 modelItem->setContentWidgetData( "checkState", profileSettings.mNotificationTone ? 2 : 0 ); |
167 modelItem->setContentWidgetData("checkState", profileSettings.mNotificationTone ? 2 : 0); |
168 modelItem->setContentWidgetData("objectName", "notificationTonesCheckBox" + QString::number(profileId)); |
|
141 if (profileId == EProfileWrapperGeneralId) { |
169 if (profileId == EProfileWrapperGeneralId) { |
142 addConnection( modelItem, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationTones_stateChanged( int ))); |
170 addConnection( modelItem, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationTones_stateChanged( int ))); |
143 } |
171 } |
144 else if (profileId == EProfileWrapperMeetingId) { |
172 else if (profileId == EProfileWrapperMeetingId) { |
145 addConnection( modelItem, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationTones_stateChanged( int ))); |
173 addConnection( modelItem, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationTones_stateChanged( int ))); |
154 QList<QVariant> sliderElements; |
182 QList<QVariant> sliderElements; |
155 sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement) |
183 sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement) |
156 << QVariant(HbSlider::DecreaseElement) << QVariant(HbSlider::IconElement) |
184 << QVariant(HbSlider::DecreaseElement) << QVariant(HbSlider::IconElement) |
157 << QVariant(HbSlider::TextElement); |
185 << QVariant(HbSlider::TextElement); |
158 modelItem->setContentWidgetData("sliderElements",sliderElements); |
186 modelItem->setContentWidgetData("sliderElements",sliderElements); |
159 |
187 modelItem->setContentWidgetData("objectName", "keyTonesSlider" + QString::number(profileId)); |
160 |
188 |
161 |
189 |
162 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
190 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
163 modelItem->setContentWidgetData( QString( "minimum" ), 0 ); |
191 modelItem->setContentWidgetData( QString( "minimum" ), 0 ); |
164 modelItem->setContentWidgetData( QString( "maximum" ), 5 ); |
192 modelItem->setContentWidgetData( QString( "maximum" ), 5 ); |
165 modelItem->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone ); |
193 modelItem->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone ); |
166 QMap< QString, QVariant > elements; |
194 QMap< QString, QVariant > elements; |
167 elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); |
195 elements.insert(QString("IncreaseElement") , QVariant("qtg_mono_vol_up")); |
168 elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); |
196 elements.insert(QString("DecreaseElement"), QVariant("qtg_mono_vol_down") ); |
169 if (profileSettings.mKeyTouchScreenTone != 0) { |
197 if (profileSettings.mKeyTouchScreenTone != 0) { |
170 elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg") ); |
198 elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker") ); |
171 } |
199 } |
172 else { |
200 else { |
173 elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") ); |
201 elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker_off") ); |
174 } |
202 } |
175 |
203 |
176 modelItem->setContentWidgetData( QString( "elementIcons" ), elements ); |
204 modelItem->setContentWidgetData( QString( "elementIcons" ), elements ); |
177 |
205 |
178 if (profileId == EProfileWrapperGeneralId) { |
206 if (profileId == EProfileWrapperGeneralId) { |
190 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
218 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
191 sliderElements.clear(); |
219 sliderElements.clear(); |
192 sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement) |
220 sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement) |
193 << QVariant(HbSlider::DecreaseElement); |
221 << QVariant(HbSlider::DecreaseElement); |
194 modelItem->setContentWidgetData("sliderElements",sliderElements); |
222 modelItem->setContentWidgetData("sliderElements",sliderElements); |
195 |
223 modelItem->setContentWidgetData("objectName", "vibrationSlider" + QString::number(profileId)); |
196 modelItem->setContentWidgetData( QString( "minimum" ), 0 ); |
224 modelItem->setContentWidgetData( QString( "minimum" ), 0 ); |
197 modelItem->setContentWidgetData( QString( "maximum" ), 5 ); |
225 modelItem->setContentWidgetData( QString( "maximum" ), 5 ); |
198 modelItem->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); |
226 modelItem->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); |
199 QMap< QString, QVariant > iconElements; |
227 QMap< QString, QVariant > iconElements; |
200 iconElements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); |
228 iconElements.insert(QString("IncreaseElement") , QVariant("qtg_mono_vol_up")); |
201 iconElements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); |
229 iconElements.insert(QString("DecreaseElement"), QVariant("qtg_mono_vol_down") ); |
202 modelItem->setContentWidgetData( QString( "elementIcons" ), iconElements ); |
230 modelItem->setContentWidgetData( QString( "elementIcons" ), iconElements ); |
203 |
231 |
204 if (profileId == EProfileWrapperGeneralId) { |
232 if (profileId == EProfileWrapperGeneralId) { |
205 addConnection( modelItem, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int ))); |
233 addConnection( modelItem, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int ))); |
206 } |
234 } |
212 |
240 |
213 mProfileModelItems.insert(profileId,modelItems); |
241 mProfileModelItems.insert(profileId,modelItems); |
214 |
242 |
215 } |
243 } |
216 |
244 |
217 /* |
245 |
218 void CpProfileSettingForm::initGeneralTonesGroup() |
|
219 { |
|
220 CpProfileSettings profileSettings; |
|
221 mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings ); |
|
222 |
|
223 //HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup( |
|
224 // hbTrId("txt_cp_subhead_tones"),mGeneralPage); |
|
225 QFileInfo ringToneFileInfo( profileSettings.mRingTone ); |
|
226 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
227 hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mGeneralPage); |
|
228 |
|
229 QFileInfo messageToneFileInfo( profileSettings.mMessageTone ); |
|
230 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
231 hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mGeneralPage); |
|
232 |
|
233 QFileInfo emailToneFileInfo( profileSettings.mEmailTone ); |
|
234 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
235 hbTrId("txt_cp_dblist_email_tone"), emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mGeneralPage); |
|
236 |
|
237 QFileInfo reminderToneFileInfo( profileSettings.mReminderTone ); |
|
238 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
239 hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mGeneralPage); |
|
240 |
|
241 HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mGeneralPage); |
|
242 notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones")); |
|
243 notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 ); |
|
244 |
|
245 mGeneralKeysAndScreenToneSlider = |
|
246 mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mGeneralPage); |
|
247 |
|
248 //QMap< QString, QVariant > elements; |
|
249 //elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); |
|
250 //elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); |
|
251 //elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") ); |
|
252 //mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "elementIcons" ), elements ); |
|
253 |
|
254 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
|
255 mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 ); |
|
256 mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 ); |
|
257 mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone ); |
|
258 |
|
259 |
|
260 mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mGeneralPage ); |
|
261 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
|
262 mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); |
|
263 mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); |
|
264 mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); |
|
265 |
|
266 addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationTones_stateChanged( int ))); |
|
267 addConnection( mGeneralKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_general_keysAndScreenToneSlider_ValueChanged( int ))); |
|
268 addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int ))); |
|
269 } |
|
270 */ |
|
271 |
|
272 /*void CpProfileSettingForm::initGeneralVibraGroup() |
|
273 { |
|
274 CpProfileSettings profileSettings; |
|
275 mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings ); |
|
276 |
|
277 HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup( |
|
278 hbTrId( "txt_cp_subhead_vibra" ), mGeneralPage ); |
|
279 HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
280 ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) ); |
|
281 ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 ); |
|
282 |
|
283 HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
284 messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) ); |
|
285 messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 ); |
|
286 |
|
287 HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
288 emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) ); |
|
289 emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 ); |
|
290 |
|
291 HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
292 reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" )); |
|
293 reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 ); |
|
294 |
|
295 HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
296 notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) ); |
|
297 notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 ); |
|
298 |
|
299 mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup ); |
|
300 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
|
301 mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); |
|
302 mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); |
|
303 mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); |
|
304 |
|
305 addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_general_ringVibar_stateChanged( int ))); |
|
306 addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_messageVibra_stateChanged( int ))); |
|
307 addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_emailVibra_stateChanged( int ))); |
|
308 addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_reminderVibra_stateChanged( int ))); |
|
309 addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationVibra_stateChanged( int ))); |
|
310 |
|
311 addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int ))); |
|
312 }*/ |
|
313 |
|
314 //////////////////////////////////////////////////////////// |
|
315 /*void CpProfileSettingForm::initMeetingTonesGroup() |
|
316 { |
|
317 CpProfileSettings profileSettings; |
|
318 mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings ); |
|
319 |
|
320 //HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup( |
|
321 // hbTrId("txt_cp_subhead_tones"),mMeetingPage); |
|
322 QFileInfo ringToneFileInfo( profileSettings.mRingTone ); |
|
323 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
324 hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mMeetingPage); |
|
325 |
|
326 QFileInfo messageToneFileInfo( profileSettings.mMessageTone ); |
|
327 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
328 hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mMeetingPage); |
|
329 |
|
330 QFileInfo emailToneFileInfo( profileSettings.mEmailTone ); |
|
331 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
332 hbTrId("txt_cp_dblist_email_tone"), emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mMeetingPage); |
|
333 |
|
334 QFileInfo reminderToneFileInfo( profileSettings.mReminderTone ); |
|
335 mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, |
|
336 hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mMeetingPage); |
|
337 |
|
338 HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mMeetingPage); |
|
339 notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones")); |
|
340 notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 ); |
|
341 |
|
342 mMeetingKeysAndScreenToneSlider = |
|
343 mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mMeetingPage); |
|
344 |
|
345 //QMap< QString, QVariant > elements; |
|
346 //elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); |
|
347 //elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); |
|
348 //elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") ); |
|
349 //mMeetingkeysAndScreenSlider->setContentWidgetData( QString( "elementIcons" ), elements ); |
|
350 |
|
351 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
|
352 mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 ); |
|
353 mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 ); |
|
354 mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone ); |
|
355 |
|
356 mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mMeetingPage ); |
|
357 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
|
358 mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); |
|
359 mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); |
|
360 mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); |
|
361 |
|
362 addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationTones_stateChanged( int ))); |
|
363 addConnection( mMeetingKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_keysAndScreenSlider_ValueChanged( int ))); |
|
364 addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int ))); |
|
365 } |
|
366 */ |
|
367 /*void CpProfileSettingForm::initMeetingVibraGroup() |
|
368 { |
|
369 CpProfileSettings profileSettings; |
|
370 mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings ); |
|
371 |
|
372 HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup( |
|
373 hbTrId( "txt_cp_subhead_vibra" ), mMeetingPage ); |
|
374 HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
375 ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) ); |
|
376 ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 ); |
|
377 |
|
378 HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
379 messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) ); |
|
380 messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 ); |
|
381 |
|
382 HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
383 emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) ); |
|
384 emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 ); |
|
385 |
|
386 HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
387 reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" )); |
|
388 reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 ); |
|
389 |
|
390 HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); |
|
391 notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) ); |
|
392 notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 ); |
|
393 |
|
394 mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup ); |
|
395 //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 |
|
396 mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); |
|
397 mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); |
|
398 mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); |
|
399 |
|
400 addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_ringVibar_stateChanged( int ))); |
|
401 addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_messageVibra_stateChanged( int ))); |
|
402 addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_emailVibra_stateChanged( int ))); |
|
403 addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_reminderVibra_stateChanged( int ))); |
|
404 addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationVibra_stateChanged( int ))); |
|
405 |
|
406 addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int ))); |
|
407 }*/ |
|
408 |
246 |
409 //////////////////////////////////////////////////// |
247 //////////////////////////////////////////////////// |
410 //general tones |
248 //general tones |
411 void CpProfileSettingForm::on_general_notificationTones_stateChanged(int state) |
249 void CpProfileSettingForm::on_general_notificationTones_stateChanged(int state) |
412 { |
250 { |
423 } |
261 } |
424 } |
262 } |
425 |
263 |
426 |
264 |
427 //general vibra |
265 //general vibra |
428 void CpProfileSettingForm::on_general_ringVibar_stateChanged( int state ) |
|
429 { |
|
430 mProfileModel->setRingAlertVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); |
|
431 } |
|
432 void CpProfileSettingForm::on_general_messageVibra_stateChanged( int state ) |
|
433 { |
|
434 mProfileModel->setMessageVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); |
|
435 } |
|
436 void CpProfileSettingForm::on_general_emailVibra_stateChanged( int state ) |
|
437 { |
|
438 mProfileModel->setEmailVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); |
|
439 } |
|
440 void CpProfileSettingForm::on_general_reminderVibra_stateChanged( int state ) |
|
441 { |
|
442 mProfileModel->setReminderVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); |
|
443 } |
|
444 void CpProfileSettingForm::on_general_notificationVibra_stateChanged( int state ) |
|
445 { |
|
446 mProfileModel->setNotificationVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); |
|
447 } |
|
448 void CpProfileSettingForm::on_general_screenVibra_ValueChanged( int value ) |
266 void CpProfileSettingForm::on_general_screenVibra_ValueChanged( int value ) |
449 { |
267 { |
450 mProfileModel->setKeyTouchScreenVibra( EProfileWrapperGeneralId, value ); |
268 mProfileModel->setKeyTouchScreenVibra( EProfileWrapperGeneralId, value ); |
451 |
269 |
452 HbDataFormModelItem *modelItem = profileItem(EProfileWrapperGeneralId,ProfileItemTouchScreenVibra); |
270 HbDataFormModelItem *modelItem = profileItem(EProfileWrapperGeneralId,ProfileItemTouchScreenVibra); |
472 modelItem->setContentWidgetData( QString("value"), value ); |
290 modelItem->setContentWidgetData( QString("value"), value ); |
473 setMuteIcon(modelItem, (value == 0) ); |
291 setMuteIcon(modelItem, (value == 0) ); |
474 } |
292 } |
475 } |
293 } |
476 |
294 |
477 |
|
478 //meeting vibra |
|
479 void CpProfileSettingForm::on_meeting_ringVibar_stateChanged( int state ) |
|
480 { |
|
481 mProfileModel->setRingAlertVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); |
|
482 } |
|
483 void CpProfileSettingForm::on_meeting_messageVibra_stateChanged( int state ) |
|
484 { |
|
485 mProfileModel->setMessageVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); |
|
486 } |
|
487 void CpProfileSettingForm::on_meeting_emailVibra_stateChanged( int state ) |
|
488 { |
|
489 mProfileModel->setEmailVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); |
|
490 } |
|
491 void CpProfileSettingForm::on_meeting_reminderVibra_stateChanged( int state ) |
|
492 { |
|
493 mProfileModel->setReminderVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); |
|
494 } |
|
495 void CpProfileSettingForm::on_meeting_notificationVibra_stateChanged( int state ) |
|
496 { |
|
497 mProfileModel->setNotificationVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); |
|
498 } |
|
499 void CpProfileSettingForm::on_meeting_screenVibra_ValueChanged( int value ) |
295 void CpProfileSettingForm::on_meeting_screenVibra_ValueChanged( int value ) |
500 { |
296 { |
501 mProfileModel->setKeyTouchScreenVibra( EProfileWrapperMeetingId, value ); |
297 mProfileModel->setKeyTouchScreenVibra( EProfileWrapperMeetingId, value ); |
502 |
298 |
503 HbDataFormModelItem *modelItem = profileItem(EProfileWrapperMeetingId,ProfileItemTouchScreenVibra); |
299 HbDataFormModelItem *modelItem = profileItem(EProfileWrapperMeetingId,ProfileItemTouchScreenVibra); |
570 } |
366 } |
571 |
367 |
572 QMap<QString, QVariant> elements = sliderItem->contentWidgetData("elementIcons").toMap(); |
368 QMap<QString, QVariant> elements = sliderItem->contentWidgetData("elementIcons").toMap(); |
573 |
369 |
574 if (isMute) { |
370 if (isMute) { |
575 elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg")); |
371 elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker_off")); |
576 } |
372 } |
577 else { |
373 else { |
578 elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg")); |
374 elements.insert(QString("IconElement"), QVariant("qtg_mono_speaker")); |
579 } |
375 } |
580 sliderItem->setContentWidgetData( QString( "elementIcons" ), elements ); |
376 sliderItem->setContentWidgetData( QString( "elementIcons" ), elements ); |
581 } |
377 } |
582 //End of File |
378 //End of File |