aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llnotify.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llnotify.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp
index 17aff78..f703736 100644
--- a/linden/indra/newview/llnotify.cpp
+++ b/linden/indra/newview/llnotify.cpp
@@ -63,7 +63,7 @@ const F32 ANIMATION_TIME = 0.333f;
63S32 LLNotifyBox::sNotifyBoxCount = 0; 63S32 LLNotifyBox::sNotifyBoxCount = 0;
64const LLFontGL* LLNotifyBox::sFont = NULL; 64const LLFontGL* LLNotifyBox::sFont = NULL;
65const LLFontGL* LLNotifyBox::sFontSmall = NULL; 65const LLFontGL* LLNotifyBox::sFontSmall = NULL;
66std::map<LLString, LLNotifyBox*> LLNotifyBox::sOpenUniqueNotifyBoxes; 66std::map<std::string, LLNotifyBox*> LLNotifyBox::sOpenUniqueNotifyBoxes;
67LLPointer<LLNotifyBoxTemplate> LLNotifyBox::sDefaultTemplate; 67LLPointer<LLNotifyBoxTemplate> LLNotifyBox::sDefaultTemplate;
68 68
69 69
@@ -80,14 +80,14 @@ LLNotifyBox::LLNotifyBehavior::LLNotifyBehavior(notify_callback_t callback, void
80//--------------------------------------------------------------------------- 80//---------------------------------------------------------------------------
81 81
82//static 82//static
83LLNotifyBox* LLNotifyBox::showXml( const LLString& xml_desc, notify_callback_t callback, void *user_data) 83LLNotifyBox* LLNotifyBox::showXml( const std::string& xml_desc, notify_callback_t callback, void *user_data)
84{ 84{
85 return showXml(xml_desc, LLString::format_map_t(), callback, user_data); 85 return showXml(xml_desc, LLStringUtil::format_map_t(), callback, user_data);
86} 86}
87 87
88 88
89//static 89//static
90LLNotifyBox* LLNotifyBox::showXml( const LLString& xml_desc, const LLString::format_map_t& args, BOOL is_caution, 90LLNotifyBox* LLNotifyBox::showXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args, BOOL is_caution,
91 notify_callback_t callback, void *user_data) 91 notify_callback_t callback, void *user_data)
92{ 92{
93 // for script permission prompts 93 // for script permission prompts
@@ -108,7 +108,7 @@ LLNotifyBox* LLNotifyBox::showXml( const LLString& xml_desc, const LLString::for
108} 108}
109 109
110//static 110//static
111LLNotifyBox* LLNotifyBox::showXml( const LLString& xml_desc, const LLString::format_map_t& args, 111LLNotifyBox* LLNotifyBox::showXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args,
112 notify_callback_t callback, void *user_data) 112 notify_callback_t callback, void *user_data)
113{ 113{
114 LLPointer<LLNotifyBoxTemplate> xml_template = getTemplate(xml_desc); 114 LLPointer<LLNotifyBoxTemplate> xml_template = getTemplate(xml_desc);
@@ -128,7 +128,7 @@ LLNotifyBox* LLNotifyBox::showXml( const LLString& xml_desc, const LLString::for
128} 128}
129 129
130//static 130//static
131LLNotifyBox* LLNotifyBox::showXml( const LLString& xml_desc, const LLString::format_map_t& args, 131LLNotifyBox* LLNotifyBox::showXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args,
132 notify_callback_t callback, void *user_data, 132 notify_callback_t callback, void *user_data,
133 const option_list_t& options, 133 const option_list_t& options,
134 BOOL layout_script_dialog) 134 BOOL layout_script_dialog)
@@ -149,11 +149,11 @@ LLNotifyBox* LLNotifyBox::showXml( const LLString& xml_desc, const LLString::for
149} 149}
150 150
151//static 151//static
152LLNotifyBox* LLNotifyBox::findExistingNotify(LLPointer<LLNotifyBoxTemplate> notify_template, const LLString::format_map_t &args) 152LLNotifyBox* LLNotifyBox::findExistingNotify(LLPointer<LLNotifyBoxTemplate> notify_template, const LLStringUtil::format_map_t &args)
153{ 153{
154 if(notify_template->mUnique) 154 if(notify_template->mUnique)
155 { 155 {
156 LLString message = notify_template->mMessage; 156 std::string message = notify_template->mMessage;
157 format(message, args); 157 format(message, args);
158 unique_map_t::iterator found_it = sOpenUniqueNotifyBoxes.find(notify_template->mLabel + message); 158 unique_map_t::iterator found_it = sOpenUniqueNotifyBoxes.find(notify_template->mLabel + message);
159 if (found_it != sOpenUniqueNotifyBoxes.end()) 159 if (found_it != sOpenUniqueNotifyBoxes.end())
@@ -172,7 +172,7 @@ void LLNotifyBox::cleanup()
172 172
173//--------------------------------------------------------------------------- 173//---------------------------------------------------------------------------
174 174
175LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLString::format_map_t& args, 175LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLStringUtil::format_map_t& args,
176 notify_callback_t callback, void* user_data, BOOL is_caution, 176 notify_callback_t callback, void* user_data, BOOL is_caution,
177 const option_list_t& extra_options, 177 const option_list_t& extra_options,
178 BOOL layout_script_dialog) 178 BOOL layout_script_dialog)
@@ -250,17 +250,17 @@ LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLSt
250 if (mIsTip) 250 if (mIsTip)
251 { 251 {
252 // use the tip notification icon 252 // use the tip notification icon
253 icon = new LLIconCtrl("icon", LLRect(x, y, x+32, TOP-32), "notify_tip_icon.tga"); 253 icon = new LLIconCtrl(std::string("icon"), LLRect(x, y, x+32, TOP-32), std::string("notify_tip_icon.tga"));
254 } 254 }
255 else if (mIsCaution) 255 else if (mIsCaution)
256 { 256 {
257 // use the caution notification icon 257 // use the caution notification icon
258 icon = new LLIconCtrl("icon", LLRect(x, y, x+32, TOP-32), "notify_caution_icon.tga"); 258 icon = new LLIconCtrl(std::string("icon"), LLRect(x, y, x+32, TOP-32), std::string("notify_caution_icon.tga"));
259 } 259 }
260 else 260 else
261 { 261 {
262 // use the default notification icon 262 // use the default notification icon
263 icon = new LLIconCtrl("icon", LLRect(x, y, x+32, TOP-32), "notify_box_icon.tga"); 263 icon = new LLIconCtrl(std::string("icon"), LLRect(x, y, x+32, TOP-32), std::string("notify_box_icon.tga"));
264 } 264 }
265 265
266 icon->setMouseOpaque(FALSE); 266 icon->setMouseOpaque(FALSE);
@@ -274,9 +274,9 @@ LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLSt
274 { 274 {
275 S32 caution_height = ((S32)sFont->getLineHeight() * 2) + VPAD; 275 S32 caution_height = ((S32)sFont->getLineHeight() * 2) + VPAD;
276 caution_box = new LLTextBox( 276 caution_box = new LLTextBox(
277 "caution_box", 277 std::string("caution_box"),
278 LLRect(x, y, getRect().getWidth() - 2, caution_height), 278 LLRect(x, y, getRect().getWidth() - 2, caution_height),
279 "", 279 LLStringUtil::null,
280 sFont, 280 sFont,
281 FALSE); 281 FALSE);
282 282
@@ -303,7 +303,7 @@ LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLSt
303 DB_LAST_NAME_BUF_SIZE + 303 DB_LAST_NAME_BUF_SIZE +
304 DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title. 304 DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title.
305 305
306 text = new LLTextEditor("box", 306 text = new LLTextEditor(std::string("box"),
307 LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16), 307 LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16),
308 MAX_LENGTH, 308 MAX_LENGTH,
309 mMessage, 309 mMessage,
@@ -333,16 +333,16 @@ LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLSt
333 else 333 else
334 { 334 {
335 LLButton* btn; 335 LLButton* btn;
336 btn = new LLButton("next", 336 btn = new LLButton(std::string("next"),
337 LLRect(getRect().getWidth()-26, BOTTOM_PAD + 20, getRect().getWidth()-2, BOTTOM_PAD), 337 LLRect(getRect().getWidth()-26, BOTTOM_PAD + 20, getRect().getWidth()-2, BOTTOM_PAD),
338 "notify_next.png", 338 std::string("notify_next.png"),
339 "notify_next.png", 339 std::string("notify_next.png"),
340 "", 340 LLStringUtil::null,
341 onClickNext, 341 onClickNext,
342 this, 342 this,
343 sFont); 343 sFont);
344 btn->setScaleImage(TRUE); 344 btn->setScaleImage(TRUE);
345 btn->setToolTip(LLString("Next")); // *TODO: Translate 345 btn->setToolTip(std::string("Next")); // *TODO: Translate
346 addChild(btn); 346 addChild(btn);
347 mNextBtn = btn; 347 mNextBtn = btn;
348 348
@@ -382,7 +382,7 @@ LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLSt
382 382
383 mBtnCallbackData.push_back(userdata); 383 mBtnCallbackData.push_back(userdata);
384 384
385 btn = new LLButton(options[i], btn_rect, "", onClickButton, userdata); 385 btn = new LLButton(options[i], btn_rect, LLStringUtil::null, onClickButton, userdata);
386 btn->setFont(font); 386 btn->setFont(font);
387 387
388 if (mIsCaution) 388 if (mIsCaution)
@@ -569,12 +569,12 @@ void LLNotifyBox::close()
569 } 569 }
570} 570}
571 571
572void LLNotifyBox::format(LLString& msg, const LLString::format_map_t& args) 572void LLNotifyBox::format(std::string& msg, const LLStringUtil::format_map_t& args)
573{ 573{
574 // XUI:translate! 574 // XUI:translate!
575 LLString::format_map_t targs = args; 575 LLStringUtil::format_map_t targs = args;
576 targs["[SECOND_LIFE]"] = "Second Life"; 576 targs["[SECOND_LIFE]"] = "Second Life";
577 LLString::format(msg, targs); 577 LLStringUtil::format(msg, targs);
578} 578}
579 579
580 580
@@ -667,7 +667,7 @@ LLRect LLNotifyBox::getNotifyRect(S32 num_options, BOOL layout_script_dialog, BO
667} 667}
668 668
669// static 669// static
670LLRect LLNotifyBox::getNotifyTipRect(const LLString &utf8message) 670LLRect LLNotifyBox::getNotifyTipRect(const std::string &utf8message)
671{ 671{
672 S32 line_count = 1; 672 S32 line_count = 1;
673 LLWString message = utf8str_to_wstring(utf8message); 673 LLWString message = utf8str_to_wstring(utf8message);
@@ -789,7 +789,7 @@ void LLNotifyBox::onClickNext(void* data)
789} 789}
790 790
791// static 791// static
792LLPointer<LLNotifyBoxTemplate> LLNotifyBox::getTemplate(const LLString& xml_desc) 792LLPointer<LLNotifyBoxTemplate> LLNotifyBox::getTemplate(const std::string& xml_desc)
793{ 793{
794 // get template 794 // get template
795 795
@@ -808,7 +808,7 @@ LLPointer<LLNotifyBoxTemplate> LLNotifyBox::getTemplate(const LLString& xml_desc
808 } 808 }
809 else 809 else
810 { 810 {
811 LLString tmsg = "[Notification template not found:\n " + xml_desc + " ]"; 811 std::string tmsg = "[Notification template not found:\n " + xml_desc + " ]";
812 sDefaultTemplate->setMessage(tmsg); 812 sDefaultTemplate->setMessage(tmsg);
813 xml_template = sDefaultTemplate; 813 xml_template = sDefaultTemplate;
814 } 814 }
@@ -819,12 +819,12 @@ LLPointer<LLNotifyBoxTemplate> LLNotifyBox::getTemplate(const LLString& xml_desc
819//----------------------------------------------------------------------------- 819//-----------------------------------------------------------------------------
820 820
821//static 821//static
822const LLString LLNotifyBox::getTemplateMessage(const LLString& xml_desc, const LLString::format_map_t& args) 822const std::string LLNotifyBox::getTemplateMessage(const std::string& xml_desc, const LLStringUtil::format_map_t& args)
823{ 823{
824 template_map_t::iterator iter = sNotifyTemplates.find(xml_desc); 824 template_map_t::iterator iter = sNotifyTemplates.find(xml_desc);
825 if (iter != sNotifyTemplates.end()) 825 if (iter != sNotifyTemplates.end())
826 { 826 {
827 LLString message = iter->second->mMessage; 827 std::string message = iter->second->mMessage;
828 format(message, args); 828 format(message, args);
829 return message; 829 return message;
830 } 830 }
@@ -835,7 +835,7 @@ const LLString LLNotifyBox::getTemplateMessage(const LLString& xml_desc, const L
835} 835}
836 836
837//static 837//static
838const LLString LLNotifyBox::getTemplateMessage(const LLString& xml_desc) 838const std::string LLNotifyBox::getTemplateMessage(const std::string& xml_desc)
839{ 839{
840 template_map_t::iterator iter = sNotifyTemplates.find(xml_desc); 840 template_map_t::iterator iter = sNotifyTemplates.find(xml_desc);
841 if (iter != sNotifyTemplates.end()) 841 if (iter != sNotifyTemplates.end())
@@ -849,7 +849,7 @@ const LLString LLNotifyBox::getTemplateMessage(const LLString& xml_desc)
849} 849}
850 850
851// method to check whether a given notify template show as a caution or not 851// method to check whether a given notify template show as a caution or not
852BOOL LLNotifyBox::getTemplateIsCaution(const LLString& xml_desc) 852BOOL LLNotifyBox::getTemplateIsCaution(const std::string& xml_desc)
853{ 853{
854 BOOL is_caution = FALSE; 854 BOOL is_caution = FALSE;
855 855
@@ -863,7 +863,7 @@ BOOL LLNotifyBox::getTemplateIsCaution(const LLString& xml_desc)
863} 863}
864 864
865//static 865//static
866bool LLNotifyBox::parseNotify(const LLString& xml_filename) 866bool LLNotifyBox::parseNotify(const std::string& xml_filename)
867{ 867{
868 LLXMLNodePtr root; 868 LLXMLNodePtr root;
869 869
@@ -892,7 +892,7 @@ bool LLNotifyBox::parseNotify(const LLString& xml_filename)
892 LLPointer<LLNotifyBoxTemplate> xml_template = new LLNotifyBoxTemplate(unique, duration); 892 LLPointer<LLNotifyBoxTemplate> xml_template = new LLNotifyBoxTemplate(unique, duration);
893 893
894 // label= 894 // label=
895 LLString notify_name; 895 std::string notify_name;
896 if (notify->getAttributeString("name", notify_name)) 896 if (notify->getAttributeString("name", notify_name))
897 { 897 {
898 xml_template->mLabel = notify_name; 898 xml_template->mLabel = notify_name;
@@ -934,10 +934,10 @@ bool LLNotifyBox::parseNotify(const LLString& xml_filename)
934 // <option> 934 // <option>
935 if (child->hasName("option")) 935 if (child->hasName("option"))
936 { 936 {
937 LLString label = child->getValue(); 937 std::string label = child->getValue();
938 BOOL is_default = FALSE; 938 BOOL is_default = FALSE;
939 child->getAttributeBOOL("default", is_default); 939 child->getAttributeBOOL("default", is_default);
940 LLString ignore_text; 940 std::string ignore_text;
941 if (!child->getAttributeString("ignore", ignore_text)) 941 if (!child->getAttributeString("ignore", ignore_text))
942 { 942 {
943 ignore_text = label; 943 ignore_text = label;
@@ -957,7 +957,7 @@ bool LLNotifyBox::parseNotify(const LLString& xml_filename)
957 return true; 957 return true;
958} 958}
959 959
960LLNotifyBoxView::LLNotifyBoxView(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows) 960LLNotifyBoxView::LLNotifyBoxView(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows)
961 : LLUICtrl(name,rect,mouse_opaque,NULL,NULL,follows) 961 : LLUICtrl(name,rect,mouse_opaque,NULL,NULL,follows)
962{ 962{
963} 963}