aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelgroupnotices.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llpanelgroupnotices.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanelgroupnotices.cpp45
1 files changed, 22 insertions, 23 deletions
diff --git a/linden/indra/newview/llpanelgroupnotices.cpp b/linden/indra/newview/llpanelgroupnotices.cpp
index 846a4c1..30a9c5b 100644
--- a/linden/indra/newview/llpanelgroupnotices.cpp
+++ b/linden/indra/newview/llpanelgroupnotices.cpp
@@ -80,7 +80,7 @@ public:
80 EDragAndDropType cargo_type, 80 EDragAndDropType cargo_type,
81 void* cargo_data, 81 void* cargo_data,
82 EAcceptance* accept, 82 EAcceptance* accept,
83 LLString& tooltip_msg); 83 std::string& tooltip_msg);
84protected: 84protected:
85 LLPanelGroupNotices* mGroupNoticesPanel; 85 LLPanelGroupNotices* mGroupNoticesPanel;
86 LLUUID mGroupID; 86 LLUUID mGroupID;
@@ -103,7 +103,7 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
103 EDragAndDropType cargo_type, 103 EDragAndDropType cargo_type,
104 void* cargo_data, 104 void* cargo_data,
105 EAcceptance* accept, 105 EAcceptance* accept,
106 LLString& tooltip_msg) 106 std::string& tooltip_msg)
107{ 107{
108 BOOL handled = FALSE; 108 BOOL handled = FALSE;
109 109
@@ -168,14 +168,14 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
168//----------------------------------------------------------------------------- 168//-----------------------------------------------------------------------------
169// LLPanelGroupNotices 169// LLPanelGroupNotices
170//----------------------------------------------------------------------------- 170//-----------------------------------------------------------------------------
171char* build_notice_date(const time_t& the_time, char* buffer) 171std::string build_notice_date(const time_t& the_time)
172{ 172{
173 time_t t = the_time; 173 time_t t = the_time;
174 if (!t) time(&t); 174 if (!t) time(&t);
175 tm* lt = localtime(&t); 175 tm* lt = localtime(&t);
176 //for some reason, the month is off by 1. See other uses of 176 //for some reason, the month is off by 1. See other uses of
177 //"local" time in the code... 177 //"local" time in the code...
178 snprintf(buffer, NOTICE_DATE_STRING_SIZE, "%i/%i/%i", lt->tm_mon + 1, lt->tm_mday, lt->tm_year + 1900); /*Flawfinder: ignore*/ 178 std::string buffer = llformat("%i/%i/%i", lt->tm_mon + 1, lt->tm_mday, lt->tm_year + 1900);
179 return buffer; 179 return buffer;
180} 180}
181 181
@@ -316,7 +316,7 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item)
316 item_is_multi = TRUE; 316 item_is_multi = TRUE;
317 }; 317 };
318 318
319 LLString icon_name = get_item_icon_name(inv_item->getType(), 319 std::string icon_name = get_item_icon_name(inv_item->getType(),
320 inv_item->getInventoryType(), 320 inv_item->getInventoryType(),
321 inv_item->getFlags(), 321 inv_item->getFlags(),
322 item_is_multi ); 322 item_is_multi );
@@ -362,8 +362,8 @@ void LLPanelGroupNotices::onClickSendMessage(void* data)
362 } 362 }
363 send_group_notice( 363 send_group_notice(
364 self->mGroupID, 364 self->mGroupID,
365 self->mCreateSubject->getText().c_str(), 365 self->mCreateSubject->getText(),
366 self->mCreateMessage->getText().c_str(), 366 self->mCreateMessage->getText(),
367 self->mInventoryItem); 367 self->mInventoryItem);
368 368
369 self->mCreateMessage->clear(); 369 self->mCreateMessage->clear();
@@ -442,8 +442,8 @@ void LLPanelGroupNotices::processGroupNoticesListReply(LLMessageSystem* msg, voi
442void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) 442void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
443{ 443{
444 LLUUID id; 444 LLUUID id;
445 char subj[MAX_STRING]; /*Flawfinder: ignore*/ 445 std::string subj;
446 char name[MAX_STRING]; /*Flawfinder: ignore*/ 446 std::string name;
447 U32 timestamp; 447 U32 timestamp;
448 BOOL has_attachment; 448 BOOL has_attachment;
449 U8 asset_type; 449 U8 asset_type;
@@ -461,8 +461,8 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
461 return; 461 return;
462 } 462 }
463 463
464 msg->getString("Data","Subject",MAX_STRING,subj,i); 464 msg->getString("Data","Subject",subj,i);
465 msg->getString("Data","FromName",MAX_STRING,name,i); 465 msg->getString("Data","FromName",name,i);
466 msg->getBOOL("Data","HasAttachment",has_attachment,i); 466 msg->getBOOL("Data","HasAttachment",has_attachment,i);
467 msg->getU8("Data","AssetType",asset_type,i); 467 msg->getU8("Data","AssetType",asset_type,i);
468 msg->getU32("Data","Timestamp",timestamp,i); 468 msg->getU32("Data","Timestamp",timestamp,i);
@@ -474,7 +474,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
474 row["columns"][0]["column"] = "icon"; 474 row["columns"][0]["column"] = "icon";
475 if (has_attachment) 475 if (has_attachment)
476 { 476 {
477 LLString icon_name = get_item_icon_name( 477 std::string icon_name = get_item_icon_name(
478 (LLAssetType::EType)asset_type, 478 (LLAssetType::EType)asset_type,
479 LLInventoryType::IT_NONE,FALSE, FALSE); 479 LLInventoryType::IT_NONE,FALSE, FALSE);
480 row["columns"][0]["type"] = "icon"; 480 row["columns"][0]["type"] = "icon";
@@ -487,12 +487,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
487 row["columns"][2]["column"] = "from"; 487 row["columns"][2]["column"] = "from";
488 row["columns"][2]["value"] = name; 488 row["columns"][2]["value"] = name;
489 489
490 char buffer[NOTICE_DATE_STRING_SIZE]; /*Flawfinder: ignore*/ 490 std::string buffer = build_notice_date(t);
491 build_notice_date(t, buffer);
492 row["columns"][3]["column"] = "date"; 491 row["columns"][3]["column"] = "date";
493 row["columns"][3]["value"] = buffer; 492 row["columns"][3]["value"] = buffer;
494 493
495 snprintf(buffer, 30, "%u", timestamp); /* Flawfinder: ignore */ 494 buffer = llformat( "%u", timestamp);
496 row["columns"][4]["column"] = "sort"; 495 row["columns"][4]["column"] = "sort";
497 row["columns"][4]["value"] = buffer; 496 row["columns"][4]["value"] = buffer;
498 497
@@ -522,16 +521,16 @@ void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data)
522 lldebugs << "Item " << item->getUUID() << " selected." << llendl; 521 lldebugs << "Item " << item->getUUID() << " selected." << llendl;
523} 522}
524 523
525void LLPanelGroupNotices::showNotice(const char* subject, 524void LLPanelGroupNotices::showNotice(const std::string& subject,
526 const char* message, 525 const std::string& message,
527 const bool& has_inventory, 526 const bool& has_inventory,
528 const char* inventory_name, 527 const std::string& inventory_name,
529 LLOfferInfo* inventory_offer) 528 LLOfferInfo* inventory_offer)
530{ 529{
531 arrangeNoticeView(VIEW_PAST_NOTICE); 530 arrangeNoticeView(VIEW_PAST_NOTICE);
532 531
533 if(mViewSubject) mViewSubject->setText(LLString(subject)); 532 if(mViewSubject) mViewSubject->setText(subject);
534 if(mViewMessage) mViewMessage->setText(LLString(message)); 533 if(mViewMessage) mViewMessage->setText(message);
535 534
536 if (mInventoryOffer) 535 if (mInventoryOffer)
537 { 536 {
@@ -544,7 +543,7 @@ void LLPanelGroupNotices::showNotice(const char* subject,
544 { 543 {
545 mInventoryOffer = inventory_offer; 544 mInventoryOffer = inventory_offer;
546 545
547 LLString icon_name = get_item_icon_name(mInventoryOffer->mType, 546 std::string icon_name = get_item_icon_name(mInventoryOffer->mType,
548 LLInventoryType::IT_TEXTURE, 547 LLInventoryType::IT_TEXTURE,
549 0, FALSE); 548 0, FALSE);
550 549