23 #include <seccodeeditdataformviewitem.h> |
23 #include <seccodeeditdataformviewitem.h> |
24 #include <seccodesettings.h> |
24 #include <seccodesettings.h> |
25 |
25 |
26 // User includes |
26 // User includes |
27 #include "cppincodepluginview.h" |
27 #include "cppincodepluginview.h" |
|
28 #include <../../inc/cpsecplugins.h> |
28 |
29 |
29 /*! |
30 /*! |
30 \class CpPinCodePluginView |
31 \class CpPinCodePluginView |
31 \brief Pin Code Setting view class |
32 \brief Pin Code Setting view class |
32 |
33 |
39 Constructor |
40 Constructor |
40 */ |
41 */ |
41 CpPinCodePluginView::CpPinCodePluginView(QGraphicsItem *parent /*= 0*/) |
42 CpPinCodePluginView::CpPinCodePluginView(QGraphicsItem *parent /*= 0*/) |
42 : CpBaseSettingView(0,parent), mSecCodeSettings(new SecCodeSettings()) |
43 : CpBaseSettingView(0,parent), mSecCodeSettings(new SecCodeSettings()) |
43 { |
44 { |
|
45 RDEBUG("0", 0); |
44 HbDataForm *form = qobject_cast<HbDataForm*>(widget()); |
46 HbDataForm *form = qobject_cast<HbDataForm*>(widget()); |
45 if (form) { |
47 if (form) { |
46 QList<HbAbstractViewItem *> protoTypeList = form->itemPrototypes(); |
48 QList<HbAbstractViewItem *> protoTypeList = form->itemPrototypes(); |
47 protoTypeList.append(new SecCodeEditDataFormViewItem()); |
49 protoTypeList.append(new SecCodeEditDataFormViewItem()); |
48 form->setItemPrototypes(protoTypeList); |
50 form->setItemPrototypes(protoTypeList); |
58 mPinCodeRequestItem->setContentWidgetData("additionalText", tr("On")); |
60 mPinCodeRequestItem->setContentWidgetData("additionalText", tr("On")); |
59 } else { |
61 } else { |
60 mPinCodeRequestItem->setContentWidgetData("text",tr("Off")); |
62 mPinCodeRequestItem->setContentWidgetData("text",tr("Off")); |
61 mPinCodeRequestItem->setContentWidgetData("additionalText", tr("Off")); |
63 mPinCodeRequestItem->setContentWidgetData("additionalText", tr("Off")); |
62 } |
64 } |
63 |
65 RDEBUG("form->addConnection", 1); |
64 form->addConnection(mPinCodeRequestItem, SIGNAL(clicked()), this, |
66 form->addConnection(mPinCodeRequestItem, SIGNAL(clicked()), this, |
65 SLOT(changePinCodeRequest())); |
67 SLOT(changePinCodeRequest())); |
66 formModel->appendDataFormItem(mPinCodeRequestItem); |
68 formModel->appendDataFormItem(mPinCodeRequestItem); |
67 |
69 |
68 HbDataFormModelItem *pinCodeItem = new HbDataFormModelItem( |
70 HbDataFormModelItem *pinCodeItem = new HbDataFormModelItem( |
82 pin2CodeItem->setContentWidgetData("text", "1111"); |
84 pin2CodeItem->setContentWidgetData("text", "1111"); |
83 pin2CodeItem->setContentWidgetData("readOnly", true); |
85 pin2CodeItem->setContentWidgetData("readOnly", true); |
84 form->addConnection(pin2CodeItem, SIGNAL(clicked()), this, |
86 form->addConnection(pin2CodeItem, SIGNAL(clicked()), this, |
85 SLOT(changePin2Code())); |
87 SLOT(changePin2Code())); |
86 formModel->appendDataFormItem(pin2CodeItem); |
88 formModel->appendDataFormItem(pin2CodeItem); |
87 |
89 RDEBUG("form->setModel", 1); |
88 form->setModel(formModel); |
90 form->setModel(formModel); |
89 } |
91 } |
90 } |
92 } |
91 |
93 |
92 /*! |
94 /*! |
100 /*! |
102 /*! |
101 response for click pin code |
103 response for click pin code |
102 */ |
104 */ |
103 void CpPinCodePluginView::changePinCode() |
105 void CpPinCodePluginView::changePinCode() |
104 { |
106 { |
|
107 RDEBUG("0", 0); |
105 mSecCodeSettings->changePinCode(); |
108 mSecCodeSettings->changePinCode(); |
106 } |
109 } |
107 |
110 |
108 /*! |
111 /*! |
109 response for click pin2 code |
112 response for click pin2 code |
110 */ |
113 */ |
111 void CpPinCodePluginView::changePin2Code() |
114 void CpPinCodePluginView::changePin2Code() |
112 { |
115 { |
|
116 RDEBUG("0", 0); |
113 mSecCodeSettings->changePin2Code(); |
117 mSecCodeSettings->changePin2Code(); |
114 } |
118 } |
115 |
119 |
116 /*! |
120 /*! |
117 response for click pin code request |
121 response for click pin code request |
118 */ |
122 */ |
119 void CpPinCodePluginView::changePinCodeRequest() |
123 void CpPinCodePluginView::changePinCodeRequest() |
120 { |
124 { |
|
125 RDEBUG("0", 0); |
121 if (mSecCodeSettings->changePinCodeRequest()) { |
126 if (mSecCodeSettings->changePinCodeRequest()) { |
122 QString text = mPinCodeRequestItem->contentWidgetData("text").toString(); |
127 QString text = mPinCodeRequestItem->contentWidgetData("text").toString(); |
123 if (0 == text.compare("On")) { |
128 if (0 == text.compare("On")) { |
|
129 RDEBUG("On->Off", 0); |
124 mPinCodeRequestItem->setContentWidgetData("text", |
130 mPinCodeRequestItem->setContentWidgetData("text", |
125 tr("Off")); |
131 tr("Off")); |
126 mPinCodeRequestItem->setContentWidgetData("additionalText", |
132 mPinCodeRequestItem->setContentWidgetData("additionalText", |
127 tr("Off")); |
133 tr("Off")); |
128 } else { |
134 } else { |
|
135 RDEBUG("Off->On", 0); |
129 mPinCodeRequestItem->setContentWidgetData("text", |
136 mPinCodeRequestItem->setContentWidgetData("text", |
130 tr("On")); |
137 tr("On")); |
131 mPinCodeRequestItem->setContentWidgetData("additionalText", |
138 mPinCodeRequestItem->setContentWidgetData("additionalText", |
132 tr("On")); |
139 tr("On")); |
133 } |
140 } |