aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaternewim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaternewim.cpp')
-rw-r--r--linden/indra/newview/llfloaternewim.cpp63
1 files changed, 46 insertions, 17 deletions
diff --git a/linden/indra/newview/llfloaternewim.cpp b/linden/indra/newview/llfloaternewim.cpp
index 4288209..2fa2b51 100644
--- a/linden/indra/newview/llfloaternewim.cpp
+++ b/linden/indra/newview/llfloaternewim.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -96,18 +97,44 @@ void LLFloaterNewIM::clearAllTargets()
96 mSelectionList->deleteAllItems(); 97 mSelectionList->deleteAllItems();
97} 98}
98 99
99void LLFloaterNewIM::addTarget(const LLUUID& uuid, const std::string& name, 100void LLFloaterNewIM::addSpecial(const LLUUID& uuid, const std::string& name,
100 void* data, BOOL bold, BOOL online) 101 void* data, BOOL bold, BOOL online)
101{ 102{
102 LLScrollListItem* item = new LLScrollListItem(TRUE, data, uuid); 103 LLSD row;
104 row["id"] = uuid;
105 row["name"] = name;
106 row["target"] = "SPECIAL";
107 row["columns"][0]["value"] = name;
108 row["columns"][0]["width"] = COL_1_WIDTH;
109 row["columns"][0]["font"] = "SANSSERIF";
110 row["columns"][0]["font-style"] = bold ? "BOLD" : "NORMAL";
111 row["columns"][1]["value"] = online ? sOnlineDescriptor : "";
112 row["columns"][1]["font"] = "SANSSERIF";
113 row["columns"][1]["font-style"] = "BOLD";
114 LLScrollListItem* itemp = mSelectionList->addElement(row);
115 itemp->setUserdata(data);
103 116
104 item->addColumn(name, bold ? LLFontGL::sSansSerifBold : LLFontGL::sSansSerif, COL_1_WIDTH); 117 if (mSelectionList->getFirstSelectedIndex() == -1)
105 if( online )
106 { 118 {
107 item->addColumn(sOnlineDescriptor, LLFontGL::sSansSerifBold); 119 mSelectionList->selectFirstItem();
108 } 120 }
121}
122
123void LLFloaterNewIM::addGroup(const LLUUID& uuid, void* data, BOOL bold, BOOL online)
124{
125 LLSD row;
126 row["id"] = uuid;
127 row["target"] = "GROUP";
128 row["columns"][0]["value"] = ""; // name will be looked up
129 row["columns"][0]["width"] = COL_1_WIDTH;
130 row["columns"][0]["font"] = "SANSSERIF";
131 row["columns"][0]["font-style"] = bold ? "BOLD" : "NORMAL";
132 row["columns"][1]["value"] = online ? sOnlineDescriptor : "";
133 row["columns"][1]["font"] = "SANSSERIF";
134 row["columns"][1]["font-style"] = "BOLD";
135 LLScrollListItem* itemp = mSelectionList->addElement(row);
136 itemp->setUserdata(data);
109 137
110 mSelectionList->addItem(item);
111 if (mSelectionList->getFirstSelectedIndex() == -1) 138 if (mSelectionList->getFirstSelectedIndex() == -1)
112 { 139 {
113 mSelectionList->selectFirstItem(); 140 mSelectionList->selectFirstItem();
@@ -116,7 +143,6 @@ void LLFloaterNewIM::addTarget(const LLUUID& uuid, const std::string& name,
116 143
117void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online) 144void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online)
118{ 145{
119 LLScrollListItem* item = new LLScrollListItem(TRUE, data, uuid);
120 char first[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ 146 char first[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
121 first[0] = '\0'; 147 first[0] = '\0';
122 char last[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ 148 char last[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
@@ -125,16 +151,19 @@ void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online)
125 LLUIString fullname = sNameFormat; 151 LLUIString fullname = sNameFormat;
126 fullname.setArg("[FIRST]", first); 152 fullname.setArg("[FIRST]", first);
127 fullname.setArg("[LAST]", last); 153 fullname.setArg("[LAST]", last);
128 item->addColumn( 154
129 fullname, 155 LLSD row;
130 online ? LLFontGL::sSansSerifBold : LLFontGL::sSansSerif, 156 row["id"] = uuid;
131 COL_1_WIDTH, 157 row["columns"][0]["value"] = fullname;
132 FALSE); 158 row["columns"][0]["width"] = COL_1_WIDTH;
133 if(online) 159 row["columns"][0]["font"] = "SANSSERIF";
134 { 160 row["columns"][0]["font-style"] = online ? "BOLD" : "NORMAL";
135 item->addColumn(sOnlineDescriptor, LLFontGL::sSansSerifBold); 161 row["columns"][1]["value"] = online ? sOnlineDescriptor : "";
136 } 162 row["columns"][1]["font"] = "SANSSERIF";
137 mSelectionList->addItem(item, ADD_BOTTOM); 163 row["columns"][1]["font-style"] = "BOLD";
164 LLScrollListItem* itemp = mSelectionList->addElement(row);
165 itemp->setUserdata(data);
166
138 if (mSelectionList->getFirstSelectedIndex() == -1) 167 if (mSelectionList->getFirstSelectedIndex() == -1)
139 { 168 {
140 mSelectionList->selectFirstItem(); 169 mSelectionList->selectFirstItem();