diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 8784a84c4..46bda0ad3 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -373,7 +373,7 @@ void AIEngine::setMaxCount(F32 StateMachineMaxTime) sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000; } -#ifdef CWDEBUG +#if defined(CWDEBUG) || defined(DEBUG_CURLIO) char const* AIStateMachine::event_str(event_type event) { switch(event) diff --git a/indra/aistatemachine/aistatemachine.h b/indra/aistatemachine/aistatemachine.h index 979205e02..160c6d6eb 100644 --- a/indra/aistatemachine/aistatemachine.h +++ b/indra/aistatemachine/aistatemachine.h @@ -271,7 +271,7 @@ class AIStateMachine : public LLThreadSafeRefCount // Return stringified state, for debugging purposes. char const* state_str(base_state_type state); -#ifdef CWDEBUG +#if defined(CWDEBUG) || defined(DEBUG_CURLIO) char const* event_str(event_type event); #endif diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 6bfa9f9f6..5eb78b0b2 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -34,7 +34,7 @@ if (WINDOWS) endif (MSVC10) # Remove default /Zm1000 flag that cmake inserts - string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Don't build DLLs. set(BUILD_SHARED_LIBS OFF) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 4b34ff47d..00754ec36 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -1,4 +1,8 @@ # -*- cmake -*- +if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) +set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") + +include(Variables) if (NOT STANDALONE) if (WINDOWS) @@ -45,3 +49,5 @@ else (WINDOWS) endif (WINDOWS) mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES) + +endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 6dd9c47bd..2295a7574 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -1,5 +1,8 @@ # -*- cmake -*- +if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) +set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") + macro (use_prebuilt_binary _binary) if(NOT STANDALONE) get_property(PREBUILT_PACKAGES TARGET prepare PROPERTY PREBUILT) @@ -9,3 +12,5 @@ macro (use_prebuilt_binary _binary) endif(_index LESS 0) endif(NOT STANDALONE) endmacro (use_prebuilt_binary _binary) + +endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 9815c8096..5bc3e2156 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -92,29 +92,25 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) if(${CMAKE_GENERATOR} MATCHES Xcode) - execute_process( - COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2" - OUTPUT_VARIABLE XCODE_VERSION ) - - # To support a different SDK update these Xcode settings: - if (XCODE_VERSION GREATER 4.2) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) - else (XCODE_VERSION GREATER 4.2) + #SDK Compiler and Deployment targets for XCode + if (${XCODE_VERSION} VERSION_LESS 4.0.0) + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) - endif (XCODE_VERSION GREATER 4.2) + else (${XCODE_VERSION} VERSION_LESS 4.0.0) + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) + endif (${XCODE_VERSION} VERSION_LESS 4.0.0) else(${CMAKE_GENERATOR} MATCHES Xcode) + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) endif(${CMAKE_GENERATOR} MATCHES Xcode) - set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk) set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) # Build only for i386 by default, system default on MacOSX 10.6 is x86_64 - if (NOT CMAKE_OSX_ARCHITECTURES) - set(CMAKE_OSX_ARCHITECTURES i386) - endif (NOT CMAKE_OSX_ARCHITECTURES) + set(CMAKE_OSX_ARCHITECTURES i386) set(ARCH i386) set(WORD_SIZE 32) diff --git a/indra/libpathing/CMakeLists.txt b/indra/libpathing/CMakeLists.txt index 12d409f20..087faec05 100644 --- a/indra/libpathing/CMakeLists.txt +++ b/indra/libpathing/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.6.4) project(ndPathingLib CXX C) if( MSVC ) - add_definitions(-D_HAS_ITERATOR_DEBUGGING=0 -D_SECURE_SCL=0 -D_CRT_SECURE_NO_WARNINGS=1) + add_definitions(-D_SECURE_SCL=0 -D_CRT_SECURE_NO_WARNINGS=1) endif( MSVC ) file (GLOB SOURCE_FILES *.cpp ) diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 8a2b6d0b5..4ddc58d18 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -486,10 +486,14 @@ LLThreadSafeRefCount::LLThreadSafeRefCount() : LLThreadSafeRefCount::~LLThreadSafeRefCount() { + llassert(mRef == 0); + /* TEMPORARILY disable erroring out on deleting this object with + nonzero reference count until the problem in AIStateMachine is fixed if (mRef != 0) { llerrs << "deleting non-zero reference" << llendl; } + */ } //============================================================================ diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 34354e3e8..f41fce8ed 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -1022,6 +1022,16 @@ void mask_to_string(U32 mask, char* str) { *str = ' '; } + str++; + + if (mask & PERM_EXPORT) + { + *str = 'E'; + } + else + { + *str = ' '; + } str++; *str = '\0'; } diff --git a/indra/llinventory/llpermissionsflags.h b/indra/llinventory/llpermissionsflags.h index f810929d6..02224d0c8 100644 --- a/indra/llinventory/llpermissionsflags.h +++ b/indra/llinventory/llpermissionsflags.h @@ -52,6 +52,9 @@ const PermissionBit PERM_MODIFY = (1 << 14); // 0x00004000 // objects, allow copy const PermissionBit PERM_COPY = (1 << 15); // 0x00008000 +// objects, allow exporting +const PermissionBit PERM_EXPORT = (1 << 16); // 0x00010000 + // parcels, allow entry, deprecated //const PermissionBit PERM_ENTER = (1 << 16); // 0x00010000 diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index 0e2c3bcb4..266f266a6 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -110,11 +110,13 @@ protected: LLGLEnable mBlend, mAlphaTest; LLGLDisable mCullFace; LLGLDepthTest mDepthTest; + LLGLDisable mMSAA; public: LLGLSUIDefault() : mBlend(GL_BLEND), mAlphaTest(GL_ALPHA_TEST), mCullFace(GL_CULL_FACE), - mDepthTest(GL_FALSE, GL_TRUE, GL_LEQUAL) + mDepthTest(GL_FALSE, GL_TRUE, GL_LEQUAL), + mMSAA(GL_MULTISAMPLE_ARB) {} }; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 88cb7209c..bbf70b9de 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1495,7 +1495,7 @@ void LLRender::translateUI(F32 x, F32 y, F32 z) llerrs << "Need to push a UI translation frame before offsetting" << llendl; } - LLVector4a add(x,y,x); + LLVector4a add(x,y,z); mUIOffset.back()->add(add); } @@ -1564,13 +1564,13 @@ LLVector3 LLRender::getUIScale() { return LLVector3(1,1,1); } - return LLVector3(mUIOffset.back()->getF32ptr()); + return LLVector3(mUIScale.back()->getF32ptr()); } void LLRender::loadUIIdentity() { - if (mUIOffset.empty()) + if (mUIOffset.empty() || mUIScale.empty()) { llerrs << "Need to push UI translation frame before clearing offset." << llendl; } @@ -1730,8 +1730,10 @@ void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, mCurrBlendAlphaSFactor = alpha_sfactor; mCurrBlendColorDFactor = color_dfactor; mCurrBlendAlphaDFactor = alpha_dfactor; - blendfunc_debug[0]=blendfunc_debug[2]=color_sfactor; - blendfunc_debug[1]=blendfunc_debug[3]=alpha_sfactor; + blendfunc_debug[0]=color_sfactor; + blendfunc_debug[1]=alpha_sfactor; + blendfunc_debug[2]=color_dfactor; + blendfunc_debug[3]=alpha_dfactor; flush(); glBlendFuncSeparateEXT(sGLBlendFactor[color_sfactor], sGLBlendFactor[color_dfactor], sGLBlendFactor[alpha_sfactor], sGLBlendFactor[alpha_dfactor]); diff --git a/indra/llui/llalertdialog.cpp b/indra/llui/llalertdialog.cpp index 712683021..feb04aa67 100644 --- a/indra/llui/llalertdialog.cpp +++ b/indra/llui/llalertdialog.cpp @@ -107,7 +107,7 @@ static const LLFONT_ID FONT_NAME = LLFONT_SANSSERIF; LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) : LLModalDialog( notification->getLabel(), 100, 100, modal ), // dummy size. Will reshape below. LLInstanceTracker(notification->getID()), - mDefaultOption( 0 ), + mDefaultButton( NULL ), mCheck(NULL), mCaution(notification->getPriority() >= NOTIFICATION_PRIORITY_HIGH), mLabel(notification->getName()), @@ -126,35 +126,24 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) setBackgroundVisible(TRUE); setBackgroundOpaque(TRUE); - - typedef std::vector > options_t; - options_t supplied_options; + typedef std::list options_t; + options_t options; // for now, get LLSD to iterator over form elements LLSD form_sd = form->asLLSD(); - S32 option_index = 0; for (LLSD::array_const_iterator it = form_sd.beginArray(); it != form_sd.endArray(); ++it) { std::string type = (*it)["type"].asString(); if (type == "button") { - if((*it)["default"]) - { - mDefaultOption = option_index; - } - - supplied_options.push_back(std::make_pair((*it)["name"].asString(), (*it)["text"].asString())); - - ButtonData data; - data.mSelf = this; - if (option_index == mNote->getURLOption()) - { - data.mURL = mNote->getURL(); - } - - mButtonData.push_back(data); - option_index++; + options.push_back(ButtonData()); + ButtonData& button_data = options.back(); + button_data.mName = (*it)["name"].asString(); + button_data.mText = (*it)["text"].asString(); + button_data.mDefault = (*it)["default"].asBoolean(); + if(options.size()-1 == mNote->getURLOption()) + button_data.mUrl = mNote->getURL(); } else if (type == "text") { @@ -168,23 +157,14 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) is_password = true; } } - // Buttons - options_t options; - if (supplied_options.empty()) + if (options.empty()) { - options.push_back(std::make_pair(std::string("close"), std::string("Close"))); - - // add data for ok button. - ButtonData ok_button; - ok_button.mSelf = this; - - mButtonData.push_back(ok_button); - mDefaultOption = 0; - } - else - { - options = supplied_options; + options.push_back(ButtonData()); + ButtonData& button_data = options.back(); + button_data.mName = "close"; + button_data.mText = "Close"; + button_data.mDefault = true; } S32 num_options = options.size(); @@ -192,9 +172,9 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) // Calc total width of buttons S32 button_width = 0; S32 sp = font->getWidth(std::string("OO")); - for( S32 i = 0; i < num_options; i++ ) + for( options_t::iterator it = options.begin(); it != options.end(); it++ ) { - S32 w = S32(font->getWidth( options[i].second ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD; + S32 w = S32(font->getWidth( it->mText ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD; button_width = llmax( w, button_width ); } S32 btn_total_width = button_width; @@ -261,33 +241,37 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal) // Buttons S32 button_left = (getRect().getWidth() - btn_total_width) / 2; - for( S32 i = 0; i < num_options; i++ ) + for( options_t::iterator it = options.begin(); it != options.end(); it++ ) { LLRect button_rect; button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT ); + ButtonData& button_data = *it; + LLButton* btn = new LLButton( - options[i].first, button_rect, + button_data.mName, button_rect, "","", "", NULL, NULL, font, - options[i].second, - options[i].second); + button_data.mText, + button_data.mText); - mButtonData[i].mButton = btn; - - btn->setClickedCallback(&LLAlertDialog::onButtonPressed, (void*)(&mButtonData[i])); + btn->setClickedCallback(boost::bind(&LLAlertDialog::onButtonPressed, this, _1, button_data.mUrl)); addChild(btn); - if( i == mDefaultOption ) + if(!mDefaultButton || button_data.mDefault) { - btn->setFocus(TRUE); + mDefaultButton = btn; } button_left += button_width + BTN_HPAD; } + llassert(mDefaultButton); //'options' map should never be empty, thus mDefaultButton should always get set in the above loop. + mDefaultButton->setFocus(TRUE); + + // (Optional) Edit Box if (!edit_text_name.empty()) { @@ -346,7 +330,7 @@ bool LLAlertDialog::show() mLineEditor->setFocus(TRUE); mLineEditor->selectAll(); } - if(mDefaultOption >= 0) + if(mDefaultButton) { // delay before enabling default button mDefaultBtnTimer.start(DEFAULT_BUTTON_DELAY); @@ -385,7 +369,8 @@ bool LLAlertDialog::setCheckBox( const std::string& check_title, const std::stri check_rect.setOriginAndSize(msg_x, VPAD+BTN_HEIGHT+LINE_HEIGHT/2, max_msg_width, LINE_HEIGHT); - mCheck = new LLCheckboxCtrl(std::string("check"), check_rect, check_title, font, onClickIgnore, this); + mCheck = new LLCheckboxCtrl(std::string("check"), check_rect, check_title, font); + mCheck->setCommitCallback(boost::bind(&LLAlertDialog::onClickIgnore, this, _1)); addChild(mCheck); return true; @@ -402,8 +387,49 @@ void LLAlertDialog::setVisible( BOOL visible ) } } +//Fixing a hole in alert logic. If the alert isn't modal, clicking 'x' to close its floater would result +//in a dangling notification. To address this we try to find the most reasonable button to emulate clicking. +//Close tends to be the best, as it's most accurate, and is the default for alerts that lack defined buttons. +//Next up is cancel, which is the correct behavior for a majority of alert notifications +//After that, try 'ok', which is the only button that exists for a few alert notifications. 'ok' for these equates to 'dismiss'. +//Finally, if none of the above are found, issue the respond procedure with the dummy button name 'close'. void LLAlertDialog::onClose(bool app_quitting) { + if(mNote.get() && !mNote->isRespondedTo() && !mNote->isIgnored()) + { + LLButton* btn = NULL; + bool found_cancel = false; + for(child_list_const_iter_t it = beginChild(); it != endChild(); ++it) + { + LLButton* cur_btn = dynamic_cast(*it); + if(!cur_btn) + continue; + if( LLStringUtil::compareInsensitive(cur_btn->getName(), "close") == 0 )//prefer 'close' over anything else. + { + btn = cur_btn; + break; + } + else if(LLStringUtil::compareInsensitive(cur_btn->getName(), "cancel") == 0 )//prefer 'cancel' over 'ok'. + { + btn = cur_btn; + found_cancel = true; + } + else if(!found_cancel && LLStringUtil::compareInsensitive(cur_btn->getName(), "ok") == 0 )//accept 'ok' as last resort. + { + btn = cur_btn; + } + } + LLSD response = mNote->getResponseTemplate(); + if(btn) + response[btn->getName()] = true; + else + { //We found no acceptable button so just feed it a fake one. + //LLNotification::getSelectedOption will return -1 in notification callbacks. + response["Close"] = true; + } + mNote->respond(response); + + } LLModalDialog::onClose(app_quitting); } @@ -458,7 +484,7 @@ void LLAlertDialog::draw() if(mDefaultBtnTimer.hasExpired() && mDefaultBtnTimer.getStarted()) { mDefaultBtnTimer.stop(); // prevent this block from being run more than once - setDefaultBtn(mButtonData[mDefaultOption].mButton); + setDefaultBtn(mDefaultButton); } static LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); @@ -483,44 +509,37 @@ void LLAlertDialog::setEditTextArgs(const LLSD& edit_args) } } -// static -void LLAlertDialog::onButtonPressed( void* userdata ) +void LLAlertDialog::onButtonPressed( LLUICtrl* ctrl, const std::string url ) { - ButtonData* button_data = (ButtonData*)userdata; - LLAlertDialog* self = button_data->mSelf; - - LLSD response = self->mNote->getResponseTemplate(); - if (self->mLineEditor) + LLSD response = mNote->getResponseTemplate(); + if (mLineEditor) { - response[self->mLineEditor->getName()] = self->mLineEditor->getValue(); + response[mLineEditor->getName()] = mLineEditor->getValue(); } - response[button_data->mButton->getName()] = true; + response[ctrl->getName()] = true; // If we declared a URL and chose the URL option, go to the url - if (!button_data->mURL.empty() && sURLLoader != NULL) + if (!url.empty() && sURLLoader != NULL) { - sURLLoader->load(button_data->mURL); + sURLLoader->load(url); } - self->mNote->respond(response); // new notification reponse - self->close(); // deletes self + mNote->respond(response); // new notification reponse + close(); // deletes self } -//static -void LLAlertDialog::onClickIgnore(LLUICtrl* ctrl, void* user_data) +void LLAlertDialog::onClickIgnore(LLUICtrl* ctrl) { - LLAlertDialog* self = (LLAlertDialog*)user_data; - // checkbox sometimes means "hide and do the default" and // other times means "warn me again". Yuck. JC BOOL check = ctrl->getValue(); - if (self->mNote->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN) + if (mNote->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN) { // question was "show again" so invert value to get "ignore" check = !check; } - self->mNote->setIgnored(check); + mNote->setIgnored(check); } diff --git a/indra/llui/llalertdialog.h b/indra/llui/llalertdialog.h index 04caea651..799ab8a80 100644 --- a/indra/llui/llalertdialog.h +++ b/indra/llui/llalertdialog.h @@ -87,8 +87,8 @@ public: //statics static void initClass(); static bool onNewNotification(const LLSD& notify, bool is_modal); - static void onButtonPressed(void* userdata); - static void onClickIgnore(LLUICtrl* ctrl, void* user_data); + void onButtonPressed( LLUICtrl* ctrl, const std::string url ); + void onClickIgnore( LLUICtrl* ctrl ); private: LLNotificationPtr mNote; @@ -102,18 +102,18 @@ private: BOOL hasTitleBar() const; private: + struct ButtonData + { + std::string mName; + std::string mText; + bool mDefault; + std::string mUrl; + }; + static URLLoader* sURLLoader; static LLControlGroup* sSettings; - struct ButtonData - { - LLAlertDialog* mSelf; - LLButton* mButton; - std::string mURL; - }; - std::vector mButtonData; - - S32 mDefaultOption; + LLButton* mDefaultButton; LLCheckBoxCtrl* mCheck; BOOL mCaution; BOOL mUnique; diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 8c11a50b8..c512f6816 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1094,6 +1094,7 @@ LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelN if(p == mChannels.end()) { llerrs << "Did not find channel named " << channelName << llendl; + return LLNotificationChannelPtr(); } return p->second; } diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 69841a042..1e6146a3f 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -112,7 +112,7 @@ public: BOOL focusNextItem(BOOL text_entry_only); BOOL focusPrevItem(BOOL text_entry_only); - BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); + virtual BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); BOOL focusLastItem(BOOL prefer_text_fields = FALSE); // Non Virtuals diff --git a/indra/lscript/lscript_byteformat.h b/indra/lscript/lscript_byteformat.h index bf810817b..09c8b1281 100644 --- a/indra/lscript/lscript_byteformat.h +++ b/indra/lscript/lscript_byteformat.h @@ -536,6 +536,7 @@ typedef enum e_lscript_runtime_permissions SCRIPT_PERMISSION_TRACK_CAMERA, SCRIPT_PERMISSION_CONTROL_CAMERA, SCRIPT_PERMISSION_TELEPORT, + SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS, SCRIPT_PERMISSION_EOF } LSCRIPTRunTimePermissions; @@ -553,6 +554,7 @@ const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] = (0x1 << 10),// SCRIPT_PERMISSION_TRACK_CAMERA (0x1 << 11),// SCRIPT_PERMISSION_CONTROL_CAMERA (0x1 << 12),// SCRIPT_PERMISSION_TELEPORT + (0x1 << 15),// SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS }; // http_request string constants diff --git a/indra/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp index 4837b4f6b..3d91fafe8 100644 --- a/indra/lscript/lscript_library/lscript_library.cpp +++ b/indra/lscript/lscript_library/lscript_library.cpp @@ -532,6 +532,14 @@ void LLScriptLibrary::init() addFunction(10.f, 0.f, dummy_func, "llUpdateCharacter", NULL, "l"); addFunction(10.f, 0.f, dummy_func, "llWanderWithin", NULL, "vvl"); + // Server RC LeTigre 12.10.12.265819 new function + addFunction(0.f, 0.f, dummy_func, "llGetSimStats", "f", "i"); + + // Server RC LeTigre 13.03.22.272565 new function + addFunction(0.f, 0.f, dummy_func, "llSetAnimationOverride", NULL, "ss"); + addFunction(0.f, 0.f, dummy_func, "llGetAnimationOverride", "s", "s"); + addFunction(0.f, 0.f, dummy_func, "llResetAnimationOverride", NULL, "s"); + // SL-LSL Functions to be added above this line // --------------------------------------------- // NOTE bytecode placement no longer applies, viewers do not compile scripts anymore (confirmed with LL, also noted by Phoenix/Firestorm team.) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9e3abed3e..c5dcff371 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -97,6 +97,7 @@ set(viewer_SOURCE_FILES hippopanelgrids.cpp importtracker.cpp jcfloaterareasearch.cpp + lfsimfeaturehandler.cpp lggdicdownload.cpp lgghunspell_wrapper.cpp llaccountingcostmanager.cpp @@ -597,6 +598,7 @@ set(viewer_HEADER_FILES hippopanelgrids.h importtracker.h jcfloaterareasearch.h + lfsimfeaturehandler.h lggdicdownload.h lgghunspell_wrapper.h llaccountingcostmanager.h diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index b084a5894..d43e54989 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -52,7 +52,7 @@ changed changed( integer change ):Triggered various event change the task:(tes remote_data remote_data(integer event_type, key channel, key message_id, string sender,integer idata, string sdata):Triggered by various XML-RPC calls (event_type will be one of REMOTE_DATA_CHANNEL, REMOTE_DATA_REQUEST, REMOTE_DATA_REPLY) http_response http_response(key request_id, integer status, list metadata, string body):Triggered when task receives a response to one of its llHTTPRequests http_request http_request(key id, string method, string body):Triggered when task receives an http request against a public URL -transaction_result transaction_result(key id, integer success, string data):Triggered when task receives asynchronous data. +transaction_result transaction_result(key id, integer success, string data): Triggered when currency is given to task path_update path_update(integer type, list reserved):Triggered when the state of a pathfinder character changes. Note; "list reserved" is not currently used # integer constants @@ -99,6 +99,7 @@ PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to req PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override agent's animations DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users diff --git a/indra/newview/app_settings/lsl_functions_sl.xml b/indra/newview/app_settings/lsl_functions_sl.xml index 51074f13e..563414c6e 100644 --- a/indra/newview/app_settings/lsl_functions_sl.xml +++ b/indra/newview/app_settings/lsl_functions_sl.xml @@ -1013,5 +1013,12 @@ llGetSimStats + + llSetAnimationOverride + + llGetAnimationOverride + + llResetAnimationOverride + \ No newline at end of file diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index d30cb4343..b591a82db 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -314,6 +314,17 @@ Value 0 + EveryoneExport + + Comment + Whether content you upload has exportability permission by default + Persist + 1 + Type + Boolean + Value + 0 + RLVaLoginLastLocation Comment diff --git a/indra/newview/app_settings/settings_sh.xml b/indra/newview/app_settings/settings_sh.xml index d70e6183f..d0f7516a2 100644 --- a/indra/newview/app_settings/settings_sh.xml +++ b/indra/newview/app_settings/settings_sh.xml @@ -218,7 +218,7 @@ Value 1 - SHAlphaMaskMaxRMSE + SHAutoMaskMaxRMSE Comment Sets the maximum random mean square error cutoff used when detecting suitable textures for alphamasking. (SHUseRMSEAutoMask must be TRUE for this to have any effect) diff --git a/indra/newview/hippofloaterxml.cpp b/indra/newview/hippofloaterxml.cpp index d8af038a6..926190ed6 100644 --- a/indra/newview/hippofloaterxml.cpp +++ b/indra/newview/hippofloaterxml.cpp @@ -40,6 +40,8 @@ #include #include +#include "llavatarnamecache.h" +#include "llfloateravatarpicker.h" #include "llviewerwindow.h" @@ -58,10 +60,12 @@ class HippoFloaterXmlImpl : public LLFloater BOOL postBuild(); void onClose(bool quitting); - static bool execute(LLUICtrl *ctrl, + static bool execute(LLFloater *floater, LLUICtrl *ctrl, const std::string &cmds, std::string::size_type &offset, std::string &response); + U32 mChannel; + private: std::string mName; bool mIsNotifyOnClose; @@ -160,7 +164,7 @@ void XmlData::release(const std::string &floaterName) // create HippoFloaterXmlImpl HippoFloaterXmlImpl::HippoFloaterXmlImpl(const std::string &name, const std::string &xml) : - mName(name), mIsNotifyOnClose(false) + mName(name), mIsNotifyOnClose(false), mChannel(CHANNEL) { gInstances[mName] = this; LLUICtrlFactory::getInstance()->buildFloaterFromBuffer(this, xml); @@ -218,7 +222,7 @@ void HippoFloaterXml::execute(const std::string &cmds) if (token == "{") { if (floater) { std::string response; - if (!floater->execute(floater, cmds, offset, response)) + if (!floater->execute(floater, floater, cmds, offset, response)) break; if (!response.empty()) send_chat_from_viewer(response, CHAT_TYPE_WHISPER, CHANNEL); @@ -265,29 +269,56 @@ void HippoFloaterXml::execute(const std::string &cmds) // ******************************************************************** // generic notification callbacks -static void notifyCallback(void *c) +static void notifyCallback(void *c, void *f) { + HippoFloaterXmlImpl* floaterp = (HippoFloaterXmlImpl*)f; + LLUICtrl *ctrl = (LLUICtrl *)c; std::string msg = "NOTIFY:"; msg += ctrl->getName(); msg += ':'; msg += ctrl->getValue().asString(); - send_chat_from_viewer(msg, CHAT_TYPE_WHISPER, CHANNEL); + send_chat_from_viewer(msg, CHAT_TYPE_WHISPER, floaterp->mChannel); +} + +void callbackAvatarPick(void *c, void *f, const uuid_vec_t& ids, const std::vector& names) +{ + HippoFloaterXmlImpl* floaterp = (HippoFloaterXmlImpl*)f; + + LLUICtrl *ctrl = (LLUICtrl *)c; + + LLUUID id = ids[0]; + + std::string msg = "PICKER:"; + msg += ctrl->getName(); + msg += ':'; + msg += id.asString(); + msg += ':'; + msg += names[0].getCompleteName(); + send_chat_from_viewer(msg, CHAT_TYPE_WHISPER, floaterp->mChannel); +} + +static void pickerCallback(void *c, void *f) +{ + LLUICtrl *ctrl = (LLUICtrl *)c; + HippoFloaterXmlImpl* floaterp = (HippoFloaterXmlImpl*)f; + + floaterp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&callbackAvatarPick, ctrl, floaterp, _1, _2), FALSE, TRUE)); + //send_chat_from_viewer(msg, CHAT_TYPE_WHISPER, CHANNEL); } void HippoFloaterXmlImpl::onClose(bool quitting) { if (mIsNotifyOnClose) send_chat_from_viewer("NOTIFY:" + mName + ":closed", - CHAT_TYPE_WHISPER, CHANNEL); + CHAT_TYPE_WHISPER, mChannel); LLFloater::onClose(quitting); } - // ******************************************************************** // execute commands on instance -bool HippoFloaterXmlImpl::execute(LLUICtrl *ctrl, +bool HippoFloaterXmlImpl::execute(LLFloater *floater, LLUICtrl *ctrl, const std::string &cmds, std::string::size_type &offset, std::string &response) { @@ -313,24 +344,36 @@ bool HippoFloaterXmlImpl::execute(LLUICtrl *ctrl, if (!child) return false; if (!cmdGetToken(cmds, offset, token)) return false; if (token != "{") return false; - if (!execute(child, cmds, offset, response)) + if (!execute(floater, child, cmds, offset, response)) return false; } else if (key == "setValue") { ctrl->setValue(value); + } else if (key == "channel") { + if (HippoFloaterXmlImpl *floater = dynamic_cast(ctrl)) { + floater->mChannel = atoi(value.c_str()); + } } else if (key == "setLabel") { /*ctrl->setLabel(value);*/ } else if (key == "setVisible") { ctrl->setVisible(value != "0"); } else if (key == "notify") { bool set = (value != "0"); - if (HippoFloaterXmlImpl *floater = dynamic_cast(ctrl)) { - floater->mIsNotifyOnClose = set; + if (HippoFloaterXmlImpl *floaterp = dynamic_cast(ctrl)) { + floaterp->mIsNotifyOnClose = set; } else { if (set) - ctrl->setCommitCallback(boost::bind(¬ifyCallback, _1), ctrl); + ctrl->setCommitCallback(boost::bind(¬ifyCallback, _1, floater), ctrl); else ctrl->setCommitCallback(0); } + } else if (key == "picker") { + bool set = (value != "0"); + if (!dynamic_cast(ctrl)) { + if (set) + ctrl->setCommitCallback(boost::bind(&pickerCallback, _1, floater), ctrl); + else + ctrl->setCommitCallback(0); + } } } } diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp new file mode 100644 index 000000000..bce7124ae --- /dev/null +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -0,0 +1,66 @@ +/* Copyright (C) 2013 Liru Færs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA */ + +#include "llviewerprecompiledheaders.h" + +#include "lfsimfeaturehandler.h" + +#include "llagent.h" +#include "llenvmanager.h" +#include "llviewerregion.h" +#include "hippogridmanager.h" + +LFSimFeatureHandler::LFSimFeatureHandler() +: mSupportsExport(false) +{ + if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features + LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this)); +} + +void LFSimFeatureHandler::handleRegionChange() +{ + if (LLViewerRegion* region = gAgent.getRegion()) + { + if (region->getFeaturesReceived()) + { + setSupportedFeatures(); + } + else + { + region->setFeaturesReceivedCallback(boost::bind(&LFSimFeatureHandler::setSupportedFeatures, this)); + } + } +} + +void LFSimFeatureHandler::setSupportedFeatures() +{ + if (LLViewerRegion* region = gAgent.getRegion()) + { + LLSD info; + region->getSimulatorFeatures(info); + //if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Non-SL specific sim features + { + mSupportsExport = info.has("ExportSupported"); + } + } +} + +boost::signals2::connection LFSimFeatureHandler::setSupportsExportCallback(const boost::signals2::signal::slot_type& slot) +{ + return mSupportsExport.connect(slot); +} + diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h new file mode 100644 index 000000000..070d6ba1e --- /dev/null +++ b/indra/newview/lfsimfeaturehandler.h @@ -0,0 +1,70 @@ +/* Copyright (C) 2013 Liru Færs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA */ + +#ifndef LFSIMFEATUREHANDLER_H +#define LFSIMFEATUREHANDLER_H + +#include "llsingleton.h" + +template +class SignaledType +{ +public: + SignaledType(Type b) : mValue(b) {} + + template + boost::signals2::connection connect(Slot slot) { return mSignal.connect(slot); } + + SignaledType& operator =(Type val) + { + if (val != mValue) + { + mValue = val; + mSignal(); + } + return *this; + } + operator Type() const { return mValue; } + +private: + boost::signals2::signal mSignal; + Type mValue; +}; + +class LFSimFeatureHandler : public LLSingleton +{ +protected: + friend class LLSingleton; + LFSimFeatureHandler(); + +public: + void handleRegionChange(); + void setSupportedFeatures(); + + // Connection setters + boost::signals2::connection setSupportsExportCallback(const boost::signals2::signal::slot_type& slot); + + // Accessors + bool simSupportsExport() const { return mSupportsExport; } + +private: + // SignaledTypes + SignaledType mSupportsExport; +}; + +#endif //LFSIMFEATUREHANDLER_H + diff --git a/indra/newview/llestateinfomodel.h b/indra/newview/llestateinfomodel.h index 56391eda9..30e83b140 100644 --- a/indra/newview/llestateinfomodel.h +++ b/indra/newview/llestateinfomodel.h @@ -56,7 +56,8 @@ public: const std::string& getName() const { return mName; } const LLUUID& getOwnerID() const { return mOwnerID; } U32 getID() const { return mID; } - F32 getSunHour() const { return getUseFixedSun() ? mSunHour : 0.f; } + F32 getSunHour() const { return mSunHour; } + bool getGlobalTime() const { return !(mSunHour || getUseFixedSun()); } // setters void setUseFixedSun(bool val); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index d2c6834b9..8b1f2a564 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1068,10 +1068,10 @@ bool LLFace::canRenderAsMask() const LLTextureEntry* te = getTextureEntry(); static const LLCachedControl use_rmse_auto_mask("SHUseRMSEAutoMask",false); - static const LLCachedControl alpha_mas_max_rmse("SHAlphaMaskMaxRMSE",.09f); + static const LLCachedControl auto_mask_max_rmse("SHAutoMaskMaxRMSE",.09f); if ((te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - getTexture()->getIsAlphaMask(use_rmse_auto_mask ? alpha_mas_max_rmse : -1.f)) // texture actually qualifies for masking (lazily recalculated but expensive) + (!getViewerObject()->isAttachment() && getTexture()->getIsAlphaMask(use_rmse_auto_mask ? auto_mask_max_rmse : -1.f))) // texture actually qualifies for masking (lazily recalculated but expensive) { if (LLPipeline::sRenderDeferred) { diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 60f67c1e0..01ed3f0c1 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -187,7 +187,15 @@ void LLFloaterChat::handleVisibilityChange(BOOL new_visibility) // virtual void LLFloaterChat::onFocusReceived() { - gFocusMgr.setKeyboardFocus(getChildView("Chat Editor")); // Work around the chat bar no longer focusing from within the layout_stack + LLView* chat_editor = getChildView("Chat Editor"); + if (getVisible() && childIsVisible("Chat Editor")) + { + gFocusMgr.setKeyboardFocus(chat_editor); + + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + } + LLFloater::onFocusReceived(); } @@ -740,3 +748,20 @@ void LLFloaterChat::hide(LLFloater* instance, const LLSD& key) VisibilityPolicy::hide(instance, key); } } + +BOOL LLFloaterChat::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) +{ + LLView* chat_editor = getChildView("Chat Editor"); + if (getVisible() && childIsVisible("Chat Editor")) + { + gFocusMgr.setKeyboardFocus(chat_editor); + + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + + return TRUE; + } + + return LLUICtrl::focusFirstItem(prefer_text_fields, focus_flash); +} + diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index e1626a9f3..3c7cbc4c5 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -98,6 +98,8 @@ public: LLPanelActiveSpeakers* mPanel; BOOL mScrolledToEnd; + BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); + CachedUICtrl mToggleActiveSpeakersBtn; CachedUICtrl mChatPanel; }; diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index ccbeb8c5c..9a094ad58 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -32,6 +32,7 @@ */ #include "llviewerprecompiledheaders.h" +#include "lfsimfeaturehandler.h" #include "llalertdialog.h" #include "llcheckboxctrl.h" #include "llfloaterperms.h" @@ -40,7 +41,35 @@ #include "llviewerwindow.h" #include "lluictrlfactory.h" #include "llpermissions.h" +#include "hippogridmanager.h" +namespace +{ + bool everyone_export; + void handle_checkboxes(LLUICtrl* ctrl, const LLSD& value) + { + LLPanel* view = static_cast(ctrl->getParent()); + if (ctrl->getName() == "everyone_export") + { + view->childSetEnabled("next_owner_copy", !value); + view->childSetEnabled("next_owner_modify", !value); + view->childSetEnabled("next_owner_transfer", !value); + } + else + { + if (ctrl->getName() == "next_owner_copy") + { + if (!value) // Implements fair use + gSavedSettings.setBOOL("NextOwnerTransfer", true); + view->childSetEnabled("next_owner_transfer", value); + } + if (!value) // If any of these are unchecked, export can no longer be checked. + view->childSetEnabled("everyone_export", false); + else + view->childSetEnabled("everyone_export", LFSimFeatureHandler::instance().simSupportsExport() && (LLFloaterPerms::getNextOwnerPerms() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED); + } + } +} LLFloaterPerms::LLFloaterPerms(const LLSD& seed) { @@ -49,11 +78,35 @@ LLFloaterPerms::LLFloaterPerms(const LLSD& seed) BOOL LLFloaterPerms::postBuild() { - childSetEnabled("next_owner_transfer", gSavedSettings.getBOOL("NextOwnerCopy")); + //handle_checkboxes + { + bool export_support = LFSimFeatureHandler::instance().simSupportsExport(); + const U32 next_owner_perms = getNextOwnerPerms(); + childSetEnabled("everyone_export", export_support && (next_owner_perms & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED); + if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) + childSetVisible("everyone_export", false); + + if (!(next_owner_perms & PERM_COPY)) + { + childSetEnabled("next_owner_transfer", false); + } + else if (export_support) + { + bool export_off = !gSavedPerAccountSettings.getBOOL("EveryoneExport"); + childSetEnabled("next_owner_copy", export_off); + childSetEnabled("next_owner_modify", export_off); + childSetEnabled("next_owner_transfer", export_off); + } + else // Set EveryoneExport false, just in case. + gSavedPerAccountSettings.setBOOL("EveryoneExport", false); + } childSetAction("help", onClickHelp, this); childSetAction("ok", onClickOK, this); childSetAction("cancel", onClickCancel, this); - childSetCommitCallback("next_owner_copy", &onCommitCopy, this); + getChild("next_owner_copy")->setCommitCallback(handle_checkboxes); + getChild("next_owner_modify")->setCommitCallback(handle_checkboxes); + getChild("next_owner_transfer")->setCommitCallback(handle_checkboxes); + getChild("everyone_export")->setCommitCallback(handle_checkboxes); refresh(); @@ -76,20 +129,6 @@ void LLFloaterPerms::onClickCancel(void* data) self->close(); } -//static -void LLFloaterPerms::onCommitCopy(LLUICtrl* ctrl, void* data) -{ - LLFloaterPerms* self = static_cast(data); - // Implements fair use - BOOL copyable = gSavedSettings.getBOOL("NextOwnerCopy"); - if(!copyable) - { - gSavedSettings.setBOOL("NextOwnerTransfer", TRUE); - } - LLCheckBoxCtrl* xfer = self->getChild("next_owner_transfer"); - xfer->setEnabled(copyable); -} - void LLFloaterPerms::ok() { refresh(); // Changes were already applied to saved settings. Refreshing internal values makes it official. @@ -102,6 +141,7 @@ void LLFloaterPerms::cancel() gSavedSettings.setBOOL("NextOwnerCopy", mNextOwnerCopy); gSavedSettings.setBOOL("NextOwnerModify", mNextOwnerModify); gSavedSettings.setBOOL("NextOwnerTransfer", mNextOwnerTransfer); + gSavedPerAccountSettings.setBOOL("EveryoneExport", everyone_export); } void LLFloaterPerms::refresh() @@ -111,6 +151,7 @@ void LLFloaterPerms::refresh() mNextOwnerCopy = gSavedSettings.getBOOL("NextOwnerCopy"); mNextOwnerModify = gSavedSettings.getBOOL("NextOwnerModify"); mNextOwnerTransfer = gSavedSettings.getBOOL("NextOwnerTransfer"); + everyone_export = gSavedPerAccountSettings.getBOOL("EveryoneExport"); } void LLFloaterPerms::onClose(bool app_quitting) @@ -130,7 +171,12 @@ U32 LLFloaterPerms::getGroupPerms(std::string prefix) //static U32 LLFloaterPerms::getEveryonePerms(std::string prefix) { - return gSavedSettings.getBOOL(prefix+"EveryoneCopy") ? PERM_COPY : PERM_NONE; + U32 flags = PERM_NONE; + if (LFSimFeatureHandler::instance().simSupportsExport() && prefix.empty() && gSavedPerAccountSettings.getBOOL("EveryoneExport")) // TODO: Bulk enable export? + flags |= PERM_EXPORT; + if (gSavedSettings.getBOOL(prefix+"EveryoneCopy")) + flags |= PERM_COPY; + return flags; } //static diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h index 805039efe..9193b5983 100644 --- a/indra/newview/llfloaterperms.h +++ b/indra/newview/llfloaterperms.h @@ -47,7 +47,6 @@ public: void cancel(); static void onClickOK(void*); static void onClickCancel(void*); - static void onCommitCopy(LLUICtrl* ctrl, void* data); // Convenience methods to get current permission preference bitfields from saved settings: static U32 getEveryonePerms(std::string prefix=""); // prefix + "EveryoneCopy" static U32 getGroupPerms(std::string prefix=""); // prefix + "ShareWithGroup" diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 34a51e018..cbd42ac0b 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -60,6 +60,7 @@ #include "lluictrlfactory.h" +#include "lfsimfeaturehandler.h" #include "hippogridmanager.h" @@ -67,6 +68,8 @@ #include "rlvhandler.h" // [/RLVa:KB] +bool can_set_export(const U32& base, const U32& own, const U32& next); + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPropertiesObserver // @@ -197,6 +200,9 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& // everyone permissions childSetCommitCallback("CheckEveryoneCopy",&onCommitPermissions, this); childSetCommitCallback("CheckEveryoneMove",&onCommitPermissions, this); + childSetCommitCallback("CheckExport", &onCommitPermissions, this); + if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) + LFSimFeatureHandler::instance().setSupportsExportCallback(boost::bind(&LLFloaterProperties::refresh, this)); // next owner permissions childSetCommitCallback("CheckNextOwnerModify",&onCommitPermissions, this); childSetCommitCallback("CheckNextOwnerCopy",&onCommitPermissions, this); @@ -251,11 +257,13 @@ void LLFloaterProperties::refresh() "CheckOwnerModify", "CheckOwnerCopy", "CheckOwnerTransfer", + "CheckOwnerExport", "CheckGroupCopy", "CheckGroupMod", "CheckGroupMove", "CheckEveryoneCopy", "CheckEveryoneMove", + "CheckExport", "CheckNextOwnerModify", "CheckNextOwnerCopy", "CheckNextOwnerTransfer", @@ -437,6 +445,12 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) childSetEnabled("CheckOwnerTransfer",FALSE); childSetValue("CheckOwnerTransfer",LLSD((BOOL)(owner_mask & PERM_TRANSFER))); + bool supports_export = LFSimFeatureHandler::instance().simSupportsExport(); + childSetEnabled("CheckOwnerExport",false); + childSetValue("CheckOwnerExport", supports_export && owner_mask & PERM_EXPORT); + if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) + childSetVisible("CheckOwnerExport", false); + /////////////////////// // DEBUG PERMISSIONS // /////////////////////// @@ -459,11 +473,15 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) perm_string = "B: "; perm_string += mask_to_string(base_mask); + if (!supports_export && base_mask & PERM_EXPORT) // Hide Export when not available + perm_string.erase(perm_string.find_last_of("E")); childSetText("BaseMaskDebug",perm_string); childSetVisible("BaseMaskDebug",TRUE); perm_string = "O: "; perm_string += mask_to_string(owner_mask); + if (!supports_export && owner_mask & PERM_EXPORT) // Hide Export when not available + perm_string.erase(perm_string.find_last_of("E")); childSetText("OwnerMaskDebug",perm_string); childSetVisible("OwnerMaskDebug",TRUE); @@ -476,6 +494,8 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) perm_string = "E"; perm_string += overwrite_everyone ? "*: " : ": "; perm_string += mask_to_string(everyone_mask); + if (!supports_export && everyone_mask & PERM_EXPORT) // Hide Export when not available + perm_string.erase(perm_string.find_last_of("E")); childSetText("EveryoneMaskDebug",perm_string); childSetVisible("EveryoneMaskDebug",TRUE); @@ -519,6 +539,8 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) childSetEnabled("CheckEveryoneCopy",false); childSetEnabled("CheckEveryoneMove",false); } + childSetEnabled("CheckExport", supports_export && item->getType() != LLAssetType::AT_OBJECT && gAgentID == item->getCreatorUUID() + && can_set_export(base_mask, owner_mask, next_owner_mask)); // Set values. BOOL is_group_copy = (group_mask & PERM_COPY) ? TRUE : FALSE; @@ -531,6 +553,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) childSetValue("CheckEveryoneCopy",LLSD((BOOL)(everyone_mask & PERM_COPY))); childSetValue("CheckEveryoneMove",LLSD((BOOL)(everyone_mask & PERM_MOVE))); + childSetValue("CheckExport", supports_export && everyone_mask & PERM_EXPORT); /////////////// // SALE INFO // @@ -545,10 +568,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) childSetEnabled("SaleLabel",is_complete); childSetEnabled("CheckPurchase",is_complete); - childSetEnabled("NextOwnerLabel",TRUE); - childSetEnabled("CheckNextOwnerModify",base_mask & PERM_MODIFY); - childSetEnabled("CheckNextOwnerCopy",base_mask & PERM_COPY); - childSetEnabled("CheckNextOwnerTransfer",next_owner_mask & PERM_COPY); + bool no_export = !(everyone_mask & PERM_EXPORT); // Next owner perms can't be changed if set + childSetEnabled("NextOwnerLabel", no_export); + childSetEnabled("CheckNextOwnerModify", no_export && base_mask & PERM_MODIFY); + childSetEnabled("CheckNextOwnerCopy", no_export && base_mask & PERM_COPY); + childSetEnabled("CheckNextOwnerTransfer", no_export && next_owner_mask & PERM_COPY); childSetEnabled("RadioSaleType",is_complete && is_for_sale); childSetEnabled("TextPrice",is_complete && is_for_sale); @@ -750,6 +774,11 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), CheckEveryoneCopy->get(), PERM_COPY); } + LLCheckBoxCtrl* CheckExport = self->getChild("CheckExport"); + if(CheckExport) + { + perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), CheckExport->get(), PERM_EXPORT); + } LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild("CheckNextOwnerModify"); if(CheckNextOwnerModify) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 382d747a5..e8cb41ad5 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -160,6 +160,39 @@ void unpack_request_params( */ +namespace +{ + void on_caps_received(LLTabContainer* tab) + { + if (!tab) return; + const LLViewerRegion* region = gAgent.getRegion(); + tab->enableTabButton(tab->getIndexForPanel(tab->getPanelByName("panel_env_info")), region && !region->getCapability("EnvironmentSettings").empty()); + } + + void handle_opposite(const bool& off, LLUICtrl* opposite) + { + opposite->setEnabled(!off); + if (off) opposite->setValue(false); + } + + void on_change_use_other_sun(const LLSD& param, LLUICtrl* opposite, LLUICtrl* slider) + { + handle_opposite(param.asBoolean(), opposite); + slider->setEnabled(false); + } + + void on_change_fixed_sun(const LLSD& param, LLUICtrl* opposite, LLUICtrl* slider) + { + bool fixed_sun = param.asBoolean(); + handle_opposite(fixed_sun, opposite); + slider->setEnabled(fixed_sun); + } + + const float get_sun_hour(const LLUICtrl* sun_hour) + { + return sun_hour->getEnabled() ? sun_hour->getValue().asFloat() : 0.f; + } +} bool estate_dispatch_initialized = false; @@ -352,6 +385,15 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) LLTrans::findString(sim_type, sim_type); // try localizing sim product name } + // Disable Environment Tab when not supported + if (region) + { + if (region->capabilitiesReceived()) + on_caps_received(tab); + else + region->setCapabilitiesReceivedCallback(boost::bind(on_caps_received, tab)); + } + // GENERAL PANEL panel = tab->getChild("General"); panel->getChild("region_text")->setValue(LLSD(sim_name)); @@ -629,6 +671,27 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region) getChildView("im_btn")->setEnabled(allow_modify); getChildView("manage_telehub_btn")->setEnabled(allow_modify); + // Support Legacy Region Environment + { + const LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + bool estate_sun = region_info.mUseEstateSun; + getChild("use_estate_sun_check")->setValue(estate_sun); + getChild("fixed_sun_check")->setEnabled(allow_modify && !estate_sun); + getChild("sun_hour_slider")->setEnabled(allow_modify && !estate_sun); + if (estate_sun) + { + getChild("use_estate_sun_check")->setEnabled(allow_modify); + getChild("fixed_sun_check")->setValue(false); + } + else + { + bool fixed_sun = region_info.getUseFixedSun(); + getChild("use_estate_sun_check")->setEnabled(allow_modify && !fixed_sun); + getChild("fixed_sun_check")->setValue(fixed_sun); + getChild("sun_hour_slider")->setValue(region_info.mSunHour); + } + } + // Data gets filled in by processRegionInfo return LLPanelRegionInfo::refreshFromRegion(region); @@ -647,6 +710,9 @@ BOOL LLPanelRegionGeneralInfo::postBuild() initCtrl("access_combo"); initCtrl("restrict_pushobject"); initCtrl("block_parcel_search_check"); + initCtrl("use_estate_sun_check"); + initCtrl("fixed_sun_check"); + initCtrl("sun_hour_slider"); initHelpBtn("terraform_help", "HelpRegionBlockTerraform"); initHelpBtn("fly_help", "HelpRegionBlockFly"); @@ -658,12 +724,23 @@ BOOL LLPanelRegionGeneralInfo::postBuild() initHelpBtn("land_resell_help", "HelpRegionLandResell"); initHelpBtn("parcel_changes_help", "HelpParcelChanges"); initHelpBtn("parcel_search_help", "HelpRegionSearch"); + initHelpBtn("use_estate_sun_help", "HelpRegionUseEstateSun"); + initHelpBtn("fixed_sun_help", "HelpRegionFixedSun"); childSetAction("kick_btn", boost::bind(&LLPanelRegionGeneralInfo::onClickKick, this)); childSetAction("kick_all_btn", onClickKickAll, this); childSetAction("im_btn", onClickMessage, this); childSetAction("manage_telehub_btn", boost::bind(&LLPanelRegionGeneralInfo::onClickManageTelehub, this)); + // Set up the Legacy Region Environment checkboxes + { + LLUICtrl* estate_sun = getChild("use_estate_sun_check"); + LLUICtrl* fixed_sun = getChild("fixed_sun_check"); + LLUICtrl* hour_slider = getChild("sun_hour_slider"); + estate_sun->setCommitCallback(boost::bind(on_change_use_other_sun, _2, fixed_sun, hour_slider)); + fixed_sun->setCommitCallback(boost::bind(on_change_fixed_sun, _2, estate_sun, hour_slider)); + } + return LLPanelRegionInfo::postBuild(); } @@ -839,6 +916,13 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings); } + // Send the Legacy Region Environment + LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + region_info.mUseEstateSun = getChild("use_estate_sun_check")->getValue().asBoolean(); + region_info.setUseFixedSun(getChild("fixed_sun_check")->getValue().asBoolean()); + region_info.mSunHour = get_sun_hour(getChild("sun_hour_slider")); + region_info.sendRegionTerrain(LLFloaterRegionInfo::getLastInvoice()); + // if we changed access levels, tell user about it LLViewerRegion* region = gAgent.getRegion(); if (region && (getChild("access_combo")->getValue().asInteger() != region->getSimAccess()) ) @@ -2015,11 +2099,16 @@ BOOL LLPanelEstateInfo::postBuild() { // set up the callbacks for the generic controls initCtrl("externally_visible_check"); + initCtrl("use_global_time_check"); + initCtrl("fixed_sun_check"); + initCtrl("sun_hour_slider"); initCtrl("allow_direct_teleport"); initCtrl("limit_payment"); initCtrl("limit_age_verified"); initCtrl("voice_chat_check"); initHelpBtn("estate_manager_help", "HelpEstateEstateManager"); + initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime"); + initHelpBtn("fixed_sun_help", "HelpEstateFixedSun"); initHelpBtn("externally_visible_help", "HelpEstateExternallyVisible"); initHelpBtn("allow_direct_teleport_help", "HelpEstateAllowDirectTeleport"); initHelpBtn("allow_resident_help", "HelpEstateAllowResident"); @@ -2027,6 +2116,15 @@ BOOL LLPanelEstateInfo::postBuild() initHelpBtn("ban_resident_help", "HelpEstateBanResident"); initHelpBtn("voice_chat_help", "HelpEstateVoiceChat"); + // Set up the Legacy Estate Environment checkboxes + { + LLUICtrl* global_time = getChild("use_global_time_check"); + LLUICtrl* fixed_sun = getChild("fixed_sun_check"); + LLUICtrl* hour_slider = getChild("sun_hour_slider"); + global_time->setCommitCallback(boost::bind(on_change_use_other_sun, _2, fixed_sun, hour_slider)); + fixed_sun->setCommitCallback(boost::bind(on_change_fixed_sun, _2, global_time, hour_slider)); + } + getChild("allowed_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl *avatar_name_list = getChild("allowed_avatar_name_list"); if (avatar_name_list) @@ -2106,14 +2204,36 @@ void LLPanelEstateInfo::refreshFromEstate() getChild("limit_payment")->setValue(estate_info.getDenyAnonymous()); getChild("limit_age_verified")->setValue(estate_info.getDenyAgeUnverified()); - // Ensure appriopriate state of the management UI + // Ensure appropriate state of the management UI updateControls(gAgent.getRegion()); + // Support Legacy Estate Environment + { + const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + bool global_time = estate_info.getGlobalTime(); + getChild("use_global_time_check")->setValue(global_time); + getChild("fixed_sun_check")->setEnabled(!global_time); + getChild("sun_hour_slider")->setEnabled(!global_time); + if (global_time) + { + getChild("use_global_time_check")->setEnabled(true); + getChild("fixed_sun_check")->setValue(false); + } + else + { + bool fixed_sun = estate_info.getUseFixedSun(); + getChild("use_global_time_check")->setEnabled(!fixed_sun); + getChild("fixed_sun_check")->setValue(fixed_sun); + F32 sun_hour = estate_info.getSunHour(); + if (sun_hour < 6.0f) sun_hour += 24.0f; + getChild("sun_hour_slider")->setValue(sun_hour); + } + } refresh(); } BOOL LLPanelEstateInfo::sendUpdate() { - llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; + llinfos << "LLPanelEstateInfo::sendUpdate()" << llendl; LLNotification::Params params("ChangeLindenEstate"); params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); @@ -2141,8 +2261,9 @@ bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, con LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); // update model - estate_info.setUseFixedSun(false); // we don't support fixed sun estates anymore estate_info.setIsExternallyVisible(getChild("externally_visible_check")->getValue().asBoolean()); + estate_info.setUseFixedSun(getChild("fixed_sun_check")->getValue().asBoolean()); + estate_info.setSunHour(get_sun_hour(getChild("sun_hour_slider"))); estate_info.setAllowDirectTeleport(getChild("allow_direct_teleport")->getValue().asBoolean()); estate_info.setDenyAnonymous(getChild("limit_payment")->getValue().asBoolean()); estate_info.setDenyAgeUnverified(getChild("limit_age_verified")->getValue().asBoolean()); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 953f7c097..7c9cd398a 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -2606,3 +2606,32 @@ const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id) return FALSE; } +BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) +{ + LLView* chat_editor = getChildView("chat_editor"); + if (getVisible() && childIsVisible("chat_editor")) + { + gFocusMgr.setKeyboardFocus(chat_editor); + + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + + return TRUE; + } + + return LLUICtrl::focusFirstItem(prefer_text_fields, focus_flash); +} + +void LLFloaterIMPanel::onFocusReceived() +{ + LLView* chat_editor = getChildView("chat_editor"); + if (getVisible() && childIsVisible("chat_editor")) + { + gFocusMgr.setKeyboardFocus(chat_editor); + + LLUICtrl * ctrl = static_cast(chat_editor); + ctrl->setFocus(TRUE); + } + + LLFloater::onFocusReceived(); +} diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 54a12c9d0..d8aac2be7 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -231,6 +231,9 @@ public: void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE ); + + void onFocusReceived(); void onInputEditorFocusReceived(); void onInputEditorFocusLost(); static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata); diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 269a1f479..a6a181014 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -105,7 +105,7 @@ LLPanelDisplay::LLPanelDisplay() BOOL LLPanelDisplay::postBuild() { // return to default values - childSetAction("Defaults", setHardwareDefaults, NULL); + getChild("Defaults")->setClickedCallback(boost::bind(&LLPanelDisplay::setHardwareDefaults)); //============================================================================ // Resolution @@ -113,8 +113,7 @@ BOOL LLPanelDisplay::postBuild() // radio set for fullscreen size mCtrlWindowed = getChild( "windowed mode"); - mCtrlWindowed->setCommitCallback(&LLPanelDisplay::onCommitWindowedMode); - mCtrlWindowed->setCallbackUserData(this); + mCtrlWindowed->setCommitCallback(boost::bind(&LLPanelDisplay::onCommitWindowedMode,this)); mAspectRatioLabel1 = getChild("AspectRatioLabel1"); mDisplayResLabel = getChild("DisplayResLabel"); @@ -194,25 +193,22 @@ BOOL LLPanelDisplay::postBuild() } mCtrlAspectRatio = getChild( "aspect_ratio"); - mCtrlAspectRatio->setTextEntryCallback(onKeystrokeAspectRatio); - mCtrlAspectRatio->setCommitCallback(onSelectAspectRatio); - mCtrlAspectRatio->setCallbackUserData(this); + mCtrlAspectRatio->setTextEntryCallback(&LLPanelDisplay::onKeystrokeAspectRatio); + mCtrlAspectRatio->setCallbackUserData(this); + mCtrlAspectRatio->setCommitCallback(boost::bind(&LLPanelDisplay::onSelectAspectRatio,this)); // add default aspect ratios mCtrlAspectRatio->add(aspect_ratio_text, &mAspectRatio, ADD_TOP); mCtrlAspectRatio->setCurrentByIndex(0); mCtrlAutoDetectAspect = getChild( "aspect_auto_detect"); - mCtrlAutoDetectAspect->setCommitCallback(onCommitAutoDetectAspect); - mCtrlAutoDetectAspect->setCallbackUserData(this); + mCtrlAutoDetectAspect->setCommitCallback(boost::bind(&LLPanelDisplay::onCommitAutoDetectAspect,this,_2)); // radio performance box mCtrlSliderQuality = getChild("QualityPerformanceSelection"); - mCtrlSliderQuality->setSliderMouseUpCallback(boost::bind(&LLPanelDisplay::onChangeQuality,mCtrlSliderQuality,this)); - mCtrlSliderQuality->setCallbackUserData(this); + mCtrlSliderQuality->setSliderMouseUpCallback(boost::bind(&LLPanelDisplay::onChangeQuality,this,_1)); mCtrlCustomSettings = getChild("CustomSettings"); - mCtrlCustomSettings->setCommitCallback(onChangeCustom); - mCtrlCustomSettings->setCallbackUserData(this); + mCtrlCustomSettings->setCommitCallback(boost::bind(&LLPanelDisplay::onChangeCustom)); //mGraphicsBorder = getChild("GraphicsBorder"); @@ -226,24 +222,19 @@ BOOL LLPanelDisplay::postBuild() //---------------------------------------------------------------------------- // Enable Reflections mCtrlReflectionDetail = getChild("ReflectionDetailCombo"); - mCtrlReflectionDetail->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlReflectionDetail->setCallbackUserData(this); + mCtrlReflectionDetail->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); // WindLight mCtrlWindLight = getChild("WindLightUseAtmosShaders"); - mCtrlWindLight->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlWindLight->setCallbackUserData(this); + mCtrlWindLight->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); // Deferred mCtrlDeferred = getChild("RenderDeferred"); - mCtrlDeferred->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlDeferred->setCallbackUserData(this); + mCtrlDeferred->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); mCtrlDeferredDoF = getChild("RenderDepthOfField"); - mCtrlDeferredDoF->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlDeferredDoF->setCallbackUserData(this); + mCtrlDeferredDoF->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); mCtrlShadowDetail = getChild("ShadowDetailCombo"); - mCtrlShadowDetail->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlShadowDetail->setCallbackUserData(this); + mCtrlShadowDetail->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); //---------------------------------------------------------------------------- // Terrain Scale @@ -252,15 +243,13 @@ BOOL LLPanelDisplay::postBuild() //---------------------------------------------------------------------------- // Enable Avatar Shaders mCtrlAvatarVP = getChild("AvatarVertexProgram"); - mCtrlAvatarVP->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlAvatarVP->setCallbackUserData(this); + mCtrlAvatarVP->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); //---------------------------------------------------------------------------- // Avatar Render Mode mCtrlAvatarCloth = getChild("AvatarCloth"); mCtrlAvatarImpostors = getChild("AvatarImpostors"); - mCtrlAvatarImpostors->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlAvatarImpostors->setCallbackUserData(this); + mCtrlAvatarImpostors->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); mCtrlNonImpostors = getChild("AvatarMaxVisible"); //---------------------------------------------------------------------------- @@ -278,8 +267,7 @@ BOOL LLPanelDisplay::postBuild() //---------------------------------------------------------------------------- // Global Shader Enable mCtrlShaderEnable = getChild("BasicShaders"); - mCtrlShaderEnable->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); - mCtrlShaderEnable->setCallbackUserData(this); + mCtrlShaderEnable->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); //============================================================================ @@ -287,50 +275,42 @@ BOOL LLPanelDisplay::postBuild() mCtrlDrawDistance = getChild("DrawDistance"); mDrawDistanceMeterText1 = getChild("DrawDistanceMeterText1"); mDrawDistanceMeterText2 = getChild("DrawDistanceMeterText2"); - mCtrlDrawDistance->setCommitCallback(&LLPanelDisplay::updateMeterText); - mCtrlDrawDistance->setCallbackUserData(this); + mCtrlDrawDistance->setCommitCallback(boost::bind(&LLPanelDisplay::updateMeterText, this)); // Object detail slider mCtrlLODFactor = getChild("ObjectMeshDetail"); mLODFactorText = getChild("ObjectMeshDetailText"); - mCtrlLODFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlLODFactor->setCallbackUserData(mLODFactorText); + mCtrlLODFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1,mLODFactorText)); // Flex object detail slider mCtrlFlexFactor = getChild("FlexibleMeshDetail"); mFlexFactorText = getChild("FlexibleMeshDetailText"); - mCtrlFlexFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlFlexFactor->setCallbackUserData(mFlexFactorText); + mCtrlFlexFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText,_1, mFlexFactorText)); // Tree detail slider mCtrlTreeFactor = getChild("TreeMeshDetail"); mTreeFactorText = getChild("TreeMeshDetailText"); - mCtrlTreeFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlTreeFactor->setCallbackUserData(mTreeFactorText); + mCtrlTreeFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mTreeFactorText)); // Avatar detail slider mCtrlAvatarFactor = getChild("AvatarMeshDetail"); mAvatarFactorText = getChild("AvatarMeshDetailText"); - mCtrlAvatarFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlAvatarFactor->setCallbackUserData(mAvatarFactorText); + mCtrlAvatarFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mAvatarFactorText)); // Avatar physics detail slider mCtrlAvatarPhysicsFactor = getChild("AvatarPhysicsDetail"); mAvatarPhysicsFactorText = getChild("AvatarPhysicsDetailText"); - mCtrlAvatarPhysicsFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlAvatarPhysicsFactor->setCallbackUserData(mAvatarPhysicsFactorText); + mCtrlAvatarPhysicsFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mAvatarPhysicsFactorText)); // Terrain detail slider mCtrlTerrainFactor = getChild("TerrainMeshDetail"); mTerrainFactorText = getChild("TerrainMeshDetailText"); - mCtrlTerrainFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlTerrainFactor->setCallbackUserData(mTerrainFactorText); + mCtrlTerrainFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mTerrainFactorText)); // Terrain detail slider mCtrlSkyFactor = getChild("SkyMeshDetail"); mSkyFactorText = getChild("SkyMeshDetailText"); - mCtrlSkyFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlSkyFactor->setCallbackUserData(mSkyFactorText); + mCtrlSkyFactor->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mSkyFactorText)); // Particle detail slider mCtrlMaxParticle = getChild("MaxParticleCount"); @@ -338,8 +318,7 @@ BOOL LLPanelDisplay::postBuild() // Glow detail slider mCtrlPostProcess = getChild("RenderPostProcess"); mPostProcessText = getChild("PostProcessText"); - mCtrlPostProcess->setCommitCallback(&LLPanelDisplay::updateSliderText); - mCtrlPostProcess->setCallbackUserData(mPostProcessText); + mCtrlPostProcess->setCommitCallback(boost::bind(&LLPanelDisplay::updateSliderText, _1, mPostProcessText)); // Text boxes (for enabling/disabling) mShaderText = getChild("ShadersText"); @@ -351,7 +330,11 @@ BOOL LLPanelDisplay::postBuild() mTerrainScaleText = getChild("TerrainScaleText"); // Hardware tab - childSetCommitCallback("vbo", &LLPanelDisplay::onRenderVBOEnable, this); + mVBO = getChild("vbo"); + mVBO->setCommitCallback(boost::bind(&LLPanelDisplay::onVertexShaderEnable)); + + mVBOStream = getChild("vbo_stream"); + refresh(); @@ -598,13 +581,13 @@ void LLPanelDisplay::refreshEnabledState() if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { - childSetEnabled("vbo", false); + mVBO->setEnabled(false); //Streaming VBOs -Shyotl - childSetEnabled("vbo_stream", false); + mVBOStream->setEnabled(false); } else { - childSetEnabled("vbo_stream", LLVertexBuffer::sEnableVBOs); + mVBOStream->setEnabled(gSavedSettings.getBOOL("RenderVBOEnable")); } // if no windlight shaders, enable gamma, and fog distance @@ -811,7 +794,7 @@ void LLPanelDisplay::setHiddenGraphicsState(bool isHidden) // hide one meter text if we're making things visible if(!isHidden) { - updateMeterText(mCtrlDrawDistance, this); + updateMeterText(); } mMeshDetailText->setVisible(!isHidden); @@ -900,12 +883,11 @@ void LLPanelDisplay::apply() } } -void LLPanelDisplay::onChangeQuality(LLUICtrl *ctrl, void *data) +void LLPanelDisplay::onChangeQuality(LLUICtrl* caller) { - LLSliderCtrl* sldr = static_cast(ctrl); - LLPanelDisplay* cur_panel = static_cast(data); + LLSlider* sldr = dynamic_cast(caller); - if(sldr == NULL || cur_panel == NULL) + if(sldr == NULL) { return; } @@ -914,19 +896,14 @@ void LLPanelDisplay::onChangeQuality(LLUICtrl *ctrl, void *data) LLFeatureManager::getInstance()->setGraphicsLevel(set, true); LLFloaterPreference::refreshEnabledGraphics(); - cur_panel->refresh(); + refresh(); } -void LLPanelDisplay::onChangeCustom(LLUICtrl *ctrl, void *data) +void LLPanelDisplay::onChangeCustom() { LLFloaterPreference::refreshEnabledGraphics(); } -void LLPanelDisplay::onApplyResolution(LLUICtrl* src, void* user_data) -{ - ((LLPanelDisplay*) src)->applyResolution(); -} - void LLPanelDisplay::applyResolution() { @@ -1018,20 +995,14 @@ void LLPanelDisplay::applyWindowSize() } } -//static -void LLPanelDisplay::onCommitWindowedMode(LLUICtrl* ctrl, void *data) +void LLPanelDisplay::onCommitWindowedMode() { - LLPanelDisplay *panel = (LLPanelDisplay*)data; - - panel->refresh(); + refresh(); } -//static -void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data) +void LLPanelDisplay::onCommitAutoDetectAspect(const LLSD& value) { - LLPanelDisplay *panel = (LLPanelDisplay*)data; - - BOOL auto_detect = ((LLCheckBoxCtrl*)ctrl)->get(); + BOOL auto_detect = value.asBoolean(); F32 ratio; if (auto_detect) @@ -1053,27 +1024,23 @@ void LLPanelDisplay::onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data) aspect = llformat("%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); } - panel->mCtrlAspectRatio->setLabel(aspect); + mCtrlAspectRatio->setLabel(aspect); ratio = gViewerWindow->mWindow->getNativeAspectRatio(); gSavedSettings.setF32("FullScreenAspectRatio", ratio); } } -//static -void LLPanelDisplay::onKeystrokeAspectRatio(LLLineEditor* caller, void* user_data) +void LLPanelDisplay::onKeystrokeAspectRatio(LLLineEditor* caller, void *user_data) { - LLPanelDisplay* panel = (LLPanelDisplay*)user_data; + LLPanelDisplay* panel = (LLPanelDisplay*)user_data; panel->mCtrlAutoDetectAspect->set(FALSE); } -//static -void LLPanelDisplay::onSelectAspectRatio(LLUICtrl*, void* user_data) +void LLPanelDisplay::onSelectAspectRatio() { - LLPanelDisplay* panel = (LLPanelDisplay*)user_data; - - panel->mCtrlAutoDetectAspect->set(FALSE); + mCtrlAutoDetectAspect->set(FALSE); } //static @@ -1092,22 +1059,13 @@ void LLPanelDisplay::fractionFromDecimal(F32 decimal_val, S32& numerator, S32& d } } -//static -void LLPanelDisplay::onVertexShaderEnable(LLUICtrl* self, void* data) +void LLPanelDisplay::onVertexShaderEnable() { LLFloaterPreference::refreshEnabledGraphics(); } //static -void LLPanelDisplay::onRenderVBOEnable(LLUICtrl* self, void* data) -{ - LLPanelDisplay* panel = (LLPanelDisplay*)data; - bool enable = panel->childGetValue("vbo").asBoolean(); - panel->childSetEnabled("vbo_stream", enable); - if(!enable) panel->childSetValue("vbo_stream", false); -} - -void LLPanelDisplay::setHardwareDefaults(void* user_data) +void LLPanelDisplay::setHardwareDefaults() { LLFeatureManager::getInstance()->applyRecommendedSettings(); LLControlVariable* controlp = gSavedSettings.getControl("RenderAvatarMaxVisible"); @@ -1118,11 +1076,11 @@ void LLPanelDisplay::setHardwareDefaults(void* user_data) LLFloaterPreference::refreshEnabledGraphics(); } -void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, void* user_data) +//static +void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, LLTextBox* text_box) { // get our UI widgets - LLTextBox* text_box = (LLTextBox*)user_data; - LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; + LLSliderCtrl* slider = dynamic_cast(ctrl); if(text_box == NULL || slider == NULL) { return; @@ -1160,20 +1118,13 @@ void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, void* user_data) } } -void LLPanelDisplay::updateMeterText(LLUICtrl* ctrl, void* user_data) +void LLPanelDisplay::updateMeterText() { - // get our UI widgets - LLPanelDisplay* panel = (LLPanelDisplay*)user_data; - LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; - - LLTextBox* m1 = panel->getChild("DrawDistanceMeterText1"); - LLTextBox* m2 = panel->getChild("DrawDistanceMeterText2"); - // toggle the two text boxes based on whether we have 2 or 3 digits - F32 val = slider->getValueF32(); + F32 val = mCtrlDrawDistance->getValueF32(); bool two_digits = val < 100; - m1->setVisible(two_digits); - m2->setVisible(!two_digits); + mDrawDistanceMeterText1->setVisible(two_digits); + mDrawDistanceMeterText2->setVisible(!two_digits); } diff --git a/indra/newview/llpaneldisplay.h b/indra/newview/llpaneldisplay.h index 304c674a4..07b6b6dbe 100644 --- a/indra/newview/llpaneldisplay.h +++ b/indra/newview/llpaneldisplay.h @@ -146,6 +146,9 @@ protected: LLTextBox *mShadowDetailText; LLTextBox *mTerrainScaleText; + LLCheckBoxCtrl *mVBO; + LLCheckBoxCtrl *mVBOStream; + BOOL mFSAutoDetectAspect; F32 mAspectRatio; @@ -192,31 +195,24 @@ protected: S32 mVideoCardMem; F32 mFogRatio; - static void setGraphicsSettings(LLControlGroup& group); - static void createGroup(); - // if the quality radio buttons are changed - static void onChangeQuality(LLUICtrl *ctrl, void *data); + void onChangeQuality(LLUICtrl* caller); // if the custom settings box is clicked - static void onChangeCustom(LLUICtrl *ctrl, void *data); + static void onChangeCustom(); - static void onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data); - static void onKeystrokeAspectRatio(LLLineEditor* caller, void* user_data); - static void onSelectAspectRatio(LLUICtrl*, void*); - static void onCommitWindowedMode(LLUICtrl* ctrl, void *data); - static void onApplyResolution(LLUICtrl* ctrl, void* data); - static void updateSliderText(LLUICtrl* ctrl, void* user_data); - static void updateMeterText(LLUICtrl* ctrl, void* user_data); + void onCommitAutoDetectAspect(const LLSD& value); + static void onKeystrokeAspectRatio(LLLineEditor* caller, void *user_data); + void onSelectAspectRatio(); + void onCommitWindowedMode(); + static void updateSliderText(LLUICtrl* ctrl, LLTextBox* text_box); + void updateMeterText(); /// callback for defaults - static void setHardwareDefaults(void *data); + static void setHardwareDefaults(); // callback for when client turns on shaders - static void onVertexShaderEnable(LLUICtrl*, void*); - - // callbacks for hardware tab - static void onRenderVBOEnable(LLUICtrl*, void*); + static void onVertexShaderEnable(); // helper function static void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 99ea6e9c4..d01185294 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -67,7 +67,9 @@ #include "lluictrlfactory.h" #include "roles_constants.h" #include "lltrans.h" +#include "llinventoryfunctions.h" +#include "lfsimfeaturehandler.h" #include "hippogridmanager.h" @@ -76,6 +78,32 @@ #include "rlvhandler.h" // [/RLVa:KB] +// base and own must have EXPORT, next owner must be UNRESTRICTED +bool can_set_export(const U32& base, const U32& own, const U32& next) +{ + return base & PERM_EXPORT && own & PERM_EXPORT && (next & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED; +} + +bool perms_allow_export(const LLPermissions& perms) +{ + return perms.getMaskBase() & PERM_EXPORT && perms.getMaskEveryone() & PERM_EXPORT; +} + +bool is_asset_exportable(const LLUUID& asset_id) +{ + if (asset_id.isNull()) return true; // Don't permission-check null textures + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(asset_id); + gInventory.collectDescendentsIf(LLUUID::null, cats, items, true, asset_id_matches, false); + + for (int i = 0; i < items.count(); ++i) + { + if (perms_allow_export(items[i]->getPermissions())) return true; + } + return false; +} + ///---------------------------------------------------------------------------- /// Class llpanelpermissions ///---------------------------------------------------------------------------- @@ -112,6 +140,8 @@ BOOL LLPanelPermissions::postBuild() childSetCommitCallback("checkbox allow everyone copy",LLPanelPermissions::onCommitEveryoneCopy,this); + getChild("checkbox allow export")->setCommitCallback(boost::bind(&LLPanelPermissions::onCommitExport, this, _2)); + childSetCommitCallback("checkbox for sale",LLPanelPermissions::onCommitSaleInfo,this); childSetCommitCallback("Edit Cost",LLPanelPermissions::onCommitSaleInfo,this); @@ -136,6 +166,9 @@ BOOL LLPanelPermissions::postBuild() mLabelGroupName = NULL; } + if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) + LFSimFeatureHandler::instance().setSupportsExportCallback(boost::bind(&LLPanelPermissions::refresh, this)); + return TRUE; } @@ -145,6 +178,13 @@ LLPanelPermissions::~LLPanelPermissions() // base class will take care of everything } +// virtual +void LLPanelPermissions::handleVisibilityChange(BOOL new_visibility) +{ + if (new_visibility) + refresh(); + LLPanel::handleVisibilityChange(new_visibility); +} void LLPanelPermissions::refresh() { @@ -223,10 +263,13 @@ void LLPanelPermissions::refresh() childSetEnabled("checkbox share with group",false); childSetEnabled("button deed",false); + childSetEnabled("text anyone can", false); childSetValue("checkbox allow everyone move",FALSE); childSetEnabled("checkbox allow everyone move",false); childSetValue("checkbox allow everyone copy",FALSE); childSetEnabled("checkbox allow everyone copy",false); + childSetValue("checkbox allow export", false); + childSetEnabled("checkbox allow export", false); //Next owner can: childSetEnabled("Next owner can:",false); @@ -601,6 +644,7 @@ void LLPanelPermissions::refresh() &next_owner_mask_on, &next_owner_mask_off); + bool supports_export = LFSimFeatureHandler::instance().simSupportsExport(); if( gSavedSettings.getBOOL("DebugPermissions") ) { @@ -610,6 +654,8 @@ void LLPanelPermissions::refresh() { perm_string = "B: "; perm_string += mask_to_string(base_mask_on); + if (!supports_export && base_mask_on & PERM_EXPORT) // Hide Export when not available + perm_string.erase(perm_string.find_last_of("E")); if (U32 diff_mask = base_mask_on ^ owner_mask_on) // When different, show the user's potential permissions lowercase. { if (diff_mask & PERM_MOVE) @@ -620,12 +666,16 @@ void LLPanelPermissions::refresh() LLStringUtil::replaceChar(perm_string, 'C', 'c'); if (diff_mask & PERM_TRANSFER) LLStringUtil::replaceChar(perm_string, 'T', 't'); + if (diff_mask & PERM_EXPORT) + LLStringUtil::replaceChar(perm_string, 'E', 'e'); } childSetText("B:",perm_string); childSetVisible("B:",true); perm_string = "O: "; perm_string += mask_to_string(owner_mask_on); + if (!supports_export && owner_mask_on & PERM_EXPORT) // Hide Export when not available + perm_string.erase(perm_string.find_last_of("E")); childSetText("O:",perm_string); childSetVisible("O:",true); @@ -636,6 +686,8 @@ void LLPanelPermissions::refresh() perm_string = "E: "; perm_string += mask_to_string(everyone_mask_on); + if (!supports_export && everyone_mask_on & PERM_EXPORT) // Hide Export when not available + perm_string.erase(perm_string.find_last_of("E")); childSetText("E:",perm_string); childSetVisible("E:",true); @@ -688,16 +740,41 @@ void LLPanelPermissions::refresh() if (has_change_perm_ability) { childSetEnabled("checkbox share with group",true); + childSetEnabled("text anyone can", true); childSetEnabled("checkbox allow everyone move",owner_mask_on & PERM_MOVE); childSetEnabled("checkbox allow everyone copy",owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("text anyone can", false); childSetEnabled("checkbox allow everyone move", FALSE); childSetEnabled("checkbox allow everyone copy", FALSE); } + // Is this user allowed to toggle export on this object? + if (supports_export && self_owned && mCreatorID == mOwnerID && can_set_export(base_mask_on, owner_mask_on, next_owner_mask_on)) + { + bool can_export = true; + LLInventoryObject::object_list_t objects; + objectp->getInventoryContents(objects); + for (LLInventoryObject::object_list_t::iterator i = objects.begin(); can_export && i != objects.end() ; ++i) //The object's inventory must have EXPORT. + { + LLViewerInventoryItem* item = static_cast(i->get()); //getInventoryContents() filters out categories, static_cast. + can_export = perms_allow_export(item->getPermissions()); + } + for (U8 i = 0; can_export && i < objectp->getNumTEs(); ++i) // Can the textures be exported? + if (LLTextureEntry* texture = objectp->getTE(i)) + can_export = is_asset_exportable(texture->getID()); + childSetEnabled("checkbox allow export", can_export); + } + else + { + childSetEnabled("checkbox allow export", false); + if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) + childSetVisible("checkbox allow export", false); + } + if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); @@ -706,10 +783,11 @@ void LLPanelPermissions::refresh() childSetTentative("checkbox for sale", is_for_sale_mixed); childSetEnabled("sale type",num_for_sale && can_transfer && !is_sale_price_mixed); - childSetEnabled("Next owner can:", TRUE); - childSetEnabled("checkbox next owner can modify",base_mask_on & PERM_MODIFY); - childSetEnabled("checkbox next owner can copy",base_mask_on & PERM_COPY); - childSetEnabled("checkbox next owner can transfer",next_owner_mask_on & PERM_COPY); + bool no_export = everyone_mask_off & PERM_EXPORT; // Next owner perms can't be changed if set + childSetEnabled("Next owner can:", no_export); + childSetEnabled("checkbox next owner can modify", no_export && base_mask_on & PERM_MODIFY); + childSetEnabled("checkbox next owner can copy", no_export && base_mask_on & PERM_COPY); + childSetEnabled("checkbox next owner can transfer", no_export && next_owner_mask_on & PERM_COPY); } else { @@ -779,6 +857,31 @@ void LLPanelPermissions::refresh() childSetValue("checkbox allow everyone copy",TRUE); childSetTentative("checkbox allow everyone copy",true); } + + // Export + if (supports_export) + { + if(everyone_mask_on & PERM_EXPORT) + { + childSetValue("checkbox allow export", true); + childSetTentative("checkbox allow export", false); + } + else if(everyone_mask_off & PERM_EXPORT) + { + childSetValue("checkbox allow export", false); + childSetTentative("checkbox allow export", false); + } + else + { + childSetValue("checkbox allow export", true); + childSetTentative("checkbox allow export", true); + } + } + else + { + childSetValue("checkbox allow export", false); + childSetTentative("checkbox allow export", false); + } } if(valid_next_perms) @@ -1064,6 +1167,11 @@ void LLPanelPermissions::onCommitEveryoneCopy(LLUICtrl *ctrl, void *data) onCommitPerm(ctrl, data, PERM_EVERYONE, PERM_COPY); } +void LLPanelPermissions::onCommitExport(const LLSD& param) +{ + LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_EVERYONE, param, PERM_EXPORT); +} + // static void LLPanelPermissions::onCommitNextOwnerModify(LLUICtrl* ctrl, void* data) { diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index 85ac41831..706067a01 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -57,6 +57,7 @@ public: virtual ~LLPanelPermissions(); virtual BOOL postBuild(); + virtual void handleVisibilityChange(BOOL new_visibility); // MANIPULATORS void refresh(); // refresh all labels as needed @@ -86,6 +87,7 @@ protected: static void onCommitEveryoneMove(LLUICtrl *ctrl, void *data); static void onCommitEveryoneCopy(LLUICtrl *ctrl, void *data); //static void onCommitEveryoneModify(LLUICtrl *ctrl, void *data); + void onCommitExport(const LLSD& param); static void onCommitNextOwnerModify(LLUICtrl* ctrl, void* data); static void onCommitNextOwnerCopy(LLUICtrl* ctrl, void* data); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index af2ee3723..5b5649256 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -283,8 +283,8 @@ void LLPreviewTexture::draw() mImage); static const LLCachedControl use_rmse_auto_mask("SHUseRMSEAutoMask",false); - static const LLCachedControl alpha_mas_max_rmse("SHAlphaMaskMaxRMSE",.09f); - if (mAlphaMaskResult != mImage->getIsAlphaMask(use_rmse_auto_mask ? alpha_mas_max_rmse : -1.f)) + static const LLCachedControl auto_mask_max_rmse("SHAutoMaskMaxRMSE",.09f); + if (mAlphaMaskResult != mImage->getIsAlphaMask(use_rmse_auto_mask ? auto_mask_max_rmse : -1.f)) { mAlphaMaskResult = !mAlphaMaskResult; if (!mAlphaMaskResult) diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index 590e24648..3892c8795 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -35,6 +35,7 @@ // viewer #include "llagent.h" #include "llviewerregion.h" +#include "llestateinfomodel.h" // For supporting legacy environment void LLRegionInfoModel::reset() { @@ -107,6 +108,17 @@ void LLRegionInfoModel::sendRegionTerrain(const LLUUID& invoice) const strings.push_back(buffer); buffer = llformat("%f", mSunHour); strings.push_back(buffer); + if (mUseEstateSun) + { + // Grab estate info, the user decided to set the region back to estate time. JC + LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + estate_global_time = estate_info.getGlobalTime(); + if (!estate_global_time) + { + estate_fixed_sun = estate_info.getUseFixedSun(); + estate_sun_hour = estate_info.getSunHour(); + } + } buffer = llformat("%s", (estate_global_time ? "Y" : "N") ); strings.push_back(buffer); buffer = llformat("%s", (estate_fixed_sun ? "Y" : "N") ); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 670306119..a751140f8 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1329,7 +1329,7 @@ bool LLTextureFetchWorker::doWork(S32 param) } LLHTTPClient::request(mUrl, LLHTTPClient::HTTP_GET, NULL, new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset, true), - headers/*,*/ DEBUG_CURLIO_PARAM(false), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL); + headers/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL); res = true; } if (!res) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 4f0326f46..1fa7a4eca 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -675,7 +675,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("SHUseRMSEAutoMask")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); - gSavedSettings.getControl("SHAlphaMaskMaxRMSE")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("SHAutoMaskMaxRMSE")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); //See LL jira VWR-3258 comment section. Implemented by LL in 2.1 -Shyotl diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index b95a96ad3..ee56d7b5d 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -123,7 +123,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel) if( ! mediaUrl.empty() && gSavedSettings.getWarning("FirstStreamingVideo") ) { LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(callback_play_media, _1, _2, parcel)); + boost::bind(&callback_play_media, _1, _2, parcel)); return; } @@ -903,35 +903,43 @@ void callback_media_alert(const LLSD ¬ification, const LLSD &response, LLParc LLViewerParcelMedia::playStreamingMusic(parcel, false); } } - else if (option == 1 || option == 2) // Deny or Blacklist + else { - LLViewerParcelMedia::sDeniedMedia.insert(domain); - if (ip != domain && domain.find('/') == std::string::npos) - { - LLViewerParcelMedia::sDeniedMedia.insert(ip); - } if (type == 1) { LLViewerParcelMedia::stopStreamingMusic(); } - if (option == 1) // Deny + else { - LLNotificationsUtil::add("MediaBlocked", args); + LLViewerParcelMedia::stopStreamingMusic(); } - else // Blacklist + if (option == 1 || option == 2) // Deny or Blacklist { - LLSD newmedia; - newmedia["domain"] = domain; - newmedia["action"] = "deny"; - LLViewerParcelMedia::sMediaFilterList.append(newmedia); + LLViewerParcelMedia::sDeniedMedia.insert(domain); if (ip != domain && domain.find('/') == std::string::npos) { - newmedia["domain"] = ip; - LLViewerParcelMedia::sMediaFilterList.append(newmedia); + LLViewerParcelMedia::sDeniedMedia.insert(ip); + } + + if (option == 1) // Deny + { + LLNotificationsUtil::add("MediaBlocked", args); + } + else // Blacklist + { + LLSD newmedia; + newmedia["domain"] = domain; + newmedia["action"] = "deny"; + LLViewerParcelMedia::sMediaFilterList.append(newmedia); + if (ip != domain && domain.find('/') == std::string::npos) + { + newmedia["domain"] = ip; + LLViewerParcelMedia::sMediaFilterList.append(newmedia); + } + LLViewerParcelMedia::saveDomainFilterList(); + args["LISTED"] = "blacklisted"; + LLNotificationsUtil::add("MediaListed", args); } - LLViewerParcelMedia::saveDomainFilterList(); - args["LISTED"] = "blacklisted"; - LLNotificationsUtil::add("MediaListed", args); } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9da17bf3d..fda306e0d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -370,8 +370,8 @@ public: } } static const LLCachedControl use_rmse_auto_mask("SHUseRMSEAutoMask",false); - static const LLCachedControl alpha_mas_max_rmse("SHAlphaMaskMaxRMSE",.09f); - addText(xpos, ypos, llformat("Mask: %s", imagep->getIsAlphaMask(use_rmse_auto_mask ? alpha_mas_max_rmse : -1.f) ? "TRUE":"FALSE")); ypos += y_inc; + static const LLCachedControl auto_mask_max_rmse("SHAutoMaskMaxRMSE",.09f); + addText(xpos, ypos, llformat("Mask: %s", imagep->getIsAlphaMask(use_rmse_auto_mask ? auto_mask_max_rmse : -1.f) ? "TRUE":"FALSE")); ypos += y_inc; addText(xpos, ypos, llformat("ID: %s", imagep->getID().asString().c_str())); ypos += y_inc; } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 044765ba0..9e9f785c7 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2404,6 +2404,14 @@ BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority) if (update_complete && assertInitialized()) { drawablep->setState(LLDrawable::BUILT); + //Workaround for 'missing prims' until it's fixed upstream by LL. + //Sometimes clearing CLEAR_INVISIBLE and FORCE_INVISIBLE in LLPipeline::stateSort was too late. Do it here instead, before + //the rebuild state is picked up on and LLVolumeGeometryManager::rebuildGeom is called. + //If the FORCE_INVISIBLE isn't cleared before the rebuildGeom call, the geometry will NOT BE REBUILT! + if(drawablep->isState(LLDrawable::CLEAR_INVISIBLE)) + { + drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE); + } mGeometryChanges++; } return update_complete; diff --git a/indra/newview/skins/apollo/keywords.ini b/indra/newview/skins/apollo/keywords.ini index 5a85f42a1..d6b7595f4 100644 --- a/indra/newview/skins/apollo/keywords.ini +++ b/indra/newview/skins/apollo/keywords.ini @@ -52,7 +52,7 @@ changed changed( integer change ):Triggered various event change the task:(tes remote_data remote_data(integer event_type, key channel, key message_id, string sender,integer idata, string sdata):Triggered by various XML-RPC calls (event_type will be one of REMOTE_DATA_CHANNEL, REMOTE_DATA_REQUEST, REMOTE_DATA_REPLY) http_response http_response(key request_id, integer status, list metadata, string body):Triggered when task receives a response to one of its llHTTPRequests http_request http_request(key id, string method, string body):Triggered when task receives an http request against a public URL -transaction_result transaction_result(key id, integer success, string data):Triggered when task receives asynchronous data. +transaction_result transaction_result(key id, integer success, string data): Triggered when currency is given to task path_update path_update(integer type, list reserved):Triggered when the state of a pathfinder character changes. Note; "list reserved" is not currently used # integer constants @@ -99,6 +99,7 @@ PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to req PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override agent's animations DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users diff --git a/indra/newview/skins/default/textures/inv_reset.tga b/indra/newview/skins/default/textures/inv_reset.tga new file mode 100644 index 000000000..8c911e709 Binary files /dev/null and b/indra/newview/skins/default/textures/inv_reset.tga differ diff --git a/indra/newview/skins/default/xui/en-us/floater_inventory.xml b/indra/newview/skins/default/xui/en-us/floater_inventory.xml index d06bc23ba..fbe221070 100644 --- a/indra/newview/skins/default/xui/en-us/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_inventory.xml @@ -12,7 +12,7 @@ label="" image_overlay="inv_expand_all.tga" name="Inventory.ExpandAll" mouse_opaque="true" font="SansSerif" tool_tip="Expand All"/>