controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp
changeset 12 624337f114fe
parent 11 10d0dd0e43f1
child 14 23411a3be0db
child 19 36aa4756ee82
equal deleted inserted replaced
11:10d0dd0e43f1 12:624337f114fe
    14  * Description:  
    14  * Description:  
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include "cpprofilesettingform.h"
    18 #include "cpprofilesettingform.h"
       
    19 #include "cppersonalizationentryitemdata.h"
    19 #include <QStringList>
    20 #include <QStringList>
    20 #include <hbdataformmodel.h>
    21 #include <hbdataformmodel.h>
    21 #include "cppersonalizationcustomviewitem.h"
    22 #include <hbabstractviewitem.h>
       
    23 #include <cpitemdatahelper.h>
       
    24 #include <cpprofilemodel.h>
       
    25 
       
    26 #include <QFileInfo>
       
    27 #include <QFileIconProvider>
       
    28 #include <QAbstractItemModel>
       
    29 #include <QModelIndex>
       
    30 #include <QMap>
    22 
    31 
    23 CpProfileSettingForm::CpProfileSettingForm()
    32 CpProfileSettingForm::CpProfileSettingForm()
    24 : mModel(0)
    33     : mModel(0), mItemDataHelper(new CpItemDataHelper( this )),
    25 {
    34     mProfileModel(new CpProfileModel()), mFileIconProvider(new QFileIconProvider),
    26     this->setHeading(tr("Profiles"));
    35     mGeneralPage(0),mMeetingPage(0),mCurrentPage( 0 )
    27     this->setDescription(tr("With profiles you can quickly change audio settings of your device"));
    36 {
    28 
    37     this->setHeading(hbTrId("txt_cp_button_advanced_settings"));
    29     QList<HbAbstractViewItem *> protoTypeList = itemPrototypes();
    38     this->setDescription(hbTrId("txt_cp_info_select_tones_that_play_when_you_select"));
    30     protoTypeList.append(new CpPersonalizationCustomViewItem);
    39     
    31     setItemPrototypes(protoTypeList);
       
    32 
       
    33     initModel();
    40     initModel();
    34 }
    41 }
    35 
    42 
    36 CpProfileSettingForm::~CpProfileSettingForm()
    43 CpProfileSettingForm::~CpProfileSettingForm()
    37 {
    44 {
    38     delete mModel;
    45     delete mModel;
       
    46     delete mProfileModel;
       
    47     delete mFileIconProvider;
    39 }
    48 }
    40 
    49 
    41 void CpProfileSettingForm::initModel()
    50 void CpProfileSettingForm::initModel()
    42 {
    51 {
    43     mModel = new HbDataFormModel();
    52     mModel = new HbDataFormModel();
    44 
    53 
    45     QStringList profileList;
    54     QString generalString( mProfileModel->profileName( EProfileWrapperGeneralId ) );
    46     profileList << "General" << "Meeting" << "Silent"; //should be got from engine.
    55     if( generalString.isEmpty() ) {
    47     foreach (const QString &profile,profileList) {
    56         qDebug( "warning: general profile name is empty");
    48         HbDataFormModelItem *profilePage = mModel->appendDataFormPage(profile);
    57         generalString = hbTrId("txt_cp_list_general"); 
    49         //hard code: profile name should be got from profile engine
       
    50         if (profile != "Silent") {
       
    51         initVolumeGroup(profilePage);
       
    52         }
       
    53         initVibraGroup(profilePage);
       
    54         //initRingToneGroup(profilePage);
       
    55         //initMessageToneGroup(profilePage);
       
    56         //initAlertToneGroup(profilePage);
       
    57         //initKeyAndScreenToneGroup(profilePage);
       
    58     }
    58     }
       
    59     QString meetingString( mProfileModel->profileName( EProfileWrapperMeetingId ) );
       
    60     if( meetingString.isEmpty() ) {
       
    61         qDebug( "warning: meeting profile name is empty");
       
    62         meetingString = hbTrId("txt_cp_list_meeting"); 
       
    63     }
       
    64     
       
    65     mGeneralPage = mModel->appendDataFormPage( generalString );
       
    66     initGeneralTonesGroup();
       
    67     //initGeneralVibraGroup();
       
    68     
       
    69     mMeetingPage = mModel->appendDataFormPage( meetingString );
       
    70     initMeetingTonesGroup();
       
    71     //initMeetingVibraGroup();
       
    72 
    59     setModel(mModel);
    73     setModel(mModel);
    60 }
    74 }
    61 
    75 
    62 void CpProfileSettingForm::initVolumeGroup(HbDataFormModelItem *parent)
    76 void CpProfileSettingForm::initGeneralTonesGroup()
    63 {
    77 {
    64     HbDataFormModelItem *volumeGroup = mModel->appendDataFormGroup(
    78     CpProfileSettings profileSettings;
    65         tr("Volume"),parent);
    79     mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings );
    66    // mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),QString("Master volume"),volumeGroup);
    80     
    67     HbDataFormModelItem *informationTone = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),volumeGroup);
    81     /*HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup(
    68     informationTone->setContentWidgetData("text", tr("information tones"));
    82         hbTrId("txt_cp_subhead_tones"),mGeneralPage);*/
    69     mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),QString("Key and touch screen tones"),volumeGroup);
    83     QFileInfo ringToneFileInfo( profileSettings.mRingTone );
    70 }
    84     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
    71 void CpProfileSettingForm::initVibraGroup(HbDataFormModelItem *parent)
    85         hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mGeneralPage);
    72 {
    86     
       
    87     QFileInfo messageToneFileInfo( profileSettings.mMessageTone );
       
    88     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
    89         hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mGeneralPage);
       
    90     
       
    91     QFileInfo emailToneFileInfo( profileSettings.mEmailTone );
       
    92     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
    93         hbTrId("txt_cp_dblist_email_tone"),  emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mGeneralPage);
       
    94     
       
    95     QFileInfo reminderToneFileInfo( profileSettings.mReminderTone );
       
    96     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
    97         hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mGeneralPage);
       
    98     
       
    99     HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mGeneralPage);
       
   100     notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones"));
       
   101     notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 );
       
   102     
       
   103     mGeneralKeysAndScreenToneSlider = 
       
   104             mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mGeneralPage);
       
   105     /*
       
   106     QMap< QString, QVariant > elements;
       
   107     elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
       
   108     elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
       
   109     elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );
       
   110     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "elementIcons" ), elements );
       
   111      */
       
   112     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   113     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 );
       
   114     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 );
       
   115     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone );
       
   116     
       
   117     
       
   118     mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mGeneralPage );
       
   119      //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   120     mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
       
   121     mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
       
   122     mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
       
   123     
       
   124     addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationTones_stateChanged( int )));
       
   125     addConnection( mGeneralKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_general_keysAndScreenToneSlider_ValueChanged( int )));
       
   126     addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int )));    
       
   127 }
       
   128 
       
   129 /*void CpProfileSettingForm::initGeneralVibraGroup()
       
   130 {
       
   131     CpProfileSettings profileSettings;
       
   132     mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings );
       
   133         
    73     HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
   134     HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
    74         tr("Vibra"),parent);
   135         hbTrId( "txt_cp_subhead_vibra" ), mGeneralPage );
    75     HbDataFormModelItem *ringVibar = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
   136     HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
    76     ringVibar->setContentWidgetData("text", tr("Ring alert vibra"));
   137     ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) );
    77 
   138     ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 );    
    78     HbDataFormModelItem *messageVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
   139 
    79     messageVibra->setContentWidgetData("text", tr("New message alert vibra"));
   140     HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
    80 
   141     messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) );
    81     HbDataFormModelItem *emailVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
   142     messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 );
    82     emailVibra->setContentWidgetData("text", tr("New e-mail alert vibra"));
   143 
    83 
   144     HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
    84     HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
   145     emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) );
    85     reminderVibra->setContentWidgetData("text", tr("Reminder alarm vibra"));
   146     emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 );
    86 
   147 
    87     HbDataFormModelItem *clockVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
   148     HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
    88     clockVibra->setContentWidgetData("text", tr("Clock alarm vibra"));
   149     reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" ));
    89 
   150     reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 );
    90     HbDataFormModelItem *informationVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
   151     
    91     informationVibra->setContentWidgetData("text", tr("Information vibra"));
   152     HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
    92 
   153     notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) );
    93 }
   154     notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 );
    94 
   155     
    95 /*void CpProfileSettingForm::initRingToneGroup(HbDataFormModelItem *parent)
   156     mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup );
    96 {
   157     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
    97     HbDataFormModelItem *ringToneGroup = mModel->appendDataFormGroup(
   158     mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
    98         tr("Ring tone"),parent);
   159     mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
    99 
   160     mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
   100     QStringList tonesList;
   161     
   101     tonesList << "Off" << "Beep" << "Default ring tone" << "set profile-specific tone";
   162     addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_general_ringVibar_stateChanged( int )));
   102 
   163     addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_messageVibra_stateChanged( int )));
   103     foreach (const QString &tone,tonesList) {
   164     addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_emailVibra_stateChanged( int )));
   104         HbDataFormModelItem *toneGroup = mModel->appendDataFormGroupPage(tone,ringToneGroup);
   165     addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_reminderVibra_stateChanged( int )));
   105         mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("Say caller name"),toneGroup);
   166     addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationVibra_stateChanged( int )));
   106         HbDataFormModelItem *threeDEffect = mModel->appendDataFormItem(
   167     
   107             HbDataFormModelItem::ComboBoxItem,tr("3D effect"),toneGroup);
   168     addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int )));
       
   169 }*/
       
   170 
       
   171 ////////////////////////////////////////////////////////////
       
   172 void CpProfileSettingForm::initMeetingTonesGroup()
       
   173 {
       
   174     CpProfileSettings profileSettings;
       
   175     mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings );
       
   176     
       
   177    /* HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup(
       
   178         hbTrId("txt_cp_subhead_tones"),mMeetingPage);*/
       
   179     QFileInfo ringToneFileInfo( profileSettings.mRingTone );
       
   180     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   181         hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mMeetingPage);
       
   182     
       
   183     QFileInfo messageToneFileInfo( profileSettings.mMessageTone );
       
   184     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   185         hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mMeetingPage);
       
   186     
       
   187     QFileInfo emailToneFileInfo( profileSettings.mEmailTone );
       
   188     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   189         hbTrId("txt_cp_dblist_email_tone"),  emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mMeetingPage);
       
   190     
       
   191     QFileInfo reminderToneFileInfo( profileSettings.mReminderTone );
       
   192     mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
       
   193         hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mMeetingPage);
       
   194     
       
   195     HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mMeetingPage);
       
   196     notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones"));
       
   197     notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 );
       
   198     
       
   199     mMeetingKeysAndScreenToneSlider = 
       
   200             mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mMeetingPage);
       
   201     /*
       
   202     QMap< QString, QVariant > elements;
       
   203     elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
       
   204     elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
       
   205     elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );
       
   206     mMeetingkeysAndScreenSlider->setContentWidgetData( QString( "elementIcons" ), elements );
       
   207     */
       
   208     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   209     mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 );
       
   210     mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 );
       
   211     mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone );
       
   212     
       
   213     mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mMeetingPage );
       
   214     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   215     mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
       
   216     mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
       
   217     mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
       
   218     
       
   219     addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationTones_stateChanged( int )));
       
   220     addConnection( mMeetingKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_keysAndScreenSlider_ValueChanged( int )));
       
   221     addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int )));
       
   222 }
       
   223 
       
   224 /*void CpProfileSettingForm::initMeetingVibraGroup()
       
   225 {
       
   226     CpProfileSettings profileSettings;
       
   227     mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings );
   108         
   228         
   109         threeDEffect->setContentWidgetData("items",QStringList() 
   229     HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
   110             << tr("Off") << tr("Circular") << tr("Fly-by") << tr("Zigzag") 
   230         hbTrId( "txt_cp_subhead_vibra" ), mMeetingPage );
   111             << tr("Meander") << tr("Chaos") << tr("Stereo widening"));
   231     HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
   112         threeDEffect->setContentWidgetData("currentIndex",0);
   232     ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) );
   113 
   233     ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 );    
   114         HbDataFormModelItem *treeEcho = mModel->appendDataFormItem(
   234 
   115             HbDataFormModelItem::ComboBoxItem,tr("3D echo"),toneGroup);
   235     HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
   116         treeEcho->setContentWidgetData("items",QStringList()
   236     messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) );
   117             << tr("Off") << tr("Living room") << tr("Cave") << tr("Railway station")
   237     messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 );
   118             << tr("Forest") << tr("Duct") << tr("underwater"));
   238 
   119         treeEcho->setContentWidgetData("currentIndex",0);
   239     HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   240     emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) );
       
   241     emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 );
       
   242 
       
   243     HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   244     reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" ));
       
   245     reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 );
       
   246     
       
   247     HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
       
   248     notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) );
       
   249     notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 );
       
   250     
       
   251     mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup );
       
   252     //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
       
   253     mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
       
   254     mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
       
   255     mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
       
   256     
       
   257     addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_ringVibar_stateChanged( int )));
       
   258     addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_messageVibra_stateChanged( int )));
       
   259     addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_emailVibra_stateChanged( int )));
       
   260     addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_reminderVibra_stateChanged( int )));
       
   261     addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationVibra_stateChanged( int )));
       
   262         
       
   263     addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int )));
       
   264 }*/
       
   265 
       
   266 ////////////////////////////////////////////////////
       
   267 //general tones
       
   268 void CpProfileSettingForm::on_general_notificationTones_stateChanged(int state)
       
   269 {
       
   270     mProfileModel->setNotificationTone( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   271 }
       
   272 
       
   273 void CpProfileSettingForm::on_general_keysAndScreenToneSlider_ValueChanged( int value )
       
   274 {
       
   275     mProfileModel->setKeyTouchScreenTone( EProfileWrapperGeneralId, value );
       
   276     mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), value );
       
   277 }
       
   278 
       
   279 
       
   280 //general vibra
       
   281 void CpProfileSettingForm::on_general_ringVibar_stateChanged( int state )
       
   282 {
       
   283     mProfileModel->setRingAlertVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   284 }
       
   285 void CpProfileSettingForm::on_general_messageVibra_stateChanged( int state )
       
   286 {
       
   287     mProfileModel->setMessageVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   288 }
       
   289 void CpProfileSettingForm::on_general_emailVibra_stateChanged( int state )
       
   290 {
       
   291     mProfileModel->setEmailVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   292 }
       
   293 void CpProfileSettingForm::on_general_reminderVibra_stateChanged( int state )
       
   294 {
       
   295     mProfileModel->setReminderVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   296 }
       
   297 void CpProfileSettingForm::on_general_notificationVibra_stateChanged( int state )
       
   298 {
       
   299     mProfileModel->setNotificationVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
       
   300 }
       
   301 void CpProfileSettingForm::on_general_screenVibra_ValueChanged( int value )
       
   302 {
       
   303     mProfileModel->setKeyTouchScreenVibra( EProfileWrapperGeneralId, value );
       
   304     mGeneralSreenVibra->setContentWidgetData( QString("value"), value );
       
   305 
       
   306 }
       
   307 
       
   308 ////////////////////////////////////////////////////
       
   309 //meeting Tones
       
   310 void CpProfileSettingForm::on_meeting_notificationTones_stateChanged(int state)
       
   311 {
       
   312     mProfileModel->setNotificationTone( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   313 }
       
   314 
       
   315 void CpProfileSettingForm::on_meeting_keysAndScreenSlider_ValueChanged( int value )
       
   316 {
       
   317     mProfileModel->setKeyTouchScreenTone( EProfileWrapperMeetingId, value );
       
   318     mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), value );
       
   319 }
       
   320 
       
   321 
       
   322 //meeting vibra
       
   323 void CpProfileSettingForm::on_meeting_ringVibar_stateChanged( int state )
       
   324 {
       
   325     mProfileModel->setRingAlertVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   326 }
       
   327 void CpProfileSettingForm::on_meeting_messageVibra_stateChanged( int state )
       
   328 {
       
   329     mProfileModel->setMessageVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   330 }
       
   331 void CpProfileSettingForm::on_meeting_emailVibra_stateChanged( int state )
       
   332 {
       
   333     mProfileModel->setEmailVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   334 }
       
   335 void CpProfileSettingForm::on_meeting_reminderVibra_stateChanged( int state )
       
   336 {
       
   337     mProfileModel->setReminderVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   338 }
       
   339 void CpProfileSettingForm::on_meeting_notificationVibra_stateChanged( int state )
       
   340 {
       
   341     mProfileModel->setNotificationVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
       
   342 }
       
   343 void CpProfileSettingForm::on_meeting_screenVibra_ValueChanged( int value )
       
   344 {
       
   345     mProfileModel->setKeyTouchScreenVibra( EProfileWrapperMeetingId, value );
       
   346     mMeetingSreenVibra->setContentWidgetData( QString("value"), value );
       
   347 }
       
   348 
       
   349 bool CpProfileSettingForm::checkBoxStateToBool( int state )
       
   350 {
       
   351     if( state == Qt::Checked ) {
       
   352         return true;
       
   353     } else {
       
   354         return false;
   120     }
   355     }
   121 }
   356 }
   122 
       
   123 void CpProfileSettingForm::initMessageToneGroup(HbDataFormModelItem *parent)
       
   124 {
       
   125     HbDataFormModelItem *messageToneGroup = mModel->appendDataFormGroup(
       
   126         tr("Message tones"),parent);
       
   127 
       
   128     HbDataFormModelItem *messageTone = mModel->appendDataFormItem(
       
   129         HbDataFormModelItem::ComboBoxItem,tr("Message tone"),messageToneGroup);
       
   130 
       
   131     messageTone->setContentWidgetData("items",QStringList() 
       
   132         << tr("Off") << tr("Beep") << tr("Default mesage tone") << tr("set profile-specific tone"));
       
   133     messageTone->setContentWidgetData("currentIndex",2);
       
   134 
       
   135     HbDataFormModelItem *emailTone = mModel->appendDataFormItem(
       
   136         HbDataFormModelItem::ComboBoxItem,tr("E-mail tone"),messageToneGroup);
       
   137 
       
   138     emailTone->setContentWidgetData("items",QStringList() 
       
   139         << tr("Off") << tr("Beep") << tr("Default e-mail tone") << tr("set profile-specific tone"));
       
   140     emailTone->setContentWidgetData("currentIndex",2);
       
   141 
       
   142 }
       
   143 
       
   144 void CpProfileSettingForm::initAlertToneGroup(HbDataFormModelItem *parent)
       
   145 {
       
   146     HbDataFormModelItem *alertToneGroup = mModel->appendDataFormGroup(
       
   147         tr("Alert tones"),parent);
       
   148 
       
   149     HbDataFormModelItem *reminderTone = mModel->appendDataFormItem(
       
   150         HbDataFormModelItem::ComboBoxItem,tr("Reminder tone"),alertToneGroup);
       
   151 
       
   152     reminderTone->setContentWidgetData("items",QStringList() 
       
   153         << tr("Off") << tr("Beep") << tr("Default reminder tone") << tr("set profile-specific tone"));
       
   154     reminderTone->setContentWidgetData("currentIndex",2);
       
   155 
       
   156     HbDataFormModelItem *clockAlarmTone = mModel->appendDataFormItem(
       
   157         HbDataFormModelItem::ComboBoxItem,tr("Clock alarm tone"),alertToneGroup);
       
   158 
       
   159     clockAlarmTone->setContentWidgetData("items",QStringList() 
       
   160         << tr("Off") << tr("Beep") << tr("Default clock alarm tone") << tr("set profile-specific tone"));
       
   161     clockAlarmTone->setContentWidgetData("currentIndex",2);
       
   162 
       
   163 }
       
   164 
       
   165 void CpProfileSettingForm::initKeyAndScreenToneGroup(HbDataFormModelItem *parent)
       
   166 {
       
   167     HbDataFormModelItem *keyAndScreenToneGroup= mModel->appendDataFormGroup(
       
   168         tr("Key and screen tones"),parent);
       
   169     mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),
       
   170         tr("Key and touch screen tones"),keyAndScreenToneGroup);
       
   171     mModel->appendDataFormItem(HbDataFormModelItem::SliderItem,
       
   172         tr("Touch screen vibra"),keyAndScreenToneGroup);
       
   173 }
       
   174 */