controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp
changeset 33 0cfa53de576f
parent 26 808caa51b78b
child 41 ab0490982943
equal deleted inserted replaced
29:313976a11e23 33:0cfa53de576f
   213     
   213     
   214     mProfileModelItems.insert(profileId,modelItems);
   214     mProfileModelItems.insert(profileId,modelItems);
   215     
   215     
   216 }
   216 }
   217 
   217 
   218 /*
   218 
   219 void CpProfileSettingForm::initGeneralTonesGroup()
       
   220 {
       
   221     CpProfileSettings profileSettings;
       
   222     mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings );
       
   223     
       
   224     //HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup(
       
   225      //   hbTrId("txt_cp_subhead_tones"),mGeneralPage);
       
   226     QFileInfo ringToneFileInfo( profileSettings.mRingTone );
       
   227     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   228         hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mGeneralPage);
       
   229     
       
   230     QFileInfo messageToneFileInfo( profileSettings.mMessageTone );
       
   231     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   232         hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mGeneralPage);
       
   233     
       
   234     QFileInfo emailToneFileInfo( profileSettings.mEmailTone );
       
   235     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   236         hbTrId("txt_cp_dblist_email_tone"),  emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mGeneralPage);
       
   237     
       
   238     QFileInfo reminderToneFileInfo( profileSettings.mReminderTone );
       
   239     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   240         hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mGeneralPage);
       
   241     
       
   242     HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mGeneralPage);
       
   243     notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones"));
       
   244     notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 );
       
   245     
       
   246     mGeneralKeysAndScreenToneSlider = 
       
   247             mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mGeneralPage);
       
   248     
       
   249     //QMap< QString, QVariant > elements;
       
   250     //elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
       
   251     //elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
       
   252     //elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );
       
   253     //mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "elementIcons" ), elements );
       
   254      
       
   255     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   256     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 );
       
   257     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 );
       
   258     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone );
       
   259     
       
   260     
       
   261     mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mGeneralPage );
       
   262      //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   263     mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
       
   264     mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
       
   265     mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
       
   266     
       
   267     addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationTones_stateChanged( int )));
       
   268     addConnection( mGeneralKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_general_keysAndScreenToneSlider_ValueChanged( int )));
       
   269     addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int )));    
       
   270 }
       
   271 */
       
   272 
       
   273 /*void CpProfileSettingForm::initGeneralVibraGroup()
       
   274 {
       
   275     CpProfileSettings profileSettings;
       
   276     mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings );
       
   277         
       
   278     HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
       
   279         hbTrId( "txt_cp_subhead_vibra" ), mGeneralPage );
       
   280     HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   281     ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) );
       
   282     ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 );    
       
   283 
       
   284     HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   285     messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) );
       
   286     messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 );
       
   287 
       
   288     HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   289     emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) );
       
   290     emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 );
       
   291 
       
   292     HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   293     reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" ));
       
   294     reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 );
       
   295     
       
   296     HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   297     notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) );
       
   298     notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 );
       
   299     
       
   300     mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup );
       
   301     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   302     mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
       
   303     mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
       
   304     mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
       
   305     
       
   306     addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_general_ringVibar_stateChanged( int )));
       
   307     addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_messageVibra_stateChanged( int )));
       
   308     addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_emailVibra_stateChanged( int )));
       
   309     addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_reminderVibra_stateChanged( int )));
       
   310     addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationVibra_stateChanged( int )));
       
   311     
       
   312     addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int )));
       
   313 }*/
       
   314 
       
   315 ////////////////////////////////////////////////////////////
       
   316 /*void CpProfileSettingForm::initMeetingTonesGroup()
       
   317 {
       
   318     CpProfileSettings profileSettings;
       
   319     mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings );
       
   320     
       
   321    //HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup(
       
   322    //     hbTrId("txt_cp_subhead_tones"),mMeetingPage);
       
   323     QFileInfo ringToneFileInfo( profileSettings.mRingTone );
       
   324     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   325         hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mMeetingPage);
       
   326     
       
   327     QFileInfo messageToneFileInfo( profileSettings.mMessageTone );
       
   328     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   329         hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mMeetingPage);
       
   330     
       
   331     QFileInfo emailToneFileInfo( profileSettings.mEmailTone );
       
   332     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   333         hbTrId("txt_cp_dblist_email_tone"),  emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mMeetingPage);
       
   334     
       
   335     QFileInfo reminderToneFileInfo( profileSettings.mReminderTone );
       
   336     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   337         hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mMeetingPage);
       
   338     
       
   339     HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mMeetingPage);
       
   340     notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones"));
       
   341     notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 );
       
   342     
       
   343     mMeetingKeysAndScreenToneSlider = 
       
   344             mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mMeetingPage);
       
   345     
       
   346     //QMap< QString, QVariant > elements;
       
   347     //elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
       
   348     //elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
       
   349     //elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );
       
   350     //mMeetingkeysAndScreenSlider->setContentWidgetData( QString( "elementIcons" ), elements );
       
   351     
       
   352     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   353     mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 );
       
   354     mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 );
       
   355     mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone );
       
   356     
       
   357     mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mMeetingPage );
       
   358     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   359     mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
       
   360     mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
       
   361     mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
       
   362     
       
   363     addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationTones_stateChanged( int )));
       
   364     addConnection( mMeetingKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_keysAndScreenSlider_ValueChanged( int )));
       
   365     addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int )));
       
   366 }
       
   367 */
       
   368 /*void CpProfileSettingForm::initMeetingVibraGroup()
       
   369 {
       
   370     CpProfileSettings profileSettings;
       
   371     mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings );
       
   372         
       
   373     HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
       
   374         hbTrId( "txt_cp_subhead_vibra" ), mMeetingPage );
       
   375     HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   376     ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) );
       
   377     ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 );    
       
   378 
       
   379     HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   380     messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) );
       
   381     messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 );
       
   382 
       
   383     HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   384     emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) );
       
   385     emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 );
       
   386 
       
   387     HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   388     reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" ));
       
   389     reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 );
       
   390     
       
   391     HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   392     notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) );
       
   393     notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 );
       
   394     
       
   395     mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup );
       
   396     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   397     mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
       
   398     mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
       
   399     mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
       
   400     
       
   401     addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_ringVibar_stateChanged( int )));
       
   402     addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_messageVibra_stateChanged( int )));
       
   403     addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_emailVibra_stateChanged( int )));
       
   404     addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_reminderVibra_stateChanged( int )));
       
   405     addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationVibra_stateChanged( int )));
       
   406         
       
   407     addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int )));
       
   408 }*/
       
   409 
   219 
   410 ////////////////////////////////////////////////////
   220 ////////////////////////////////////////////////////
   411 //general tones
   221 //general tones
   412 void CpProfileSettingForm::on_general_notificationTones_stateChanged(int state)
   222 void CpProfileSettingForm::on_general_notificationTones_stateChanged(int state)
   413 {
   223 {
   424     }
   234     }
   425 }
   235 }
   426 
   236 
   427 
   237 
   428 //general vibra
   238 //general vibra
   429 void CpProfileSettingForm::on_general_ringVibar_stateChanged( int state )
       
   430 {
       
   431     mProfileModel->setRingAlertVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   432 }
       
   433 void CpProfileSettingForm::on_general_messageVibra_stateChanged( int state )
       
   434 {
       
   435     mProfileModel->setMessageVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   436 }
       
   437 void CpProfileSettingForm::on_general_emailVibra_stateChanged( int state )
       
   438 {
       
   439     mProfileModel->setEmailVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   440 }
       
   441 void CpProfileSettingForm::on_general_reminderVibra_stateChanged( int state )
       
   442 {
       
   443     mProfileModel->setReminderVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   444 }
       
   445 void CpProfileSettingForm::on_general_notificationVibra_stateChanged( int state )
       
   446 {
       
   447     mProfileModel->setNotificationVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   448 }
       
   449 void CpProfileSettingForm::on_general_screenVibra_ValueChanged( int value )
   239 void CpProfileSettingForm::on_general_screenVibra_ValueChanged( int value )
   450 {
   240 {
   451     mProfileModel->setKeyTouchScreenVibra( EProfileWrapperGeneralId, value );
   241     mProfileModel->setKeyTouchScreenVibra( EProfileWrapperGeneralId, value );
   452     
   242     
   453     HbDataFormModelItem *modelItem = profileItem(EProfileWrapperGeneralId,ProfileItemTouchScreenVibra);
   243     HbDataFormModelItem *modelItem = profileItem(EProfileWrapperGeneralId,ProfileItemTouchScreenVibra);
   473         modelItem->setContentWidgetData( QString("value"), value );
   263         modelItem->setContentWidgetData( QString("value"), value );
   474         setMuteIcon(modelItem, (value == 0) );            
   264         setMuteIcon(modelItem, (value == 0) );            
   475     }
   265     }
   476 }
   266 }
   477 
   267 
   478 
       
   479 //meeting vibra
       
   480 void CpProfileSettingForm::on_meeting_ringVibar_stateChanged( int state )
       
   481 {
       
   482     mProfileModel->setRingAlertVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   483 }
       
   484 void CpProfileSettingForm::on_meeting_messageVibra_stateChanged( int state )
       
   485 {
       
   486     mProfileModel->setMessageVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   487 }
       
   488 void CpProfileSettingForm::on_meeting_emailVibra_stateChanged( int state )
       
   489 {
       
   490     mProfileModel->setEmailVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   491 }
       
   492 void CpProfileSettingForm::on_meeting_reminderVibra_stateChanged( int state )
       
   493 {
       
   494     mProfileModel->setReminderVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   495 }
       
   496 void CpProfileSettingForm::on_meeting_notificationVibra_stateChanged( int state )
       
   497 {
       
   498     mProfileModel->setNotificationVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   499 }
       
   500 void CpProfileSettingForm::on_meeting_screenVibra_ValueChanged( int value )
   268 void CpProfileSettingForm::on_meeting_screenVibra_ValueChanged( int value )
   501 {
   269 {
   502     mProfileModel->setKeyTouchScreenVibra( EProfileWrapperMeetingId, value );
   270     mProfileModel->setKeyTouchScreenVibra( EProfileWrapperMeetingId, value );
   503     
   271     
   504     HbDataFormModelItem *modelItem = profileItem(EProfileWrapperMeetingId,ProfileItemTouchScreenVibra);
   272     HbDataFormModelItem *modelItem = profileItem(EProfileWrapperMeetingId,ProfileItemTouchScreenVibra);