18 |
18 |
19 #include <hbradiobuttonlist.h> |
19 #include <hbradiobuttonlist.h> |
20 #include <hbaction.h> |
20 #include <hbaction.h> |
21 #include <hbdataformmodelitem.h> |
21 #include <hbdataformmodelitem.h> |
22 #include <hbpopup.h> |
22 #include <hbpopup.h> |
|
23 #include <hblabel.h> |
23 #include "cpprofileactivatorentryitem.h" |
24 #include "cpprofileactivatorentryitem.h" |
|
25 #include <QGraphicsLinearLayout> |
|
26 #include <QGraphicsWidget> |
|
27 |
24 CpProfileActivatorDialog::CpProfileActivatorDialog(CpSettingFormItemData *profileActivator, |
28 CpProfileActivatorDialog::CpProfileActivatorDialog(CpSettingFormItemData *profileActivator, |
25 CpProfileModel &profileModel, |
29 CpProfileModel &profileModel, |
26 QGraphicsItem *parent):HbDialog(parent), |
30 QGraphicsItem *parent):HbDialog(parent), |
27 mProfileModel(profileModel), |
31 mProfileModel(profileModel), |
28 mProfileList(0), |
32 mProfileList(0), |
29 mProfileActivator(profileActivator) |
33 mProfileActivator(profileActivator) |
30 { |
34 { |
|
35 mTitleLabel = new HbLabel(this); |
|
36 mTitleLabel->setPlainText(hbTrId("txt_cp_title_profile")); |
|
37 mContentWidget = new QGraphicsWidget(this); |
|
38 setContentWidget(mContentWidget); |
|
39 mLayout = new QGraphicsLinearLayout(); |
|
40 mLayout->setOrientation( Qt::Vertical ); |
31 mProfileIds << EProfileWrapperGeneralId |
41 mProfileIds << EProfileWrapperGeneralId |
32 << EProfileWrapperMeetingId; |
42 << EProfileWrapperMeetingId; |
33 mProfileList = new HbRadioButtonList(); |
43 mProfileList = new HbRadioButtonList(); |
34 mProfileList->setItems(profileModel.profileNames()); |
44 mProfileList->setItems(profileModel.profileNames()); |
35 |
45 mLayout->addItem(mTitleLabel); |
|
46 mLayout->addItem(mProfileList); |
|
47 |
36 int currentId = mProfileModel.activeProfileId(); |
48 int currentId = mProfileModel.activeProfileId(); |
37 mProfileList->setSelected(mProfileIds.indexOf(static_cast<ProfileWrapperProfileId>(currentId))); |
49 mProfileList->setSelected(mProfileIds.indexOf(static_cast<ProfileWrapperProfileId>(currentId))); |
38 |
50 |
39 |
51 |
40 |
52 |
44 connect(mConfirmProfile, SIGNAL(triggered(bool)), this, SLOT(confirmProfileSelection())); |
56 connect(mConfirmProfile, SIGNAL(triggered(bool)), this, SLOT(confirmProfileSelection())); |
45 connect(mCancelProfile, SIGNAL(triggered(bool)), this, SLOT(cancelProfileSelection())); |
57 connect(mCancelProfile, SIGNAL(triggered(bool)), this, SLOT(cancelProfileSelection())); |
46 |
58 |
47 |
59 |
48 this->addAction(mConfirmProfile); |
60 this->addAction(mConfirmProfile); |
49 this->addAction(mCancelProfile); |
61 this->addAction(mCancelProfile); |
50 |
|
51 this->setContentWidget(mProfileList); |
|
52 this->setModal(true); |
62 this->setModal(true); |
53 this->setDismissPolicy(HbPopup::NoDismiss); |
63 this->setDismissPolicy(HbPopup::NoDismiss); |
54 this->setTimeout(HbPopup::NoTimeout); |
64 this->setTimeout(HbPopup::NoTimeout); |
|
65 mContentWidget->setLayout( mLayout ); |
55 } |
66 } |
56 |
67 |
57 CpProfileActivatorDialog::~CpProfileActivatorDialog() |
68 CpProfileActivatorDialog::~CpProfileActivatorDialog() |
58 { |
69 { |
59 |
70 |