From 816cf7db82f2e633631c334f44547714de6cbebc Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Thu, 29 Jul 2010 19:49:13 -0700 Subject: Adding a simple region debug console. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloaterregiondebugconsole.cpp | 93 ++++++++++++++++++++++ indra/newview/llfloaterregiondebugconsole.h | 55 +++++++++++++ indra/newview/llviewerfloaterreg.cpp | 2 + indra/newview/llviewermenu.cpp | 2 +- indra/newview/llviewerregion.cpp | 1 + .../xui/en/floater_region_debug_console.xml | 37 +++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 12 +++ 8 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 indra/newview/llfloaterregiondebugconsole.cpp create mode 100644 indra/newview/llfloaterregiondebugconsole.h create mode 100644 indra/newview/skins/default/xui/en/floater_region_debug_console.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 92f701551b..53941af355 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -197,6 +197,7 @@ set(viewer_SOURCE_FILES llfloaterpostprocess.cpp llfloaterpreference.cpp llfloaterproperties.cpp + llfloaterregiondebugconsole.cpp llfloaterregioninfo.cpp llfloaterreporter.cpp llfloaterscriptdebug.cpp @@ -723,6 +724,7 @@ set(viewer_HEADER_FILES llfloaterpostprocess.h llfloaterpreference.h llfloaterproperties.h + llfloaterregiondebugconsole.h llfloaterregioninfo.h llfloaterreporter.h llfloaterscriptdebug.h diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp new file mode 100644 index 0000000000..058f894800 --- /dev/null +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -0,0 +1,93 @@ +/** + * @file llfloaterregiondebugconsole.h + * @author Brad Kittenbrink + * @brief Quick and dirty console for region debug settings + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010-2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterregiondebugconsole.h" + +#include "llagent.h" +#include "llhttpclient.h" +#include "lllineeditor.h" +#include "lltexteditor.h" +#include "llviewerregion.h" + +class Responder : public LLHTTPClient::Responder { +public: + Responder(LLTextEditor *output) : mOutput(output) + { + } + + /*virtual*/ + void error(U32 status, const std::string& reason) + { + } + + /*virtual*/ + void result(const LLSD& content) + { + std::string text = mOutput->getText(); + text += '\n'; + text += content.asString(); + text += '\n'; + mOutput->setText(text); + }; + + LLTextEditor * mOutput; +}; + +LLFloaterRegionDebugConsole::LLFloaterRegionDebugConsole(LLSD const & key) +: LLFloater(key), mOutput(NULL) +{ +} + +BOOL LLFloaterRegionDebugConsole::postBuild() +{ + getChild("region_debug_console_input")->setCommitCallback(boost::bind(&LLFloaterRegionDebugConsole::onInput, this, _1, _2)); + mOutput = getChild("region_debug_console_output"); + return TRUE; +} + +void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param) +{ + LLLineEditor * input = static_cast(ctrl); + std::string text = mOutput->getText(); + text += "\n\POST: "; + text += input->getText(); + mOutput->setText(text); + + std::string url = gAgent.getRegion()->getCapability("SimConsole"); + LLHTTPClient::post(url, LLSD(input->getText()), new ::Responder(mOutput)); + + input->setText(std::string("")); +} + diff --git a/indra/newview/llfloaterregiondebugconsole.h b/indra/newview/llfloaterregiondebugconsole.h new file mode 100644 index 0000000000..69d7773fec --- /dev/null +++ b/indra/newview/llfloaterregiondebugconsole.h @@ -0,0 +1,55 @@ +/** + * @file llfloaterregiondebugconsole.h + * @author Brad Kittenbrink + * @brief Quick and dirty console for region debug settings + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010-2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERREGIONDEBUGCONSOLE_H +#define LL_LLFLOATERREGIONDEBUGCONSOLE_H + +#include "llfloater.h" +#include "llhttpclient.h" + +class LLTextEditor; + +class LLFloaterRegionDebugConsole : public LLFloater, public LLHTTPClient::Responder +{ +public: + LLFloaterRegionDebugConsole(LLSD const & key); + + // virtual + BOOL postBuild(); + + void onInput(LLUICtrl* ctrl, const LLSD& param); + + LLTextEditor * mOutput; +}; + +#endif // LL_LLFLOATERREGIONDEBUGCONSOLE_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index efe59744bc..9e256864d2 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -87,6 +87,7 @@ #include "llfloaterpostprocess.h" #include "llfloaterpreference.h" #include "llfloaterproperties.h" +#include "llfloaterregiondebugconsole.h" #include "llfloaterregioninfo.h" #include "llfloaterreporter.h" #include "llfloaterscriptdebug.h" @@ -236,6 +237,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("reporter", "floater_report_abuse.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("reset_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("region_debug_console", "floater_region_debug_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("region_info", "floater_region_info.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 635cc361f3..0822295ba1 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -558,7 +558,7 @@ class LLAdvancedCheckConsole : public view_listener_t new_value = get_visibility( (void*)gDebugView->mMemoryView ); } #endif - + return new_value; } }; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index da240cedbb..93666ee5f2 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1517,6 +1517,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("SendUserReport"); capabilityNames.append("SendUserReportWithScreenshot"); capabilityNames.append("ServerReleaseNotes"); + capabilityNames.append("SimConsole"); capabilityNames.append("StartGroupProposal"); capabilityNames.append("TextureStats"); capabilityNames.append("UntrustedSimulatorMessage"); diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml new file mode 100644 index 0000000000..591d77340a --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml @@ -0,0 +1,37 @@ + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 3557318705..8a3785d7c1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2542,6 +2542,18 @@ function="ToggleControl" parameter="DoubleClickAutoPilot" /> + + + + Date: Tue, 24 Aug 2010 09:41:35 -0700 Subject: fix for sim console not staying scrolled to bottom --- indra/newview/llfloaterregiondebugconsole.cpp | 13 +++++-------- .../skins/default/xui/en/floater_region_debug_console.xml | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index 058f894800..8885fa0cb1 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -55,11 +55,9 @@ public: /*virtual*/ void result(const LLSD& content) { - std::string text = mOutput->getText(); + std::string text = content.asString(); text += '\n'; - text += content.asString(); - text += '\n'; - mOutput->setText(text); + mOutput->appendText(text, true); }; LLTextEditor * mOutput; @@ -80,14 +78,13 @@ BOOL LLFloaterRegionDebugConsole::postBuild() void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param) { LLLineEditor * input = static_cast(ctrl); - std::string text = mOutput->getText(); - text += "\n\POST: "; + std::string text = "\\POST: "; text += input->getText(); - mOutput->setText(text); + mOutput->appendText(text, true); std::string url = gAgent.getRegion()->getCapability("SimConsole"); LLHTTPClient::post(url, LLSD(input->getText()), new ::Responder(mOutput)); - input->setText(std::string("")); + input->clear(); } diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml index 591d77340a..976fa35d3c 100644 --- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml +++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml @@ -9,6 +9,7 @@ width="600"> -- cgit v1.2.3 From 4b9abaaab9448df7e0773cdbaf1a5202a1f9e6c7 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Thu, 26 Aug 2010 17:09:15 -0700 Subject: Cleaned up the debug console a bit. Gave it a command history and proper scrolling to the bottom of the returned data. --- indra/newview/llfloaterregiondebugconsole.cpp | 48 ++++++++++++++++------ .../xui/en/floater_region_debug_console.xml | 10 +++-- 2 files changed, 42 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index 058f894800..159dee7631 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -55,11 +55,8 @@ public: /*virtual*/ void result(const LLSD& content) { - std::string text = mOutput->getText(); - text += '\n'; - text += content.asString(); - text += '\n'; - mOutput->setText(text); + std::string text = content.asString() + "\n\n> "; + mOutput->appendText(text, false); }; LLTextEditor * mOutput; @@ -72,22 +69,47 @@ LLFloaterRegionDebugConsole::LLFloaterRegionDebugConsole(LLSD const & key) BOOL LLFloaterRegionDebugConsole::postBuild() { - getChild("region_debug_console_input")->setCommitCallback(boost::bind(&LLFloaterRegionDebugConsole::onInput, this, _1, _2)); + LLLineEditor* input = getChild("region_debug_console_input"); + input->setEnableLineHistory(true); + input->setCommitCallback(boost::bind(&LLFloaterRegionDebugConsole::onInput, this, _1, _2)); + input->setFocus(true); + input->setCommitOnFocusLost(false); + mOutput = getChild("region_debug_console_output"); + + std::string url = gAgent.getRegion()->getCapability("SimConsole"); + if ( url.size() == 0 ) + { + mOutput->appendText("This region does not support the simulator console.\n\n> ", false); + } + else + { + mOutput->appendText("> ", false); + } + + return TRUE; } void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param) { - LLLineEditor * input = static_cast(ctrl); - std::string text = mOutput->getText(); - text += "\n\POST: "; - text += input->getText(); - mOutput->setText(text); + LLLineEditor* input = static_cast(ctrl); + std::string text = input->getText() + "\n"; + std::string url = gAgent.getRegion()->getCapability("SimConsole"); - LLHTTPClient::post(url, LLSD(input->getText()), new ::Responder(mOutput)); - input->setText(std::string("")); + if ( url.size() > 0 ) + { + LLHTTPClient::post(url, LLSD(input->getText()), new ::Responder(mOutput)); + } + else + { + text += "\nError: No console available for this region/simulator.\n\n> "; + } + + mOutput->appendText(text, false); + + input->clear(); } diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml index 591d77340a..cf95257b0a 100644 --- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml +++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml @@ -6,7 +6,8 @@ min_height="300" min_width="300" height="400" - width="600"> + width="600" + default_tab_group="1"> + word_wrap="true" + track_end="true" + read_only="true"> + width="576" /> -- cgit v1.2.3 From 301112ac7a89266d7378a413f15200ea1bb44d9e Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Thu, 26 Aug 2010 17:14:22 -0700 Subject: Fixed bad merge. --- indra/newview/skins/default/xui/en/floater_region_debug_console.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml index b3bf28e285..bdb890f882 100644 --- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml +++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml @@ -10,7 +10,6 @@ default_tab_group="1"> Date: Thu, 26 Aug 2010 17:29:33 -0700 Subject: Removed duplicate item in floater_region_Debug_console.xml --- indra/newview/skins/default/xui/en/floater_region_debug_console.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml index bdb890f882..cf95257b0a 100644 --- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml +++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml @@ -19,7 +19,6 @@ ignore_tab="false" layout="topleft" max_length="65536" - track_end="true" name="region_debug_console_output" show_line_numbers="false" word_wrap="true" -- cgit v1.2.3 From 39e5d2ecf04deceda92d6a53413298ca1c3bc0c7 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 8 Sep 2010 23:03:56 -0700 Subject: VWR-22761 : Rearchitecture of llmetricperformancetester and simple (non complete) implementation in llimagej2c --- indra/newview/CMakeLists.txt | 2 - indra/newview/llappviewer.cpp | 7 +- indra/newview/llfasttimerview.cpp | 30 +++- indra/newview/llfasttimerview.h | 1 + indra/newview/llmetricperformancetester.cpp | 252 ---------------------------- indra/newview/llmetricperformancetester.h | 153 ----------------- indra/newview/llviewertexture.cpp | 83 +++++---- indra/newview/llviewertexture.h | 6 +- 8 files changed, 75 insertions(+), 459 deletions(-) delete mode 100644 indra/newview/llmetricperformancetester.cpp delete mode 100644 indra/newview/llmetricperformancetester.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 630902c48f..546f8268d0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -284,7 +284,6 @@ set(viewer_SOURCE_FILES llmediadataclient.cpp llmemoryview.cpp llmenucommands.cpp - llmetricperformancetester.cpp llmimetypes.cpp llmorphview.cpp llmoveview.cpp @@ -808,7 +807,6 @@ set(viewer_HEADER_FILES llmediadataclient.h llmemoryview.h llmenucommands.h - llmetricperformancetester.h llmimetypes.h llmorphview.h llmoveview.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bfe3e52657..d383c9adbc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -536,6 +536,7 @@ public: os.close(); } + }; //virtual @@ -1279,7 +1280,7 @@ bool LLAppViewer::cleanup() { // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); - + // remove any old breakpad minidump files from the log directory if (! isError()) { @@ -1630,7 +1631,7 @@ bool LLAppViewer::cleanup() gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric_report.csv")); } } - LLMetricPerformanceTester::cleanClass() ; + LLMetricPerformanceTesterBasic::cleanClass() ; llinfos << "Cleaning up Media and Textures" << llendflush; @@ -2124,7 +2125,7 @@ bool LLAppViewer::initConfiguration() { LLFastTimerView::sAnalyzePerformance = TRUE; } - + if (clp.hasOption("replaysession")) { LLAgentPilot::sReplaySession = TRUE; diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index b715647143..07ff3a91a1 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1144,15 +1144,15 @@ LLSD LLFastTimerView::analyzeMetricPerformanceLog(std::istream& is) { std::string label = iter->first; - LLMetricPerformanceTester* tester = LLMetricPerformanceTester::getTester(iter->second["Name"].asString()) ; + LLMetricPerformanceTesterBasic* tester = LLMetricPerformanceTesterBasic::getTester(iter->second["Name"].asString()) ; if(tester) { ret[label]["Name"] = iter->second["Name"] ; - S32 num_of_strings = tester->getNumOfMetricStrings() ; - for(S32 index = 0 ; index < num_of_strings ; index++) + S32 num_of_metrics = tester->getNumberOfMetrics() ; + for(S32 index = 0 ; index < num_of_metrics ; index++) { - ret[label][ tester->getMetricString(index) ] = iter->second[ tester->getMetricString(index) ] ; + ret[label][ tester->getMetricName(index) ] = iter->second[ tester->getMetricName(index) ] ; } } } @@ -1161,10 +1161,24 @@ LLSD LLFastTimerView::analyzeMetricPerformanceLog(std::istream& is) return ret; } +//static +void LLFastTimerView::outputAllMetrics() +{ + if (LLMetricPerformanceTesterBasic::hasMetricPerformanceTesters()) + { + for (LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin(); + iter != LLMetricPerformanceTesterBasic::sTesterMap.end(); ++iter) + { + LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)iter->second); + tester->outputTestResults(); + } + } +} + //static void LLFastTimerView::doAnalysisMetrics(std::string baseline, std::string target, std::string output) { - if(!LLMetricPerformanceTester::hasMetricPerformanceTesters()) + if(!LLMetricPerformanceTesterBasic::hasMetricPerformanceTesters()) { return ; } @@ -1183,10 +1197,10 @@ void LLFastTimerView::doAnalysisMetrics(std::string baseline, std::string target std::ofstream os(output.c_str()); os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; - for(LLMetricPerformanceTester::name_tester_map_t::iterator iter = LLMetricPerformanceTester::sTesterMap.begin() ; - iter != LLMetricPerformanceTester::sTesterMap.end() ; ++iter) + for(LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin() ; + iter != LLMetricPerformanceTesterBasic::sTesterMap.end() ; ++iter) { - LLMetricPerformanceTester* tester = ((LLMetricPerformanceTester*)iter->second) ; + LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)iter->second) ; tester->analyzePerformance(&os, &base, ¤t) ; } diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 961d03abf1..54025267ee 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -37,6 +37,7 @@ public: static BOOL sAnalyzePerformance; + static void outputAllMetrics(); static void doAnalysis(std::string baseline, std::string target, std::string output); private: diff --git a/indra/newview/llmetricperformancetester.cpp b/indra/newview/llmetricperformancetester.cpp deleted file mode 100644 index 903c97378e..0000000000 --- a/indra/newview/llmetricperformancetester.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/** - * @file llmetricperformancetester.cpp - * @brief LLMetricPerformanceTester class implementation - * - * $LicenseInfo:firstyear=2004&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 "indra_constants.h" -#include "llerror.h" -#include "llmath.h" -#include "llfontgl.h" -#include "llsdserialize.h" -#include "llstat.h" -#include "lltreeiterators.h" -#include "llmetricperformancetester.h" - -LLMetricPerformanceTester::name_tester_map_t LLMetricPerformanceTester::sTesterMap ; - -//static -void LLMetricPerformanceTester::initClass() -{ -} -//static -void LLMetricPerformanceTester::cleanClass() -{ - for(name_tester_map_t::iterator iter = sTesterMap.begin() ; iter != sTesterMap.end() ; ++iter) - { - delete iter->second ; - } - sTesterMap.clear() ; -} - -//static -void LLMetricPerformanceTester::addTester(LLMetricPerformanceTester* tester) -{ - if(!tester) - { - llerrs << "invalid tester!" << llendl ; - return ; - } - - std::string name = tester->getName() ; - if(getTester(name)) - { - llerrs << "Tester name is used by some other tester: " << name << llendl ; - return ; - } - - sTesterMap.insert(std::make_pair(name, tester)); - - return ; -} - -//static -LLMetricPerformanceTester* LLMetricPerformanceTester::getTester(std::string label) -{ - name_tester_map_t::iterator found_it = sTesterMap.find(label) ; - if(found_it != sTesterMap.end()) - { - return found_it->second ; - } - - return NULL ; -} - -LLMetricPerformanceTester::LLMetricPerformanceTester(std::string name, BOOL use_default_performance_analysis) - : mName(name), - mBaseSessionp(NULL), - mCurrentSessionp(NULL), - mCount(0), - mUseDefaultPerformanceAnalysis(use_default_performance_analysis) -{ - if(mName == std::string()) - { - llerrs << "invalid name." << llendl ; - } - - LLMetricPerformanceTester::addTester(this) ; -} - -/*virtual*/ -LLMetricPerformanceTester::~LLMetricPerformanceTester() -{ - if(mBaseSessionp) - { - delete mBaseSessionp ; - mBaseSessionp = NULL ; - } - if(mCurrentSessionp) - { - delete mCurrentSessionp ; - mCurrentSessionp = NULL ; - } -} - -void LLMetricPerformanceTester::incLabel() -{ - mCurLabel = llformat("%s-%d", mName.c_str(), mCount++) ; -} -void LLMetricPerformanceTester::preOutputTestResults(LLSD* sd) -{ - incLabel() ; - (*sd)[mCurLabel]["Name"] = mName ; -} -void LLMetricPerformanceTester::postOutputTestResults(LLSD* sd) -{ - LLMutexLock lock(LLFastTimer::sLogLock); - LLFastTimer::sLogQueue.push((*sd)); -} - -void LLMetricPerformanceTester::outputTestResults() -{ - LLSD sd ; - preOutputTestResults(&sd) ; - - outputTestRecord(&sd) ; - - postOutputTestResults(&sd) ; -} - -void LLMetricPerformanceTester::addMetricString(std::string str) -{ - mMetricStrings.push_back(str) ; -} - -const std::string& LLMetricPerformanceTester::getMetricString(U32 index) const -{ - return mMetricStrings[index] ; -} - -void LLMetricPerformanceTester::prePerformanceAnalysis() -{ - mCount = 0 ; - incLabel() ; -} - -// -//default analyzing the performance -// -/*virtual*/ -void LLMetricPerformanceTester::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) -{ - if(mUseDefaultPerformanceAnalysis)//use default performance analysis - { - prePerformanceAnalysis() ; - - BOOL in_base = (*base).has(mCurLabel) ; - BOOL in_current = (*current).has(mCurLabel) ; - - while(in_base || in_current) - { - LLSD::String label = mCurLabel ; - - if(in_base && in_current) - { - *os << llformat("%s\n", label.c_str()) ; - - for(U32 index = 0 ; index < mMetricStrings.size() ; index++) - { - switch((*current)[label][ mMetricStrings[index] ].type()) - { - case LLSD::TypeInteger: - compareTestResults(os, mMetricStrings[index], - (S32)((*base)[label][ mMetricStrings[index] ].asInteger()), (S32)((*current)[label][ mMetricStrings[index] ].asInteger())) ; - break ; - case LLSD::TypeReal: - compareTestResults(os, mMetricStrings[index], - (F32)((*base)[label][ mMetricStrings[index] ].asReal()), (F32)((*current)[label][ mMetricStrings[index] ].asReal())) ; - break; - default: - llerrs << "unsupported metric " << mMetricStrings[index] << " LLSD type: " << (S32)(*current)[label][ mMetricStrings[index] ].type() << llendl ; - } - } - } - - incLabel() ; - in_base = (*base).has(mCurLabel) ; - in_current = (*current).has(mCurLabel) ; - } - }//end of default - else - { - //load the base session - prePerformanceAnalysis() ; - mBaseSessionp = loadTestSession(base) ; - - //load the current session - prePerformanceAnalysis() ; - mCurrentSessionp = loadTestSession(current) ; - - if(!mBaseSessionp || !mCurrentSessionp) - { - llerrs << "memory error during loading test sessions." << llendl ; - } - - //compare - compareTestSessions(os) ; - - //release memory - if(mBaseSessionp) - { - delete mBaseSessionp ; - mBaseSessionp = NULL ; - } - if(mCurrentSessionp) - { - delete mCurrentSessionp ; - mCurrentSessionp = NULL ; - } - } -} - -//virtual -void LLMetricPerformanceTester::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) -{ - *os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current, - v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ; -} - -//virtual -void LLMetricPerformanceTester::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) -{ - *os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current, - v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ; -} - -//virtual -LLMetricPerformanceTester::LLTestSession::~LLTestSession() -{ -} - diff --git a/indra/newview/llmetricperformancetester.h b/indra/newview/llmetricperformancetester.h deleted file mode 100644 index 6f5dc03564..0000000000 --- a/indra/newview/llmetricperformancetester.h +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file LLMetricPerformanceTester.h - * @brief LLMetricPerformanceTester class definition - * - * $LicenseInfo:firstyear=2004&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_METRICPERFORMANCETESTER_H -#define LL_METRICPERFORMANCETESTER_H - -class LLMetricPerformanceTester -{ -public: - // - //name passed to the constructor is a unique string for each tester. - //an error is reported if the name is already used by some other tester. - // - LLMetricPerformanceTester(std::string name, BOOL use_default_performance_analysis) ; - virtual ~LLMetricPerformanceTester(); - - // - //return the name of the tester - // - std::string getName() const { return mName ;} - // - //return the number of the test metrics in this tester - // - S32 getNumOfMetricStrings() const { return mMetricStrings.size() ;} - // - //return the metric string at the index - // - const std::string& getMetricString(U32 index) const ; - - // - //this function to compare the test results. - //by default, it compares the test results against the baseline one by one, item by item, - //in the increasing order of the LLSD label counter, starting from the first one. - //you can define your own way to analyze performance by passing FALSE to "use_default_performance_analysis", - //and implement two abstract virtual functions below: loadTestSession(...) and compareTestSessions(...). - // - void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; - -protected: - // - //insert metric strings used in the tester. - // - void addMetricString(std::string str) ; - - // - //increase LLSD label by 1 - // - void incLabel() ; - - // - //the function to write a set of test results to the log LLSD. - // - void outputTestResults() ; - - // - //compare the test results. - //you can write your own to overwrite the default one. - // - virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; - virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; - - // - //for performance analysis use - //it defines an interface for the two abstract virtual functions loadTestSession(...) and compareTestSessions(...). - //please make your own test session class derived from it. - // - class LLTestSession - { - public: - virtual ~LLTestSession() ; - }; - - // - //load a test session for log LLSD - //you need to implement it only when you define your own way to analyze performance. - //otherwise leave it empty. - // - virtual LLMetricPerformanceTester::LLTestSession* loadTestSession(LLSD* log) = 0 ; - // - //compare the base session and the target session - //you need to implement it only when you define your own way to analyze performance. - //otherwise leave it empty. - // - virtual void compareTestSessions(std::ofstream* os) = 0 ; - // - //the function to write a set of test results to the log LLSD. - //you have to write you own version of this function. - // - virtual void outputTestRecord(LLSD* sd) = 0 ; - -private: - void preOutputTestResults(LLSD* sd) ; - void postOutputTestResults(LLSD* sd) ; - void prePerformanceAnalysis() ; - -protected: - // - //the unique name string of the tester - // - std::string mName ; - // - //the current label counter for the log LLSD - // - std::string mCurLabel ; - S32 mCount ; - - BOOL mUseDefaultPerformanceAnalysis ; - LLTestSession* mBaseSessionp ; - LLTestSession* mCurrentSessionp ; - - //metrics strings - std::vector< std::string > mMetricStrings ; - -//static members -private: - static void addTester(LLMetricPerformanceTester* tester) ; - -public: - typedef std::map< std::string, LLMetricPerformanceTester* > name_tester_map_t; - static name_tester_map_t sTesterMap ; - - static LLMetricPerformanceTester* getTester(std::string label) ; - static BOOL hasMetricPerformanceTesters() {return !sTesterMap.empty() ;} - - static void initClass() ; - static void cleanClass() ; -}; - -#endif - diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0ad54f238e..99a9469ddb 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -344,6 +344,11 @@ void LLViewerTextureManager::init() if(LLFastTimer::sMetricLog) { LLViewerTextureManager::sTesterp = new LLTexturePipelineTester() ; + if (!LLViewerTextureManager::sTesterp->isValid()) + { + delete LLViewerTextureManager::sTesterp; + LLViewerTextureManager::sTesterp = NULL; + } } } @@ -3579,22 +3584,22 @@ F32 LLViewerMediaTexture::getMaxVirtualSize() //start of LLTexturePipelineTester //---------------------------------------------------------------------------------------------- LLTexturePipelineTester::LLTexturePipelineTester() : - LLMetricPerformanceTester("TextureTester", FALSE) -{ - addMetricString("TotalBytesLoaded") ; - addMetricString("TotalBytesLoadedFromCache") ; - addMetricString("TotalBytesLoadedForLargeImage") ; - addMetricString("TotalBytesLoadedForSculpties") ; - addMetricString("StartFetchingTime") ; - addMetricString("TotalGrayTime") ; - addMetricString("TotalStablizingTime") ; - addMetricString("StartTimeLoadingSculpties") ; - addMetricString("EndTimeLoadingSculpties") ; - - addMetricString("Time") ; - addMetricString("TotalBytesBound") ; - addMetricString("TotalBytesBoundForLargeImage") ; - addMetricString("PercentageBytesBound") ; + LLMetricPerformanceTesterWithSession("TextureTester") +{ + addMetric("TotalBytesLoaded") ; + addMetric("TotalBytesLoadedFromCache") ; + addMetric("TotalBytesLoadedForLargeImage") ; + addMetric("TotalBytesLoadedForSculpties") ; + addMetric("StartFetchingTime") ; + addMetric("TotalGrayTime") ; + addMetric("TotalStablizingTime") ; + addMetric("StartTimeLoadingSculpties") ; + addMetric("EndTimeLoadingSculpties") ; + + addMetric("Time") ; + addMetric("TotalBytesBound") ; + addMetric("TotalBytesBoundForLargeImage") ; + addMetric("PercentageBytesBound") ; mTotalBytesLoaded = 0 ; mTotalBytesLoadedFromCache = 0 ; @@ -3672,22 +3677,23 @@ void LLTexturePipelineTester::reset() //virtual void LLTexturePipelineTester::outputTestRecord(LLSD *sd) { - (*sd)[mCurLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded ; - (*sd)[mCurLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache ; - (*sd)[mCurLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage ; - (*sd)[mCurLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties ; + std::string currentLabel = getCurrentLabelName(); + (*sd)[currentLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded ; + (*sd)[currentLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache ; + (*sd)[currentLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage ; + (*sd)[currentLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties ; - (*sd)[mCurLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime ; - (*sd)[mCurLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime ; - (*sd)[mCurLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime ; + (*sd)[currentLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime ; + (*sd)[currentLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime ; + (*sd)[currentLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime ; - (*sd)[mCurLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties ; - (*sd)[mCurLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties ; + (*sd)[currentLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties ; + (*sd)[currentLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties ; - (*sd)[mCurLabel]["Time"] = LLImageGL::sLastFrameTime ; - (*sd)[mCurLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed ; - (*sd)[mCurLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage ; - (*sd)[mCurLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded) ; + (*sd)[currentLabel]["Time"] = LLImageGL::sLastFrameTime ; + (*sd)[currentLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed ; + (*sd)[currentLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage ; + (*sd)[currentLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded) ; } void LLTexturePipelineTester::updateTextureBindingStats(const LLViewerTexture* imagep) @@ -3776,7 +3782,7 @@ void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) } //compare and output the comparison - *os << llformat("%s\n", mName.c_str()) ; + *os << llformat("%s\n", getTesterName().c_str()) ; *os << llformat("AggregateResults\n") ; compareTestResults(os, "TotalFetchingTime", base_sessionp->mTotalFetchingTime, current_sessionp->mTotalFetchingTime) ; @@ -3831,7 +3837,7 @@ void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) } //virtual -LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSession(LLSD* log) +LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::loadTestSession(LLSD* log) { LLTexturePipelineTester::LLTextureTestSession* sessionp = new LLTexturePipelineTester::LLTextureTestSession() ; if(!sessionp) @@ -3858,12 +3864,11 @@ LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSessi sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ; //load a session - BOOL in_log = (*log).has(mCurLabel) ; - while(in_log) + std::string currentLabel = getCurrentLabelName(); + BOOL in_log = (*log).has(currentLabel) ; + while (in_log) { - LLSD::String label = mCurLabel ; - incLabel() ; - in_log = (*log).has(mCurLabel) ; + LLSD::String label = currentLabel ; if(sessionp->mInstantPerformanceListCounter >= (S32)sessionp->mInstantPerformanceList.size()) { @@ -3929,7 +3934,11 @@ LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSessi sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0 ; sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f ; sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ; - } + } + // Next label + incrementCurrentCount() ; + currentLabel = getCurrentLabelName(); + in_log = (*log).has(currentLabel) ; } sessionp->mTotalFetchingTime += total_fetching_time ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 7cb8bea4c8..6ea717c8b1 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -732,7 +732,7 @@ public: //it tracks the activities of the texture pipeline //records them, and outputs them to log files // -class LLTexturePipelineTester : public LLMetricPerformanceTester +class LLTexturePipelineTester : public LLMetricPerformanceTesterWithSession { enum { @@ -748,8 +748,6 @@ public: void updateGrayTextureBinding() ; void setStablizingTime() ; - /*virtual*/ void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; - private: void reset() ; void updateStablizingTime() ; @@ -820,7 +818,7 @@ private: S32 mInstantPerformanceListCounter ; }; - /*virtual*/ LLMetricPerformanceTester::LLTestSession* loadTestSession(LLSD* log) ; + /*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) ; /*virtual*/ void compareTestSessions(std::ofstream* os) ; }; -- cgit v1.2.3 From 58d6057076028c13a2dcc6130734a86933dc5864 Mon Sep 17 00:00:00 2001 From: Tofu Linden 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("info_panel"); mControlPanel = getChild("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; igetElement(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 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("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"/> + 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 @@ 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 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"/> + -- cgit v1.2.3 From 14c9db3a52cbafa0d057e84657f9df11d7695638 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Thu, 4 Nov 2010 22:55:05 +0200 Subject: STORM-284 FIXED Disabled "+" sign when user tries to drop a landmark to Favorites bar from any location besides My Inventory or Library. --- indra/newview/llfavoritesbar.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 3981b887ad..a1ba370c26 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -414,6 +414,9 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { *accept = ACCEPT_NO; + LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); + if (LLToolDragAndDrop::SOURCE_AGENT != source && LLToolDragAndDrop::SOURCE_LIBRARY != source) return FALSE; + switch (cargo_type) { -- cgit v1.2.3 From dfeb7abe5f690bbd3a908c84c53bbea20a5adb7c Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" 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 @@ Type String Value - http://localhost/agni + http://update.secondlife.com + + UpdaterServicePath + + Comment + Path on the update server host. + Persist + 0 + Type + String + Value + update + + UpdaterServiceProtocolVersion + + Comment + The update protocol version to use. + Persist + 0 + Type + String + Value + v1.0 UploadBakedTexOld 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 1d7ef9cda5113af14076bf67417aa657ddb034bf Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Thu, 4 Nov 2010 15:47:24 -0700 Subject: INTL-6 WIP missing translations ES and PT --- indra/newview/skins/default/xui/es/floater_about_land.xml | 13 +++++++++++++ indra/newview/skins/default/xui/pt/floater_about_land.xml | 13 +++++++++++++ 2 files changed, 26 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml index 06b9ae0c30..be5b5d011c 100644 --- a/indra/newview/skins/default/xui/es/floater_about_land.xml +++ b/indra/newview/skins/default/xui/es/floater_about_land.xml @@ -470,7 +470,20 @@ los media: + + Residentes autorizados + + + + (People and/or Objects you have blocked) + -- cgit v1.2.3 From 5894a6a593a0a948815d925dabfb2a4bc78e9d3f Mon Sep 17 00:00:00 2001 From: Andrew Productengine Date: Thu, 11 Nov 2010 14:59:51 +0200 Subject: STORM-582 FIXED Moved movement and camera control preferences from Advanced to the new Move & View tab. In addition to moving existing controls, created stub checkbox and radiobuttons for double-click behavior. Logic will be hooked up to them in STORM-576. --- .../default/xui/en/panel_preferences_move.xml | 194 +++++++++++++++++++++ 1 file changed, 194 insertions(+) (limited to 'indra/newview') 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 2d6dddfc8c..ec80efe188 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -9,4 +9,198 @@ name="move_panel" top="1" width="517"> + + + + + Automatic position for: + + + + + + + + Mouselook mouse sensitivity: + + + + + + + + + + -- cgit v1.2.3 From d358feff7ad732b28d8e914e44cdb08761207346 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Thu, 11 Nov 2010 15:06:51 +0200 Subject: STORM-586 FIXED Layout cleanup in the Setup tab of Preferences - Deleted Mouselook settings - Increased vertical padding between "Cache size" and "Cache location" controls --- .../default/xui/en/panel_preferences_setup.xml | 49 +--------------------- 1 file changed, 2 insertions(+), 47 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..14aa38c5d3 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -9,51 +9,6 @@ name="Input panel" top="1" width="517"> - - Mouselook: - - - Mouse sensitivity - - - Network: @@ -187,7 +142,7 @@ layout="topleft" left="80" name="Cache location" - top_delta="20" + top_delta="40" width="300"> Cache location: -- cgit v1.2.3 From 5821631c2e3527d248d6190e342e241acdc38dd7 Mon Sep 17 00:00:00 2001 From: Andrew Productengine Date: Thu, 11 Nov 2010 15:15:04 +0200 Subject: STORM-583 ADDITIONAL_FIX Fixed top_pad of topmost control in "Colors" so that it is consistent with other preferences tab. --- indra/newview/skins/default/xui/en/panel_preferences_colors.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml index 06e8ee80b5..036730a646 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml @@ -17,7 +17,7 @@ layout="topleft" left="30" name="effects_color_textbox" - top_pad="15" + top_pad="10" width="200"> My effects (selection beam): -- cgit v1.2.3 From 51e38dff76fce7f0fe5b665f8707931435e2ff99 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Thu, 11 Nov 2010 16:45:35 +0200 Subject: STORM-587 FIXED Layout cleanup in the Advanced tab of Preferences - According to the specification deleted all controls except: 1. "UI Size" slider 2. "Show script errors in" radio group - According to the specification: 1. "Allow Multiple Viewer" checkbox 2. "Show Grid Selection at login" checkbox 3. "Show Advanced Manu" checkbox 4. "Show Developer Menu" checkbox --- .../default/xui/en/panel_preferences_advanced.xml | 259 +++------------------ 1 file changed, 32 insertions(+), 227 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index e17d4768d4..6f4beea43a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -17,188 +17,17 @@ name="middle_mouse"> Middle Mouse - - - - -Automatic position for: - - - - - - - - - - - - - - - - UI size + width="100"> + UI size: + width="250" /> - - + - - - + height="15" + label="Show Developer Menu" + layout="topleft" + left="30" + name="push_to_talk_toggle_check" + top_pad="5" + width="237"/> -- cgit v1.2.3 From 2287f7612ce0e2cbc439c4ce048edcb2df3b3d40 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Thu, 11 Nov 2010 18:49:55 +0200 Subject: STORM-587 ADDITIONAL FIX Layout cleanup in the Advanced tab of Preferences - Temporary restored controls: 1. "Move avatar lips when speaking" checkbox 2. "Toggle speak on/off when I press:" checkbox 3. "Push-to-Speak trigger" lineeditor 4. "set_voice_hotkey_button" button 5. "set_voice_middlemouse_button" button They should be moved to the Sound&Media panel of floater Preferences. But the specification for the Sound&Media panel is not ready yet. As specification will be ready, these controls will be moved to the Sound&Media panel. --- .../default/xui/en/panel_preferences_advanced.xml | 64 +++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 6f4beea43a..6a9ea5afb6 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -103,7 +103,7 @@ + + + + + + + -- cgit v1.2.3 From 6e15957d909787ba612004903f04335a593b5348 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" 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 /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" 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" 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(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 mQueue; + LLThreadSafeQueue * 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)" 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 4077e6bb52f73a3ccd7f560788fc2fda21d7d9e7 Mon Sep 17 00:00:00 2001 From: Wolfpup Lowenhar Date: Thu, 11 Nov 2010 22:50:14 -0500 Subject: STORM-102 : STORM-143 :Made needed changes to code to improve searching for previous logs and also changed the name used for P2P IM log file names. The latter change is going to temporarely break personal content for those that are saving conversation logs as P2P IM logs will now be useinf the user name and not the legacy name. --- indra/newview/llimview.cpp | 5 +++-- indra/newview/lllogchat.cpp | 53 +++++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 857c27be63..14a29b7e0f 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -537,7 +537,8 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline() void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name) { - if (av_name.mLegacyFirstName.empty()) + mHistoryFileName = av_name.mUsername; + /*if (av_name.mLegacyFirstName.empty()) { // if mLegacyFirstName is empty it means display names is off and the // data came from the gCacheName, mDisplayName will be the legacy name @@ -546,7 +547,7 @@ void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LL else { mHistoryFileName = LLCacheName::cleanFullName(av_name.getLegacyName()); - } + }*/ } void LLIMModel::LLIMSession::buildHistoryFileName() diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 4f80472330..2fb5ba82ba 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -206,7 +206,7 @@ std::string LLLogChat::makeLogFileName(std::string filename) std::string LLLogChat::cleanFileName(std::string filename) { - std::string invalidChars = "\"\'\\/?*:<>|"; + std::string invalidChars = "\"\'\\/?*:.<>|"; std::string::size_type position = filename.find_first_of(invalidChars); while (position != filename.npos) { @@ -370,8 +370,8 @@ void LLLogChat::loadAllHistory(const std::string& file_name, std::list& me llwarns << "Session name is Empty!" << llendl; return ; } - LL_INFOS("") << "Loading:" << file_name << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ - LL_INFOS("") << "Current:" << makeLogFileName(file_name) << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ + //LL_INFOS("") << "Loading:" << file_name << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ + //LL_INFOS("") << "Current:" << makeLogFileName(file_name) << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ LLFILE* fptr = LLFile::fopen(makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ if (!fptr) { @@ -569,31 +569,32 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im) im[IM_TEXT] = name_and_text[IDX_TEXT]; return true; //parsed name and message text, maybe have a timestamp too } -std::string LLLogChat::oldLogFileName(std::string filename) -{ +std::string LLLogChat::oldLogFileName(std::string filename) +{ std::string scanResult; std::string directory = gDirUtilp->getPerAccountChatLogsDir();/* get Users log directory */ directory += gDirUtilp->getDirDelimiter();/* add final OS dependent delimiter */ - std::string pattern = (cleanFileName(filename)+(( filename == "chat" ) ? "-???\?-?\?-??.txt" : "-???\?-??.txt"));/* create search pattern*/ - LL_INFOS("") << "Checking:" << directory << " for " << pattern << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ - std::vector allfiles; - - while (gDirUtilp->getNextFileInDir(directory, pattern, scanResult)) + filename=cleanFileName(filename);/* lest make shure the file name has no invalad charecters befor making the pattern */ + std::string pattern = (filename+(( filename == "chat" ) ? "-???\?-?\?-??.txt" : "-???\?-??.txt"));/* create search pattern*/ + //LL_INFOS("") << "Checking:" << directory << " for " << pattern << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ + std::vector allfiles; + + while (gDirUtilp->getNextFileInDir(directory, pattern, scanResult)) + { + //LL_INFOS("") << "Found :" << scanResult << LL_ENDL; + allfiles.push_back(scanResult); + } + + if (allfiles.size() == 0) // if no result from date search, return generic filename + { + scanResult = directory + filename + ".txt"; + } + else { - //LL_INFOS("") << "Found :" << scanResult << LL_ENDL; - allfiles.push_back(scanResult); - } - - if (allfiles.size() == 0) // if no result from date search, return generic filename - { - scanResult = directory + filename + ".txt"; - } - else - { - std::sort(allfiles.begin(), allfiles.end()); - scanResult = directory + allfiles.back(); - // thisfile is now the most recent version of the file. - } - LL_INFOS("") << "Reading:" << scanResult << LL_ENDL; - return scanResult; + std::sort(allfiles.begin(), allfiles.end()); + scanResult = directory + allfiles.back(); + // thisfile is now the most recent version of the file. + } + //LL_INFOS("") << "Reading:" << scanResult << LL_ENDL;/* uncomment if you want to verify step, delete on commit */ + return scanResult; } -- cgit v1.2.3 From 5c18ab7aceabc01fdcf01e86e364621241132966 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Fri, 12 Nov 2010 15:35:42 +0200 Subject: STORM-587 ADDITIONAL FIX Layout cleanup in the Advanced tab of Preferences - Removed controls: 1. "Move avatar lips when speaking" checkbox 2. "Toggle speak on/off when I press:" checkbox 3. "Push-to-Speak trigger" lineeditor 4. "set_voice_hotkey_button" button 5. "set_voice_middlemouse_button" button - Set proper names for checkboxes According to the specification these controls are in the Sound&Media panel now. --- .../default/xui/en/panel_preferences_advanced.xml | 70 ++-------------------- 1 file changed, 4 insertions(+), 66 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 6a9ea5afb6..c1fb0243b7 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -88,7 +88,7 @@ label="Allow Multiple Viewer" layout="topleft" left="30" - name="push_to_talk_toggle_check" + name="allow_multiple_viewer_check" top_pad="20" width="237"/> - - - - - - - -- cgit v1.2.3 From 2632565bbced3002eb9912270b1f7303c48a0b44 Mon Sep 17 00:00:00 2001 From: Wolfpup Lowenhar Date: Fri, 12 Nov 2010 09:09:41 -0500 Subject: STORM-102 : STORM-143 :Removed unneeded code in llimview. --- indra/newview/llimview.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 14a29b7e0f..cc48226052 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -538,16 +538,6 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline() void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name) { mHistoryFileName = av_name.mUsername; - /*if (av_name.mLegacyFirstName.empty()) - { - // if mLegacyFirstName is empty it means display names is off and the - // data came from the gCacheName, mDisplayName will be the legacy name - mHistoryFileName = LLCacheName::cleanFullName(av_name.mDisplayName); - } - else - { - mHistoryFileName = LLCacheName::cleanFullName(av_name.getLegacyName()); - }*/ } void LLIMModel::LLIMSession::buildHistoryFileName() -- cgit v1.2.3 From ef46e7037ca59224dfcdf3745e165ee97b086a69 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 12 Nov 2010 17:28:44 +0200 Subject: STORM-579 FIXED resident SLURL font color to match Chat preferences for plain text Nearby Chat log --- indra/newview/llchathistory.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 0f7e9313a9..271ee0c4a4 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -798,9 +798,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) { LLStyle::Params link_params(style_params); - link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); + + // Setting is_link = true for agent SLURL to avoid applying default style to it. + // See LLTextBase::appendTextImpl(). + link_params.is_link = true; + link_params.link_href = LLSLURL("agent", chat.mFromID, "inspect").getSLURLString(); + // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(link_params.link_href, false, style_params); + mEditor->appendText(chat.mFromName, false, link_params); mEditor->appendText(delimiter, false, style_params); } else -- cgit v1.2.3 From 29a36c21db57729ff86785745c90ffbf93875edb Mon Sep 17 00:00:00 2001 From: Andrew Productengine Date: Fri, 12 Nov 2010 18:18:44 +0200 Subject: STORM-571 FIXED Moved voice prefs from advanced to Sound&Media and changed layout accordingly. This changeset also covers STORM-572 (note that design in this fix differs a little from the one proposed in there because there was not enough space to make it that way). --- .../default/xui/en/panel_preferences_advanced.xml | 4 - .../default/xui/en/panel_preferences_sound.xml | 140 +++++++++++++++------ 2 files changed, 104 insertions(+), 40 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index c1fb0243b7..15d1222d00 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -13,10 +13,6 @@ name="aspect_ratio_text"> [NUM]:[DEN] - - Middle Mouse - + + Middle Mouse + + left="25" + width="230"/> + + width="180" + top_pad="10"> Voice Chat Settings + width="102"> Listen from: + top_delta="0" /> + + + + @@ -396,14 +464,14 @@ visiblity_control="ShowDeviceSettings" border="false" follows="top|left" - height="120" + height="100" label="Device Settings" layout="topleft" - left="0" + left_delta="-2" name="device_settings_panel" class="panel_voice_device_settings" - width="501" - top="285"> + width="470" + top_pad="0"> Default @@ -419,7 +487,7 @@ + width="70"> Input My volume: @@ -465,11 +533,11 @@ increment="0.025" initial_value="1.0" layout="topleft" - left="160" + left_delta="-6" max_val="2" name="mic_volume_slider" tool_tip="Change the volume using this slider" - top_pad="-2" + top_pad="-1" width="220" /> Please wait @@ -489,7 +557,7 @@ layout="topleft" left_delta="0" name="bar0" - top_delta="0" + top_delta="-2" width="20" /> + width="70"> Output -- cgit v1.2.3 From e3677f9ee2223cc13d12456e1eee4f7f9a90c474 Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 12 Nov 2010 12:18:18 -0800 Subject: Revert change for ER-301 to make merging easier. We'll get this in another pass --- 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 5147272122..b614ccdbc2 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 = 3000.f; +const F32 MAX_BANDWIDTH = 1500.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 b2fcba25c8dd04318420af30f877b0984a524055 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 13 Nov 2010 00:53:29 +0200 Subject: STORM-52 FIXED Made it possible to use an external script editor. The editor can be specified: * via "ExternalEditor" setting in settings.xml * via LL_SCRIPT_EDITOR variable Removed obsolete XUIEditor setting in favor of the new one. --- indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 4 +- indra/newview/llexternaleditor.cpp | 192 +++++++++++++++++ indra/newview/llexternaleditor.h | 91 ++++++++ indra/newview/llfloateruipreview.cpp | 210 ++++-------------- indra/newview/llpreviewscript.cpp | 235 ++++++++++++++++----- indra/newview/llpreviewscript.h | 15 +- .../skins/default/xui/en/panel_script_ed.xml | 9 + 8 files changed, 530 insertions(+), 228 deletions(-) create mode 100644 indra/newview/llexternaleditor.cpp create mode 100644 indra/newview/llexternaleditor.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 09622d3af5..d44b0ce679 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -143,6 +143,7 @@ set(viewer_SOURCE_FILES lleventnotifier.cpp lleventpoll.cpp llexpandabletextbox.cpp + llexternaleditor.cpp llface.cpp llfasttimerview.cpp llfavoritesbar.cpp @@ -674,6 +675,7 @@ set(viewer_HEADER_FILES lleventnotifier.h lleventpoll.h llexpandabletextbox.h + llexternaleditor.h llface.h llfasttimerview.h llfavoritesbar.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ebd93b5987..a5d9bd0f4f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11883,10 +11883,10 @@ Value 150000.0 - XUIEditor + ExternalEditor Comment - Path to program used to edit XUI files + Path to program used to edit LSL scripts and XUI files, e.g.: /usr/bin/gedit --new-window "%s" Persist 1 Type diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp new file mode 100644 index 0000000000..54968841ab --- /dev/null +++ b/indra/newview/llexternaleditor.cpp @@ -0,0 +1,192 @@ +/** + * @file llexternaleditor.cpp + * @brief A convenient class to run external editor. + * + * $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 "llviewerprecompiledheaders.h" +#include "llexternaleditor.h" + +#include "llui.h" + +// static +const std::string LLExternalEditor::sFilenameMarker = "%s"; + +// static +const std::string LLExternalEditor::sSetting = "ExternalEditor"; + +bool LLExternalEditor::setCommand(const std::string& env_var, const std::string& override) +{ + std::string cmd = findCommand(env_var, override); + if (cmd.empty()) + { + llwarns << "Empty editor command" << llendl; + return false; + } + + // Add the filename marker if missing. + if (cmd.find(sFilenameMarker) == std::string::npos) + { + cmd += " \"" + sFilenameMarker + "\""; + llinfos << "Adding the filename marker (" << sFilenameMarker << ")" << llendl; + } + + string_vec_t tokens; + if (tokenize(tokens, cmd) < 2) // 2 = bin + at least one arg (%s) + { + llwarns << "Error parsing editor command" << llendl; + return false; + } + + // Check executable for existence. + std::string bin_path = tokens[0]; + if (!LLFile::isfile(bin_path)) + { + llwarns << "Editor binary [" << bin_path << "] not found" << llendl; + return false; + } + + // Save command. + mProcess.setExecutable(bin_path); + mArgs.clear(); + for (size_t i = 1; i < tokens.size(); ++i) + { + if (i > 1) mArgs += " "; + mArgs += "\"" + tokens[i] + "\""; + } + llinfos << "Setting command [" << bin_path << " " << mArgs << "]" << llendl; + + return true; +} + +bool LLExternalEditor::run(const std::string& file_path) +{ + std::string args = mArgs; + if (mProcess.getExecutable().empty() || args.empty()) + { + llwarns << "Editor command not set" << llendl; + return false; + } + + // Substitute the filename marker in the command with the actual passed file name. + LLStringUtil::replaceString(args, sFilenameMarker, file_path); + + // Split command into separate tokens. + string_vec_t tokens; + tokenize(tokens, args); + + // Set process arguments taken from the command. + mProcess.clearArguments(); + for (string_vec_t::const_iterator arg_it = tokens.begin(); arg_it != tokens.end(); ++arg_it) + { + mProcess.addArgument(*arg_it); + } + + // Run the editor. + llinfos << "Running editor command [" << mProcess.getExecutable() + " " + args << "]" << llendl; + int result = mProcess.launch(); + if (result == 0) + { + // Prevent killing the process in destructor (will add it to the zombies list). + mProcess.orphan(); + } + + return result == 0; +} + +// static +size_t LLExternalEditor::tokenize(string_vec_t& tokens, const std::string& str) +{ + tokens.clear(); + + // Split the argument string into separate strings for each argument + typedef boost::tokenizer< boost::char_separator > tokenizer; + boost::char_separator sep("", "\" ", boost::drop_empty_tokens); + + tokenizer tokens_list(str, sep); + tokenizer::iterator token_iter; + BOOL inside_quotes = FALSE; + BOOL last_was_space = FALSE; + for (token_iter = tokens_list.begin(); token_iter != tokens_list.end(); ++token_iter) + { + if (!strncmp("\"",(*token_iter).c_str(),2)) + { + inside_quotes = !inside_quotes; + } + else if (!strncmp(" ",(*token_iter).c_str(),2)) + { + if(inside_quotes) + { + tokens.back().append(std::string(" ")); + last_was_space = TRUE; + } + } + else + { + std::string to_push = *token_iter; + if (last_was_space) + { + tokens.back().append(to_push); + last_was_space = FALSE; + } + else + { + tokens.push_back(to_push); + } + } + } + + return tokens.size(); +} + +// static +std::string LLExternalEditor::findCommand( + const std::string& env_var, + const std::string& override) +{ + std::string cmd; + + // Get executable path. + if (!override.empty()) // try the supplied override first + { + cmd = override; + llinfos << "Using override" << llendl; + } + else if (!LLUI::sSettingGroups["config"]->getString(sSetting).empty()) + { + cmd = LLUI::sSettingGroups["config"]->getString(sSetting); + llinfos << "Using setting" << llendl; + } + else // otherwise use the path specified by the environment variable + { + char* env_var_val = getenv(env_var.c_str()); + if (env_var_val) + { + cmd = env_var_val; + llinfos << "Using env var " << env_var << llendl; + } + } + + llinfos << "Found command [" << cmd << "]" << llendl; + return cmd; +} diff --git a/indra/newview/llexternaleditor.h b/indra/newview/llexternaleditor.h new file mode 100644 index 0000000000..6ea210d5e2 --- /dev/null +++ b/indra/newview/llexternaleditor.h @@ -0,0 +1,91 @@ +/** + * @file llexternaleditor.h + * @brief A convenient class to run external editor. + * + * $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_LLEXTERNALEDITOR_H +#define LL_LLEXTERNALEDITOR_H + +#include + +/** + * Usage: + * LLExternalEditor ed; + * ed.setCommand("MY_EXTERNAL_EDITOR_VAR"); + * ed.run("/path/to/file1"); + * ed.run("/other/path/to/file2"); + */ +class LLExternalEditor +{ + typedef std::vector string_vec_t; + +public: + + /** + * Set editor command. + * + * @param env_var Environment variable of the same purpose. + * @param override Optional override. + * + * First tries the override, then a predefined setting (sSetting), + * then the environment variable. + * + * @return Command if found, empty string otherwise. + * + * @see sSetting + */ + bool setCommand(const std::string& env_var, const std::string& override = LLStringUtil::null); + + /** + * Run the editor with the given file. + * + * @param file_path File to edit. + * @return true on success, false on error. + */ + bool run(const std::string& file_path); + +private: + + static std::string findCommand( + const std::string& env_var, + const std::string& override); + + static size_t tokenize(string_vec_t& tokens, const std::string& str); + + /** + * Filename placeholder that gets replaced with an actual file name. + */ + static const std::string sFilenameMarker; + + /** + * Setting that can specify the editor command. + */ + static const std::string sSetting; + + + std::string mArgs; + LLProcessLauncher mProcess; +}; + +#endif // LL_LLEXTERNALEDITOR_H diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 5dc8067648..d3a2f144d9 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -36,6 +36,7 @@ // Internal utility #include "lleventtimer.h" +#include "llexternaleditor.h" #include "llrender.h" #include "llsdutil.h" #include "llxmltree.h" @@ -160,6 +161,8 @@ public: DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors private: + LLExternalEditor mExternalEditor; + // XUI elements for this floater LLScrollListCtrl* mFileList; // scroll list control for file list LLLineEditor* mEditorPathTextBox; // text field for path to editor executable @@ -185,7 +188,7 @@ private: std::string mSavedDiffPath; // stored diff file path so closing this floater doesn't reset it // Internal functionality - static void popupAndPrintWarning(std::string& warning); // pop up a warning + static void popupAndPrintWarning(const std::string& warning); // pop up a warning std::string getLocalizedDirectory(); // build and return the path to the XUI directory for the currently-selected localization void scanDiffFile(LLXmlTreeNode* file_node); // scan a given XML node for diff entries and highlight them in its associated file void highlightChangedElements(); // look up the list of elements to highlight and highlight them in the current floater @@ -597,7 +600,7 @@ void LLFloaterUIPreview::onClose(bool app_quitting) // Error handling (to avoid code repetition) // *TODO: this is currently unlocalized. Add to alerts/notifications.xml, someday, maybe. -void LLFloaterUIPreview::popupAndPrintWarning(std::string& warning) +void LLFloaterUIPreview::popupAndPrintWarning(const std::string& warning) { llwarns << warning << llendl; LLSD args; @@ -998,190 +1001,55 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) // Respond to button click to edit currently-selected floater void LLFloaterUIPreview::onClickEditFloater() { - std::string file_name = mFileList->getSelectedItemLabel(1); // get the file name of the currently-selected floater - if(std::string("") == file_name) // if no item is selected - { - return; // ignore click - } - std::string path = getLocalizedDirectory() + file_name; - - // stat file to see if it exists (some localized versions may not have it there are no diffs, and then we try to open an nonexistent file) - llstat dummy; - if(LLFile::stat(path.c_str(), &dummy)) // if the file does not exist - { - std::string warning = "No file for this floater exists in the selected localization. Opening the EN version instead."; - popupAndPrintWarning(warning); - - path = get_xui_dir() + mDelim + "en" + mDelim + file_name; // open the en version instead, by default - } - - // get executable path - const char* exe_path_char; - std::string path_in_textfield = mEditorPathTextBox->getText(); - if(std::string("") != path_in_textfield) // if the text field is not emtpy, use its path - { - exe_path_char = path_in_textfield.c_str(); - } - else if (!LLUI::sSettingGroups["config"]->getString("XUIEditor").empty()) - { - exe_path_char = LLUI::sSettingGroups["config"]->getString("XUIEditor").c_str(); - } - else // otherwise use the path specified by the environment variable + // Determine file to edit. + std::string file_path; { - exe_path_char = getenv("LL_XUI_EDITOR"); - } - - // error check executable path - if(NULL == exe_path_char) - { - std::string warning = "Select an editor by setting the environment variable LL_XUI_EDITOR or specifying its path in the \"Editor Path\" field."; - popupAndPrintWarning(warning); - return; - } - std::string exe_path = exe_path_char; // do this after error check, otherwise internal strlen call fails on bad char* - - // remove any quotes; they're added back in later where necessary - int found_at; - while((found_at = exe_path.find("\"")) != -1 || (found_at = exe_path.find("'")) != -1) - { - exe_path.erase(found_at,1); - } - - llstat s; - if(!LLFile::stat(exe_path.c_str(), &s)) // If the executable exists - { - // build paths and arguments - std::string quote = std::string("\""); - std::string args; - std::string custom_args = mEditorArgsTextBox->getText(); - int position_of_file = custom_args.find(std::string("%FILE%"), 0); // prepare to replace %FILE% with actual file path - std::string first_part_of_args = ""; - std::string second_part_of_args = ""; - if(-1 == position_of_file) // default: Executable.exe File.xml - { - args = quote + path + quote; // execute the command Program.exe "File.xml" - } - else // use advanced command-line arguments, e.g. "Program.exe -safe File.xml" -windowed for "-safe %FILE% -windowed" + std::string file_name = mFileList->getSelectedItemLabel(1); // get the file name of the currently-selected floater + if (file_name.empty()) // if no item is selected { - first_part_of_args = custom_args.substr(0,position_of_file); // get part of args before file name - second_part_of_args = custom_args.substr(position_of_file+6,custom_args.length()); // get part of args after file name - custom_args = first_part_of_args + std::string("\"") + path + std::string("\"") + second_part_of_args; // replace %FILE% with "" and put back together - args = custom_args; // and save in the variable that is actually used + llwarns << "No file selected" << llendl; + return; // ignore click } + file_path = getLocalizedDirectory() + file_name; - // find directory in which executable resides by taking everything after last slash - int last_slash_position = exe_path.find_last_of(mDelim); - if(-1 == last_slash_position) - { - std::string warning = std::string("Unable to find a valid path to the specified executable for XUI XML editing: ") + exe_path; - popupAndPrintWarning(warning); - return; - } - std::string exe_dir = exe_path.substr(0,last_slash_position); // strip executable off, e.g. get "C:\Program Files\TextPad 5" (with or without trailing slash) - -#if LL_WINDOWS - PROCESS_INFORMATION pinfo; - STARTUPINFOA sinfo; - memset(&sinfo, 0, sizeof(sinfo)); - memset(&pinfo, 0, sizeof(pinfo)); - - std::string exe_name = exe_path.substr(last_slash_position+1); - args = quote + exe_name + quote + std::string(" ") + args; // and prepend the executable name, so we get 'Program.exe "Arg1"' - - char *args2 = new char[args.size() + 1]; // Windows requires that the second parameter to CreateProcessA be a writable (non-const) string... - strcpy(args2, args.c_str()); - - // we don't want the current directory to be the executable directory, since the file path is now relative. By using - // NULL for the current directory instead of exe_dir.c_str(), the path to the target file will work. - if(!CreateProcessA(exe_path.c_str(), args2, NULL, NULL, FALSE, 0, NULL, NULL, &sinfo, &pinfo)) - { - // DWORD dwErr = GetLastError(); - std::string warning = "Creating editor process failed!"; - popupAndPrintWarning(warning); - } - else + // stat file to see if it exists (some localized versions may not have it there are no diffs, and then we try to open an nonexistent file) + llstat dummy; + if(LLFile::stat(file_path.c_str(), &dummy)) // if the file does not exist { - // foo = pinfo.dwProcessId; // get your pid here if you want to use it later on - // sGatewayHandle = pinfo.hProcess; - CloseHandle(pinfo.hThread); // stops leaks - nothing else + popupAndPrintWarning("No file for this floater exists in the selected localization. Opening the EN version instead."); + file_path = get_xui_dir() + mDelim + "en" + mDelim + file_name; // open the en version instead, by default } + } - delete[] args2; -#else // if !LL_WINDOWS - // This code was copied from the code to run SLVoice, with some modification; should work in UNIX (Mac/Darwin or Linux) + // Set the editor command. + std::string cmd_override; + { + std::string bin = mEditorPathTextBox->getText(); + if (!bin.empty()) { - std::vector arglist; - arglist.push_back(exe_path.c_str()); - - // Split the argument string into separate strings for each argument - typedef boost::tokenizer< boost::char_separator > tokenizer; - boost::char_separator sep("","\" ", boost::drop_empty_tokens); - - tokenizer tokens(args, sep); - tokenizer::iterator token_iter; - BOOL inside_quotes = FALSE; - BOOL last_was_space = FALSE; - for(token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) - { - if(!strncmp("\"",(*token_iter).c_str(),2)) - { - inside_quotes = !inside_quotes; - } - else if(!strncmp(" ",(*token_iter).c_str(),2)) - { - if(inside_quotes) - { - arglist.back().append(std::string(" ")); - last_was_space = TRUE; - } - } - else - { - std::string to_push = *token_iter; - if(last_was_space) - { - arglist.back().append(to_push); - last_was_space = FALSE; - } - else - { - arglist.push_back(to_push); - } - } - } - - // create an argv vector for the child process - char **fakeargv = new char*[arglist.size() + 1]; - int i; - for(i=0; i < arglist.size(); i++) - fakeargv[i] = const_cast(arglist[i].c_str()); - - fakeargv[i] = NULL; - - fflush(NULL); // flush all buffers before the child inherits them - pid_t id = vfork(); - if(id == 0) + // surround command with double quotes for the case if the path contains spaces + if (bin.find("\"") == std::string::npos) { - // child - execv(exe_path.c_str(), fakeargv); - - // If we reach this point, the exec failed. - // Use _exit() instead of exit() per the vfork man page. - std::string warning = "Creating editor process failed (vfork/execv)!"; - popupAndPrintWarning(warning); - _exit(0); + bin = "\"" + bin + "\""; } - // parent - delete[] fakeargv; - // sGatewayPID = id; + std::string args = mEditorArgsTextBox->getText(); + cmd_override = bin + " " + args; } -#endif // LL_WINDOWS } - else + if (!mExternalEditor.setCommand("LL_XUI_EDITOR", cmd_override)) { - std::string warning = "Unable to find path to external XML editor for XUI preview tool"; + std::string warning = "Select an editor by setting the environment variable LL_XUI_EDITOR " + "or the ExternalEditor setting or specifying its path in the \"Editor Path\" field."; popupAndPrintWarning(warning); + return; + } + + // Run the editor. + if (!mExternalEditor.run(file_path)) + { + popupAndPrintWarning("Failed to run editor"); + return; } } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index cf2ea38288..330e809c53 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -34,11 +34,13 @@ #include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldir.h" +#include "llexternaleditor.h" #include "llfloaterreg.h" #include "llinventorydefines.h" #include "llinventorymodel.h" #include "llkeyboard.h" #include "lllineeditor.h" +#include "lllivefile.h" #include "llhelp.h" #include "llnotificationsutil.h" #include "llresmgr.h" @@ -115,6 +117,54 @@ static bool have_script_upload_cap(LLUUID& object_id) return object && (! object->getRegion()->getCapability("UpdateScriptTask").empty()); } +/// --------------------------------------------------------------------------- +/// LLLiveLSLFile +/// --------------------------------------------------------------------------- +class LLLiveLSLFile : public LLLiveFile +{ +public: + LLLiveLSLFile(std::string file_path, LLLiveLSLEditor* parent); + ~LLLiveLSLFile(); + + void ignoreNextUpdate() { mIgnoreNextUpdate = true; } + +protected: + /*virtual*/ bool loadFile(); + + LLLiveLSLEditor* mParent; + bool mIgnoreNextUpdate; +}; + +LLLiveLSLFile::LLLiveLSLFile(std::string file_path, LLLiveLSLEditor* parent) +: mParent(parent) +, mIgnoreNextUpdate(false) +, LLLiveFile(file_path, 1.0) +{ +} + +LLLiveLSLFile::~LLLiveLSLFile() +{ + LLFile::remove(filename()); +} + +bool LLLiveLSLFile::loadFile() +{ + if (mIgnoreNextUpdate) + { + mIgnoreNextUpdate = false; + return true; + } + + if (!mParent->loadScriptText(filename())) + { + return false; + } + + // Disable sync to avoid recursive load->save->load calls. + mParent->saveIfNeeded(false); + return true; +} + /// --------------------------------------------------------------------------- /// LLFloaterScriptSearch /// --------------------------------------------------------------------------- @@ -281,6 +331,7 @@ LLScriptEdCore::LLScriptEdCore( const LLHandle& floater_handle, void (*load_callback)(void*), void (*save_callback)(void*, BOOL), + void (*edit_callback)(void*), void (*search_replace_callback) (void* userdata), void* userdata, S32 bottom_pad) @@ -290,6 +341,7 @@ LLScriptEdCore::LLScriptEdCore( mEditor( NULL ), mLoadCallback( load_callback ), mSaveCallback( save_callback ), + mEditCallback( edit_callback ), mSearchReplaceCallback( search_replace_callback ), mUserdata( userdata ), mForceClose( FALSE ), @@ -329,6 +381,7 @@ BOOL LLScriptEdCore::postBuild() childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this); childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,FALSE)); + childSetAction("Edit_btn", boost::bind(&LLScriptEdCore::onEditButtonClick, this)); initMenu(); @@ -809,6 +862,13 @@ void LLScriptEdCore::doSave( BOOL close_after_save ) } } +void LLScriptEdCore::onEditButtonClick() +{ + if (mEditCallback) + { + mEditCallback(mUserdata); + } +} void LLScriptEdCore::onBtnUndoChanges() { @@ -949,6 +1009,7 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) self->getHandle(), LLPreviewLSL::onLoad, LLPreviewLSL::onSave, + NULL, // no edit callback LLPreviewLSL::onSearchReplace, self, 0); @@ -1417,6 +1478,7 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) self->getHandle(), &LLLiveLSLEditor::onLoad, &LLLiveLSLEditor::onSave, + &LLLiveLSLEditor::onEdit, &LLLiveLSLEditor::onSearchReplace, self, 0); @@ -1433,6 +1495,7 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : mCloseAfterSave(FALSE), mPendingUploads(0), mIsModifiable(FALSE), + mLiveFile(NULL), mIsNew(false) { mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); @@ -1458,6 +1521,7 @@ BOOL LLLiveLSLEditor::postBuild() LLLiveLSLEditor::~LLLiveLSLEditor() { + delete mLiveFile; } // virtual @@ -1639,38 +1703,39 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, delete xored_id; } -// unused -// void LLLiveLSLEditor::loadScriptText(const std::string& filename) -// { -// if(!filename) -// { -// llerrs << "Filename is Empty!" << llendl; -// return; -// } -// LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ -// if(file) -// { -// // read in the whole file -// fseek(file, 0L, SEEK_END); -// long file_length = ftell(file); -// fseek(file, 0L, SEEK_SET); -// char* buffer = new char[file_length+1]; -// size_t nread = fread(buffer, 1, file_length, file); -// if (nread < (size_t) file_length) -// { -// llwarns << "Short read" << llendl; -// } -// buffer[nread] = '\0'; -// fclose(file); -// mScriptEd->mEditor->setText(LLStringExplicit(buffer)); -// mScriptEd->mEditor->makePristine(); -// delete[] buffer; -// } -// else -// { -// llwarns << "Error opening " << filename << llendl; -// } -// } + bool LLLiveLSLEditor::loadScriptText(const std::string& filename) + { + if (filename.empty()) + { + llwarns << "Empty file name" << llendl; + return false; + } + + LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ + if (!file) + { + llwarns << "Error opening " << filename << llendl; + return false; + } + + // read in the whole file + fseek(file, 0L, SEEK_END); + size_t file_length = (size_t) ftell(file); + fseek(file, 0L, SEEK_SET); + char* buffer = new char[file_length+1]; + size_t nread = fread(buffer, 1, file_length, file); + if (nread < file_length) + { + llwarns << "Short read" << llendl; + } + buffer[nread] = '\0'; + fclose(file); + mScriptEd->mEditor->setText(LLStringExplicit(buffer)); + //mScriptEd->mEditor->makePristine(); + delete[] buffer; + + return true; + } void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type) { @@ -1825,9 +1890,8 @@ LLLiveLSLSaveData::LLLiveLSLSaveData(const LLUUID& id, mItem = new LLViewerInventoryItem(item); } -void LLLiveLSLEditor::saveIfNeeded() +void LLLiveLSLEditor::saveIfNeeded(bool sync) { - llinfos << "LLLiveLSLEditor::saveIfNeeded()" << llendl; LLViewerObject* object = gObjectList.findObject(mObjectUUID); if(!object) { @@ -1877,9 +1941,74 @@ void LLLiveLSLEditor::saveIfNeeded() mItem->setAssetUUID(asset_id); mItem->setTransactionID(tid); - // write out the data, and store it in the asset database + writeToFile(filename); + + if (sync) + { + // Sync with external ed2itor. + std::string tmp_file = getTmpFileName(); + llstat s; + if (LLFile::stat(tmp_file, &s) == 0) // file exists + { + if (mLiveFile) mLiveFile->ignoreNextUpdate(); + writeToFile(tmp_file); + } + } + + // save it out to asset server + std::string url = object->getRegion()->getCapability("UpdateScriptTask"); + getWindow()->incBusyCount(); + mPendingUploads++; + BOOL is_running = getChild( "running")->get(); + if (!url.empty()) + { + uploadAssetViaCaps(url, filename, mObjectUUID, mItemUUID, is_running); + } + else if (gAssetStorage) + { + uploadAssetLegacy(filename, object, tid, is_running); + } +} + +void LLLiveLSLEditor::openExternalEditor() +{ + LLViewerObject* object = gObjectList.findObject(mObjectUUID); + if(!object) + { + LLNotificationsUtil::add("SaveScriptFailObjectNotFound"); + return; + } + + delete mLiveFile; // deletes file + + // Save the script to a temporary file. + std::string filename = getTmpFileName(); + writeToFile(filename); + + // Start watching file changes. + mLiveFile = new LLLiveLSLFile(filename, this); + mLiveFile->addToEventTimer(); + + // Open it in external editor. + { + LLExternalEditor ed; + + if (!ed.setCommand("LL_SCRIPT_EDITOR")) + { + std::string msg = "Select an editor by setting the environment variable LL_SCRIPT_EDITOR " + "or the ExternalEditor setting"; // *TODO: localize + LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", msg)); + return; + } + + ed.run(filename); + } +} + +bool LLLiveLSLEditor::writeToFile(const std::string& filename) +{ LLFILE* fp = LLFile::fopen(filename, "wb"); - if(!fp) + if (!fp) { llwarns << "Unable to write to " << filename << llendl; @@ -1887,33 +2016,25 @@ void LLLiveLSLEditor::saveIfNeeded() row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?"; row["columns"][0]["font"] = "SANSSERIF_SMALL"; mScriptEd->mErrorList->addElement(row); - return; + return false; } + std::string utf8text = mScriptEd->mEditor->getText(); // Special case for a completely empty script - stuff in one space so it can store properly. See SL-46889 - if ( utf8text.size() == 0 ) + if (utf8text.size() == 0) { utf8text = " "; } fputs(utf8text.c_str(), fp); fclose(fp); - fp = NULL; - - // save it out to asset server - std::string url = object->getRegion()->getCapability("UpdateScriptTask"); - getWindow()->incBusyCount(); - mPendingUploads++; - BOOL is_running = getChild( "running")->get(); - if (!url.empty()) - { - uploadAssetViaCaps(url, filename, mObjectUUID, mItemUUID, is_running); - } - else if (gAssetStorage) - { - uploadAssetLegacy(filename, object, tid, is_running); - } + return true; +} + +std::string LLLiveLSLEditor::getTmpFileName() +{ + return std::string(LLFile::tmpdir()) + "sl_script_" + mObjectUUID.asString() + ".lsl"; } void LLLiveLSLEditor::uploadAssetViaCaps(const std::string& url, @@ -2138,6 +2259,14 @@ void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save) self->saveIfNeeded(); } + +// static +void LLLiveLSLEditor::onEdit(void* userdata) +{ + LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; + self->openExternalEditor(); +} + // static void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) { diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index f4b31e5962..d35c6b8528 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -35,6 +35,7 @@ #include "lliconctrl.h" #include "llframetimer.h" +class LLLiveLSLFile; class LLMessageSystem; class LLTextEditor; class LLButton; @@ -62,6 +63,7 @@ public: const LLHandle& floater_handle, void (*load_callback)(void* userdata), void (*save_callback)(void* userdata, BOOL close_after_save), + void (*edit_callback)(void*), void (*search_replace_callback)(void* userdata), void* userdata, S32 bottom_pad = 0); // pad below bottom row of buttons @@ -80,6 +82,8 @@ public: bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); bool handleReloadFromServerDialog(const LLSD& notification, const LLSD& response); + void onEditButtonClick(); + static void onCheckLock(LLUICtrl*, void*); static void onHelpComboCommit(LLUICtrl* ctrl, void* userdata); static void onClickBack(void* userdata); @@ -114,6 +118,7 @@ private: LLTextEditor* mEditor; void (*mLoadCallback)(void* userdata); void (*mSaveCallback)(void* userdata, BOOL close_after_save); + void (*mEditCallback)(void* userdata); void (*mSearchReplaceCallback) (void* userdata); void* mUserdata; LLComboBox *mFunctions; @@ -179,6 +184,7 @@ protected: // Used to view and edit an LSL that is attached to an object. class LLLiveLSLEditor : public LLPreview { + friend class LLLiveLSLFile; public: LLLiveLSLEditor(const LLSD& key); ~LLLiveLSLEditor(); @@ -202,7 +208,10 @@ private: virtual void loadAsset(); void loadAsset(BOOL is_new); - void saveIfNeeded(); + void saveIfNeeded(bool sync = true); + void openExternalEditor(); + std::string getTmpFileName(); + bool writeToFile(const std::string& filename); void uploadAssetViaCaps(const std::string& url, const std::string& filename, const LLUUID& task_id, @@ -218,6 +227,7 @@ private: static void onSearchReplace(void* userdata); static void onLoad(void* userdata); static void onSave(void* userdata, BOOL close_after_save); + static void onEdit(void* userdata); static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, @@ -227,7 +237,7 @@ private: static void onRunningCheckboxClicked(LLUICtrl*, void* userdata); static void onReset(void* userdata); -// void loadScriptText(const std::string& filename); // unused + bool loadScriptText(const std::string& filename); void loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type); static void onErrorList(LLUICtrl*, void* user_data); @@ -253,6 +263,7 @@ private: LLCheckBoxCtrl* mMonoCheckbox; BOOL mIsModifiable; + LLLiveLSLFile* mLiveFile; }; #endif // LL_LLPREVIEWSCRIPT_H diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml index 1e332a40c2..a041c9b229 100644 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -179,4 +179,13 @@ right="487" name="Save_btn" width="81" /> + + \ No newline at end of file -- cgit v1.2.3 From c61d89f61d0b696e6e73105ed7be7580bf1b3437 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" 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)" 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 @@ -76,7 +76,7 @@ left_delta="50" name="Maximum bandwidth" mouse_opaque="false" - top_pad="10" + top_pad="5" width="200"> Maximum bandwidth @@ -115,7 +115,7 @@ layout="topleft" left="77" name="connection_port_enabled" - top_pad="20" + top_pad="10" width="256"> Cache size @@ -239,7 +239,7 @@ layout="topleft" left="30" name="Web:" - top_pad="5" + top_pad="10" width="300"> Web: @@ -386,4 +386,20 @@ name="web_proxy_port" top_delta="0" width="145" /> + + + -- cgit v1.2.3 From 098fa21c4f812b94348c0631c29babff68968d3d Mon Sep 17 00:00:00 2001 From: brad kittenbrink 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 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); @@ -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("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("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("double_click_chkbox"); + if (!double_click_action_cb) return; + bool enable = double_click_action_cb->getValue().asBoolean(); + + LLRadioGroup* radio_double_click_action = getChild("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("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("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 @@ - - - - - - - - + top_pad="0"> + + + -- cgit v1.2.3 From c68d6c794c8f6654ad83bf56977886c8d30c599f Mon Sep 17 00:00:00 2001 From: Seth ProductEngine 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 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 dba05505ee0d5ad23cd7b2fab44271b3487b2712 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 22 Nov 2010 17:18:59 +0200 Subject: STORM-517 FIXED Warn user that language change will only take effect after restarting viewer. The warning is shown only once (until the preferences floater is reopened). --- indra/newview/llfloaterpreference.cpp | 18 ++++++++++++++++++ indra/newview/llfloaterpreference.h | 2 ++ indra/newview/skins/default/xui/en/notifications.xml | 7 +++++++ 3 files changed, 27 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ac940f4f77..6a7b5171b5 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -283,6 +283,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) : LLFloater(key), mGotPersonalInfo(false), mOriginalIMViaEmail(false), + mLanguageChanged(false), mDoubleClickActionDirty(false) { //Build Floater is now Called from LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); @@ -351,6 +352,8 @@ BOOL LLFloaterPreference::postBuild() std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); setCacheLocation(cache_location); + getChild("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); + // if floater is opened before login set default localized busy message if (LLStartUp::getStartupState() < STATE_STARTED) { @@ -570,6 +573,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) getChildView("maturity_desired_combobox")->setVisible( false); } + // Forget previous language changes. + mLanguageChanged = false; + // Display selected maturity icons. onChangeMaturity(); @@ -727,6 +733,18 @@ void LLFloaterPreference::onClickBrowserClearCache() LLNotificationsUtil::add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache); } +// Called when user changes language via the combobox. +void LLFloaterPreference::onLanguageChange() +{ + // Let the user know that the change will only take effect after restart. + // Do it only once so that we're not too irritating. + if (!mLanguageChanged) + { + LLNotificationsUtil::add("ChangeLanguage"); + mLanguageChanged = true; + } +} + void LLFloaterPreference::onClickSetCache() { std::string cur_name(gSavedSettings.getString("CacheLocation")); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 46f50d9a4d..bb871e7e25 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -83,6 +83,7 @@ protected: void onBtnApply(); void onClickBrowserClearCache(); + void onLanguageChange(); // set value of "BusyResponseChanged" in account settings depending on whether busy response // string differs from default after user changes. @@ -158,6 +159,7 @@ private: bool mDoubleClickActionDirty; bool mGotPersonalInfo; bool mOriginalIMViaEmail; + bool mLanguageChanged; bool mOriginalHideOnlineStatus; std::string mDirectoryVisibility; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9536bf2cf7..60b876d163 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -907,6 +907,13 @@ Port settings take effect after you restart [APP_NAME]. The new skin will appear after you restart [APP_NAME]. + +Changing language will take effect after you restart [APP_NAME]. + + Date: Fri, 19 Nov 2010 23:20:40 +0200 Subject: STORM-456 FIXED Removed an extra space from a Polish string. --- indra/newview/skins/default/xui/pl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index 59daa26bf0..ea8bdd75b9 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -3469,7 +3469,7 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE]. Rozmowa głosowa zakończona - Konferencja z [AGENT_NAME] + Konferencja z [AGENT_NAME] (Sesja IM wygasła) -- cgit v1.2.3 From e7e974d6c9e8b548fe2542f767c99dc27bc7cf8f Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 23 Nov 2010 20:08:50 +0200 Subject: STORM-378 FIXED Added playing snapshot animation and sound when snapshot floater is open or refreshed and a snapshot is actually taken. Removed animation upon saving and sending a snapshot. --- indra/newview/llfloaterpostcard.cpp | 4 +--- indra/newview/llfloatersnapshot.cpp | 11 ++++------- indra/newview/llviewermenufile.cpp | 2 -- 3 files changed, 5 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index e8e9f76912..220d33016a 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -361,9 +361,7 @@ void LLFloaterPostcard::sendPostcard() { gAssetStorage->storeAssetData(mTransactionID, LLAssetType::AT_IMAGE_JPEG, &uploadCallback, (void *)this, FALSE); } - - // give user feedback of the event - gViewerWindow->playSnapshotAnimAndSound(); + LLUploadDialog::modalUploadDialog(getString("upload_message")); // don't destroy the window until the upload is done diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 51ee38bd65..d55272c558 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1004,7 +1004,6 @@ void LLSnapshotLivePreview::saveTexture() LLFloaterPerms::getEveryonePerms(), "Snapshot : " + pos_string, callback, expected_upload_cost, userdata); - gViewerWindow->playSnapshotAnimAndSound(); } else { @@ -1026,10 +1025,6 @@ BOOL LLSnapshotLivePreview::saveLocal() mDataSize = 0; updateSnapshot(FALSE, FALSE); - if(success) - { - gViewerWindow->playSnapshotAnimAndSound(); - } return success; } @@ -1049,8 +1044,6 @@ void LLSnapshotLivePreview::saveWeb() LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(), boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4)); - - gViewerWindow->playSnapshotAnimAndSound(); } void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z) @@ -1540,6 +1533,8 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data) if (previewp && view) { previewp->updateSnapshot(TRUE); + + gViewerWindow->playSnapshotAnimAndSound(); } } @@ -2209,6 +2204,8 @@ void LLFloaterSnapshot::onOpen(const LLSD& key) gSnapshotFloaterView->setEnabled(TRUE); gSnapshotFloaterView->setVisible(TRUE); gSnapshotFloaterView->adjustToFitScreen(this, FALSE); + + gViewerWindow->playSnapshotAnimAndSound(); } void LLFloaterSnapshot::onClose(bool app_quitting) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 237aa39e6e..048691696b 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -404,8 +404,6 @@ class LLFileTakeSnapshotToDisk : public view_listener_t gSavedSettings.getBOOL("RenderUIInSnapshot"), FALSE)) { - gViewerWindow->playSnapshotAnimAndSound(); - LLPointer formatted; switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))) { -- cgit v1.2.3 From b12a2d2fd9fc4aaaf45ef893c86fd1d5f6d37372 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 19 Nov 2010 21:16:01 +0200 Subject: STORM-432 FIXED Disabled manual resizing of the bottom panel in the People/Friends tab. --- indra/newview/skins/default/xui/en/panel_people.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 68c423d7dd..6a8bf87bc5 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -241,6 +241,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M height="25" layout="topleft" name="options_gear_btn_panel" + user_resize="false" width="32">