diff options
Diffstat (limited to 'linden/indra/newview/llnotify.cpp')
-rw-r--r-- | linden/indra/newview/llnotify.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp index cd22343..0c259c0 100644 --- a/linden/indra/newview/llnotify.cpp +++ b/linden/indra/newview/llnotify.cpp | |||
@@ -152,7 +152,7 @@ LLNotifyBox* LLNotifyBox::findExistingNotify(LLPointer<LLNotifyBoxTemplate> noti | |||
152 | if(notify_template->mUnique) | 152 | if(notify_template->mUnique) |
153 | { | 153 | { |
154 | LLString message = notify_template->mMessage; | 154 | LLString message = notify_template->mMessage; |
155 | LLAlertDialog::format(message, args); | 155 | format(message, args); |
156 | unique_map_t::iterator found_it = sOpenUniqueNotifyBoxes.find(notify_template->mLabel + message); | 156 | unique_map_t::iterator found_it = sOpenUniqueNotifyBoxes.find(notify_template->mLabel + message); |
157 | if (found_it != sOpenUniqueNotifyBoxes.end()) | 157 | if (found_it != sOpenUniqueNotifyBoxes.end()) |
158 | { | 158 | { |
@@ -162,6 +162,7 @@ LLNotifyBox* LLNotifyBox::findExistingNotify(LLPointer<LLNotifyBoxTemplate> noti | |||
162 | return NULL; | 162 | return NULL; |
163 | } | 163 | } |
164 | 164 | ||
165 | //static | ||
165 | void LLNotifyBox::cleanup() | 166 | void LLNotifyBox::cleanup() |
166 | { | 167 | { |
167 | sDefaultTemplate = NULL; | 168 | sDefaultTemplate = NULL; |
@@ -196,7 +197,7 @@ LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLSt | |||
196 | // setup paramaters | 197 | // setup paramaters |
197 | 198 | ||
198 | mMessage = xml_template->mMessage; | 199 | mMessage = xml_template->mMessage; |
199 | LLAlertDialog::format(mMessage, args); | 200 | format(mMessage, args); |
200 | 201 | ||
201 | // use name + formatted text as unique key | 202 | // use name + formatted text as unique key |
202 | if (mUnique) | 203 | if (mUnique) |
@@ -339,7 +340,7 @@ LLNotifyBox::LLNotifyBox(LLPointer<LLNotifyBoxTemplate> xml_template, const LLSt | |||
339 | onClickNext, | 340 | onClickNext, |
340 | this, | 341 | this, |
341 | sFont); | 342 | sFont); |
342 | btn->setToolTip("Next"); | 343 | btn->setToolTip(LLString("Next")); // *TODO: Translate |
343 | addChild(btn); | 344 | addChild(btn); |
344 | mNextBtn = btn; | 345 | mNextBtn = btn; |
345 | 346 | ||
@@ -440,7 +441,7 @@ BOOL LLNotifyBox::handleRightMouseDown(S32 x, S32 y, MASK mask) | |||
440 | { | 441 | { |
441 | if (!mIsTip && getVisible() && getEnabled() && pointInView(x,y)) | 442 | if (!mIsTip && getVisible() && getEnabled() && pointInView(x,y)) |
442 | { | 443 | { |
443 | moveToBack(); | 444 | moveToBack(true); |
444 | return TRUE; | 445 | return TRUE; |
445 | } | 446 | } |
446 | 447 | ||
@@ -554,6 +555,15 @@ void LLNotifyBox::close() | |||
554 | } | 555 | } |
555 | } | 556 | } |
556 | 557 | ||
558 | void LLNotifyBox::format(LLString& msg, const LLString::format_map_t& args) | ||
559 | { | ||
560 | // XUI:translate! | ||
561 | LLString::format_map_t targs = args; | ||
562 | targs["[SECOND_LIFE]"] = "Second Life"; | ||
563 | LLString::format(msg, targs); | ||
564 | } | ||
565 | |||
566 | |||
557 | /*virtual*/ | 567 | /*virtual*/ |
558 | BOOL LLNotifyBox::tick() | 568 | BOOL LLNotifyBox::tick() |
559 | { | 569 | { |
@@ -575,7 +585,7 @@ void LLNotifyBox::setVisible(BOOL visible) | |||
575 | LLPanel::setVisible(visible); | 585 | LLPanel::setVisible(visible); |
576 | } | 586 | } |
577 | 587 | ||
578 | void LLNotifyBox::moveToBack() | 588 | void LLNotifyBox::moveToBack(bool getfocus) |
579 | { | 589 | { |
580 | // Move this dialog to the back. | 590 | // Move this dialog to the back. |
581 | gNotifyBoxView->sendChildToBack(this); | 591 | gNotifyBoxView->sendChildToBack(this); |
@@ -590,10 +600,13 @@ void LLNotifyBox::moveToBack() | |||
590 | if (front) | 600 | if (front) |
591 | { | 601 | { |
592 | gNotifyBoxView->showOnly(front); | 602 | gNotifyBoxView->showOnly(front); |
593 | // assuming that moveToBack is only called by clicking the next button, | 603 | if (getfocus) |
594 | // we give focus to the next next button | 604 | { |
595 | front->mNextBtn->setFocus(TRUE); | 605 | // if are called from a user interaction |
596 | gFocusMgr.triggerFocusFlash(); // TODO: it's ugly to call this here | 606 | // we give focus to the next next button |
607 | front->mNextBtn->setFocus(TRUE); | ||
608 | gFocusMgr.triggerFocusFlash(); // TODO: it's ugly to call this here | ||
609 | } | ||
597 | } | 610 | } |
598 | } | 611 | } |
599 | } | 612 | } |
@@ -755,7 +768,7 @@ void LLNotifyBox::onClickButton(void* data) | |||
755 | void LLNotifyBox::onClickNext(void* data) | 768 | void LLNotifyBox::onClickNext(void* data) |
756 | { | 769 | { |
757 | LLNotifyBox* self = static_cast<LLNotifyBox*>(data); | 770 | LLNotifyBox* self = static_cast<LLNotifyBox*>(data); |
758 | self->moveToBack(); | 771 | self->moveToBack(true); |
759 | } | 772 | } |
760 | 773 | ||
761 | // static | 774 | // static |
@@ -795,7 +808,7 @@ const LLString LLNotifyBox::getTemplateMessage(const LLString& xml_desc, const L | |||
795 | if (iter != sNotifyTemplates.end()) | 808 | if (iter != sNotifyTemplates.end()) |
796 | { | 809 | { |
797 | LLString message = iter->second->mMessage; | 810 | LLString message = iter->second->mMessage; |
798 | LLAlertDialog::format(message, args); | 811 | format(message, args); |
799 | return message; | 812 | return message; |
800 | } | 813 | } |
801 | else | 814 | else |