equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 #include <hbnamespace.h> |
18 #include <hbnamespace.h> |
19 #include <HbAbstractItemView> |
19 #include <HbAbstractItemView> |
20 #include <HbStyleLoader> |
20 #include <HbStyleLoader> |
21 #include <HbTextItem> |
21 #include <HbTextItem> |
|
22 #include <HbRichTextItem> |
22 #include <HbParameterLengthLimiter> |
23 #include <HbParameterLengthLimiter> |
23 #include <QPainter> |
24 #include <QPainter> |
24 #include <caitemmodel.h> |
25 #include <caitemmodel.h> |
25 #include "hsmenuitemmodel.h" |
26 #include "hsmenuitemmodel.h" |
26 |
27 |
104 } |
105 } |
105 } |
106 } |
106 |
107 |
107 void HsListViewItem::updateChildItems() |
108 void HsListViewItem::updateChildItems() |
108 { |
109 { |
|
110 HSMENUTEST_FUNC_ENTRY("HsListViewItem::updateChildItems"); |
109 HbListViewItem::updateChildItems(); |
111 HbListViewItem::updateChildItems(); |
110 |
112 |
111 EntryFlags flags = modelIndex().data( |
113 EntryFlags flags = modelIndex().data( |
112 CaItemModel::FlagsRole).value<EntryFlags> (); |
114 CaItemModel::FlagsRole).value<EntryFlags> (); |
113 isProgress = false; |
115 isProgress = false; |
126 } |
128 } |
127 progress->setTargetProgressValue(progresVal); |
129 progress->setTargetProgressValue(progresVal); |
128 // TODO, consider moving this logic to model |
130 // TODO, consider moving this logic to model |
129 foreach (QGraphicsItem * item, this->childItems()) { |
131 foreach (QGraphicsItem * item, this->childItems()) { |
130 if (HbStyle::itemName(item) == "text-1") { |
132 if (HbStyle::itemName(item) == "text-1") { |
131 HbTextItem* text = (HbTextItem*)item; |
133 if (textFormat() == Qt::RichText) { |
132 text->setText( |
134 HbRichTextItem * text = (HbRichTextItem *)item; |
133 HbParameterLengthLimiter("txt_applib_dblist_uninstalling_1") |
135 text->setText( |
134 .arg(text->text())); |
136 HbParameterLengthLimiter("txt_applib_dblist_uninstalling_1") |
|
137 .arg(text->text())); |
|
138 } |
|
139 else { |
|
140 HbTextItem* text = (HbTextItem*)item; |
|
141 text->setText( |
|
142 HbParameterLengthLimiter("txt_applib_dblist_uninstalling_1") |
|
143 .arg(text->text())); |
|
144 } |
135 break; |
145 break; |
136 } |
146 } |
137 } |
147 } |
138 } else if (progress) { |
148 } else if (progress) { |
139 disconnect(progress, SIGNAL(valueChanged())); |
149 disconnect(progress, SIGNAL(valueChanged())); |
146 if (HbStyle::itemName(item) == "text-2") { |
156 if (HbStyle::itemName(item) == "text-2") { |
147 item->setVisible(!isProgress); |
157 item->setVisible(!isProgress); |
148 break; |
158 break; |
149 } |
159 } |
150 } |
160 } |
|
161 HSMENUTEST_FUNC_EXIT("HsListViewItem::updateChildItems"); |
151 } |
162 } |
152 |
163 |
153 HbAbstractViewItem* HsListViewItem::createItem() |
164 HbAbstractViewItem* HsListViewItem::createItem() |
154 { |
165 { |
155 return new HsListViewItem(*this); |
166 return new HsListViewItem(*this); |
156 } |
167 } |
157 |
168 |
158 |
169 |
159 void HsListViewItem::polish(HbStyleParameters& params) |
170 void HsListViewItem::polish(HbStyleParameters& params) |
160 { |
171 { |
|
172 HSMENUTEST_FUNC_ENTRY("HsListViewItem::polish"); |
161 if (isProgress) { |
173 if (isProgress) { |
162 HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml"); |
174 HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml"); |
163 } |
175 } |
164 HbListViewItem::setProperty("progress", isProgress); |
176 HbListViewItem::setProperty("progress", isProgress); |
165 HbListViewItem::polish(params); |
177 HbListViewItem::polish(params); |
166 if (isProgress) { |
178 if (isProgress) { |
167 HbStyleLoader::unregisterFilePath(":/layout/hslistviewitem.widgetml"); |
179 HbStyleLoader::unregisterFilePath(":/layout/hslistviewitem.widgetml"); |
168 } |
180 } |
|
181 HSMENUTEST_FUNC_EXIT("HsListViewItem::polish"); |
169 } |
182 } |
170 |
183 |