aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llalertdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/llalertdialog.cpp47
1 files changed, 42 insertions, 5 deletions
diff --git a/linden/indra/llui/llalertdialog.cpp b/linden/indra/llui/llalertdialog.cpp
index fd0262d..204fb10 100644
--- a/linden/indra/llui/llalertdialog.cpp
+++ b/linden/indra/llui/llalertdialog.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -41,6 +41,7 @@
41#include "llcheckboxctrl.h" 41#include "llcheckboxctrl.h"
42#include "llkeyboard.h" 42#include "llkeyboard.h"
43#include "llfocusmgr.h" 43#include "llfocusmgr.h"
44#include "lliconctrl.h"
44#include "llui.h" 45#include "llui.h"
45#include "llxmlnode.h" 46#include "llxmlnode.h"
46#include "lllineeditor.h" 47#include "lllineeditor.h"
@@ -143,6 +144,7 @@ LLAlertDialog::LLAlertDialog( const LLAlertDialogTemplate* xml_template,
143 mDefaultOption( 0 ), 144 mDefaultOption( 0 ),
144 mOptionChosen( -1 ), 145 mOptionChosen( -1 ),
145 mCheck(NULL), 146 mCheck(NULL),
147 mCaution(xml_template->mCaution),
146 mUnique(xml_template->mUnique), 148 mUnique(xml_template->mUnique),
147 mIgnorable(xml_template->mIgnorable), 149 mIgnorable(xml_template->mIgnorable),
148 mLabel(xml_template->mLabel), 150 mLabel(xml_template->mLabel),
@@ -211,6 +213,16 @@ bool LLAlertDialog::show()
211 } 213 }
212 } 214 }
213 215
216 // If this is a caution message, change the color and add an icon.
217 if (mCaution)
218 {
219 setBackgroundColor( LLUI::sColorsGroup->getColor( "AlertCautionBoxColor" ) );
220 }
221 else
222 {
223 setBackgroundColor( LLUI::sColorsGroup->getColor( "AlertBoxColor" ) );
224 }
225
214 // Check to see if we are already displaying the alert 226 // Check to see if we are already displaying the alert
215 if (mUnique) 227 if (mUnique)
216 { 228 {
@@ -311,19 +323,35 @@ void LLAlertDialog::createDialog(const std::vector<LLString>* optionsp, S32 defa
311 dialog_width = llmax(dialog_width, S32(font->getWidth( edit_text ) + 0.99f)); 323 dialog_width = llmax(dialog_width, S32(font->getWidth( edit_text ) + 0.99f));
312 dialog_height += EDITOR_HEIGHT; 324 dialog_height += EDITOR_HEIGHT;
313 } 325 }
314 326 if (mCaution)
327 {
328 // Make room for the caution icon.
329 dialog_width += 32 + HPAD;
330 }
315 reshape( dialog_width, dialog_height, FALSE ); 331 reshape( dialog_width, dialog_height, FALSE );
316 332
317 S32 msg_y = mRect.getHeight() - VPAD; 333 S32 msg_y = mRect.getHeight() - VPAD;
334 S32 msg_x = HPAD;
318 if (hasTitleBar()) 335 if (hasTitleBar())
319 { 336 {
320 msg_y -= LINE_HEIGHT; // room for title 337 msg_y -= LINE_HEIGHT; // room for title
321 } 338 }
322 339
340 if (mCaution)
341 {
342 LLIconCtrl* icon = new LLIconCtrl("icon", LLRect(msg_x, msg_y, msg_x+32, msg_y-32), "notify_caution_icon.tga");
343 icon->setMouseOpaque(FALSE);
344 addChild(icon);
345 msg_x += 32 + HPAD;
346 msg_box->setColor( LLUI::sColorsGroup->getColor( "AlertCautionTextColor" ) );
347 }
348 else
349 {
350 msg_box->setColor( LLUI::sColorsGroup->getColor( "AlertTextColor" ) );
351 }
323 LLRect rect; 352 LLRect rect;
324 rect.setLeftTopAndSize( HPAD, msg_y, text_rect.getWidth(), text_rect.getHeight() ); 353 rect.setLeftTopAndSize( msg_x, msg_y, text_rect.getWidth(), text_rect.getHeight() );
325 msg_box->setRect( rect ); 354 msg_box->setRect( rect );
326 msg_box->setColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) );
327 addChild(msg_box); 355 addChild(msg_box);
328 356
329 // Buttons 357 // Buttons
@@ -688,6 +716,15 @@ bool LLAlertDialog::parseAlerts(const LLString& xml_filename, LLControlGroup* se
688 xml_template->mModal = modal; 716 xml_template->mModal = modal;
689 } 717 }
690 } 718 }
719 // caution=
720 BOOL caution;
721 if (alert->getAttributeBOOL("caution", caution))
722 {
723 if (xml_template)
724 {
725 xml_template->mCaution = caution;
726 }
727 }
691 // unique= 728 // unique=
692 BOOL unique; 729 BOOL unique;
693 if (alert->getAttributeBOOL("unique", unique)) 730 if (alert->getAttributeBOOL("unique", unique))