diff options
Diffstat (limited to 'linden/indra/newview/llinventoryview.cpp')
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 157 |
1 files changed, 89 insertions, 68 deletions
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 52c3b7e..a265906 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -118,6 +118,21 @@ LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, | |||
118 | 118 | ||
119 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml"); | 119 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml"); |
120 | 120 | ||
121 | |||
122 | childSetCommitCallback("check_animation", onCheckFilterType, this); | ||
123 | childSetCommitCallback("check_bodypart", onCheckFilterType, this); | ||
124 | childSetCommitCallback("check_calling_card", onCheckFilterType, this); | ||
125 | childSetCommitCallback("check_clothing", onCheckFilterType, this); | ||
126 | childSetCommitCallback("check_gesture", onCheckFilterType, this); | ||
127 | childSetCommitCallback("check_landmark", onCheckFilterType, this); | ||
128 | childSetCommitCallback("check_notecard", onCheckFilterType, this); | ||
129 | childSetCommitCallback("check_object", onCheckFilterType, this); | ||
130 | childSetCommitCallback("check_script", onCheckFilterType, this); | ||
131 | childSetCommitCallback("check_sound", onCheckFilterType, this); | ||
132 | childSetCommitCallback("check_texture", onCheckFilterType, this); | ||
133 | childSetCommitCallback("check_snapshot", onCheckFilterType, this); | ||
134 | |||
135 | |||
121 | childSetAction("All", selectAllTypes, this); | 136 | childSetAction("All", selectAllTypes, this); |
122 | childSetAction("None", selectNoTypes, this); | 137 | childSetAction("None", selectNoTypes, this); |
123 | 138 | ||
@@ -127,6 +142,8 @@ LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, | |||
127 | mSpinSinceDays = getChild<LLSpinCtrl>("spin_days_ago"); | 142 | mSpinSinceDays = getChild<LLSpinCtrl>("spin_days_ago"); |
128 | childSetCommitCallback("spin_days_ago", onTimeAgo, this); | 143 | childSetCommitCallback("spin_days_ago", onTimeAgo, this); |
129 | 144 | ||
145 | childSetCommitCallback("check_show_empty", onCheckShowEmptyFolders, this); | ||
146 | |||
130 | // mCheckSinceLogoff = getChild<LLSpinCtrl>("check_since_logoff"); | 147 | // mCheckSinceLogoff = getChild<LLSpinCtrl>("check_since_logoff"); |
131 | childSetCommitCallback("check_since_logoff", onCheckSinceLogoff, this); | 148 | childSetCommitCallback("check_since_logoff", onCheckSinceLogoff, this); |
132 | 149 | ||
@@ -136,6 +153,16 @@ LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, | |||
136 | } | 153 | } |
137 | 154 | ||
138 | 155 | ||
156 | // Callback when an inventory type checkbox is changed. | ||
157 | void LLInventoryViewFinder::onCheckFilterType(LLUICtrl *ctrl, void *user_data) | ||
158 | { | ||
159 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; | ||
160 | if (!self) return; | ||
161 | |||
162 | self->rebuildFilter(); | ||
163 | } | ||
164 | |||
165 | |||
139 | void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) | 166 | void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) |
140 | { | 167 | { |
141 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; | 168 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; |
@@ -148,6 +175,8 @@ void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) | |||
148 | { | 175 | { |
149 | self->mSpinSinceHours->set(1.0f); | 176 | self->mSpinSinceHours->set(1.0f); |
150 | } | 177 | } |
178 | |||
179 | self->rebuildFilter(); | ||
151 | } | 180 | } |
152 | 181 | ||
153 | void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) | 182 | void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) |
@@ -161,14 +190,27 @@ void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) | |||
161 | since_logoff = false; | 190 | since_logoff = false; |
162 | } | 191 | } |
163 | self->childSetValue("check_since_logoff", since_logoff); | 192 | self->childSetValue("check_since_logoff", since_logoff); |
193 | |||
194 | self->rebuildFilter(); | ||
195 | } | ||
196 | |||
197 | |||
198 | void LLInventoryViewFinder::onCheckShowEmptyFolders(LLUICtrl *ctrl, void *user_data) | ||
199 | { | ||
200 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; | ||
201 | if (!self) return; | ||
202 | |||
203 | self->rebuildFilter(); | ||
164 | } | 204 | } |
165 | 205 | ||
206 | |||
166 | void LLInventoryViewFinder::changeFilter(LLInventoryFilter* filter) | 207 | void LLInventoryViewFinder::changeFilter(LLInventoryFilter* filter) |
167 | { | 208 | { |
168 | mFilter = filter; | 209 | mFilter = filter; |
169 | updateElementsFromFilter(); | 210 | updateElementsFromFilter(); |
170 | } | 211 | } |
171 | 212 | ||
213 | |||
172 | void LLInventoryViewFinder::updateElementsFromFilter() | 214 | void LLInventoryViewFinder::updateElementsFromFilter() |
173 | { | 215 | { |
174 | if (!mFilter) | 216 | if (!mFilter) |
@@ -180,113 +222,116 @@ void LLInventoryViewFinder::updateElementsFromFilter() | |||
180 | LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); | 222 | LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); |
181 | U32 hours = mFilter->getHoursAgo(); | 223 | U32 hours = mFilter->getHoursAgo(); |
182 | 224 | ||
183 | // update the ui elements | 225 | // Update floater title |
184 | LLFloater::setTitle(mFilter->getName()); | 226 | LLFloater::setTitle(mFilter->getName()); |
185 | 227 | ||
186 | childSetValue("check_animation", (S32) (filter_types & LLInventoryType::NIT_ANIMATION)); | 228 | // Update type check boxes |
187 | childSetValue("check_bodypart", (S32) (filter_types & LLInventoryType::NIT_BODYPART)); | 229 | childSetValue("check_animation", |
188 | childSetValue("check_calling_card", (S32) (filter_types & LLInventoryType::NIT_CALLCARD)); | 230 | (S32)(filter_types & LLInventoryType::NIT_ANIMATION)); |
189 | childSetValue("check_clothing", (S32) (filter_types & LLInventoryType::NIT_CLOTHING)); | 231 | childSetValue("check_bodypart", |
190 | childSetValue("check_gesture", (S32) (filter_types & LLInventoryType::NIT_GESTURE)); | 232 | (S32)(filter_types & LLInventoryType::NIT_BODYPART)); |
191 | childSetValue("check_landmark", (S32) (filter_types & LLInventoryType::NIT_LANDMARK)); | 233 | childSetValue("check_calling_card", |
192 | childSetValue("check_notecard", (S32) (filter_types & LLInventoryType::NIT_NOTECARD)); | 234 | (S32)(filter_types & LLInventoryType::NIT_CALLCARD)); |
193 | childSetValue("check_object", (S32) (filter_types & LLInventoryType::NIT_OBJECT)); | 235 | childSetValue("check_clothing", |
194 | childSetValue("check_script", (S32) (filter_types & LLInventoryType::NIT_SCRIPT_LSL2)); | 236 | (S32)(filter_types & LLInventoryType::NIT_CLOTHING)); |
195 | childSetValue("check_sound", (S32) (filter_types & LLInventoryType::NIT_SOUND)); | 237 | childSetValue("check_gesture", |
196 | childSetValue("check_texture", (S32) (filter_types & LLInventoryType::NIT_TEXTURE)); | 238 | (S32)(filter_types & LLInventoryType::NIT_GESTURE)); |
197 | childSetValue("check_snapshot", (S32) (filter_types & LLInventoryType::NIT_SNAPSHOT)); | 239 | childSetValue("check_landmark", |
198 | childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); | 240 | (S32)(filter_types & LLInventoryType::NIT_LANDMARK)); |
199 | childSetValue("check_since_logoff", mFilter->isSinceLogoff()); | 241 | childSetValue("check_notecard", |
200 | mSpinSinceHours->set((F32)(hours % 24)); | 242 | (S32)(filter_types & LLInventoryType::NIT_NOTECARD)); |
201 | mSpinSinceDays->set((F32)(hours / 24)); | 243 | childSetValue("check_object", |
202 | } | 244 | (S32)(filter_types & LLInventoryType::NIT_OBJECT)); |
203 | 245 | childSetValue("check_script", | |
204 | void LLInventoryViewFinder::draw() | 246 | (S32)(filter_types & LLInventoryType::NIT_SCRIPT_LSL2)); |
205 | { | 247 | childSetValue("check_sound", |
206 | U32 filter = 0xffffffff; | 248 | (S32)(filter_types & LLInventoryType::NIT_SOUND)); |
207 | BOOL filtered_by_all_types = TRUE; | 249 | childSetValue("check_texture", |
250 | (S32)(filter_types & LLInventoryType::NIT_TEXTURE)); | ||
251 | childSetValue("check_snapshot", | ||
252 | (S32)(filter_types & LLInventoryType::NIT_SNAPSHOT)); | ||
253 | |||
254 | // Update other check boxes | ||
255 | childSetValue("check_show_empty", | ||
256 | show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); | ||
257 | childSetValue("check_since_logoff", | ||
258 | mFilter->isSinceLogoff()); | ||
259 | |||
260 | // Update hours and days spinners | ||
261 | mSpinSinceHours->set( (F32)(hours % 24) ); | ||
262 | mSpinSinceDays->set( (F32)(hours / 24) ); | ||
263 | } | ||
264 | |||
265 | |||
266 | void LLInventoryViewFinder::rebuildFilter() | ||
267 | { | ||
268 | U32 filter = LLInventoryType::NIT_ALL; | ||
208 | 269 | ||
209 | if (!childGetValue("check_animation")) | 270 | if (!childGetValue("check_animation")) |
210 | { | 271 | { |
211 | filter &= ~(LLInventoryType::NIT_ANIMATION); | 272 | filter &= ~(LLInventoryType::NIT_ANIMATION); |
212 | filtered_by_all_types = FALSE; | ||
213 | } | 273 | } |
214 | 274 | ||
215 | if (!childGetValue("check_bodypart")) | 275 | if (!childGetValue("check_bodypart")) |
216 | { | 276 | { |
217 | filter &= ~(LLInventoryType::NIT_BODYPART); | 277 | filter &= ~(LLInventoryType::NIT_BODYPART); |
218 | filtered_by_all_types = FALSE; | ||
219 | } | 278 | } |
220 | 279 | ||
221 | if (!childGetValue("check_calling_card")) | 280 | if (!childGetValue("check_calling_card")) |
222 | { | 281 | { |
223 | filter &= ~(LLInventoryType::NIT_CALLCARD); | 282 | filter &= ~(LLInventoryType::NIT_CALLCARD); |
224 | filtered_by_all_types = FALSE; | ||
225 | } | 283 | } |
226 | 284 | ||
227 | if (!childGetValue("check_clothing")) | 285 | if (!childGetValue("check_clothing")) |
228 | { | 286 | { |
229 | filter &= ~(LLInventoryType::NIT_CLOTHING); | 287 | filter &= ~(LLInventoryType::NIT_CLOTHING); |
230 | filtered_by_all_types = FALSE; | ||
231 | } | 288 | } |
232 | 289 | ||
233 | if (!childGetValue("check_gesture")) | 290 | if (!childGetValue("check_gesture")) |
234 | { | 291 | { |
235 | filter &= ~(LLInventoryType::NIT_GESTURE); | 292 | filter &= ~(LLInventoryType::NIT_GESTURE); |
236 | filtered_by_all_types = FALSE; | ||
237 | } | 293 | } |
238 | 294 | ||
239 | if (!childGetValue("check_landmark")) | 295 | if (!childGetValue("check_landmark")) |
240 | |||
241 | |||
242 | { | 296 | { |
243 | filter &= ~(LLInventoryType::NIT_LANDMARK); | 297 | filter &= ~(LLInventoryType::NIT_LANDMARK); |
244 | filtered_by_all_types = FALSE; | ||
245 | } | 298 | } |
246 | 299 | ||
247 | if (!childGetValue("check_notecard")) | 300 | if (!childGetValue("check_notecard")) |
248 | { | 301 | { |
249 | filter &= ~(LLInventoryType::NIT_NOTECARD); | 302 | filter &= ~(LLInventoryType::NIT_NOTECARD); |
250 | filtered_by_all_types = FALSE; | ||
251 | } | 303 | } |
252 | 304 | ||
253 | if (!childGetValue("check_object")) | 305 | if (!childGetValue("check_object")) |
254 | { | 306 | { |
255 | filter &= ~(LLInventoryType::NIT_OBJECT); | 307 | filter &= ~(LLInventoryType::NIT_OBJECT); |
256 | filtered_by_all_types = FALSE; | ||
257 | } | 308 | } |
258 | 309 | ||
259 | if (!childGetValue("check_script")) | 310 | if (!childGetValue("check_script")) |
260 | { | 311 | { |
261 | filter &= ~(LLInventoryType::NIT_SCRIPT_LSL2); | 312 | filter &= ~(LLInventoryType::NIT_SCRIPT_LSL2); |
262 | filtered_by_all_types = FALSE; | ||
263 | } | 313 | } |
264 | 314 | ||
265 | if (!childGetValue("check_sound")) | 315 | if (!childGetValue("check_sound")) |
266 | { | 316 | { |
267 | filter &= ~(LLInventoryType::NIT_SOUND); | 317 | filter &= ~(LLInventoryType::NIT_SOUND); |
268 | filtered_by_all_types = FALSE; | ||
269 | } | 318 | } |
270 | 319 | ||
271 | if (!childGetValue("check_texture")) | 320 | if (!childGetValue("check_texture")) |
272 | { | 321 | { |
273 | filter &= ~(LLInventoryType::NIT_TEXTURE); | 322 | filter &= ~(LLInventoryType::NIT_TEXTURE); |
274 | filtered_by_all_types = FALSE; | ||
275 | } | 323 | } |
276 | 324 | ||
277 | if (!childGetValue("check_snapshot")) | 325 | if (!childGetValue("check_snapshot")) |
278 | { | 326 | { |
279 | filter &= ~(LLInventoryType::NIT_SNAPSHOT); | 327 | filter &= ~(LLInventoryType::NIT_SNAPSHOT); |
280 | filtered_by_all_types = FALSE; | ||
281 | } | 328 | } |
282 | 329 | ||
283 | /* | 330 | if (filter != LLInventoryType::NIT_ALL) |
284 | if (!filtered_by_all_types) | ||
285 | { | 331 | { |
286 | // don't include folders in filter, unless I've selected everything | 332 | // don't include folders in filter, unless I've selected everything |
287 | filter &= ~(LLInventoryType::NIT_CATEGORY); | 333 | filter &= ~(LLInventoryType::NIT_FOLDER); |
288 | } | 334 | } |
289 | */ | ||
290 | 335 | ||
291 | // update the panel, panel will update the filter | 336 | // update the panel, panel will update the filter |
292 | mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? | 337 | mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? |
@@ -310,8 +355,6 @@ void LLInventoryViewFinder::draw() | |||
310 | mInventoryView->mActivePanel->setHoursAgo(hours); | 355 | mInventoryView->mActivePanel->setHoursAgo(hours); |
311 | mInventoryView->mActivePanel->setSinceLogoff(getCheckSinceLogoff()); | 356 | mInventoryView->mActivePanel->setSinceLogoff(getCheckSinceLogoff()); |
312 | mInventoryView->setFilterTextFromFilter(); | 357 | mInventoryView->setFilterTextFromFilter(); |
313 | |||
314 | LLFloater::draw(); | ||
315 | } | 358 | } |
316 | 359 | ||
317 | void LLInventoryViewFinder::onClose(bool app_quitting) | 360 | void LLInventoryViewFinder::onClose(bool app_quitting) |
@@ -364,17 +407,7 @@ void LLInventoryViewFinder::selectAllTypes(void* user_data) | |||
364 | self->childSetValue("check_texture", TRUE); | 407 | self->childSetValue("check_texture", TRUE); |
365 | self->childSetValue("check_snapshot", TRUE); | 408 | self->childSetValue("check_snapshot", TRUE); |
366 | 409 | ||
367 | /* | 410 | self->rebuildFilter(); |
368 | self->mCheckCallingCard->set(TRUE); | ||
369 | self->mCheckClothing->set(TRUE); | ||
370 | self->mCheckGesture->set(TRUE); | ||
371 | self->mCheckLandmark->set(TRUE); | ||
372 | self->mCheckNotecard->set(TRUE); | ||
373 | self->mCheckObject->set(TRUE); | ||
374 | self->mCheckScript->set(TRUE); | ||
375 | self->mCheckSound->set(TRUE); | ||
376 | self->mCheckTexture->set(TRUE); | ||
377 | self->mCheckSnapshot->set(TRUE);*/ | ||
378 | } | 411 | } |
379 | 412 | ||
380 | //static | 413 | //static |
@@ -383,20 +416,6 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data) | |||
383 | LLInventoryViewFinder* self = (LLInventoryViewFinder*)user_data; | 416 | LLInventoryViewFinder* self = (LLInventoryViewFinder*)user_data; |
384 | if(!self) return; | 417 | if(!self) return; |
385 | 418 | ||
386 | /* | ||
387 | self->childSetValue("check_animation", FALSE); | ||
388 | self->mCheckCallingCard->set(FALSE); | ||
389 | self->mCheckClothing->set(FALSE); | ||
390 | self->mCheckGesture->set(FALSE); | ||
391 | self->mCheckLandmark->set(FALSE); | ||
392 | self->mCheckNotecard->set(FALSE); | ||
393 | self->mCheckObject->set(FALSE); | ||
394 | self->mCheckScript->set(FALSE); | ||
395 | self->mCheckSound->set(FALSE); | ||
396 | self->mCheckTexture->set(FALSE); | ||
397 | self->mCheckSnapshot->set(FALSE);*/ | ||
398 | |||
399 | |||
400 | self->childSetValue("check_animation", FALSE); | 419 | self->childSetValue("check_animation", FALSE); |
401 | self->childSetValue("check_bodypart", FALSE); | 420 | self->childSetValue("check_bodypart", FALSE); |
402 | self->childSetValue("check_calling_card", FALSE); | 421 | self->childSetValue("check_calling_card", FALSE); |
@@ -409,6 +428,8 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data) | |||
409 | self->childSetValue("check_sound", FALSE); | 428 | self->childSetValue("check_sound", FALSE); |
410 | self->childSetValue("check_texture", FALSE); | 429 | self->childSetValue("check_texture", FALSE); |
411 | self->childSetValue("check_snapshot", FALSE); | 430 | self->childSetValue("check_snapshot", FALSE); |
431 | |||
432 | self->rebuildFilter(); | ||
412 | } | 433 | } |
413 | 434 | ||
414 | 435 | ||