From 29dc24a3ea8d6f3d3aa83fd6b22921937d0dd430 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 14 Dec 2010 14:53:51 +0200 Subject: STORM-713 FIXED XML/UI issues in llTextBox - As the class LLToastNotifyPanel is deprecated, made the class LLToastScriptTextbox derived directly from LLToastPanel. - Added callback for ignore button. Now LLToastScriptTextbox has its own XML, therefore it's not needed to dynamically create toast panel. Since LLToastNotifyPanel is deprecated all new notification toasts should be created this way. --- indra/newview/llscriptfloater.h | 4 +- indra/newview/lltoastscripttextbox.cpp | 16 +++++- indra/newview/lltoastscripttextbox.h | 13 +++-- .../skins/default/xui/en/panel_notify_textbox.xml | 66 +++++++++++++++------- 4 files changed, 69 insertions(+), 30 deletions(-) (limited to 'indra') diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index dc52baa115..8e959a3d0e 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -30,7 +30,7 @@ #include "lltransientdockablefloater.h" #include "llnotificationptr.h" -class LLToastNotifyPanel; +class LLToastPanel; /** * Handles script notifications ("ScriptDialog" and "ScriptDialogGroup") @@ -206,7 +206,7 @@ protected: private: bool isScriptTextbox(LLNotificationPtr notification); - LLToastNotifyPanel* mScriptForm; + LLToastPanel* mScriptForm; LLUUID mNotificationId; LLUUID mObjectId; bool mSaveFloaterPosition; diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp index c013f521cc..2529ec865a 100644 --- a/indra/newview/lltoastscripttextbox.cpp +++ b/indra/newview/lltoastscripttextbox.cpp @@ -46,11 +46,16 @@ const S32 LLToastScriptTextbox::DEFAULT_MESSAGE_MAX_LINE_COUNT= 7; -LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification) -: LLToastNotifyPanel(notification) +LLToastScriptTextbox::LLToastScriptTextbox(const LLNotificationPtr& notification) +: LLToastPanel(notification) { buildFromFile( "panel_notify_textbox.xml"); + LLTextEditor* text_editorp = getChild("text_editor_box"); + text_editorp->setValue(notification->getMessage()); + + getChild("ignore_btn")->setClickedCallback(boost::bind(&LLToastScriptTextbox::onClickIgnore, this)); + const LLSD& payload = notification->getPayload(); //message body @@ -107,3 +112,10 @@ void LLToastScriptTextbox::onClickSubmit() llwarns << response << llendl; } } + +void LLToastScriptTextbox::onClickIgnore() +{ + LLSD response = mNotification->getResponseTemplate(); + mNotification->respond(response); + close(); +} diff --git a/indra/newview/lltoastscripttextbox.h b/indra/newview/lltoastscripttextbox.h index ae3b545e0a..8e69d8834d 100644 --- a/indra/newview/lltoastscripttextbox.h +++ b/indra/newview/lltoastscripttextbox.h @@ -30,13 +30,11 @@ #include "lltoastnotifypanel.h" #include "llnotificationptr.h" -class LLButton; - /** * Toast panel for scripted llTextbox notifications. */ class LLToastScriptTextbox -: public LLToastNotifyPanel +: public LLToastPanel { public: void close(); @@ -46,12 +44,15 @@ public: // Non-transient messages. You can specify non-default button // layouts (like one for script dialogs) by passing various // numbers in for "layout". - LLToastScriptTextbox(LLNotificationPtr& notification); + LLToastScriptTextbox(const LLNotificationPtr& notification); /*virtual*/ ~LLToastScriptTextbox(); -protected: - void onClickSubmit(); + private: + + void onClickSubmit(); + void onClickIgnore(); + static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT; }; diff --git a/indra/newview/skins/default/xui/en/panel_notify_textbox.xml b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml index 4634eeed46..d5b6057233 100644 --- a/indra/newview/skins/default/xui/en/panel_notify_textbox.xml +++ b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml @@ -1,7 +1,7 @@ + width="305"> + + width="285" + word_wrap="true" + parse_url="false" > - parse_urls="false" -