--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Fri Apr 16 14:59:22 2010 +0300
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Mon May 03 12:32:06 2010 +0300
@@ -16,159 +16,341 @@
*/
#include "cpprofilesettingform.h"
+#include "cppersonalizationentryitemdata.h"
#include <QStringList>
#include <hbdataformmodel.h>
-#include "cppersonalizationcustomviewitem.h"
+#include <hbabstractviewitem.h>
+#include <cpitemdatahelper.h>
+#include <cpprofilemodel.h>
+
+#include <QFileInfo>
+#include <QFileIconProvider>
+#include <QAbstractItemModel>
+#include <QModelIndex>
+#include <QMap>
CpProfileSettingForm::CpProfileSettingForm()
-: mModel(0)
+ : mModel(0), mItemDataHelper(new CpItemDataHelper( this )),
+ mProfileModel(new CpProfileModel()), mFileIconProvider(new QFileIconProvider),
+ mGeneralPage(0),mMeetingPage(0),mCurrentPage( 0 )
{
- this->setHeading(tr("Profiles"));
- this->setDescription(tr("With profiles you can quickly change audio settings of your device"));
-
- QList<HbAbstractViewItem *> protoTypeList = itemPrototypes();
- protoTypeList.append(new CpPersonalizationCustomViewItem);
- setItemPrototypes(protoTypeList);
-
+ this->setHeading(hbTrId("txt_cp_button_advanced_settings"));
+ this->setDescription(hbTrId("txt_cp_info_select_tones_that_play_when_you_select"));
+
initModel();
}
CpProfileSettingForm::~CpProfileSettingForm()
{
delete mModel;
+ delete mProfileModel;
+ delete mFileIconProvider;
}
void CpProfileSettingForm::initModel()
{
mModel = new HbDataFormModel();
- QStringList profileList;
- profileList << "General" << "Meeting" << "Silent"; //should be got from engine.
- foreach (const QString &profile,profileList) {
- HbDataFormModelItem *profilePage = mModel->appendDataFormPage(profile);
- //hard code: profile name should be got from profile engine
- if (profile != "Silent") {
- initVolumeGroup(profilePage);
- }
- initVibraGroup(profilePage);
- //initRingToneGroup(profilePage);
- //initMessageToneGroup(profilePage);
- //initAlertToneGroup(profilePage);
- //initKeyAndScreenToneGroup(profilePage);
+ QString generalString( mProfileModel->profileName( EProfileWrapperGeneralId ) );
+ if( generalString.isEmpty() ) {
+ qDebug( "warning: general profile name is empty");
+ generalString = hbTrId("txt_cp_list_general");
+ }
+ QString meetingString( mProfileModel->profileName( EProfileWrapperMeetingId ) );
+ if( meetingString.isEmpty() ) {
+ qDebug( "warning: meeting profile name is empty");
+ meetingString = hbTrId("txt_cp_list_meeting");
}
+
+ mGeneralPage = mModel->appendDataFormPage( generalString );
+ initGeneralTonesGroup();
+ //initGeneralVibraGroup();
+
+ mMeetingPage = mModel->appendDataFormPage( meetingString );
+ initMeetingTonesGroup();
+ //initMeetingVibraGroup();
+
setModel(mModel);
}
-void CpProfileSettingForm::initVolumeGroup(HbDataFormModelItem *parent)
+void CpProfileSettingForm::initGeneralTonesGroup()
{
- HbDataFormModelItem *volumeGroup = mModel->appendDataFormGroup(
- tr("Volume"),parent);
- // mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),QString("Master volume"),volumeGroup);
- HbDataFormModelItem *informationTone = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),volumeGroup);
- informationTone->setContentWidgetData("text", tr("information tones"));
- mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),QString("Key and touch screen tones"),volumeGroup);
+ CpProfileSettings profileSettings;
+ mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings );
+
+ /*HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup(
+ hbTrId("txt_cp_subhead_tones"),mGeneralPage);*/
+ QFileInfo ringToneFileInfo( profileSettings.mRingTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mGeneralPage);
+
+ QFileInfo messageToneFileInfo( profileSettings.mMessageTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mGeneralPage);
+
+ QFileInfo emailToneFileInfo( profileSettings.mEmailTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_email_tone"), emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mGeneralPage);
+
+ QFileInfo reminderToneFileInfo( profileSettings.mReminderTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mGeneralPage);
+
+ HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mGeneralPage);
+ notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones"));
+ notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 );
+
+ mGeneralKeysAndScreenToneSlider =
+ mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mGeneralPage);
+ /*
+ QMap< QString, QVariant > elements;
+ elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
+ elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
+ elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );
+ mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "elementIcons" ), elements );
+ */
+ //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
+ mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 );
+ mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 );
+ mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone );
+
+
+ mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mGeneralPage );
+ //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
+ mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
+ mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
+ mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
+
+ addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationTones_stateChanged( int )));
+ addConnection( mGeneralKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_general_keysAndScreenToneSlider_ValueChanged( int )));
+ addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int )));
}
-void CpProfileSettingForm::initVibraGroup(HbDataFormModelItem *parent)
+
+/*void CpProfileSettingForm::initGeneralVibraGroup()
{
+ CpProfileSettings profileSettings;
+ mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings );
+
HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
- tr("Vibra"),parent);
- HbDataFormModelItem *ringVibar = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
- ringVibar->setContentWidgetData("text", tr("Ring alert vibra"));
+ hbTrId( "txt_cp_subhead_vibra" ), mGeneralPage );
+ HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) );
+ ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 );
+
+ HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) );
+ messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 );
+
+ HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) );
+ emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 );
- HbDataFormModelItem *messageVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
- messageVibra->setContentWidgetData("text", tr("New message alert vibra"));
+ HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" ));
+ reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 );
+
+ HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) );
+ notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 );
+
+ mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup );
+ //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
+ mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
+ mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
+ mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
+
+ addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_general_ringVibar_stateChanged( int )));
+ addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_messageVibra_stateChanged( int )));
+ addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_emailVibra_stateChanged( int )));
+ addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_reminderVibra_stateChanged( int )));
+ addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationVibra_stateChanged( int )));
+
+ addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int )));
+}*/
- HbDataFormModelItem *emailVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
- emailVibra->setContentWidgetData("text", tr("New e-mail alert vibra"));
+////////////////////////////////////////////////////////////
+void CpProfileSettingForm::initMeetingTonesGroup()
+{
+ CpProfileSettings profileSettings;
+ mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings );
+
+ /* HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup(
+ hbTrId("txt_cp_subhead_tones"),mMeetingPage);*/
+ QFileInfo ringToneFileInfo( profileSettings.mRingTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mMeetingPage);
+
+ QFileInfo messageToneFileInfo( profileSettings.mMessageTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mMeetingPage);
+
+ QFileInfo emailToneFileInfo( profileSettings.mEmailTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_email_tone"), emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mMeetingPage);
+
+ QFileInfo reminderToneFileInfo( profileSettings.mReminderTone );
+ mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper,
+ hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mMeetingPage);
+
+ HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mMeetingPage);
+ notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones"));
+ notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 );
+
+ mMeetingKeysAndScreenToneSlider =
+ mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mMeetingPage);
+ /*
+ QMap< QString, QVariant > elements;
+ elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
+ elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
+ elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );
+ mMeetingkeysAndScreenSlider->setContentWidgetData( QString( "elementIcons" ), elements );
+ */
+ //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
+ mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 );
+ mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 );
+ mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone );
+
+ mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mMeetingPage );
+ //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
+ mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
+ mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
+ mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
+
+ addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationTones_stateChanged( int )));
+ addConnection( mMeetingKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_keysAndScreenSlider_ValueChanged( int )));
+ addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int )));
+}
- HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
- reminderVibra->setContentWidgetData("text", tr("Reminder alarm vibra"));
+/*void CpProfileSettingForm::initMeetingVibraGroup()
+{
+ CpProfileSettings profileSettings;
+ mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings );
+
+ HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
+ hbTrId( "txt_cp_subhead_vibra" ), mMeetingPage );
+ HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) );
+ ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 );
- HbDataFormModelItem *clockVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
- clockVibra->setContentWidgetData("text", tr("Clock alarm vibra"));
+ HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) );
+ messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 );
+
+ HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) );
+ emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 );
+
+ HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" ));
+ reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 );
+
+ HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup );
+ notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) );
+ notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 );
+
+ mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup );
+ //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
+ mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 );
+ mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 );
+ mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
+
+ addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_ringVibar_stateChanged( int )));
+ addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_messageVibra_stateChanged( int )));
+ addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_emailVibra_stateChanged( int )));
+ addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_reminderVibra_stateChanged( int )));
+ addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationVibra_stateChanged( int )));
+
+ addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int )));
+}*/
- HbDataFormModelItem *informationVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
- informationVibra->setContentWidgetData("text", tr("Information vibra"));
+////////////////////////////////////////////////////
+//general tones
+void CpProfileSettingForm::on_general_notificationTones_stateChanged(int state)
+{
+ mProfileModel->setNotificationTone( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
+}
+
+void CpProfileSettingForm::on_general_keysAndScreenToneSlider_ValueChanged( int value )
+{
+ mProfileModel->setKeyTouchScreenTone( EProfileWrapperGeneralId, value );
+ mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), value );
+}
+
+
+//general vibra
+void CpProfileSettingForm::on_general_ringVibar_stateChanged( int state )
+{
+ mProfileModel->setRingAlertVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_general_messageVibra_stateChanged( int state )
+{
+ mProfileModel->setMessageVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_general_emailVibra_stateChanged( int state )
+{
+ mProfileModel->setEmailVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_general_reminderVibra_stateChanged( int state )
+{
+ mProfileModel->setReminderVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_general_notificationVibra_stateChanged( int state )
+{
+ mProfileModel->setNotificationVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_general_screenVibra_ValueChanged( int value )
+{
+ mProfileModel->setKeyTouchScreenVibra( EProfileWrapperGeneralId, value );
+ mGeneralSreenVibra->setContentWidgetData( QString("value"), value );
}
-/*void CpProfileSettingForm::initRingToneGroup(HbDataFormModelItem *parent)
+////////////////////////////////////////////////////
+//meeting Tones
+void CpProfileSettingForm::on_meeting_notificationTones_stateChanged(int state)
{
- HbDataFormModelItem *ringToneGroup = mModel->appendDataFormGroup(
- tr("Ring tone"),parent);
-
- QStringList tonesList;
- tonesList << "Off" << "Beep" << "Default ring tone" << "set profile-specific tone";
+ mProfileModel->setNotificationTone( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
+}
- foreach (const QString &tone,tonesList) {
- HbDataFormModelItem *toneGroup = mModel->appendDataFormGroupPage(tone,ringToneGroup);
- mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("Say caller name"),toneGroup);
- HbDataFormModelItem *threeDEffect = mModel->appendDataFormItem(
- HbDataFormModelItem::ComboBoxItem,tr("3D effect"),toneGroup);
-
- threeDEffect->setContentWidgetData("items",QStringList()
- << tr("Off") << tr("Circular") << tr("Fly-by") << tr("Zigzag")
- << tr("Meander") << tr("Chaos") << tr("Stereo widening"));
- threeDEffect->setContentWidgetData("currentIndex",0);
-
- HbDataFormModelItem *treeEcho = mModel->appendDataFormItem(
- HbDataFormModelItem::ComboBoxItem,tr("3D echo"),toneGroup);
- treeEcho->setContentWidgetData("items",QStringList()
- << tr("Off") << tr("Living room") << tr("Cave") << tr("Railway station")
- << tr("Forest") << tr("Duct") << tr("underwater"));
- treeEcho->setContentWidgetData("currentIndex",0);
- }
+void CpProfileSettingForm::on_meeting_keysAndScreenSlider_ValueChanged( int value )
+{
+ mProfileModel->setKeyTouchScreenTone( EProfileWrapperMeetingId, value );
+ mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), value );
}
-void CpProfileSettingForm::initMessageToneGroup(HbDataFormModelItem *parent)
+
+//meeting vibra
+void CpProfileSettingForm::on_meeting_ringVibar_stateChanged( int state )
+{
+ mProfileModel->setRingAlertVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_meeting_messageVibra_stateChanged( int state )
+{
+ mProfileModel->setMessageVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_meeting_emailVibra_stateChanged( int state )
{
- HbDataFormModelItem *messageToneGroup = mModel->appendDataFormGroup(
- tr("Message tones"),parent);
-
- HbDataFormModelItem *messageTone = mModel->appendDataFormItem(
- HbDataFormModelItem::ComboBoxItem,tr("Message tone"),messageToneGroup);
-
- messageTone->setContentWidgetData("items",QStringList()
- << tr("Off") << tr("Beep") << tr("Default mesage tone") << tr("set profile-specific tone"));
- messageTone->setContentWidgetData("currentIndex",2);
-
- HbDataFormModelItem *emailTone = mModel->appendDataFormItem(
- HbDataFormModelItem::ComboBoxItem,tr("E-mail tone"),messageToneGroup);
-
- emailTone->setContentWidgetData("items",QStringList()
- << tr("Off") << tr("Beep") << tr("Default e-mail tone") << tr("set profile-specific tone"));
- emailTone->setContentWidgetData("currentIndex",2);
-
+ mProfileModel->setEmailVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_meeting_reminderVibra_stateChanged( int state )
+{
+ mProfileModel->setReminderVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_meeting_notificationVibra_stateChanged( int state )
+{
+ mProfileModel->setNotificationVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) );
+}
+void CpProfileSettingForm::on_meeting_screenVibra_ValueChanged( int value )
+{
+ mProfileModel->setKeyTouchScreenVibra( EProfileWrapperMeetingId, value );
+ mMeetingSreenVibra->setContentWidgetData( QString("value"), value );
}
-void CpProfileSettingForm::initAlertToneGroup(HbDataFormModelItem *parent)
+bool CpProfileSettingForm::checkBoxStateToBool( int state )
{
- HbDataFormModelItem *alertToneGroup = mModel->appendDataFormGroup(
- tr("Alert tones"),parent);
-
- HbDataFormModelItem *reminderTone = mModel->appendDataFormItem(
- HbDataFormModelItem::ComboBoxItem,tr("Reminder tone"),alertToneGroup);
-
- reminderTone->setContentWidgetData("items",QStringList()
- << tr("Off") << tr("Beep") << tr("Default reminder tone") << tr("set profile-specific tone"));
- reminderTone->setContentWidgetData("currentIndex",2);
-
- HbDataFormModelItem *clockAlarmTone = mModel->appendDataFormItem(
- HbDataFormModelItem::ComboBoxItem,tr("Clock alarm tone"),alertToneGroup);
-
- clockAlarmTone->setContentWidgetData("items",QStringList()
- << tr("Off") << tr("Beep") << tr("Default clock alarm tone") << tr("set profile-specific tone"));
- clockAlarmTone->setContentWidgetData("currentIndex",2);
-
+ if( state == Qt::Checked ) {
+ return true;
+ } else {
+ return false;
+ }
}
-
-void CpProfileSettingForm::initKeyAndScreenToneGroup(HbDataFormModelItem *parent)
-{
- HbDataFormModelItem *keyAndScreenToneGroup= mModel->appendDataFormGroup(
- tr("Key and screen tones"),parent);
- mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),
- tr("Key and touch screen tones"),keyAndScreenToneGroup);
- mModel->appendDataFormItem(HbDataFormModelItem::SliderItem,
- tr("Touch screen vibra"),keyAndScreenToneGroup);
-}
-*/