354 mDialog->setTimeout(HbPopup::NoTimeout); |
354 mDialog->setTimeout(HbPopup::NoTimeout); |
355 mDialog->setAttribute(Qt::WA_DeleteOnClose); |
355 mDialog->setAttribute(Qt::WA_DeleteOnClose); |
356 mDialog->setDismissPolicy(HbPopup::NoDismiss); |
356 mDialog->setDismissPolicy(HbPopup::NoDismiss); |
357 mDialog->setModal(true); |
357 mDialog->setModal(true); |
358 mDialog->setContentWidget(mRadioButtonList); |
358 mDialog->setContentWidget(mRadioButtonList); |
359 HbAction *ok = new HbAction(hbTrId("txt_common_button_ok")); |
359 HbAction *ok = new HbAction(hbTrId("txt_common_button_ok"), mDialog); |
360 mDialog->addAction(ok); |
360 mDialog->addAction(ok); |
361 HbAction *cancel = new HbAction(hbTrId("txt_common_button_cancel")); |
361 HbAction *cancel = new HbAction(hbTrId("txt_common_button_cancel"), mDialog); |
362 connect(ok, SIGNAL(triggered()), mDialog,SLOT(accept())); |
362 connect(ok, SIGNAL(triggered()), mDialog,SLOT(accept())); |
363 mDialog->addAction(cancel); |
363 mDialog->addAction(cancel); |
364 mDialog->connect(cancel, SIGNAL(triggered()), mDialog, SLOT(reject())); |
364 mDialog->connect(cancel, SIGNAL(triggered()), mDialog, SLOT(reject())); |
365 mRadioButtonList->setSelected(mSelected); |
365 mRadioButtonList->setSelected(mSelected); |
366 mDialog->open(this,SLOT(dialogClosed(int))); |
366 mDialog->open(this,SLOT(dialogClosed(int))); |
369 |
369 |
370 |
370 |
371 void HbRadioItem::updateModel( int index ) |
371 void HbRadioItem::updateModel( int index ) |
372 { |
372 { |
373 mSelected = index; |
373 mSelected = index; |
374 if( index > -1 && mItems.count() < index ) { |
374 if( index > -1 && mItems.count() > index ) { |
375 emit valueChanged(mViewItem->modelIndex(), mItems.at(index)); |
375 emit valueChanged(mViewItem->modelIndex(), mItems.at(index)); |
376 } |
376 } |
377 // Disconnect modelchanged signal since visualization is already updated by user |
377 // Disconnect modelchanged signal since visualization is already updated by user |
378 // so if not disconnected , this will trigger visualization change again |
378 // so if not disconnected , this will trigger visualization change again |
379 disconnect( mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), |
379 disconnect( mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), |
895 } |
900 } |
896 |
901 |
897 void HbDataFormViewItemPrivate::setEnabled(bool enabled) |
902 void HbDataFormViewItemPrivate::setEnabled(bool enabled) |
898 { |
903 { |
899 Q_Q(HbDataFormViewItem); |
904 Q_Q(HbDataFormViewItem); |
900 |
905 Q_UNUSED(enabled); |
901 QGraphicsItem::GraphicsItemFlags itemFlags = q->flags(); |
906 QGraphicsItem::GraphicsItemFlags itemFlags = q->flags(); |
902 Qt::ItemFlags indexFlags = mIndex.flags(); |
907 Qt::ItemFlags indexFlags = mIndex.flags(); |
903 |
908 |
904 if (indexFlags & Qt::ItemIsEnabled) { |
909 if (indexFlags & Qt::ItemIsEnabled) { |
905 if (!(itemFlags & QGraphicsItem::ItemIsFocusable)) { |
910 if (!(itemFlags & QGraphicsItem::ItemIsFocusable)) { |
918 q->ungrabGesture(Qt::TapGesture); |
923 q->ungrabGesture(Qt::TapGesture); |
919 } |
924 } |
920 } |
925 } |
921 |
926 |
922 if( mContentWidget ) { |
927 if( mContentWidget ) { |
923 mContentWidget->setEnabled(enabled); |
928 //mContentWidget->setEnabled(enabled); |
924 //If slider is disabled then still panning should be possible. |
929 //If slider is disabled then still panning should be possible. |
925 if( ( mType == HbDataFormModelItem::SliderItem ) || |
930 if( ( mType == HbDataFormModelItem::SliderItem ) || |
926 ( mType == HbDataFormModelItem::VolumeSliderItem ) ) { |
931 ( mType == HbDataFormModelItem::VolumeSliderItem ) ) { |
927 HbSlider *slider = static_cast<HbSlider*>( mContentWidget ); |
932 HbSlider *slider = static_cast<HbSlider*>( mContentWidget ); |
928 if( enabled ) { |
933 if( slider && slider->isEnabled() ) { |
929 //grab pan gesture |
934 //grab pan gesture |
930 slider->primitive((HbStyle::Primitive)HbStylePrivate::P_SliderElement_touchgroove)->toGraphicsObject()->grabGesture( |
935 slider->primitive((HbStyle::Primitive)HbStylePrivate::P_SliderElement_touchgroove)->toGraphicsObject()->grabGesture( |
931 Qt::PanGesture); |
936 Qt::PanGesture); |
932 } else { |
937 } else { |
933 //ungrab pan gesture |
938 //ungrab pan gesture |