aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterproperties.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterproperties.cpp73
1 files changed, 31 insertions, 42 deletions
diff --git a/linden/indra/newview/llfloaterproperties.cpp b/linden/indra/newview/llfloaterproperties.cpp
index 546270e..538e841 100644
--- a/linden/indra/newview/llfloaterproperties.cpp
+++ b/linden/indra/newview/llfloaterproperties.cpp
@@ -2,6 +2,8 @@
2 * @file llfloaterproperties.cpp 2 * @file llfloaterproperties.cpp
3 * @brief A floater which shows an inventory item's properties. 3 * @brief A floater which shows an inventory item's properties.
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 *
5 * Copyright (c) 2002-2007, Linden Research, Inc. 7 * Copyright (c) 2002-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -56,14 +59,6 @@
56#include "llvieweruictrlfactory.h" 59#include "llvieweruictrlfactory.h"
57 60
58 61
59///----------------------------------------------------------------------------
60/// Local function declarations, constants, enums, and typedefs
61///----------------------------------------------------------------------------
62
63const char* YOU_CAN = "You can:";
64const char* OWNER_CAN = "Owner can: ";
65
66
67//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68// Class LLPropertiesObserver 63// Class LLPropertiesObserver
69// 64//
@@ -299,22 +294,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
299 294
300 childSetEnabled("LabelItemNameTitle",TRUE); 295 childSetEnabled("LabelItemNameTitle",TRUE);
301 childSetEnabled("LabelItemName",is_modifiable); 296 childSetEnabled("LabelItemName",is_modifiable);
302 const char EMPTY_STRING[1] = ""; /* Flawfinder: ignore */ 297 childSetText("LabelItemName",item->getName());
303 const char* txt = EMPTY_STRING;
304 if(!item->getName().empty())
305 {
306 txt = item->getName().c_str();
307 }
308 childSetText("LabelItemName",txt);
309 childSetEnabled("LabelItemDescTitle",TRUE); 298 childSetEnabled("LabelItemDescTitle",TRUE);
310 childSetEnabled("LabelItemDesc",is_modifiable); 299 childSetEnabled("LabelItemDesc",is_modifiable);
311 childSetVisible("IconLocked",!is_modifiable); 300 childSetVisible("IconLocked",!is_modifiable);
312 txt = EMPTY_STRING; 301 childSetText("LabelItemDesc",item->getDescription());
313 if(!item->getDescription().empty())
314 {
315 txt = item->getDescription().c_str();
316 }
317 childSetText("LabelItemDesc",txt);
318 302
319 ////////////////// 303 //////////////////
320 // CREATOR NAME // 304 // CREATOR NAME //
@@ -341,7 +325,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
341 childSetEnabled("BtnCreator",FALSE); 325 childSetEnabled("BtnCreator",FALSE);
342 childSetEnabled("LabelCreatorTitle",FALSE); 326 childSetEnabled("LabelCreatorTitle",FALSE);
343 childSetEnabled("LabelCreatorName",FALSE); 327 childSetEnabled("LabelCreatorName",FALSE);
344 childSetText("LabelCreatorName","(unknown)"); // XUI:translate 328 childSetText("LabelCreatorName",childGetText("unknown"));
345 } 329 }
346 330
347 //////////////// 331 ////////////////
@@ -373,20 +357,22 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
373 childSetEnabled("BtnOwner",FALSE); 357 childSetEnabled("BtnOwner",FALSE);
374 childSetEnabled("LabelOwnerTitle",FALSE); 358 childSetEnabled("LabelOwnerTitle",FALSE);
375 childSetEnabled("LabelOwnerName",FALSE); 359 childSetEnabled("LabelOwnerName",FALSE);
376 childSetText("LabelOwnerName","(public)"); // XUI:translate 360 childSetText("LabelOwnerName",childGetText("public"));
377 } 361 }
378 362
379 ////////////////// 363 //////////////////
380 // ACQUIRE DATE // 364 // ACQUIRE DATE //
381 ////////////////// 365 //////////////////
366
367 // *TODO: Localize / translate this
382 time_t time_utc = (time_t)item->getCreationDate(); 368 time_t time_utc = (time_t)item->getCreationDate();
383 if (0 == time_utc) 369 if (0 == time_utc)
384 { 370 {
385 childSetText("LabelAcquiredDate","(unknown)"); 371 childSetText("LabelAcquiredDate",childGetText("unknown"));
386 } 372 }
387 else 373 else
388 { 374 {
389 childSetText("LabelAcquiredDate", ctime(&time_utc) ); 375 childSetText("LabelAcquiredDate", LLString(ctime(&time_utc)) );
390 } 376 }
391 377
392 /////////////////////// 378 ///////////////////////
@@ -394,11 +380,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
394 /////////////////////// 380 ///////////////////////
395 if(can_agent_manipulate) 381 if(can_agent_manipulate)
396 { 382 {
397 childSetText("OwnerLabel",YOU_CAN); 383 childSetText("OwnerLabel",childGetText("you_can"));
398 } 384 }
399 else 385 else
400 { 386 {
401 childSetText("OwnerLabel",OWNER_CAN); 387 childSetText("OwnerLabel",childGetText("owner_can"));
402 } 388 }
403 389
404 U32 base_mask = perm.getMaskBase(); 390 U32 base_mask = perm.getMaskBase();
@@ -433,30 +419,33 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
433 overwrite_group = flags & LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP; 419 overwrite_group = flags & LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
434 } 420 }
435 421
436 char perm_string[11]; /* Flawfinder: ignore */ 422 std::string perm_string;
437 423
438 snprintf(perm_string, sizeof(perm_string), "B: "); /* Flawfinder: ignore */ 424 perm_string = "B: ";
439 mask_to_string(base_mask, perm_string+3); 425 perm_string += mask_to_string(base_mask);
440 childSetText("BaseMaskDebug",perm_string); 426 childSetText("BaseMaskDebug",perm_string);
441 childSetVisible("BaseMaskDebug",TRUE); 427 childSetVisible("BaseMaskDebug",TRUE);
442 428
443 snprintf(perm_string, sizeof(perm_string), "O: "); /* Flawfinder: ignore */ 429 perm_string = "O: ";
444 mask_to_string(owner_mask, perm_string+3); 430 perm_string += mask_to_string(owner_mask);
445 childSetText("OwnerMaskDebug",perm_string); 431 childSetText("OwnerMaskDebug",perm_string);
446 childSetVisible("OwnerMaskDebug",TRUE); 432 childSetVisible("OwnerMaskDebug",TRUE);
447 433
448 snprintf(perm_string, sizeof(perm_string), "G%s: ", overwrite_group ? "*" : ""); /* Flawfinder: ignore */ 434 perm_string = "G";
449 mask_to_string(group_mask, perm_string + (overwrite_group ? 4 : 3)); 435 perm_string += overwrite_group ? "*: " : ": ";
436 perm_string += perm_string += mask_to_string(group_mask);
450 childSetText("GroupMaskDebug",perm_string); 437 childSetText("GroupMaskDebug",perm_string);
451 childSetVisible("GroupMaskDebug",TRUE); 438 childSetVisible("GroupMaskDebug",TRUE);
452 439
453 snprintf(perm_string, sizeof(perm_string), "E%s: ", overwrite_everyone ? "*" : ""); /* Flawfinder: ignore */ 440 perm_string = "E";
454 mask_to_string(everyone_mask, perm_string + (overwrite_everyone ? 4 : 3)); 441 perm_string += overwrite_everyone ? "*: " : ": ";
442 perm_string += mask_to_string(everyone_mask);
455 childSetText("EveryoneMaskDebug",perm_string); 443 childSetText("EveryoneMaskDebug",perm_string);
456 childSetVisible("EveryoneMaskDebug",TRUE); 444 childSetVisible("EveryoneMaskDebug",TRUE);
457 445
458 snprintf(perm_string, sizeof(perm_string), "N%s: ", slam_perm ? "*" : ""); /* Flawfinder: ignore */ 446 perm_string = "N";
459 mask_to_string(next_owner_mask, perm_string + (slam_perm ? 4 : 3)); 447 perm_string += slam_perm ? "*: " : ": ";
448 perm_string += mask_to_string(next_owner_mask);
460 childSetText("NextMaskDebug",perm_string); 449 childSetText("NextMaskDebug",perm_string);
461 childSetVisible("NextMaskDebug",TRUE); 450 childSetVisible("NextMaskDebug",TRUE);
462 } 451 }
@@ -568,14 +557,14 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
568 if (is_for_sale) 557 if (is_for_sale)
569 { 558 {
570 radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); 559 radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1);
571 char numerical_price[MAX_STRING]; /* Flawfinder: ignore */ 560 S32 numerical_price;
572 snprintf(numerical_price, MAX_STRING, "%d", sale_info.getSalePrice()); /* Flawfinder: ignore */ 561 numerical_price = sale_info.getSalePrice();
573 childSetText("EditPrice",numerical_price); 562 childSetText("EditPrice",llformat("%d",numerical_price));
574 } 563 }
575 else 564 else
576 { 565 {
577 radioSaleType->setSelectedIndex(-1); 566 radioSaleType->setSelectedIndex(-1);
578 childSetText("EditPrice",""); 567 childSetText("EditPrice",llformat("%d",0));
579 } 568 }
580} 569}
581 570