summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastnotifypanel.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-09-13 12:38:12 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-09-13 12:38:12 +0100
commit58d6057076028c13a2dcc6130734a86933dc5864 (patch)
treeb5d30fa5bda26fe3425fa6ed7b098ab2389eca3f /indra/newview/lltoastnotifypanel.cpp
parent807aec7bafe19fca75a8f3980bd621fad7c8338e (diff)
VWR-20756 WIP - start to detect the magic llTextBox() case.
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rw-r--r--indra/newview/lltoastnotifypanel.cpp40
1 files changed, 33 insertions, 7 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index ca6efa9d2f..9febcb3d8b 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -33,6 +33,7 @@
// library includes
#include "lldbstrings.h"
+#include "lllslconstants.h"
#include "llnotifications.h"
#include "lluiconstants.h"
#include "llrect.h"
@@ -54,6 +55,7 @@ LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal
LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification, const LLRect& rect) :
LLToastPanel(notification),
mTextBox(NULL),
+mUserInputBox(NULL),
mInfoPanel(NULL),
mControlPanel(NULL),
mNumOptions(0),
@@ -66,15 +68,43 @@ mCloseNotificationOnDestroy(true)
{
this->setShape(rect);
}
+ // get a form for the notification
+ LLNotificationFormPtr form(notification->getForm());
+ // get number of elements
+ mNumOptions = form->getNumElements();
+
mInfoPanel = getChild<LLPanel>("info_panel");
mControlPanel = getChild<LLPanel>("control_panel");
BUTTON_WIDTH = gSavedSettings.getS32("ToastButtonWidth");
+
// customize panel's attributes
- // is it intended for displaying a tip
+
+ // is it intended for displaying a tip?
mIsTip = notification->getType() == "notifytip";
- // is it a script dialog
+ // is it a script dialog?
mIsScriptDialog = (notification->getName() == "ScriptDialog" || notification->getName() == "ScriptDialogGroup");
- // is it a caution
+ // is it a script dialog with llTextBox()?
+ mIsScriptTextBox = false;
+ if (mIsScriptDialog)
+ {
+ // if ANY of the buttons have the magic lltextbox string as name, then
+ // treat the whole dialog as a simple text entry box (i.e. mixed button
+ // and textbox forms are not supported)
+ for (int i=0; i<mNumOptions; ++i)
+ {
+ LLSD form_element = form->getElement(i);
+ llwarns << form_element << llendl;
+ if (form_element["name"].asString() == TEXTBOX_MAGIC_TOKEN)
+ {
+ mIsScriptTextBox = true;
+ break;
+ }
+ }
+ }
+ llwarns << "FORM ELEMS " << int(form->getNumElements()) << llendl;
+ llwarns << "isScriptDialog? " << int(mIsScriptDialog) << llendl;
+ llwarns << "isScriptTextBox? " << int(mIsScriptTextBox) << llendl;
+ // is it a caution?
//
// caution flag can be set explicitly by specifying it in the notification payload, or it can be set implicitly if the
// notify xml template specifies that it is a caution
@@ -94,10 +124,6 @@ mCloseNotificationOnDestroy(true)
setIsChrome(TRUE);
// initialize
setFocusRoot(!mIsTip);
- // get a form for the notification
- LLNotificationFormPtr form(notification->getForm());
- // get number of elements
- mNumOptions = form->getNumElements();
// customize panel's outfit
// preliminary adjust panel's layout