From 58d6057076028c13a2dcc6130734a86933dc5864 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 12:38:12 +0100
Subject: VWR-20756 WIP - start to detect the magic llTextBox() case.

---
 indra/newview/lltoastnotifypanel.cpp | 40 +++++++++++++++++++++++++++++-------
 indra/newview/lltoastnotifypanel.h   |  2 ++
 2 files changed, 35 insertions(+), 7 deletions(-)

(limited to 'indra/newview')

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
diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h
index 9e1eac90b3..f90fca3eaa 100644
--- a/indra/newview/lltoastnotifypanel.h
+++ b/indra/newview/lltoastnotifypanel.h
@@ -99,6 +99,7 @@ protected:
 
 	// panel elements
 	LLTextBase*		mTextBox;
+	LLTextEditor*           mUserInputBox;
 	LLPanel*		mInfoPanel;		// a panel, that contains an information
 	LLPanel*		mControlPanel;	// a panel, that contains buttons (if present)
 
@@ -121,6 +122,7 @@ protected:
 	void disableRespondedOptions(LLNotificationPtr& notification);
 
 	bool mIsTip;
+	bool mIsScriptTextBox;
 	bool mAddedDefaultBtn;
 	bool mIsScriptDialog;
 	bool mIsCaution; 
-- 
cgit v1.2.3


From 17d913fef4778234c97b48d26167d6e1f62d8add Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 13:56:29 +0100
Subject: VWR-20756 WIP - very limping display of llTextBox

---
 indra/newview/lltoastnotifypanel.cpp               | 19 +++++++++++++++++--
 .../skins/default/xui/en/panel_notification.xml    | 22 ++++++++++++++++++++++
 2 files changed, 39 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 9febcb3d8b..6413874863 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -148,6 +148,11 @@ mCloseNotificationOnDestroy(true)
 	mTextBox->setVisible(TRUE);
 	mTextBox->setValue(notification->getMessage());
 
+	mUserInputBox = getChild<LLTextEditor>("user_input_box"); 
+	mUserInputBox->setMaxTextLength(254);// FIXME
+	mUserInputBox->setVisible(FALSE);
+	mUserInputBox->setEnabled(FALSE);
+
 	// add buttons for a script notification
 	if (mIsTip)
 	{
@@ -164,6 +169,16 @@ mCloseNotificationOnDestroy(true)
 			LLSD form_element = form->getElement(i);
 			if (form_element["type"].asString() != "button")
 			{
+				// not a button.
+				continue;
+			}
+			if (form_element["name"].asString() == TEXTBOX_MAGIC_TOKEN)
+			{
+				// a textbox pretending to be a button.
+				// (re)enable the textbox for this panel, and continue.
+				mUserInputBox->setVisible(TRUE);
+				mUserInputBox->setEnabled(TRUE);
+				mUserInputBox->insertText("FOOOOOO!!!!");
 				continue;
 			}
 			LLButton* new_button = createButton(form_element, TRUE);
@@ -278,7 +293,7 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
 		p.image_color(LLUIColorTable::instance().getColor("ButtonCautionImageColor"));
 		p.image_color_disabled(LLUIColorTable::instance().getColor("ButtonCautionImageColor"));
 	}
-	// for the scriptdialog buttons we use fixed button size. This  is a limit!
+	// for the scriptdialog buttons we use fixed button size. This is a limit!
 	if (!mIsScriptDialog && font->getWidth(form_element["text"].asString()) > BUTTON_WIDTH)
 	{
 		p.rect.width = 1;
@@ -286,7 +301,7 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
 	}
 	else if (mIsScriptDialog && is_ignore_btn)
 	{
-		// this is ignore button,make it smaller
+		// this is ignore button, make it smaller
 		p.rect.height = BTN_HEIGHT_SMALL;
 		p.rect.width = 1;
 		p.auto_resize = true;
diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml
index 59ead84127..a816eaccb6 100644
--- a/indra/newview/skins/default/xui/en/panel_notification.xml
+++ b/indra/newview/skins/default/xui/en/panel_notification.xml
@@ -55,6 +55,28 @@
       visible="false"
       width="285"
       wrap="true"/>
+    <text_editor
+    	h_pad="0"
+	v_pad="0"
+      border_visible="true"
+      embedded_items="false"
+      enabled="false"
+      follows="left|right|top|bottom"
+      font="SansSerif"
+      height="85" 
+      layout="topleft"
+      left="10"
+      mouse_opaque="false"
+      name="user_input_box"
+      read_only="false"
+      tab_stop="false"
+      text_color="red"
+      top="50"
+      visible="false"
+      width="285"
+      wrap="true"
+      parse_highlights="true"
+      parse_urls="true"/>
     <text_editor
     	h_pad="0"
 	v_pad="0"
-- 
cgit v1.2.3


From bf8639dd1830e313f78e65efb0b0bce6a8b82a62 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 19:53:08 +0100
Subject: Annoying focus hacks to unblock development.

---
 indra/newview/lltoastnotifypanel.cpp                      | 1 +
 indra/newview/skins/default/xui/en/panel_notification.xml | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 6413874863..8cae7d0963 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -178,6 +178,7 @@ mCloseNotificationOnDestroy(true)
 				// (re)enable the textbox for this panel, and continue.
 				mUserInputBox->setVisible(TRUE);
 				mUserInputBox->setEnabled(TRUE);
+				mUserInputBox->setFocus(TRUE);
 				mUserInputBox->insertText("FOOOOOO!!!!");
 				continue;
 			}
diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml
index a816eaccb6..ef9e5323f9 100644
--- a/indra/newview/skins/default/xui/en/panel_notification.xml
+++ b/indra/newview/skins/default/xui/en/panel_notification.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
+   tab_stop="false"
   background_opaque="false"
       border_visible="false"
   background_visible="true"
@@ -15,6 +16,7 @@
   width="305">
   <!-- THIS PANEL CONTROLS TOAST HEIGHT? -->
   <panel
+   tab_stop="false"
       border_visible="false"
  bevel_style="none"
     background_visible="true"
@@ -70,7 +72,8 @@
       name="user_input_box"
       read_only="false"
       tab_stop="false"
-      text_color="red"
+      text_color="green"
+      text_readonly_color="red"
       top="50"
       visible="false"
       width="285"
@@ -103,6 +106,7 @@
       parse_urls="true"/>
   </panel>
   <panel
+   tab_stop="false"
     background_visible="false"
     follows="left|right|bottom"
     height="30" 
-- 
cgit v1.2.3


From e171f63f3868ca03a31e64eead32028711b3211d Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 20:04:05 +0100
Subject: trivial whitespace change...

---
 indra/newview/lltoastnotifypanel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 8cae7d0963..56f71dc43e 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -200,7 +200,7 @@ mCloseNotificationOnDestroy(true)
 			if(h_pad < 2*HPAD)
 			{
 				/*
-				 * Probably it is  a scriptdialog toast
+				 * Probably it is a scriptdialog toast
 				 * for a scriptdialog toast h_pad can be < 2*HPAD if we have a lot of buttons.
 				 * In last case set default h_pad to avoid heaping of buttons 
 				 */
-- 
cgit v1.2.3


From 89e1f3be753c7c5153261ebb94095f2dee95a991 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 20:12:50 +0100
Subject: quick stab at a submit button.

---
 indra/newview/skins/default/xui/en/panel_notification.xml | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml
index ef9e5323f9..21c45aa5e3 100644
--- a/indra/newview/skins/default/xui/en/panel_notification.xml
+++ b/indra/newview/skins/default/xui/en/panel_notification.xml
@@ -104,6 +104,14 @@
       wrap="true"
       parse_highlights="true"
       parse_urls="true"/>
+      <button
+	 follows="left|top"
+	 height="25"
+	 layout="topleft"
+	 left_pad="10"
+	 label="Submit"
+	 name="submit"
+	 width="35" />
   </panel>
   <panel
    tab_stop="false"
-- 
cgit v1.2.3


From 2044179baf05742c09d1e06b93679f3545b62551 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 20:25:06 +0100
Subject: trivial typo fix.

---
 indra/newview/lltoastgroupnotifypanel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp
index 4c75b07ae8..bf79492b1e 100644
--- a/indra/newview/lltoastgroupnotifypanel.cpp
+++ b/indra/newview/lltoastgroupnotifypanel.cpp
@@ -59,7 +59,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
 	LLGroupData groupData;
 	if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData))
 	{
-		llwarns << "Group notice for unkown group: " << payload["group_id"].asUUID() << llendl;
+		llwarns << "Group notice for unknown group: " << payload["group_id"].asUUID() << llendl;
 	}
 
 	//group icon
-- 
cgit v1.2.3


From 35962b54e0afa14cd89eb028efb13787802c18a0 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 20:39:15 +0100
Subject: Start to break the lltextbox toast into its own toast class instead
 of mega-overloading the generic notification panel.

---
 indra/newview/lltoastscripttextbox.cpp             | 214 +++++++++++++++++++++
 indra/newview/lltoastscripttextbox.h               |  79 ++++++++
 .../skins/default/xui/en/panel_notify_textbox.xml  | 101 ++++++++++
 3 files changed, 394 insertions(+)
 create mode 100644 indra/newview/lltoastscripttextbox.cpp
 create mode 100644 indra/newview/lltoastscripttextbox.h
 create mode 100644 indra/newview/skins/default/xui/en/panel_notify_textbox.xml

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
new file mode 100644
index 0000000000..bb06976d40
--- /dev/null
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -0,0 +1,214 @@
+/**
+ * @file lltoastscripttextbox.cpp
+ * @brief Panel for script llTextBox dialogs
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "lltoastscripttextbox.h"
+
+#include "llfocusmgr.h"
+
+#include "llbutton.h"
+#include "lliconctrl.h"
+#include "llinventoryfunctions.h"
+#include "llnotifications.h"
+#include "llviewertexteditor.h"
+
+#include "lluiconstants.h"
+#include "llui.h"
+#include "llviewercontrol.h"
+#include "lltrans.h"
+#include "llstyle.h"
+
+#include "llglheaders.h"
+#include "llagent.h"
+#include "llavatariconctrl.h"
+#include "llfloaterinventory.h"
+#include "llinventorytype.h"
+
+const S32 LLToastGroupNotifyPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT	= 7;
+
+LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification)
+:	LLToastPanel(notification),
+	mInventoryOffer(NULL)
+{
+	LLUICtrlFactory::getInstance()->buildPanel(this, "panel_notify_textbox.xml");
+	const LLSD& payload = notification->getPayload();
+	LLGroupData groupData;
+	if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData))
+	{
+		llwarns << "Group notice for unknown group: " << payload["group_id"].asUUID() << llendl;
+	}
+
+	//group icon
+	LLIconCtrl* pGroupIcon = getChild<LLIconCtrl>("group_icon", TRUE);
+	pGroupIcon->setValue(groupData.mInsigniaID);
+
+	//header title
+	const std::string& from_name = payload["sender_name"].asString();
+	std::stringstream from;
+	from << from_name << "/" << groupData.mName;
+	LLTextBox* pTitleText = getChild<LLTextBox>("title");
+	pTitleText->setValue(from.str());
+
+	//message subject
+	const std::string& subject = payload["subject"].asString();
+	//message body
+	const std::string& message = payload["message"].asString();
+
+	std::string timeStr = "["+LLTrans::getString("UTCTimeWeek")+"],["
+							+LLTrans::getString("UTCTimeDay")+"] ["
+							+LLTrans::getString("UTCTimeMth")+"] ["
+							+LLTrans::getString("UTCTimeYr")+"] ["
+							+LLTrans::getString("UTCTimeHr")+"]:["
+							+LLTrans::getString("UTCTimeMin")+"]:["
+							+LLTrans::getString("UTCTimeSec")+"] ["
+							+LLTrans::getString("UTCTimeTimezone")+"]";
+	const LLDate timeStamp = notification->getDate();
+	LLDate notice_date = timeStamp.notNull() ? timeStamp : LLDate::now();
+	LLSD substitution;
+	substitution["datetime"] = (S32) notice_date.secondsSinceEpoch();
+	LLStringUtil::format(timeStr, substitution);
+
+	LLViewerTextEditor* pMessageText = getChild<LLViewerTextEditor>("message");
+	pMessageText->clear();
+
+	LLStyle::Params style;
+	LLFontGL* subject_font = LLFontGL::getFontByName(getString("subject_font"));
+	if (subject_font) 
+		style.font = subject_font;
+	pMessageText->appendText(subject, FALSE, style);
+
+	LLFontGL* date_font = LLFontGL::getFontByName(getString("date_font"));
+	if (date_font)
+		style.font = date_font;
+	pMessageText->appendText(timeStr + "\n", TRUE, style);
+	
+	style.font = pMessageText->getDefaultFont();
+	pMessageText->appendText(message, TRUE, style);
+
+	//attachment
+	BOOL hasInventory = payload["inventory_offer"].isDefined();
+
+	//attachment text
+	LLTextBox * pAttachLink = getChild<LLTextBox>("attachment");
+	//attachment icon
+	LLIconCtrl* pAttachIcon = getChild<LLIconCtrl>("attachment_icon", TRUE);
+
+	//If attachment is empty let it be invisible and not take place at the panel
+	pAttachLink->setVisible(hasInventory);
+	pAttachIcon->setVisible(hasInventory);
+	if (hasInventory) {
+		pAttachLink->setValue(payload["inventory_name"]);
+
+		mInventoryOffer = new LLOfferInfo(payload["inventory_offer"]);
+		getChild<LLTextBox>("attachment")->setClickedCallback(boost::bind(
+				&LLToastGroupNotifyPanel::onClickAttachment, this));
+
+		LLUIImagePtr attachIconImg = LLInventoryIcon::getIcon(mInventoryOffer->mType,
+												LLInventoryType::IT_TEXTURE);
+		pAttachIcon->setValue(attachIconImg->getName());
+	}
+
+	//ok button
+	LLButton* pOkBtn = getChild<LLButton>("btn_ok");
+	pOkBtn->setClickedCallback((boost::bind(&LLToastGroupNotifyPanel::onClickOk, this)));
+	setDefaultBtn(pOkBtn);
+
+	S32 maxLinesCount;
+	std::istringstream ss( getString("message_max_lines_count") );
+	if (!(ss >> maxLinesCount))
+	{
+		maxLinesCount = DEFAULT_MESSAGE_MAX_LINE_COUNT;
+	}
+	snapToMessageHeight(pMessageText, maxLinesCount);
+}
+
+// virtual
+LLToastGroupNotifyPanel::~LLToastGroupNotifyPanel()
+{
+}
+
+void LLToastGroupNotifyPanel::close()
+{
+	// The group notice dialog may be an inventory offer.
+	// If it has an inventory save button and that button is still enabled
+	// Then we need to send the inventory declined message
+	if(mInventoryOffer != NULL)
+	{
+		mInventoryOffer->forceResponse(IOR_DECLINE);
+		mInventoryOffer = NULL;
+	}
+
+	die();
+}
+
+void LLToastGroupNotifyPanel::onClickOk()
+{
+	LLSD response = mNotification->getResponseTemplate();
+	mNotification->respond(response);
+	close();
+}
+
+void LLToastGroupNotifyPanel::onClickAttachment()
+{
+	if (mInventoryOffer != NULL) {
+		mInventoryOffer->forceResponse(IOR_ACCEPT);
+
+		LLTextBox * pAttachLink = getChild<LLTextBox> ("attachment");
+		static const LLUIColor textColor = LLUIColorTable::instance().getColor(
+				"GroupNotifyDimmedTextColor");
+		pAttachLink->setColor(textColor);
+
+		LLIconCtrl* pAttachIcon =
+				getChild<LLIconCtrl> ("attachment_icon", TRUE);
+		pAttachIcon->setEnabled(FALSE);
+
+		//if attachment isn't openable - notify about saving
+		if (!isAttachmentOpenable(mInventoryOffer->mType)) {
+			LLNotifications::instance().add("AttachmentSaved", LLSD(), LLSD());
+		}
+
+		mInventoryOffer = NULL;
+	}
+}
+
+//static
+bool LLToastGroupNotifyPanel::isAttachmentOpenable(LLAssetType::EType type)
+{
+	switch(type)
+	{
+	case LLAssetType::AT_LANDMARK:
+	case LLAssetType::AT_NOTECARD:
+	case LLAssetType::AT_IMAGE_JPEG:
+	case LLAssetType::AT_IMAGE_TGA:
+	case LLAssetType::AT_TEXTURE:
+	case LLAssetType::AT_TEXTURE_TGA:
+		return true;
+	default:
+		return false;
+	}
+}
+
diff --git a/indra/newview/lltoastscripttextbox.h b/indra/newview/lltoastscripttextbox.h
new file mode 100644
index 0000000000..4890ee1dea
--- /dev/null
+++ b/indra/newview/lltoastscripttextbox.h
@@ -0,0 +1,79 @@
+/**
+ * @file lltoastscripttextbox.h
+ * @brief Panel for script llTextBox dialogs
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTOASTSCRIPTTEXTBOX_H
+#define LL_LLTOASTSCRIPTTEXTBOX_H
+
+#include "llfontgl.h"
+#include "lltoastpanel.h"
+#include "lldarray.h"
+#include "lltimer.h"
+#include "llviewermessage.h"
+#include "llnotificationptr.h"
+
+class LLButton;
+
+/**
+ * Toast panel for group notification.
+ *
+ * Replaces class LLGroupNotifyBox.
+ */
+class LLToastGroupNotifyPanel
+:	public LLToastPanel
+{
+public:
+	void close();
+
+	static bool onNewNotification(const LLSD& notification);
+
+
+	// Non-transient messages.  You can specify non-default button
+	// layouts (like one for script dialogs) by passing various
+	// numbers in for "layout".
+	LLToastGroupNotifyPanel(LLNotificationPtr& notification);
+
+	/*virtual*/ ~LLToastGroupNotifyPanel();
+protected:
+	void onClickOk();
+	void onClickAttachment();
+private:
+	static bool isAttachmentOpenable(LLAssetType::EType);
+
+	static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT;
+
+	LLButton* mSaveInventoryBtn;
+
+	LLUUID mGroupID;
+	LLOfferInfo* mInventoryOffer;
+};
+
+// This view contains the stack of notification windows.
+//extern LLView* gGroupNotifyBoxView;
+
+const S32 GROUP_LAYOUT_DEFAULT = 0;
+const S32 GROUP_LAYOUT_SCRIPT_DIALOG = 1;
+
+#endif
diff --git a/indra/newview/skins/default/xui/en/panel_notify_textbox.xml b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
new file mode 100644
index 0000000000..6f271a757c
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ background_visible="true"
+ height="90"
+ label="instant_message"
+ layout="topleft"
+ left="0"
+ name="panel_group_notify"
+ top="0"
+ width="305">
+    <string
+     name="message_max_lines_count"
+     value="7" />
+    <string
+     name="subject_font"
+     value="SANSSERIF_BIG" />
+    <string
+     name="date_font"
+     value="SANSSERIF" />
+    <panel
+     background_visible="true"
+     follows="top"
+     height="30"
+     label="header"
+     layout="topleft"
+     left="0"
+     name="header"
+     top="0"
+     width="305">
+        <icon
+         follows="all"
+         height="20"
+         layout="topleft"
+         left="5"
+         mouse_opaque="true"
+         name="group_icon"
+         top="5"
+         width="20" />
+        <text
+         follows="all"
+         font="SansSerifBig"
+         height="20"
+         layout="topleft"
+         left_pad="10"
+         name="title"
+         text_color="GroupNotifyTextColor"
+         top="5"
+         use_ellipses="true"
+         value="Sender Name / Group Name"
+         width="230" />
+    </panel>
+    <text_editor
+     parse_urls="true"
+     enabled="true"
+     follows="all"
+     height="0"
+     layout="topleft"
+     left="25"
+     max_length="2147483647"
+     name="message"
+     parse_highlights="true"
+     read_only="true"
+     text_color="GroupNotifyTextColor"
+     top="40"
+     type="string"
+     use_ellipses="true"
+     value="message"
+     width="270"
+	 word_wrap="true" >
+    </text_editor>
+    <icon
+     bottom="60"
+     follows="left|bottom|right"
+     height="15"
+     layout="topleft"
+     left="25"
+     mouse_opaque="true"
+     name="attachment_icon"
+     width="15" />
+    <text
+     bottom="60"
+     follows="left|bottom|right"
+     font="SansSerif"
+     height="15"
+     layout="topleft"
+     left="45"
+     name="attachment"
+     text_color="GroupNotifyTextColor"
+     value="Attachment"
+     use_ellipses="true"
+     width="250" />
+    <button
+     bottom="85"
+     follows="bottom"
+     height="20"
+     label="OK"
+     layout="topleft"
+     right="-10"
+     name="btn_ok"
+     width="70" />
+</panel>
-- 
cgit v1.2.3


From c2a87df2bccbf6e662f3a4c4edb210748ffa692d Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 13 Sep 2010 20:53:58 +0100
Subject: add new modules.

---
 indra/newview/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index d685e6ae36..78c9769d06 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -440,6 +440,7 @@ set(viewer_SOURCE_FILES
     lltoastimpanel.cpp
     lltoastnotifypanel.cpp
     lltoastpanel.cpp
+    lltoastscripttextbox.cpp
     lltool.cpp
     lltoolbrush.cpp
     lltoolcomp.cpp
@@ -966,6 +967,7 @@ set(viewer_HEADER_FILES
     lltoastimpanel.h
     lltoastnotifypanel.h
     lltoastpanel.h
+    lltoastscripttextbox.h
     lltool.h
     lltoolbrush.h
     lltoolcomp.h
-- 
cgit v1.2.3


From 34a55f2f05036d465ae1ddad5031a3e3f892d549 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 20 Sep 2010 13:04:56 +0100
Subject: make this at least build, but no real flesh yet.

---
 indra/newview/lltoastscripttextbox.cpp | 18 +++++++++---------
 indra/newview/lltoastscripttextbox.h   |  6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index bb06976d40..a54594e474 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -48,9 +48,9 @@
 #include "llfloaterinventory.h"
 #include "llinventorytype.h"
 
-const S32 LLToastGroupNotifyPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT	= 7;
+const S32 LLToastScriptTextbox::DEFAULT_MESSAGE_MAX_LINE_COUNT	= 7;
 
-LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification)
+LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 :	LLToastPanel(notification),
 	mInventoryOffer(NULL)
 {
@@ -125,7 +125,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
 
 		mInventoryOffer = new LLOfferInfo(payload["inventory_offer"]);
 		getChild<LLTextBox>("attachment")->setClickedCallback(boost::bind(
-				&LLToastGroupNotifyPanel::onClickAttachment, this));
+				&LLToastScriptTextbox::onClickAttachment, this));
 
 		LLUIImagePtr attachIconImg = LLInventoryIcon::getIcon(mInventoryOffer->mType,
 												LLInventoryType::IT_TEXTURE);
@@ -134,7 +134,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
 
 	//ok button
 	LLButton* pOkBtn = getChild<LLButton>("btn_ok");
-	pOkBtn->setClickedCallback((boost::bind(&LLToastGroupNotifyPanel::onClickOk, this)));
+	pOkBtn->setClickedCallback((boost::bind(&LLToastScriptTextbox::onClickOk, this)));
 	setDefaultBtn(pOkBtn);
 
 	S32 maxLinesCount;
@@ -147,11 +147,11 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
 }
 
 // virtual
-LLToastGroupNotifyPanel::~LLToastGroupNotifyPanel()
+LLToastScriptTextbox::~LLToastScriptTextbox()
 {
 }
 
-void LLToastGroupNotifyPanel::close()
+void LLToastScriptTextbox::close()
 {
 	// The group notice dialog may be an inventory offer.
 	// If it has an inventory save button and that button is still enabled
@@ -165,14 +165,14 @@ void LLToastGroupNotifyPanel::close()
 	die();
 }
 
-void LLToastGroupNotifyPanel::onClickOk()
+void LLToastScriptTextbox::onClickOk()
 {
 	LLSD response = mNotification->getResponseTemplate();
 	mNotification->respond(response);
 	close();
 }
 
-void LLToastGroupNotifyPanel::onClickAttachment()
+void LLToastScriptTextbox::onClickAttachment()
 {
 	if (mInventoryOffer != NULL) {
 		mInventoryOffer->forceResponse(IOR_ACCEPT);
@@ -196,7 +196,7 @@ void LLToastGroupNotifyPanel::onClickAttachment()
 }
 
 //static
-bool LLToastGroupNotifyPanel::isAttachmentOpenable(LLAssetType::EType type)
+bool LLToastScriptTextbox::isAttachmentOpenable(LLAssetType::EType type)
 {
 	switch(type)
 	{
diff --git a/indra/newview/lltoastscripttextbox.h b/indra/newview/lltoastscripttextbox.h
index 4890ee1dea..2d942939bc 100644
--- a/indra/newview/lltoastscripttextbox.h
+++ b/indra/newview/lltoastscripttextbox.h
@@ -41,7 +41,7 @@ class LLButton;
  *
  * Replaces class LLGroupNotifyBox.
  */
-class LLToastGroupNotifyPanel
+class LLToastScriptTextbox
 :	public LLToastPanel
 {
 public:
@@ -53,9 +53,9 @@ public:
 	// Non-transient messages.  You can specify non-default button
 	// layouts (like one for script dialogs) by passing various
 	// numbers in for "layout".
-	LLToastGroupNotifyPanel(LLNotificationPtr& notification);
+	LLToastScriptTextbox(LLNotificationPtr& notification);
 
-	/*virtual*/ ~LLToastGroupNotifyPanel();
+	/*virtual*/ ~LLToastScriptTextbox();
 protected:
 	void onClickOk();
 	void onClickAttachment();
-- 
cgit v1.2.3


From faa96995d359047c539d1262df0e668e2f578f94 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 20 Sep 2010 13:07:32 +0100
Subject: tweak.

---
 indra/newview/skins/default/xui/en/panel_notify_textbox.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

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 6f271a757c..a0d103e2a3 100644
--- a/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
+++ b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
@@ -5,7 +5,7 @@
  label="instant_message"
  layout="topleft"
  left="0"
- name="panel_group_notify"
+ name="panel_notify_textbox"
  top="0"
  width="305">
     <string
-- 
cgit v1.2.3


From 1d1852a08f599921f10803aa64324c4962612679 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Tue, 21 Sep 2010 16:52:20 +0100
Subject: more work towards making textbox-based script dialogs be their own
 toast type.

---
 indra/newview/CMakeLists.txt                       |   1 +
 indra/newview/llnotificationhandler.h              |  22 ++-
 .../newview/llnotificationscripttextboxhandler.cpp | 174 +++++++++++++++++++++
 3 files changed, 196 insertions(+), 1 deletion(-)
 create mode 100644 indra/newview/llnotificationscripttextboxhandler.cpp

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 42d996419c..3899c8658f 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -307,6 +307,7 @@ set(viewer_SOURCE_FILES
     llnotificationmanager.cpp
     llnotificationofferhandler.cpp
     llnotificationscripthandler.cpp
+    llnotificationscripttextboxhandler.cpp
     llnotificationstorage.cpp
     llnotificationtiphandler.cpp
     lloutfitslist.cpp
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index 060eccf5c7..0cca878a4f 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -197,9 +197,29 @@ protected:
 	virtual void initChannel();
 
 	// own handlers
-	void onRejectToast(LLUUID& id);
+	virtual void onRejectToast(LLUUID& id);
 };
 
+/**
+ * Handler for specific textbox-based script notices.
+ */
+
+class LLScriptTextboxHandler : public LLSysHandler
+{
+ public:
+	LLScriptTextboxHandler(e_notification_type type, const LLSD& id);
+	virtual ~LLScriptTextboxHandler();
+
+	// base interface functions
+	virtual bool processNotification(const LLSD& notify);
+
+protected:
+	virtual void onDeleteToast(LLToast* toast);
+	virtual void initChannel();
+
+	// own handlers
+	virtual void onRejectToast(LLUUID& id);
+};
 
 /**
  * Handler for group system notices.
diff --git a/indra/newview/llnotificationscripttextboxhandler.cpp b/indra/newview/llnotificationscripttextboxhandler.cpp
new file mode 100644
index 0000000000..27ece8422e
--- /dev/null
+++ b/indra/newview/llnotificationscripttextboxhandler.cpp
@@ -0,0 +1,174 @@
+/** 
+ * @file llnotificationscripthandler.cpp
+ * @brief Notification Handler Class for Simple Notifications and Notification Tips
+ *
+ * $LicenseInfo:firstyear=2000&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+
+#include "llviewerprecompiledheaders.h" // must be first include
+
+#include "llnotificationhandler.h"
+#include "lltoastnotifypanel.h"
+#include "llviewercontrol.h"
+#include "llviewerwindow.h"
+#include "llnotificationmanager.h"
+#include "llnotifications.h"
+#include "llscriptfloater.h"
+#include "lltoastscripttextbox.h"
+
+using namespace LLNotificationsUI;
+
+static const std::string SCRIPT_DIALOG				("ScriptDialog");
+static const std::string SCRIPT_DIALOG_GROUP		("ScriptDialogGroup");
+static const std::string SCRIPT_LOAD_URL			("LoadWebPage");
+
+//--------------------------------------------------------------------------
+LLScriptTextboxHandler::LLScriptTextboxHandler(e_notification_type type, const LLSD& id)
+{
+	mType = type;
+
+	// Getting a Channel for our notifications
+	mChannel = LLChannelManager::getInstance()->createNotificationChannel();
+	mChannel->setControlHovering(true);
+	
+	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+	if(channel)
+		channel->setOnRejectToastCallback(boost::bind(&LLScriptTextboxHandler::onRejectToast, this, _1));
+
+}
+
+//--------------------------------------------------------------------------
+LLScriptTextboxHandler::~LLScriptTextboxHandler()
+{
+}
+
+//--------------------------------------------------------------------------
+void LLScriptTextboxHandler::initChannel()
+{
+	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); 
+	S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
+	mChannel->init(channel_right_bound - channel_width, channel_right_bound);
+}
+
+//--------------------------------------------------------------------------
+bool LLScriptTextboxHandler::processNotification(const LLSD& notify)
+{
+	if(!mChannel)
+	{
+		return false;
+	}
+
+	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
+
+	if(!notification)
+		return false;
+
+	// arrange a channel on a screen
+	if(!mChannel->getVisible())
+	{
+		initChannel();
+	}
+	
+	if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
+	{
+		if (LLHandlerUtil::canLogToIM(notification))
+		{
+			LLHandlerUtil::logToIMP2P(notification);
+		}
+
+		if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
+		{
+			LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID());
+		}
+		else
+		{
+			LLToastScriptTextbox* notify_box = new LLToastScriptTextbox(notification);
+
+			LLToast::Params p;
+			p.notif_id = notification->getID();
+			p.notification = notification;
+			p.panel = notify_box;	
+			p.on_delete_toast = boost::bind(&LLScriptTextboxHandler::onDeleteToast, this, _1);
+
+			LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
+			if(channel)
+			{
+				channel->addToast(p);
+			}
+
+			// send a signal to the counter manager
+			mNewNotificationSignal();
+		}
+	}
+	else if (notify["sigtype"].asString() == "delete")
+	{
+		if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
+		{
+			LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
+		}
+		else
+		{
+			mChannel->killToastByNotificationID(notification->getID());
+		}
+	}
+	return true;
+}
+
+//--------------------------------------------------------------------------
+
+void LLScriptTextboxHandler::onDeleteToast(LLToast* toast)
+{
+	// send a signal to the counter manager
+	mDelNotificationSignal();
+
+	// send a signal to a listener to let him perform some action
+	// in this case listener is a SysWellWindow and it will remove a corresponding item from its list
+	mNotificationIDSignal(toast->getNotificationID());
+
+	LLNotificationPtr notification = LLNotifications::getInstance()->find(toast->getNotificationID());
+	
+	if( notification && 
+		(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) )
+	{
+		LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
+	}
+}
+
+//--------------------------------------------------------------------------
+void LLScriptTextboxHandler::onRejectToast(LLUUID& id)
+{
+	LLNotificationPtr notification = LLNotifications::instance().find(id);
+
+	if (notification
+			&& LLNotificationManager::getInstance()->getHandlerForNotification(
+					notification->getType()) == this)
+	{
+		LLNotifications::instance().cancel(notification);
+	}
+}
+
+//--------------------------------------------------------------------------
+
+
+
+
-- 
cgit v1.2.3


From c54c369e5ef84c63ad3d634c3329b0a292a215d4 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Fri, 24 Sep 2010 11:49:40 +0100
Subject: remove panel_notify textbox hacks now that this is gonna be its own
 panel.

---
 .../skins/default/xui/en/panel_notification.xml    | 34 ----------------------
 1 file changed, 34 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml
index 21c45aa5e3..59ead84127 100644
--- a/indra/newview/skins/default/xui/en/panel_notification.xml
+++ b/indra/newview/skins/default/xui/en/panel_notification.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
-   tab_stop="false"
   background_opaque="false"
       border_visible="false"
   background_visible="true"
@@ -16,7 +15,6 @@
   width="305">
   <!-- THIS PANEL CONTROLS TOAST HEIGHT? -->
   <panel
-   tab_stop="false"
       border_visible="false"
  bevel_style="none"
     background_visible="true"
@@ -57,29 +55,6 @@
       visible="false"
       width="285"
       wrap="true"/>
-    <text_editor
-    	h_pad="0"
-	v_pad="0"
-      border_visible="true"
-      embedded_items="false"
-      enabled="false"
-      follows="left|right|top|bottom"
-      font="SansSerif"
-      height="85" 
-      layout="topleft"
-      left="10"
-      mouse_opaque="false"
-      name="user_input_box"
-      read_only="false"
-      tab_stop="false"
-      text_color="green"
-      text_readonly_color="red"
-      top="50"
-      visible="false"
-      width="285"
-      wrap="true"
-      parse_highlights="true"
-      parse_urls="true"/>
     <text_editor
     	h_pad="0"
 	v_pad="0"
@@ -104,17 +79,8 @@
       wrap="true"
       parse_highlights="true"
       parse_urls="true"/>
-      <button
-	 follows="left|top"
-	 height="25"
-	 layout="topleft"
-	 left_pad="10"
-	 label="Submit"
-	 name="submit"
-	 width="35" />
   </panel>
   <panel
-   tab_stop="false"
     background_visible="false"
     follows="left|right|bottom"
     height="30" 
-- 
cgit v1.2.3


From 7cd8557ff7008580eedda5b5131a2632dbe6206b Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 27 Sep 2010 13:36:07 +0100
Subject: hacky hacky to figure out the call flow.

---
 indra/newview/llnotificationmanager.cpp              | 3 ++-
 indra/newview/llnotificationscripttextboxhandler.cpp | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index 6988227128..cd0d323741 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -73,7 +73,8 @@ void LLNotificationManager::init()
 	LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
 	LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
 
-	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
+	//mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
+	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptTextboxHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["notifytip"] =  boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["groupnotify"] = boost::shared_ptr<LLEventHandler>(new LLGroupHandler(NT_GROUPNOTIFY, LLSD()));
 	mNotifyHandlers["alert"] = boost::shared_ptr<LLEventHandler>(new LLAlertHandler(NT_ALERT, LLSD()));
diff --git a/indra/newview/llnotificationscripttextboxhandler.cpp b/indra/newview/llnotificationscripttextboxhandler.cpp
index 8ee32575e7..9556501c42 100644
--- a/indra/newview/llnotificationscripttextboxhandler.cpp
+++ b/indra/newview/llnotificationscripttextboxhandler.cpp
@@ -96,7 +96,7 @@ bool LLScriptTextboxHandler::processNotification(const LLSD& notify)
 			LLHandlerUtil::logToIMP2P(notification);
 		}
 
-		if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
+		if(0)//(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
 		{
 			LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID());
 		}
-- 
cgit v1.2.3


From 393af9b02347f136818143db0e8b823755df0af9 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Tue, 28 Sep 2010 13:14:07 +0100
Subject: hack hack scratch scratch sketch sketch

---
 indra/newview/llnotificationmanager.cpp       |   4 +-
 indra/newview/llnotificationscripthandler.cpp |   2 +
 indra/newview/llscriptfloater.cpp             |  17 +-
 indra/newview/llscripttextboxfloater.cpp      | 576 ++++++++++++++++++++++++++
 indra/newview/llscripttextboxfloater.h        | 212 ++++++++++
 5 files changed, 805 insertions(+), 6 deletions(-)
 create mode 100644 indra/newview/llscripttextboxfloater.cpp
 create mode 100644 indra/newview/llscripttextboxfloater.h

(limited to 'indra/newview')

diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index cd0d323741..3967117fc8 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -73,8 +73,8 @@ void LLNotificationManager::init()
 	LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
 	LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
 
-	//mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
-	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptTextboxHandler(NT_NOTIFY, LLSD()));
+	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
+	//mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptTextboxHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["notifytip"] =  boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["groupnotify"] = boost::shared_ptr<LLEventHandler>(new LLGroupHandler(NT_GROUPNOTIFY, LLSD()));
 	mNotifyHandlers["alert"] = boost::shared_ptr<LLEventHandler>(new LLAlertHandler(NT_ALERT, LLSD()));
diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index 45590c3cdb..eed0bdc15d 100644
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -97,10 +97,12 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
 
 		if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
 		{
+			llwarns << "DUMB ROUTE" << llendl;
 			LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID());
 		}
 		else
 		{
+			llwarns << "SMART ROUTE" << llendl;
 			LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification);
 
 			LLToast::Params p;
diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index 2334f0cde5..0f7223aaf0 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -37,6 +37,7 @@
 #include "llscreenchannel.h"
 #include "llsyswellwindow.h"
 #include "lltoastnotifypanel.h"
+#include "lltoastscripttextbox.h"
 #include "lltrans.h"
 #include "llviewerwindow.h"
 #include "llimfloater.h"
@@ -151,10 +152,18 @@ void LLScriptFloater::createForm(const LLUUID& notification_id)
 
 	// create new form
 	LLRect toast_rect = getRect();
-	// LLToastNotifyPanel will fit own content in vertical direction,
-	// but it needs an initial rect to properly calculate  its width
- 	// Use an initial rect of the script floater to make the floater window more configurable.
-	mScriptForm = new LLToastNotifyPanel(notification, toast_rect); 
+	if (isScriptTextBox())
+	{
+		mScriptForm = new LLToastScriptTextbox(notify, toast_rect);
+	}
+	else
+	{
+		// LLToastNotifyPanel will fit own content in vertical direction,
+		// but it needs an initial rect to properly calculate  its width
+		// Use an initial rect of the script floater to make the floater
+		// window more configurable.
+		mScriptForm = new LLToastNotifyPanel(notification, toast_rect); 
+	}
 	addChild(mScriptForm);
 
 	// position form on floater
diff --git a/indra/newview/llscripttextboxfloater.cpp b/indra/newview/llscripttextboxfloater.cpp
new file mode 100644
index 0000000000..0f7223aaf0
--- /dev/null
+++ b/indra/newview/llscripttextboxfloater.cpp
@@ -0,0 +1,576 @@
+/** 
+ * @file llscriptfloater.cpp
+ * @brief LLScriptFloater class definition
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llscriptfloater.h"
+#include "llagentcamera.h"
+
+#include "llbottomtray.h"
+#include "llchannelmanager.h"
+#include "llchiclet.h"
+#include "llfloaterreg.h"
+#include "llnotifications.h"
+#include "llnotificationsutil.h"
+#include "llscreenchannel.h"
+#include "llsyswellwindow.h"
+#include "lltoastnotifypanel.h"
+#include "lltoastscripttextbox.h"
+#include "lltrans.h"
+#include "llviewerwindow.h"
+#include "llimfloater.h"
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+LLUUID notification_id_to_object_id(const LLUUID& notification_id)
+{
+	LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
+	if(notification)
+	{
+		return notification->getPayload()["object_id"].asUUID();
+	}
+	return LLUUID::null;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+LLScriptFloater::LLScriptFloater(const LLSD& key)
+: LLDockableFloater(NULL, true, key)
+, mScriptForm(NULL)
+, mSaveFloaterPosition(false)
+{
+	setMouseDownCallback(boost::bind(&LLScriptFloater::onMouseDown, this));
+	setOverlapsScreenChannel(true);
+	mIsDockedStateForcedCallback = boost::bind(&LLAgentCamera::cameraMouselook, &gAgentCamera);
+}
+
+bool LLScriptFloater::toggle(const LLUUID& notification_id)
+{
+	LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
+
+	// show existing floater
+	if(floater)
+	{
+		if(floater->getVisible())
+		{
+			floater->setVisible(false);
+			return false;
+		}
+		else
+		{
+			floater->setVisible(TRUE);
+			floater->setFocus(FALSE);
+		}
+	}
+	// create and show new floater
+	else
+	{
+		show(notification_id);
+	}
+
+	LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(notification_id, true);
+	return true;
+}
+
+LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id)
+{
+	LLScriptFloater* floater = LLFloaterReg::getTypedInstance<LLScriptFloater>("script_floater", notification_id);
+	floater->setNotificationId(notification_id);
+	floater->createForm(notification_id);
+
+	//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
+	floater->setAutoFocus(FALSE);
+
+	if(LLScriptFloaterManager::OBJ_SCRIPT == LLScriptFloaterManager::getObjectType(notification_id))
+	{
+		floater->setSavePosition(true);
+		floater->restorePosition();
+	}
+	else
+	{
+		floater->dockToChiclet(true);
+	}
+
+	//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
+	LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id, FALSE);
+
+	return floater;
+}
+
+void LLScriptFloater::setNotificationId(const LLUUID& id)
+{
+	mNotificationId = id;
+	// Lets save object id now while notification exists
+	mObjectId = notification_id_to_object_id(id);
+}
+
+void LLScriptFloater::getAllowedRect(LLRect& rect)
+{
+	rect = gViewerWindow->getWorldViewRectScaled();
+}
+
+void LLScriptFloater::createForm(const LLUUID& notification_id)
+{
+	// delete old form
+	if(mScriptForm)
+	{
+		removeChild(mScriptForm);
+		mScriptForm->die();
+	}
+
+	LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
+	if(NULL == notification)
+	{
+		return;
+	}
+
+	// create new form
+	LLRect toast_rect = getRect();
+	if (isScriptTextBox())
+	{
+		mScriptForm = new LLToastScriptTextbox(notify, toast_rect);
+	}
+	else
+	{
+		// LLToastNotifyPanel will fit own content in vertical direction,
+		// but it needs an initial rect to properly calculate  its width
+		// Use an initial rect of the script floater to make the floater
+		// window more configurable.
+		mScriptForm = new LLToastNotifyPanel(notification, toast_rect); 
+	}
+	addChild(mScriptForm);
+
+	// position form on floater
+	mScriptForm->setOrigin(0, 0);
+
+	// make floater size fit form size
+	LLRect panel_rect = mScriptForm->getRect();
+	toast_rect.setLeftTopAndSize(toast_rect.mLeft, toast_rect.mTop, panel_rect.getWidth(), panel_rect.getHeight() + getHeaderHeight());
+	setShape(toast_rect);
+}
+
+void LLScriptFloater::onClose(bool app_quitting)
+{
+	savePosition();
+
+	if(getNotificationId().notNull())
+	{
+		// we shouldn't kill notification on exit since it may be used as persistent.
+		if (app_quitting)
+		{
+			LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId());
+		}
+		else
+		{
+			LLScriptFloaterManager::getInstance()->removeNotification(getNotificationId());
+		}
+	}
+}
+
+void LLScriptFloater::setDocked(bool docked, bool pop_on_undock /* = true */)
+{
+	LLDockableFloater::setDocked(docked, pop_on_undock);
+
+	savePosition();
+
+	hideToastsIfNeeded();
+}
+
+void LLScriptFloater::setVisible(BOOL visible)
+{
+	LLDockableFloater::setVisible(visible);
+
+	hideToastsIfNeeded();
+
+	if(!visible)
+	{
+		LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId());
+		if(chiclet)
+		{
+			chiclet->setToggleState(false);
+		}
+	}
+}
+
+void LLScriptFloater::onMouseDown()
+{
+	if(getNotificationId().notNull())
+	{
+		// Remove new message icon
+		LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId());
+		if (chiclet == NULL)
+		{
+			llerror("Dock chiclet for LLScriptFloater doesn't exist", 0);
+		}
+		else
+		{
+			chiclet->setShowNewMessagesIcon(false);
+		}
+	}
+}
+
+void LLScriptFloater::savePosition()
+{
+	if(getSavePosition() && mObjectId.notNull())
+	{
+		LLScriptFloaterManager::FloaterPositionInfo fpi = {getRect(), isDocked()};
+		LLScriptFloaterManager::getInstance()->saveFloaterPosition(mObjectId, fpi);
+	}
+}
+
+void LLScriptFloater::restorePosition()
+{
+	LLScriptFloaterManager::FloaterPositionInfo fpi;
+	if(LLScriptFloaterManager::getInstance()->getFloaterPosition(mObjectId, fpi))
+	{
+		dockToChiclet(fpi.mDockState);
+		if(!fpi.mDockState)
+		{
+			// Un-docked floater is opened in 0,0, now move it to saved position
+			translate(fpi.mRect.mLeft - getRect().mLeft, fpi.mRect.mTop - getRect().mTop);
+		}
+	}
+	else
+	{
+		dockToChiclet(true);
+	}
+}
+
+void LLScriptFloater::onFocusLost()
+{
+	if(getNotificationId().notNull())
+	{
+		LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), false);
+	}
+}
+
+void LLScriptFloater::onFocusReceived()
+{
+	// first focus will be received before setObjectId() call - don't toggle chiclet
+	if(getNotificationId().notNull())
+	{
+		LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), true);
+	}
+}
+
+void LLScriptFloater::dockToChiclet(bool dock)
+{
+	if (getDockControl() == NULL)
+	{
+		LLChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(getNotificationId());
+		if (chiclet == NULL)
+		{
+			llwarns << "Dock chiclet for LLScriptFloater doesn't exist" << llendl;
+			return;
+		}
+		else
+		{
+			LLBottomTray::getInstance()->getChicletPanel()->scrollToChiclet(chiclet);
+		}
+
+		// Stop saving position while we dock floater
+		bool save = getSavePosition();
+		setSavePosition(false);
+
+		setDockControl(new LLDockControl(chiclet, this, getDockTongue(),
+			LLDockControl::TOP,  boost::bind(&LLScriptFloater::getAllowedRect, this, _1)));
+
+		setDocked(dock);
+
+		// Restore saving
+		setSavePosition(save);
+	}
+}
+
+void LLScriptFloater::hideToastsIfNeeded()
+{
+	using namespace LLNotificationsUI;
+
+	// find channel
+	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(LLChannelManager::getInstance()->findChannelByID(
+		LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
+	// update notification channel state
+	if(channel)
+	{
+		channel->updateShowToastsState();
+		channel->redrawToasts();
+	}
+}
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id)
+{
+	if(notification_id.isNull())
+	{
+		llwarns << "Invalid notification ID" << llendl;
+		return;
+	}
+
+	// get scripted Object's ID
+	LLUUID object_id = notification_id_to_object_id(notification_id);
+	
+	// Need to indicate of "new message" for object chiclets according to requirements
+	// specified in the Message Bar design specification. See EXT-3142.
+	bool set_new_message = false;
+	EObjectType obj_type = getObjectType(notification_id);
+
+	// LLDialog can spawn only one instance, LLLoadURL and LLGiveInventory can spawn unlimited number of instances
+	if(OBJ_SCRIPT == obj_type)
+	{
+		// If an Object spawns more-than-one floater, only the newest one is shown. 
+		// The previous is automatically closed.
+		script_notification_map_t::const_iterator it = findUsingObjectId(object_id);
+		if(it != mNotifications.end())
+		{
+			LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(it->first);
+			if(chiclet)
+			{
+				// Pass the new_message icon state further.
+				set_new_message = chiclet->getShowNewMessagesIcon();
+			}
+
+			LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->first);
+			if(floater)
+			{
+				// Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142.
+				set_new_message |= !floater->hasFocus();
+			}
+
+			removeNotification(it->first);
+		}
+	}
+
+	mNotifications.insert(std::make_pair(notification_id, object_id));
+
+	// Create inventory offer chiclet for offer type notifications
+	if( OBJ_GIVE_INVENTORY == obj_type )
+	{
+		LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(notification_id);
+	}
+	else
+	{
+		LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(notification_id);
+	}
+
+	LLIMWellWindow::getInstance()->addObjectRow(notification_id, set_new_message);
+
+	LLSD data;
+	data["notification_id"] = notification_id;
+	data["new_message"] = set_new_message;
+	data["unread"] = 1; // each object has got only one floater
+	mNewObjectSignal(data);
+
+	toggleScriptFloater(notification_id, set_new_message);
+}
+
+void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id)
+{
+	LLNotificationPtr notification = LLNotifications::instance().find(notification_id);
+	if (notification != NULL && !notification->isCancelled())
+	{
+		LLNotificationsUtil::cancel(notification);
+	}
+
+	onRemoveNotification(notification_id);
+}
+
+void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
+{
+	if(notification_id.isNull())
+	{
+		llwarns << "Invalid notification ID" << llendl;
+		return;
+	}
+
+	// remove related chiclet
+	LLBottomTray::getInstance()->getChicletPanel()->removeChiclet(notification_id);
+
+	LLIMWellWindow::getInstance()->removeObjectRow(notification_id);
+
+	mNotifications.erase(notification_id);
+
+	// close floater
+	LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
+	if(floater)
+	{
+		floater->savePosition();
+		floater->setNotificationId(LLUUID::null);
+		floater->closeFloater();
+	}
+}
+
+void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& notification_id, bool set_new_message)
+{
+	LLSD data;
+	data["notification_id"] = notification_id;
+	data["new_message"] = set_new_message;
+	mToggleFloaterSignal(data);
+
+	// toggle floater
+	LLScriptFloater::toggle(notification_id);
+}
+
+LLUUID LLScriptFloaterManager::findObjectId(const LLUUID& notification_id)
+{
+	script_notification_map_t::const_iterator it = mNotifications.find(notification_id);
+	if(mNotifications.end() != it)
+	{
+		return it->second;
+	}
+	return LLUUID::null;
+}
+
+LLUUID LLScriptFloaterManager::findNotificationId(const LLUUID& object_id)
+{
+	if(object_id.notNull())
+	{
+		script_notification_map_t::const_iterator it = findUsingObjectId(object_id);
+		if(mNotifications.end() != it)
+		{
+			return it->first;
+		}
+	}
+	return LLUUID::null;
+}
+
+// static
+LLScriptFloaterManager::EObjectType LLScriptFloaterManager::getObjectType(const LLUUID& notification_id)
+{
+	if(notification_id.isNull())
+	{
+		llwarns << "Invalid notification ID" << llendl;
+		return OBJ_UNKNOWN;
+	}
+
+	static const object_type_map TYPE_MAP = initObjectTypeMap();
+
+	LLNotificationPtr notification = LLNotificationsUtil::find(notification_id);
+	object_type_map::const_iterator it = TYPE_MAP.find(notification->getName());
+	if(it != TYPE_MAP.end())
+	{
+		return it->second;
+	}
+
+	llwarns << "Unknown object type" << llendl;
+	return OBJ_UNKNOWN;
+}
+
+// static
+std::string LLScriptFloaterManager::getObjectName(const LLUUID& notification_id)
+{
+	using namespace LLNotificationsUI;
+	LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
+	if(!notification)
+	{
+		llwarns << "Invalid notification" << llendl;
+		return LLStringUtil::null;
+	}
+
+	std::string text;
+
+	switch(LLScriptFloaterManager::getObjectType(notification_id))
+	{
+	case LLScriptFloaterManager::OBJ_SCRIPT:
+		text = notification->getSubstitutions()["TITLE"].asString();
+		break;
+	case LLScriptFloaterManager::OBJ_LOAD_URL:
+		text = notification->getSubstitutions()["OBJECTNAME"].asString();
+		break;
+	case LLScriptFloaterManager::OBJ_GIVE_INVENTORY:
+		text = notification->getSubstitutions()["OBJECTFROMNAME"].asString();
+		break;
+	default:
+		text = LLTrans::getString("object");
+		break;
+	}
+
+	return text;
+}
+
+//static
+LLScriptFloaterManager::object_type_map LLScriptFloaterManager::initObjectTypeMap()
+{
+	object_type_map type_map;
+	type_map["ScriptDialog"] = OBJ_SCRIPT;
+	type_map["ScriptDialogGroup"] = OBJ_SCRIPT;
+	type_map["LoadWebPage"] = OBJ_LOAD_URL;
+	type_map["ObjectGiveItem"] = OBJ_GIVE_INVENTORY;
+	return type_map;
+}
+
+LLScriptFloaterManager::script_notification_map_t::const_iterator LLScriptFloaterManager::findUsingObjectId(const LLUUID& object_id)
+{
+	script_notification_map_t::const_iterator it = mNotifications.begin();
+	for(; mNotifications.end() != it; ++it)
+	{
+		if(object_id == it->second)
+		{
+			return it;
+		}
+	}
+	return mNotifications.end();
+}
+
+void LLScriptFloaterManager::saveFloaterPosition(const LLUUID& object_id, const FloaterPositionInfo& fpi)
+{
+	if(object_id.notNull())
+	{
+		LLScriptFloaterManager::getInstance()->mFloaterPositions[object_id] = fpi;
+	}
+	else
+	{
+		llwarns << "Invalid object id" << llendl;
+	}
+}
+
+bool LLScriptFloaterManager::getFloaterPosition(const LLUUID& object_id, FloaterPositionInfo& fpi)
+{
+	floater_position_map_t::const_iterator it = mFloaterPositions.find(object_id);
+	if(LLScriptFloaterManager::getInstance()->mFloaterPositions.end() != it)
+	{
+		fpi = it->second;
+		return true;
+	}
+	return false;
+}
+
+void LLScriptFloaterManager::setFloaterVisible(const LLUUID& notification_id, bool visible)
+{
+	LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>(
+		"script_floater", notification_id);
+	if(floater)
+	{
+		floater->setVisible(visible);
+	}
+}
+
+// EOF
diff --git a/indra/newview/llscripttextboxfloater.h b/indra/newview/llscripttextboxfloater.h
new file mode 100644
index 0000000000..b0ab725810
--- /dev/null
+++ b/indra/newview/llscripttextboxfloater.h
@@ -0,0 +1,212 @@
+/** 
+ * @file llscripttextboxfloater.h
+ * @brief LLScriptTextboxFloater class definition
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_SCRIPTTEXTBOXFLOATER_H
+#define LL_SCRIPTTEXTBOXFLOATER_H
+
+#include "lltransientdockablefloater.h"
+
+class LLToastNotifyPanel;
+
+/**
+ * Handles script notifications ("ScriptDialog" and "ScriptDialogGroup")
+ * and manages Script Floaters.
+ */
+class LLScriptTextboxFloaterManager : public LLSingleton<LLScriptTextboxFloaterManager>
+{
+	// *TODO
+	// LLScriptTextboxFloaterManager and LLScriptTextboxFloater will need some refactoring after we 
+	// know how script notifications should look like.
+public:
+
+	typedef enum e_object_type
+	{
+		OBJ_SCRIPT,
+		OBJ_GIVE_INVENTORY,
+		OBJ_LOAD_URL,
+
+		OBJ_UNKNOWN
+	}EObjectType;
+
+	/**
+	 * Handles new notifications.
+	 * Saves notification and object ids, removes old notification if needed, creates script chiclet
+	 * Note that one object can spawn one script floater.
+	 */
+	void onAddNotification(const LLUUID& notification_id);
+
+	/**
+	 * Removes notification.
+	 */
+	void removeNotification(const LLUUID& notification_id);
+
+	/**
+	 * Handles notification removal.
+	 * Removes script notification toast, removes script chiclet, closes script floater
+	 */
+	void onRemoveNotification(const LLUUID& notification_id);
+
+	/**
+	 * Toggles script floater.
+	 * Removes "new message" icon from chiclet and removes notification toast.
+	 */
+	void toggleScriptFloater(const LLUUID& object_id, bool set_new_message = false);
+
+	LLUUID findObjectId(const LLUUID& notification_id);
+
+	LLUUID findNotificationId(const LLUUID& object_id);
+
+	static EObjectType getObjectType(const LLUUID& notification_id);
+
+	static std::string getObjectName(const LLUUID& notification_id);
+
+	typedef boost::signals2::signal<void(const LLSD&)> object_signal_t;
+
+	boost::signals2::connection addNewObjectCallback(const object_signal_t::slot_type& cb) { return mNewObjectSignal.connect(cb); }
+	boost::signals2::connection addToggleObjectFloaterCallback(const object_signal_t::slot_type& cb) { return mToggleFloaterSignal.connect(cb); }
+
+	struct FloaterPositionInfo
+	{
+		LLRect mRect;
+		bool mDockState;
+	};
+
+	void saveFloaterPosition(const LLUUID& object_id, const FloaterPositionInfo& fpi);
+
+	bool getFloaterPosition(const LLUUID& object_id, FloaterPositionInfo& fpi);
+
+	void setFloaterVisible(const LLUUID& notification_id, bool visible);
+
+protected:
+
+	typedef std::map<std::string, EObjectType> object_type_map;
+
+	static object_type_map initObjectTypeMap();
+
+	// <notification_id, object_id>
+	typedef std::map<LLUUID, LLUUID> script_notification_map_t;
+
+	script_notification_map_t::const_iterator findUsingObjectId(const LLUUID& object_id);
+
+private:
+
+	script_notification_map_t mNotifications;
+
+	object_signal_t mNewObjectSignal;
+	object_signal_t mToggleFloaterSignal;
+
+	// <object_id, floater position>
+	typedef std::map<LLUUID, FloaterPositionInfo> floater_position_map_t;
+
+	floater_position_map_t mFloaterPositions;
+};
+
+/**
+ * Floater script forms.
+ * LLScriptTextboxFloater will create script form based on notification data and 
+ * will auto fit the form.
+ */
+class LLScriptTextboxFloater : public LLDockableFloater
+{
+public:
+
+	/**
+	 * key - UUID of scripted Object
+	 */
+	LLScriptTextboxFloater(const LLSD& key);
+
+	virtual ~LLScriptTextboxFloater(){};
+
+	/**
+	 * Toggle existing floater or create and show a new one.
+	 */
+	static bool toggle(const LLUUID& object_id);
+
+	/**
+	 * Creates and shows floater
+	 */
+	static LLScriptTextboxFloater* show(const LLUUID& object_id);
+
+	const LLUUID& getNotificationId() { return mNotificationId; }
+
+	void setNotificationId(const LLUUID& id);
+
+	/**
+	 * Close notification if script floater is closed.
+	 */
+	/*virtual*/ void onClose(bool app_quitting);
+
+	/**
+	 * Hide all notification toasts when we show dockable floater
+	 */
+	/*virtual*/ void setDocked(bool docked, bool pop_on_undock = true);
+
+	/**
+	 * Hide all notification toasts when we show dockable floater
+	 */
+	/*virtual*/ void setVisible(BOOL visible);
+
+	bool getSavePosition() { return mSaveFloaterPosition; }
+
+	void setSavePosition(bool save) { mSaveFloaterPosition = save; }
+
+	void savePosition();
+
+	void restorePosition();
+
+protected:
+
+	/**
+	 * Creates script form, will delete old form if floater is shown for same object.
+	 */
+	void createForm(const LLUUID& object_id);
+
+	/*virtual*/ void getAllowedRect(LLRect& rect);
+
+	/**
+	 * Hide all notification toasts.
+	 */
+	static void hideToastsIfNeeded();
+
+	/**
+	 * Removes chiclets new messages icon
+	 */
+	void onMouseDown();
+
+	/*virtual*/ void onFocusLost();
+	
+	/*virtual*/ void onFocusReceived();
+
+	void dockToChiclet(bool dock);
+
+private:
+	LLToastNotifyPanel* mScriptForm;
+	LLUUID mNotificationId;
+	LLUUID mObjectId;
+	bool mSaveFloaterPosition;
+};
+
+#endif //LL_SCRIPTFLOATER_H
-- 
cgit v1.2.3


From 532ee1dae0f3a612a38a16e0a0144bcea12c64a3 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Tue, 28 Sep 2010 13:14:23 +0100
Subject: scrattttch

---
 indra/newview/llscripttextboxfloater.cpp | 576 -------------------------------
 indra/newview/llscripttextboxfloater.h   | 212 ------------
 2 files changed, 788 deletions(-)
 delete mode 100644 indra/newview/llscripttextboxfloater.cpp
 delete mode 100644 indra/newview/llscripttextboxfloater.h

(limited to 'indra/newview')

diff --git a/indra/newview/llscripttextboxfloater.cpp b/indra/newview/llscripttextboxfloater.cpp
deleted file mode 100644
index 0f7223aaf0..0000000000
--- a/indra/newview/llscripttextboxfloater.cpp
+++ /dev/null
@@ -1,576 +0,0 @@
-/** 
- * @file llscriptfloater.cpp
- * @brief LLScriptFloater class definition
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-#include "llscriptfloater.h"
-#include "llagentcamera.h"
-
-#include "llbottomtray.h"
-#include "llchannelmanager.h"
-#include "llchiclet.h"
-#include "llfloaterreg.h"
-#include "llnotifications.h"
-#include "llnotificationsutil.h"
-#include "llscreenchannel.h"
-#include "llsyswellwindow.h"
-#include "lltoastnotifypanel.h"
-#include "lltoastscripttextbox.h"
-#include "lltrans.h"
-#include "llviewerwindow.h"
-#include "llimfloater.h"
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-LLUUID notification_id_to_object_id(const LLUUID& notification_id)
-{
-	LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
-	if(notification)
-	{
-		return notification->getPayload()["object_id"].asUUID();
-	}
-	return LLUUID::null;
-}
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-LLScriptFloater::LLScriptFloater(const LLSD& key)
-: LLDockableFloater(NULL, true, key)
-, mScriptForm(NULL)
-, mSaveFloaterPosition(false)
-{
-	setMouseDownCallback(boost::bind(&LLScriptFloater::onMouseDown, this));
-	setOverlapsScreenChannel(true);
-	mIsDockedStateForcedCallback = boost::bind(&LLAgentCamera::cameraMouselook, &gAgentCamera);
-}
-
-bool LLScriptFloater::toggle(const LLUUID& notification_id)
-{
-	LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
-
-	// show existing floater
-	if(floater)
-	{
-		if(floater->getVisible())
-		{
-			floater->setVisible(false);
-			return false;
-		}
-		else
-		{
-			floater->setVisible(TRUE);
-			floater->setFocus(FALSE);
-		}
-	}
-	// create and show new floater
-	else
-	{
-		show(notification_id);
-	}
-
-	LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(notification_id, true);
-	return true;
-}
-
-LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id)
-{
-	LLScriptFloater* floater = LLFloaterReg::getTypedInstance<LLScriptFloater>("script_floater", notification_id);
-	floater->setNotificationId(notification_id);
-	floater->createForm(notification_id);
-
-	//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
-	floater->setAutoFocus(FALSE);
-
-	if(LLScriptFloaterManager::OBJ_SCRIPT == LLScriptFloaterManager::getObjectType(notification_id))
-	{
-		floater->setSavePosition(true);
-		floater->restorePosition();
-	}
-	else
-	{
-		floater->dockToChiclet(true);
-	}
-
-	//LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445)
-	LLFloaterReg::showTypedInstance<LLScriptFloater>("script_floater", notification_id, FALSE);
-
-	return floater;
-}
-
-void LLScriptFloater::setNotificationId(const LLUUID& id)
-{
-	mNotificationId = id;
-	// Lets save object id now while notification exists
-	mObjectId = notification_id_to_object_id(id);
-}
-
-void LLScriptFloater::getAllowedRect(LLRect& rect)
-{
-	rect = gViewerWindow->getWorldViewRectScaled();
-}
-
-void LLScriptFloater::createForm(const LLUUID& notification_id)
-{
-	// delete old form
-	if(mScriptForm)
-	{
-		removeChild(mScriptForm);
-		mScriptForm->die();
-	}
-
-	LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
-	if(NULL == notification)
-	{
-		return;
-	}
-
-	// create new form
-	LLRect toast_rect = getRect();
-	if (isScriptTextBox())
-	{
-		mScriptForm = new LLToastScriptTextbox(notify, toast_rect);
-	}
-	else
-	{
-		// LLToastNotifyPanel will fit own content in vertical direction,
-		// but it needs an initial rect to properly calculate  its width
-		// Use an initial rect of the script floater to make the floater
-		// window more configurable.
-		mScriptForm = new LLToastNotifyPanel(notification, toast_rect); 
-	}
-	addChild(mScriptForm);
-
-	// position form on floater
-	mScriptForm->setOrigin(0, 0);
-
-	// make floater size fit form size
-	LLRect panel_rect = mScriptForm->getRect();
-	toast_rect.setLeftTopAndSize(toast_rect.mLeft, toast_rect.mTop, panel_rect.getWidth(), panel_rect.getHeight() + getHeaderHeight());
-	setShape(toast_rect);
-}
-
-void LLScriptFloater::onClose(bool app_quitting)
-{
-	savePosition();
-
-	if(getNotificationId().notNull())
-	{
-		// we shouldn't kill notification on exit since it may be used as persistent.
-		if (app_quitting)
-		{
-			LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId());
-		}
-		else
-		{
-			LLScriptFloaterManager::getInstance()->removeNotification(getNotificationId());
-		}
-	}
-}
-
-void LLScriptFloater::setDocked(bool docked, bool pop_on_undock /* = true */)
-{
-	LLDockableFloater::setDocked(docked, pop_on_undock);
-
-	savePosition();
-
-	hideToastsIfNeeded();
-}
-
-void LLScriptFloater::setVisible(BOOL visible)
-{
-	LLDockableFloater::setVisible(visible);
-
-	hideToastsIfNeeded();
-
-	if(!visible)
-	{
-		LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId());
-		if(chiclet)
-		{
-			chiclet->setToggleState(false);
-		}
-	}
-}
-
-void LLScriptFloater::onMouseDown()
-{
-	if(getNotificationId().notNull())
-	{
-		// Remove new message icon
-		LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getNotificationId());
-		if (chiclet == NULL)
-		{
-			llerror("Dock chiclet for LLScriptFloater doesn't exist", 0);
-		}
-		else
-		{
-			chiclet->setShowNewMessagesIcon(false);
-		}
-	}
-}
-
-void LLScriptFloater::savePosition()
-{
-	if(getSavePosition() && mObjectId.notNull())
-	{
-		LLScriptFloaterManager::FloaterPositionInfo fpi = {getRect(), isDocked()};
-		LLScriptFloaterManager::getInstance()->saveFloaterPosition(mObjectId, fpi);
-	}
-}
-
-void LLScriptFloater::restorePosition()
-{
-	LLScriptFloaterManager::FloaterPositionInfo fpi;
-	if(LLScriptFloaterManager::getInstance()->getFloaterPosition(mObjectId, fpi))
-	{
-		dockToChiclet(fpi.mDockState);
-		if(!fpi.mDockState)
-		{
-			// Un-docked floater is opened in 0,0, now move it to saved position
-			translate(fpi.mRect.mLeft - getRect().mLeft, fpi.mRect.mTop - getRect().mTop);
-		}
-	}
-	else
-	{
-		dockToChiclet(true);
-	}
-}
-
-void LLScriptFloater::onFocusLost()
-{
-	if(getNotificationId().notNull())
-	{
-		LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), false);
-	}
-}
-
-void LLScriptFloater::onFocusReceived()
-{
-	// first focus will be received before setObjectId() call - don't toggle chiclet
-	if(getNotificationId().notNull())
-	{
-		LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getNotificationId(), true);
-	}
-}
-
-void LLScriptFloater::dockToChiclet(bool dock)
-{
-	if (getDockControl() == NULL)
-	{
-		LLChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLChiclet>(getNotificationId());
-		if (chiclet == NULL)
-		{
-			llwarns << "Dock chiclet for LLScriptFloater doesn't exist" << llendl;
-			return;
-		}
-		else
-		{
-			LLBottomTray::getInstance()->getChicletPanel()->scrollToChiclet(chiclet);
-		}
-
-		// Stop saving position while we dock floater
-		bool save = getSavePosition();
-		setSavePosition(false);
-
-		setDockControl(new LLDockControl(chiclet, this, getDockTongue(),
-			LLDockControl::TOP,  boost::bind(&LLScriptFloater::getAllowedRect, this, _1)));
-
-		setDocked(dock);
-
-		// Restore saving
-		setSavePosition(save);
-	}
-}
-
-void LLScriptFloater::hideToastsIfNeeded()
-{
-	using namespace LLNotificationsUI;
-
-	// find channel
-	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(LLChannelManager::getInstance()->findChannelByID(
-		LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
-	// update notification channel state
-	if(channel)
-	{
-		channel->updateShowToastsState();
-		channel->redrawToasts();
-	}
-}
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id)
-{
-	if(notification_id.isNull())
-	{
-		llwarns << "Invalid notification ID" << llendl;
-		return;
-	}
-
-	// get scripted Object's ID
-	LLUUID object_id = notification_id_to_object_id(notification_id);
-	
-	// Need to indicate of "new message" for object chiclets according to requirements
-	// specified in the Message Bar design specification. See EXT-3142.
-	bool set_new_message = false;
-	EObjectType obj_type = getObjectType(notification_id);
-
-	// LLDialog can spawn only one instance, LLLoadURL and LLGiveInventory can spawn unlimited number of instances
-	if(OBJ_SCRIPT == obj_type)
-	{
-		// If an Object spawns more-than-one floater, only the newest one is shown. 
-		// The previous is automatically closed.
-		script_notification_map_t::const_iterator it = findUsingObjectId(object_id);
-		if(it != mNotifications.end())
-		{
-			LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(it->first);
-			if(chiclet)
-			{
-				// Pass the new_message icon state further.
-				set_new_message = chiclet->getShowNewMessagesIcon();
-			}
-
-			LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->first);
-			if(floater)
-			{
-				// Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142.
-				set_new_message |= !floater->hasFocus();
-			}
-
-			removeNotification(it->first);
-		}
-	}
-
-	mNotifications.insert(std::make_pair(notification_id, object_id));
-
-	// Create inventory offer chiclet for offer type notifications
-	if( OBJ_GIVE_INVENTORY == obj_type )
-	{
-		LLBottomTray::instance().getChicletPanel()->createChiclet<LLInvOfferChiclet>(notification_id);
-	}
-	else
-	{
-		LLBottomTray::getInstance()->getChicletPanel()->createChiclet<LLScriptChiclet>(notification_id);
-	}
-
-	LLIMWellWindow::getInstance()->addObjectRow(notification_id, set_new_message);
-
-	LLSD data;
-	data["notification_id"] = notification_id;
-	data["new_message"] = set_new_message;
-	data["unread"] = 1; // each object has got only one floater
-	mNewObjectSignal(data);
-
-	toggleScriptFloater(notification_id, set_new_message);
-}
-
-void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id)
-{
-	LLNotificationPtr notification = LLNotifications::instance().find(notification_id);
-	if (notification != NULL && !notification->isCancelled())
-	{
-		LLNotificationsUtil::cancel(notification);
-	}
-
-	onRemoveNotification(notification_id);
-}
-
-void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
-{
-	if(notification_id.isNull())
-	{
-		llwarns << "Invalid notification ID" << llendl;
-		return;
-	}
-
-	// remove related chiclet
-	LLBottomTray::getInstance()->getChicletPanel()->removeChiclet(notification_id);
-
-	LLIMWellWindow::getInstance()->removeObjectRow(notification_id);
-
-	mNotifications.erase(notification_id);
-
-	// close floater
-	LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
-	if(floater)
-	{
-		floater->savePosition();
-		floater->setNotificationId(LLUUID::null);
-		floater->closeFloater();
-	}
-}
-
-void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& notification_id, bool set_new_message)
-{
-	LLSD data;
-	data["notification_id"] = notification_id;
-	data["new_message"] = set_new_message;
-	mToggleFloaterSignal(data);
-
-	// toggle floater
-	LLScriptFloater::toggle(notification_id);
-}
-
-LLUUID LLScriptFloaterManager::findObjectId(const LLUUID& notification_id)
-{
-	script_notification_map_t::const_iterator it = mNotifications.find(notification_id);
-	if(mNotifications.end() != it)
-	{
-		return it->second;
-	}
-	return LLUUID::null;
-}
-
-LLUUID LLScriptFloaterManager::findNotificationId(const LLUUID& object_id)
-{
-	if(object_id.notNull())
-	{
-		script_notification_map_t::const_iterator it = findUsingObjectId(object_id);
-		if(mNotifications.end() != it)
-		{
-			return it->first;
-		}
-	}
-	return LLUUID::null;
-}
-
-// static
-LLScriptFloaterManager::EObjectType LLScriptFloaterManager::getObjectType(const LLUUID& notification_id)
-{
-	if(notification_id.isNull())
-	{
-		llwarns << "Invalid notification ID" << llendl;
-		return OBJ_UNKNOWN;
-	}
-
-	static const object_type_map TYPE_MAP = initObjectTypeMap();
-
-	LLNotificationPtr notification = LLNotificationsUtil::find(notification_id);
-	object_type_map::const_iterator it = TYPE_MAP.find(notification->getName());
-	if(it != TYPE_MAP.end())
-	{
-		return it->second;
-	}
-
-	llwarns << "Unknown object type" << llendl;
-	return OBJ_UNKNOWN;
-}
-
-// static
-std::string LLScriptFloaterManager::getObjectName(const LLUUID& notification_id)
-{
-	using namespace LLNotificationsUI;
-	LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
-	if(!notification)
-	{
-		llwarns << "Invalid notification" << llendl;
-		return LLStringUtil::null;
-	}
-
-	std::string text;
-
-	switch(LLScriptFloaterManager::getObjectType(notification_id))
-	{
-	case LLScriptFloaterManager::OBJ_SCRIPT:
-		text = notification->getSubstitutions()["TITLE"].asString();
-		break;
-	case LLScriptFloaterManager::OBJ_LOAD_URL:
-		text = notification->getSubstitutions()["OBJECTNAME"].asString();
-		break;
-	case LLScriptFloaterManager::OBJ_GIVE_INVENTORY:
-		text = notification->getSubstitutions()["OBJECTFROMNAME"].asString();
-		break;
-	default:
-		text = LLTrans::getString("object");
-		break;
-	}
-
-	return text;
-}
-
-//static
-LLScriptFloaterManager::object_type_map LLScriptFloaterManager::initObjectTypeMap()
-{
-	object_type_map type_map;
-	type_map["ScriptDialog"] = OBJ_SCRIPT;
-	type_map["ScriptDialogGroup"] = OBJ_SCRIPT;
-	type_map["LoadWebPage"] = OBJ_LOAD_URL;
-	type_map["ObjectGiveItem"] = OBJ_GIVE_INVENTORY;
-	return type_map;
-}
-
-LLScriptFloaterManager::script_notification_map_t::const_iterator LLScriptFloaterManager::findUsingObjectId(const LLUUID& object_id)
-{
-	script_notification_map_t::const_iterator it = mNotifications.begin();
-	for(; mNotifications.end() != it; ++it)
-	{
-		if(object_id == it->second)
-		{
-			return it;
-		}
-	}
-	return mNotifications.end();
-}
-
-void LLScriptFloaterManager::saveFloaterPosition(const LLUUID& object_id, const FloaterPositionInfo& fpi)
-{
-	if(object_id.notNull())
-	{
-		LLScriptFloaterManager::getInstance()->mFloaterPositions[object_id] = fpi;
-	}
-	else
-	{
-		llwarns << "Invalid object id" << llendl;
-	}
-}
-
-bool LLScriptFloaterManager::getFloaterPosition(const LLUUID& object_id, FloaterPositionInfo& fpi)
-{
-	floater_position_map_t::const_iterator it = mFloaterPositions.find(object_id);
-	if(LLScriptFloaterManager::getInstance()->mFloaterPositions.end() != it)
-	{
-		fpi = it->second;
-		return true;
-	}
-	return false;
-}
-
-void LLScriptFloaterManager::setFloaterVisible(const LLUUID& notification_id, bool visible)
-{
-	LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>(
-		"script_floater", notification_id);
-	if(floater)
-	{
-		floater->setVisible(visible);
-	}
-}
-
-// EOF
diff --git a/indra/newview/llscripttextboxfloater.h b/indra/newview/llscripttextboxfloater.h
deleted file mode 100644
index b0ab725810..0000000000
--- a/indra/newview/llscripttextboxfloater.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/** 
- * @file llscripttextboxfloater.h
- * @brief LLScriptTextboxFloater class definition
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_SCRIPTTEXTBOXFLOATER_H
-#define LL_SCRIPTTEXTBOXFLOATER_H
-
-#include "lltransientdockablefloater.h"
-
-class LLToastNotifyPanel;
-
-/**
- * Handles script notifications ("ScriptDialog" and "ScriptDialogGroup")
- * and manages Script Floaters.
- */
-class LLScriptTextboxFloaterManager : public LLSingleton<LLScriptTextboxFloaterManager>
-{
-	// *TODO
-	// LLScriptTextboxFloaterManager and LLScriptTextboxFloater will need some refactoring after we 
-	// know how script notifications should look like.
-public:
-
-	typedef enum e_object_type
-	{
-		OBJ_SCRIPT,
-		OBJ_GIVE_INVENTORY,
-		OBJ_LOAD_URL,
-
-		OBJ_UNKNOWN
-	}EObjectType;
-
-	/**
-	 * Handles new notifications.
-	 * Saves notification and object ids, removes old notification if needed, creates script chiclet
-	 * Note that one object can spawn one script floater.
-	 */
-	void onAddNotification(const LLUUID& notification_id);
-
-	/**
-	 * Removes notification.
-	 */
-	void removeNotification(const LLUUID& notification_id);
-
-	/**
-	 * Handles notification removal.
-	 * Removes script notification toast, removes script chiclet, closes script floater
-	 */
-	void onRemoveNotification(const LLUUID& notification_id);
-
-	/**
-	 * Toggles script floater.
-	 * Removes "new message" icon from chiclet and removes notification toast.
-	 */
-	void toggleScriptFloater(const LLUUID& object_id, bool set_new_message = false);
-
-	LLUUID findObjectId(const LLUUID& notification_id);
-
-	LLUUID findNotificationId(const LLUUID& object_id);
-
-	static EObjectType getObjectType(const LLUUID& notification_id);
-
-	static std::string getObjectName(const LLUUID& notification_id);
-
-	typedef boost::signals2::signal<void(const LLSD&)> object_signal_t;
-
-	boost::signals2::connection addNewObjectCallback(const object_signal_t::slot_type& cb) { return mNewObjectSignal.connect(cb); }
-	boost::signals2::connection addToggleObjectFloaterCallback(const object_signal_t::slot_type& cb) { return mToggleFloaterSignal.connect(cb); }
-
-	struct FloaterPositionInfo
-	{
-		LLRect mRect;
-		bool mDockState;
-	};
-
-	void saveFloaterPosition(const LLUUID& object_id, const FloaterPositionInfo& fpi);
-
-	bool getFloaterPosition(const LLUUID& object_id, FloaterPositionInfo& fpi);
-
-	void setFloaterVisible(const LLUUID& notification_id, bool visible);
-
-protected:
-
-	typedef std::map<std::string, EObjectType> object_type_map;
-
-	static object_type_map initObjectTypeMap();
-
-	// <notification_id, object_id>
-	typedef std::map<LLUUID, LLUUID> script_notification_map_t;
-
-	script_notification_map_t::const_iterator findUsingObjectId(const LLUUID& object_id);
-
-private:
-
-	script_notification_map_t mNotifications;
-
-	object_signal_t mNewObjectSignal;
-	object_signal_t mToggleFloaterSignal;
-
-	// <object_id, floater position>
-	typedef std::map<LLUUID, FloaterPositionInfo> floater_position_map_t;
-
-	floater_position_map_t mFloaterPositions;
-};
-
-/**
- * Floater script forms.
- * LLScriptTextboxFloater will create script form based on notification data and 
- * will auto fit the form.
- */
-class LLScriptTextboxFloater : public LLDockableFloater
-{
-public:
-
-	/**
-	 * key - UUID of scripted Object
-	 */
-	LLScriptTextboxFloater(const LLSD& key);
-
-	virtual ~LLScriptTextboxFloater(){};
-
-	/**
-	 * Toggle existing floater or create and show a new one.
-	 */
-	static bool toggle(const LLUUID& object_id);
-
-	/**
-	 * Creates and shows floater
-	 */
-	static LLScriptTextboxFloater* show(const LLUUID& object_id);
-
-	const LLUUID& getNotificationId() { return mNotificationId; }
-
-	void setNotificationId(const LLUUID& id);
-
-	/**
-	 * Close notification if script floater is closed.
-	 */
-	/*virtual*/ void onClose(bool app_quitting);
-
-	/**
-	 * Hide all notification toasts when we show dockable floater
-	 */
-	/*virtual*/ void setDocked(bool docked, bool pop_on_undock = true);
-
-	/**
-	 * Hide all notification toasts when we show dockable floater
-	 */
-	/*virtual*/ void setVisible(BOOL visible);
-
-	bool getSavePosition() { return mSaveFloaterPosition; }
-
-	void setSavePosition(bool save) { mSaveFloaterPosition = save; }
-
-	void savePosition();
-
-	void restorePosition();
-
-protected:
-
-	/**
-	 * Creates script form, will delete old form if floater is shown for same object.
-	 */
-	void createForm(const LLUUID& object_id);
-
-	/*virtual*/ void getAllowedRect(LLRect& rect);
-
-	/**
-	 * Hide all notification toasts.
-	 */
-	static void hideToastsIfNeeded();
-
-	/**
-	 * Removes chiclets new messages icon
-	 */
-	void onMouseDown();
-
-	/*virtual*/ void onFocusLost();
-	
-	/*virtual*/ void onFocusReceived();
-
-	void dockToChiclet(bool dock);
-
-private:
-	LLToastNotifyPanel* mScriptForm;
-	LLUUID mNotificationId;
-	LLUUID mObjectId;
-	bool mSaveFloaterPosition;
-};
-
-#endif //LL_SCRIPTFLOATER_H
-- 
cgit v1.2.3


From b6a498c3018976b97c2353be066502e4a298e156 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Tue, 28 Sep 2010 13:41:46 +0100
Subject: iterate iterate.

---
 indra/newview/llscriptfloater.cpp      | 11 +++++++++--
 indra/newview/llscriptfloater.h        |  2 ++
 indra/newview/lltoastscripttextbox.cpp |  2 +-
 indra/newview/lltoastscripttextbox.h   |  4 ++--
 4 files changed, 14 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index 0f7223aaf0..678611a943 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -152,9 +152,9 @@ void LLScriptFloater::createForm(const LLUUID& notification_id)
 
 	// create new form
 	LLRect toast_rect = getRect();
-	if (isScriptTextBox())
+	if (isScriptTextbox())
 	{
-		mScriptForm = new LLToastScriptTextbox(notify, toast_rect);
+		mScriptForm = new LLToastScriptTextbox(notification);
 	}
 	else
 	{
@@ -573,4 +573,11 @@ void LLScriptFloaterManager::setFloaterVisible(const LLUUID& notification_id, bo
 	}
 }
 
+//////////////////////////////////////////////////////////////////
+
+bool  LLScriptFloater::isScriptTextbox()
+{
+	return true;
+}
+
 // EOF
diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h
index da70bb4334..fec81704d8 100644
--- a/indra/newview/llscriptfloater.h
+++ b/indra/newview/llscriptfloater.h
@@ -203,6 +203,8 @@ protected:
 	void dockToChiclet(bool dock);
 
 private:
+	bool isScriptTextbox();
+
 	LLToastNotifyPanel* mScriptForm;
 	LLUUID mNotificationId;
 	LLUUID mObjectId;
diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index b203579362..7fef346ae5 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -51,7 +51,7 @@
 const S32 LLToastScriptTextbox::DEFAULT_MESSAGE_MAX_LINE_COUNT	= 7;
 
 LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
-:	LLToastPanel(notification),
+:	LLToastNotifyPanel(notification),
 	mInventoryOffer(NULL)
 {
 	buildFromFile( "panel_notify_textbox.xml");
diff --git a/indra/newview/lltoastscripttextbox.h b/indra/newview/lltoastscripttextbox.h
index 2d942939bc..86fe93cf66 100644
--- a/indra/newview/lltoastscripttextbox.h
+++ b/indra/newview/lltoastscripttextbox.h
@@ -28,7 +28,7 @@
 #define LL_LLTOASTSCRIPTTEXTBOX_H
 
 #include "llfontgl.h"
-#include "lltoastpanel.h"
+#include "lltoastnotifypanel.h"
 #include "lldarray.h"
 #include "lltimer.h"
 #include "llviewermessage.h"
@@ -42,7 +42,7 @@ class LLButton;
  * Replaces class LLGroupNotifyBox.
  */
 class LLToastScriptTextbox
-:	public LLToastPanel
+:	public LLToastNotifyPanel
 {
 public:
 	void close();
-- 
cgit v1.2.3


From d2474edf85674aa4fb150caee184fc434915d5e6 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Tue, 28 Sep 2010 17:47:24 +0100
Subject: restore switching logic between textbox/nontextbox, after the
 refactor.

---
 indra/newview/llscriptfloater.cpp | 29 ++++++++++++++++++++++++++---
 indra/newview/llscriptfloater.h   |  3 ++-
 2 files changed, 28 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index 678611a943..825ee0823d 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -32,6 +32,7 @@
 #include "llchannelmanager.h"
 #include "llchiclet.h"
 #include "llfloaterreg.h"
+#include "lllslconstants.h"
 #include "llnotifications.h"
 #include "llnotificationsutil.h"
 #include "llscreenchannel.h"
@@ -152,7 +153,7 @@ void LLScriptFloater::createForm(const LLUUID& notification_id)
 
 	// create new form
 	LLRect toast_rect = getRect();
-	if (isScriptTextbox())
+	if (isScriptTextbox(notification))
 	{
 		mScriptForm = new LLToastScriptTextbox(notification);
 	}
@@ -575,9 +576,31 @@ void LLScriptFloaterManager::setFloaterVisible(const LLUUID& notification_id, bo
 
 //////////////////////////////////////////////////////////////////
 
-bool  LLScriptFloater::isScriptTextbox()
+bool LLScriptFloater::isScriptTextbox(LLNotificationPtr notification)
 {
-	return true;
+	// get a form for the notification
+	LLNotificationFormPtr form(notification->getForm());
+
+	if (form)
+	{
+		// get number of elements
+		int num_options = form->getNumElements();
+	
+		// 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<num_options; ++i)
+		{
+			LLSD form_element = form->getElement(i);
+			llwarns << form_element << llendl;
+			if (form_element["name"].asString() == TEXTBOX_MAGIC_TOKEN)
+			{
+				return true;
+			}
+		}
+	}
+
+	return false;
 }
 
 // EOF
diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h
index fec81704d8..dc52baa115 100644
--- a/indra/newview/llscriptfloater.h
+++ b/indra/newview/llscriptfloater.h
@@ -28,6 +28,7 @@
 #define LL_SCRIPTFLOATER_H
 
 #include "lltransientdockablefloater.h"
+#include "llnotificationptr.h"
 
 class LLToastNotifyPanel;
 
@@ -203,7 +204,7 @@ protected:
 	void dockToChiclet(bool dock);
 
 private:
-	bool isScriptTextbox();
+	bool isScriptTextbox(LLNotificationPtr notification);
 
 	LLToastNotifyPanel* mScriptForm;
 	LLUUID mNotificationId;
-- 
cgit v1.2.3


From e73e8de56fc2a0fd35cde975f82ead1a02112cbe Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Tue, 28 Sep 2010 18:13:21 +0100
Subject: trivial reformat before I tear this apart.

---
 indra/newview/lltoastscripttextbox.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 7fef346ae5..64360b9e48 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -80,13 +80,13 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 	const std::string& message = payload["message"].asString();
 
 	std::string timeStr = "["+LLTrans::getString("UTCTimeWeek")+"],["
-							+LLTrans::getString("UTCTimeDay")+"] ["
-							+LLTrans::getString("UTCTimeMth")+"] ["
-							+LLTrans::getString("UTCTimeYr")+"] ["
-							+LLTrans::getString("UTCTimeHr")+"]:["
-							+LLTrans::getString("UTCTimeMin")+"]:["
-							+LLTrans::getString("UTCTimeSec")+"] ["
-							+LLTrans::getString("UTCTimeTimezone")+"]";
+		+LLTrans::getString("UTCTimeDay")+"] ["
+		+LLTrans::getString("UTCTimeMth")+"] ["
+		+LLTrans::getString("UTCTimeYr")+"] ["
+		+LLTrans::getString("UTCTimeHr")+"]:["
+		+LLTrans::getString("UTCTimeMin")+"]:["
+		+LLTrans::getString("UTCTimeSec")+"] ["
+		+LLTrans::getString("UTCTimeTimezone")+"]";
 	const LLDate timeStamp = notification->getDate();
 	LLDate notice_date = timeStamp.notNull() ? timeStamp : LLDate::now();
 	LLSD substitution;
-- 
cgit v1.2.3


From 7007896f9811022c58fab6e7e320dfb6773b1a71 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 12:23:15 +0100
Subject: trivial comment changes.

---
 indra/newview/llscriptfloater.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index 825ee0823d..53a5881f4b 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -583,12 +583,12 @@ bool LLScriptFloater::isScriptTextbox(LLNotificationPtr notification)
 
 	if (form)
 	{
-		// get number of elements
+		// get number of elements in the form
 		int num_options = form->getNumElements();
 	
-		// 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)
+		// 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<num_options; ++i)
 		{
 			LLSD form_element = form->getElement(i);
-- 
cgit v1.2.3


From 32b04991c86b4e6467a23e6b5ce264e4ec5c2ad9 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 13:56:12 +0100
Subject: textbox dialog working, preparing to send response properly.

---
 indra/newview/lltoastscripttextbox.cpp             | 41 ++++++++++------------
 .../skins/default/xui/en/panel_notify_textbox.xml  |  3 +-
 2 files changed, 19 insertions(+), 25 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 64360b9e48..391aee79e8 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -57,25 +57,23 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 	buildFromFile( "panel_notify_textbox.xml");
 
 	const LLSD& payload = notification->getPayload();
-	LLGroupData groupData;
-	if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData))
-	{
-		llwarns << "Group notice for unknown group: " << payload["group_id"].asUUID() << llendl;
-	}
-
-	//group icon
-	LLIconCtrl* pGroupIcon = getChild<LLIconCtrl>("group_icon", TRUE);
-	pGroupIcon->setValue(groupData.mInsigniaID);
-
-	//header title
-	const std::string& from_name = payload["sender_name"].asString();
-	std::stringstream from;
-	from << from_name << "/" << groupData.mName;
-	LLTextBox* pTitleText = getChild<LLTextBox>("title");
-	pTitleText->setValue(from.str());
+	llwarns << "PAYLOAD " << payload << llendl;
+	llwarns << "TYPE " << notification->getType() << llendl;
+	llwarns << "MESSAGE " << notification->getMessage() << llendl;
+	llwarns << "LABEL " << notification->getLabel() << llendl;
+	llwarns << "URL " << notification->getURL() << llendl;
+
+	/*
+2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: PAYLOAD {'chat_channel':i-376,'object_id':ubb05bcf2-4eca-2203-13f4-b328411d344f,'sender':'216.82.20.80:13001'}
+2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: TYPE notify
+2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: MESSAGE Tofu Tester's 'lltextbox test'
+Write something here...
+2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: LABEL 
+2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: URL 
+*/
 
 	//message subject
-	const std::string& subject = payload["subject"].asString();
+	//const std::string& subject = payload["subject"].asString();
 	//message body
 	const std::string& message = payload["message"].asString();
 
@@ -97,10 +95,6 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 	pMessageText->clear();
 
 	LLStyle::Params style;
-	LLFontGL* subject_font = LLFontGL::getFontByName(getString("subject_font"));
-	if (subject_font) 
-		style.font = subject_font;
-	pMessageText->appendText(subject, FALSE, style);
 
 	LLFontGL* date_font = LLFontGL::getFontByName(getString("date_font"));
 	if (date_font)
@@ -109,7 +103,7 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 	
 	style.font = pMessageText->getDefaultFont();
 	pMessageText->appendText(message, TRUE, style);
-
+	/*
 	//attachment
 	BOOL hasInventory = payload["inventory_offer"].isDefined();
 
@@ -132,7 +126,7 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 												LLInventoryType::IT_TEXTURE);
 		pAttachIcon->setValue(attachIconImg->getName());
 	}
-
+	*/
 	//ok button
 	LLButton* pOkBtn = getChild<LLButton>("btn_ok");
 	pOkBtn->setClickedCallback((boost::bind(&LLToastScriptTextbox::onClickOk, this)));
@@ -169,6 +163,7 @@ void LLToastScriptTextbox::close()
 void LLToastScriptTextbox::onClickOk()
 {
 	LLSD response = mNotification->getResponseTemplate();
+	response["OH MY GOD WHAT A HACK"] = true;
 	mNotification->respond(response);
 	close();
 }
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 a0d103e2a3..6a07d41e7e 100644
--- a/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
+++ b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
@@ -59,8 +59,7 @@
      max_length="2147483647"
      name="message"
      parse_highlights="true"
-     read_only="true"
-     text_color="GroupNotifyTextColor"
+     read_only="false"
      top="40"
      type="string"
      use_ellipses="true"
-- 
cgit v1.2.3


From 921d6187073afa3e76e05395ddb8a64f9f479d68 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 14:10:04 +0100
Subject: clean up xui a bit, still working on proper script reponse.

---
 indra/newview/lltoastscripttextbox.cpp             |  9 +++-
 .../skins/default/xui/en/panel_notify_textbox.xml  | 58 +---------------------
 2 files changed, 8 insertions(+), 59 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 391aee79e8..a9f8272ea9 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -151,12 +151,13 @@ void LLToastScriptTextbox::close()
 	// The group notice dialog may be an inventory offer.
 	// If it has an inventory save button and that button is still enabled
 	// Then we need to send the inventory declined message
+	/*
 	if(mInventoryOffer != NULL)
 	{
 		mInventoryOffer->forceResponse(IOR_DECLINE);
 		mInventoryOffer = NULL;
 	}
-
+	*/
 	die();
 }
 
@@ -166,8 +167,9 @@ void LLToastScriptTextbox::onClickOk()
 	response["OH MY GOD WHAT A HACK"] = true;
 	mNotification->respond(response);
 	close();
+	//llerrs << response << llendl;
 }
-
+/*
 void LLToastScriptTextbox::onClickAttachment()
 {
 	if (mInventoryOffer != NULL) {
@@ -190,7 +192,9 @@ void LLToastScriptTextbox::onClickAttachment()
 		mInventoryOffer = NULL;
 	}
 }
+*/
 
+ /*
 //static
 bool LLToastScriptTextbox::isAttachmentOpenable(LLAssetType::EType type)
 {
@@ -208,3 +212,4 @@ bool LLToastScriptTextbox::isAttachmentOpenable(LLAssetType::EType type)
 	}
 }
 
+ */
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 6a07d41e7e..dcd1e29e17 100644
--- a/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
+++ b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
@@ -11,44 +11,9 @@
     <string
      name="message_max_lines_count"
      value="7" />
-    <string
-     name="subject_font"
-     value="SANSSERIF_BIG" />
     <string
      name="date_font"
      value="SANSSERIF" />
-    <panel
-     background_visible="true"
-     follows="top"
-     height="30"
-     label="header"
-     layout="topleft"
-     left="0"
-     name="header"
-     top="0"
-     width="305">
-        <icon
-         follows="all"
-         height="20"
-         layout="topleft"
-         left="5"
-         mouse_opaque="true"
-         name="group_icon"
-         top="5"
-         width="20" />
-        <text
-         follows="all"
-         font="SansSerifBig"
-         height="20"
-         layout="topleft"
-         left_pad="10"
-         name="title"
-         text_color="GroupNotifyTextColor"
-         top="5"
-         use_ellipses="true"
-         value="Sender Name / Group Name"
-         width="230" />
-    </panel>
     <text_editor
      parse_urls="true"
      enabled="true"
@@ -65,29 +30,8 @@
      use_ellipses="true"
      value="message"
      width="270"
-	 word_wrap="true" >
+     word_wrap="true" >
     </text_editor>
-    <icon
-     bottom="60"
-     follows="left|bottom|right"
-     height="15"
-     layout="topleft"
-     left="25"
-     mouse_opaque="true"
-     name="attachment_icon"
-     width="15" />
-    <text
-     bottom="60"
-     follows="left|bottom|right"
-     font="SansSerif"
-     height="15"
-     layout="topleft"
-     left="45"
-     name="attachment"
-     text_color="GroupNotifyTextColor"
-     value="Attachment"
-     use_ellipses="true"
-     width="250" />
     <button
      bottom="85"
      follows="bottom"
-- 
cgit v1.2.3


From 42ed8e8ffadd6bd7d8784084e9a29badf5d75c5c Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 17:03:05 +0100
Subject: response is starting to limp along.

---
 indra/newview/lltoastnotifypanel.cpp   | 1 +
 indra/newview/lltoastscripttextbox.cpp | 6 ++++--
 indra/newview/llviewermessage.cpp      | 6 +++++-
 3 files changed, 10 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 51f32331d8..45c031964c 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -527,6 +527,7 @@ void LLToastNotifyPanel::onClickButton(void* data)
 		self->mNotification->setResponder(new_info);
 	}
 
+	llwarns << response << llendl;
 	self->mNotification->respond(response);
 
 	if(is_reusable)
diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index a9f8272ea9..2a0d971a44 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -161,13 +161,15 @@ void LLToastScriptTextbox::close()
 	die();
 }
 
+#include "lllslconstants.h"
 void LLToastScriptTextbox::onClickOk()
 {
 	LLSD response = mNotification->getResponseTemplate();
-	response["OH MY GOD WHAT A HACK"] = true;
+	//response["OH MY GOD WHAT A HACK"] = "woot";
+	response[TEXTBOX_MAGIC_TOKEN] = "ffffffffuuuuu";
 	mNotification->respond(response);
 	close();
-	//llerrs << response << llendl;
+	llwarns << response << llendl;
 }
 /*
 void LLToastScriptTextbox::onClickAttachment()
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 26b7e0fb6d..b78c7b3d66 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6171,10 +6171,14 @@ const S32 SCRIPT_DIALOG_BUTTON_STR_SIZE = 24;
 const S32 SCRIPT_DIALOG_MAX_MESSAGE_SIZE = 512;
 const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n";
 
+#include "lllslconstants.h"
 bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 {
 	LLNotificationForm form(notification["form"]);
-	std::string button = LLNotification::getSelectedOptionName(response);
+	//std::string button = "booya";//LLNotification::getSelectedOptionName(response);
+	std::string button = response[TEXTBOX_MAGIC_TOKEN].asString().empty() ?
+		LLNotification::getSelectedOptionName(response) :
+		response[TEXTBOX_MAGIC_TOKEN].asString();
 	S32 button_idx = LLNotification::getSelectedOption(notification, response);
 	// Didn't click "Ignore"
 	if (button_idx != -1)
-- 
cgit v1.2.3


From 578ee535644931ede7dd74741d905d04d8da7fd6 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 17:20:16 +0100
Subject: work on response integrity.

---
 indra/newview/lltoastscripttextbox.cpp | 17 +++++++++++------
 indra/newview/llviewermessage.cpp      |  6 +++---
 2 files changed, 14 insertions(+), 9 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 2a0d971a44..91a4831a9c 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -164,12 +164,17 @@ void LLToastScriptTextbox::close()
 #include "lllslconstants.h"
 void LLToastScriptTextbox::onClickOk()
 {
-	LLSD response = mNotification->getResponseTemplate();
-	//response["OH MY GOD WHAT A HACK"] = "woot";
-	response[TEXTBOX_MAGIC_TOKEN] = "ffffffffuuuuu";
-	mNotification->respond(response);
-	close();
-	llwarns << response << llendl;
+	LLViewerTextEditor* pMessageText = getChild<LLViewerTextEditor>("message");
+
+	if (pMessageText)
+	{
+		LLSD response = mNotification->getResponseTemplate();
+		//response["OH MY GOD WHAT A HACK"] = "woot";
+		response[TEXTBOX_MAGIC_TOKEN] = pMessageText->getText();
+		mNotification->respond(response);
+		close();
+		llwarns << response << llendl;
+	}
 }
 /*
 void LLToastScriptTextbox::onClickAttachment()
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index b78c7b3d66..f897f5e733 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6176,9 +6176,9 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 {
 	LLNotificationForm form(notification["form"]);
 	//std::string button = "booya";//LLNotification::getSelectedOptionName(response);
-	std::string button = response[TEXTBOX_MAGIC_TOKEN].asString().empty() ?
-		LLNotification::getSelectedOptionName(response) :
-		response[TEXTBOX_MAGIC_TOKEN].asString();
+	std::string button = response.has(TEXTBOX_MAGIC_TOKEN) ?
+		response[TEXTBOX_MAGIC_TOKEN].asString() :
+		LLNotification::getSelectedOptionName(response);
 	S32 button_idx = LLNotification::getSelectedOption(notification, response);
 	// Didn't click "Ignore"
 	if (button_idx != -1)
-- 
cgit v1.2.3


From f7f3df3a2c0b7a87828c4a2c777d9a94502f3d4e Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 18:39:47 +0100
Subject: make empty textboxes return an empty string instead of doing nothing.
  I hope.

---
 indra/newview/llviewermessage.cpp | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index f897f5e733..321100e140 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6176,10 +6176,20 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 {
 	LLNotificationForm form(notification["form"]);
 	//std::string button = "booya";//LLNotification::getSelectedOptionName(response);
-	std::string button = response.has(TEXTBOX_MAGIC_TOKEN) ?
-		response[TEXTBOX_MAGIC_TOKEN].asString() :
-		LLNotification::getSelectedOptionName(response);
-	S32 button_idx = LLNotification::getSelectedOption(notification, response);
+	llwarns << "ok: " << response << llendl;
+	std::string rtn_text;
+	S32 button_idx;
+	if (response[TEXTBOX_MAGIC_TOKEN].isDefined())
+	{
+		rtn_text = response[TEXTBOX_MAGIC_TOKEN].asString();
+		button_idx = 0;
+	}
+	else
+	{
+		rtn_text = LLNotification::getSelectedOptionName(response);
+		button_idx = LLNotification::getSelectedOption(notification, response);
+	}
+	llwarns << "rtn: " << rtn_text << " btnidx: " << button_idx << llendl;
 	// Didn't click "Ignore"
 	if (button_idx != -1)
 	{
@@ -6192,7 +6202,7 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 		msg->addUUID("ObjectID", notification["payload"]["object_id"].asUUID());
 		msg->addS32("ChatChannel", notification["payload"]["chat_channel"].asInteger());
 		msg->addS32("ButtonIndex", button_idx);
-		msg->addString("ButtonLabel", button);
+		msg->addString("ButtonLabel", rtn_text);
 		msg->sendReliable(LLHost(notification["payload"]["sender"].asString()));
 	}
 
-- 
cgit v1.2.3


From ca1821048583acedaae7e1dbfe83a0b058faee2c Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 19:00:55 +0100
Subject: more robustness for empty-but-not-aborted textboxes.

---
 indra/newview/lltoastscripttextbox.cpp | 6 ++++++
 indra/newview/llviewermessage.cpp      | 5 ++---
 2 files changed, 8 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 91a4831a9c..bdadff4cb0 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -171,6 +171,12 @@ void LLToastScriptTextbox::onClickOk()
 		LLSD response = mNotification->getResponseTemplate();
 		//response["OH MY GOD WHAT A HACK"] = "woot";
 		response[TEXTBOX_MAGIC_TOKEN] = pMessageText->getText();
+		if (response[TEXTBOX_MAGIC_TOKEN].asString().empty())
+		{
+			// so we can distinguish between a successfully
+			// submitted blank textbox, and an ignored toast
+			response[TEXTBOX_MAGIC_TOKEN] = true;
+		}
 		mNotification->respond(response);
 		close();
 		llwarns << response << llendl;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 321100e140..3a8f76aca1 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6179,15 +6179,14 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 	llwarns << "ok: " << response << llendl;
 	std::string rtn_text;
 	S32 button_idx;
-	if (response[TEXTBOX_MAGIC_TOKEN].isDefined())
+	button_idx = LLNotification::getSelectedOption(notification, response);
+	if (response[TEXTBOX_MAGIC_TOKEN].isString())
 	{
 		rtn_text = response[TEXTBOX_MAGIC_TOKEN].asString();
-		button_idx = 0;
 	}
 	else
 	{
 		rtn_text = LLNotification::getSelectedOptionName(response);
-		button_idx = LLNotification::getSelectedOption(notification, response);
 	}
 	llwarns << "rtn: " << rtn_text << " btnidx: " << button_idx << llendl;
 	// Didn't click "Ignore"
-- 
cgit v1.2.3


From 2669b54e2c25ca705c4a41a89d46dee7a199757e Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 19:13:02 +0100
Subject: start to de-cruftify.

---
 indra/newview/lltoastscripttextbox.cpp | 88 +---------------------------------
 1 file changed, 1 insertion(+), 87 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index bdadff4cb0..23ae4c142d 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -63,15 +63,6 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 	llwarns << "LABEL " << notification->getLabel() << llendl;
 	llwarns << "URL " << notification->getURL() << llendl;
 
-	/*
-2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: PAYLOAD {'chat_channel':i-376,'object_id':ubb05bcf2-4eca-2203-13f4-b328411d344f,'sender':'216.82.20.80:13001'}
-2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: TYPE notify
-2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: MESSAGE Tofu Tester's 'lltextbox test'
-Write something here...
-2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: LABEL 
-2010-09-29T12:24:44Z WARNING: LLToastScriptTextbox: URL 
-*/
-
 	//message subject
 	//const std::string& subject = payload["subject"].asString();
 	//message body
@@ -103,30 +94,7 @@ Write something here...
 	
 	style.font = pMessageText->getDefaultFont();
 	pMessageText->appendText(message, TRUE, style);
-	/*
-	//attachment
-	BOOL hasInventory = payload["inventory_offer"].isDefined();
-
-	//attachment text
-	LLTextBox * pAttachLink = getChild<LLTextBox>("attachment");
-	//attachment icon
-	LLIconCtrl* pAttachIcon = getChild<LLIconCtrl>("attachment_icon", TRUE);
-
-	//If attachment is empty let it be invisible and not take place at the panel
-	pAttachLink->setVisible(hasInventory);
-	pAttachIcon->setVisible(hasInventory);
-	if (hasInventory) {
-		pAttachLink->setValue(payload["inventory_name"]);
-
-		mInventoryOffer = new LLOfferInfo(payload["inventory_offer"]);
-		getChild<LLTextBox>("attachment")->setClickedCallback(boost::bind(
-				&LLToastScriptTextbox::onClickAttachment, this));
-
-		LLUIImagePtr attachIconImg = LLInventoryIcon::getIcon(mInventoryOffer->mType,
-												LLInventoryType::IT_TEXTURE);
-		pAttachIcon->setValue(attachIconImg->getName());
-	}
-	*/
+
 	//ok button
 	LLButton* pOkBtn = getChild<LLButton>("btn_ok");
 	pOkBtn->setClickedCallback((boost::bind(&LLToastScriptTextbox::onClickOk, this)));
@@ -148,16 +116,6 @@ LLToastScriptTextbox::~LLToastScriptTextbox()
 
 void LLToastScriptTextbox::close()
 {
-	// The group notice dialog may be an inventory offer.
-	// If it has an inventory save button and that button is still enabled
-	// Then we need to send the inventory declined message
-	/*
-	if(mInventoryOffer != NULL)
-	{
-		mInventoryOffer->forceResponse(IOR_DECLINE);
-		mInventoryOffer = NULL;
-	}
-	*/
 	die();
 }
 
@@ -182,47 +140,3 @@ void LLToastScriptTextbox::onClickOk()
 		llwarns << response << llendl;
 	}
 }
-/*
-void LLToastScriptTextbox::onClickAttachment()
-{
-	if (mInventoryOffer != NULL) {
-		mInventoryOffer->forceResponse(IOR_ACCEPT);
-
-		LLTextBox * pAttachLink = getChild<LLTextBox> ("attachment");
-		static const LLUIColor textColor = LLUIColorTable::instance().getColor(
-				"GroupNotifyDimmedTextColor");
-		pAttachLink->setColor(textColor);
-
-		LLIconCtrl* pAttachIcon =
-				getChild<LLIconCtrl> ("attachment_icon", TRUE);
-		pAttachIcon->setEnabled(FALSE);
-
-		//if attachment isn't openable - notify about saving
-		if (!isAttachmentOpenable(mInventoryOffer->mType)) {
-			LLNotifications::instance().add("AttachmentSaved", LLSD(), LLSD());
-		}
-
-		mInventoryOffer = NULL;
-	}
-}
-*/
-
- /*
-//static
-bool LLToastScriptTextbox::isAttachmentOpenable(LLAssetType::EType type)
-{
-	switch(type)
-	{
-	case LLAssetType::AT_LANDMARK:
-	case LLAssetType::AT_NOTECARD:
-	case LLAssetType::AT_IMAGE_JPEG:
-	case LLAssetType::AT_IMAGE_TGA:
-	case LLAssetType::AT_TEXTURE:
-	case LLAssetType::AT_TEXTURE_TGA:
-		return true;
-	default:
-		return false;
-	}
-}
-
- */
-- 
cgit v1.2.3


From 4dfb0b7b2d76cf288cca34c23218c4769ec76991 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 29 Sep 2010 19:33:03 +0100
Subject: finally, properly(?) deal with submitting empty text.

---
 indra/newview/lltoastscripttextbox.cpp | 2 --
 indra/newview/llviewermessage.cpp      | 7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 23ae4c142d..95f70eda88 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -63,8 +63,6 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 	llwarns << "LABEL " << notification->getLabel() << llendl;
 	llwarns << "URL " << notification->getURL() << llendl;
 
-	//message subject
-	//const std::string& subject = payload["subject"].asString();
 	//message body
 	const std::string& message = payload["message"].asString();
 
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3a8f76aca1..e284d8d154 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6180,9 +6180,12 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 	std::string rtn_text;
 	S32 button_idx;
 	button_idx = LLNotification::getSelectedOption(notification, response);
-	if (response[TEXTBOX_MAGIC_TOKEN].isString())
+	if (response[TEXTBOX_MAGIC_TOKEN].isDefined())
 	{
-		rtn_text = response[TEXTBOX_MAGIC_TOKEN].asString();
+		if (response[TEXTBOX_MAGIC_TOKEN].isString())
+			rtn_text = response[TEXTBOX_MAGIC_TOKEN].asString();
+		else
+			rtn_text.clear(); // bool marks empty string
 	}
 	else
 	{
-- 
cgit v1.2.3


From 793d6579fcfb427d9abafdcd728ef18887dbfc11 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Thu, 30 Sep 2010 10:35:06 +0100
Subject: remove a wad of the experimental evil deadcode that I added while
 hacking.

---
 indra/newview/CMakeLists.txt                       |   1 -
 indra/newview/llnotificationhandler.h              |  22 +--
 indra/newview/llnotificationmanager.cpp            |   1 -
 .../newview/llnotificationscripttextboxhandler.cpp | 174 ---------------------
 4 files changed, 1 insertion(+), 197 deletions(-)
 delete mode 100644 indra/newview/llnotificationscripttextboxhandler.cpp

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 300103929b..c439781175 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -309,7 +309,6 @@ set(viewer_SOURCE_FILES
     llnotificationmanager.cpp
     llnotificationofferhandler.cpp
     llnotificationscripthandler.cpp
-    llnotificationscripttextboxhandler.cpp
     llnotificationstorage.cpp
     llnotificationtiphandler.cpp
     lloutfitslist.cpp
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h
index a9ae2bd21f..28a69f2373 100644
--- a/indra/newview/llnotificationhandler.h
+++ b/indra/newview/llnotificationhandler.h
@@ -197,29 +197,9 @@ protected:
 	virtual void initChannel();
 
 	// own handlers
-	virtual void onRejectToast(LLUUID& id);
+	void onRejectToast(LLUUID& id);
 };
 
-/**
- * Handler for specific textbox-based script notices.
- */
-
-class LLScriptTextboxHandler : public LLSysHandler
-{
- public:
-	LLScriptTextboxHandler(e_notification_type type, const LLSD& id);
-	virtual ~LLScriptTextboxHandler();
-
-	// base interface functions
-	virtual bool processNotification(const LLSD& notify);
-
-protected:
-	virtual void onDeleteToast(LLToast* toast);
-	virtual void initChannel();
-
-	// own handlers
-	virtual void onRejectToast(LLUUID& id);
-};
 
 /**
  * Handler for group system notices.
diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index 3967117fc8..6988227128 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -74,7 +74,6 @@ void LLNotificationManager::init()
 	LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
 
 	mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
-	//mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptTextboxHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["notifytip"] =  boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
 	mNotifyHandlers["groupnotify"] = boost::shared_ptr<LLEventHandler>(new LLGroupHandler(NT_GROUPNOTIFY, LLSD()));
 	mNotifyHandlers["alert"] = boost::shared_ptr<LLEventHandler>(new LLAlertHandler(NT_ALERT, LLSD()));
diff --git a/indra/newview/llnotificationscripttextboxhandler.cpp b/indra/newview/llnotificationscripttextboxhandler.cpp
deleted file mode 100644
index 9556501c42..0000000000
--- a/indra/newview/llnotificationscripttextboxhandler.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-/** 
- * @file llnotificationscripthandler.cpp
- * @brief Notification Handler Class for Simple Notifications and Notification Tips
- *
- * $LicenseInfo:firstyear=2000&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-
-#include "llviewerprecompiledheaders.h" // must be first include
-
-#include "llnotificationhandler.h"
-#include "lltoastnotifypanel.h"
-#include "llviewercontrol.h"
-#include "llviewerwindow.h"
-#include "llnotificationmanager.h"
-#include "llnotifications.h"
-#include "llscriptfloater.h"
-#include "lltoastscripttextbox.h"
-
-using namespace LLNotificationsUI;
-
-static const std::string SCRIPT_DIALOG				("ScriptDialog");
-static const std::string SCRIPT_DIALOG_GROUP		("ScriptDialogGroup");
-static const std::string SCRIPT_LOAD_URL			("LoadWebPage");
-
-//--------------------------------------------------------------------------
-LLScriptTextboxHandler::LLScriptTextboxHandler(e_notification_type type, const LLSD& id)
-{
-	mType = type;
-
-	// Getting a Channel for our notifications
-	mChannel = LLChannelManager::getInstance()->createNotificationChannel();
-	mChannel->setControlHovering(true);
-	
-	LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
-	if(channel)
-		channel->setOnRejectToastCallback(boost::bind(&LLScriptTextboxHandler::onRejectToast, this, _1));
-
-}
-
-//--------------------------------------------------------------------------
-LLScriptTextboxHandler::~LLScriptTextboxHandler()
-{
-}
-
-//--------------------------------------------------------------------------
-void LLScriptTextboxHandler::initChannel()
-{
-	S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); 
-	S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
-	mChannel->init(channel_right_bound - channel_width, channel_right_bound);
-}
-
-//--------------------------------------------------------------------------
-bool LLScriptTextboxHandler::processNotification(const LLSD& notify)
-{
-	if(!mChannel)
-	{
-		return false;
-	}
-
-	LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
-
-	if(!notification)
-		return false;
-
-	// arrange a channel on a screen
-	if(!mChannel->getVisible())
-	{
-		initChannel();
-	}
-	
-	if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
-	{
-		if (LLHandlerUtil::canLogToIM(notification))
-		{
-			LLHandlerUtil::logToIMP2P(notification);
-		}
-
-		if(0)//(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
-		{
-			LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID());
-		}
-		else
-		{
-			LLToastScriptTextbox* notify_box = new LLToastScriptTextbox(notification);
-
-			LLToast::Params p;
-			p.notif_id = notification->getID();
-			p.notification = notification;
-			p.panel = notify_box;	
-			p.on_delete_toast = boost::bind(&LLScriptTextboxHandler::onDeleteToast, this, _1);
-
-			LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel);
-			if(channel)
-			{
-				channel->addToast(p);
-			}
-
-			// send a signal to the counter manager
-			mNewNotificationSignal();
-		}
-	}
-	else if (notify["sigtype"].asString() == "delete")
-	{
-		if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
-		{
-			LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
-		}
-		else
-		{
-			mChannel->killToastByNotificationID(notification->getID());
-		}
-	}
-	return false;
-}
-
-//--------------------------------------------------------------------------
-
-void LLScriptTextboxHandler::onDeleteToast(LLToast* toast)
-{
-	// send a signal to the counter manager
-	mDelNotificationSignal();
-
-	// send a signal to a listener to let him perform some action
-	// in this case listener is a SysWellWindow and it will remove a corresponding item from its list
-	mNotificationIDSignal(toast->getNotificationID());
-
-	LLNotificationPtr notification = LLNotifications::getInstance()->find(toast->getNotificationID());
-	
-	if( notification && 
-		(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) )
-	{
-		LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
-	}
-}
-
-//--------------------------------------------------------------------------
-void LLScriptTextboxHandler::onRejectToast(LLUUID& id)
-{
-	LLNotificationPtr notification = LLNotifications::instance().find(id);
-
-	if (notification
-			&& LLNotificationManager::getInstance()->getHandlerForNotification(
-					notification->getType()) == this)
-	{
-		LLNotifications::instance().cancel(notification);
-	}
-}
-
-//--------------------------------------------------------------------------
-
-
-
-
-- 
cgit v1.2.3


From 03842eebcf6cb01d9e0dbe493fad2af533a9333a Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Thu, 30 Sep 2010 10:36:08 +0100
Subject: remove more evil deadcode.

---
 indra/newview/llnotificationscripthandler.cpp | 2 --
 1 file changed, 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp
index eed0bdc15d..45590c3cdb 100644
--- a/indra/newview/llnotificationscripthandler.cpp
+++ b/indra/newview/llnotificationscripthandler.cpp
@@ -97,12 +97,10 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
 
 		if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
 		{
-			llwarns << "DUMB ROUTE" << llendl;
 			LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID());
 		}
 		else
 		{
-			llwarns << "SMART ROUTE" << llendl;
 			LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification);
 
 			LLToast::Params p;
-- 
cgit v1.2.3


From ace8964cf56891202f3d0690d7321656ce1bd1f9 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Thu, 30 Sep 2010 11:13:02 +0100
Subject: more de-crufting.

---
 indra/newview/lltoastnotifypanel.cpp | 46 ++++--------------------------------
 indra/newview/lltoastnotifypanel.h   |  2 --
 2 files changed, 5 insertions(+), 43 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 45c031964c..3f7dc24ade 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -55,7 +55,6 @@ LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal
 LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification, const LLRect& rect, bool show_images) : 
 LLToastPanel(notification),
 mTextBox(NULL),
-mUserInputBox(NULL),
 mInfoPanel(NULL),
 mControlPanel(NULL),
 mNumOptions(0),
@@ -68,42 +67,14 @@ 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?
 	mIsTip = notification->getType() == "notifytip";
 	// is it a script dialog?
 	mIsScriptDialog = (notification->getName() == "ScriptDialog" || notification->getName() == "ScriptDialogGroup");
-	// 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
@@ -124,6 +95,10 @@ 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
@@ -149,11 +124,6 @@ mCloseNotificationOnDestroy(true)
 	mTextBox->setPlainText(!show_images);
 	mTextBox->setValue(notification->getMessage());
 
-	mUserInputBox = getChild<LLTextEditor>("user_input_box"); 
-	mUserInputBox->setMaxTextLength(254);// FIXME
-	mUserInputBox->setVisible(FALSE);
-	mUserInputBox->setEnabled(FALSE);
-
 	// add buttons for a script notification
 	if (mIsTip)
 	{
@@ -176,11 +146,6 @@ mCloseNotificationOnDestroy(true)
 			if (form_element["name"].asString() == TEXTBOX_MAGIC_TOKEN)
 			{
 				// a textbox pretending to be a button.
-				// (re)enable the textbox for this panel, and continue.
-				mUserInputBox->setVisible(TRUE);
-				mUserInputBox->setEnabled(TRUE);
-				mUserInputBox->setFocus(TRUE);
-				mUserInputBox->insertText("FOOOOOO!!!!");
 				continue;
 			}
 			LLButton* new_button = createButton(form_element, TRUE);
@@ -295,7 +260,7 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
 		p.image_color(LLUIColorTable::instance().getColor("ButtonCautionImageColor"));
 		p.image_color_disabled(LLUIColorTable::instance().getColor("ButtonCautionImageColor"));
 	}
-	// for the scriptdialog buttons we use fixed button size. This is a limit!
+	// for the scriptdialog buttons we use fixed button size. This  is a limit!
 	if (!mIsScriptDialog && font->getWidth(form_element["text"].asString()) > BUTTON_WIDTH)
 	{
 		p.rect.width = 1;
@@ -527,7 +492,6 @@ void LLToastNotifyPanel::onClickButton(void* data)
 		self->mNotification->setResponder(new_info);
 	}
 
-	llwarns << response << llendl;
 	self->mNotification->respond(response);
 
 	if(is_reusable)
diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h
index 06f6767ccd..57711b3d80 100644
--- a/indra/newview/lltoastnotifypanel.h
+++ b/indra/newview/lltoastnotifypanel.h
@@ -99,7 +99,6 @@ protected:
 
 	// panel elements
 	LLTextBase*		mTextBox;
-	LLTextEditor*           mUserInputBox;
 	LLPanel*		mInfoPanel;		// a panel, that contains an information
 	LLPanel*		mControlPanel;	// a panel, that contains buttons (if present)
 
@@ -122,7 +121,6 @@ protected:
 	void disableRespondedOptions(LLNotificationPtr& notification);
 
 	bool mIsTip;
-	bool mIsScriptTextBox;
 	bool mAddedDefaultBtn;
 	bool mIsScriptDialog;
 	bool mIsCaution; 
-- 
cgit v1.2.3


From de84d95ba083c5a2ab827b9b51849d30ab11c7d3 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Thu, 30 Sep 2010 11:15:58 +0100
Subject: minor tidy-up.

---
 indra/newview/llviewermessage.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index e284d8d154..02d27be4ec 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -37,6 +37,7 @@
 #include "llfloaterreg.h"
 #include "llfollowcamparams.h"
 #include "llinventorydefines.h"
+#include "lllslconstants.h"
 #include "llregionhandle.h"
 #include "llsdserialize.h"
 #include "llteleportflags.h"
@@ -6171,7 +6172,6 @@ const S32 SCRIPT_DIALOG_BUTTON_STR_SIZE = 24;
 const S32 SCRIPT_DIALOG_MAX_MESSAGE_SIZE = 512;
 const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n";
 
-#include "lllslconstants.h"
 bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 {
 	LLNotificationForm form(notification["form"]);
-- 
cgit v1.2.3


From dd6a77c9e1baeec7276d3599b73d5cde384e810f Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Thu, 30 Sep 2010 12:01:36 +0100
Subject: xui / panel format cleanup.

---
 indra/newview/lltoastscripttextbox.cpp             | 48 ++++------------------
 indra/newview/lltoastscripttextbox.h               | 25 +----------
 .../skins/default/xui/en/panel_notify_textbox.xml  | 19 ++++-----
 3 files changed, 18 insertions(+), 74 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 95f70eda88..581bb9519c 100644
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -31,8 +31,6 @@
 #include "llfocusmgr.h"
 
 #include "llbutton.h"
-#include "lliconctrl.h"
-#include "llinventoryfunctions.h"
 #include "llnotifications.h"
 #include "llviewertexteditor.h"
 
@@ -44,59 +42,30 @@
 
 #include "llglheaders.h"
 #include "llagent.h"
-#include "llavatariconctrl.h"
-#include "llfloaterinventory.h"
-#include "llinventorytype.h"
 
-const S32 LLToastScriptTextbox::DEFAULT_MESSAGE_MAX_LINE_COUNT	= 7;
+const S32 LLToastScriptTextbox::DEFAULT_MESSAGE_MAX_LINE_COUNT= 7;
 
 LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
-:	LLToastNotifyPanel(notification),
-	mInventoryOffer(NULL)
+:	LLToastNotifyPanel(notification)
 {
 	buildFromFile( "panel_notify_textbox.xml");
 
 	const LLSD& payload = notification->getPayload();
-	llwarns << "PAYLOAD " << payload << llendl;
-	llwarns << "TYPE " << notification->getType() << llendl;
-	llwarns << "MESSAGE " << notification->getMessage() << llendl;
-	llwarns << "LABEL " << notification->getLabel() << llendl;
-	llwarns << "URL " << notification->getURL() << llendl;
 
 	//message body
 	const std::string& message = payload["message"].asString();
 
-	std::string timeStr = "["+LLTrans::getString("UTCTimeWeek")+"],["
-		+LLTrans::getString("UTCTimeDay")+"] ["
-		+LLTrans::getString("UTCTimeMth")+"] ["
-		+LLTrans::getString("UTCTimeYr")+"] ["
-		+LLTrans::getString("UTCTimeHr")+"]:["
-		+LLTrans::getString("UTCTimeMin")+"]:["
-		+LLTrans::getString("UTCTimeSec")+"] ["
-		+LLTrans::getString("UTCTimeTimezone")+"]";
-	const LLDate timeStamp = notification->getDate();
-	LLDate notice_date = timeStamp.notNull() ? timeStamp : LLDate::now();
-	LLSD substitution;
-	substitution["datetime"] = (S32) notice_date.secondsSinceEpoch();
-	LLStringUtil::format(timeStr, substitution);
-
 	LLViewerTextEditor* pMessageText = getChild<LLViewerTextEditor>("message");
 	pMessageText->clear();
 
 	LLStyle::Params style;
-
-	LLFontGL* date_font = LLFontGL::getFontByName(getString("date_font"));
-	if (date_font)
-		style.font = date_font;
-	pMessageText->appendText(timeStr + "\n", TRUE, style);
-	
 	style.font = pMessageText->getDefaultFont();
 	pMessageText->appendText(message, TRUE, style);
 
-	//ok button
-	LLButton* pOkBtn = getChild<LLButton>("btn_ok");
-	pOkBtn->setClickedCallback((boost::bind(&LLToastScriptTextbox::onClickOk, this)));
-	setDefaultBtn(pOkBtn);
+	//submit button
+	LLButton* pSubmitBtn = getChild<LLButton>("btn_submit");
+	pSubmitBtn->setClickedCallback((boost::bind(&LLToastScriptTextbox::onClickSubmit, this)));
+	setDefaultBtn(pSubmitBtn);
 
 	S32 maxLinesCount;
 	std::istringstream ss( getString("message_max_lines_count") );
@@ -104,7 +73,7 @@ LLToastScriptTextbox::LLToastScriptTextbox(LLNotificationPtr& notification)
 	{
 		maxLinesCount = DEFAULT_MESSAGE_MAX_LINE_COUNT;
 	}
-	snapToMessageHeight(pMessageText, maxLinesCount);
+	//snapToMessageHeight(pMessageText, maxLinesCount);
 }
 
 // virtual
@@ -118,14 +87,13 @@ void LLToastScriptTextbox::close()
 }
 
 #include "lllslconstants.h"
-void LLToastScriptTextbox::onClickOk()
+void LLToastScriptTextbox::onClickSubmit()
 {
 	LLViewerTextEditor* pMessageText = getChild<LLViewerTextEditor>("message");
 
 	if (pMessageText)
 	{
 		LLSD response = mNotification->getResponseTemplate();
-		//response["OH MY GOD WHAT A HACK"] = "woot";
 		response[TEXTBOX_MAGIC_TOKEN] = pMessageText->getText();
 		if (response[TEXTBOX_MAGIC_TOKEN].asString().empty())
 		{
diff --git a/indra/newview/lltoastscripttextbox.h b/indra/newview/lltoastscripttextbox.h
index 86fe93cf66..ae3b545e0a 100644
--- a/indra/newview/lltoastscripttextbox.h
+++ b/indra/newview/lltoastscripttextbox.h
@@ -27,19 +27,13 @@
 #ifndef LL_LLTOASTSCRIPTTEXTBOX_H
 #define LL_LLTOASTSCRIPTTEXTBOX_H
 
-#include "llfontgl.h"
 #include "lltoastnotifypanel.h"
-#include "lldarray.h"
-#include "lltimer.h"
-#include "llviewermessage.h"
 #include "llnotificationptr.h"
 
 class LLButton;
 
 /**
- * Toast panel for group notification.
- *
- * Replaces class LLGroupNotifyBox.
+ * Toast panel for scripted llTextbox notifications.
  */
 class LLToastScriptTextbox
 :	public LLToastNotifyPanel
@@ -49,7 +43,6 @@ public:
 
 	static bool onNewNotification(const LLSD& notification);
 
-
 	// Non-transient messages.  You can specify non-default button
 	// layouts (like one for script dialogs) by passing various
 	// numbers in for "layout".
@@ -57,23 +50,9 @@ public:
 
 	/*virtual*/ ~LLToastScriptTextbox();
 protected:
-	void onClickOk();
-	void onClickAttachment();
+	void onClickSubmit();
 private:
-	static bool isAttachmentOpenable(LLAssetType::EType);
-
 	static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT;
-
-	LLButton* mSaveInventoryBtn;
-
-	LLUUID mGroupID;
-	LLOfferInfo* mInventoryOffer;
 };
 
-// This view contains the stack of notification windows.
-//extern LLView* gGroupNotifyBoxView;
-
-const S32 GROUP_LAYOUT_DEFAULT = 0;
-const S32 GROUP_LAYOUT_SCRIPT_DIALOG = 1;
-
 #endif
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 dcd1e29e17..0fc84f0f3c 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 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
  background_visible="true"
- height="90"
+ height="150"
  label="instant_message"
  layout="topleft"
  left="0"
@@ -11,17 +11,14 @@
     <string
      name="message_max_lines_count"
      value="7" />
-    <string
-     name="date_font"
-     value="SANSSERIF" />
     <text_editor
      parse_urls="true"
      enabled="true"
      follows="all"
-     height="0"
+     height="60"
      layout="topleft"
      left="25"
-     max_length="2147483647"
+     max_length="250"
      name="message"
      parse_highlights="true"
      read_only="false"
@@ -33,12 +30,12 @@
      word_wrap="true" >
     </text_editor>
     <button
-     bottom="85"
-     follows="bottom"
+     top="110"
+     follows="top|left"
      height="20"
-     label="OK"
+     label="Submit"
      layout="topleft"
-     right="-10"
-     name="btn_ok"
+     left="25"
+     name="btn_submit"
      width="70" />
 </panel>
-- 
cgit v1.2.3


From 5b3f293453af7c54ef5c1913c706982ece8be1d0 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Thu, 30 Sep 2010 12:06:44 +0100
Subject: more de-crufting.

---
 indra/newview/llscriptfloater.cpp | 1 -
 indra/newview/llviewermessage.cpp | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index 53a5881f4b..170e23e4c5 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -592,7 +592,6 @@ bool LLScriptFloater::isScriptTextbox(LLNotificationPtr notification)
 		for (int i=0; i<num_options; ++i)
 		{
 			LLSD form_element = form->getElement(i);
-			llwarns << form_element << llendl;
 			if (form_element["name"].asString() == TEXTBOX_MAGIC_TOKEN)
 			{
 				return true;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 02d27be4ec..dfd7b1092a 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -6175,8 +6175,7 @@ const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n";
 bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 {
 	LLNotificationForm form(notification["form"]);
-	//std::string button = "booya";//LLNotification::getSelectedOptionName(response);
-	llwarns << "ok: " << response << llendl;
+
 	std::string rtn_text;
 	S32 button_idx;
 	button_idx = LLNotification::getSelectedOption(notification, response);
@@ -6191,7 +6190,7 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response)
 	{
 		rtn_text = LLNotification::getSelectedOptionName(response);
 	}
-	llwarns << "rtn: " << rtn_text << " btnidx: " << button_idx << llendl;
+
 	// Didn't click "Ignore"
 	if (button_idx != -1)
 	{
-- 
cgit v1.2.3


From 0e7b77b9827668fd9819be807ff0dfa4cd0b1219 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Thu, 30 Sep 2010 12:49:28 +0100
Subject: make the ignore button slightly clickable.  XUI is wierd.

---
 .../skins/default/xui/en/panel_notify_textbox.xml  | 46 +++++++++++++++++-----
 1 file changed, 36 insertions(+), 10 deletions(-)

(limited to 'indra/newview')

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 0fc84f0f3c..99a3540012 100644
--- a/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
+++ b/indra/newview/skins/default/xui/en/panel_notify_textbox.xml
@@ -1,16 +1,26 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <panel
- background_visible="true"
- height="150"
- label="instant_message"
- layout="topleft"
- left="0"
- name="panel_notify_textbox"
- top="0"
- width="305">
-    <string
+   background_visible="true"
+   height="230"
+   label="instant_message"
+   layout="topleft"
+   left="0"
+   name="panel_notify_textbox"
+   top="0"
+   width="305">
+  <string
      name="message_max_lines_count"
      value="7" />
+  <panel
+   bevel_style="none"
+   follows="left|right|top"
+   height="150"
+   label="info_panel"
+   layout="topleft"
+   left="0"
+   name="info_panel"
+   top="0"
+   width="305">
     <text_editor
      parse_urls="true"
      enabled="true"
@@ -26,7 +36,7 @@
      type="string"
      use_ellipses="true"
      value="message"
-     width="270"
+     width="260"
      word_wrap="true" >
     </text_editor>
     <button
@@ -38,4 +48,20 @@
      left="25"
      name="btn_submit"
      width="70" />
+  </panel>
+  <panel
+     background_visible="false"
+     follows="left|right|bottom"
+     height="0" 
+     width="290"
+     label="control_panel"
+     layout="topleft"
+     left="10"
+     name="control_panel"
+     top_pad="5">
+    <!-- 
+	 Notes:
+	 This panel holds the Ignore button and possibly other buttons of notification.
+      -->
+  </panel>
 </panel>
-- 
cgit v1.2.3


From be8c9fc21758bcbc1d9f3d565b221310344231bd Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Wed, 27 Oct 2010 17:07:31 -0700
Subject: CHOP-122 Initializing Facade service in the viewer. Rev. by Brad.

---
 indra/newview/CMakeLists.txt            |  2 ++
 indra/newview/app_settings/settings.xml | 35 ++++++++++++++++++++++++++++++++-
 indra/newview/llappviewer.cpp           | 25 ++++++++++++++++++++++-
 indra/newview/llappviewer.h             | 11 +++++++++--
 indra/newview/lltranslate.cpp           | 12 +++++------
 5 files changed, 75 insertions(+), 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index bf885e5934..63982ba87b 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -64,6 +64,7 @@ include_directories(
     ${LSCRIPT_INCLUDE_DIRS}
     ${LSCRIPT_INCLUDE_DIRS}/lscript_compile
     ${LLLOGIN_INCLUDE_DIRS}
+    ${UPDATER_INCLUDE_DIRS}
     )
 
 set(viewer_SOURCE_FILES
@@ -1679,6 +1680,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
     ${OPENSSL_LIBRARIES}
     ${CRYPTO_LIBRARIES}
     ${LLLOGIN_LIBRARIES}
+    ${UPDATER_LIBRARIES}
     ${GOOGLE_PERFTOOLS_LIBRARIES}
     )
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 086d73bc00..371326c0f5 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10991,7 +10991,40 @@
       <key>Value</key>
       <integer>15</integer>
     </map>
-	<key>UploadBakedTexOld</key>
+    <key>UpdaterServiceActive</key>
+    <map>
+      <key>Comment</key>
+      <string>Enable or disable the updater service.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>UpdaterServiceCheckPeriod</key>
+    <map>
+      <key>Comment</key>
+      <string>Default period between update checking.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>3600</integer>
+    </map>
+    <key>UpdaterServiceURL</key>
+    <map>
+      <key>Comment</key>
+      <string>Default location for the updater service.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>http://secondlife.com/app/update</string>
+    </map>
+    <key>UploadBakedTexOld</key>
     <map>
       <key>Comment</key>
       <string>Forces the baked texture pipeline to upload using the old method.</string>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 931b9fd2f3..e6feaae504 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -83,6 +83,7 @@
 
 #include "llweb.h"
 #include "llsecondlifeurls.h"
+#include "llupdaterservice.h"
 
 // Linden library includes
 #include "llavatarnamecache.h"
@@ -581,7 +582,8 @@ LLAppViewer::LLAppViewer() :
 	mAgentRegionLastAlive(false),
 	mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)),
 	mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)),
-	mFastTimerLogThread(NULL)
+	mFastTimerLogThread(NULL),
+	mUpdater(new LLUpdaterService())
 {
 	if(NULL != sInstance)
 	{
@@ -630,6 +632,9 @@ bool LLAppViewer::init()
 	if (!initConfiguration())
 		return false;
 
+	// Initialize updater service
+	initUpdater();
+
 	// write Google Breakpad minidump files to our log directory
 	std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "");
 	logdir += gDirUtilp->getDirDelimiter();
@@ -2324,6 +2329,24 @@ bool LLAppViewer::initConfiguration()
 	return true; // Config was successful.
 }
 
+void LLAppViewer::initUpdater()
+{
+	// Initialize the updater service.
+	// Generate URL to the udpater service
+	// Get Channel
+	// Get Version
+	std::string url = gSavedSettings.getString("UpdaterServiceURL");
+	std::string channel = gSavedSettings.getString("VersionChannelName");
+	std::string version = LLVersionInfo::getVersion();
+	U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod");
+
+	mUpdater->setParams(url, channel, version);
+	mUpdater->setCheckPeriod(check_period);
+	if(gSavedSettings.getBOOL("UpdaterServiceActive"))
+	{
+		mUpdater->startChecking();
+	}
+}
 
 void LLAppViewer::checkForCrash(void)
 {
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index fdc3b9ef9e..ea44ade8c6 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -39,7 +39,7 @@ class LLTextureCache;
 class LLImageDecodeThread;
 class LLTextureFetch;
 class LLWatchdogTimeout;
-class LLCommandLineParser;
+class LLUpdaterService;
 
 struct apr_dso_handle_t;
 
@@ -186,7 +186,7 @@ private:
 
 	bool initThreads(); // Initialize viewer threads, return false on failure.
 	bool initConfiguration(); // Initialize settings from the command line/config file.
-
+	void initUpdater(); // Initialize the updater service.
 	bool initCache(); // Initialize local client cache.
 
 
@@ -260,7 +260,13 @@ private:
 
 	std::set<struct apr_dso_handle_t*> mPlugins;
 
+	boost::scoped_ptr<LLUpdaterService> mUpdater;
+
+	//---------------------------------------------
+	//*NOTE: Mani - legacy updater stuff
+	// Still useable?
 public:
+
 	//some information for updater
 	typedef struct
 	{
@@ -270,6 +276,7 @@ public:
 	static LLUpdaterInfo *sUpdaterInfo ;
 
 	void launchUpdater();
+	//---------------------------------------------
 };
 
 // consts from viewer.h
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index 050e34ade9..21467a2ab8 100644
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -36,7 +36,7 @@
 
 #include "llbufferstream.h"
 #include "llui.h"
-#include "llversionviewer.h"
+#include "llversioninfo.h"
 #include "llviewercontrol.h"
 
 #include "jsoncpp/reader.h"
@@ -64,11 +64,11 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std
 	getTranslateUrl(url, from_lang, to_lang, mesg);
 
     std::string user_agent = llformat("%s %d.%d.%d (%d)",
-		LL_CHANNEL,
-		LL_VERSION_MAJOR,
-		LL_VERSION_MINOR,
-		LL_VERSION_PATCH,
-		LL_VERSION_BUILD );
+		LLVersionInfo::getChannel(),
+		LLVersionInfo::getMajor(),
+		LLVersionInfo::getMinor(),
+		LLVersionInfo::getPatch(),
+		LLVersionInfo::getBuild());
 
 	if (!m_Header.size())
 	{
-- 
cgit v1.2.3


From ca9594af28ce2e1cc8bb333a0fa7384dae718a9a Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Thu, 28 Oct 2010 16:47:05 -0700
Subject: shell of the update checker; it will just print a message to the log
 depending on the result of the check one time.

---
 indra/newview/llappviewer.cpp | 8 ++++----
 indra/newview/lltranslate.cpp | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index e6feaae504..06300141be 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -632,9 +632,6 @@ bool LLAppViewer::init()
 	if (!initConfiguration())
 		return false;
 
-	// Initialize updater service
-	initUpdater();
-
 	// write Google Breakpad minidump files to our log directory
 	std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "");
 	logdir += gDirUtilp->getDirDelimiter();
@@ -980,7 +977,10 @@ bool LLAppViewer::mainLoop()
 	gServicePump = new LLPumpIO(gAPRPoolp);
 	LLHTTPClient::setPump(*gServicePump);
 	LLCurl::setCAFile(gDirUtilp->getCAFile());
-
+	
+	// Initialize updater service (now that we have an io pump)
+	initUpdater();
+	
 	// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated.
 
 	LLVoiceChannel::initClass();
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index 21467a2ab8..8ccfdb071b 100644
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -64,7 +64,7 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std
 	getTranslateUrl(url, from_lang, to_lang, mesg);
 
     std::string user_agent = llformat("%s %d.%d.%d (%d)",
-		LLVersionInfo::getChannel(),
+		LLVersionInfo::getChannel().c_str(),
 		LLVersionInfo::getMajor(),
 		LLVersionInfo::getMinor(),
 		LLVersionInfo::getPatch(),
-- 
cgit v1.2.3


From 609f5bd6810ca16a409f209610e6fac972348cba Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Fri, 29 Oct 2010 11:20:54 -0700
Subject: added periodic retry to look for updates

---
 indra/newview/app_settings/settings.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 371326c0f5..5b9bfd0f9c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11011,7 +11011,7 @@
       <key>Type</key>
       <string>U32</string>
       <key>Value</key>
-      <integer>3600</integer>
+      <integer>10</integer>
     </map>
     <key>UpdaterServiceURL</key>
     <map>
@@ -11022,7 +11022,7 @@
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://secondlife.com/app/update</string>
+      <string>http://localhost/agni</string>
     </map>
     <key>UploadBakedTexOld</key>
     <map>
-- 
cgit v1.2.3


From 064a8d079917ecd91bd6b47f5f7f353989594593 Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Fri, 29 Oct 2010 11:22:07 -0700
Subject: restore 1hr polling frequency

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5b9bfd0f9c..274c7fbeb8 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11011,7 +11011,7 @@
       <key>Type</key>
       <string>U32</string>
       <key>Value</key>
-      <integer>10</integer>
+      <integer>3600</integer>
     </map>
     <key>UpdaterServiceURL</key>
     <map>
-- 
cgit v1.2.3


From 6ab2e44e945ddc085a7b4b5f1524de924419a897 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Mon, 1 Nov 2010 15:18:18 -0700
Subject: VWR-23666 Removed setting VersionChannelName.
 LLVersionInfo::resetChannel() and unit tests. Reviewed by brad.

---
 indra/newview/CMakeLists.txt                 |   1 +
 indra/newview/app_settings/cmd_line.xml      |   3 +-
 indra/newview/app_settings/settings.xml      |  11 ---
 indra/newview/llappviewer.cpp                |  25 +++---
 indra/newview/llcurrencyuimanager.cpp        |   4 +-
 indra/newview/llfloaterabout.cpp             |   4 +-
 indra/newview/lllogininstance.cpp            |   5 +-
 indra/newview/llpanellogin.cpp               |   4 +-
 indra/newview/llversioninfo.cpp              |  37 ++++++++-
 indra/newview/llversioninfo.h                |   7 ++
 indra/newview/llviewercontrol.cpp            |   1 -
 indra/newview/llviewercontrol.h              |   2 -
 indra/newview/llviewermedia.cpp              |   2 +-
 indra/newview/llviewerstats.cpp              |   3 +-
 indra/newview/tests/lllogininstance_test.cpp |   9 ++-
 indra/newview/tests/llversioninfo_test.cpp   | 114 +++++++++++++++++++++++++++
 16 files changed, 189 insertions(+), 43 deletions(-)
 create mode 100644 indra/newview/tests/llversioninfo_test.cpp

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 63982ba87b..a488fb1069 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1858,6 +1858,7 @@ if (LL_TESTS)
     llmediadataclient.cpp
     lllogininstance.cpp
     llviewerhelputil.cpp
+    llversioninfo.cpp
   )
 
   ##################################################
diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index 00d69f805e..a17da8e344 100644
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -361,8 +361,7 @@
     <map>
       <key>count</key>
       <integer>1</integer>
-      <key>map-to</key>
-      <string>VersionChannelName</string>
+      <!-- Special case. Not mapped to a setting. -->
     </map>
 
     <key>loginpage</key>
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 371326c0f5..96d4fb1295 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11344,17 +11344,6 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
-    <key>VersionChannelName</key>
-    <map>
-      <key>Comment</key>
-      <string>Versioning Channel Name.</string>
-      <key>Persist</key>
-      <integer>0</integer>
-      <key>Type</key>
-      <string>String</string>
-      <key>Value</key>
-      <string>Second Life Release</string>
-    </map>
     <key>VertexShaderEnable</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index e6feaae504..b122209af8 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -662,11 +662,6 @@ bool LLAppViewer::init()
     initThreads();
     writeSystemInfo();
 
-	// Build a string representing the current version number.
-    gCurrentVersion = llformat("%s %s", 
-							   gSavedSettings.getString("VersionChannelName").c_str(),
-							   LLVersionInfo::getVersion().c_str());
-
 	//////////////////////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////////////////////
@@ -905,7 +900,8 @@ bool LLAppViewer::init()
 	gDebugInfo["GraphicsCard"] = LLFeatureManager::getInstance()->getGPUString();
 
 	// Save the current version to the prefs file
-	gSavedSettings.setString("LastRunVersion", gCurrentVersion);
+	gSavedSettings.setString("LastRunVersion", 
+							 LLVersionInfo::getVersionAndChannel());
 
 	gSimLastTime = gRenderStartTime.getElapsedTimeF32();
 	gSimFrames = (F32)gFrameCount;
@@ -1941,8 +1937,6 @@ bool LLAppViewer::initConfiguration()
 	gSavedSettings.setString("ClientSettingsFile", 
         gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global")));
 
-	gSavedSettings.setString("VersionChannelName", LLVersionInfo::getChannel());
-
 #ifndef	LL_RELEASE_FOR_DOWNLOAD
 	// provide developer build only overrides for these control variables that are not
 	// persisted to settings.xml
@@ -2074,6 +2068,11 @@ bool LLAppViewer::initConfiguration()
         }
     }
 
+    if(clp.hasOption("channel"))
+    {
+		LLVersionInfo::resetChannel(clp.getOption("channel")[0]);
+	}
+	
 
 	// If we have specified crash on startup, set the global so we'll trigger the crash at the right time
 	if(clp.hasOption("crashonstartup"))
@@ -2336,7 +2335,7 @@ void LLAppViewer::initUpdater()
 	// Get Channel
 	// Get Version
 	std::string url = gSavedSettings.getString("UpdaterServiceURL");
-	std::string channel = gSavedSettings.getString("VersionChannelName");
+	std::string channel = LLVersionInfo::getChannel();
 	std::string version = LLVersionInfo::getVersion();
 	U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod");
 
@@ -2538,7 +2537,7 @@ void LLAppViewer::writeSystemInfo()
 {
 	gDebugInfo["SLLog"] = LLError::logFileName();
 
-	gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
+	gDebugInfo["ClientInfo"]["Name"] = LLVersionInfo::getChannel();
 	gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor();
 	gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor();
 	gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::getPatch();
@@ -2636,7 +2635,7 @@ void LLAppViewer::handleViewerCrash()
 	
 	//We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version
 	//to check against no matter what
-	gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
+	gDebugInfo["ClientInfo"]["Name"] = LLVersionInfo::getChannel();
 
 	gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor();
 	gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor();
@@ -4363,7 +4362,7 @@ void LLAppViewer::handleLoginComplete()
 	initMainloopTimeout("Mainloop Init");
 
 	// Store some data to DebugInfo in case of a freeze.
-	gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName");
+	gDebugInfo["ClientInfo"]["Name"] = LLVersionInfo::getChannel();
 
 	gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor();
 	gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor();
@@ -4469,7 +4468,7 @@ void LLAppViewer::launchUpdater()
 	// *TODO change userserver to be grid on both viewer and sim, since
 	// userserver no longer exists.
 	query_map["userserver"] = LLGridManager::getInstance()->getGridLabel();
-	query_map["channel"] = gSavedSettings.getString("VersionChannelName");
+	query_map["channel"] = LLVersionInfo::getChannel();
 	// *TODO constantize this guy
 	// *NOTE: This URL is also used in win_setup/lldownloader.cpp
 	LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp
index 2b92b228b3..b4a1457f47 100644
--- a/indra/newview/llcurrencyuimanager.cpp
+++ b/indra/newview/llcurrencyuimanager.cpp
@@ -166,7 +166,7 @@ void LLCurrencyUIManager::Impl::updateCurrencyInfo()
 		gAgent.getSecureSessionID().asString());
 	keywordArgs.appendString("language", LLUI::getLanguage());
 	keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy);
-	keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName"));
+	keywordArgs.appendString("viewerChannel", LLVersionInfo::getChannel());
 	keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::getMajor());
 	keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::getMinor());
 	keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::getPatch());
@@ -241,7 +241,7 @@ void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password)
 	{
 		keywordArgs.appendString("password", password);
 	}
-	keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName"));
+	keywordArgs.appendString("viewerChannel", LLVersionInfo::getChannel());
 	keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::getMajor());
 	keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::getMinor());
 	keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::getPatch());
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 135137069c..8ae3ccbae3 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -213,7 +213,7 @@ LLSD LLFloaterAbout::getInfo()
 	info["VIEWER_VERSION_STR"] = LLVersionInfo::getVersion();
 	info["BUILD_DATE"] = __DATE__;
 	info["BUILD_TIME"] = __TIME__;
-	info["CHANNEL"] = gSavedSettings.getString("VersionChannelName");
+	info["CHANNEL"] = LLVersionInfo::getChannel();
 
 	info["VIEWER_RELEASE_NOTES_URL"] = get_viewer_release_notes_url();
 
@@ -291,7 +291,7 @@ static std::string get_viewer_release_notes_url()
 	std::string url = LLTrans::getString("RELEASE_NOTES_BASE_URL");
 	if (! LLStringUtil::endsWith(url, "/"))
 		url += "/";
-	url += gSavedSettings.getString("VersionChannelName") + "/";
+	url += LLVersionInfo::getChannel() + "/";
 	url += LLVersionInfo::getShortVersion();
 	return LLWeb::escapeURL(url);
 }
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 029e700c4c..fe84aca147 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -42,6 +42,7 @@
 // newview
 #include "llviewernetwork.h"
 #include "llviewercontrol.h"
+#include "llversioninfo.h"
 #include "llslurl.h"
 #include "llstartup.h"
 #include "llfloaterreg.h"
@@ -181,8 +182,8 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
 	request_params["read_critical"] = false; // handleTOSResponse
 	request_params["last_exec_event"] = mLastExecEvent;
 	request_params["mac"] = hashed_unique_id_string;
-	request_params["version"] = gCurrentVersion; // Includes channel name
-	request_params["channel"] = gSavedSettings.getString("VersionChannelName");
+	request_params["version"] = LLVersionInfo::getVersionAndChannel(); // Includes channel name
+	request_params["channel"] = LLVersionInfo::getChannel();
 	request_params["id0"] = mSerialNumber;
 
 	mRequestData.clear();
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 467aefc60f..cf567fb208 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -230,7 +230,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 
 	getChild<LLPanel>("login")->setDefaultBtn("connect_btn");
 
-	std::string channel = gSavedSettings.getString("VersionChannelName");
+	std::string channel = LLVersionInfo::getChannel();
 	std::string version = llformat("%s (%d)",
 								   LLVersionInfo::getShortVersion().c_str(),
 								   LLVersionInfo::getBuild());
@@ -817,7 +817,7 @@ void LLPanelLogin::loadLoginPage()
 								   LLVersionInfo::getShortVersion().c_str(),
 								   LLVersionInfo::getBuild());
 
-	char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0);
+	char* curl_channel = curl_escape(LLVersionInfo::getChannel().c_str(), 0);
 	char* curl_version = curl_escape(version.c_str(), 0);
 
 	oStr << "&channel=" << curl_channel;
diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp
index 733d05834a..53994c68f2 100644
--- a/indra/newview/llversioninfo.cpp
+++ b/indra/newview/llversioninfo.cpp
@@ -95,9 +95,42 @@ const std::string &LLVersionInfo::getShortVersion()
 	return version;
 }
 
+namespace
+{
+	/// Storage of the channel name the viewer is using.
+	//  The channel name is set by hardcoded constant, 
+	//  or by calling LLVersionInfo::resetChannel()
+	std::string sWorkingChannelName(LL_CHANNEL);
+
+	// Storage for the "version and channel" string.
+	// This will get reset too.
+	std::string sVersionChannel("");
+}
+
+//static
+const std::string &LLVersionInfo::getVersionAndChannel()
+{
+	if (sVersionChannel.empty())
+	{
+		// cache the version string
+		std::ostringstream stream;
+		stream << LLVersionInfo::getVersion() 
+			   << " "
+			   << LLVersionInfo::getChannel();
+		sVersionChannel = stream.str();
+	}
+
+	return sVersionChannel;
+}
+
 //static
 const std::string &LLVersionInfo::getChannel()
 {
-	static std::string name(LL_CHANNEL);
-	return name;
+	return sWorkingChannelName;
+}
+
+void LLVersionInfo::resetChannel(const std::string& channel)
+{
+	sWorkingChannelName = channel;
+	sVersionChannel.clear(); // Reset version and channel string til next use.
 }
diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h
index e468b6ae4e..36defbcd68 100644
--- a/indra/newview/llversioninfo.h
+++ b/indra/newview/llversioninfo.h
@@ -58,8 +58,15 @@ public:
 	/// return the viewer version as a string like "2.0.0"
 	static const std::string &getShortVersion();
 
+	/// return the viewer version and channel as a string
+	/// like "2.0.0.200030 Second Life Release"
+	static const std::string &getVersionAndChannel();
+
 	/// return the channel name, e.g. "Second Life"
 	static const std::string &getChannel();
+	
+	/// reset the channel name used by the viewer.
+	static void resetChannel(const std::string& channel);
 };
 
 #endif
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 522b5a7dfa..ebe9f7e275 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -82,7 +82,6 @@ LLControlGroup gCrashSettings("CrashSettings");	// saved at end of session
 LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warnings
 
 std::string gLastRunVersion;
-std::string gCurrentVersion;
 
 extern BOOL gResizeScreenTexture;
 extern BOOL gDebugGL;
diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h
index 22b48f8906..d7191f5c8d 100644
--- a/indra/newview/llviewercontrol.h
+++ b/indra/newview/llviewercontrol.h
@@ -57,7 +57,5 @@ extern LLControlGroup gCrashSettings;
 
 // Set after settings loaded
 extern std::string gLastRunVersion;
-extern std::string gCurrentVersion;
-
 
 #endif // LL_LLVIEWERCONTROL_H
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 48ab122edf..13fbce910b 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -492,7 +492,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
 
 	// Just in case we need to check browser differences in A/B test
 	// builds.
-	std::string channel = gSavedSettings.getString("VersionChannelName");
+	std::string channel = LLVersionInfo::getChannel();
 
 	// append our magic version number string to the browser user agent id
 	// See the HTTP 1.0 and 1.1 specifications for allowed formats:
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 42266ad233..3b7e44668d 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -48,6 +48,7 @@
 #include "llagent.h"
 #include "llagentcamera.h"
 #include "llviewercontrol.h"
+#include "llversioninfo.h"
 #include "llfloatertools.h"
 #include "lldebugview.h"
 #include "llfasttimerview.h"
@@ -749,7 +750,7 @@ void send_stats()
 
 	// send fps only for time app spends in foreground
 	agent["fps"] = (F32)gForegroundFrameCount / gForegroundTime.getElapsedTimeF32();
-	agent["version"] = gCurrentVersion;
+	agent["version"] = LLVersionInfo::getVersionAndChannel();
 	std::string language = LLUI::getLanguage();
 	agent["language"] = language;
 	
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index db50b89620..b902c7ab09 100644
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -48,6 +48,9 @@ const std::string VIEWERLOGIN_GRIDLABEL("viewerlogin_grid");
 
 const std::string APPVIEWER_SERIALNUMBER("appviewer_serialno");
 
+const std::string VIEWERLOGIN_CHANNEL("invalid_channel");
+const std::string VIEWERLOGIN_VERSION_CHANNEL("invalid_version");
+
 // Link seams.
 
 //-----------------------------------------------------------------------------
@@ -160,7 +163,6 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid_name)
 //-----------------------------------------------------------------------------
 #include "../llviewercontrol.h"
 LLControlGroup gSavedSettings("Global");
-std::string gCurrentVersion = "invalid_version";
 
 LLControlGroup::LLControlGroup(const std::string& name) :
 	LLInstanceTracker<LLControlGroup, std::string>(name){}
@@ -177,6 +179,10 @@ BOOL LLControlGroup::declareString(const std::string& name, const std::string &i
 #include "lluicolortable.h"
 void LLUIColorTable::saveUserSettings(void)const {}
 
+//-----------------------------------------------------------------------------
+#include "../llversioninfo.h"
+const std::string &LLVersionInfo::getVersionAndChannel() { return VIEWERLOGIN_VERSION_CHANNEL; }
+const std::string &LLVersionInfo::getChannel() { return VIEWERLOGIN_CHANNEL; }
 
 //-----------------------------------------------------------------------------
 #include "llnotifications.h"
@@ -290,7 +296,6 @@ namespace tut
 			gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", FALSE);
 			gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", FALSE);
 			gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", FALSE);
-			gSavedSettings.declareString("VersionChannelName", "test_version_string", "", FALSE);
 			gSavedSettings.declareString("NextLoginLocation", "", "", FALSE);
 			gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", FALSE);
 
diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp
new file mode 100644
index 0000000000..b4f1b0273f
--- /dev/null
+++ b/indra/newview/tests/llversioninfo_test.cpp
@@ -0,0 +1,114 @@
+/** 
+ * @file llversioninfo_test.cpp
+ *
+ * $LicenseInfo:firstyear=2010&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "../test/lltut.h"
+
+#include "../llversioninfo.h"
+#include "llversionviewer.h"
+
+namespace tut
+{
+    struct versioninfo
+    {
+		versioninfo()
+			: mResetChannel("Reset Channel")
+		{
+			std::ostringstream stream;
+			stream << LL_VERSION_MAJOR << "."
+				   << LL_VERSION_MINOR << "."
+				   << LL_VERSION_PATCH << "."
+				   << LL_VERSION_BUILD;
+			mVersion = stream.str();
+			stream.str("");
+
+			stream << LL_VERSION_MAJOR << "."
+				   << LL_VERSION_MINOR << "."
+				   << LL_VERSION_PATCH;
+			mShortVersion = stream.str();
+			stream.str("");
+
+			stream << mVersion
+				   << " "
+				   << LL_CHANNEL;
+			mVersionAndChannel = stream.str();
+			stream.str("");
+
+			stream << mVersion
+				   << " "
+				   << mResetChannel;
+			mResetVersionAndChannel = stream.str();
+		}
+		std::string mResetChannel;
+		std::string mVersion;
+		std::string mShortVersion;
+		std::string mVersionAndChannel;
+		std::string mResetVersionAndChannel;
+    };
+    
+	typedef test_group<versioninfo> versioninfo_t;
+	typedef versioninfo_t::object versioninfo_object_t;
+	tut::versioninfo_t tut_versioninfo("LLVersionInfo");
+
+	template<> template<>
+	void versioninfo_object_t::test<1>()
+	{
+		ensure_equals("Major version", 
+					  LLVersionInfo::getMajor(), 
+					  LL_VERSION_MAJOR);
+		ensure_equals("Minor version", 
+					  LLVersionInfo::getMinor(), 
+					  LL_VERSION_MINOR);
+		ensure_equals("Patch version", 
+					  LLVersionInfo::getPatch(), 
+					  LL_VERSION_PATCH);
+		ensure_equals("Build version", 
+					  LLVersionInfo::getBuild(), 
+					  LL_VERSION_BUILD);
+		ensure_equals("Channel version", 
+					  LLVersionInfo::getChannel(), 
+					  LL_CHANNEL);
+
+		ensure_equals("Version String", 
+					  LLVersionInfo::getVersion(), 
+					  mVersion);
+		ensure_equals("Short Version String", 
+					  LLVersionInfo::getShortVersion(), 
+					  mShortVersion);
+		ensure_equals("Version and channel String", 
+					  LLVersionInfo::getVersionAndChannel(), 
+					  mVersionAndChannel);
+
+		LLVersionInfo::resetChannel(mResetChannel);
+		ensure_equals("Reset channel version", 
+					  LLVersionInfo::getChannel(), 
+					  mResetChannel);
+
+		ensure_equals("Reset Version and channel String", 
+					  LLVersionInfo::getVersionAndChannel(), 
+					  mResetVersionAndChannel);
+	}
+}
\ No newline at end of file
-- 
cgit v1.2.3


From 9cc290ef8fccdc585027d84ac9cfb864ed933061 Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Mon, 1 Nov 2010 16:49:18 -0700
Subject: Added newline at EOF to satisfy linux gcc

---
 indra/newview/tests/llversioninfo_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp
index b4f1b0273f..8855a24ead 100644
--- a/indra/newview/tests/llversioninfo_test.cpp
+++ b/indra/newview/tests/llversioninfo_test.cpp
@@ -111,4 +111,4 @@ namespace tut
 					  LLVersionInfo::getVersionAndChannel(), 
 					  mResetVersionAndChannel);
 	}
-}
\ No newline at end of file
+}
-- 
cgit v1.2.3


From a26386c53a09d47eff092ad89b5684503ee31b9d Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 3 Nov 2010 08:43:31 -0400
Subject: For non-Release Linux build, explain why we don't create tarball.

---
 indra/newview/viewer_manifest.py | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 6861f02bfb..4b98a11091 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -897,6 +897,9 @@ class LinuxManifest(ViewerManifest):
                         'dir': self.get_build_prefix(),
                         'inst_name': installer_name,
                         'inst_path':self.build_path_of(installer_name)})
+            else:
+                print "Skipping %s.tar.bz2 for non-Release build (%s)" % \
+                      (installer_name, self.args['buildtype'])
         finally:
             self.run_command("mv %(inst)s %(dst)s" % {
                 'dst': self.get_dst_prefix(),
-- 
cgit v1.2.3


From 2f6062e59793c8a5326c1dfac41334bac428faa9 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 3 Nov 2010 11:08:04 -0400
Subject: Remove erroneous 'inline' on LLPanelStandStopFlying::getInstance()
 This is ignored by every compiler except Linux g++ 4.4.3 in Release mode. In
 that case, it literally does cause getInstance() to be inlined, therefore
 llmoveview.o contains no such symbol, therefore the Linux viewer link fails
 in Release mode. But for a method implementation in a .cpp file of a method
 declared in a .h file, 'inline' is just wrong. Removing it fixes Release
 build.

---
 indra/newview/llmoveview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 6658e1d7e8..d38bb5aa4a 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -552,7 +552,7 @@ LLPanelStandStopFlying::LLPanelStandStopFlying() :
 }
 
 // static
-inline LLPanelStandStopFlying* LLPanelStandStopFlying::getInstance()
+LLPanelStandStopFlying* LLPanelStandStopFlying::getInstance()
 {
 	static LLPanelStandStopFlying* panel = getStandStopFlyingPanel();
 	return panel;
-- 
cgit v1.2.3


From 65997a1f5bb05dd263063606c00e0633af282784 Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Wed, 3 Nov 2010 14:39:24 -0700
Subject: Added some logging to viewer_manifest.py to attempt to narrow down
 the Mac packaging failures a bit.

---
 indra/newview/viewer_manifest.py | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 4b98a11091..4596938775 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -743,6 +743,11 @@ class DarwinManifest(ViewerManifest):
             devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip()
             volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip()
 
+            if devfile != '/dev/disk1':
+                # adding more debugging info based upon nat's hunches to the
+                # logs to help track down 'SetFile -a V' failures -brad
+                print "WARNING: 'SetFile -a V' command below is probably gonna fail"
+
             # Copy everything in to the mounted .dmg
 
             if self.default_channel() and not self.default_grid():
-- 
cgit v1.2.3


From d594744d49732fd235694bde41f09cf578fccaf1 Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Thu, 4 Nov 2010 10:52:21 -0700
Subject: Turned inlining on in windows builds (RelWithDebInfo and Release).
 This reduces the number of symbols in the viewer binary by about 30%. Also,
 fixed test errors revealed by inlining being enabled.

---
 indra/newview/tests/llviewerhelputil_test.cpp | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp
index a0f1d1c3c3..b425b50c8b 100644
--- a/indra/newview/tests/llviewerhelputil_test.cpp
+++ b/indra/newview/tests/llviewerhelputil_test.cpp
@@ -72,16 +72,13 @@ static void substitute_string(std::string &input, const std::string &search, con
 	}
 }
 
-class LLAgent
-{
-public:
-	LLAgent() {}
-	~LLAgent() {}
-#ifdef __GNUC__
-	__attribute__ ((noinline))
-#endif
-	bool isGodlike() const { return FALSE; }
-};
+#include "../llagent.h"
+LLAgent::LLAgent() : mAgentAccess(gSavedSettings) { }
+LLAgent::~LLAgent() { }
+bool LLAgent::isGodlike() const { return FALSE; }
+LLAgentAccess::LLAgentAccess(LLControlGroup& settings) : mSavedSettings(settings) { }
+LLUIColor::LLUIColor() {}
+
 LLAgent gAgent;
 
 std::string LLWeb::expandURLSubstitutions(const std::string &url,
-- 
cgit v1.2.3


From e0c734a7105060740e5597d4439d882bb3f2bff4 Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Thu, 4 Nov 2010 10:53:11 -0700
Subject: Turned generate_breakpad_symbols target into a noop for non-Release
 builds.

---
 indra/newview/CMakeLists.txt               | 10 +++++++++-
 indra/newview/generate_breakpad_symbols.py | 10 +++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index a488fb1069..f18107f673 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1831,10 +1831,18 @@ if (PACKAGE)
     set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest)
   endif (LINUX)
 
+  if(CMAKE_CONFIGURATION_TYPES)
+      # set LLBUILD_CONFIG to be a shell variable evaluated at build time
+      # reflecting the configuration we are currently building.
+      set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR})
+  else(CMAKE_CONFIGURATION_TYPES)
+      set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE})
+  endif(CMAKE_CONFIGURATION_TYPES)
   add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}"
     COMMAND "${PYTHON_EXECUTABLE}"
     ARGS
       "${CMAKE_CURRENT_SOURCE_DIR}/generate_breakpad_symbols.py"
+      "${LLBUILD_CONFIG}"
       "${VIEWER_DIST_DIR}"
       "${VIEWER_EXE_GLOBS}"
       "${VIEWER_LIB_GLOB}"
@@ -1843,7 +1851,7 @@ if (PACKAGE)
     DEPENDS generate_breakpad_symbols.py
     VERBATIM
   )
-  add_custom_target(generate_breakpad_symbols ALL DEPENDS "${VIEWER_SYMBOL_FILE}")
+  add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}")
   add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}")
   add_dependencies(package generate_breakpad_symbols)
 endif (PACKAGE)
diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py
index 8f2dfd2348..0e61bee1ef 100644
--- a/indra/newview/generate_breakpad_symbols.py
+++ b/indra/newview/generate_breakpad_symbols.py
@@ -45,8 +45,12 @@ class MissingModuleError(Exception):
         Exception.__init__(self, "Failed to find required modules: %r" % modules)
         self.modules = modules
 
-def main(viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file):
-    print "generate_breakpad_symbols run with args: %s" % str((viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file))
+def main(configuration, viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file):
+    print "generate_breakpad_symbols run with args: %s" % str((configuration, viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file))
+
+    if configuration != "Release":
+        print "skipping breakpad symbol generation for non-release build."
+        return 0
 
     # split up list of viewer_exes
     # "'Second Life' SLPlugin" becomes ['Second Life', 'SLPlugin']
@@ -122,7 +126,7 @@ def main(viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_fil
     return 0
 
 if __name__ == "__main__":
-    if len(sys.argv) != 6:
+    if len(sys.argv) != 7:
         usage()
         sys.exit(1)
     sys.exit(main(*sys.argv[1:]))
-- 
cgit v1.2.3


From dfeb7abe5f690bbd3a908c84c53bbea20a5adb7c Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Thu, 4 Nov 2010 14:08:14 -0700
Subject: checker working with v1.0 update protocol.

---
 indra/newview/app_settings/settings.xml | 24 +++++++++++++++++++++++-
 indra/newview/llappviewer.cpp           |  4 +++-
 2 files changed, 26 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 8f5cb7c709..cc0e0a78db 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11022,7 +11022,29 @@
       <key>Type</key>
       <string>String</string>
       <key>Value</key>
-      <string>http://localhost/agni</string>
+      <string>http://update.secondlife.com</string>
+    </map>
+    <key>UpdaterServicePath</key>
+    <map>
+      <key>Comment</key>
+      <string>Path on the update server host.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>update</string>
+    </map>
+    <key>UpdaterServiceProtocolVersion</key>
+    <map>
+      <key>Comment</key>
+      <string>The update protocol version to use.</string>
+      <key>Persist</key>
+      <integer>0</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>v1.0</string>
     </map>
     <key>UploadBakedTexOld</key>
     <map>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 3a48bc25f1..6bb25969a6 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2337,9 +2337,11 @@ void LLAppViewer::initUpdater()
 	std::string url = gSavedSettings.getString("UpdaterServiceURL");
 	std::string channel = LLVersionInfo::getChannel();
 	std::string version = LLVersionInfo::getVersion();
+	std::string protocol_version = gSavedSettings.getString("UpdaterServiceProtocolVersion");
+	std::string service_path = gSavedSettings.getString("UpdaterServicePath");
 	U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod");
 
-	mUpdater->setParams(url, channel, version);
+	mUpdater->setParams(protocol_version, url, service_path, channel, version);
 	mUpdater->setCheckPeriod(check_period);
 	if(gSavedSettings.getBOOL("UpdaterServiceActive"))
 	{
-- 
cgit v1.2.3


From 0836d1b1ae861ee7a226ba342166148a31cc5bdd Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Mon, 8 Nov 2010 15:51:39 -0800
Subject: Fix for linux link errors in teamcity.

---
 indra/newview/CMakeLists.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index f18107f673..ff099710f1 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1643,7 +1643,14 @@ if (WINDOWS)
     endif (PACKAGE)
 endif (WINDOWS)
 
+# *NOTE - this list is very sensitive to ordering, test carefully on all
+# platforms if you change the releative order of the entries here.
+# In particular, cmake 2.6.4 (when buidling with linux/makefile generators)
+# appears to sometimes de-duplicate redundantly listed dependencies improperly.
+# To work around this, higher level modules should be listed before the modules
+# that they depend upon. -brad
 target_link_libraries(${VIEWER_BINARY_NAME}
+    ${UPDATER_LIBRARIES}
     ${LLAUDIO_LIBRARIES}
     ${LLCHARACTER_LIBRARIES}
     ${LLIMAGE_LIBRARIES}
@@ -1680,7 +1687,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
     ${OPENSSL_LIBRARIES}
     ${CRYPTO_LIBRARIES}
     ${LLLOGIN_LIBRARIES}
-    ${UPDATER_LIBRARIES}
     ${GOOGLE_PERFTOOLS_LIBRARIES}
     )
 
-- 
cgit v1.2.3


From 8cce8827e01dab6bfcd3e94e56b6041f8f487c76 Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Mon, 8 Nov 2010 17:12:43 -0800
Subject: Fix for breakpad symbol files failing to be generated on linux.

---
 indra/newview/CMakeLists.txt               | 8 ++++----
 indra/newview/generate_breakpad_symbols.py | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index ff099710f1..a9d1fd9064 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1837,13 +1837,13 @@ if (PACKAGE)
     set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest)
   endif (LINUX)
 
-  if(CMAKE_CONFIGURATION_TYPES)
+  if(CMAKE_CFG_INTDIR STREQUAL ".")
+      set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE})
+  else(CMAKE_CFG_INTDIR STREQUAL ".")
       # set LLBUILD_CONFIG to be a shell variable evaluated at build time
       # reflecting the configuration we are currently building.
       set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR})
-  else(CMAKE_CONFIGURATION_TYPES)
-      set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE})
-  endif(CMAKE_CONFIGURATION_TYPES)
+  endif(CMAKE_CFG_INTDIR STREQUAL ".")
   add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}"
     COMMAND "${PYTHON_EXECUTABLE}"
     ARGS
diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py
index 0e61bee1ef..4fd04d780e 100644
--- a/indra/newview/generate_breakpad_symbols.py
+++ b/indra/newview/generate_breakpad_symbols.py
@@ -31,6 +31,7 @@ import fnmatch
 import itertools
 import operator
 import os
+import re
 import sys
 import shlex
 import subprocess
@@ -48,7 +49,7 @@ class MissingModuleError(Exception):
 def main(configuration, viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file):
     print "generate_breakpad_symbols run with args: %s" % str((configuration, viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file))
 
-    if configuration != "Release":
+    if not re.match("release", configuration, re.IGNORECASE):
         print "skipping breakpad symbol generation for non-release build."
         return 0
 
-- 
cgit v1.2.3


From fdf616c59d87219e2d5ad6e12687cf2793cfba1e Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Tue, 9 Nov 2010 11:23:32 -0800
Subject: beginnings of the update installer (with simple install script for
 darwin).

---
 indra/newview/viewer_manifest.py | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 4596938775..f95697adb6 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -575,6 +575,10 @@ class DarwinManifest(ViewerManifest):
             # most everything goes in the Resources directory
             if self.prefix(src="", dst="Resources"):
                 super(DarwinManifest, self).construct()
+		
+                if self.prefix(src="../viewer_components/updater", dst=""):
+                    self.path("update_install")
+                    self.end_prefix()
 
                 if self.prefix("cursors_mac"):
                     self.path("*.tif")
-- 
cgit v1.2.3


From 9ae2891a3afefcbf0c72cadaef203426cb0e5954 Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Tue, 9 Nov 2010 15:04:44 -0800
Subject: start of a thread safe queue

---
 indra/newview/CMakeLists.txt         |  2 +
 indra/newview/llappviewer.cpp        |  5 +++
 indra/newview/llmainlooprepeater.cpp | 82 ++++++++++++++++++++++++++++++++++++
 indra/newview/llmainlooprepeater.h   | 65 ++++++++++++++++++++++++++++
 4 files changed, 154 insertions(+)
 create mode 100644 indra/newview/llmainlooprepeater.cpp
 create mode 100644 indra/newview/llmainlooprepeater.h

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index a9d1fd9064..36cfa615f0 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -283,6 +283,7 @@ set(viewer_SOURCE_FILES
     llloginhandler.cpp
     lllogininstance.cpp
     llmachineid.cpp
+    llmainlooprepeater.cpp
     llmanip.cpp
     llmaniprotate.cpp
     llmanipscale.cpp
@@ -815,6 +816,7 @@ set(viewer_HEADER_FILES
     llloginhandler.h
     lllogininstance.h
     llmachineid.h
+    llmainlooprepeater.h
     llmanip.h
     llmaniprotate.h
     llmanipscale.h
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index c0ec15f436..438f8668ae 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -197,6 +197,8 @@
 #include "llsecapi.h"
 #include "llmachineid.h"
 
+#include "llmainlooprepeater.h"
+
 // *FIX: These extern globals should be cleaned up.
 // The globals either represent state/config/resource-storage of either 
 // this app, or another 'component' of the viewer. App globals should be 
@@ -801,6 +803,9 @@ bool LLAppViewer::init()
 		return 1;
 	}
 	
+	// Initialize the repeater service.
+	LLMainLoopRepeater::getInstance()->start();
+	
 	//
 	// Initialize the window
 	//
diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp
new file mode 100644
index 0000000000..c2eba97641
--- /dev/null
+++ b/indra/newview/llmainlooprepeater.cpp
@@ -0,0 +1,82 @@
+/** 
+ * @file llmachineid.cpp
+ * @brief retrieves unique machine ids
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llapr.h"
+#include "llevents.h"
+#include "llmainlooprepeater.h"
+
+
+
+// LLMainLoopRepeater
+//-----------------------------------------------------------------------------
+
+
+LLMainLoopRepeater::LLMainLoopRepeater(void):
+	mQueue(gAPRPoolp, 1024)
+{
+	; // No op.
+}
+
+
+void LLMainLoopRepeater::start(void)
+{
+	mMainLoopConnection = LLEventPumps::instance().
+		obtain("mainloop").listen("stupid name here", boost::bind(&LLMainLoopRepeater::onMainLoop, this, _1));
+	mRepeaterConnection = LLEventPumps::instance().
+		obtain("mainlooprepeater").listen("other stupid name here", boost::bind(&LLMainLoopRepeater::onMessage, this, _1));
+}
+
+
+void LLMainLoopRepeater::stop(void)
+{
+	mMainLoopConnection.release();
+	mRepeaterConnection.release();
+}
+
+
+bool LLMainLoopRepeater::onMainLoop(LLSD const &)
+{
+	LLSD message;
+	while(mQueue.tryPopBack(message)) {
+		std::string pump = message["pump"].asString();
+		if(pump.length() == 0 ) continue; // No pump.
+		LLEventPumps::instance().obtain(pump).post(message["payload"]);
+	}
+	return false;
+}
+
+
+bool LLMainLoopRepeater::onMessage(LLSD const & event)
+{
+	try {
+		mQueue.pushFront(event);
+	} catch(LLThreadSafeQueueError & e) {
+		llwarns << "could not repeat message (" << e.what() << ")" << 
+			event.asString() << LL_ENDL;
+	}
+	return false;
+}
diff --git a/indra/newview/llmainlooprepeater.h b/indra/newview/llmainlooprepeater.h
new file mode 100644
index 0000000000..96b83b4916
--- /dev/null
+++ b/indra/newview/llmainlooprepeater.h
@@ -0,0 +1,65 @@
+/** 
+ * @file llmainlooprepeater.h
+ * @brief a service for repeating messages on the main loop.
+ *
+ * $LicenseInfo:firstyear=2010&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLMAINLOOPREPEATER_H
+#define LL_LLMAINLOOPREPEATER_H
+
+
+#include "llsd.h"
+#include "llthreadsafequeue.h"
+
+
+//
+// A service which creates the pump 'mainlooprepeater' to which any thread can
+// post a message that will be re-posted on the main loop.
+//
+// The posted message should contain two map elements: pump and payload.  The
+// pump value is a string naming the pump to which the message should be
+// re-posted.  The payload value is what will be posted to the designated pump.
+//
+class LLMainLoopRepeater:
+	public LLSingleton<LLMainLoopRepeater>
+{
+public:
+	LLMainLoopRepeater(void);
+	
+	// Start the repeater service.
+	void start(void);
+	
+	// Stop the repeater service.
+	void stop(void);
+	
+private:
+	LLTempBoundListener mMainLoopConnection;
+	LLTempBoundListener mRepeaterConnection;
+	LLThreadSafeQueue<LLSD> mQueue;
+	
+	bool onMainLoop(LLSD const &);
+	bool onMessage(LLSD const & event);
+};
+
+
+#endif
-- 
cgit v1.2.3


From b2e84d739b4f5c00b497e57e892fc10d78af8b76 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Wed, 10 Nov 2010 14:26:14 -0800
Subject: CHOP-151 Adding startup updater flow to drive update installation and
 resume.

---
 indra/newview/llappviewer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 6bb25969a6..335998767c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2341,7 +2341,7 @@ void LLAppViewer::initUpdater()
 	std::string service_path = gSavedSettings.getString("UpdaterServicePath");
 	U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod");
 
-	mUpdater->setParams(protocol_version, url, service_path, channel, version);
+	mUpdater->initialize(protocol_version, url, service_path, channel, version);
 	mUpdater->setCheckPeriod(check_period);
 	if(gSavedSettings.getBOOL("UpdaterServiceActive"))
 	{
-- 
cgit v1.2.3


From 41517715844c986aab169502c94f39a9f507eb55 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Wed, 10 Nov 2010 19:21:03 -0800
Subject: CHOP-151 Hooked up app exit callback, cleaned up early exit. Rev. by
 Brad

---
 indra/newview/llappviewer.cpp | 66 +++++++++++++++++++++++++++++--------------
 1 file changed, 45 insertions(+), 21 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 10c03954bc..c06f0c18e8 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -661,6 +661,14 @@ bool LLAppViewer::init()
     initThreads();
     writeSystemInfo();
 
+	// Initialize updater service (now that we have an io pump)
+	initUpdater();
+	if(isQuitting())
+	{
+		// Early out here because updater set the quitting flag.
+		return true;
+	}
+
 	//////////////////////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////////////////////
@@ -979,9 +987,6 @@ bool LLAppViewer::mainLoop()
 	LLHTTPClient::setPump(*gServicePump);
 	LLCurl::setCAFile(gDirUtilp->getCAFile());
 	
-	// Initialize updater service (now that we have an io pump)
-	initUpdater();
-	
 	// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated.
 
 	LLVoiceChannel::initClass();
@@ -1364,11 +1369,14 @@ bool LLAppViewer::cleanup()
 	llinfos << "Cleaning Up" << llendflush;
 
 	// Must clean up texture references before viewer window is destroyed.
-	LLHUDManager::getInstance()->updateEffects();
-	LLHUDObject::updateAll();
-	LLHUDManager::getInstance()->cleanupEffects();
-	LLHUDObject::cleanupHUDObjects();
-	llinfos << "HUD Objects cleaned up" << llendflush;
+	if(LLHUDManager::instanceExists())
+	{
+		LLHUDManager::getInstance()->updateEffects();
+		LLHUDObject::updateAll();
+		LLHUDManager::getInstance()->cleanupEffects();
+		LLHUDObject::cleanupHUDObjects();
+		llinfos << "HUD Objects cleaned up" << llendflush;
+	}
 
 	LLKeyframeDataCache::clear();
 	
@@ -1380,8 +1388,10 @@ bool LLAppViewer::cleanup()
 	// Note: this is where gWorldMap used to be deleted.
 
 	// Note: this is where gHUDManager used to be deleted.
-	LLHUDManager::getInstance()->shutdownClass();
-	
+	if(LLHUDManager::instanceExists())
+	{
+		LLHUDManager::getInstance()->shutdownClass();
+	}
 
 	delete gAssetStorage;
 	gAssetStorage = NULL;
@@ -1683,7 +1693,10 @@ bool LLAppViewer::cleanup()
 
 #ifndef LL_RELEASE_FOR_DOWNLOAD
 	llinfos << "Auditing VFS" << llendl;
-	gVFS->audit();
+	if(gVFS)
+	{
+		gVFS->audit();
+	}
 #endif
 
 	llinfos << "Misc Cleanup" << llendflush;
@@ -2383,8 +2396,13 @@ void LLAppViewer::initUpdater()
 	std::string service_path = gSavedSettings.getString("UpdaterServicePath");
 	U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod");
 
-	mUpdater->initialize(protocol_version, url, service_path, channel, version);
-	mUpdater->setCheckPeriod(check_period);
+	mUpdater->setAppExitCallback(boost::bind(&LLAppViewer::forceQuit, this));
+	mUpdater->initialize(protocol_version, 
+						 url, 
+						 service_path, 
+						 channel, 
+						 version);
+ 	mUpdater->setCheckPeriod(check_period);
 	if(gSavedSettings.getBOOL("UpdaterServiceActive"))
 	{
 		mUpdater->startChecking();
@@ -2550,15 +2568,18 @@ void LLAppViewer::cleanupSavedSettings()
 
 	// save window position if not maximized
 	// as we don't track it in callbacks
-	BOOL maximized = gViewerWindow->mWindow->getMaximized();
-	if (!maximized)
+	if(NULL != gViewerWindow)
 	{
-		LLCoordScreen window_pos;
-
-		if (gViewerWindow->mWindow->getPosition(&window_pos))
+		BOOL maximized = gViewerWindow->mWindow->getMaximized();
+		if (!maximized)
 		{
-			gSavedSettings.setS32("WindowX", window_pos.mX);
-			gSavedSettings.setS32("WindowY", window_pos.mY);
+			LLCoordScreen window_pos;
+
+			if (gViewerWindow->mWindow->getPosition(&window_pos))
+			{
+				gSavedSettings.setS32("WindowX", window_pos.mX);
+				gSavedSettings.setS32("WindowY", window_pos.mY);
+			}
 		}
 	}
 
@@ -4297,7 +4318,10 @@ void LLAppViewer::disconnectViewer()
 
 	// This is where we used to call gObjectList.destroy() and then delete gWorldp.
 	// Now we just ask the LLWorld singleton to cleanly shut down.
-	LLWorld::getInstance()->destroyClass();
+	if(LLWorld::instanceExists())
+	{
+		LLWorld::getInstance()->destroyClass();
+	}
 
 	// call all self-registered classes
 	LLDestroyClassList::instance().fireCallbacks();
-- 
cgit v1.2.3


From 6e15957d909787ba612004903f04335a593b5348 Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Thu, 11 Nov 2010 09:40:30 -0800
Subject: run install script on successful download

---
 indra/newview/viewer_manifest.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index f95697adb6..0073641ed4 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -571,14 +571,16 @@ class DarwinManifest(ViewerManifest):
 
             # copy additional libs in <bundle>/Contents/MacOS/
             self.path("../../libraries/universal-darwin/lib_release/libndofdev.dylib", dst="MacOS/libndofdev.dylib")
+			
+					
+            if self.prefix(src="../viewer_components/updater", dst="MacOS"):
+                self.path("update_install")
+                self.end_prefix()
+
 
             # most everything goes in the Resources directory
             if self.prefix(src="", dst="Resources"):
                 super(DarwinManifest, self).construct()
-		
-                if self.prefix(src="../viewer_components/updater", dst=""):
-                    self.path("update_install")
-                    self.end_prefix()
 
                 if self.prefix("cursors_mac"):
                     self.path("*.tif")
-- 
cgit v1.2.3


From 4e22d63352dd65085cfbba9c22070271ecdd4bcf Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Thu, 11 Nov 2010 11:05:46 -0800
Subject: Add very basic windows install script.

---
 indra/newview/viewer_manifest.py | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 0073641ed4..55d64fd3a6 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -251,6 +251,10 @@ class WindowsManifest(ViewerManifest):
         if self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']),
                        dst=""):
 
+            if self.prefix(src="../../viewer_components/updater", dst=""):
+                self.path("update_install.bat")
+                self.end_prefix()
+
             self.enable_crt_manifest_check()
 
             # Get kdu dll, continue if missing.
-- 
cgit v1.2.3


From 7a7f89db6d9c5e6b2c6c89ea39c0302907a0442b Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Thu, 11 Nov 2010 11:46:24 -0800
Subject: fix termination issues with thread safe queue in main loop repeater
 service.

---
 indra/newview/llappviewer.cpp        |  4 +++-
 indra/newview/llmainlooprepeater.cpp | 12 +++++++++---
 indra/newview/llmainlooprepeater.h   |  2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index c06f0c18e8..76d518b610 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -812,7 +812,7 @@ bool LLAppViewer::init()
 	}
 	
 	// Initialize the repeater service.
-	LLMainLoopRepeater::getInstance()->start();
+	LLMainLoopRepeater::instance().start();
 	
 	//
 	// Initialize the window
@@ -1737,6 +1737,8 @@ bool LLAppViewer::cleanup()
 		llinfos << "File launched." << llendflush;
 	}
 
+	LLMainLoopRepeater::instance().stop();
+
 	ll_close_fail_log();
 
     llinfos << "Goodbye!" << llendflush;
diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp
index c2eba97641..ddc925a73b 100644
--- a/indra/newview/llmainlooprepeater.cpp
+++ b/indra/newview/llmainlooprepeater.cpp
@@ -36,7 +36,7 @@
 
 
 LLMainLoopRepeater::LLMainLoopRepeater(void):
-	mQueue(gAPRPoolp, 1024)
+	mQueue(0)
 {
 	; // No op.
 }
@@ -44,6 +44,9 @@ LLMainLoopRepeater::LLMainLoopRepeater(void):
 
 void LLMainLoopRepeater::start(void)
 {
+	if(mQueue != 0) return;
+
+	mQueue = new LLThreadSafeQueue<LLSD>(gAPRPoolp, 1024);
 	mMainLoopConnection = LLEventPumps::instance().
 		obtain("mainloop").listen("stupid name here", boost::bind(&LLMainLoopRepeater::onMainLoop, this, _1));
 	mRepeaterConnection = LLEventPumps::instance().
@@ -55,13 +58,16 @@ void LLMainLoopRepeater::stop(void)
 {
 	mMainLoopConnection.release();
 	mRepeaterConnection.release();
+
+	delete mQueue;
+	mQueue = 0;
 }
 
 
 bool LLMainLoopRepeater::onMainLoop(LLSD const &)
 {
 	LLSD message;
-	while(mQueue.tryPopBack(message)) {
+	while(mQueue->tryPopBack(message)) {
 		std::string pump = message["pump"].asString();
 		if(pump.length() == 0 ) continue; // No pump.
 		LLEventPumps::instance().obtain(pump).post(message["payload"]);
@@ -73,7 +79,7 @@ bool LLMainLoopRepeater::onMainLoop(LLSD const &)
 bool LLMainLoopRepeater::onMessage(LLSD const & event)
 {
 	try {
-		mQueue.pushFront(event);
+		mQueue->pushFront(event);
 	} catch(LLThreadSafeQueueError & e) {
 		llwarns << "could not repeat message (" << e.what() << ")" << 
 			event.asString() << LL_ENDL;
diff --git a/indra/newview/llmainlooprepeater.h b/indra/newview/llmainlooprepeater.h
index 96b83b4916..f84c0ca94c 100644
--- a/indra/newview/llmainlooprepeater.h
+++ b/indra/newview/llmainlooprepeater.h
@@ -55,7 +55,7 @@ public:
 private:
 	LLTempBoundListener mMainLoopConnection;
 	LLTempBoundListener mRepeaterConnection;
-	LLThreadSafeQueue<LLSD> mQueue;
+	LLThreadSafeQueue<LLSD> * mQueue;
 	
 	bool onMainLoop(LLSD const &);
 	bool onMessage(LLSD const & event);
-- 
cgit v1.2.3


From bfa393f933ccf11105daf5258f373efc764b736f Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Thu, 11 Nov 2010 19:05:05 -0800
Subject: CHOP-178 Add a non-interactive moe to the windows installer. Rev by
 Brad

---
 .../installers/windows/installer_template.nsi      | 55 +++++++++++++++-------
 1 file changed, 39 insertions(+), 16 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index d5712f80cf..4e8ed807ee 100644
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -85,6 +85,8 @@ AutoCloseWindow true					; after all files install, close window
 InstallDir "$PROGRAMFILES\${INSTNAME}"
 InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" ""
 DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup)
+Page directory dirPre
+Page instfiles
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Variables
@@ -95,6 +97,8 @@ Var INSTFLAGS
 Var INSTSHORTCUT
 Var COMMANDLINE         ; command line passed to this installer, set in .onInit
 Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
+Var SKIP_DIALOGS        ; set from command line in  .onInit. autoinstall 
+                        ; GUI and the defaults.
 
 ;;; Function definitions should go before file includes, because calls to
 ;;; DLLs like LangDLL trigger an implicit file include, so if that call is at
@@ -110,6 +114,9 @@ Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 Function .onInstSuccess
     Push $R0	# Option value, unused
+
+    StrCmp $SKIP_DIALOGS "true" label_launch 
+
     ${GetOptions} $COMMANDLINE "/AUTOSTART" $R0
     # If parameter was there (no error) just launch
     # Otherwise ask
@@ -128,6 +135,13 @@ label_no_launch:
 	Pop $R0
 FunctionEnd
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Pre-directory page callback
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function dirPre
+    StrCmp $SKIP_DIALOGS "true" 0 +2
+	Abort
+FunctionEnd    
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; Make sure we're not on Windows 98 / ME
@@ -145,7 +159,8 @@ Function CheckWindowsVersion
 	StrCmp $R0 "NT" win_ver_bad
 	Return
 win_ver_bad:
-	MessageBox MB_YESNO $(CheckWindowsVersionMB) IDNO win_ver_abort
+	StrCmp $SKIP_DIALOGS "true" +2 ; If skip_dialogs is set just install
+            MessageBox MB_YESNO $(CheckWindowsVersionMB) IDNO win_ver_abort
 	Return
 win_ver_abort:
 	Quit
@@ -184,13 +199,13 @@ FunctionEnd
 ; If it has, allow user to bail out of install process.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 Function CheckIfAlreadyCurrent
-  Push $0
-	ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version"
-    StrCmp $0 ${VERSION_LONG} 0 DONE
-	MessageBox MB_OKCANCEL $(CheckIfCurrentMB) /SD IDOK IDOK DONE
+    Push $0
+    ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version"
+    StrCmp $0 ${VERSION_LONG} 0 continue_install
+    StrCmp $SKIP_DIALOGS "true" continue_install
+    MessageBox MB_OKCANCEL $(CheckIfCurrentMB) /SD IDOK IDOK continue_install
     Quit
-
-  DONE:
+continue_install:
     Pop $0
     Return
 FunctionEnd
@@ -203,7 +218,9 @@ Function CloseSecondLife
   Push $0
   FindWindow $0 "Second Life" ""
   IntCmp $0 0 DONE
-  MessageBox MB_OKCANCEL $(CloseSecondLifeInstMB) IDOK CLOSE IDCANCEL CANCEL_INSTALL
+  
+  StrCmp $SKIP_DIALOGS "true" CLOSE
+    MessageBox MB_OKCANCEL $(CloseSecondLifeInstMB) IDOK CLOSE IDCANCEL CANCEL_INSTALL
 
   CANCEL_INSTALL:
     Quit
@@ -659,23 +676,29 @@ FunctionEnd
 Function .onInit
     Push $0
     ${GetParameters} $COMMANDLINE              ; get our command line
+
+    ${GetOptions} $COMMANDLINE "/SKIP_DIALOGS" $0   
+    IfErrors +2 0 ; If error jump past setting SKIP_DIALOGS
+        StrCpy $SKIP_DIALOGS "true"
+
     ${GetOptions} $COMMANDLINE "/LANGID=" $0   ; /LANGID=1033 implies US English
     ; If no language (error), then proceed
-    IfErrors lbl_check_silent
+    IfErrors lbl_configure_default_lang
     ; No error means we got a language, so use it
     StrCpy $LANGUAGE $0
     Goto lbl_return
 
-lbl_check_silent:
-    ; For silent installs, no language prompt, use default
-    IfSilent lbl_return
-    
-	; If we currently have a version of SL installed, default to the language of that install
+lbl_configure_default_lang:
+    ; If we currently have a version of SL installed, default to the language of that install
     ; Otherwise don't change $LANGUAGE and it will default to the OS UI language.
-	ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage"
-    IfErrors lbl_build_menu
+    ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage"
+    IfErrors +2 0 ; If error skip the copy instruction 
 	StrCpy $LANGUAGE $0
 
+    ; For silent installs, no language prompt, use default
+    IfSilent lbl_return
+    StrCmp $SKIP_DIALOGS "true" lbl_return
+  
 lbl_build_menu:
 	Push ""
     # Use separate file so labels can be UTF-16 but we can still merge changes
-- 
cgit v1.2.3


From 13b77e3622de18ac8d06fdfffceb08990eb908f9 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Tue, 16 Nov 2010 16:21:17 -0800
Subject: CHOP-179 Linux install uses linux-updater. Rev. by Alain

---
 indra/newview/viewer_manifest.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 55d64fd3a6..5d35778e3e 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -247,13 +247,12 @@ class WindowsManifest(ViewerManifest):
         
         self.disable_manifest_check()
 
+        self.path("../viewer_components/updater/scripts/windows/update_install.bat")
+
         # Get shared libs from the shared libs staging directory
         if self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']),
                        dst=""):
 
-            if self.prefix(src="../../viewer_components/updater", dst=""):
-                self.path("update_install.bat")
-                self.end_prefix()
 
             self.enable_crt_manifest_check()
 
@@ -575,12 +574,8 @@ class DarwinManifest(ViewerManifest):
 
             # copy additional libs in <bundle>/Contents/MacOS/
             self.path("../../libraries/universal-darwin/lib_release/libndofdev.dylib", dst="MacOS/libndofdev.dylib")
-			
-					
-            if self.prefix(src="../viewer_components/updater", dst="MacOS"):
-                self.path("update_install")
-                self.end_prefix()
 
+            self.path("../viewer_components/updater/scripts/darwin/update_install", "MacOS/update_install")
 
             # most everything goes in the Resources directory
             if self.prefix(src="", dst="Resources"):
@@ -857,6 +852,8 @@ class LinuxManifest(ViewerManifest):
             # recurse
             self.end_prefix("res-sdl")
 
+        self.path("../viewer_components/updater/scripts/linux/update_install", "bin/update_install")
+
         # plugins
         if self.prefix(src="", dst="bin/llplugin"):
             self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
-- 
cgit v1.2.3


From 9053aa7d1cb53445f7c7e8d929e3850807b52228 Mon Sep 17 00:00:00 2001
From: Dave SIMmONs <simon@lindenlab.com>
Date: Wed, 17 Nov 2010 11:05:03 -0800
Subject: ER-301 : increase allowable bandwidth.  Bumped up to 3 mbps.

---
 indra/newview/llviewerthrottle.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp
index b614ccdbc2..5147272122 100644
--- a/indra/newview/llviewerthrottle.cpp
+++ b/indra/newview/llviewerthrottle.cpp
@@ -46,7 +46,7 @@ const F32 MAX_FRACTIONAL = 1.5f;
 const F32 MIN_FRACTIONAL = 0.2f;
 
 const F32 MIN_BANDWIDTH = 50.f;
-const F32 MAX_BANDWIDTH = 1500.f;
+const F32 MAX_BANDWIDTH = 3000.f;
 const F32 STEP_FRACTIONAL = 0.1f;
 const F32 TIGHTEN_THROTTLE_THRESHOLD = 3.0f; // packet loss % per s
 const F32 EASE_THROTTLE_THRESHOLD = 0.5f; // packet loss % per s
-- 
cgit v1.2.3


From fa2aeb07f8474cfd5d61d5347dfcc28bd8f7f257 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Wed, 17 Nov 2010 21:40:04 +0200
Subject: STORM-316 FIXED Added an item to inventory gear menu to control "Sort
 System Folders to Top" option (was always "true"). Changed inventory gear
 menu sort items - now they have check marks on the left. Made inventory sort
 options persist across sessions.

---
 indra/newview/llpanelmaininventory.cpp             | 47 ++++++++++++++++++++--
 indra/newview/llpanelmaininventory.h               |  1 +
 .../default/xui/en/menu_inventory_gear_default.xml | 25 ++++++++++--
 3 files changed, 66 insertions(+), 7 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 904e3dabcc..17433a557b 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -329,15 +329,23 @@ void LLPanelMainInventory::setSortBy(const LLSD& userdata)
 	if (sort_field == "name")
 	{
 		U32 order = getActivePanel()->getSortOrder();
-		getActivePanel()->setSortOrder( order & ~LLInventoryFilter::SO_DATE );
-			
+		order &= ~LLInventoryFilter::SO_DATE;
+
+		getActivePanel()->setSortOrder( order );
+
+		gSavedSettings.setU32("InventorySortOrder", order);
+
 		gSavedSettings.setBOOL("Inventory.SortByName", TRUE );
 		gSavedSettings.setBOOL("Inventory.SortByDate", FALSE );
 	}
 	else if (sort_field == "date")
 	{
 		U32 order = getActivePanel()->getSortOrder();
-		getActivePanel()->setSortOrder( order | LLInventoryFilter::SO_DATE );
+		order |= LLInventoryFilter::SO_DATE;
+
+		getActivePanel()->setSortOrder( order );
+
+		gSavedSettings.setU32("InventorySortOrder", order);
 
 		gSavedSettings.setBOOL("Inventory.SortByName", FALSE );
 		gSavedSettings.setBOOL("Inventory.SortByDate", TRUE );
@@ -375,6 +383,8 @@ void LLPanelMainInventory::setSortBy(const LLSD& userdata)
 			gSavedSettings.setBOOL("Inventory.SystemFoldersToTop", TRUE );
 		}
 		getActivePanel()->setSortOrder( order );
+
+		gSavedSettings.setU32("InventorySortOrder", order);
 	}
 }
 
@@ -915,6 +925,7 @@ void LLPanelMainInventory::initListCommandsHandlers()
 			));
 
 	mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2));
+	mEnableCallbackRegistrar.add("Inventory.GearDefault.Check", boost::bind(&LLPanelMainInventory::isActionChecked, this, _2));
 	mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2));
 	mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
 	mGearMenuButton->setMenu(mMenuGearDefault);
@@ -1000,6 +1011,11 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
 		const LLSD arg = "date";
 		setSortBy(arg);
 	}
+	if (command_name == "sort_system_folders_to_top")
+	{
+		const LLSD arg = "systemfolderstotop";
+		setSortBy(arg);
+	}
 	if (command_name == "show_filters")
 	{
 		toggleFindOptions();
@@ -1173,6 +1189,31 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
 	return TRUE;
 }
 
+BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata)
+{
+	const std::string command_name = userdata.asString();
+
+	if (command_name == "sort_by_name")
+	{
+		U32 order = getActivePanel()->getSortOrder();
+		return ~order & LLInventoryFilter::SO_DATE;
+	}
+
+	if (command_name == "sort_by_recent")
+	{
+		U32 order = getActivePanel()->getSortOrder();
+		return order & LLInventoryFilter::SO_DATE;
+	}
+
+	if (command_name == "sort_system_folders_to_top")
+	{
+		U32 order = getActivePanel()->getSortOrder();
+		return order & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP;
+	}
+
+	return FALSE;
+}
+
 bool LLPanelMainInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept)
 {
 	*accept = ACCEPT_NO;
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index d136e2d32e..c2b78ff9ea 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -136,6 +136,7 @@ protected:
 	void onTrashButtonClick();
 	void onClipboardAction(const LLSD& userdata);
 	BOOL isActionEnabled(const LLSD& command_name);
+	BOOL isActionChecked(const LLSD& userdata);
 	void onCustomAction(const LLSD& command_name);
 	bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept);
 	/**
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
index 679d5bc82e..7fa4cd840a 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
@@ -16,22 +16,39 @@
     </menu_item_call>
     <menu_item_separator
      layout="topleft" />
-    <menu_item_call
+    <menu_item_check
      label="Sort by Name"
      layout="topleft"
      name="sort_by_name">
         <on_click
          function="Inventory.GearDefault.Custom.Action"
          parameter="sort_by_name" />
-    </menu_item_call>
-    <menu_item_call
+        <on_check
+         function="Inventory.GearDefault.Check"
+         parameter="sort_by_name" />
+    </menu_item_check>
+    <menu_item_check
      label="Sort by Most Recent"
      layout="topleft"
      name="sort_by_recent">
         <on_click
          function="Inventory.GearDefault.Custom.Action"
          parameter="sort_by_recent" />
-    </menu_item_call>
+        <on_check
+         function="Inventory.GearDefault.Check"
+         parameter="sort_by_recent" />         
+    </menu_item_check>
+    <menu_item_check
+     label="Sort System Folders to Top"
+     layout="topleft"
+     name="sort_system_folders_to_top">
+        <on_click
+         function="Inventory.GearDefault.Custom.Action"
+         parameter="sort_system_folders_to_top" />
+        <on_check
+         function="Inventory.GearDefault.Check"
+         parameter="sort_system_folders_to_top" />
+    </menu_item_check>
     <menu_item_separator
      layout="topleft" />
     <menu_item_call
-- 
cgit v1.2.3


From c61d89f61d0b696e6e73105ed7be7580bf1b3437 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Wed, 17 Nov 2010 12:24:37 -0800
Subject: CHOP-203 Fixed linux release bug - exclude update_install from symbol
 strippage

---
 indra/newview/viewer_manifest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 5d35778e3e..4e5d6271df 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -882,7 +882,7 @@ class LinuxManifest(ViewerManifest):
 
         if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
             print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
-            self.run_command("find %(d)r/bin %(d)r/lib -type f | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
+            self.run_command("find %(d)r/bin %(d)r/lib -type f \\! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
 
         # Fix access permissions
         self.run_command("""
-- 
cgit v1.2.3


From 5c35547ade48123cb571714de42ffe42b232480d Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Wed, 17 Nov 2010 16:50:38 -0800
Subject: CHOP-135 Added Pref UI to Setup panel. Rev. by Brad

---
 .../default/xui/en/panel_preferences_setup.xml     | 26 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index 140d16e37f..79013e7e27 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -29,7 +29,7 @@
    layout="topleft"
    left_delta="50"
    name=" Mouse Sensitivity"
-   top_pad="10"
+   top_pad="5"
    width="150">
     Mouse sensitivity
   </text>
@@ -76,7 +76,7 @@
    left_delta="50"
    name="Maximum bandwidth"
    mouse_opaque="false"
-   top_pad="10"
+   top_pad="5"
    width="200">
     Maximum bandwidth
   </text>
@@ -115,7 +115,7 @@
    layout="topleft"
    left="77"
    name="connection_port_enabled"
-   top_pad="20"
+   top_pad="10"
    width="256">
     <check_box.commit_callback
      function="Notification.Show"
@@ -147,7 +147,7 @@
    left="80"
    mouse_opaque="false"
    name="cache_size_label_l"
-   top_pad="20"
+   top_pad="10"
    width="200">
     Cache size
   </text>
@@ -239,7 +239,7 @@
          layout="topleft"
          left="30"
          name="Web:"
-         top_pad="5"
+         top_pad="10"
          width="300">
     Web:
   </text>
@@ -386,4 +386,20 @@
    name="web_proxy_port"
    top_delta="0"
    width="145" />
+
+  <check_box
+    top_delta="2"
+    enabled="true"
+    follows="left|top"
+    height="18"
+    initial_value="true"
+    control_name="UpdaterServiceActive"
+    label="Automatically download and install [APP_NAME] updates"
+    left="30"
+    mouse_opaque="true"
+    name="updater_service_active"
+    radio_style="false"
+    width="400"
+    top_pad="10"/>
+
 </panel>
-- 
cgit v1.2.3


From 098fa21c4f812b94348c0631c29babff68968d3d Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Wed, 17 Nov 2010 17:06:21 -0800
Subject: Work on CHOP-135: Hooking up setting UpdaterServiceActive to
 functionality. Paired with Mani. Toggling the setting now calls
 LLUpdaterService::startChecking() and LLUpdaterService::stopChecking(), which
 enable and disable the service.

---
 indra/newview/llviewercontrol.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index f579c433e1..f65811598f 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -70,6 +70,7 @@
 #include "llpaneloutfitsinventory.h"
 #include "llpanellogin.h"
 #include "llpaneltopinfobar.h"
+#include "llupdaterservice.h"
 
 #ifdef TOGGLE_HACKED_GODLIKE_VIEWER
 BOOL 				gHackGodmode = FALSE;
@@ -488,6 +489,18 @@ bool toggle_show_object_render_cost(const LLSD& newvalue)
 	return true;
 }
 
+void toggle_updater_service_active(LLControlVariable* control, const LLSD& new_value)
+{
+    if(new_value.asBoolean())
+    {
+        LLUpdaterService().startChecking();
+    }
+    else
+    {
+        LLUpdaterService().stopChecking();
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////
 
 void settings_setup_listeners()
@@ -635,6 +648,7 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2));
 	gSavedSettings.getControl("ShowMiniLocationPanel")->getSignal()->connect(boost::bind(&toggle_show_mini_location_panel, _2));
 	gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2));
+	gSavedSettings.getControl("UpdaterServiceActive")->getSignal()->connect(&toggle_updater_service_active);
 	gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2));
 }
 
-- 
cgit v1.2.3


From 86260988e332c2ff750f680ada13560c2c97fa5d Mon Sep 17 00:00:00 2001
From: Andrew Productengine <adyukov@productengine.com>
Date: Thu, 18 Nov 2010 13:14:06 +0200
Subject: STORM-576 FIXED Hooked up code to preference that allows users to
 enable double-click to teleport or use auto-pilot.

- Added dirty flag that is set true when user changes checkbox or chooses one of radiobuttons connected to double-click action. No change of user settings happens on this commit, because user may press cancel or close floater. If user presses OK, and flag is true, user changes are applied to settings.
If user clicks cancel or closes floater, controls are reverted to the state they were before changes, using settings to determine it.

- Removed double-click action menu items and code that handled them to avoid functionality duplication and synchronization problems.
---
 indra/newview/llfloaterpreference.cpp              | 81 +++++++++++++++++++++-
 indra/newview/llfloaterpreference.h                | 11 +++
 indra/newview/llviewermenu.cpp                     | 10 ---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 20 ------
 .../default/xui/en/panel_preferences_move.xml      |  9 ++-
 5 files changed, 97 insertions(+), 34 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index c105f023c7..ac940f4f77 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -282,7 +282,8 @@ std::string LLFloaterPreference::sSkin = "";
 LLFloaterPreference::LLFloaterPreference(const LLSD& key)
 	: LLFloater(key),
 	mGotPersonalInfo(false),
-	mOriginalIMViaEmail(false)
+	mOriginalIMViaEmail(false),
+	mDoubleClickActionDirty(false)
 {
 	//Build Floater is now Called from 	LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
 	
@@ -320,6 +321,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
 	mCommitCallbackRegistrar.add("Pref.getUIColor",				boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2));
 	mCommitCallbackRegistrar.add("Pref.MaturitySettings",		boost::bind(&LLFloaterPreference::onChangeMaturity, this));
 	mCommitCallbackRegistrar.add("Pref.BlockList",				boost::bind(&LLFloaterPreference::onClickBlockList, this));
+	mCommitCallbackRegistrar.add("Pref.CommitDoubleClickChekbox",	boost::bind(&LLFloaterPreference::onDoubleClickCheckBox, this, _1));
+	mCommitCallbackRegistrar.add("Pref.CommitRadioDoubleClick",	boost::bind(&LLFloaterPreference::onDoubleClickRadio, this));
 
 	sSkin = gSavedSettings.getString("SkinCurrent");
 	
@@ -342,6 +345,8 @@ BOOL LLFloaterPreference::postBuild()
 	if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
 		tabcontainer->selectFirstTab();
 
+	updateDoubleClickControls();
+
 	getChild<LLUICtrl>("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227)
 	std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "");
 	setCacheLocation(cache_location);
@@ -475,6 +480,12 @@ void LLFloaterPreference::apply()
 			gAgent.sendAgentUpdateUserInfo(new_im_via_email,mDirectoryVisibility);
 		}
 	}
+
+	if (mDoubleClickActionDirty)
+	{
+		updateDoubleClickSettings();
+		mDoubleClickActionDirty = false;
+	}
 }
 
 void LLFloaterPreference::cancel()
@@ -501,6 +512,12 @@ void LLFloaterPreference::cancel()
 	
 	// reverts any changes to current skin
 	gSavedSettings.setString("SkinCurrent", sSkin);
+
+	if (mDoubleClickActionDirty)
+	{
+		updateDoubleClickControls();
+		mDoubleClickActionDirty = false;
+	}
 }
 
 void LLFloaterPreference::onOpen(const LLSD& key)
@@ -1318,6 +1335,68 @@ void LLFloaterPreference::onClickBlockList()
 	}
 }
 
+void LLFloaterPreference::onDoubleClickCheckBox(LLUICtrl* ctrl)
+{
+	if (!ctrl) return;
+	mDoubleClickActionDirty = true;
+	LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action");
+	if (!radio_double_click_action) return;
+	// select default value("teleport") in radio-group.
+	radio_double_click_action->setSelectedIndex(0);
+	// set radio-group enabled depending on state of checkbox
+	radio_double_click_action->setEnabled(ctrl->getValue());
+}
+
+void LLFloaterPreference::onDoubleClickRadio()
+{
+	mDoubleClickActionDirty = true;
+}
+
+void LLFloaterPreference::updateDoubleClickSettings()
+{
+	LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox");
+	if (!double_click_action_cb) return;
+	bool enable = double_click_action_cb->getValue().asBoolean();
+
+	LLRadioGroup* radio_double_click_action = getChild<LLRadioGroup>("double_click_action");
+	if (!radio_double_click_action) return;
+	
+	// enable double click radio-group depending on state of checkbox
+	radio_double_click_action->setEnabled(enable);
+	
+	if (!enable)
+	{
+		// set double click action settings values to false if checkbox was unchecked
+		gSavedSettings.setBOOL("DoubleClickAutoPilot", false);
+		gSavedSettings.setBOOL("DoubleClickTeleport", false);
+	}
+	else
+	{
+		std::string selected = radio_double_click_action->getValue().asString();
+		bool teleport_selected = selected == "radio_teleport";
+		// set double click action settings values depending on chosen radio-button
+		gSavedSettings.setBOOL( "DoubleClickTeleport", teleport_selected );
+		gSavedSettings.setBOOL( "DoubleClickAutoPilot", !teleport_selected );
+	}
+}
+
+void LLFloaterPreference::updateDoubleClickControls()
+{
+	// check is one of double-click actions settings enabled
+	bool double_click_action_enabled = gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport");
+	LLCheckBoxCtrl* double_click_action_cb = getChild<LLCheckBoxCtrl>("double_click_chkbox");
+	if (double_click_action_cb)
+	{
+		// check checkbox if one of double-click actions settings enabled, uncheck otherwise
+		double_click_action_cb->setValue(double_click_action_enabled);
+	}
+	LLRadioGroup* double_click_action_radio = getChild<LLRadioGroup>("double_click_action");
+	if (!double_click_action_radio) return;
+	// set radio-group enabled if one of double-click actions settings enabled
+	double_click_action_radio->setEnabled(double_click_action_enabled);
+	// select button in radio-group depending on setting
+	double_click_action_radio->setSelectedIndex(gSavedSettings.getBOOL("DoubleClickAutoPilot"));
+}
 
 void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
 {
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index e99731b92e..46f50d9a4d 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -95,6 +95,14 @@ protected:
 	void setHardwareDefaults();
 	// callback for when client turns on shaders
 	void onVertexShaderEnable();
+	// callback for changing double click action checkbox
+	void onDoubleClickCheckBox(LLUICtrl* ctrl);
+	// callback for selecting double click action radio-button
+	void onDoubleClickRadio();
+	// updates double-click action settings depending on controls from preferences
+	void updateDoubleClickSettings();
+	// updates double-click action controls depending on values from settings.xml
+	void updateDoubleClickControls();
 	
 	// This function squirrels away the current values of the controls so that
 	// cancel() can restore them.	
@@ -145,6 +153,9 @@ public:
 	static void refreshSkin(void* data);
 private:
 	static std::string sSkin;
+	// set true if state of double-click action checkbox or radio-group was changed by user
+	// (reset back to false on apply or cancel)
+	bool mDoubleClickActionDirty;
 	bool mGotPersonalInfo;
 	bool mOriginalIMViaEmail;
 	
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 2874a6ec79..54fe34e738 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6500,16 +6500,6 @@ class LLToggleControl : public view_listener_t
 		std::string control_name = userdata.asString();
 		BOOL checked = gSavedSettings.getBOOL( control_name );
 		gSavedSettings.setBOOL( control_name, !checked );
-
-        // Doubleclick actions - there can be only one
-        if ((control_name == "DoubleClickAutoPilot") && !checked)
-        {
-			gSavedSettings.setBOOL( "DoubleClickTeleport", FALSE );
-        }
-        else if ((control_name == "DoubleClickTeleport") && !checked)
-        {
-			gSavedSettings.setBOOL( "DoubleClickAutoPilot", FALSE );
-        }
 		return true;
 	}
 };
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 9fcf952bf0..f74b6ba7b5 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2660,26 +2660,6 @@
                 <menu_item_call.on_click
                  function="Advanced.PrintTextureMemoryStats" />
             </menu_item_call>
-            <menu_item_check
-             label="Double-ClickAuto-Pilot"
-             name="Double-ClickAuto-Pilot">
-                <menu_item_check.on_check
-                 function="CheckControl"
-                 parameter="DoubleClickAutoPilot" />
-                <menu_item_check.on_click
-                 function="ToggleControl"
-                 parameter="DoubleClickAutoPilot" />
-            </menu_item_check>
-            <menu_item_check
-             label="Double-Click Teleport"
-             name="DoubleClick Teleport">
-                <menu_item_check.on_check
-                 function="CheckControl"
-                 parameter="DoubleClickTeleport" />
-                <menu_item_check.on_click
-                 function="ToggleControl"
-                 parameter="DoubleClickTeleport" />
-            </menu_item_check>
             <menu_item_check
              label="Region Debug Console"
              name="Region Debug Console"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index c893a92e7c..d2fc6ea09a 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -177,7 +177,10 @@
    left_delta="0"
    name="double_click_chkbox"
    width="237"
-   top_pad="0"/>
+   top_pad="0">
+   <check_box.commit_callback
+    function="Pref.CommitDoubleClickChekbox"/>
+  </check_box>
   <radio_group
      height="20"
      layout="topleft"
@@ -191,7 +194,6 @@
      left="0"
      name="radio_teleport"
      top_delta="20"
-     value="0"
      width="100" />
     <radio_item
      height="16"
@@ -200,8 +202,9 @@
      layout="topleft"
      name="radio_autopilot"
      top_delta="0"
-     value="1"
      width="75" />
+    <radio_group.commit_callback
+	     function="Pref.CommitRadioDoubleClick"/>
   </radio_group>
   <button
    height="23"
-- 
cgit v1.2.3


From 9bebbfbac5b852062baa0ccb049034ff3ab945b8 Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Thu, 18 Nov 2010 13:54:28 -0500
Subject: Viewer 2.4 (as of 18 Nov 2010) with STORM-616 (Me/Movement) merged
 in.

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 72 +++++++++++++---------
 1 file changed, 43 insertions(+), 29 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 9fcf952bf0..e4cee1f774 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -94,6 +94,49 @@
              function="Floater.Toggle"
              parameter="voice_effect" />
         </menu_item_check>
+		<menu
+		 create_jump_keys="true"
+		 label="Movement"
+		 name="Movement"
+		 tear_off="true">
+            <menu_item_call
+             label="Sit Down"
+             layout="topleft"
+		     shortcut="control|alt|S"
+             name="Sit Down Here">
+                <menu_item_call.on_click
+                 function="Self.SitDown"
+                 parameter="" />
+                <menu_item_call.on_enable
+                 function="Self.EnableSitDown" />
+            </menu_item_call>
+            <menu_item_check
+             label="Always Run"
+             name="Always Run"
+             shortcut="control|R">
+                <menu_item_check.on_check
+                 function="World.CheckAlwaysRun" />
+                <menu_item_check.on_click
+                 function="World.AlwaysRun" />
+            </menu_item_check>
+            <menu_item_check
+             label="Fly"
+             name="Fly"
+             shortcut="Home">
+                <menu_item_check.on_check
+                 function="Agent.getFlying" />
+                <menu_item_check.on_click
+                 function="Agent.toggleFlying" />
+                <menu_item_check.on_enable
+                 function="Agent.enableFlying" />
+            </menu_item_check>
+            <menu_item_call
+             label="Stop Animating Me"
+             name="Stop Animating My Avatar">
+                 <menu_item_call.on_click
+                  function="Tools.StopAllAnimations" />
+            </menu_item_call>
+		</menu>
         <menu
          create_jump_keys="true"
          label="My Status"
@@ -995,12 +1038,6 @@
      name="Advanced"
      tear_off="true"
      visible="false">
-        <menu_item_call
-         label="Stop Animating Me"
-         name="Stop Animating My Avatar">
-            <menu_item_call.on_click
-             function="Tools.StopAllAnimations" />
-        </menu_item_call>
         <menu_item_call
          label="Rebake Textures"
          name="Rebake Texture"
@@ -1553,29 +1590,6 @@
 
             <menu_item_separator/>
 
-            <menu_item_check
-             label="Always Run"
-             name="Always Run"
-             shortcut="control|R">
-                <menu_item_check.on_check
-                 function="World.CheckAlwaysRun" />
-                <menu_item_check.on_click
-                 function="World.AlwaysRun" />
-            </menu_item_check>
-            <menu_item_check
-             label="Fly"
-             name="Fly"
-             shortcut="Home">
-                <menu_item_check.on_check
-                 function="Agent.getFlying" />
-                <menu_item_check.on_click
-                 function="Agent.toggleFlying" />
-                <menu_item_check.on_enable
-                 function="Agent.enableFlying" />
-            </menu_item_check>
-
-            <menu_item_separator/>
-
             <menu_item_call
              label="Close Window"
              name="Close Window"
-- 
cgit v1.2.3


From cf3ded4491751231056b220525970e125d813e6a Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Thu, 18 Nov 2010 12:15:49 -0800
Subject: First draft of CHOP-106 downloaded update ready notification.
 Reviewed by mani.

---
 indra/newview/llappviewer.cpp                        | 14 ++++++++++++++
 indra/newview/llmainlooprepeater.cpp                 |  4 ++--
 indra/newview/skins/default/xui/en/notifications.xml |  8 ++++++++
 3 files changed, 24 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 76d518b610..0c6c77566f 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2385,6 +2385,17 @@ bool LLAppViewer::initConfiguration()
 	return true; // Config was successful.
 }
 
+namespace {
+    // *TODO - decide if there's a better place for this function.
+    // do we need a file llupdaterui.cpp or something? -brad
+    bool notify_update(LLSD const & evt)
+    {
+        LLNotificationsUtil::add("DownloadBackground");
+        // let others also handle this event by default
+        return false;
+    }
+};
+
 void LLAppViewer::initUpdater()
 {
 	// Initialize the updater service.
@@ -2409,6 +2420,9 @@ void LLAppViewer::initUpdater()
 	{
 		mUpdater->startChecking();
 	}
+
+    LLEventPump & updater_pump = LLEventPumps::instance().obtain(LLUpdaterService::pumpName());
+    updater_pump.listen("notify_update", notify_update);
 }
 
 void LLAppViewer::checkForCrash(void)
diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp
index ddc925a73b..5c020e6d98 100644
--- a/indra/newview/llmainlooprepeater.cpp
+++ b/indra/newview/llmainlooprepeater.cpp
@@ -48,9 +48,9 @@ void LLMainLoopRepeater::start(void)
 
 	mQueue = new LLThreadSafeQueue<LLSD>(gAPRPoolp, 1024);
 	mMainLoopConnection = LLEventPumps::instance().
-		obtain("mainloop").listen("stupid name here", boost::bind(&LLMainLoopRepeater::onMainLoop, this, _1));
+		obtain("mainloop").listen(LLEventPump::inventName(), boost::bind(&LLMainLoopRepeater::onMainLoop, this, _1));
 	mRepeaterConnection = LLEventPumps::instance().
-		obtain("mainlooprepeater").listen("other stupid name here", boost::bind(&LLMainLoopRepeater::onMessage, this, _1));
+		obtain("mainlooprepeater").listen(LLEventPump::inventName(), boost::bind(&LLMainLoopRepeater::onMessage, this, _1));
 }
 
 
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 1f747ab997..40d5f75de2 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2869,6 +2869,14 @@ Download to your Applications folder?
      yestext="Download"/>
   </notification>
 
+  <notification
+   icon="notifytip.tga"
+   name="DownloadBackground"
+   type="notifytip">
+An updated version of [APP_NAME] has been downloaded.
+It will be applied the next time you restart [APP_NAME]
+  </notification>
+
   <notification
    icon="alertmodal.tga"
    name="DeedObjectToGroup"
-- 
cgit v1.2.3


From f0a0831954475a2f49fe7473046f0ba657fb2405 Mon Sep 17 00:00:00 2001
From: Andrew Productengine <adyukov@productengine.com>
Date: Thu, 18 Nov 2010 23:09:05 +0200
Subject: STORM-560 FIXED Implemented preference that allows users to select
 default behavior when pressing letter keys.

- Added check to LLViewerWindow::handleKey() that gives focus to nearby chat if "Pressing letter keys starts local chat" option is selected, key is not special (and no modifier key is held except Shift), camera is not in mouselook and no view currently has keyboard focus.
- The choice of what should happen when letter keys are pressed is saved in new setting added in this fix- "LetterKeysFocusChatBar".
---
 indra/newview/app_settings/settings.xml                    | 11 +++++++++++
 indra/newview/llviewerwindow.cpp                           | 14 ++++++++++++++
 .../skins/default/xui/en/panel_preferences_general.xml     |  9 +++++----
 3 files changed, 30 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 561456c9d6..51e3b4e7c8 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1365,6 +1365,17 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>LetterKeysFocusChatBar</key>
+    <map>
+      <key>Comment</key>
+      <string>When printable characters keys (possibly with Shift held) are pressed, the chatbar takes focus</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>ChatBubbleOpacity</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 743def4a0c..a7790243ed 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2266,6 +2266,20 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 		return TRUE;
 	}
 
+	// If "Pressing letter keys starts local chat" option is selected, we are not in mouselook, 
+	// no view has keyboard focus, this is a printable character key (and no modifier key is 
+	// pressed except shift), then give focus to nearby chat (STORM-560)
+	if ( gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() && 
+		!keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) )
+	{
+		LLLineEditor* chat_editor = LLBottomTray::instanceExists() ? LLBottomTray::getInstance()->getNearbyChatBar()->getChatBox() : NULL;
+		if (chat_editor)
+		{
+			// passing NULL here, character will be added later when it is handled by character handler.
+			LLBottomTray::getInstance()->getNearbyChatBar()->startChat(NULL);
+			return TRUE;
+		}
+	}
 
 	// give menus a chance to handle unmodified accelerator keys
 	if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask))
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
index a660b5d785..36f8f99178 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
@@ -331,6 +331,7 @@
        Pressing letter keys:
    </text>
    <radio_group
+     control_name="LetterKeysFocusChatBar" 
      height="20"
      layout="topleft"
      left="35"
@@ -338,12 +339,12 @@
      name="inworld_typing_preference">
         <radio_item
          label="Starts local chat"
-         name="radio_button1"
+         name="radio_start_chat"
          top_delta="20" 
          layout="topleft"
          height="16" 
          left="0" 
-         value="0"
+         value="1"
          width="150" />
         <radio_item
          label="Affects movement (i.e. WASD)"
@@ -351,8 +352,8 @@
          layout="topleft"
          top_delta="0" 
          height="16" 
-         name="radio_button2"
-         value="1"
+         name="radio_move"
+         value="0"
          width="75" />
     </radio_group>
     
-- 
cgit v1.2.3


From 7aa12f01171cab4dd69aaa0fd1062f434b9b47d6 Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Thu, 18 Nov 2010 23:24:01 +0200
Subject: STORM-189 FIXED insufficient spacing between controls and truncations
 in IT, NL, PL and PT locales in Build Tools floater.

---
 indra/newview/skins/default/xui/en/floater_tools.xml | 16 ++++++++--------
 indra/newview/skins/default/xui/it/floater_tools.xml |  2 +-
 indra/newview/skins/default/xui/nl/floater_tools.xml | 12 ++++++------
 indra/newview/skins/default/xui/pl/floater_tools.xml |  2 +-
 indra/newview/skins/default/xui/pt/floater_tools.xml |  2 +-
 5 files changed, 17 insertions(+), 17 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index f361cb7f8e..e70e1eb61b 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -160,7 +160,7 @@
      layout="topleft"
      left="10"
       height="70"
-      top="54"
+      top="59"
      name="focus_radio_group">
         <radio_item
          top_pad="6"
@@ -197,7 +197,7 @@
    <radio_group
       left="10"
       height="70"
-      top="54"
+      top="59"
      layout="topleft"
      name="move_radio_group">
         <radio_item
@@ -931,7 +931,7 @@
 			 height="23"
 			 image_overlay="Edit_Wrench"
 			 layout="topleft"
-			 left_pad="3"
+			 left_pad="13"
 			 name="button set group"
 			 tab_stop="false"
 			 tool_tip="Choose a group to share this object's permissions"
@@ -944,7 +944,7 @@
              name="checkbox share with group"
              tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions."
              top_pad="10"
-             left="106"
+             left="100"
              width="87" />
             <button
              follows="top|left"
@@ -953,7 +953,7 @@
              label_selected="Deed"
              layout="topleft"
              name="button deed"
-             left_pad="3"
+             left_pad="19"
              tool_tip="Deeding gives this item away with next owner permissions. Group shared objects can be deeded by a group officer."
              width="80" />
             <text
@@ -974,7 +974,7 @@
              layout="topleft"
              name="clickaction"
              width="148"
-             left_pad="0">
+             left_pad="10">
                 <combo_box.item
                  label="Touch  (default)"
                  name="Touch/grab(default)"
@@ -1009,7 +1009,7 @@
              width="100" />
 <!-- NEW SALE TYPE COMBO BOX -->
       <combo_box
-            left_pad="0"
+            left_pad="10"
             layout="topleft"
             follows="left|top"
             allow_text_entry="false"
@@ -1041,7 +1041,7 @@ even though the user gets a free copy.
         decimal_digits="0"
         increment="1"
         top_pad="8"
-        left="108"
+        left="118"
         control_name="Edit Cost"
         name="Edit Cost"
         label="Price: L$"
diff --git a/indra/newview/skins/default/xui/it/floater_tools.xml b/indra/newview/skins/default/xui/it/floater_tools.xml
index fbe611407e..a8c985cb12 100644
--- a/indra/newview/skins/default/xui/it/floater_tools.xml
+++ b/indra/newview/skins/default/xui/it/floater_tools.xml
@@ -283,7 +283,7 @@
 				<combo_box.item label="Plastica" name="Plastic"/>
 				<combo_box.item label="Gomma" name="Rubber"/>
 			</combo_box>
-			<text name="text cut">
+			<text name="text cut" left_delta="-10" width="170">
 				Riduci una sezione (inizio/fine)
 			</text>
 			<spinner label="I" name="cut begin"/>
diff --git a/indra/newview/skins/default/xui/nl/floater_tools.xml b/indra/newview/skins/default/xui/nl/floater_tools.xml
index d49ffc2f51..4ffe675831 100644
--- a/indra/newview/skins/default/xui/nl/floater_tools.xml
+++ b/indra/newview/skins/default/xui/nl/floater_tools.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="toolbox floater" title="" short_title="BOUWEN" height="587">
+<floater name="toolbox floater" title="" short_title="BOUWEN" height="592">
 	<button label="" label_selected="" name="button focus" tool_tip="Focus"/>
 	<button label="" label_selected="" name="button move" tool_tip="Verplaats"/>
 	<button label="" label_selected="" name="button edit" tool_tip="Bewerk"/>
@@ -81,13 +81,13 @@
 	<text name="Strength:">
 		Sterkte
 	</text>
-	<text name="obj_count" top_pad="15">
+	<text name="obj_count" top_pad="20">
 		Geselecteerde objecten: [COUNT]
 	</text>
 	<text name="prim_count">
 		primitieven: [COUNT]
 	</text>
-	<tab_container name="Object Info Tabs" tab_max_width="62" tab_min_width="30" top="180">
+	<tab_container name="Object Info Tabs" tab_max_width="62" tab_min_width="30" top="185">
 		<panel label="Algemeen" name="General">
 			<text name="Name:">
 				Naam:
@@ -115,19 +115,19 @@
 			<text name="Group Name Proxy">
 				De Lindens
 			</text>
-			<button label="Instellen..." label_selected="Instellen..." name="button set group" left_pad="13"/>
+			<button label="Instellen..." label_selected="Instellen..." name="button set group"/>
 			<text name="Permissions:">
 				Permissies:
 			</text>
 
-			<check_box label="Deel met groep" name="checkbox share with group" tool_tip="Alle leden van de ingestelde groep toestaan om te delen en uw permissies voor dit object te gebruiken. U moet &apos;Overdragen&apos; om rolbeperkingen in te schakelen." left="100"/>
+			<check_box label="Deel met groep" name="checkbox share with group" tool_tip="Alle leden van de ingestelde groep toestaan om te delen en uw permissies voor dit object te gebruiken. U moet &apos;Overdragen&apos; om rolbeperkingen in te schakelen."/>
 			<string name="text deed continued">
 				Overdragen...
 			</string>
 			<string name="text deed">
 				Overdragen
 			</string>
-			<button label="Overdragen..." label_selected="Overdragen..." name="button deed" tool_tip="Groepgedeelde objecten kunnen door een groepofficier worden overgedragen" left_pad="19"/>
+			<button label="Overdragen..." label_selected="Overdragen..." name="button deed" tool_tip="Groepgedeelde objecten kunnen door een groepofficier worden overgedragen"/>
 			<check_box label="Iedereen mag verplaatsen" name="checkbox allow everyone move"/>
 			<check_box label="Iedereen mag kopiëren" name="checkbox allow everyone copy"/>
 			<check_box label="Toon in zoeken" name="search_check" tool_tip="Laat mensen dit object zien in zoekresultaten"/>
diff --git a/indra/newview/skins/default/xui/pl/floater_tools.xml b/indra/newview/skins/default/xui/pl/floater_tools.xml
index 8c77df9248..7c1ced0eae 100644
--- a/indra/newview/skins/default/xui/pl/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pl/floater_tools.xml
@@ -307,7 +307,7 @@
 				<combo_box.item label="Kwadrat" name="Square"/>
 				<combo_box.item label="Trójkąt" name="Triangle"/>
 			</combo_box>
-			<text name="text twist">
+			<text name="text twist" left_delta="-5" width="160">
 				Skręcenie (początek/koniec)
 			</text>
 			<spinner label="P" name="Twist Begin"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_tools.xml b/indra/newview/skins/default/xui/pt/floater_tools.xml
index 2925e286ed..bd5fbf80d1 100644
--- a/indra/newview/skins/default/xui/pt/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pt/floater_tools.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="toolbox floater" short_title="BUILD TOOLS" title="" width="288">
+<floater name="toolbox floater" short_title="BUILD TOOLS" title="">
 	<floater.string name="status_rotate">
 		Arrastar as faixas coloridas para girar o objeto
 	</floater.string>
-- 
cgit v1.2.3


From 3625a0f2362d2285d925052aedc69d27713e416d Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Thu, 18 Nov 2010 13:25:44 -0800
Subject: inform user on failed install--needs proper user dialog ;-)

---
 indra/newview/llappviewer.cpp                        | 16 ++++++++++++++--
 indra/newview/skins/default/xui/en/notifications.xml | 10 ++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 0c6c77566f..93fd75f74b 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2390,8 +2390,20 @@ namespace {
     // do we need a file llupdaterui.cpp or something? -brad
     bool notify_update(LLSD const & evt)
     {
-        LLNotificationsUtil::add("DownloadBackground");
-        // let others also handle this event by default
+		switch (evt["type"].asInteger())
+		{
+			case LLUpdaterService::DOWNLOAD_COMPLETE:
+				LLNotificationsUtil::add("DownloadBackground");
+				break;
+			case LLUpdaterService::INSTALL_ERROR:
+				LLNotificationsUtil::add("FailedUpdateInstall");
+				break;
+			default:
+				llinfos << "unhandled update event " << evt << llendl;
+				break;
+		}
+
+		// let others also handle this event by default
         return false;
     }
 };
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 40d5f75de2..a342db8442 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2869,6 +2869,16 @@ Download to your Applications folder?
      yestext="Download"/>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="FailedUpdateInstall"
+   type="alertmodal">
+Gadzooks, I failed to install the latest update.
+Get thee to the interwebs and install it thyself.
+    <usetemplate
+     name="okbutton"
+     yestext="OK"/>
+  </notification>
   <notification
    icon="notifytip.tga"
    name="DownloadBackground"
-- 
cgit v1.2.3


From cbacbdd883699ea171309a1fda38ce0d2bf76b8c Mon Sep 17 00:00:00 2001
From: eli_linden <eli@lindenlab.com>
Date: Thu, 18 Nov 2010 14:12:50 -0800
Subject: CT-633 WIP FR linguistic

---
 indra/newview/skins/default/xui/fr/menu_inspect_avatar_gear.xml | 2 +-
 indra/newview/skins/default/xui/fr/panel_main_inventory.xml     | 2 +-
 indra/newview/skins/default/xui/fr/strings.xml                  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/fr/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/fr/menu_inspect_avatar_gear.xml
index 8bda133a0b..17254ff325 100644
--- a/indra/newview/skins/default/xui/fr/menu_inspect_avatar_gear.xml
+++ b/indra/newview/skins/default/xui/fr/menu_inspect_avatar_gear.xml
@@ -3,7 +3,7 @@
 	<menu_item_call label="Voir le profil" name="view_profile"/>
 	<menu_item_call label="Devenir amis" name="add_friend"/>
 	<menu_item_call label="IM" name="im"/>
-	<menu_item_call label="Appeler" name="call"/>
+	<menu_item_call label="Appel" name="call"/>
 	<menu_item_call label="Téléporter" name="teleport"/>
 	<menu_item_call label="Inviter dans le groupe" name="invite_to_group"/>
 	<menu_item_call label="Ignorer" name="block"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_main_inventory.xml b/indra/newview/skins/default/xui/fr/panel_main_inventory.xml
index e4c35d60fe..3e7225d8ac 100644
--- a/indra/newview/skins/default/xui/fr/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/panel_main_inventory.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <panel label="Choses" name="main inventory panel">
 	<panel.string name="ItemcountFetching">
-		Récupération de [ITEM_COUNT] articles... [FILTER]
+		Récupération : [ITEM_COUNT] articles... [FILTER]
 	</panel.string>
 	<panel.string name="ItemcountCompleted">
 		[ITEM_COUNT] articles [FILTER]
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index d6c701dc90..8b958119eb 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -1089,7 +1089,7 @@
 	<string name="Textures" value=" Textures,"/>
 	<string name="Snapshots" value=" Photos,"/>
 	<string name="No Filters" value="Non "/>
-	<string name="Since Logoff" value=" - Depuis la déconnexion"/>
+	<string name="Since Logoff" value=" depuis la déconnexion"/>
 	<string name="InvFolder My Inventory">
 		Mon inventaire
 	</string>
-- 
cgit v1.2.3


From 0e52564f0a36365c2ce5f5263d15778394741fde Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Thu, 18 Nov 2010 15:11:42 -0800
Subject: Fix for mac build error.

---
 indra/newview/llappviewer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 0c6c77566f..548bebcfa9 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2422,7 +2422,7 @@ void LLAppViewer::initUpdater()
 	}
 
     LLEventPump & updater_pump = LLEventPumps::instance().obtain(LLUpdaterService::pumpName());
-    updater_pump.listen("notify_update", notify_update);
+    updater_pump.listen("notify_update", &notify_update);
 }
 
 void LLAppViewer::checkForCrash(void)
-- 
cgit v1.2.3


From 3eb3198248395922a1dfe277399e1a3cd235f952 Mon Sep 17 00:00:00 2001
From: Wolfpup Lowenhar <wolfpup67@earthlink.net>
Date: Thu, 18 Nov 2010 18:30:00 -0500
Subject: STORM-654 : Person to Person chat logs are not created if Display
 Names are off Modified code in indicated changeset to correct problem after
 consulting with  Leyla Linden who sugested the orginal change. This fix will
 convert the Legacy  name to a user name id not useing Display Names.

---
 indra/newview/llimview.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index cc48226052..3578c98622 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -537,7 +537,15 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline()
 
 void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name)
 {
-	mHistoryFileName = av_name.mUsername;
+	if (av_name.mUsername.empty())
+	{
+		// display names is off, use mDisplayName which will be the legacy name
+		mHistoryFileName = LLCacheName::buildUsername(av_name.mDisplayName);
+	}
+	else
+	{  
+		mHistoryFileName = av_name.mUsername;
+	}
 }
 
 void LLIMModel::LLIMSession::buildHistoryFileName()
-- 
cgit v1.2.3


From c893c55d8a1328a134c956b70e6fef7fd7053d47 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Thu, 18 Nov 2010 17:03:01 -0800
Subject: Fixing bugs discovered in merge with viewer development

---
 indra/newview/llspeakbutton.cpp              | 7 +++++--
 indra/newview/llspeakingindicatormanager.cpp | 5 ++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp
index 3dce66f394..c76ecae4a2 100644
--- a/indra/newview/llspeakbutton.cpp
+++ b/indra/newview/llspeakbutton.cpp
@@ -134,8 +134,11 @@ LLSpeakButton::LLSpeakButton(const Params& p)
 
 LLSpeakButton::~LLSpeakButton()
 {
-	LLTransientFloaterMgr::getInstance()->removeControlView(mSpeakBtn);
-	LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn);
+	if(LLTransientFloaterMgr::instanceExists())
+	{
+		LLTransientFloaterMgr::getInstance()->removeControlView(mSpeakBtn);
+		LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn);
+	}
 }
 
 void LLSpeakButton::setSpeakToolTip(const std::string& msg)
diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp
index ede1d6bebe..9b38bf22ff 100644
--- a/indra/newview/llspeakingindicatormanager.cpp
+++ b/indra/newview/llspeakingindicatormanager.cpp
@@ -308,7 +308,10 @@ void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker
 
 void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator)
 {
-	SpeakingIndicatorManager::instance().unregisterSpeakingIndicator(speaker_id, speaking_indicator);
+	if(SpeakingIndicatorManager::instanceExists())
+	{
+		SpeakingIndicatorManager::instance().unregisterSpeakingIndicator(speaker_id, speaking_indicator);
+	}
 }
 
 // EOF
-- 
cgit v1.2.3


From 8c2026d6b71f133deafa6b0e19baf69632a2510a Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Thu, 18 Nov 2010 21:57:27 -0800
Subject: CHOP-135 Bug fixes.

---
 indra/newview/llappviewer.cpp           | 3 ++-
 indra/newview/llchiclet.cpp             | 8 +++++---
 indra/newview/lltransientfloatermgr.cpp | 5 ++++-
 3 files changed, 11 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1fd8b02530..b6f52e3e15 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2433,7 +2433,8 @@ void LLAppViewer::initUpdater()
  	mUpdater->setCheckPeriod(check_period);
 	if(gSavedSettings.getBOOL("UpdaterServiceActive"))
 	{
-		mUpdater->startChecking();
+		bool install_if_ready = true;
+		mUpdater->startChecking(install_if_ready);
 	}
 
     LLEventPump & updater_pump = LLEventPumps::instance().obtain(LLUpdaterService::pumpName());
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 8f385160e9..885d553524 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -1092,9 +1092,11 @@ LLChicletPanel::LLChicletPanel(const Params&p)
 
 LLChicletPanel::~LLChicletPanel()
 {
-	LLTransientFloaterMgr::getInstance()->removeControlView(mLeftScrollButton);
-	LLTransientFloaterMgr::getInstance()->removeControlView(mRightScrollButton);
-
+	if(LLTransientFloaterMgr::instanceExists())
+	{
+		LLTransientFloaterMgr::getInstance()->removeControlView(mLeftScrollButton);
+		LLTransientFloaterMgr::getInstance()->removeControlView(mRightScrollButton);
+	}
 }
 
 void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){
diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp
index 78dd602f39..6deab96b45 100644
--- a/indra/newview/lltransientfloatermgr.cpp
+++ b/indra/newview/lltransientfloatermgr.cpp
@@ -36,8 +36,11 @@
 
 LLTransientFloaterMgr::LLTransientFloaterMgr()
 {
-	gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(
+	if(gViewerWindow)
+	{
+		gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(
 			&LLTransientFloaterMgr::leftMouseClickCallback, this, _1, _2, _3));
+	}
 
 	mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(GLOBAL, std::set<LLView*>()));
 	mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(DOCKED, std::set<LLView*>()));
-- 
cgit v1.2.3


From edd1db29563555e4bdc38ffded4f499d65058c3a Mon Sep 17 00:00:00 2001
From: Andrew Productengine <adyukov@productengine.com>
Date: Fri, 19 Nov 2010 14:41:01 +0200
Subject: STORM-572 ADDITIONAL_FIX Fixed overlappings in Sound & Media tab of
 Preferences.

Changed xml to fix overlappings in Spanish locale and make panel closer to spec.
---
 .../default/xui/en/panel_preferences_sound.xml     | 55 +++++++++++-----------
 1 file changed, 28 insertions(+), 27 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
index 8ade41f587..da366f30ae 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml
@@ -70,7 +70,7 @@
 		name="UI Volume"
 		show_text="false"
 		slider_label.halign="right"
-		top_pad="5"
+		top_pad="4"
 		volume="true"
 		width="300">
 	  <slider.commit_callback
@@ -104,7 +104,7 @@
      name="Wind Volume"
      show_text="false"
      slider_label.halign="right"
-     top_pad="5"
+     top_pad="4"
      volume="true"
      width="300">
         <slider.commit_callback
@@ -138,7 +138,7 @@
      left="0"
      name="SFX Volume"
      show_text="false"
-     top_pad="7"
+     top_pad="4"
      volume="true"
      width="300">
         <slider.commit_callback
@@ -172,7 +172,7 @@
      name="Music Volume"
      slider_label.halign="right"
      show_text="false"
-     top_pad="5"
+     top_pad="4"
      volume="true"
      width="300">
         <slider.commit_callback
@@ -215,7 +215,7 @@
 		name="Media Volume"
 		show_text="false"
 		slider_label.halign="right"
-		top_pad="5"
+		top_pad="4"
 		volume="true"
 		width="300">
 	  <slider.commit_callback
@@ -257,7 +257,7 @@
 		label_width="120"
 		layout="topleft"
 		left="0"
-		top_pad="5"
+		top_pad="4"
 		name="Voice Volume"
 		show_text="false"
 		slider_label.halign="right"
@@ -301,9 +301,9 @@
 		height="15"
 		tool_tip="Check this to let media auto-play if it wants"
 		label="Allow Media to auto-play"
-		top_pad="5"
+		top_pad="1"
 		left="25"/>
-	<check_box
+ 	<check_box
 		name="media_show_on_others_btn"
 		control_name="MediaShowOnOthers"
 		value="true"
@@ -313,16 +313,6 @@
 		label="Play media attached to other avatars"
 		left="25"
     width="230"/>
-  <check_box
-     control_name="LipSyncEnabled"
-     follows="left|top"
-     height="20"
-     label="Move avatar lips when speaking"
-     layout="topleft"
-     left_pad="0"
-     name="enable_lip_sync"
-     width="237"
-     top_delta="-4" />
 
     <text
      type="string"
@@ -333,7 +323,7 @@
      left="25"
      name="voice_chat_settings"
      width="180"
-     top_pad="10">
+     top_pad="7">
 	  Voice Chat Settings
     </text>
     <text
@@ -341,10 +331,10 @@
      length="1"
      follows="left|top"
      layout="topleft"
-	   left="80"
+	   left="46"
 	   top_delta="16"
      name="Listen from"
-     width="102">
+     width="112">
         Listen from:
     </text>
 	<icon
@@ -363,7 +353,7 @@
 		height="18"
 		image_name="Move_Walk_Off"
 		layout="topleft"
-    left_pad="130" 
+    left_pad="170" 
 		name="avatar_icon"
 		mouse_opaque="false"
 		visible="true"
@@ -375,7 +365,7 @@
      draw_border="false"
      follows="left|top"
      layout="topleft"
-     left_delta="-128"
+     left_delta="-168"
      width="221"
      height="20"
      name="ear_location">
@@ -391,11 +381,21 @@
      follows="left|top"
      label="Avatar position"
      layout="topleft"
-     left_pad="-54"
+     left_pad="-16"
      name="1"
      top_delta ="0" 
      width="200" />
    </radio_group>
+  <check_box
+   control_name="LipSyncEnabled"
+   follows="left|top"
+   height="15"
+   label="Move avatar lips when speaking"
+   layout="topleft"
+   left="44"
+   name="enable_lip_sync"
+   top_pad="5" 
+   width="237"/>
  <check_box
   follows="top|left"
   enabled_control="EnableVoiceChat"
@@ -403,10 +403,11 @@
   height="15"
   label="Toggle speak on/off when I press:"
   layout="topleft"
-  left="30"
+  left="44"
   name="push_to_talk_toggle_check"
   width="237"
-  tool_tip="When in toggle mode, press and release the trigger key ONCE to switch your microphone on or off. When not in toggle mode, the microphone broadcasts your voice only while the trigger is being held down."/>
+  tool_tip="When in toggle mode, press and release the trigger key ONCE to switch your microphone on or off. When not in toggle mode, the microphone broadcasts your voice only while the trigger is being held down."
+  top_pad="3"/>
   <line_editor
    follows="top|left"
    control_name="PushToTalkButton"
@@ -454,7 +455,7 @@
    label="Input/Output devices"
    layout="topleft"
    left="20"
-   top_pad="8"
+   top_pad="6"
    name="device_settings_btn"
    width="190">
   </button>
-- 
cgit v1.2.3


From c68d6c794c8f6654ad83bf56977886c8d30c599f Mon Sep 17 00:00:00 2001
From: Seth ProductEngine <slitovchuk@productengine.com>
Date: Fri, 19 Nov 2010 16:50:10 +0200
Subject: STORM-584 FIXED color setting to apply to bubble chat text.

---
 indra/newview/llhudnametag.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index fc758569e4..c099a3964b 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -87,7 +87,6 @@ LLHUDNameTag::LLHUDNameTag(const U8 type)
 	mZCompare(TRUE),
 	mVisibleOffScreen(FALSE),
 	mOffscreen(FALSE),
-	mColor(1.f, 1.f, 1.f, 1.f),
 //	mScale(),
 	mWidth(0.f),
 	mHeight(0.f),
@@ -109,6 +108,8 @@ LLHUDNameTag::LLHUDNameTag(const U8 type)
 {
 	LLPointer<LLHUDNameTag> ptr(this);
 	sTextObjects.insert(ptr);
+
+	mColor = LLUIColorTable::instance().getColor("BackgroundChatColor");
 }
 
 LLHUDNameTag::~LLHUDNameTag()
@@ -256,6 +257,7 @@ void LLHUDNameTag::renderText(BOOL for_select)
 	
 	LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f);
 	F32 alpha_factor = 1.f;
+	mColor = LLUIColorTable::instance().getColor("BackgroundChatColor");
 	LLColor4 text_color = mColor;
 	if (mDoFade)
 	{
@@ -521,7 +523,6 @@ void LLHUDNameTag::renderText(BOOL for_select)
 				x_offset += 1;
 			}
 
-			text_color = segment_iter->mColor;
 			text_color.mV[VALPHA] *= alpha_factor;
 
 			hud_render_text(segment_iter->getText(), render_position, *fontp, style, shadow, x_offset, y_offset, text_color, FALSE);
-- 
cgit v1.2.3


From 8d21105a8c2b6bff98b4f3b91a614a4710d4b7ea Mon Sep 17 00:00:00 2001
From: "Andrew A. de Laix" <alain@lindenlab.com>
Date: Fri, 19 Nov 2010 12:04:01 -0800
Subject: dull boring notification message.

---
 indra/newview/skins/default/xui/en/notifications.xml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 0663583543..9536bf2cf7 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2873,8 +2873,9 @@ Download to your Applications folder?
    icon="alertmodal.tga"
    name="FailedUpdateInstall"
    type="alertmodal">
-Gadzooks, I failed to install the latest update.
-Get thee to the interwebs and install it thyself.
+An error occurred installing the viewer update.
+Please download and install the latest viewer from
+http://secondlife.com/download.
     <usetemplate
      name="okbutton"
      yestext="OK"/>
-- 
cgit v1.2.3


From daae74e569c0f0bc4ea822ac4127c1d8c21aa91f Mon Sep 17 00:00:00 2001
From: Jonathan Yap <none@none>
Date: Fri, 19 Nov 2010 15:35:24 -0500
Subject: Changed Sit Down shortcut definition and reordered menu slightly.

---
 indra/newview/llviewermenu.cpp                     |  6 +++---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 2874a6ec79..8d060fdbc8 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7805,6 +7805,9 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLViewCheckRenderType(), "View.CheckRenderType");
 	view_listener_t::addMenu(new LLViewCheckHUDAttachments(), "View.CheckHUDAttachments");
 
+	// Me > Movement
+	view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
+	
 	// World menu
 	commit.add("World.Chat", boost::bind(&handle_chat, (void*)NULL));
 	view_listener_t::addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun");
@@ -7878,9 +7881,6 @@ void initialize_menus()
 
 	// Advanced Other Settings	
 	view_listener_t::addMenu(new LLAdvancedClearGroupCache(), "Advanced.ClearGroupCache");
-
-	// Advanced > Shortcuts
-	view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
 	
 	// Advanced > Render > Types
 	view_listener_t::addMenu(new LLAdvancedToggleRenderType(), "Advanced.ToggleRenderType");
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index e4cee1f774..9273ef217b 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -102,7 +102,7 @@
             <menu_item_call
              label="Sit Down"
              layout="topleft"
-		     shortcut="control|alt|S"
+		     shortcut="alt|shift|S"
              name="Sit Down Here">
                 <menu_item_call.on_click
                  function="Self.SitDown"
@@ -110,15 +110,6 @@
                 <menu_item_call.on_enable
                  function="Self.EnableSitDown" />
             </menu_item_call>
-            <menu_item_check
-             label="Always Run"
-             name="Always Run"
-             shortcut="control|R">
-                <menu_item_check.on_check
-                 function="World.CheckAlwaysRun" />
-                <menu_item_check.on_click
-                 function="World.AlwaysRun" />
-            </menu_item_check>
             <menu_item_check
              label="Fly"
              name="Fly"
@@ -130,6 +121,15 @@
                 <menu_item_check.on_enable
                  function="Agent.enableFlying" />
             </menu_item_check>
+            <menu_item_check
+             label="Always Run"
+             name="Always Run"
+             shortcut="control|R">
+                <menu_item_check.on_check
+                 function="World.CheckAlwaysRun" />
+                <menu_item_check.on_click
+                 function="World.AlwaysRun" />
+            </menu_item_check>
             <menu_item_call
              label="Stop Animating Me"
              name="Stop Animating My Avatar">
-- 
cgit v1.2.3


From a062c73ff418ee57e393effb09f494818bc63d6c Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Fri, 19 Nov 2010 15:54:03 -0800
Subject: Fix for windows installer missing update_install.bat.  Paired with
 mani.

---
 indra/newview/viewer_manifest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 4e5d6271df..54bf3a5918 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -247,7 +247,7 @@ class WindowsManifest(ViewerManifest):
         
         self.disable_manifest_check()
 
-        self.path("../viewer_components/updater/scripts/windows/update_install.bat")
+        self.path(src="../viewer_components/updater/scripts/windows/update_install.bat", dst="")
 
         # Get shared libs from the shared libs staging directory
         if self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']),
-- 
cgit v1.2.3