aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpaneldirbrowser.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:16 -0500
committerJacek Antonelli2008-08-15 23:45:16 -0500
commit3f27ba891ac4d032753b219b4b96d1ffbc9fb488 (patch)
tree504932ee91a0356fba7ea48798887c96867e492f /linden/indra/newview/llpaneldirbrowser.cpp
parentSecond Life viewer sources 1.18.4.3 (diff)
downloadmeta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.zip
meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.gz
meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.bz2
meta-impy-3f27ba891ac4d032753b219b4b96d1ffbc9fb488.tar.xz
Second Life viewer sources 1.18.5.0-RC
Diffstat (limited to 'linden/indra/newview/llpaneldirbrowser.cpp')
-rw-r--r--linden/indra/newview/llpaneldirbrowser.cpp99
1 files changed, 41 insertions, 58 deletions
diff --git a/linden/indra/newview/llpaneldirbrowser.cpp b/linden/indra/newview/llpaneldirbrowser.cpp
index 3e79c9d..c4e33cb 100644
--- a/linden/indra/newview/llpaneldirbrowser.cpp
+++ b/linden/indra/newview/llpaneldirbrowser.cpp
@@ -297,13 +297,7 @@ void LLPanelDirBrowser::onCommitList(LLUICtrl* ctrl, void* data)
297 // Start with everyone invisible 297 // Start with everyone invisible
298 if (self->mFloaterDirectory) 298 if (self->mFloaterDirectory)
299 { 299 {
300 if (self->mFloaterDirectory->mPanelAvatarp) self->mFloaterDirectory->mPanelAvatarp->setVisible(FALSE); 300 self->mFloaterDirectory->hideAllDetailPanels();
301 if (self->mFloaterDirectory->mPanelEventp) self->mFloaterDirectory->mPanelEventp->setVisible(FALSE);
302 if (self->mFloaterDirectory->mPanelGroupp) self->mFloaterDirectory->mPanelGroupp->setVisible(FALSE);
303 if (self->mFloaterDirectory->mPanelGroupHolderp) self->mFloaterDirectory->mPanelGroupHolderp->setVisible(FALSE);
304 if (self->mFloaterDirectory->mPanelPlacep) self->mFloaterDirectory->mPanelPlacep->setVisible(FALSE);
305 if (self->mFloaterDirectory->mPanelPlaceSmallp) self->mFloaterDirectory->mPanelPlaceSmallp->setVisible(FALSE);
306 if (self->mFloaterDirectory->mPanelClassifiedp) self->mFloaterDirectory->mPanelClassifiedp->setVisible(FALSE);
307 } 301 }
308 302
309 if (FALSE == list->getCanSelect()) 303 if (FALSE == list->getCanSelect())
@@ -317,62 +311,70 @@ void LLPanelDirBrowser::onCommitList(LLUICtrl* ctrl, void* data)
317 return; 311 return;
318 } 312 }
319 313
320 LLUUID id = list->getCurrentID(); 314 LLSD item_id = list->getCurrentID();
321 S32 type = self->mResultsContents[id_str]["type"]; 315 S32 type = self->mResultsContents[id_str]["type"];
322 LLString name = self->mResultsContents[id_str]["name"].asString(); 316 if (type == EVENT_CODE)
323 317 {
318 // all but events use the UUID above
319 item_id = self->mResultsContents[id_str]["event_id"];
320 }
321
322 //LLString name = self->mResultsContents[id_str]["name"].asString();
323 self->showDetailPanel(type, item_id);
324}
325
326void LLPanelDirBrowser::showDetailPanel(S32 type, LLSD id)
327{
324 switch(type) 328 switch(type)
325 { 329 {
326 // These are both people searches. Let the panel decide if they are online or offline. 330 case AVATAR_CODE:
327 case ONLINE_CODE: 331 if (mFloaterDirectory && mFloaterDirectory->mPanelAvatarp)
328 case OFFLINE_CODE:
329 if (self->mFloaterDirectory && self->mFloaterDirectory->mPanelAvatarp)
330 { 332 {
331 self->mFloaterDirectory->mPanelAvatarp->setVisible(TRUE); 333 mFloaterDirectory->mPanelAvatarp->setVisible(TRUE);
332 self->mFloaterDirectory->mPanelAvatarp->setAvatarID(id, name, ONLINE_STATUS_NO); 334 mFloaterDirectory->mPanelAvatarp->setAvatarID(id.asUUID(), "", ONLINE_STATUS_NO);
333 } 335 }
334 break; 336 break;
335 case EVENT_CODE: 337 case EVENT_CODE:
336 { 338 {
337 U32 event_id = (U32)self->mResultsContents[id_str]["event_id"].asInteger(); 339 U32 event_id = (U32)id.asInteger();
338 self->showEvent(event_id); 340 showEvent(event_id);
339 } 341 }
340 break; 342 break;
341 case GROUP_CODE: 343 case GROUP_CODE:
342 if (self->mFloaterDirectory && self->mFloaterDirectory->mPanelGroupHolderp) 344 if (mFloaterDirectory && mFloaterDirectory->mPanelGroupHolderp)
343 { 345 {
344 self->mFloaterDirectory->mPanelGroupHolderp->setVisible(TRUE); 346 mFloaterDirectory->mPanelGroupHolderp->setVisible(TRUE);
345 } 347 }
346 if (self->mFloaterDirectory && self->mFloaterDirectory->mPanelGroupp) 348 if (mFloaterDirectory && mFloaterDirectory->mPanelGroupp)
347 { 349 {
348 self->mFloaterDirectory->mPanelGroupp->setVisible(TRUE); 350 mFloaterDirectory->mPanelGroupp->setVisible(TRUE);
349 self->mFloaterDirectory->mPanelGroupp->setGroupID(id); 351 mFloaterDirectory->mPanelGroupp->setGroupID(id.asUUID());
350 } 352 }
351 break; 353 break;
352 case CLASSIFIED_CODE: 354 case CLASSIFIED_CODE:
353 if (self->mFloaterDirectory && self->mFloaterDirectory->mPanelClassifiedp) 355 if (mFloaterDirectory && mFloaterDirectory->mPanelClassifiedp)
354 { 356 {
355 self->mFloaterDirectory->mPanelClassifiedp->setVisible(TRUE); 357 mFloaterDirectory->mPanelClassifiedp->setVisible(TRUE);
356 self->mFloaterDirectory->mPanelClassifiedp->setClassifiedID(id); 358 mFloaterDirectory->mPanelClassifiedp->setClassifiedID(id.asUUID());
357 self->mFloaterDirectory->mPanelClassifiedp->sendClassifiedInfoRequest(); 359 mFloaterDirectory->mPanelClassifiedp->sendClassifiedInfoRequest();
358 } 360 }
359 break; 361 break;
360 case FOR_SALE_CODE: 362 case FOR_SALE_CODE:
361 case AUCTION_CODE: 363 case AUCTION_CODE:
362 if (self->mFloaterDirectory && self->mFloaterDirectory->mPanelPlaceSmallp) 364 if (mFloaterDirectory && mFloaterDirectory->mPanelPlaceSmallp)
363 { 365 {
364 self->mFloaterDirectory->mPanelPlaceSmallp->setVisible(TRUE); 366 mFloaterDirectory->mPanelPlaceSmallp->setVisible(TRUE);
365 self->mFloaterDirectory->mPanelPlaceSmallp->setParcelID(id); 367 mFloaterDirectory->mPanelPlaceSmallp->resetLocation();
366 self->mFloaterDirectory->mPanelPlaceSmallp->sendParcelInfoRequest(); 368 mFloaterDirectory->mPanelPlaceSmallp->setParcelID(id.asUUID());
367 } 369 }
368 break; 370 break;
369 case PLACE_CODE: 371 case PLACE_CODE:
370 case POPULAR_CODE: 372 case POPULAR_CODE:
371 if (self->mFloaterDirectory && self->mFloaterDirectory->mPanelPlacep) 373 if (mFloaterDirectory && mFloaterDirectory->mPanelPlacep)
372 { 374 {
373 self->mFloaterDirectory->mPanelPlacep->setVisible(TRUE); 375 mFloaterDirectory->mPanelPlacep->setVisible(TRUE);
374 self->mFloaterDirectory->mPanelPlacep->setParcelID(id); 376 mFloaterDirectory->mPanelPlacep->resetLocation();
375 self->mFloaterDirectory->mPanelPlacep->sendParcelInfoRequest(); 377 mFloaterDirectory->mPanelPlacep->setParcelID(id.asUUID());
376 } 378 }
377 break; 379 break;
378 default: 380 default:
@@ -389,12 +391,7 @@ void LLPanelDirBrowser::showEvent(const U32 event_id)
389 // Start with everyone invisible 391 // Start with everyone invisible
390 if (mFloaterDirectory) 392 if (mFloaterDirectory)
391 { 393 {
392 if (mFloaterDirectory->mPanelAvatarp) mFloaterDirectory->mPanelAvatarp->setVisible(FALSE); 394 mFloaterDirectory->hideAllDetailPanels();
393 if (mFloaterDirectory->mPanelGroupp) mFloaterDirectory->mPanelGroupp->setVisible(FALSE);
394 if (mFloaterDirectory->mPanelGroupHolderp) mFloaterDirectory->mPanelGroupHolderp->setVisible(FALSE);
395 if (mFloaterDirectory->mPanelPlacep) mFloaterDirectory->mPanelPlacep->setVisible(FALSE);
396 if (mFloaterDirectory->mPanelPlaceSmallp) mFloaterDirectory->mPanelPlaceSmallp->setVisible(FALSE);
397 if (mFloaterDirectory->mPanelClassifiedp) mFloaterDirectory->mPanelClassifiedp->setVisible(FALSE);
398 if (mFloaterDirectory->mPanelEventp) 395 if (mFloaterDirectory->mPanelEventp)
399 { 396 {
400 mFloaterDirectory->mPanelEventp->setVisible(TRUE); 397 mFloaterDirectory->mPanelEventp->setVisible(TRUE);
@@ -436,9 +433,6 @@ void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**)
436 433
437 rows = self->showNextButton(rows); 434 rows = self->showNextButton(rows);
438 435
439 LLString online_type = llformat("%d", ONLINE_CODE);
440 LLString offline_type = llformat("%d", OFFLINE_CODE);
441
442 for (S32 i = 0; i < rows; i++) 436 for (S32 i = 0; i < rows; i++)
443 { 437 {
444 msg->getStringFast(_PREHASH_QueryReplies,_PREHASH_FirstName, DB_FIRST_NAME_BUF_SIZE, first_name, i); 438 msg->getStringFast(_PREHASH_QueryReplies,_PREHASH_FirstName, DB_FIRST_NAME_BUF_SIZE, first_name, i);
@@ -467,7 +461,7 @@ void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**)
467 row["columns"][0]["type"] = "icon"; 461 row["columns"][0]["type"] = "icon";
468 row["columns"][0]["value"] = image_id; 462 row["columns"][0]["value"] = image_id;
469 463
470 content["type"] = OFFLINE_CODE; 464 content["type"] = AVATAR_CODE;
471 465
472 LLString fullname = LLString(first_name) + " " + LLString(last_name); 466 LLString fullname = LLString(first_name) + " " + LLString(last_name);
473 row["columns"][1]["column"] = "name"; 467 row["columns"][1]["column"] = "name";
@@ -1183,13 +1177,7 @@ void LLPanelDirBrowser::setupNewSearch()
1183 mHaveSearchResults = FALSE; 1177 mHaveSearchResults = FALSE;
1184 1178
1185 // Set all panels to be invisible 1179 // Set all panels to be invisible
1186 if (mFloaterDirectory->mPanelAvatarp) mFloaterDirectory->mPanelAvatarp->setVisible(FALSE); 1180 mFloaterDirectory->hideAllDetailPanels();
1187 if (mFloaterDirectory->mPanelEventp) mFloaterDirectory->mPanelEventp->setVisible(FALSE);
1188 if (mFloaterDirectory->mPanelGroupp) mFloaterDirectory->mPanelGroupp->setVisible(FALSE);
1189 if (mFloaterDirectory->mPanelGroupHolderp) mFloaterDirectory->mPanelGroupHolderp->setVisible(FALSE);
1190 if (mFloaterDirectory->mPanelPlacep) mFloaterDirectory->mPanelPlacep->setVisible(FALSE);
1191 if (mFloaterDirectory->mPanelPlaceSmallp) mFloaterDirectory->mPanelPlaceSmallp->setVisible(FALSE);
1192 if (mFloaterDirectory->mPanelClassifiedp) mFloaterDirectory->mPanelClassifiedp->setVisible(FALSE);
1193 1181
1194 updateResultCount(); 1182 updateResultCount();
1195} 1183}
@@ -1237,11 +1225,6 @@ void LLPanelDirBrowser::addHelpText(const char* text)
1237} 1225}
1238 1226
1239 1227
1240BOOL enable_never(void*)
1241{
1242 return FALSE;
1243}
1244
1245void LLPanelDirBrowser::onKeystrokeName(LLLineEditor* line, void* data) 1228void LLPanelDirBrowser::onKeystrokeName(LLLineEditor* line, void* data)
1246{ 1229{
1247 LLPanelDirBrowser *self = (LLPanelDirBrowser*)data; 1230 LLPanelDirBrowser *self = (LLPanelDirBrowser*)data;
@@ -1270,7 +1253,7 @@ S32 LLPanelDirBrowser::showNextButton(S32 rows)
1270{ 1253{
1271 // HACK: This hack doesn't work for llpaneldirfind (ALL) 1254 // HACK: This hack doesn't work for llpaneldirfind (ALL)
1272 // because other data is being returned as well. 1255 // because other data is being returned as well.
1273 if ( getName() != "all_panel") 1256 if ( getName() != "find_all_old_panel")
1274 { 1257 {
1275 // HACK: The (mResultsPerPage)+1th entry indicates there are 'more' 1258 // HACK: The (mResultsPerPage)+1th entry indicates there are 'more'
1276 bool show_next = (mResultsReceived > mResultsPerPage); 1259 bool show_next = (mResultsReceived > mResultsPerPage);