diff options
author | Jacek Antonelli | 2008-08-15 23:45:16 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:16 -0500 |
commit | 3f27ba891ac4d032753b219b4b96d1ffbc9fb488 (patch) | |
tree | 504932ee91a0356fba7ea48798887c96867e492f /linden/indra/newview/llfloateravatarinfo.cpp | |
parent | Second Life viewer sources 1.18.4.3 (diff) | |
download | meta-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/llfloateravatarinfo.cpp')
-rw-r--r-- | linden/indra/newview/llfloateravatarinfo.cpp | 150 |
1 files changed, 51 insertions, 99 deletions
diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp index c7341b6..58fe1ab 100644 --- a/linden/indra/newview/llfloateravatarinfo.cpp +++ b/linden/indra/newview/llfloateravatarinfo.cpp | |||
@@ -1,6 +1,9 @@ | |||
1 | /** | 1 | /** |
2 | * @file llfloateravatarinfo.cpp | 2 | * @file llfloateravatarinfo.cpp |
3 | * @brief LLFloaterAvatarInfo class implementation | 3 | * @brief LLFloaterAvatarInfo class implementation |
4 | * Avatar information as shown in a floating window from right-click | ||
5 | * Profile. Used for editing your own avatar info. Just a wrapper | ||
6 | * for LLPanelAvatar, shared with the Find directory. | ||
4 | * | 7 | * |
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 8 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
6 | * | 9 | * |
@@ -28,54 +31,42 @@ | |||
28 | * COMPLETENESS OR PERFORMANCE. | 31 | * COMPLETENESS OR PERFORMANCE. |
29 | * $/LicenseInfo$ | 32 | * $/LicenseInfo$ |
30 | */ | 33 | */ |
31 | |||
32 | /** | ||
33 | * Avatar information as shown in a floating window from right-click | ||
34 | * Profile. Used for editing your own avatar info. Just a wrapper | ||
35 | * for LLPanelAvatar, shared with the Find directory. | ||
36 | */ | ||
37 | |||
38 | // system includes | ||
39 | |||
40 | // linden prefix includes | ||
41 | #include "llviewerprecompiledheaders.h" | 34 | #include "llviewerprecompiledheaders.h" |
42 | 35 | ||
43 | // self include | ||
44 | #include "llfloateravatarinfo.h" | 36 | #include "llfloateravatarinfo.h" |
45 | 37 | ||
46 | // linden library includes | ||
47 | #include "llcachename.h" | ||
48 | #include "llfontgl.h" | ||
49 | #include "llinventory.h" | ||
50 | #include "message.h" | ||
51 | |||
52 | // viewer project includes | 38 | // viewer project includes |
53 | #include "llagentdata.h" | 39 | #include "llagentdata.h" |
54 | #include "llbutton.h" | 40 | //#include "llbutton.h" |
55 | #include "llcallingcard.h" | 41 | //#include "llcallingcard.h" |
56 | #include "llcheckboxctrl.h" | 42 | //#include "llcheckboxctrl.h" |
43 | //#include "llcommandhandler.h" | ||
44 | //#include "llfloaterworldmap.h" | ||
45 | //#include "llfloatermute.h" | ||
46 | //#include "llinventoryview.h" | ||
47 | //#include "lllineeditor.h" | ||
48 | //#include "llmutelist.h" | ||
49 | //#include "llscrolllistctrl.h" | ||
50 | //#include "lltabcontainer.h" | ||
51 | //#include "llimview.h" | ||
52 | //#include "lluiconstants.h" | ||
53 | //#include "llviewerobject.h" | ||
54 | //#include "llviewerobjectlist.h" | ||
55 | //#include "llviewerregion.h" | ||
56 | //#include "llviewborder.h" | ||
57 | //#include "llinventorymodel.h" | ||
58 | //#include "lltextbox.h" | ||
59 | //#include "lltexturectrl.h" | ||
60 | //#include "llviewertexteditor.h" | ||
57 | #include "llcommandhandler.h" | 61 | #include "llcommandhandler.h" |
58 | #include "llfloaterworldmap.h" | ||
59 | #include "llfloatermute.h" | ||
60 | #include "llinventoryview.h" | ||
61 | #include "lllineeditor.h" | ||
62 | #include "llmutelist.h" | ||
63 | #include "llscrolllistctrl.h" | ||
64 | #include "lltabcontainer.h" | ||
65 | #include "llimview.h" | ||
66 | #include "lluiconstants.h" | ||
67 | #include "llviewerobject.h" | ||
68 | #include "llviewerobjectlist.h" | ||
69 | #include "llviewerregion.h" | ||
70 | #include "llviewborder.h" | ||
71 | #include "llinventorymodel.h" | ||
72 | #include "lltextbox.h" | ||
73 | #include "lltexturectrl.h" | ||
74 | #include "llviewertexteditor.h" | ||
75 | #include "llpanelavatar.h" | 62 | #include "llpanelavatar.h" |
76 | |||
77 | #include "llvieweruictrlfactory.h" | 63 | #include "llvieweruictrlfactory.h" |
78 | 64 | ||
65 | // linden library includes | ||
66 | #include "llinventory.h" | ||
67 | #include "lluuid.h" | ||
68 | #include "message.h" | ||
69 | |||
79 | const char FLOATER_TITLE[] = "Profile"; | 70 | const char FLOATER_TITLE[] = "Profile"; |
80 | const LLRect FAI_RECT(0, 530, 420, 0); | 71 | const LLRect FAI_RECT(0, 530, 420, 0); |
81 | 72 | ||
@@ -100,7 +91,7 @@ public: | |||
100 | 91 | ||
101 | if (params[1] == "about") | 92 | if (params[1] == "about") |
102 | { | 93 | { |
103 | LLFloaterAvatarInfo::showFromDirectory(agent_id); | 94 | LLFloaterAvatarInfo::show(agent_id); |
104 | return true; | 95 | return true; |
105 | } | 96 | } |
106 | return false; | 97 | return false; |
@@ -172,79 +163,52 @@ void LLFloaterAvatarInfo::resetGroupList() | |||
172 | mPanelAvatarp->resetGroupList(); | 163 | mPanelAvatarp->resetGroupList(); |
173 | } | 164 | } |
174 | 165 | ||
175 | |||
176 | // Open profile to a certian tab. | ||
177 | // static | 166 | // static |
178 | void LLFloaterAvatarInfo::showFromObject( | 167 | LLFloaterAvatarInfo* LLFloaterAvatarInfo::show(const LLUUID &avatar_id) |
179 | const LLUUID& avatar_id, | ||
180 | std::string tab_name) | ||
181 | { | 168 | { |
182 | if(avatar_id.isNull()) | 169 | if (avatar_id.isNull()) |
183 | { | 170 | { |
184 | return; | 171 | return NULL; |
185 | } | 172 | } |
186 | 173 | ||
187 | LLFloaterAvatarInfo *floater = NULL; | 174 | LLFloaterAvatarInfo *floater; |
188 | if (gAvatarInfoInstances.checkData(avatar_id)) | 175 | if (gAvatarInfoInstances.checkData(avatar_id)) |
189 | { | 176 | { |
190 | // ...bring that window to front | 177 | // ...bring that window to front |
191 | floater = gAvatarInfoInstances.getData(avatar_id); | 178 | floater = gAvatarInfoInstances.getData(avatar_id); |
179 | floater->open(); /*Flawfinder: ignore*/ | ||
192 | } | 180 | } |
193 | else | 181 | else |
194 | { | 182 | { |
195 | floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, | 183 | floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, |
196 | avatar_id); | 184 | avatar_id ); |
197 | floater->center(); | 185 | floater->center(); |
198 | floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); | 186 | floater->open(); /*Flawfinder: ignore*/ |
199 | |||
200 | } | 187 | } |
201 | floater->mPanelAvatarp->selectTabByName(tab_name); | 188 | return floater; |
202 | floater->open(); /*Flawfinder: ignore*/ | ||
203 | } | 189 | } |
204 | 190 | ||
191 | // Open profile to a certain tab. | ||
205 | // static | 192 | // static |
206 | void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id) | 193 | void LLFloaterAvatarInfo::showFromObject( |
194 | const LLUUID& avatar_id, | ||
195 | std::string tab_name) | ||
207 | { | 196 | { |
208 | if(avatar_id.isNull()) | 197 | LLFloaterAvatarInfo *floater = show(avatar_id); |
198 | if (floater) | ||
209 | { | 199 | { |
210 | return; | ||
211 | } | ||
212 | |||
213 | LLFloaterAvatarInfo *floater; | ||
214 | if (gAvatarInfoInstances.checkData(avatar_id)) | ||
215 | { | ||
216 | // ...bring that window to front | ||
217 | floater = gAvatarInfoInstances.getData(avatar_id); | ||
218 | } | ||
219 | else | ||
220 | { | ||
221 | floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, | ||
222 | avatar_id); | ||
223 | floater->center(); | ||
224 | floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); | 200 | floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); |
225 | } | 201 | floater->mPanelAvatarp->selectTabByName(tab_name); |
226 | if(floater) | ||
227 | { | ||
228 | floater->open(); | ||
229 | } | 202 | } |
230 | } | 203 | } |
231 | 204 | ||
232 | |||
233 | // static | 205 | // static |
234 | void LLFloaterAvatarInfo::showFromAvatar(LLViewerObject *avatar) | 206 | void LLFloaterAvatarInfo::showFromDirectory(const LLUUID &avatar_id) |
235 | { | 207 | { |
236 | if (gAvatarInfoInstances.checkData(avatar->getID())) | 208 | LLFloaterAvatarInfo *floater = show(avatar_id); |
237 | { | 209 | if (floater) |
238 | // ...bring that window to front | ||
239 | LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData(avatar->getID()); | ||
240 | f->open(); /*Flawfinder: ignore*/ | ||
241 | } | ||
242 | else | ||
243 | { | 210 | { |
244 | LLFloaterAvatarInfo *floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, | 211 | floater->mPanelAvatarp->setAvatarID(avatar_id, "", ONLINE_STATUS_NO); |
245 | avatar->getID() ); | ||
246 | floater->center(); | ||
247 | floater->open(); /*Flawfinder: ignore*/ | ||
248 | } | 212 | } |
249 | } | 213 | } |
250 | 214 | ||
@@ -252,21 +216,9 @@ void LLFloaterAvatarInfo::showFromAvatar(LLViewerObject *avatar) | |||
252 | // static | 216 | // static |
253 | void LLFloaterAvatarInfo::showFromFriend(const LLUUID& agent_id, BOOL online) | 217 | void LLFloaterAvatarInfo::showFromFriend(const LLUUID& agent_id, BOOL online) |
254 | { | 218 | { |
255 | if(agent_id.isNull()) | 219 | LLFloaterAvatarInfo *floater = show(agent_id); |
220 | if (floater) | ||
256 | { | 221 | { |
257 | return; | ||
258 | } | ||
259 | if (gAvatarInfoInstances.checkData( agent_id )) | ||
260 | { | ||
261 | // ...bring that window to front | ||
262 | LLFloaterAvatarInfo *f = gAvatarInfoInstances.getData( agent_id ); | ||
263 | f->open(); /*Flawfinder: ignore*/ | ||
264 | } | ||
265 | else | ||
266 | { | ||
267 | LLFloaterAvatarInfo *floater = new LLFloaterAvatarInfo("avatarinfo", FAI_RECT, | ||
268 | agent_id); | ||
269 | floater->center(); | ||
270 | floater->mSuggestedOnlineStatus = online ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; | 222 | floater->mSuggestedOnlineStatus = online ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; |
271 | } | 223 | } |
272 | } | 224 | } |