diff options
Diffstat (limited to 'indra/newview')
46 files changed, 2054 insertions, 906 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f96c8fdca0..c177de6e88 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -36,6 +36,7 @@ include(UI) include(UnixInstall) include(LLKDU) include(ViewerMiscLibs) +include(LLLogin) if (WINDOWS) include(CopyWinLibs) @@ -60,6 +61,7 @@ include_directories( ${LLXML_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS} ${LSCRIPT_INCLUDE_DIRS}/lscript_compile + ${LLLOGIN_INCLUDE_DIRS} ) set(viewer_SOURCE_FILES @@ -244,6 +246,7 @@ set(viewer_SOURCE_FILES lllocationinputctrl.cpp lllogchat.cpp llloginhandler.cpp + lllogininstance.cpp llmanip.cpp llmaniprotate.cpp llmanipscale.cpp @@ -299,6 +302,7 @@ set(viewer_SOURCE_FILES llpanelpicks.cpp llpanelplace.cpp llpanelplaceinfo.cpp + llpanelshower.cpp llpanelplaces.cpp llpanelplacestab.cpp llpanelprofileview.cpp @@ -328,7 +332,6 @@ set(viewer_SOURCE_FILES llslurl.cpp llspatialpartition.cpp llsprite.cpp - llsrv.cpp llstartup.cpp llstatusbar.cpp llstylemap.cpp @@ -368,7 +371,6 @@ set(viewer_SOURCE_FILES llurlhistory.cpp llurlsimstring.cpp llurlwhitelist.cpp - lluserauth.cpp llvectorperfoptions.cpp llviewchildren.cpp llviewerassetstorage.cpp @@ -450,6 +452,7 @@ set(viewer_SOURCE_FILES llworld.cpp llworldmap.cpp llworldmapview.cpp + llxmlrpclistener.cpp llxmlrpctransaction.cpp noise.cpp pipeline.cpp @@ -659,6 +662,7 @@ set(viewer_HEADER_FILES lllocationinputctrl.h lllogchat.h llloginhandler.h + lllogininstance.h llmanip.h llmaniprotate.h llmanipscale.h @@ -714,6 +718,7 @@ set(viewer_HEADER_FILES llpanelpicks.h llpanelplace.h llpanelplaceinfo.h + llpanelshower.h llpanelplaces.h llpanelplacestab.h llpanelprofileview.h @@ -745,7 +750,6 @@ set(viewer_HEADER_FILES llslurl.h llspatialpartition.h llsprite.h - llsrv.h llstartup.h llstatusbar.h llstylemap.h @@ -787,7 +791,6 @@ set(viewer_HEADER_FILES llurlhistory.h llurlsimstring.h llurlwhitelist.h - lluserauth.h llvectorperfoptions.h llviewchildren.h llviewerassetstorage.h @@ -870,6 +873,7 @@ set(viewer_HEADER_FILES llworld.h llworldmap.h llworldmapview.h + llxmlrpclistener.h llxmlrpctransaction.h macmain.h noise.h @@ -1069,6 +1073,15 @@ file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/skins/default/xui/en/widgets/*.xml) list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST}) +file(GLOB SILVER_XUI_FILE_GLOB_LIST + ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/*.xml) +list(APPEND viewer_XUI_FILES ${SILVER_XUI_FILE_GLOB_LIST}) + +# Cannot append empty lists in CMake, wait until we have files here. +#file(GLOB SILVER_WIDGET_FILE_GLOB_LIST +# ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml) +#list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST}) + list(SORT viewer_XUI_FILES) source_group("XUI Files" FILES ${viewer_XUI_FILES}) @@ -1297,6 +1310,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${WINDOWS_LIBRARIES} ${XMLRPCEPI_LIBRARIES} ${ELFIO_LIBRARIES} + ${LLLOGIN_LIBRARIES} ${GOOGLE_PERFTOOLS_LIBRARIES} ) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d0d6a118b3..48cb3babfa 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -71,6 +71,7 @@ #include "llurlhistory.h" #include "llfirstuse.h" #include "llrender.h" +#include "llteleporthistory.h" #include "lllocationhistory.h" #include "llfasttimerview.h" #include "llweb.h" @@ -145,7 +146,6 @@ #include "llfolderview.h" #include "lltoolbar.h" #include "llagentpilot.h" -#include "llsrv.h" #include "llvovolume.h" #include "llflexibleobject.h" #include "llvosurfacepatch.h" @@ -207,9 +207,6 @@ BOOL gAllowTapTapHoldRun = TRUE; BOOL gShowObjectUpdates = FALSE; BOOL gUseQuickTime = TRUE; -BOOL gAcceptTOS = FALSE; -BOOL gAcceptCriticalMessage = FALSE; - eLastExecEvent gLastExecEvent = LAST_EXEC_NORMAL; LLSD gDebugInfo; @@ -558,9 +555,9 @@ LLAppViewer::LLAppViewer() : mYieldTime(-1), mMainloopTimeout(NULL), mAgentRegionLastAlive(false), - mFastTimerLogThread(NULL), mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)), - mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)) + mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)), + mFastTimerLogThread(NULL) { if(NULL != sInstance) { @@ -3648,6 +3645,17 @@ void LLAppViewer::idleShutdown() { return; } + + // ProductEngine: Try moving this code to where we shut down sTextureCache in cleanup() + // *TODO: ugly + static bool saved_teleport_history = false; + if (!saved_teleport_history) + { + saved_teleport_history = true; + LLTeleportHistory::getInstance()->save(); + LLLocationHistory::getInstance()->save(); // *TODO: find a better place for doing this + return; + } static bool saved_snapshot = false; if (!saved_snapshot) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 75033698b6..b23bd8cc81 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -43,6 +43,7 @@ class LLCommandLineParser; class LLAllocator; + class LLAppViewer : public LLApp { public: @@ -266,10 +267,6 @@ extern LLSD gDebugInfo; extern BOOL gAllowTapTapHoldRun; extern BOOL gShowObjectUpdates; -extern BOOL gAcceptTOS; -extern BOOL gAcceptCriticalMessage; - - typedef enum { LAST_EXEC_NORMAL = 0, diff --git a/indra/newview/llcapabilitylistener.cpp b/indra/newview/llcapabilitylistener.cpp index 3277da8930..0a41ad614e 100644 --- a/indra/newview/llcapabilitylistener.cpp +++ b/indra/newview/llcapabilitylistener.cpp @@ -90,6 +90,7 @@ bool LLCapabilityListener::capListener(const LLSD& request) // This capability is supported by the region to which we're talking. LLHTTPClient::post(url, payload, new LLSDMessage::EventResponder(LLEventPumps::instance(), + request, mProvider.getDescription(), cap, reply, error), LLSD(), // headers diff --git a/indra/newview/llclassifiedinfo.cpp b/indra/newview/llclassifiedinfo.cpp index 5cf1579d0e..5fcafbeca6 100644 --- a/indra/newview/llclassifiedinfo.cpp +++ b/indra/newview/llclassifiedinfo.cpp @@ -38,35 +38,19 @@ LLClassifiedInfo::cat_map LLClassifiedInfo::sCategories; // static -void LLClassifiedInfo::loadCategories(LLUserAuth::options_t classified_options) +void LLClassifiedInfo::loadCategories(const LLSD& options) { - LLUserAuth::options_t::iterator resp_it; - for (resp_it = classified_options.begin(); - resp_it != classified_options.end(); - ++resp_it) + for(LLSD::array_const_iterator resp_it = options.beginArray(), + end = options.endArray(); resp_it != end; ++resp_it) { - const LLUserAuth::response_t& response = *resp_it; - - LLUserAuth::response_t::const_iterator option_it; - - S32 cat_id = 0; - option_it = response.find("category_id"); - if (option_it != response.end()) + LLSD name = (*resp_it)["category_name"]; + if(name.isDefined()) { - cat_id = atoi(option_it->second.c_str()); + LLSD id = (*resp_it)["category_id"]; + if(id.isDefined()) + { + LLClassifiedInfo::sCategories[id.asInteger()] = name.asString(); + } } - else - { - continue; - } - - // Add the category id/name pair - option_it = response.find("category_name"); - if (option_it != response.end()) - { - LLClassifiedInfo::sCategories[cat_id] = option_it->second; - } - } - } diff --git a/indra/newview/llclassifiedinfo.h b/indra/newview/llclassifiedinfo.h index cc5a6bf28f..37134c7e5b 100644 --- a/indra/newview/llclassifiedinfo.h +++ b/indra/newview/llclassifiedinfo.h @@ -37,7 +37,6 @@ #include "v3dmath.h" #include "lluuid.h" -#include "lluserauth.h" class LLMessageSystem; @@ -46,7 +45,7 @@ class LLClassifiedInfo public: LLClassifiedInfo() {} - static void loadCategories(LLUserAuth::options_t event_options); + static void loadCategories(const LLSD& options); typedef std::map<U32, std::string> cat_map; static cat_map sCategories; diff --git a/indra/newview/lleventinfo.cpp b/indra/newview/lleventinfo.cpp index d4175b6c84..9be45d18fb 100644 --- a/indra/newview/lleventinfo.cpp +++ b/indra/newview/lleventinfo.cpp @@ -87,35 +87,19 @@ void LLEventInfo::unpack(LLMessageSystem *msg) } // static -void LLEventInfo::loadCategories(LLUserAuth::options_t event_options) +void LLEventInfo::loadCategories(const LLSD& options) { - LLUserAuth::options_t::iterator resp_it; - for (resp_it = event_options.begin(); - resp_it != event_options.end(); - ++resp_it) + for(LLSD::array_const_iterator resp_it = options.beginArray(), + end = options.endArray(); resp_it != end; ++resp_it) { - const LLUserAuth::response_t& response = *resp_it; - - LLUserAuth::response_t::const_iterator option_it; - - S32 cat_id = 0; - option_it = response.find("category_id"); - if (option_it != response.end()) + LLSD name = (*resp_it)["category_name"]; + if(name.isDefined()) { - cat_id = atoi(option_it->second.c_str()); + LLSD id = (*resp_it)["category_id"]; + if(id.isDefined()) + { + LLEventInfo::sCategories[id.asInteger()] = name.asString(); + } } - else - { - continue; - } - - // Add the category id/name pair - option_it = response.find("category_name"); - if (option_it != response.end()) - { - LLEventInfo::sCategories[cat_id] = option_it->second; - } - } - } diff --git a/indra/newview/lleventinfo.h b/indra/newview/lleventinfo.h index 880517a9f4..493c659983 100644 --- a/indra/newview/lleventinfo.h +++ b/indra/newview/lleventinfo.h @@ -37,7 +37,6 @@ #include "v3dmath.h" #include "lluuid.h" -#include "lluserauth.h" class LLMessageSystem; @@ -48,7 +47,7 @@ public: void unpack(LLMessageSystem *msg); - static void loadCategories(LLUserAuth::options_t event_options); + static void loadCategories(const LLSD& options); public: std::string mName; diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp index c0fe327815..e54d78de2e 100644 --- a/indra/newview/lleventnotifier.cpp +++ b/indra/newview/lleventnotifier.cpp @@ -95,18 +95,16 @@ void LLEventNotifier::update() } } -void LLEventNotifier::load(const LLUserAuth::options_t& event_options) +void LLEventNotifier::load(const LLSD& event_options) { - LLUserAuth::options_t::const_iterator resp_it; - for (resp_it = event_options.begin(); - resp_it != event_options.end(); - ++resp_it) + for(LLSD::array_const_iterator resp_it = event_options.beginArray(), + end = event_options.endArray(); resp_it != end; ++resp_it) { - const LLUserAuth::response_t& response = *resp_it; + LLSD response = *resp_it; LLEventNotification *new_enp = new LLEventNotification(); - if (!new_enp->load(response)) + if(!new_enp->load(response)) { delete new_enp; continue; @@ -207,49 +205,46 @@ bool LLEventNotification::handleResponse(const LLSD& notification, const LLSD& r return false; } -BOOL LLEventNotification::load(const LLUserAuth::response_t &response) +BOOL LLEventNotification::load(const LLSD& response) { - - LLUserAuth::response_t::const_iterator option_it; BOOL event_ok = TRUE; - option_it = response.find("event_id"); - if (option_it != response.end()) + LLSD option = response.get("event_id"); + if (option.isDefined()) { - mEventID = atoi(option_it->second.c_str()); + mEventID = option.asInteger(); } else { event_ok = FALSE; } - option_it = response.find("event_name"); - if (option_it != response.end()) + option = response.get("event_name"); + if (option.isDefined()) { - llinfos << "Event: " << option_it->second << llendl; - mEventName = option_it->second; + llinfos << "Event: " << option.asString() << llendl; + mEventName = option.asString(); } else { event_ok = FALSE; } - - option_it = response.find("event_date"); - if (option_it != response.end()) + option = response.get("event_date"); + if (option.isDefined()) { - llinfos << "EventDate: " << option_it->second << llendl; - mEventDateStr = option_it->second; + llinfos << "EventDate: " << option.asString() << llendl; + mEventDateStr = option.asString(); } else { event_ok = FALSE; } - option_it = response.find("event_date_ut"); - if (option_it != response.end()) + option = response.get("event_date_ut"); + if (option.isDefined()) { - llinfos << "EventDate: " << option_it->second << llendl; - mEventDate = strtoul(option_it->second.c_str(), NULL, 10); + llinfos << "EventDate: " << option.asString() << llendl; + mEventDate = strtoul(option.asString().c_str(), NULL, 10); } else { @@ -261,44 +256,44 @@ BOOL LLEventNotification::load(const LLUserAuth::response_t &response) S32 x_region = 0; S32 y_region = 0; - option_it = response.find("grid_x"); - if (option_it != response.end()) + option = response.get("grid_x"); + if (option.isDefined()) { - llinfos << "GridX: " << option_it->second << llendl; - grid_x= atoi(option_it->second.c_str()); + llinfos << "GridX: " << option.asInteger() << llendl; + grid_x= option.asInteger(); } else { event_ok = FALSE; } - option_it = response.find("grid_y"); - if (option_it != response.end()) + option = response.get("grid_y"); + if (option.isDefined()) { - llinfos << "GridY: " << option_it->second << llendl; - grid_y = atoi(option_it->second.c_str()); + llinfos << "GridY: " << option.asInteger() << llendl; + grid_y = option.asInteger(); } else { event_ok = FALSE; } - option_it = response.find("x_region"); - if (option_it != response.end()) + option = response.get("x_region"); + if (option.isDefined()) { - llinfos << "RegionX: " << option_it->second << llendl; - x_region = atoi(option_it->second.c_str()); + llinfos << "RegionX: " << option.asInteger() << llendl; + x_region = option.asInteger(); } else { event_ok = FALSE; } - option_it = response.find("y_region"); - if (option_it != response.end()) + option = response.get("y_region"); + if (option.isDefined()) { - llinfos << "RegionY: " << option_it->second << llendl; - y_region = atoi(option_it->second.c_str()); + llinfos << "RegionY: " << option.asInteger() << llendl; + y_region = option.asInteger(); } else { diff --git a/indra/newview/lleventnotifier.h b/indra/newview/lleventnotifier.h index feb734948c..6fdde87646 100644 --- a/indra/newview/lleventnotifier.h +++ b/indra/newview/lleventnotifier.h @@ -34,7 +34,6 @@ #define LL_LLEVENTNOTIFIER_H #include "llframetimer.h" -#include "lluserauth.h" #include "v3dmath.h" class LLEventInfo; @@ -49,7 +48,7 @@ public: void update(); // Notify the user of the event if it's coming up - void load(const LLUserAuth::options_t& event_options); // In the format that it comes in from LLUserAuth + void load(const LLSD& event_options); // In the format that it comes in from login void add(LLEventInfo &event_info); // Add a new notification for an event void remove(U32 event_id); @@ -69,7 +68,7 @@ public: LLEventNotification(); virtual ~LLEventNotification(); - BOOL load(const LLUserAuth::response_t &en); // In the format it comes in from LLUserAuth + BOOL load(const LLSD& en); // In the format it comes in from login BOOL load(const LLEventInfo &event_info); // From existing event_info on the viewer. //void setEventID(const U32 event_id); //void setEventName(std::string &event_name); diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 35613b7c34..e863be40e1 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -44,6 +44,7 @@ #include "llgl.h" #include "llsecondlifeurls.h" +#include "llappviewer.h" #include "llviewercontrol.h" #include "llworld.h" #include "lldrawpoolterrain.h" @@ -58,11 +59,6 @@ #include "lldxhardware.h" #endif -// -// externs -// -extern LLMemoryInfo gSysMemory; -extern LLCPUInfo gSysCPU; #if LL_DARWIN const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt"; diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h index 9242f00c91..9c6660c0dc 100644 --- a/indra/newview/llfloaterfriends.h +++ b/indra/newview/llfloaterfriends.h @@ -74,6 +74,9 @@ public: virtual BOOL postBuild(); + // *HACK Made public to remove friends from LLAvatarIconCtrl context menu + static bool handleRemove(const LLSD& notification, const LLSD& response); + private: enum FRIENDS_COLUMN_ORDER diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 4b29a304ac..57f4bcf319 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -35,6 +35,7 @@ #include "llfloaterinspect.h" #include "llfloaterreg.h" +#include "llfloateravatarinfo.h" #include "llfloatertools.h" #include "llfriendactions.h" #include "llcachename.h" diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 764a6a3498..c79e96a5e5 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -36,8 +36,6 @@ // viewer includes #include "llagent.h" -#include "llappviewer.h" -#include "llstartup.h" #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerwindow.h" @@ -58,11 +56,13 @@ LLFloaterTOS* LLFloaterTOS::sInstance = NULL; // static -LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) +LLFloaterTOS* LLFloaterTOS::show(ETOSType type, + const std::string & message, + const YesNoCallback& callback) { if( !LLFloaterTOS::sInstance ) { - LLFloaterTOS::sInstance = new LLFloaterTOS(type, message); + LLFloaterTOS::sInstance = new LLFloaterTOS(type, message, callback); } if (type == TOS_TOS) @@ -78,12 +78,15 @@ LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) } -LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string & message) +LLFloaterTOS::LLFloaterTOS(ETOSType type, + const std::string & message, + const YesNoCallback& callback) : LLModalDialog( std::string(" "), 100, 100 ), mType(type), mMessage(message), mWebBrowserWindowId( 0 ), - mLoadCompleteCount( 0 ) + mLoadCompleteCount( 0 ), + mCallback(callback) { } @@ -235,25 +238,12 @@ void LLFloaterTOS::onContinue( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User agrees with TOS." << llendl; - if (self->mType == TOS_TOS) - { - gAcceptTOS = TRUE; - } - else - { - gAcceptCriticalMessage = TRUE; - } - // Testing TOS dialog - #if ! LL_RELEASE_FOR_DOWNLOAD - if ( LLStartUp::getStartupState() == STATE_LOGIN_WAIT ) + if(self->mCallback) { - LLStartUp::setStartupState( STATE_LOGIN_SHOW ); + self->mCallback(true); } - else - #endif - LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication self->closeFloater(); // destroys this object } @@ -262,8 +252,12 @@ void LLFloaterTOS::onCancel( void* userdata ) { LLFloaterTOS* self = (LLFloaterTOS*) userdata; llinfos << "User disagrees with TOS." << llendl; - LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); - LLStartUp::setStartupState( STATE_LOGIN_SHOW ); + + if(self->mCallback) + { + self->mCallback(false); + } + self->mLoadCompleteCount = 0; // reset counter for next time we come to TOS self->closeFloater(); // destroys this object } diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index dbec3ff8b6..67d2f0ceec 100644 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -36,6 +36,7 @@ #include "llmodaldialog.h" #include "llassetstorage.h" #include "llwebbrowserctrl.h" +#include <boost/function.hpp> class LLButton; class LLRadioGroup; @@ -57,8 +58,12 @@ public: TOS_CRITICAL_MESSAGE = 1 }; + typedef boost::function<void(bool)> YesNoCallback; + // Asset_id is overwritten with LLUUID::null when agree is clicked. - static LLFloaterTOS* show(ETOSType type, const std::string & message); + static LLFloaterTOS* show(ETOSType type, + const std::string & message, + const YesNoCallback& callback); BOOL postBuild(); @@ -74,13 +79,16 @@ public: private: // Asset_id is overwritten with LLUUID::null when agree is clicked. - LLFloaterTOS(ETOSType type, const std::string & message); + LLFloaterTOS(ETOSType type, + const std::string & message, + const YesNoCallback& callback); private: ETOSType mType; std::string mMessage; int mWebBrowserWindowId; int mLoadCompleteCount; + YesNoCallback mCallback; static LLFloaterTOS* sInstance; }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d6569663a2..cb67fd34e5 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -40,7 +40,7 @@ #include "llerror.h" #include "llbutton.h" #include "llhttpclient.h" -#include "llsdutil.h" +#include "llsdutil_math.h" #include "llstring.h" #include "lluictrlfactory.h" diff --git a/indra/newview/llinventoryactions.h b/indra/newview/llinventoryactions.h new file mode 100644 index 0000000000..79247e3abb --- /dev/null +++ b/indra/newview/llinventoryactions.h @@ -0,0 +1,47 @@ +/** + * @file llinventoryactions.h + * @brief inventory callback functions + * class definition + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, 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_LLINVENTORYACTIONS_H +#define LL_LLINVENTORYACTIONS_H + +#include "lluictrl.h" + +class LLPanelInventory; +class LLInventoryView; +class LLInventoryPanel; + +void init_object_inventory_panel_actions(LLPanelInventory *panel, LLUICtrl::CommitCallbackRegistry::Registrar& registrar); +void init_inventory_actions(LLInventoryView *floater, LLUICtrl::CommitCallbackRegistry::Registrar& registrar); +void init_inventory_panel_actions(LLInventoryPanel *panel, LLUICtrl::CommitCallbackRegistry::Registrar& registrar); + +#endif // LL_LLINVENTORYACTIONS_H diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 3958f7e9c2..b55a6a658b 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -575,6 +575,165 @@ public: // This method is a convenience function which creates the correct // type of bridge action based on some basic information static LLInvFVBridgeAction* createAction(LLAssetType::EType asset_type, + const LLUUID& uuid,LLInventoryModel* model); + + static void doAction(LLAssetType::EType asset_type, + const LLUUID& uuid,LLInventoryModel* model); + + virtual void doIt() { }; + virtual ~LLInvFVBridgeAction(){}//need this because of warning on OSX +protected: + LLInvFVBridgeAction(const LLUUID& id,LLInventoryModel* model):mUUID(id),mModel(model){} + + LLViewerInventoryItem* getItem() const; +protected: + const LLUUID& mUUID; // item id + LLInventoryModel* mModel; + +}; + + + +class LLTextureBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLTextureBridgeAction(){} +protected: + LLTextureBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLSoundBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLSoundBridgeAction(){} +protected: + LLSoundBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLLandmarkBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLLandmarkBridgeAction(){} +protected: + LLLandmarkBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLCallingCardBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLCallingCardBridgeAction(){} +protected: + LLCallingCardBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLNotecardBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLNotecardBridgeAction(){} +protected: + LLNotecardBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLGestureBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLGestureBridgeAction(){} +protected: + LLGestureBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLAnimationBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLAnimationBridgeAction(){} +protected: + LLAnimationBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLObjectBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLObjectBridgeAction(){} +protected: + LLObjectBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLLSLTextBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt() ; + virtual ~LLLSLTextBridgeAction(){} +protected: + LLLSLTextBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + +}; + + +class LLWearableBridgeAction: public LLInvFVBridgeAction +{ + friend class LLInvFVBridgeAction; +public: + virtual void doIt(); + virtual ~LLWearableBridgeAction(){} +protected: + LLWearableBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){} + + + BOOL isInTrash() const; + // return true if the item is in agent inventory. if false, it + // must be lost or in the inventory library. + BOOL isAgentInventory() const; + + void wearOnAvatar(); + +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInvFVBridgeAction (& it's derived classes) +// +// This is an implementation class to be able to +// perform action to view inventory items. +// +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInvFVBridgeAction +{ +public: + // This method is a convenience function which creates the correct + // type of bridge action based on some basic information + static LLInvFVBridgeAction* createAction(LLAssetType::EType asset_type, const LLUUID& uuid,LLInventoryModel* model); static void doAction(LLAssetType::EType asset_type, diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 2193552f4a..0ba64d20e4 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -314,10 +314,8 @@ public: // methods to load up inventory skeleton & meat. These are used // during authentication. return true if everything parsed. - typedef std::map<std::string, std::string> response_t; - typedef std::vector<response_t> options_t; - bool loadSkeleton(const options_t& options, const LLUUID& owner_id); - bool loadMeat(const options_t& options, const LLUUID& owner_id); + bool loadSkeleton(const LLSD& options, const LLUUID& owner_id); + bool loadMeat(const LLSD& options, const LLUUID& owner_id); // This is a brute force method to rebuild the entire parent-child // relations. diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp new file mode 100644 index 0000000000..606f145d3b --- /dev/null +++ b/indra/newview/lllogininstance.cpp @@ -0,0 +1,526 @@ +/** + * @file lllogininstance.cpp + * @brief Viewer's host for a login connection. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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 "lllogininstance.h" + +// llcommon +#include "llevents.h" +#include "llmd5.h" +#include "stringize.h" + +// llmessage (!) +#include "llfiltersd2xmlrpc.h" // for xml_escape_string() + +// login +#include "lllogin.h" + +// newview +#include "llviewernetwork.h" +#include "llappviewer.h" // Wish I didn't have to, but... +#include "llviewercontrol.h" +#include "llurlsimstring.h" +#include "llfloatertos.h" +#include "llwindow.h" + +std::string construct_start_string(); + +LLLoginInstance::LLLoginInstance() : + mLoginModule(new LLLogin()), + mLoginState("offline"), + mUserInteraction(true), + mSkipOptionalUpdate(false), + mAttemptComplete(false), + mTransferRate(0.0f) +{ + mLoginModule->getEventPump().listen("lllogininstance", + boost::bind(&LLLoginInstance::handleLoginEvent, this, _1)); +} + +LLLoginInstance::~LLLoginInstance() +{ +} + + +void LLLoginInstance::connect(const LLSD& credentials) +{ + std::vector<std::string> uris; + LLViewerLogin::getInstance()->getLoginURIs(uris); + connect(uris.front(), credentials); +} + +void LLLoginInstance::connect(const std::string& uri, const LLSD& credentials) +{ + constructAuthParams(credentials); + mLoginModule->connect(uri, mRequestData); +} + +void LLLoginInstance::reconnect() +{ + // Sort of like connect, only using the pre-existing + // request params. + std::vector<std::string> uris; + LLViewerLogin::getInstance()->getLoginURIs(uris); + mLoginModule->connect(uris.front(), mRequestData); +} + +void LLLoginInstance::disconnect() +{ + mRequestData.clear(); + mLoginModule->disconnect(); +} + +LLSD LLLoginInstance::getResponse() +{ + return mResponseData; +} + +void LLLoginInstance::constructAuthParams(const LLSD& credentials) +{ + // Set up auth request options. +//#define LL_MINIMIAL_REQUESTED_OPTIONS + LLSD requested_options; + // *Note: this is where gUserAuth used to be created. + requested_options.append("inventory-root"); + requested_options.append("inventory-skeleton"); + //requested_options.append("inventory-meat"); + //requested_options.append("inventory-skel-targets"); +#if (!defined LL_MINIMIAL_REQUESTED_OPTIONS) + if(FALSE == gSavedSettings.getBOOL("NoInventoryLibrary")) + { + requested_options.append("inventory-lib-root"); + requested_options.append("inventory-lib-owner"); + requested_options.append("inventory-skel-lib"); + // requested_options.append("inventory-meat-lib"); + } + + requested_options.append("initial-outfit"); + requested_options.append("gestures"); + requested_options.append("event_categories"); + requested_options.append("event_notifications"); + requested_options.append("classified_categories"); + //requested_options.append("inventory-targets"); + requested_options.append("buddy-list"); + requested_options.append("ui-config"); +#endif + requested_options.append("tutorial_setting"); + requested_options.append("login-flags"); + requested_options.append("global-textures"); + if(gSavedSettings.getBOOL("ConnectAsGod")) + { + gSavedSettings.setBOOL("UseDebugMenus", TRUE); + requested_options.append("god-connect"); + } + + char hashed_mac_string[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ + LLMD5 hashed_mac; + hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES ); + hashed_mac.finalize(); + hashed_mac.hex_digest(hashed_mac_string); + + // prepend "$1$" to the password to indicate its the md5'd version. + std::string dpasswd("$1$"); + dpasswd.append(credentials["passwd"].asString()); + + // (re)initialize the request params with creds. + LLSD request_params(credentials); + request_params["passwd"] = dpasswd; + request_params["start"] = construct_start_string(); + request_params["skipoptional"] = mSkipOptionalUpdate; + request_params["agree_to_tos"] = false; // Always false here. Set true in + request_params["read_critical"] = false; // handleTOSResponse + request_params["last_exec_event"] = gLastExecEvent; + request_params["mac"] = hashed_mac_string; + request_params["version"] = gCurrentVersion; // Includes channel name + request_params["channel"] = gSavedSettings.getString("VersionChannelName"); + request_params["id0"] = LLAppViewer::instance()->getSerialNumber(); + + mRequestData["method"] = "login_to_simulator"; + mRequestData["params"] = request_params; + mRequestData["options"] = requested_options; +} + +bool LLLoginInstance::handleLoginEvent(const LLSD& event) +{ + std::cout << "LoginListener called!: \n"; + std::cout << event << "\n"; + + if(!(event.has("state") && event.has("progress"))) + { + llerrs << "Unknown message from LLLogin!" << llendl; + } + + mLoginState = event["state"].asString(); + mResponseData = event["data"]; + + if(event.has("transfer_rate")) + { + mTransferRate = event["transfer_rate"].asReal(); + } + + if(mLoginState == "offline") + { + handleLoginFailure(event); + } + else if(mLoginState == "online") + { + handleLoginSuccess(event); + } + + return false; +} + +bool LLLoginInstance::handleLoginFailure(const LLSD& event) +{ + // Login has failed. + // Figure out why and respond... + LLSD response = event["data"]; + std::string reason_response = response["reason"].asString(); + std::string message_response = response["message"].asString(); + if(mUserInteraction) + { + // For the cases of critical message or TOS agreement, + // start the TOS dialog. The dialog response will be handled + // by the LLLoginInstance::handleTOSResponse() callback. + // The callback intiates the login attempt next step, either + // to reconnect or to end the attempt in failure. + if(reason_response == "tos") + { + LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS, + message_response, + boost::bind(&LLLoginInstance::handleTOSResponse, + this, _1, "agree_to_tos") + ); + tos_dialog->startModal(); + } + else if(reason_response == "critical") + { + LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_CRITICAL_MESSAGE, + message_response, + boost::bind(&LLLoginInstance::handleTOSResponse, + this, _1, "read_critical") + ); + tos_dialog->startModal(); + } + else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate")) + { + gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); + updateApp(true, message_response); + } + else if(reason_response == "optional") + { + updateApp(false, message_response); + } + else + { + attemptComplete(); + } + } + else // no user interaction + { + attemptComplete(); + } + + return false; +} + +bool LLLoginInstance::handleLoginSuccess(const LLSD& event) +{ + LLSD response = event["data"]; + std::string message_response = response["message"].asString(); + if(gSavedSettings.getBOOL("ForceMandatoryUpdate")) + { + // Testing update... + gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); + // Don't confuse startup by leaving login "online". + mLoginModule->disconnect(); + updateApp(true, message_response); + } + else + { + attemptComplete(); + } + return false; +} + +void LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key) +{ + if(accepted) + { + // Set the request data to true and retry login. + mRequestData[key] = true; + reconnect(); + } + else + { + attemptComplete(); + } +} + + +void LLLoginInstance::updateApp(bool mandatory, const std::string& auth_msg) +{ + // store off config state, as we might quit soon + gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); + gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile"), TRUE); + + std::ostringstream message; + std::string msg; + if (!auth_msg.empty()) + { + msg = "(" + auth_msg + ") \n"; + } + + LLSD args; + args["MESSAGE"] = msg; + + LLSD payload; + payload["mandatory"] = mandatory; + +/* + We're constructing one of the following 6 strings here: + "DownloadWindowsMandatory" + "DownloadWindowsReleaseForDownload" + "DownloadWindows" + "DownloadMacMandatory" + "DownloadMacReleaseForDownload" + "DownloadMac" + + I've called them out explicitly in this comment so that they can be grepped for. + + Also, we assume that if we're not Windows we're Mac. If we ever intend to support + Linux with autoupdate, this should be an explicit #elif LL_DARWIN, but + we'd rather deliver the wrong message than no message, so until Linux is supported + we'll leave it alone. + */ + std::string notification_name = "Download"; + +#if LL_WINDOWS + notification_name += "Windows"; +#else + notification_name += "Mac"; +#endif + + if (mandatory) + { + notification_name += "Mandatory"; + } + else + { +#if LL_RELEASE_FOR_DOWNLOAD + notification_name += "ReleaseForDownload"; +#endif + } + + LLNotifications::instance().add(notification_name, args, payload, + boost::bind(&LLLoginInstance::updateDialogCallback, this, _1, _2)); +} + +bool LLLoginInstance::updateDialogCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + std::string update_exe_path; + bool mandatory = notification["payload"]["mandatory"].asBoolean(); + +#if !LL_RELEASE_FOR_DOWNLOAD + if (option == 2) + { + // This condition attempts to skip the + // update if using a dev build. + // The relog probably won't work if the + // update is mandatory. :) + + // *REMOVE:Mani - Saving for reference... + //LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); + mSkipOptionalUpdate = true; + reconnect(); + return false; + } +#endif + + if (option == 1) + { + // ...user doesn't want to do it + if (mandatory) + { + // Mandatory update, user chose to not to update... + // The login attemp is complete, startup should + // quit when detecting this. + attemptComplete(); + + // *REMOVE:Mani - Saving for reference... + //LLAppViewer::instance()->forceQuit(); + // // Bump them back to the login screen. + // //reset_login(); + } + else + { + // Optional update, user chose to skip + mSkipOptionalUpdate = true; + reconnect(); + } + return false; + } + + LLSD query_map = LLSD::emptyMap(); + // *TODO place os string in a global constant +#if LL_WINDOWS + query_map["os"] = "win"; +#elif LL_DARWIN + query_map["os"] = "mac"; +#elif LL_LINUX + query_map["os"] = "lnx"; +#elif LL_SOLARIS + query_map["os"] = "sol"; +#endif + // *TODO change userserver to be grid on both viewer and sim, since + // userserver no longer exists. + query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel(); + query_map["channel"] = gSavedSettings.getString("VersionChannelName"); + // *TODO constantize this guy + // *NOTE: This URL is also used in win_setup/lldownloader.cpp + LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); + + if(LLAppViewer::sUpdaterInfo) + { + delete LLAppViewer::sUpdaterInfo; + } + LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ; + +#if LL_WINDOWS + LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename(); + if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty()) + { + delete LLAppViewer::sUpdaterInfo ; + LLAppViewer::sUpdaterInfo = NULL ; + + // We're hosed, bail + LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; + + attemptComplete(); + // *REMOVE:Mani - Saving for reference... + // LLAppViewer::instance()->forceQuit(); + return false; + } + + LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe"; + + std::string updater_source = gDirUtilp->getAppRODataDir(); + updater_source += gDirUtilp->getDirDelimiter(); + updater_source += "updater.exe"; + + LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source + << " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath + << LL_ENDL; + + + if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE)) + { + delete LLAppViewer::sUpdaterInfo ; + LLAppViewer::sUpdaterInfo = NULL ; + + LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; + attemptComplete(); + // *REMOVE:Mani - Saving for reference... + // LLAppViewer::instance()->forceQuit(); + return false; + } + + // if a sim name was passed in via command line parameter (typically through a SLURL) + if ( LLURLSimString::sInstance.mSimString.length() ) + { + // record the location to start at next time + gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); + }; + + LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\""; + + LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL; + + //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. + LLAppViewer::instance()->removeMarkerFile(); // In case updater fails + + // *NOTE:Mani The updater is spawned as the last thing before the WinMain exit. + // see LLAppViewerWin32.cpp + +#elif LL_DARWIN + // if a sim name was passed in via command line parameter (typically through a SLURL) + if ( LLURLSimString::sInstance.mSimString.length() ) + { + // record the location to start at next time + gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); + }; + + LLAppViewer::sUpdaterInfo->mUpdateExePath = "'"; + LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir(); + LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; + LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString(); + LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \""; + LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle(); + LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &"; + + LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; + + // Run the auto-updater. + system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ + +#elif LL_LINUX || LL_SOLARIS + OSMessageBox(LLTrans::getString("MBNoAutoUpdate"), LLStringUtil::null, OSMB_OK); +#endif + + // *REMOVE:Mani - Saving for reference... + // LLAppViewer::instance()->forceQuit(); + + return false; +} + +std::string construct_start_string() +{ + std::string start; + if (LLURLSimString::parse()) + { + // a startup URL was specified + std::string unescaped_start = + STRINGIZE( "uri:" + << LLURLSimString::sInstance.mSimName << "&" + << LLURLSimString::sInstance.mX << "&" + << LLURLSimString::sInstance.mY << "&" + << LLURLSimString::sInstance.mZ); + start = xml_escape_string(unescaped_start); + } + else + { + start = gSavedSettings.getString("LoginLocation"); + } + return start; +} diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h new file mode 100644 index 0000000000..da70fec40e --- /dev/null +++ b/indra/newview/lllogininstance.h @@ -0,0 +1,95 @@ +/** + * @file lllogininstance.h + * @brief A host for the viewer's login connection. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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_LLLOGININSTANCE_H +#define LL_LLLOGININSTANCE_H + +#include <boost/scoped_ptr.hpp> +class LLLogin; + +// This class hosts the login module and is used to +// negotiate user authentication attempts. +class LLLoginInstance : public LLSingleton<LLLoginInstance> +{ +public: + LLLoginInstance(); + ~LLLoginInstance(); + + void connect(const LLSD& credential); // Connect to the current grid choice. + void connect(const std::string& uri, const LLSD& credential); // Connect to the given uri. + void reconnect(); // reconnect using the current credentials. + void disconnect(); + + // Set whether this class will drive user interaction. + // If not, login failures like 'need tos agreement' will + // end the login attempt. + void setUserInteraction(bool state) { mUserInteraction = state; } + bool getUserInteraction() { return mUserInteraction; } + + // Whether to tell login to skip optional update request. + // False by default. + void setSkipOptionalUpdate(bool state) { mSkipOptionalUpdate = state; } + + bool authFailure() { return mAttemptComplete && mLoginState == "offline"; } + bool authSuccess() { return mAttemptComplete && mLoginState == "online"; } + + const std::string& getLoginState() { return mLoginState; } + LLSD getResponse(const std::string& key) { return getResponse()[key]; } + LLSD getResponse(); + + // Only valid when authSuccess == true. + const F64 getLastTransferRateBPS() { return mTransferRate; } + +private: + void constructAuthParams(const LLSD& credentials); + void updateApp(bool mandatory, const std::string& message); + bool updateDialogCallback(const LLSD& notification, const LLSD& response); + + bool handleLoginEvent(const LLSD& event); + bool handleLoginFailure(const LLSD& event); + bool handleLoginSuccess(const LLSD& event); + + void handleTOSResponse(bool v, const std::string& key); + + void attemptComplete() { mAttemptComplete = true; } // In the future an event? + + boost::scoped_ptr<LLLogin> mLoginModule; + std::string mLoginState; + LLSD mRequestData; + LLSD mResponseData; + bool mUserInteraction; + bool mSkipOptionalUpdate; + bool mAttemptComplete; + F64 mTransferRate; +}; + +#endif diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 80bc2ad861..d76ddbf4d4 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -68,7 +68,6 @@ #include "llworldmap.h" #include "llfocusmgr.h" #include "llbottomtray.h" - void handle_pay_by_id(const LLUUID& agent_id) { const BOOL is_group = FALSE; diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index d4c2f4b6b2..ad385d8bdf 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -58,6 +58,7 @@ //#include "llviewermenu.h" // create_landmark() #include "llweb.h" #include "llsdutil.h" +#include "llsdutil_math.h" LLPanelPlace::LLPanelPlace() : LLPanel(), diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 93701800e9..5e89030a01 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -50,11 +50,7 @@ typedef enum { STATE_LOGIN_SHOW, // Show login screen STATE_LOGIN_WAIT, // Wait for user input at login screen STATE_LOGIN_CLEANUP, // Get rid of login screen and start login - STATE_UPDATE_CHECK, // Wait for user at a dialog box (updates, term-of-service, etc) STATE_LOGIN_AUTH_INIT, // Start login to SL servers - STATE_LOGIN_AUTHENTICATE, // Do authentication voodoo - STATE_LOGIN_NO_DATA_YET, // Waiting for authentication replies to start - STATE_LOGIN_DOWNLOADING, // Waiting for authentication replies to download STATE_LOGIN_PROCESS_RESPONSE, // Check authentication reply STATE_WORLD_INIT, // Start building the world STATE_MULTIMEDIA_INIT, // Init the rest of multimedia library @@ -75,8 +71,6 @@ typedef enum { // exported symbols extern bool gAgentMovementCompleted; extern LLPointer<LLImageGL> gStartImageGL; -extern std::string gInitialOutfit; -extern std::string gInitialOutfitGender; // "male" or "female" class LLStartUp { diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 918b15ef09..801c46035a 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -35,6 +35,8 @@ #include "llviewernetwork.h" #include "llviewercontrol.h" +#include "llevents.h" +#include "lllogin.h" struct LLGridData { @@ -155,6 +157,10 @@ LLViewerLogin::LLViewerLogin() : { } + LLViewerLogin::~LLViewerLogin() + { + } + void LLViewerLogin::setGridChoice(EGridInfo grid) { if(grid < 0 || grid >= GRID_INFO_COUNT) diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 4001ed05c1..edae6dc47b 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -34,7 +34,10 @@ #ifndef LL_LLVIEWERNETWORK_H #define LL_LLVIEWERNETWORK_H +#include <boost/scoped_ptr.hpp> + class LLHost; +class LLLogin; enum EGridInfo { @@ -74,6 +77,7 @@ class LLViewerLogin : public LLSingleton<LLViewerLogin> { public: LLViewerLogin(); + ~LLViewerLogin(); void setGridChoice(EGridInfo grid); void setGridChoice(const std::string& grid_name); diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp new file mode 100644 index 0000000000..71e2427c99 --- /dev/null +++ b/indra/newview/llxmlrpclistener.cpp @@ -0,0 +1,496 @@ +/** + * @file llxmlrpclistener.cpp + * @author Nat Goodspeed + * @date 2009-03-18 + * @brief Implementation for llxmlrpclistener. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + + +// Precompiled header +#include "llviewerprecompiledheaders.h" +// associated header +#include "llxmlrpclistener.h" +// STL headers +#include <map> +#include <set> +// std headers +// external library headers +#include <boost/scoped_ptr.hpp> +#include <boost/range.hpp> // boost::begin(), boost::end() +// other Linden headers +#include "llerror.h" +#include "stringize.h" +#include "llxmlrpctransaction.h" + +#include <xmlrpc-epi/xmlrpc.h> + +#if LL_WINDOWS +#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally +#endif + +template <typename STATUS> +class StatusMapperBase +{ + typedef std::map<STATUS, std::string> MapType; + +public: + StatusMapperBase(const std::string& desc): + mDesc(desc) + {} + + std::string lookup(STATUS status) const + { + typename MapType::const_iterator found = mMap.find(status); + if (found != mMap.end()) + { + return found->second; + } + return STRINGIZE("<unknown " << mDesc << " " << status << ">"); + } + +protected: + std::string mDesc; + MapType mMap; +}; + +class StatusMapper: public StatusMapperBase<LLXMLRPCTransaction::Status> +{ +public: + StatusMapper(): StatusMapperBase<LLXMLRPCTransaction::Status>("Status") + { + mMap[LLXMLRPCTransaction::StatusNotStarted] = "NotStarted"; + mMap[LLXMLRPCTransaction::StatusStarted] = "Started"; + mMap[LLXMLRPCTransaction::StatusDownloading] = "Downloading"; + mMap[LLXMLRPCTransaction::StatusComplete] = "Complete"; + mMap[LLXMLRPCTransaction::StatusCURLError] = "CURLError"; + mMap[LLXMLRPCTransaction::StatusXMLRPCError] = "XMLRPCError"; + mMap[LLXMLRPCTransaction::StatusOtherError] = "OtherError"; + } +}; + +static const StatusMapper sStatusMapper; + +class CURLcodeMapper: public StatusMapperBase<CURLcode> +{ +public: + CURLcodeMapper(): StatusMapperBase<CURLcode>("CURLcode") + { + // from curl.h +// skip the "CURLE_" prefix for each of these strings +#define def(sym) (mMap[sym] = #sym + 6) + def(CURLE_OK); + def(CURLE_UNSUPPORTED_PROTOCOL); /* 1 */ + def(CURLE_FAILED_INIT); /* 2 */ + def(CURLE_URL_MALFORMAT); /* 3 */ + def(CURLE_URL_MALFORMAT_USER); /* 4 - NOT USED */ + def(CURLE_COULDNT_RESOLVE_PROXY); /* 5 */ + def(CURLE_COULDNT_RESOLVE_HOST); /* 6 */ + def(CURLE_COULDNT_CONNECT); /* 7 */ + def(CURLE_FTP_WEIRD_SERVER_REPLY); /* 8 */ + def(CURLE_FTP_ACCESS_DENIED); /* 9 a service was denied by the FTP server + due to lack of access - when login fails + this is not returned. */ + def(CURLE_FTP_USER_PASSWORD_INCORRECT); /* 10 - NOT USED */ + def(CURLE_FTP_WEIRD_PASS_REPLY); /* 11 */ + def(CURLE_FTP_WEIRD_USER_REPLY); /* 12 */ + def(CURLE_FTP_WEIRD_PASV_REPLY); /* 13 */ + def(CURLE_FTP_WEIRD_227_FORMAT); /* 14 */ + def(CURLE_FTP_CANT_GET_HOST); /* 15 */ + def(CURLE_FTP_CANT_RECONNECT); /* 16 */ + def(CURLE_FTP_COULDNT_SET_BINARY); /* 17 */ + def(CURLE_PARTIAL_FILE); /* 18 */ + def(CURLE_FTP_COULDNT_RETR_FILE); /* 19 */ + def(CURLE_FTP_WRITE_ERROR); /* 20 */ + def(CURLE_FTP_QUOTE_ERROR); /* 21 */ + def(CURLE_HTTP_RETURNED_ERROR); /* 22 */ + def(CURLE_WRITE_ERROR); /* 23 */ + def(CURLE_MALFORMAT_USER); /* 24 - NOT USED */ + def(CURLE_UPLOAD_FAILED); /* 25 - failed upload "command" */ + def(CURLE_READ_ERROR); /* 26 - could open/read from file */ + def(CURLE_OUT_OF_MEMORY); /* 27 */ + /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error + instead of a memory allocation error if CURL_DOES_CONVERSIONS + is defined + */ + def(CURLE_OPERATION_TIMEOUTED); /* 28 - the timeout time was reached */ + def(CURLE_FTP_COULDNT_SET_ASCII); /* 29 - TYPE A failed */ + def(CURLE_FTP_PORT_FAILED); /* 30 - FTP PORT operation failed */ + def(CURLE_FTP_COULDNT_USE_REST); /* 31 - the REST command failed */ + def(CURLE_FTP_COULDNT_GET_SIZE); /* 32 - the SIZE command failed */ + def(CURLE_HTTP_RANGE_ERROR); /* 33 - RANGE "command" didn't work */ + def(CURLE_HTTP_POST_ERROR); /* 34 */ + def(CURLE_SSL_CONNECT_ERROR); /* 35 - wrong when connecting with SSL */ + def(CURLE_BAD_DOWNLOAD_RESUME); /* 36 - couldn't resume download */ + def(CURLE_FILE_COULDNT_READ_FILE); /* 37 */ + def(CURLE_LDAP_CANNOT_BIND); /* 38 */ + def(CURLE_LDAP_SEARCH_FAILED); /* 39 */ + def(CURLE_LIBRARY_NOT_FOUND); /* 40 */ + def(CURLE_FUNCTION_NOT_FOUND); /* 41 */ + def(CURLE_ABORTED_BY_CALLBACK); /* 42 */ + def(CURLE_BAD_FUNCTION_ARGUMENT); /* 43 */ + def(CURLE_BAD_CALLING_ORDER); /* 44 - NOT USED */ + def(CURLE_INTERFACE_FAILED); /* 45 - CURLOPT_INTERFACE failed */ + def(CURLE_BAD_PASSWORD_ENTERED); /* 46 - NOT USED */ + def(CURLE_TOO_MANY_REDIRECTS ); /* 47 - catch endless re-direct loops */ + def(CURLE_UNKNOWN_TELNET_OPTION); /* 48 - User specified an unknown option */ + def(CURLE_TELNET_OPTION_SYNTAX ); /* 49 - Malformed telnet option */ + def(CURLE_OBSOLETE); /* 50 - NOT USED */ + def(CURLE_SSL_PEER_CERTIFICATE); /* 51 - peer's certificate wasn't ok */ + def(CURLE_GOT_NOTHING); /* 52 - when this is a specific error */ + def(CURLE_SSL_ENGINE_NOTFOUND); /* 53 - SSL crypto engine not found */ + def(CURLE_SSL_ENGINE_SETFAILED); /* 54 - can not set SSL crypto engine as + default */ + def(CURLE_SEND_ERROR); /* 55 - failed sending network data */ + def(CURLE_RECV_ERROR); /* 56 - failure in receiving network data */ + def(CURLE_SHARE_IN_USE); /* 57 - share is in use */ + def(CURLE_SSL_CERTPROBLEM); /* 58 - problem with the local certificate */ + def(CURLE_SSL_CIPHER); /* 59 - couldn't use specified cipher */ + def(CURLE_SSL_CACERT); /* 60 - problem with the CA cert (path?) */ + def(CURLE_BAD_CONTENT_ENCODING); /* 61 - Unrecognized transfer encoding */ + def(CURLE_LDAP_INVALID_URL); /* 62 - Invalid LDAP URL */ + def(CURLE_FILESIZE_EXCEEDED); /* 63 - Maximum file size exceeded */ + def(CURLE_FTP_SSL_FAILED); /* 64 - Requested FTP SSL level failed */ + def(CURLE_SEND_FAIL_REWIND); /* 65 - Sending the data requires a rewind + that failed */ + def(CURLE_SSL_ENGINE_INITFAILED); /* 66 - failed to initialise ENGINE */ + def(CURLE_LOGIN_DENIED); /* 67 - user); password or similar was not + accepted and we failed to login */ + def(CURLE_TFTP_NOTFOUND); /* 68 - file not found on server */ + def(CURLE_TFTP_PERM); /* 69 - permission problem on server */ + def(CURLE_TFTP_DISKFULL); /* 70 - out of disk space on server */ + def(CURLE_TFTP_ILLEGAL); /* 71 - Illegal TFTP operation */ + def(CURLE_TFTP_UNKNOWNID); /* 72 - Unknown transfer ID */ + def(CURLE_TFTP_EXISTS); /* 73 - File already exists */ + def(CURLE_TFTP_NOSUCHUSER); /* 74 - No such user */ + def(CURLE_CONV_FAILED); /* 75 - conversion failed */ + def(CURLE_CONV_REQD); /* 76 - caller must register conversion + callbacks using curl_easy_setopt options + CURLOPT_CONV_FROM_NETWORK_FUNCTION); + CURLOPT_CONV_TO_NETWORK_FUNCTION); and + CURLOPT_CONV_FROM_UTF8_FUNCTION */ + def(CURLE_SSL_CACERT_BADFILE); /* 77 - could not load CACERT file); missing + or wrong format */ + def(CURLE_REMOTE_FILE_NOT_FOUND); /* 78 - remote file not found */ + def(CURLE_SSH); /* 79 - error from the SSH layer); somewhat + generic so the error message will be of + interest when this has happened */ + + def(CURLE_SSL_SHUTDOWN_FAILED); /* 80 - Failed to shut down the SSL + connection */ +#undef def + } +}; + +static const CURLcodeMapper sCURLcodeMapper; + +LLXMLRPCListener::LLXMLRPCListener(const std::string& pumpname): + mBoundListener(LLEventPumps::instance(). + obtain(pumpname). + listen("LLXMLRPCListener", boost::bind(&LLXMLRPCListener::process, this, _1))) +{ +} + +/** + * Capture an outstanding LLXMLRPCTransaction and poll it periodically until + * done. + * + * The sequence is: + * # Instantiate Poller, which instantiates, populates and initiates an + * LLXMLRPCTransaction. Poller self-registers on the LLEventPump named + * "mainloop". + * # "mainloop" is conventionally pumped once per frame. On each such call, + * Poller checks its LLXMLRPCTransaction for completion. + * # When the LLXMLRPCTransaction completes, Poller collects results (if any) + * and sends notification. + * # The tricky part: Poller frees itself (and thus its LLXMLRPCTransaction) + * when done. The only external reference to it is the connection to the + * "mainloop" LLEventPump. + */ +class Poller +{ +public: + /// Validate the passed request for required fields, then use it to + /// populate an XMLRPC_REQUEST and an associated LLXMLRPCTransaction. Send + /// the request. + Poller(const LLSD& command): + mReqID(command), + mUri(command["uri"]), + mMethod(command["method"]), + mReplyPump(command["reply"]) + { + // LL_ERRS if any of these are missing + const char* required[] = { "uri", "method", "reply" }; + // optional: "options" (array of string) + // Validate the request + std::set<std::string> missing; + for (const char** ri = boost::begin(required); ri != boost::end(required); ++ri) + { + // If the command does not contain this required entry, add it to 'missing'. + if (! command.has(*ri)) + { + missing.insert(*ri); + } + } + if (! missing.empty()) + { + LL_ERRS("LLXMLRPCListener") << mMethod << " request missing params: "; + const char* separator = ""; + for (std::set<std::string>::const_iterator mi(missing.begin()), mend(missing.end()); + mi != mend; ++mi) + { + LL_CONT << separator << *mi; + separator = ", "; + } + LL_CONT << LL_ENDL; + } + + // Build the XMLRPC request. + XMLRPC_REQUEST request = XMLRPC_RequestNew(); + XMLRPC_RequestSetMethodName(request, mMethod.c_str()); + XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); + XMLRPC_VALUE xparams = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); + LLSD params(command["params"]); + if (params.isMap()) + { + for (LLSD::map_const_iterator pi(params.beginMap()), pend(params.endMap()); + pi != pend; ++pi) + { + std::string name(pi->first); + LLSD param(pi->second); + if (param.isString()) + { + XMLRPC_VectorAppendString(xparams, name.c_str(), param.asString().c_str(), 0); + } + else if (param.isInteger() || param.isBoolean()) + { + XMLRPC_VectorAppendInt(xparams, name.c_str(), param.asInteger()); + } + else if (param.isReal()) + { + XMLRPC_VectorAppendDouble(xparams, name.c_str(), param.asReal()); + } + else + { + LL_ERRS("LLXMLRPCListener") << mMethod << " request param " + << name << " has unknown type: " << param << LL_ENDL; + } + } + } + LLSD options(command["options"]); + if (options.isArray()) + { + XMLRPC_VALUE xoptions = XMLRPC_CreateVector("options", xmlrpc_vector_array); + for (LLSD::array_const_iterator oi(options.beginArray()), oend(options.endArray()); + oi != oend; ++oi) + { + XMLRPC_VectorAppendString(xoptions, NULL, oi->asString().c_str(), 0); + } + XMLRPC_AddValueToVector(xparams, xoptions); + } + XMLRPC_RequestSetData(request, xparams); + + mTransaction.reset(new LLXMLRPCTransaction(mUri, request)); + mPreviousStatus = mTransaction->status(NULL); + + // Free the XMLRPC_REQUEST object and the attached data values. + XMLRPC_RequestFree(request, 1); + + // Now ensure that we get regular callbacks to poll for completion. + mBoundListener = + LLEventPumps::instance(). + obtain("mainloop"). + listen(LLEventPump::inventName(), boost::bind(&Poller::poll, this, _1)); + + LL_INFOS("LLXMLRPCListener") << mMethod << " request sent to " << mUri << LL_ENDL; + } + + /// called by "mainloop" LLEventPump + bool poll(const LLSD&) + { + bool done = mTransaction->process(); + + CURLcode curlcode; + LLXMLRPCTransaction::Status status; + { + // LLXMLRPCTransaction::status() is defined to accept int* rather + // than CURLcode*. I don't feel the urge to fix the signature, but + // we want a CURLcode rather than an int. So fetch it as a local + // int, but then assign to a CURLcode for the remainder of this + // method. + int curlint; + status = mTransaction->status(&curlint); + curlcode = CURLcode(curlint); + } + + LLSD data(mReqID.makeResponse()); + data["status"] = sStatusMapper.lookup(status); + data["errorcode"] = sCURLcodeMapper.lookup(curlcode); + data["error"] = ""; + data["transfer_rate"] = 0.0; + LLEventPump& replyPump(LLEventPumps::instance().obtain(mReplyPump)); + if (! done) + { + // Not done yet, carry on. + if (status == LLXMLRPCTransaction::StatusDownloading + && status != mPreviousStatus) + { + // If a response has been received, send the + // 'downloading' status if it hasn't been sent. + replyPump.post(data); + } + + mPreviousStatus = status; + return false; + } + + // Here the transaction is complete. Check status. + data["error"] = mTransaction->statusMessage(); + data["transfer_rate"] = mTransaction->transferRate(); + LL_INFOS("LLXMLRPCListener") << mMethod << " result from " << mUri << ": status " + << data["status"].asString() << ", errorcode " + << data["errorcode"].asString() + << " (" << data["error"].asString() << ")" + << LL_ENDL; + // In addition to CURLE_OK, LLUserAuth distinguishes different error + // values of 'curlcode': + // CURLE_COULDNT_RESOLVE_HOST, + // CURLE_SSL_PEER_CERTIFICATE, + // CURLE_SSL_CACERT, + // CURLE_SSL_CONNECT_ERROR. + // Given 'message', need we care? + if (status == LLXMLRPCTransaction::StatusComplete) + { + // Success! Parse data. + std::string status_string(data["status"]); + data["responses"] = parseResponse(status_string); + data["status"] = status_string; + } + + // whether successful or not, send reply on requested LLEventPump + replyPump.post(data); + + // Because mTransaction is a boost::scoped_ptr, deleting this object + // frees our LLXMLRPCTransaction object. + // Because mBoundListener is an LLTempBoundListener, deleting this + // object disconnects it from "mainloop". + // *** MUST BE LAST *** + delete this; + return false; + } + +private: + /// Derived from LLUserAuth::parseResponse() and parseOptionInto() + LLSD parseResponse(std::string& status_string) + { + // Extract every member into data["responses"] (a map of string + // values). + XMLRPC_REQUEST response = mTransaction->response(); + if (! response) + { + LL_DEBUGS("LLXMLRPCListener") << "No response" << LL_ENDL; + return LLSD(); + } + + XMLRPC_VALUE param = XMLRPC_RequestGetData(response); + if (! param) + { + LL_DEBUGS("LLXMLRPCListener") << "Response contains no data" << LL_ENDL; + return LLSD(); + } + + // Now, parse everything + return parseValues(status_string, "", param); + } + + /** + * Parse key/value pairs from a given XMLRPC_VALUE into an LLSD map. + * @param key_pfx Used to describe a given key in log messages. At top + * level, pass "". When parsing an options array, pass the top-level key + * name of the array plus the index of the array entry; to this we'll + * append the subkey of interest. + * @param param XMLRPC_VALUE iterator. At top level, pass + * XMLRPC_RequestGetData(XMLRPC_REQUEST). + */ + LLSD parseValues(std::string& status_string, const std::string& key_pfx, XMLRPC_VALUE param) + { + LLSD responses; + for (XMLRPC_VALUE current = XMLRPC_VectorRewind(param); current; + current = XMLRPC_VectorNext(param)) + { + std::string key(XMLRPC_GetValueID(current)); + LL_DEBUGS("LLXMLRPCListener") << "key: " << key_pfx << key << LL_ENDL; + XMLRPC_VALUE_TYPE_EASY type = XMLRPC_GetValueTypeEasy(current); + if (xmlrpc_type_string == type) + { + LLSD::String val(XMLRPC_GetValueString(current)); + LL_DEBUGS("LLXMLRPCListener") << "val: " << val << LL_ENDL; + responses.insert(key, val); + } + else if (xmlrpc_type_int == type) + { + LLSD::Integer val(XMLRPC_GetValueInt(current)); + LL_DEBUGS("LLXMLRPCListener") << "val: " << val << LL_ENDL; + responses.insert(key, val); + } + else if (xmlrpc_type_double == type) + { + LLSD::Real val(XMLRPC_GetValueDouble(current)); + LL_DEBUGS("LLXMLRPCListener") << "val: " << val << LL_ENDL; + responses.insert(key, val); + } + else if (xmlrpc_type_array == type) + { + // We expect this to be an array of submaps. Walk the array, + // recursively parsing each submap and collecting them. + LLSD array; + int i = 0; // for descriptive purposes + for (XMLRPC_VALUE row = XMLRPC_VectorRewind(current); row; + row = XMLRPC_VectorNext(current), ++i) + { + // Recursive call. For the lower-level key_pfx, if 'key' + // is "foo", pass "foo[0]:", then "foo[1]:", etc. In the + // nested call, a subkey "bar" will then be logged as + // "foo[0]:bar", and so forth. + // Parse the scalar subkey/value pairs from this array + // entry into a temp submap. Collect such submaps in 'array'. + array.append(parseValues(status_string, + STRINGIZE(key_pfx << key << '[' << i << "]:"), + row)); + } + // Having collected an 'array' of 'submap's, insert that whole + // 'array' as the value of this 'key'. + responses.insert(key, array); + } + else + { + // whoops - unrecognized type + LL_WARNS("LLXMLRPCListener") << "Unhandled xmlrpc type " << type << " for key " + << key_pfx << key << LL_ENDL; + responses.insert(key, STRINGIZE("<bad XMLRPC type " << type << '>')); + status_string = "BadType"; + } + } + return responses; + } + + const LLReqID mReqID; + const std::string mUri; + const std::string mMethod; + const std::string mReplyPump; + LLTempBoundListener mBoundListener; + boost::scoped_ptr<LLXMLRPCTransaction> mTransaction; + LLXMLRPCTransaction::Status mPreviousStatus; // To detect state changes. +}; + +bool LLXMLRPCListener::process(const LLSD& command) +{ + // Allocate a new heap Poller, but do not save a pointer to it. Poller + // will check its own status and free itself on completion of the request. + (new Poller(command)); + // conventional event listener return + return false; +} diff --git a/indra/newview/llxmlrpclistener.h b/indra/newview/llxmlrpclistener.h new file mode 100644 index 0000000000..120c2b329b --- /dev/null +++ b/indra/newview/llxmlrpclistener.h @@ -0,0 +1,35 @@ +/** + * @file llxmlrpclistener.h + * @author Nat Goodspeed + * @date 2009-03-18 + * @brief LLEventPump API for LLXMLRPCTransaction. This header doesn't + * actually define the API; the API is defined by the pump name on + * which this class listens, and by the expected content of LLSD it + * receives. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLXMLRPCLISTENER_H) +#define LL_LLXMLRPCLISTENER_H + +#include "llevents.h" + +/// Listen on an LLEventPump with specified name for LLXMLRPCTransaction +/// request events. +class LLXMLRPCListener +{ +public: + /// Specify the pump name on which to listen + LLXMLRPCListener(const std::string& pumpname); + + /// Handle request events on the event pump specified at construction time + bool process(const LLSD& command); + +private: + LLTempBoundListener mBoundListener; +}; + +#endif /* ! defined(LL_LLXMLRPCLISTENER_H) */ diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index a2fd0f0d9c..0e1beb377f 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llxmlrpctransaction.h" +#include "llxmlrpclistener.h" #include "llcurl.h" #include "llviewercontrol.h" @@ -42,6 +43,13 @@ #include "llappviewer.h" +// Static instance of LLXMLRPCListener declared here so that every time we +// bring in this code, we instantiate a listener. If we put the static +// instance of LLXMLRPCListener into llxmlrpclistener.cpp, the linker would +// simply omit llxmlrpclistener.o, and shouting on the LLEventPump would do +// nothing. +static LLXMLRPCListener listener("LLXMLRPCTransaction"); + LLXMLRPCValue LLXMLRPCValue::operator[](const char* id) const { return LLXMLRPCValue(XMLRPC_VectorGetValueWithID(mV, id)); @@ -213,6 +221,11 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri, XMLRPC_RequestSetData(request, params.getValue()); init(request, useGzip); + // DEV-28398: without this XMLRPC_RequestFree() call, it looks as though + // the 'request' object is simply leaked. It's less clear to me whether we + // should also ask to free request value data (second param 1), since the + // data come from 'params'. + XMLRPC_RequestFree(request, 1); } diff --git a/indra/newview/skins/default/xui/de/floater_snapshot.xml b/indra/newview/skins/default/xui/de/floater_snapshot.xml index 401aa74084..e94e22d9b8 100644 --- a/indra/newview/skins/default/xui/de/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/de/floater_snapshot.xml @@ -21,12 +21,12 @@ <button label="Senden" name="send_btn"/> <button label="Speichern ([AMOUNT] L$)" name="upload_btn"/> <flyout_button label="Speichern" name="save_btn" tool_tip="Bild als Datei speichern"> - <flyout_button_item name="save_item"> - Speichern - </flyout_button_item> - <flyout_button_item name="saveas_item"> - Speichern unter... - </flyout_button_item> + <flyout_button.item name="save_item"> + Speichern + </flyout_button.item> + <flyout_button.item name="saveas_item"> + Speichern unter... + </flyout_button.item> </flyout_button> <button label="Abbrechen" name="discard_btn"/> <button label="Mehr >>" name="more_btn" tool_tip="Erweiterte Optionen"/> @@ -38,75 +38,33 @@ Format </text> <combo_box label="Auflösung" name="postcard_size_combo"> - <combo_item name="CurrentWindow"> - Aktuelles Fenster - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="Custom"> - Benutzerdefiniert - </combo_item> + <combo_box.item name="CurrentWindow" label="Aktuelles Fenster" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="Custom" label="Benutzerdefiniert" /> </combo_box> <combo_box label="Auflösung" name="texture_size_combo"> - <combo_item name="CurrentWindow"> - Aktuelles Fenster - </combo_item> - <combo_item name="Small(128x128)"> - Klein (128x128) - </combo_item> - <combo_item name="Medium(256x256)"> - Mittel (256x256) - </combo_item> - <combo_item name="Large(512x512)"> - Groß (512x512) - </combo_item> - <combo_item name="Custom"> - Benutzerdefiniert - </combo_item> + <combo_box.item name="CurrentWindow" label="Aktuelles Fenster" /> + <combo_box.item name="Small(128x128)" label="Klein (128x128)" /> + <combo_box.item name="Medium(256x256)" label="Mittel (256x256)" /> + <combo_box.item name="Large(512x512)" label="Groß (512x512)" /> + <combo_box.item name="Custom" label="Benutzerdefiniert" /> </combo_box> <combo_box label="Auflösung" name="local_size_combo"> - <combo_item name="CurrentWindow"> - Aktuelles Fenster - </combo_item> - <combo_item name="320x240"> - 320x240 - </combo_item> - <combo_item name="640x480"> - 640x480 - </combo_item> - <combo_item name="800x600"> - 800x600 - </combo_item> - <combo_item name="1024x768"> - 1024x768 - </combo_item> - <combo_item name="1280x1024"> - 1280x1024 - </combo_item> - <combo_item name="1600x1200"> - 1600x1200 - </combo_item> - <combo_item name="Custom"> - Benutzerdefiniert - </combo_item> + <combo_box.item name="CurrentWindow" label="Aktuelles Fenster" /> + <combo_box.item name="320x240" label="320x240" /> + <combo_box.item name="640x480" label="640x480" /> + <combo_box.item name="800x600" label="800x600" /> + <combo_box.item name="1024x768" label="1024x768" /> + <combo_box.item name="1280x1024" label="1280x1024" /> + <combo_box.item name="1600x1200" label="1600x1200" /> + <combo_box.item name="Custom" label="Benutzerdefiniert" /> </combo_box> <combo_box label="Format" name="local_format_combo"> - <combo_item name="PNG"> - PNG - </combo_item> - <combo_item name="JPEG"> - JPEG - </combo_item> - <combo_item name="BMP"> - BMP - </combo_item> + <combo_box.item name="PNG" label="PNG" /> + <combo_box.item name="JPEG" label="JPEG" /> + <combo_box.item name="BMP" label="BMP" /> </combo_box> <spinner label="Breite" name="snapshot_width"/> <spinner label="Höhe" name="snapshot_height"/> @@ -116,15 +74,9 @@ Aufnehmen: </text> <combo_box label="Bildlayer" name="layer_types" width="132" left="73"> - <combo_item name="Colors"> - Farben - </combo_item> - <combo_item name="Depth"> - Tiefe - </combo_item> - <combo_item name="ObjectMattes"> - Objektmasken - </combo_item> + <combo_box.item name="Colors" label="Farben" /> + <combo_box.item name="Depth" label="Tiefe" /> + <combo_box.item name="ObjectMattes" label="Objektmasken" /> </combo_box> <check_box label="Interface auf Foto anzeigen" name="ui_check"/> <check_box label="HUD-Objekte auf Foto anzeigen" name="hud_check"/> diff --git a/indra/newview/skins/default/xui/de/panel_preferences_general.xml b/indra/newview/skins/default/xui/de/panel_preferences_general.xml index 40b4909e84..92b45bf5a5 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_general.xml @@ -10,15 +10,9 @@ </radio_group> <check_box label="Startposition auf Anmeldebildschirm anzeigen" name="show_location_checkbox"/> <combo_box name="fade_out_combobox"> - <combo_item name="Never"> - Nie - </combo_item> - <combo_item name="Show Temporarily"> - Temporär anzeigen - </combo_item> - <combo_item name="Always"> - Immer - </combo_item> + <combo_box.item name="Never" label="Nie" /> + <combo_box.item name="Show Temporarily" label="Temporär anzeigen" /> + <combo_box.item name="Always" label="Immer" /> </combo_box> <check_box label="Kleine Avatarnamen" name="small_avatar_names_checkbox"/> <check_box label="Meinen Namen auf meinem Bildschirm ausblenden" name="show_my_name_checkbox"/> @@ -80,49 +74,29 @@ Alterseinstufung zugreifen: <Region eingeben> </string> <combo_box name="crash_behavior_combobox" width="166"> - <combo_item name="Askbeforesending"> - Vor dem Senden fragen - </combo_item> - <combo_item name="Alwayssend"> - Immer senden - </combo_item> - <combo_item name="Neversend"> - Nie senden - </combo_item> + <combo_box.item name="Askbeforesending" label="Vor dem Senden fragen" /> + <combo_box.item name="Alwayssend" label="Immer senden" /> + <combo_box.item name="Neversend" label="Nie senden" /> </combo_box> <combo_box name="language_combobox" width="166"> - <combo_item name="System Default Language"> - Betriebssystem-Einstellung - </combo_item> - <combo_item name="English"> - English (Englisch) - </combo_item> - <combo_item name="Danish"> - Danks (Dänisch) - Beta - </combo_item> - <combo_item name="Deutsch(German)"> - Deutsch - Beta - </combo_item> - <combo_item name="Spanish"> - Español (Spanisch) - Beta - </combo_item> - <combo_item name="French"> - Français (Französisch) - Beta - </combo_item> + <combo_box.item name="System Default Language" label="Betriebssystem-Einstellung" /> + <combo_box.item name="English" label="English (Englisch)" /> + <combo_box.item name="Danish" label="Danks (Dänisch) - Beta" /> + <combo_box.item name="Deutsch(German)" label="Deutsch - Beta" /> + <combo_box.item name="Spanish" label="Español (Spanisch) - Beta" /> + <combo_box.item name="French" label="Français (Französisch) - Beta" /> + <combo_box.item name="Hungarian" label="Magyar (Ungarisch) - Beta" /> + <combo_box.item name="Polish" label="Polski (Polnisch) - Beta" /> + <combo_box.item name="Portugese" label="Português (Portugiesisch) - Beta" /> + <combo_box.item name="Chinese" label="中文 (简体) (Chinesisch) - Beta" /> + <combo_box.item name="(Japanese)" label="日本語 (Japanisch) - Beta" /> + <combo_box.item name="(Korean)" label="한국어 (Koreanisch) - Beta" /> <combo_item name="Italian"> Italiano (Italienisch) - Beta </combo_item> - <combo_item name="Hungarian"> - Magyar (Ungarisch) - Beta - </combo_item> <combo_item name="Dutch"> Nederlands (Niederländisch) - Beta </combo_item> - <combo_item name="Polish"> - Polski (Polnisch) - Beta - </combo_item> - <combo_item name="Portugese"> - Português (Portugiesisch) - Beta </combo_item> <combo_item name="Russian"> Русский (Russian) - Beta @@ -132,16 +106,6 @@ Alterseinstufung zugreifen: </combo_item> <combo_item name="Ukrainian"> Українська (Ukrainisch) - Beta - </combo_item> - <combo_item name="Chinese"> - 中文 (简体) (Chinesisch) - Beta - </combo_item> - <combo_item name="(Japanese)"> - 日本語 (Japanisch) - Beta - </combo_item> - <combo_item name="(Korean)"> - 한국어 (Koreanisch) - Beta - </combo_item> </combo_box> <check_box label="Objekten Sprache mitteilen" name="language_is_public" tool_tip="In-Welt-Objekten wird Ihre bevorzugte Spracheinstellung mitgeteilt."/> </panel> 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 767b384a2d..3e3b8df646 100644 --- a/indra/newview/skins/default/xui/es/floater_about_land.xml +++ b/indra/newview/skins/default/xui/es/floater_about_land.xml @@ -341,42 +341,18 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda. </combo_item> </combo_box> <combo_box name="land category"> - <combo_item name="AnyCategory"> - Cualquier categoría - </combo_item> - <combo_item name="LindenLocation"> - Localización Linden - </combo_item> - <combo_item name="Arts&Culture"> - Arte y Cultura - </combo_item> - <combo_item name="Business"> - Negocios - </combo_item> - <combo_item name="Educational"> - Educativo - </combo_item> - <combo_item name="Gaming"> - Juegos de azar - </combo_item> - <combo_item name="Hangout"> - Entretenimiento - </combo_item> - <combo_item name="NewcomerFriendly"> - Para recién llegados - </combo_item> - <combo_item name="Parks&Nature"> - Parques y Naturaleza - </combo_item> - <combo_item name="Residential"> - Residencial - </combo_item> - <combo_item name="Shopping"> - Compras - </combo_item> - <combo_item name="Other"> - Otra - </combo_item> + <combo_box.item name="AnyCategory" label="Cualquier categoría"/> + <combo_box.item name="LindenLocation" label="Localización Linden"/> + <combo_box.item name="Arts&Culture" label="Arte y Cultura"/> + <combo_box.item name="Business" label="Negocios"/> + <combo_box.item name="Educational" label="Educativo"/> + <combo_box.item name="Gaming" label="Juegos de azar"/> + <combo_box.item name="Hangout" label="Entretenimiento"/> + <combo_box.item name="NewcomerFriendly" label="Para recién llegados"/> + <combo_box.item name="Parks&Nature" label="Parques y Naturaleza"/> + <combo_box.item name="Residential" label="Residencial"/> + <combo_box.item name="Shopping" label="Compras"/> + <combo_box.item name="Other" label="Otra"/> </combo_box> <button label="?" label_selected="?" name="?"/> <check_box label="Contenido 'Mature'" name="MatureCheck" tool_tip=""/> @@ -408,15 +384,9 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda. Punto de teleporte: </text> <combo_box name="landing type" tool_tip="Punto de teleporte: defina cómo manejar en su terreno los teleportes."> - <combo_item length="1" name="Blocked" type="string"> - Bloqueado - </combo_item> - <combo_item length="1" name="LandingPoint" type="string"> - Punto de llegada - </combo_item> - <combo_item length="1" name="Anywhere" type="string"> - Cualquiera - </combo_item> + <combo_box.item length="1" name="Blocked" type="string" label="Bloqueado"/> + <combo_box.item length="1" name="LandingPoint" type="string" label="Punto de llegada"/> + <combo_box.item length="1" name="Anywhere" type="string" label="Cualquiera"/> </combo_box> <string name="push_restrict_text"> Sin 'empujones' @@ -497,12 +467,8 @@ música: <check_box label="Acceso permitido al grupo: [GROUP]" name="GroupCheck" tool_tip="Elija el grupo en la pestaña General."/> <check_box label="Vender pases a:" name="PassCheck" tool_tip="Permitir acceso temporal a esta parcela"/> <combo_box name="pass_combo"> - <combo_item name="Anyone"> - Cualquiera - </combo_item> - <combo_item name="Group"> - Grupo - </combo_item> + <combo_box.item name="Anyone" label="Cualquiera"/> + <combo_box.item name="Group" label="Grupo"/> </combo_box> <spinner label="Precio en L$:" name="PriceSpin"/> <spinner label="Horas de acceso:" name="HoursSpin"/> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_general.xml b/indra/newview/skins/default/xui/es/panel_preferences_general.xml index 9e5cd88603..b711821e5f 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_general.xml @@ -10,15 +10,9 @@ </radio_group> <check_box label="Ver mi posición inicial en la pantalla de inicio de sesión" name="show_location_checkbox"/> <combo_box name="fade_out_combobox" width="166"> - <combo_item name="Never"> - Nunca - </combo_item> - <combo_item name="Show Temporarily"> - Mostrarlos temporalmente - </combo_item> - <combo_item name="Always"> - Siempre - </combo_item> + <combo_box.item name="Never" label="Nunca"/> + <combo_box.item name="Show Temporarily" label="Mostrarlos temporalmente"/> + <combo_box.item name="Always" label="Siempre"/> </combo_box> <check_box label="Nombres de avatar en pequeño" name="small_avatar_names_checkbox"/> <check_box label="No ver mi nombre en mi pantalla" name="show_my_name_checkbox"/> @@ -80,49 +74,29 @@ contenido calificado: <escriba el nombre de la región> </string> <combo_box name="crash_behavior_combobox" width="166"> - <combo_item length="1" name="Askbeforesending" type="string"> - Preguntar antes de enviar - </combo_item> - <combo_item length="1" name="Alwayssend" type="string"> - Enviar siempre - </combo_item> - <combo_item length="1" name="Neversend" type="string"> - No enviar nunca - </combo_item> + <combo_box.item length="1" name="Askbeforesending" type="string" label="Preguntar antes de enviar"/> + <combo_box.item length="1" name="Alwayssend" type="string" label="Enviar siempre"/> + <combo_box.item length="1" name="Neversend" type="string" label="No enviar nunca"/> </combo_box> <combo_box name="language_combobox" width="166"> - <combo_item name="System Default Language"> - Predeterminado del sistema - </combo_item> - <combo_item length="1" name="English" type="string"> - English (Inglés) - </combo_item> - <combo_item name="Danish"> - Dansk (Danés) - Beta - </combo_item> - <combo_item length="1" name="Deutsch(German)" type="string"> - Deutsch (Alemán) - Beta - </combo_item> - <combo_item name="Spanish" type="string"> - Español - Beta - </combo_item> - <combo_item length="1" name="French" type="string"> - Français (Francés) - Beta - </combo_item> + <combo_box.item name="System Default Language" label="Predeterminado del sistema"/> + <combo_box.item length="1" name="English" type="string" label="English (Inglés)"/> + <combo_box.item name="Danish" label="Dansk (Danés) - Beta"/> + <combo_box.item length="1" name="Deutsch(German)" type="string" label="Deutsch (Alemán) - Beta"/> + <combo_box.item name="Spanish" type="string" label="Español - Beta"/> + <combo_box.item length="1" name="French" type="string" label="Français (Francés) - Beta"/> + <combo_box.item name="Hungarian" label="Magyar (Húngaro) - Beta"/> + <combo_box.item name="Polish" label="Polski (Polaco) - Beta"/> + <combo_box.item name="Portugese" label="Portugués (Portugués) - Beta"/> + <combo_box.item length="1" name="Chinese" type="string" label="中文 (简体) (Chino) - Beta"/> + <combo_box.item length="1" name="(Japanese)" type="string" label="日本語 (Japonés) - Beta"/> + <combo_box.item length="1" name="(Korean)" type="string" label="한국어 (Coreano) - Beta"/> <combo_item name="Italian"> Italiano - Beta </combo_item> - <combo_item name="Hungarian"> - Magyar (Húngaro) - Beta - </combo_item> <combo_item name="Dutch"> Nederlands (Neerlandés) - Beta </combo_item> - <combo_item name="Polish"> - Polski (Polaco) - Beta - </combo_item> - <combo_item name="Portugese"> - Portugués (Portugués) - Beta </combo_item> <combo_item name="Russian"> Русский (Ruso) - Beta @@ -132,16 +106,6 @@ contenido calificado: </combo_item> <combo_item name="Ukrainian"> Українська (Ucraniano) - Beta - </combo_item> - <combo_item length="1" name="Chinese" type="string"> - 中文 (简体) (Chino) - Beta - </combo_item> - <combo_item length="1" name="(Japanese)" type="string"> - 日本語 (Japonés) - Beta - </combo_item> - <combo_item length="1" name="(Korean)" type="string"> - 한국어 (Coreano) - Beta - </combo_item> </combo_box> <check_box label="Compartir el idioma con los objetos" name="language_is_public" tool_tip="Hace que los objetos con script del mundo sepan su idioma preferido."/> </panel> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml index 23e1e74035..7c366e8bdc 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml @@ -10,15 +10,9 @@ </radio_group> <check_box label="Afficher le lieu de départ sur l'écran de connexion" name="show_location_checkbox"/> <combo_box name="fade_out_combobox" width="166"> - <combo_item name="Never"> - Jamais - </combo_item> - <combo_item name="Show Temporarily"> - Afficher temporairement - </combo_item> - <combo_item name="Always"> - Toujours - </combo_item> + <combo_box.item name="Never" label="Jamais"/> + <combo_box.item name="Show Temporarily" label="Afficher temporairement"/> + <combo_box.item name="Always" label="Toujours"/> </combo_box> <check_box label="Nom des avatars en petit" name="small_avatar_names_checkbox"/> <check_box label="Masquer mon nom sur mon écran" name="show_my_name_checkbox"/> @@ -81,68 +75,34 @@ de sélection : <Saisissez le nom de la région> </string> <combo_box name="crash_behavior_combobox" width="166"> - <combo_item length="1" name="Askbeforesending" type="string"> - Demander avant d'envoyer - </combo_item> - <combo_item length="1" name="Alwayssend" type="string"> - Toujours envoyer - </combo_item> - <combo_item length="1" name="Neversend" type="string"> - Ne jamais envoyer - </combo_item> + <combo_box.item length="1" name="Askbeforesending" type="string" label="Demander avant d'envoyer"/> + <combo_box.item length="1" name="Alwayssend" type="string" label="Toujours envoyer"/> + <combo_box.item length="1" name="Neversend" type="string" label="Ne jamais envoyer"/> </combo_box> <combo_box name="language_combobox" width="166"> - <combo_item name="System Default Language"> - Choix par défaut - </combo_item> - <combo_item length="1" name="English" type="string"> - English (Anglais) - </combo_item> - <combo_item length="1" name="Danish" type="string"> - Dansk (Danois) - Bêta - </combo_item> - <combo_item length="1" name="Deutsch(German)" type="string"> - Deutsch (Allemand) - Bêta - </combo_item> - <combo_item name="Spanish"> - Español (Espagnol) - Bêta - </combo_item> - <combo_item name="French"> - Français - Bêta - </combo_item> + <combo_box.item name="System Default Language" label="Choix par défaut"/> + <combo_box.item length="1" name="English" type="string" label="English (Anglais)"/> + <combo_box.item length="1" name="Danish" type="string" label="Dansk (Danois) - Bêta"/> + <combo_box.item length="1" name="Deutsch(German)" type="string" label="Deutsch (Allemand) - Bêta"/> + <combo_box.item name="Spanish" label="Español (Espagnol) - Bêta"/> + <combo_box.item name="French" label="Français - Bêta"/> + <combo_box.item name="Hungarian" label="Magyar (Hongrois) - Bêta"/> + <combo_box.item name="Polish" label="Polski (Polonais) - Bêta"/> + <combo_box.item name="Portugese" label="Portugués (Portugais) - Bêta"/> + <combo_box.item name="Russian" label="Русский (Russe) - Bêta"/> + <combo_box.item name="Ukrainian" label="Українська (Ukrainien) - Bêta"/> + <combo_box.item length="1" name="Chinese" type="string" label="中文 (简体) (Chinois) - Bêta"/> + <combo_box.item length="1" name="(Japanese)" type="string" label="日本語 (Japonais) - Bêta"/> + <combo_box.item length="1" name="(Korean)" type="string" label="한국어 (Coréen) - Bêta"/> <combo_item name="Italian"> Italiano (Italien) - Bêta </combo_item> - <combo_item name="Hungarian"> - Magyar (Hongrois) - Bêta - </combo_item> <combo_item name="Dutch"> Nederlands (Néerlandais) - Bêta </combo_item> - <combo_item name="Polish"> - Polski (Polonais) - Bêta - </combo_item> - <combo_item name="Portugese"> - Portugués (Portugais) - Bêta - </combo_item> - <combo_item name="Russian"> - Русский (Russe) - Bêta </combo_item> <combo_item name="Turkish"> Türkçe (Turc) - Bêta - </combo_item> - <combo_item name="Ukrainian"> - Українська (Ukrainien) - Bêta - </combo_item> - <combo_item length="1" name="Chinese" type="string"> - 中文 (简体) (Chinois) - Bêta - </combo_item> - <combo_item length="1" name="(Japanese)" type="string"> - 日本語 (Japonais) - Bêta - </combo_item> - <combo_item length="1" name="(Korean)" type="string"> - 한국어 (Coréen) - Bêta - </combo_item> </combo_box> <check_box label="Partager la langue avec les objets" name="language_is_public" tool_tip="Cette option permet de faire connaître aux objets du Monde votre langue favorite."/> </panel> diff --git a/indra/newview/skins/default/xui/it/floater_about_land.xml b/indra/newview/skins/default/xui/it/floater_about_land.xml index e4ad34bf50..4f57067cd2 100644 --- a/indra/newview/skins/default/xui/it/floater_about_land.xml +++ b/indra/newview/skins/default/xui/it/floater_about_land.xml @@ -345,42 +345,18 @@ Solamente terreni più grandi possono essere abilitati nella ricerca. </combo_item> </combo_box> <combo_box name="land category"> - <combo_item name="AnyCategory"> - Tutte le categorie - </combo_item> - <combo_item name="LindenLocation"> - Luogo dei Linden - </combo_item> - <combo_item name="Arts&Culture"> - Arte & Cultura - </combo_item> - <combo_item name="Business"> - Affari - </combo_item> - <combo_item name="Educational"> - Educazione - </combo_item> - <combo_item name="Gaming"> - Gioco - </combo_item> - <combo_item name="Hangout"> - Divertimento - </combo_item> - <combo_item name="NewcomerFriendly"> - Accoglienza nuovi residenti - </combo_item> - <combo_item name="Parks&Nature"> - Parchi & Natura - </combo_item> - <combo_item name="Residential"> - Residenziale - </combo_item> - <combo_item name="Shopping"> - Shopping - </combo_item> - <combo_item name="Other"> - Altro - </combo_item> + <combo_box.item name="AnyCategory" label="Tutte le categorie"/> + <combo_box.item name="LindenLocation" label="Luogo dei Linden"/> + <combo_box.item name="Arts&Culture" label="Arte & Cultura"/> + <combo_box.item name="Business" label="Affari"/> + <combo_box.item name="Educational" label="Educazione"/> + <combo_box.item name="Gaming" label="Gioco"/> + <combo_box.item name="Hangout" label="Divertimento"/> + <combo_box.item name="NewcomerFriendly" label="Accoglienza nuovi residenti"/> + <combo_box.item name="Parks&Nature" label="Parchi & Natura"/> + <combo_box.item name="Residential" label="Residenziale"/> + <combo_box.item name="Shopping" label="Shopping"/> + <combo_box.item name="Other" label="Altro"/> </combo_box> <button label="?" label_selected="?" name="?"/> <check_box label="Contenuto Mature" name="MatureCheck" tool_tip=" "/> @@ -412,15 +388,9 @@ Solamente terreni più grandi possono essere abilitati nella ricerca. Rotte dei teleport: </text> <combo_box width="140" name="landing type" tool_tip="Rotte dei teleport -- seleziona come vuoi organizzare i teleport nella tua terra."> - <combo_item name="Blocked"> - Bloccati - </combo_item> - <combo_item name="LandingPoint"> - Punto di atterraggio - </combo_item> - <combo_item name="Anywhere"> - Ovunque - </combo_item> + <combo_box.item name="Blocked" label="Bloccati"/> + <combo_box.item name="LandingPoint" label="Punto di atterraggio"/> + <combo_box.item name="Anywhere" label="Ovunque"/> </combo_box> <string name="push_restrict_text"> Nessuna spinta @@ -501,12 +471,8 @@ Media: <check_box label="Permetti accesso al gruppo: [GROUP]" name="GroupCheck" tool_tip="Imposta il gruppo nel pannello generale."/> <check_box label="Vendi pass a:" name="PassCheck" tool_tip="Permetti in questo terreno l'accesso temporaneo"/> <combo_box name="pass_combo"> - <combo_item name="Anyone"> - Chiunque - </combo_item> - <combo_item name="Group"> - Gruppo - </combo_item> + <combo_box.item name="Anyone" label="Chiunque"/> + <combo_box.item name="Group" label="Gruppo"/> </combo_box> <spinner label="Prezzo in L$:" name="PriceSpin"/> <spinner label="Ore di accesso:" name="HoursSpin"/> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_general.xml b/indra/newview/skins/default/xui/it/panel_preferences_general.xml index aadd86d055..620cd33c0a 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_general.xml @@ -10,15 +10,9 @@ </radio_group> <check_box label="Mostra il punto di partenza nella schermata d'inizio" name="show_location_checkbox"/> <combo_box name="fade_out_combobox" width="166"> - <combo_item name="Never"> - Mai - </combo_item> - <combo_item name="Show Temporarily"> - Mostra temporanemente - </combo_item> - <combo_item name="Always"> - Sempre - </combo_item> + <combo_box.item name="Never" label="Mai"/> + <combo_box.item name="Show Temporarily" label="Mostra temporanemente"/> + <combo_box.item name="Always" label="Sempre"/> </combo_box> <check_box label="Nomi avatar in piccolo" name="small_avatar_names_checkbox"/> <check_box label="Nascondi il mio nome sul mio schermo" name="show_my_name_checkbox"/> @@ -80,50 +74,29 @@ contenuto di tipo: <Scrivi il nome della regione> </string> <combo_box name="crash_behavior_combobox" width="166"> - <combo_item name="Askbeforesending"> - Chiedi prima di inviare - </combo_item> - <combo_item name="Alwayssend"> - Invia sempre - </combo_item> - <combo_item name="Neversend"> - Non inviare mai - </combo_item> + <combo_box.item name="Askbeforesending" label="Chiedi prima di inviare"/> + <combo_box.item name="Alwayssend" label="Invia sempre"/> + <combo_box.item name="Neversend" label="Non inviare mai"/> </combo_box> <combo_box name="language_combobox" width="166"> - <combo_item name="System Default Language"> - Default di sistema - </combo_item> - <combo_item name="English"> - English - </combo_item> - <combo_item name="Danish"> - Dansk (Danese) - Beta - </combo_item> - <combo_item name="Deutsch(German)"> - Deutsch (Tedesco) - Beta - </combo_item> - <combo_item name="Spanish"> - Español (Spagnolo) - Beta - </combo_item> - <combo_item name="French"> - Français (Francese) - Beta - </combo_item> + <combo_box.item name="System Default Language" label="Default di sistema"/> + <combo_box.item name="English" label="English"/> + <combo_box.item name="Danish" label="Dansk (Danese) - Beta"/> + <combo_box.item name="Deutsch(German)" label="Deutsch (Tedesco) - Beta"/> + <combo_box.item name="Spanish" label="Español (Spagnolo) - Beta"/> + <combo_box.item name="French" label="Français (Francese) - Beta"/> + <combo_box.item name="Hungarian" label="Magyar (Ungherese) - Beta"/> + <combo_box.item name="Polish" label="Polski (Polacco) - Beta"/> + <combo_box.item name="Portugese" label="Portugués (Portoghese) - Beta"/> + <combo_box.item name="Chinese" label="中文 (简体) (Cinese) - Beta"/> + <combo_box.item name="(Japanese)" label="日本語 (Giapponese) - Beta"/> + <combo_box.item name="(Korean)" label="한국어 (Coreano) - Beta"/> <combo_item name="Italian"> Italiano - Beta </combo_item> - <combo_item name="Hungarian"> - Magyar (Ungherese) - Beta - </combo_item> <combo_item name="Dutch"> Nederlands (Olandese) - Beta </combo_item> - <combo_item name="Polish"> - Polski (Polacco) - Beta - </combo_item> - <combo_item name="Portugese"> - Portugués (Portoghese) - Beta - </combo_item> <combo_item name="Russian"> Русский (Russo) - Beta </combo_item> @@ -133,15 +106,6 @@ contenuto di tipo: <combo_item name="Ukrainian"> Українська (Ukraino) - Beta </combo_item> - <combo_item name="Chinese"> - 中文 (简体) (Cinese) - Beta - </combo_item> - <combo_item name="(Japanese)"> - 日本語 (Giapponese) - Beta - </combo_item> - <combo_item name="(Korean)"> - 한국어 (Coreano) - Beta - </combo_item> </combo_box> <check_box label="Condividi la tua lingua con gli oggetti" name="language_is_public" tool_tip="Questo fa in modo che gli oggetti inworld riconoscano la tua lingua."/> </panel> diff --git a/indra/newview/skins/default/xui/ja/floater_about_land.xml b/indra/newview/skins/default/xui/ja/floater_about_land.xml index c8195d8f38..26c8a46270 100644 --- a/indra/newview/skins/default/xui/ja/floater_about_land.xml +++ b/indra/newview/skins/default/xui/ja/floater_about_land.xml @@ -345,42 +345,18 @@ </combo_item> </combo_box> <combo_box name="land category"> - <combo_item name="AnyCategory"> - 全カテゴリー - </combo_item> - <combo_item name="LindenLocation"> - Linden所在地 - </combo_item> - <combo_item name="Arts&Culture"> - アート&カルチャー - </combo_item> - <combo_item name="Business"> - ビジネス - </combo_item> - <combo_item name="Educational"> - 教育的 - </combo_item> - <combo_item name="Gaming"> - ゲーム - </combo_item> - <combo_item name="Hangout"> - たまり場 - </combo_item> - <combo_item name="NewcomerFriendly"> - 新住人に好意的 - </combo_item> - <combo_item name="Parks&Nature"> - 公園と自然 - </combo_item> - <combo_item name="Residential"> - 住宅用 - </combo_item> - <combo_item name="Shopping"> - ショッピング - </combo_item> - <combo_item name="Other"> - その他 - </combo_item> + <combo_box.item name="AnyCategory" label="全カテゴリー"/> + <combo_box.item name="LindenLocation" label="Linden所在地"/> + <combo_box.item name="Arts&Culture" label="アート&カルチャー"/> + <combo_box.item name="Business" label="ビジネス"/> + <combo_box.item name="Educational" label="教育的"/> + <combo_box.item name="Gaming" label="ゲーム"/> + <combo_box.item name="Hangout" label="たまり場"/> + <combo_box.item name="NewcomerFriendly" label="新住人に好意的"/> + <combo_box.item name="Parks&Nature" label="公園と自然"/> + <combo_box.item name="Residential" label="住宅用"/> + <combo_box.item name="Shopping" label="ショッピング"/> + <combo_box.item name="Other" label="その他"/> </combo_box> <button label="?" label_selected="?" name="?"/> <check_box label="Matureコンテンツ" name="MatureCheck" tool_tip=""/> @@ -412,15 +388,9 @@ テレポート制限: </text> <combo_box name="landing type" tool_tip="Teleport Routing -- select how to handle teleports onto your land."> - <combo_item length="1" name="Blocked" type="string"> - 不可 - </combo_item> - <combo_item length="1" name="LandingPoint" type="string"> - 着地点 - </combo_item> - <combo_item length="1" name="Anywhere" type="string"> - どこでも - </combo_item> + <combo_box.item length="1" name="Blocked" type="string" label="不可"/> + <combo_box.item length="1" name="LandingPoint" type="string" label="着地点"/> + <combo_box.item length="1" name="Anywhere" type="string" label="どこでも"/> </combo_box> <string name="push_restrict_text"> プッシングを制限 @@ -499,12 +469,8 @@ <check_box label="グループ・アクセスを許可:[GROUP]" name="GroupCheck" tool_tip="[一般]タブで、グループを選択してください。"/> <check_box label="入場許可を販売:" name="PassCheck" tool_tip="この区画への一時的なアクセスを許可"/> <combo_box name="pass_combo"> - <combo_item name="Anyone"> - 誰でも - </combo_item> - <combo_item name="Group"> - グループ - </combo_item> + <combo_box.item name="Anyone" label="誰でも"/> + <combo_box.item name="Group" label="グループ"/> </combo_box> <spinner label="価格(L$):" name="PriceSpin"/> <spinner label="アクセス時間:" name="HoursSpin"/> diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml index 83b21b87d2..3e3d62640f 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml @@ -10,15 +10,9 @@ </radio_group> <check_box label="ログイン画面にログイン位置を表示" name="show_location_checkbox"/> <combo_box name="fade_out_combobox"> - <combo_item name="Never"> - なし - </combo_item> - <combo_item name="Show Temporarily"> - 一時的に表示 - </combo_item> - <combo_item name="Always"> - いつも - </combo_item> + <combo_box.item name="Never" label="なし"/> + <combo_box.item name="Show Temporarily" label="一時的に表示"/> + <combo_box.item name="Always" label="いつも"/> </combo_box> <check_box label="小さなアバター名" name="small_avatar_names_checkbox"/> <check_box label="画面上で自分の名前を隠す" name="show_my_name_checkbox"/> @@ -79,68 +73,34 @@ <地域の名前入力> </string> <combo_box name="crash_behavior_combobox"> - <combo_item length="1" name="Askbeforesending" type="string"> - 送る前に確認する - </combo_item> - <combo_item length="1" name="Alwayssend" type="string"> - 常に送信 - </combo_item> - <combo_item length="1" name="Neversend" type="string"> - 送信しない - </combo_item> + <combo_box.item length="1" name="Askbeforesending" type="string" label="送る前に確認する"/> + <combo_box.item length="1" name="Alwayssend" type="string" label="常に送信"/> + <combo_box.item length="1" name="Neversend" type="string" label="送信しない"/> </combo_box> <combo_box name="language_combobox"> - <combo_item length="1" name="System Default Language" type="string"> - システム・デフォルト - </combo_item> - <combo_item length="1" name="English" type="string"> - English (英語) - </combo_item> - <combo_item length="1" name="Danish" type="string"> - Dansk (デンマーク語) – ベータ - </combo_item> - <combo_item length="1" name="Deutsch(German)" type="string"> - Deutsch (ドイツ語) – ベータ - </combo_item> - <combo_item length="1" name="Spanish" type="string"> - Español (スペイン語) – ベータ - </combo_item> - <combo_item length="1" name="French" type="string"> - Français (フランス語) – ベータ - </combo_item> + <combo_box.item length="1" name="System Default Language" type="string" label="システム・デフォルト"/> + <combo_box.item length="1" name="English" type="string" label="English (英語)"/> + <combo_box.item length="1" name="Danish" type="string" label="Dansk (デンマーク語) – ベータ"/> + <combo_box.item length="1" name="Deutsch(German)" type="string" label="Deutsch (ドイツ語) – ベータ"/> + <combo_box.item length="1" name="Spanish" type="string" label="Español (スペイン語) – ベータ"/> + <combo_box.item length="1" name="French" type="string" label="Français (フランス語) – ベータ"/> + <combo_box.item name="Hungarian" label="Magyar (ハンガリー語) - ベータ"/> + <combo_box.item name="Polish" label="Polski (ポーランド語) - ベータ"/> + <combo_box.item length="1" name="Portugese" type="string" label="Português (ポルトガル語) – ベータ"/> + <combo_box.item name="Russian" label="Русский (ロシア語) - ベータ"/> + <combo_box.item name="Ukrainian" label="Українська (ウクライナ語) - ベータ"/> + <combo_box.item length="1" name="Chinese" type="string" label="中文 (简体) (中国語) - ベータ"/> + <combo_box.item length="1" name="(Japanese)" type="string" label="日本語 – ベータ"/> + <combo_box.item length="1" name="(Korean)" type="string" label="한국어 (韓国語) – ベータ"/> <combo_item name="Italian"> Italiano (イタリア語) - ベータ </combo_item> - <combo_item name="Hungarian"> - Magyar (ハンガリー語) - ベータ - </combo_item> <combo_item name="Dutch"> Nederlands (オランダ語) - ベータ </combo_item> - <combo_item name="Polish"> - Polski (ポーランド語) - ベータ - </combo_item> - <combo_item length="1" name="Portugese" type="string"> - Português (ポルトガル語) – ベータ - </combo_item> - <combo_item name="Russian"> - Русский (ロシア語) - ベータ </combo_item> <combo_item name="Turkish"> Türkçe (トルコ語) - ベータ - </combo_item> - <combo_item name="Ukrainian"> - Українська (ウクライナ語) - ベータ - </combo_item> - <combo_item length="1" name="Chinese" type="string"> - 中文 (简体) (中国語) - ベータ - </combo_item> - <combo_item length="1" name="(Japanese)" type="string"> - 日本語 – ベータ - </combo_item> - <combo_item length="1" name="(Korean)" type="string"> - 한국어 (韓国語) – ベータ - </combo_item> </combo_box> <check_box label="言語をオブジェクトと共有" name="language_is_public" tool_tip="優先言語をインワールドのオブジェクトが認識する"/> </panel> diff --git a/indra/newview/skins/default/xui/nl/floater_about_land.xml b/indra/newview/skins/default/xui/nl/floater_about_land.xml index a3e3b246fe..44c2ebccf7 100644 --- a/indra/newview/skins/default/xui/nl/floater_about_land.xml +++ b/indra/newview/skins/default/xui/nl/floater_about_land.xml @@ -343,42 +343,18 @@ of opgedeeld. </combo_item> </combo_box> <combo_box name="land category"> - <combo_item name="AnyCategory"> - Alle categorieën - </combo_item> - <combo_item name="LindenLocation"> - Linden Locatie - </combo_item> - <combo_item name="Arts&Culture"> - Kunst & Cultuur - </combo_item> - <combo_item name="Business"> - Zakelijk - </combo_item> - <combo_item name="Educational"> - Educatief - </combo_item> - <combo_item name="Gaming"> - Spelen - </combo_item> - <combo_item name="Hangout"> - Ontmoetingsplaats - </combo_item> - <combo_item name="NewcomerFriendly"> - Nieuwkomervriendelijk - </combo_item> - <combo_item name="Parks&Nature"> - Parken & Natuur - </combo_item> - <combo_item name="Residential"> - Woongebied - </combo_item> - <combo_item name="Shopping"> - Winkelen - </combo_item> - <combo_item name="Other"> - Anders - </combo_item> + <combo_box.item name="AnyCategory" label="Alle categorieën"/> + <combo_box.item name="LindenLocation" label="Linden Locatie"/> + <combo_box.item name="Arts&Culture" label="Kunst & Cultuur"/> + <combo_box.item name="Business" label="Zakelijk"/> + <combo_box.item name="Educational" label="Educatief"/> + <combo_box.item name="Gaming" label="Spelen"/> + <combo_box.item name="Hangout" label="Ontmoetingsplaats"/> + <combo_box.item name="NewcomerFriendly" label="Nieuwkomervriendelijk"/> + <combo_box.item name="Parks&Nature" label="Parken & Natuur"/> + <combo_box.item name="Residential" label="Woongebied"/> + <combo_box.item name="Shopping" label="Winkelen"/> + <combo_box.item name="Other" label="Anders"/> </combo_box> <button label="?" label_selected="?" name="?"/> <check_box label="Mature inhoud" name="MatureCheck" tool_tip=" "/> @@ -410,15 +386,9 @@ of opgedeeld. Teleport routering: </text> <combo_box name="landing type" tool_tip="Teleport routering -- selecteer hoe teleports naar uw land moeten worden afgehandeld."> - <combo_item name="Blocked"> - Geblokkeerd - </combo_item> - <combo_item name="LandingPoint"> - Landingsplaats - </combo_item> - <combo_item name="Anywhere"> - Overal - </combo_item> + <combo_box.item name="Blocked" label="Geblokkeerd"/> + <combo_box.item name="LandingPoint" label="Landingsplaats"/> + <combo_box.item name="Anywhere" label="Overal"/> </combo_box> <string name="push_restrict_text"> Niet duwen @@ -496,12 +466,8 @@ hebt geklikt.) <check_box label="Groepstoegang toestaan: [GROUP]" name="GroupCheck" tool_tip="Stel de groep in op het tabblad Algemeen"/> <check_box label="Verkoop toegangspassen aan:" name="PassCheck" tool_tip="Tijdelijke toegang tot dit perceel toestaan"/> <combo_box name="pass_combo" left_delta="190"> - <combo_item name="Anyone"> - Iedereen - </combo_item> - <combo_item name="Group"> - Groep - </combo_item> + <combo_box.item name="Anyone" label="Iedereen"/> + <combo_box.item name="Group" label="Groep"/> </combo_box> <spinner label="Prijs in L$:" name="PriceSpin" label_width="168" width="228" /> <spinner label="Toegangsuren" name="HoursSpin" label_width="168" width="228" /> diff --git a/indra/newview/skins/default/xui/pl/floater_about_land.xml b/indra/newview/skins/default/xui/pl/floater_about_land.xml index 5f4bf4ece6..7612212105 100755 --- a/indra/newview/skins/default/xui/pl/floater_about_land.xml +++ b/indra/newview/skins/default/xui/pl/floater_about_land.xml @@ -343,42 +343,18 @@ Jedynie większe posiadłości mogą być umieszczone w bazie wyszukiwarki. </combo_item> </combo_box> <combo_box name="land category"> - <combo_item name="AnyCategory"> - Każda - </combo_item> - <combo_item name="LindenLocation"> - Linden Lokacja - </combo_item> - <combo_item name="Arts&Culture"> - Sztuka i Kultura - </combo_item> - <combo_item name="Business"> - Biznes - </combo_item> - <combo_item name="Educational"> - Edukacyjna - </combo_item> - <combo_item name="Gaming"> - Gra - </combo_item> - <combo_item name="Hangout"> - Poznawanie ludzi - </combo_item> - <combo_item name="NewcomerFriendly"> - Przyjazna dla nowych - </combo_item> - <combo_item name="Parks&Nature"> - Parki i Natura - </combo_item> - <combo_item name="Residential"> - Mieszkalna - </combo_item> - <combo_item name="Shopping"> - Komercja/Sklepy - </combo_item> - <combo_item name="Other"> - Inna - </combo_item> + <combo_box.item name="AnyCategory" label="Każda"/> + <combo_box.item name="LindenLocation" label="Linden Lokacja"/> + <combo_box.item name="Arts&Culture" label="Sztuka i Kultura"/> + <combo_box.item name="Business" label="Biznes"/> + <combo_box.item name="Educational" label="Edukacyjna"/> + <combo_box.item name="Gaming" label="Gra"/> + <combo_box.item name="Hangout" label="Poznawanie ludzi"/> + <combo_box.item name="NewcomerFriendly" label="Przyjazna dla nowych"/> + <combo_box.item name="Parks&Nature" label="Parki i Natura"/> + <combo_box.item name="Residential" label="Mieszkalna"/> + <combo_box.item name="Shopping" label="Komercja/Sklepy"/> + <combo_box.item name="Other" label="Inna"/> </combo_box> <button label="?" label_selected="?" name="?"/> <check_box label="Treść 'Mature'" name="MatureCheck" tool_tip=""/> @@ -410,15 +386,9 @@ Jedynie większe posiadłości mogą być umieszczone w bazie wyszukiwarki. Trasa Teleportacji: </text> <combo_box name="landing type" tool_tip="Trasa Teleportacj-ustaw w jaki sposób będzie sę odbywać proces telportacji w posiadłości."> - <combo_item length="1" name="Blocked" type="string"> - Zablokowana - </combo_item> - <combo_item length="1" name="LandingPoint" type="string"> - Punkt Lądowania - </combo_item> - <combo_item length="1" name="Anywhere" type="string"> - Gdziekolwiek - </combo_item> + <combo_box.item length="1" name="Blocked" type="string" label="Zablokowana"/> + <combo_box.item length="1" name="LandingPoint" type="string" label="Punkt Lądowania"/> + <combo_box.item length="1" name="Anywhere" type="string" label="Gdziekolwiek"/> </combo_box> <string name="push_restrict_text"> Popychanie niedozwolone @@ -497,12 +467,8 @@ Mediów: <check_box label="Udostępnij wejście grupie: [GROUP]" name="GroupCheck" tool_tip="Ustaw grupę w głównej zakładce"/> <check_box label="Sprzedaj wejściówki:" name="PassCheck" tool_tip="Otwórz tymczasowy dostęp do tej posiadłości"/> <combo_box name="pass_combo"> - <combo_item name="Anyone"> - Każdemu - </combo_item> - <combo_item name="Group"> - Grupie - </combo_item> + <combo_box.item name="Anyone" label="Każdemu"/> + <combo_box.item name="Group" label="Grupie"/> </combo_box> <spinner label="Cena w L$:" name="PriceSpin"/> <spinner label="Ilość godzin dostępu:" name="HoursSpin"/> diff --git a/indra/newview/skins/default/xui/pt/floater_about_land.xml b/indra/newview/skins/default/xui/pt/floater_about_land.xml index 4426378075..fee7ed60f5 100644 --- a/indra/newview/skins/default/xui/pt/floater_about_land.xml +++ b/indra/newview/skins/default/xui/pt/floater_about_land.xml @@ -343,42 +343,18 @@ Apenas lotes maiores podem ser listados na busca. </combo_item> </combo_box> <combo_box left="276" name="land category" width="146"> - <combo_item name="AnyCategory"> - Qualquer Categoria - </combo_item> - <combo_item name="LindenLocation"> - Locação Linden - </combo_item> - <combo_item name="Arts&Culture"> - Artes e Cultura - </combo_item> - <combo_item name="Business"> - Negócios - </combo_item> - <combo_item name="Educational"> - Educacional - </combo_item> - <combo_item name="Gaming"> - Jogo - </combo_item> - <combo_item name="Hangout"> - Lazer - </combo_item> - <combo_item name="NewcomerFriendly"> - Amigável para novatos - </combo_item> - <combo_item name="Parks&Nature"> - Parques e Natureza - </combo_item> - <combo_item name="Residential"> - Residencial - </combo_item> - <combo_item name="Shopping"> - Compras - </combo_item> - <combo_item name="Other"> - Outros - </combo_item> + <combo_box.item name="AnyCategory" label="Qualquer Categoria"/> + <combo_box.item name="LindenLocation" label="Locação Linden"/> + <combo_box.item name="Arts&Culture" label="Artes e Cultura"/> + <combo_box.item name="Business" label="Negócios"/> + <combo_box.item name="Educational" label="Educacional"/> + <combo_box.item name="Gaming" label="Jogo"/> + <combo_box.item name="Hangout" label="Lazer"/> + <combo_box.item name="NewcomerFriendly" label="Amigável para novatos"/> + <combo_box.item name="Parks&Nature" label="Parques e Natureza"/> + <combo_box.item name="Residential" label="Residencial"/> + <combo_box.item name="Shopping" label="Compras"/> + <combo_box.item name="Other" label="Outros"/> </combo_box> <button label="?" label_selected="?" left="426" name="?"/> <check_box label="Conteúdo Mature" name="MatureCheck" tool_tip=""/> @@ -410,15 +386,9 @@ Apenas lotes maiores podem ser listados na busca. Rota de Tele-transporte: </text> <combo_box left="140" name="landing type" tool_tip="Rota de Teletransporte -- Selecione como tratar os tele-transportes no seu lote." width="140"> - <combo_item length="1" name="Blocked" type="string"> - Bloqueado - </combo_item> - <combo_item length="1" name="LandingPoint" type="string"> - Ponto de Aterrissagem - </combo_item> - <combo_item length="1" name="Anywhere" type="string"> - Qualquer lugar - </combo_item> + <combo_box.item length="1" name="Blocked" type="string" label="Bloqueado"/> + <combo_box.item length="1" name="LandingPoint" type="string" label="Ponto de Aterrissagem"/> + <combo_box.item length="1" name="Anywhere" type="string" label="Qualquer lugar"/> </combo_box> <string name="push_restrict_text"> Sem Empurrar @@ -499,12 +469,8 @@ Mídia: <check_box label="Permitir Acesso do Grupo: [GROUP]" name="GroupCheck" tool_tip="Definir grupo na aba Geral."/> <check_box label="Vender passes para:" name="PassCheck" tool_tip="Permite acesso temporário a este terreno"/> <combo_box name="pass_combo"> - <combo_item name="Anyone"> - Qualquer um - </combo_item> - <combo_item name="Group"> - Grupo - </combo_item> + <combo_box.item name="Anyone" label="Qualquer um"/> + <combo_box.item name="Group" label="Grupo"/> </combo_box> <spinner label="Preço em L$:" name="PriceSpin"/> <spinner label="Horas de Acesso:" name="HoursSpin"/> diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml index fde3551b8b..d82330cc78 100644 --- a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml @@ -10,15 +10,9 @@ </radio_group> <check_box label="Mostrar Posição Inicial na Tela de Login" name="show_location_checkbox"/> <combo_box name="fade_out_combobox" width="166"> - <combo_item name="Never"> - Nunca - </combo_item> - <combo_item name="Show Temporarily"> - Mostrar Temporariamente - </combo_item> - <combo_item name="Always"> - Sempre - </combo_item> + <combo_box.item name="Never" label="Nunca"/> + <combo_box.item name="Show Temporarily" label="Mostrar Temporariamente"/> + <combo_box.item name="Always" label="Sempre"/> </combo_box> <check_box label="Avatar com Nomes Pequenos" name="small_avatar_names_checkbox"/> <check_box label="Ocultar meu Nome na minha Tela" name="show_my_name_checkbox"/> @@ -80,49 +74,29 @@ conteúdo classificado: Digite o nome da Região </string> <combo_box name="crash_behavior_combobox" width="166"> - <combo_item length="1" name="Askbeforesending" type="string"> - Perguntar antes de enviar - </combo_item> - <combo_item length="1" name="Alwayssend" type="string"> - Sempre enviar - </combo_item> - <combo_item length="1" name="Neversend" type="string"> - Nunca Enviar - </combo_item> + <combo_box.item length="1" name="Askbeforesending" type="string" label="Perguntar antes de enviar"/> + <combo_box.item length="1" name="Alwayssend" type="string" label="Sempre enviar"/> + <combo_box.item length="1" name="Neversend" type="string" label="Nunca Enviar"/> </combo_box> <combo_box name="language_combobox" width="166"> - <combo_item name="System Default Language"> - Padrão do Sistema - </combo_item> - <combo_item name="English"> - English (Inglês) - </combo_item> - <combo_item name="Danish"> - Dansk (Dinamarquês) - Beta - </combo_item> - <combo_item name="Deutsch(German)"> - Deutsch (Alemão) - Beta - </combo_item> - <combo_item name="Spanish"> - Español (Espanhol) - Beta - </combo_item> - <combo_item name="French"> - Français (Francês) - Beta - </combo_item> + <combo_box.item name="System Default Language" label="Padrão do Sistema"/> + <combo_box.item name="English" label="English (Inglês)"/> + <combo_box.item name="Danish" label="Dansk (Dinamarquês) - Beta"/> + <combo_box.item name="Deutsch(German)" label="Deutsch (Alemão) - Beta"/> + <combo_box.item name="Spanish" label="Español (Espanhol) - Beta"/> + <combo_box.item name="French" label="Français (Francês) - Beta"/> + <combo_box.item name="Hungarian" label="Magyar (Húngaro) - Beta"/> + <combo_box.item name="Polish" label="Polski (Polonês) - Beta"/> + <combo_box.item name="Portugese" label="Português - Beta"/> + <combo_box.item name="Chinese" label="中文 (简体) (Chinês) - Beta"/> + <combo_box.item name="(Japanese)" label="日本語 (Japonês) - Beta"/> + <combo_box.item name="(Korean)" label="한국어 (Coreano) - Beta"/> <combo_item name="Italian"> Italiano - Beta </combo_item> - <combo_item name="Hungarian"> - Magyar (Húngaro) - Beta - </combo_item> <combo_item name="Dutch"> Nederlands (Holandês) - Beta </combo_item> - <combo_item name="Polish"> - Polski (Polonês) - Beta - </combo_item> - <combo_item name="Portugese"> - Português - Beta </combo_item> <combo_item name="Russian"> Русский (Russo) - Beta @@ -132,16 +106,6 @@ conteúdo classificado: </combo_item> <combo_item name="Ukrainian"> Українська (Ucraniano) - Beta - </combo_item> - <combo_item name="Chinese"> - 中文 (简体) (Chinês) - Beta - </combo_item> - <combo_item name="(Japanese)"> - 日本語 (Japonês) - Beta - </combo_item> - <combo_item name="(Korean)"> - 한국어 (Coreano) - Beta - </combo_item> </combo_box> <check_box label="Compartilhar a linguagem com objetos" name="language_is_public" tool_tip="Isto permite que os objetos no mundo conheçam sua linguagem preferida."/> </panel> diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index 42872d85fb..e08193f785 100644 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -29,6 +29,8 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ + +#include "linden_common.h" #include "../test/lltut.h" #include "../llagentaccess.h" diff --git a/indra/newview/tests/llcapabilitylistener_test.cpp b/indra/newview/tests/llcapabilitylistener_test.cpp index f66ae9404f..b965379c9c 100644 --- a/indra/newview/tests/llcapabilitylistener_test.cpp +++ b/indra/newview/tests/llcapabilitylistener_test.cpp @@ -24,9 +24,9 @@ #include "../test/lltut.h" #include "../llcapabilityprovider.h" #include "lluuid.h" -#include "llerrorcontrol.h" #include "tests/networkio.h" #include "tests/commtest.h" +#include "tests/wrapllerrs.h" #include "stringize.h" #if defined(LL_WINDOWS) @@ -104,28 +104,6 @@ namespace tut typedef llcapears_group::object llcapears_object; llcapears_group llsdmgr("llcapabilitylistener"); - struct CaptureError: public LLError::OverrideFatalFunction - { - CaptureError(): - LLError::OverrideFatalFunction(boost::bind(&CaptureError::operator(), this, _1)) - { - LLError::setPrintLocation(false); - } - - struct FatalException: public std::runtime_error - { - FatalException(const std::string& what): std::runtime_error(what) {} - }; - - void operator()(const std::string& message) - { - error = message; - throw FatalException(message); - } - - std::string error; - }; - template<> template<> void llcapears_object::test<1>() { @@ -137,10 +115,10 @@ namespace tut std::string threw; try { - CaptureError capture; + WrapLL_ERRS capture; regionPump.post(request); } - catch (const CaptureError::FatalException& e) + catch (const WrapLL_ERRS::FatalException& e) { threw = e.what(); } @@ -184,10 +162,10 @@ namespace tut std::string threw; try { - CaptureError capture; + WrapLL_ERRS capture; regionPump.post(request); } - catch (const CaptureError::FatalException& e) + catch (const WrapLL_ERRS::FatalException& e) { threw = e.what(); } @@ -246,10 +224,10 @@ namespace tut std::string threw; try { - CaptureError capture; + WrapLL_ERRS capture; regionPump.post(request); } - catch (const CaptureError::FatalException& e) + catch (const WrapLL_ERRS::FatalException& e) { threw = e.what(); } diff --git a/indra/newview/tests/llxmlrpclistener_test.cpp b/indra/newview/tests/llxmlrpclistener_test.cpp new file mode 100644 index 0000000000..c94ba0a3e8 --- /dev/null +++ b/indra/newview/tests/llxmlrpclistener_test.cpp @@ -0,0 +1,230 @@ +/* + * @file llxmlrpclistener_test.cpp + * @author Nat Goodspeed + * @date 2009-03-20 + * @brief Test for llxmlrpclistener. + * + * $LicenseInfo:firstyear=2009&license=internal$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// Precompiled header +#include "../llviewerprecompiledheaders.h" +// associated header +#include "../llxmlrpclistener.h" +// STL headers +#include <iomanip> +// std headers +// external library headers +// other Linden headers +#include "../test/lltut.h" +#include "../llxmlrpctransaction.h" +#include "llevents.h" +#include "lleventfilter.h" +#include "llsd.h" +#include "llcontrol.h" +#include "tests/wrapllerrs.h" + +LLControlGroup gSavedSettings("Global"); + +/***************************************************************************** +* TUT +*****************************************************************************/ +namespace tut +{ + struct data + { + data(): + pumps(LLEventPumps::instance()), + uri("http://127.0.0.1:8000") + { + // These variables are required by machinery used by + // LLXMLRPCTransaction. The values reflect reality for this test + // executable; hopefully these values are correct. + gSavedSettings.declareBOOL("BrowserProxyEnabled", FALSE, "", FALSE); // don't persist + gSavedSettings.declareBOOL("NoVerifySSLCert", TRUE, "", FALSE); // don't persist + } + + // LLEventPump listener signature + bool captureReply(const LLSD& r) + { + reply = r; + return false; + } + + LLSD reply; + LLEventPumps& pumps; + std::string uri; + }; + typedef test_group<data> llxmlrpclistener_group; + typedef llxmlrpclistener_group::object object; + llxmlrpclistener_group llxmlrpclistenergrp("llxmlrpclistener"); + + template<> template<> + void object::test<1>() + { + set_test_name("request validation"); + WrapLL_ERRS capture; + LLSD request; + request["uri"] = uri; + std::string threw; + try + { + pumps.obtain("LLXMLRPCTransaction").post(request); + } + catch (const WrapLL_ERRS::FatalException& e) + { + threw = e.what(); + } + ensure_contains("threw exception", threw, "missing params"); + ensure_contains("identified missing", threw, "method"); + ensure_contains("identified missing", threw, "reply"); + } + + template<> template<> + void object::test<2>() + { + set_test_name("param types validation"); + WrapLL_ERRS capture; + LLSD request; + request["uri"] = uri; + request["method"] = "hello"; + request["reply"] = "reply"; + LLSD& params(request["params"]); + params["who"]["specifically"] = "world"; // LLXMLRPCListener only handles scalar params + std::string threw; + try + { + pumps.obtain("LLXMLRPCTransaction").post(request); + } + catch (const WrapLL_ERRS::FatalException& e) + { + threw = e.what(); + } + ensure_contains("threw exception", threw, "unknown type"); + } + + template<> template<> + void object::test<3>() + { + set_test_name("success case"); + LLSD request; + request["uri"] = uri; + request["method"] = "hello"; + request["reply"] = "reply"; + LLSD& params(request["params"]); + params["who"] = "world"; + // Set up a timeout filter so we don't spin forever waiting. + LLEventTimeout watchdog; + // Connect the timeout filter to the reply pump. + LLTempBoundListener temp( + pumps.obtain("reply"). + listen("watchdog", boost::bind(&LLEventTimeout::post, boost::ref(watchdog), _1))); + // Now connect our target listener to the timeout filter. + watchdog.listen("captureReply", boost::bind(&data::captureReply, this, _1)); + // Kick off the request... + reply.clear(); + pumps.obtain("LLXMLRPCTransaction").post(request); + // Set the timer + F32 timeout(10); + watchdog.eventAfter(timeout, LLSD().insert("timeout", 0)); + // and pump "mainloop" until we get something, whether from + // LLXMLRPCListener or from the watchdog filter. + LLTimer timer; + F32 start = timer.getElapsedTimeF32(); + LLEventPump& mainloop(pumps.obtain("mainloop")); + while (reply.isUndefined()) + { + mainloop.post(LLSD()); + } + ensure("timeout works", (timer.getElapsedTimeF32() - start) < (timeout + 1)); + ensure_equals(reply["responses"]["hi_there"].asString(), "Hello, world!"); + } + + template<> template<> + void object::test<4>() + { + set_test_name("bogus method"); + LLSD request; + request["uri"] = uri; + request["method"] = "goodbye"; + request["reply"] = "reply"; + LLSD& params(request["params"]); + params["who"] = "world"; + // Set up a timeout filter so we don't spin forever waiting. + LLEventTimeout watchdog; + // Connect the timeout filter to the reply pump. + LLTempBoundListener temp( + pumps.obtain("reply"). + listen("watchdog", boost::bind(&LLEventTimeout::post, boost::ref(watchdog), _1))); + // Now connect our target listener to the timeout filter. + watchdog.listen("captureReply", boost::bind(&data::captureReply, this, _1)); + // Kick off the request... + reply.clear(); + pumps.obtain("LLXMLRPCTransaction").post(request); + // Set the timer + F32 timeout(10); + watchdog.eventAfter(timeout, LLSD().insert("timeout", 0)); + // and pump "mainloop" until we get something, whether from + // LLXMLRPCListener or from the watchdog filter. + LLTimer timer; + F32 start = timer.getElapsedTimeF32(); + LLEventPump& mainloop(pumps.obtain("mainloop")); + while (reply.isUndefined()) + { + mainloop.post(LLSD()); + } + ensure("timeout works", (timer.getElapsedTimeF32() - start) < (timeout + 1)); + ensure_equals("XMLRPC error", reply["status"].asString(), "XMLRPCError"); + } + + template<> template<> + void object::test<5>() + { + set_test_name("bad type"); + LLSD request; + request["uri"] = uri; + request["method"] = "getdict"; + request["reply"] = "reply"; + (void)request["params"]; + // Set up a timeout filter so we don't spin forever waiting. + LLEventTimeout watchdog; + // Connect the timeout filter to the reply pump. + LLTempBoundListener temp( + pumps.obtain("reply"). + listen("watchdog", boost::bind(&LLEventTimeout::post, boost::ref(watchdog), _1))); + // Now connect our target listener to the timeout filter. + watchdog.listen("captureReply", boost::bind(&data::captureReply, this, _1)); + // Kick off the request... + reply.clear(); + pumps.obtain("LLXMLRPCTransaction").post(request); + // Set the timer + F32 timeout(10); + watchdog.eventAfter(timeout, LLSD().insert("timeout", 0)); + // and pump "mainloop" until we get something, whether from + // LLXMLRPCListener or from the watchdog filter. + LLTimer timer; + F32 start = timer.getElapsedTimeF32(); + LLEventPump& mainloop(pumps.obtain("mainloop")); + while (reply.isUndefined()) + { + mainloop.post(LLSD()); + } + ensure("timeout works", (timer.getElapsedTimeF32() - start) < (timeout + 1)); + ensure_equals(reply["status"].asString(), "BadType"); + ensure_contains("bad type", reply["responses"]["nested_dict"].asString(), "bad XMLRPC type"); + } +} // namespace tut + +/***************************************************************************** +* Resolve link errors: use real machinery here, since we intend to exchange +* actual XML with a peer process. +*****************************************************************************/ +// Including llxmlrpctransaction.cpp drags in the static LLXMLRPCListener +// instantiated there. That's why it works to post requests to the LLEventPump +// named "LLXMLRPCTransaction". +#include "../llxmlrpctransaction.cpp" +#include "llcontrol.cpp" +#include "llxmltree.cpp" +#include "llxmlparser.cpp" diff --git a/indra/newview/tests/test_llxmlrpc_peer.py b/indra/newview/tests/test_llxmlrpc_peer.py new file mode 100644 index 0000000000..cb8f7d26c4 --- /dev/null +++ b/indra/newview/tests/test_llxmlrpc_peer.py @@ -0,0 +1,59 @@ +#!/usr/bin/python +"""\ +@file test_llxmlrpc_peer.py +@author Nat Goodspeed +@date 2008-10-09 +@brief This script asynchronously runs the executable (with args) specified on + the command line, returning its result code. While that executable is + running, we provide dummy local services for use by C++ tests. + +$LicenseInfo:firstyear=2008&license=viewergpl$ +Copyright (c) 2008, Linden Research, Inc. +$/LicenseInfo$ +""" + +import os +import sys +from threading import Thread +from SimpleXMLRPCServer import SimpleXMLRPCServer + +mydir = os.path.dirname(__file__) # expected to be .../indra/newview/tests/ +sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "lib", "python")) +sys.path.insert(1, os.path.join(mydir, os.pardir, os.pardir, "llmessage", "tests")) +from testrunner import run, debug + +class TestServer(SimpleXMLRPCServer): + def _dispatch(self, method, params): + try: + func = getattr(self, method) + except AttributeError: + raise Exception('method "%s" is not supported' % method) + else: + # LLXMLRPCListener constructs XMLRPC parameters that arrive as a + # 1-tuple containing a dict. + return func(**(params[0])) + + def hello(self, who): + # LLXMLRPCListener expects a dict return. + return {"hi_there": "Hello, %s!" % who} + + def getdict(self): + return dict(nested_dict=dict(a=17, b=5)) + + def log_request(self, code, size=None): + # For present purposes, we don't want the request splattered onto + # stderr, as it would upset devs watching the test run + pass + + def log_error(self, format, *args): + # Suppress error output as well + pass + +class ServerRunner(Thread): + def run(self): + server = TestServer(('127.0.0.1', 8000)) + debug("Starting XMLRPC server...\n") + server.serve_forever() + +if __name__ == "__main__": + sys.exit(run(server=ServerRunner(name="xmlrpc"), *sys.argv[1:])) |