equal
deleted
inserted
replaced
24 ****************************************************************************/ |
24 ****************************************************************************/ |
25 |
25 |
26 #include "hbinputdialog_p.h" |
26 #include "hbinputdialog_p.h" |
27 #include "hbinputdialogcontent_p.h" |
27 #include "hbinputdialogcontent_p.h" |
28 #include "hbstyleoptioninputdialog_p.h" |
28 #include "hbstyleoptioninputdialog_p.h" |
29 |
29 #include <hbstyletextprimitivedata.h> |
30 #include <hblineedit.h> |
30 #include <hblineedit.h> |
31 #include <hbaction.h> |
31 #include <hbaction.h> |
32 #include <hbvalidator.h> |
32 #include <hbvalidator.h> |
33 #include <hbstyle.h> |
33 #include <hbstyle.h> |
34 #include <hbinputeditorinterface.h> |
34 #include <hbinputeditorinterface.h> |
46 mLabel1(0), |
46 mLabel1(0), |
47 mLabel2(0), |
47 mLabel2(0), |
48 mEdit2(0), |
48 mEdit2(0), |
49 mAdditionalRowVisible(false) |
49 mAdditionalRowVisible(false) |
50 { |
50 { |
51 mLabel1 = style()->createPrimitive(HbStyle::P_InputDialog_text,this); |
51 mLabel1 = style()->createPrimitive(HbStyle::PT_TextItem, "label-1", this); |
52 mEdit1 = new HbLineEdit(this); |
52 mEdit1 = new HbLineEdit(this); |
53 HbStyle::setItemName(mEdit1, "text-1"); |
53 HbStyle::setItemName(mEdit1, "text-1"); |
54 |
54 |
55 connect(mEdit1,SIGNAL(textChanged(const QString)),this,SLOT(emitTextChange(const QString))); |
55 connect(mEdit1,SIGNAL(textChanged(const QString)),this,SLOT(emitTextChange(const QString))); |
56 this->setProperty("additionalRowVisible",QVariant(false)); |
56 this->setProperty("additionalRowVisible",QVariant(false)); |
63 void HbInputDialogContentWidget::setAdditionalRowVisible(bool visible) |
63 void HbInputDialogContentWidget::setAdditionalRowVisible(bool visible) |
64 { |
64 { |
65 mAdditionalRowVisible = visible; |
65 mAdditionalRowVisible = visible; |
66 |
66 |
67 if(!mLabel2 && visible) { |
67 if(!mLabel2 && visible) { |
68 mLabel2 = style()->createPrimitive(HbStyle::P_InputDialog_additionaltext,this); |
68 mLabel2 = style()->createPrimitive(HbStyle::PT_TextItem, "label-2", this); |
69 } |
69 } |
70 |
|
71 if(!mEdit2 && visible) { |
70 if(!mEdit2 && visible) { |
72 //Retrieve the cached data here and assign// |
71 //Retrieve the cached data here and assign// |
73 mEdit2 = new HbLineEdit(this); |
72 mEdit2 = new HbLineEdit(this); |
74 mEdit2->setText(d->mText); |
73 mEdit2->setText(d->mText); |
75 mEdit2->setEchoMode(d->mEchoMode); |
74 mEdit2->setEchoMode(d->mEchoMode); |
256 return; |
255 return; |
257 } |
256 } |
258 HbStyleOptionInputDialog option; |
257 HbStyleOptionInputDialog option; |
259 if(row == 0) { |
258 if(row == 0) { |
260 mPromptText = text; |
259 mPromptText = text; |
261 q->initStyleOption(&option); |
260 HbStyleTextPrimitiveData data; |
262 q->style()->updatePrimitive(mContentWidget->mLabel1,HbStyle::P_InputDialog_text,&option); |
261 q->initPrimitiveData(&data, mContentWidget->mLabel1); |
263 } else { |
262 q->style()->updatePrimitive(mContentWidget->mLabel1, &data, mContentWidget); |
|
263 } |
|
264 else { |
264 mPromptAdditionalText = text; |
265 mPromptAdditionalText = text; |
265 q->initStyleOption(&option); |
266 HbStyleTextPrimitiveData data; |
266 if(mContentWidget->mAdditionalRowVisible) { |
267 q->initPrimitiveData(&data, mContentWidget->mLabel2); |
267 q->style()->updatePrimitive(mContentWidget->mLabel2,HbStyle::P_InputDialog_additionaltext,&option); |
268 q->style()->updatePrimitive(mContentWidget->mLabel2, &data, mContentWidget); |
268 } |
|
269 } |
269 } |
270 } |
270 } |
271 |
271 |
272 |
272 |
273 QString HbInputDialogPrivate::promptText(int row) const |
273 QString HbInputDialogPrivate::promptText(int row) const |