aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelevent.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llpanelevent.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to 'linden/indra/newview/llpanelevent.cpp')
-rw-r--r--linden/indra/newview/llpanelevent.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/linden/indra/newview/llpanelevent.cpp b/linden/indra/newview/llpanelevent.cpp
index 1f2fb37..7812a48 100644
--- a/linden/indra/newview/llpanelevent.cpp
+++ b/linden/indra/newview/llpanelevent.cpp
@@ -2,6 +2,8 @@
2 * @file llpanelevent.cpp 2 * @file llpanelevent.cpp
3 * @brief Display for events in the finder 3 * @brief Display for events in the finder
4 * 4 *
5 * $LicenseInfo:firstyear=2004&license=viewergpl$
6 *
5 * Copyright (c) 2004-2007, Linden Research, Inc. 7 * Copyright (c) 2004-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"
@@ -73,8 +76,7 @@ BOOL LLPanelEvent::postBuild()
73 mTBCategory = LLViewerUICtrlFactory::getTextBoxByName(this, "event_category"); 76 mTBCategory = LLViewerUICtrlFactory::getTextBoxByName(this, "event_category");
74 mTBCategory->setColor(gColors.getColor( "LabelSelectedColor" )); 77 mTBCategory->setColor(gColors.getColor( "LabelSelectedColor" ));
75 78
76 mMatureText = LLViewerUICtrlFactory::getTextBoxByName(this, "event_mature"); 79 childSetColor("event_mature", gColors.getColor( "LabelSelectedColor" ));
77 mMatureText->setColor(gColors.getColor( "LabelSelectedColor" ));
78 80
79 mTBDate = LLViewerUICtrlFactory::getTextBoxByName(this, "event_date"); 81 mTBDate = LLViewerUICtrlFactory::getTextBoxByName(this, "event_date");
80 mTBDate->setColor(gColors.getColor( "LabelSelectedColor" )); 82 mTBDate->setColor(gColors.getColor( "LabelSelectedColor" ));
@@ -165,26 +167,21 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
165 { 167 {
166 continue; 168 continue;
167 } 169 }
168 char buffer[256]; /*Flawfinder: ignore*/
169
170 self->mEventInfo.unpack(msg); 170 self->mEventInfo.unpack(msg);
171 self->mTBName->setText(self->mEventInfo.mName); 171 self->mTBName->setText(self->mEventInfo.mName);
172 self->mTBCategory->setText(self->mEventInfo.mCategoryStr); 172 self->mTBCategory->setText(self->mEventInfo.mCategoryStr);
173 self->mTBDate->setText(self->mEventInfo.mTimeStr); 173 self->mTBDate->setText(self->mEventInfo.mTimeStr);
174 self->mTBDesc->setText(self->mEventInfo.mDesc); 174 self->mTBDesc->setText(self->mEventInfo.mDesc);
175 175
176 snprintf(buffer, sizeof(buffer), "%d:%.2d", self->mEventInfo.mDuration / 60, self->mEventInfo.mDuration % 60); /* Flawfinder: ignore */ 176 self->mTBDuration->setText(llformat("%d:%.2d", self->mEventInfo.mDuration / 60, self->mEventInfo.mDuration % 60));
177
178 self->mTBDuration->setText(buffer);
179 177
180 if (!self->mEventInfo.mHasCover) 178 if (!self->mEventInfo.mHasCover)
181 { 179 {
182 self->mTBCover->setText("none"); 180 self->mTBCover->setText(self->childGetText("none"));
183 } 181 }
184 else 182 else
185 { 183 {
186 snprintf(buffer, sizeof(buffer), "%d", self->mEventInfo.mCover); /* Flawfinder: ignore */ 184 self->mTBCover->setText(llformat("%d", self->mEventInfo.mCover));
187 self->mTBCover->setText(buffer);
188 } 185 }
189 186
190 F32 global_x = (F32)self->mEventInfo.mPosGlobal.mdV[VX]; 187 F32 global_x = (F32)self->mEventInfo.mPosGlobal.mdV[VX];
@@ -194,16 +191,18 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
194 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; 191 S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
195 S32 region_z = llround((F32)self->mEventInfo.mPosGlobal.mdV[VZ]); 192 S32 region_z = llround((F32)self->mEventInfo.mPosGlobal.mdV[VZ]);
196 193
197 snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", self->mEventInfo.mSimName.c_str(), region_x, region_y, region_z); /* Flawfinder: ignore */ 194 LLString desc = self->mEventInfo.mSimName + llformat(" (%d, %d, %d)", region_x, region_y, region_z);
198 self->mTBLocation->setText(buffer); 195 self->mTBLocation->setText(desc);
199 196
200 if (self->mEventInfo.mEventFlags & EVENT_FLAG_MATURE) 197 if (self->mEventInfo.mEventFlags & EVENT_FLAG_MATURE)
201 { 198 {
202 self->mMatureText->setText("Yes"); 199 self->childSetVisible("event_mature_yes", TRUE);
200 self->childSetVisible("event_mature_no", FALSE);
203 } 201 }
204 else 202 else
205 { 203 {
206 self->mMatureText->setText("No"); 204 self->childSetVisible("event_mature_yes", FALSE);
205 self->childSetVisible("event_mature_no", TRUE);
207 } 206 }
208 207
209 if (self->mEventInfo.mUnixTime < time_corrected()) 208 if (self->mEventInfo.mUnixTime < time_corrected())
@@ -217,13 +216,11 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
217 216
218 if (gEventNotifier.hasNotification(self->mEventInfo.mID)) 217 if (gEventNotifier.hasNotification(self->mEventInfo.mID))
219 { 218 {
220 self->mNotifyBtn->setLabelSelected("Don't Notify"); 219 self->mNotifyBtn->setLabel(self->childGetText("dont_notify"));
221 self->mNotifyBtn->setLabelUnselected("Don't Notify");
222 } 220 }
223 else 221 else
224 { 222 {
225 self->mNotifyBtn->setLabelSelected("Notify"); 223 self->mNotifyBtn->setLabel(self->childGetText("notify"));
226 self->mNotifyBtn->setLabelUnselected("Notify");
227 } 224 }
228 } 225 }
229} 226}
@@ -315,14 +312,12 @@ void LLPanelEvent::onClickNotify(void *data)
315 if (!gEventNotifier.hasNotification(self->mEventID)) 312 if (!gEventNotifier.hasNotification(self->mEventID))
316 { 313 {
317 gEventNotifier.add(self->mEventInfo); 314 gEventNotifier.add(self->mEventInfo);
318 self->mNotifyBtn->setLabelSelected("Don't Notify"); 315 self->mNotifyBtn->setLabel(self->childGetText("dont_notify"));
319 self->mNotifyBtn->setLabelUnselected("Don't Notify");
320 } 316 }
321 else 317 else
322 { 318 {
323 gEventNotifier.remove(self->mEventInfo.mID); 319 gEventNotifier.remove(self->mEventInfo.mID);
324 self->mNotifyBtn->setLabelSelected("Notify"); 320 self->mNotifyBtn->setLabel(self->childGetText("notify"));
325 self->mNotifyBtn->setLabelUnselected("Notify");
326 } 321 }
327} 322}
328 323