From 057bcc92eced27ad9d0d926357aabf9252309773 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 19 Apr 2018 16:48:46 +0300 Subject: MAINT-8552 FIXED Secure map links do not parse in chat and SL icon is not displayed --- indra/llui/llurlentry.cpp | 5 +++-- indra/llui/llurlentry.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index a4dc5bcde1..cd9b52d164 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -298,7 +298,7 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) const LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL() : LLUrlEntryBase() { - mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", + mPattern = boost::regex("(https?://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; mTooltip = LLTrans::getString("TooltipHttpUrl"); @@ -385,8 +385,9 @@ bool LLUrlEntryInvalidSLURL::isSLURLvalid(const std::string &url) const LLUrlEntrySLURL::LLUrlEntrySLURL() { // see http://slurl.com/about.php for details on the SLURL format - mPattern = boost::regex("http://(maps.secondlife.com|slurl.com)/secondlife/[^ /]+(/\\d+){0,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", + mPattern = boost::regex("https?://(maps.secondlife.com|slurl.com)/secondlife/[^ /]+(/\\d+){0,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", boost::regex::perl|boost::regex::icase); + mIcon = "Hand"; mMenuName = "menu_url_slurl.xml"; mTooltip = LLTrans::getString("TooltipSLURL"); } diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 28e9931718..78c149d9fd 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -175,6 +175,7 @@ class LLUrlEntrySLURL : public LLUrlEntryBase { public: LLUrlEntrySLURL(); + /*virtual*/ bool isTrusted() const { return true; } /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getLocation(const std::string &url) const; }; -- cgit v1.2.3 From 66502df0502f1c2aa6aa9fda0a2a61921535a645 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 20 Apr 2018 20:21:20 +0300 Subject: MAINT-8540 Eliminated a lot of xui related log warnings on startup and opening preferences --- indra/llcommon/llfile.cpp | 4 +-- indra/llcommon/llfile.h | 2 +- indra/llui/llviewereventrecorder.cpp | 4 +-- indra/newview/llfloaterpreference.cpp | 33 +++++++++++++--------- indra/newview/llfloaterpreference.h | 1 + indra/newview/llfloatertools.cpp | 1 - indra/newview/llmoveview.cpp | 4 +-- indra/newview/llpanellogin.cpp | 13 --------- indra/newview/llpanellogin.h | 1 - indra/newview/llpanelobject.cpp | 18 ------------ indra/newview/llpanelpeople.cpp | 1 - indra/newview/llpanelvolume.cpp | 6 +--- indra/newview/llpanelvolumepulldown.cpp | 31 ++++++++++++++++---- indra/newview/llpanelvolumepulldown.h | 4 +++ indra/newview/llstartup.cpp | 1 - indra/newview/llstatusbar.cpp | 6 ---- indra/newview/llstatusbar.h | 2 -- indra/newview/llviewermenu.cpp | 19 +++++++++++++ indra/newview/llviewerwindow.cpp | 4 +++ .../skins/default/xui/en/panel_volume_pulldown.xml | 20 ++++++------- 20 files changed, 91 insertions(+), 84 deletions(-) diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 8aa41035b9..fc203f78e1 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -258,7 +258,7 @@ int LLFile::remove(const std::string& filename, int supress_error) return warnif("remove", filename, rc, supress_error); } -int LLFile::rename(const std::string& filename, const std::string& newname) +int LLFile::rename(const std::string& filename, const std::string& newname, int supress_error) { #if LL_WINDOWS std::string utf8filename = filename; @@ -269,7 +269,7 @@ int LLFile::rename(const std::string& filename, const std::string& newname) #else int rc = ::rename(filename.c_str(),newname.c_str()); #endif - return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc); + return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc, supress_error); } bool LLFile::copy(const std::string from, const std::string to) diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index ba935b8714..398938b729 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -74,7 +74,7 @@ public: static int rmdir(const std::string& filename); static int remove(const std::string& filename, int supress_error = 0); - static int rename(const std::string& filename,const std::string& newname); + static int rename(const std::string& filename,const std::string& newname, int supress_error = 0); static bool copy(const std::string from, const std::string to); static int stat(const std::string& filename,llstat* file_status); diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index 9fe6a542b4..8754cfebbb 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -34,11 +34,11 @@ LLViewerEventRecorder::LLViewerEventRecorder() { logEvents = false; // Remove any previous event log file std::string old_log_ui_events_to_llsd_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.old"); - LLFile::remove(old_log_ui_events_to_llsd_file); + LLFile::remove(old_log_ui_events_to_llsd_file, ENOENT); mLogFilename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.llsd"); - LLFile::rename(mLogFilename, old_log_ui_events_to_llsd_file); + LLFile::rename(mLogFilename, old_log_ui_events_to_llsd_file, ENOENT); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 5de7ca5289..9d723bdd9d 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1249,6 +1249,8 @@ void LLFloaterPreference::refreshEnabledState() // Cannot have floater active until caps have been received getChild("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true); + + getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() @@ -1383,8 +1385,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() // now turn off any features that are unavailable disableUnavailableSettings(); - - getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } // static @@ -2563,18 +2563,6 @@ BOOL LLPanelPreferenceGraphics::postBuild() LLFloaterReg::showInstance("prefs_graphics_advanced"); LLFloaterReg::hideInstance("prefs_graphics_advanced"); -// Don't do this on Mac as their braindead GL versioning -// sets this when 8x and 16x are indeed available -// -#if !LL_DARWIN - if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) - { //remove FSAA settings above "4x" - LLComboBox* combo = getChild("fsaa"); - combo->remove("8x"); - combo->remove("16x"); - } -#endif - resetDirtyChilds(); setPresetText(); @@ -2749,6 +2737,23 @@ LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) mCommitCallbackRegistrar.add("Proxy.Change", boost::bind(&LLFloaterPreferenceProxy::onChangeSocksSettings, this)); } +BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild() +{ + // Don't do this on Mac as their braindead GL versioning + // sets this when 8x and 16x are indeed available + // +#if !LL_DARWIN + if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) + { //remove FSAA settings above "4x" + LLComboBox* combo = getChild("fsaa"); + combo->remove("8x"); + combo->remove("16x"); + } +#endif + + return TRUE; +} + void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) { refresh(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 444ad5a928..0cd7bac20f 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -276,6 +276,7 @@ class LLFloaterPreferenceGraphicsAdvanced : public LLFloater public: LLFloaterPreferenceGraphicsAdvanced(const LLSD& key); ~LLFloaterPreferenceGraphicsAdvanced(); + /*virtual*/ BOOL postBuild(); void onOpen(const LLSD& key); void onClickCloseBtn(bool app_quitting); void disableUnavailableSettings(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index c9d664c7c4..cf7096da9c 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -253,7 +253,6 @@ BOOL LLFloaterTools::postBuild() mCheckStretchTexture = getChild("checkbox stretch textures"); getChild("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); mComboGridMode = getChild("combobox grid mode"); - mCheckStretchUniformLabel = getChild("checkbox uniform label"); // // Create Buttons diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index c03080beb8..301487b994 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -716,9 +716,9 @@ void LLPanelStandStopFlying::updatePosition() left_tb_width = toolbar_left->getRect().getWidth(); } - if (!mStateManagementButtons.get()) + if (!mStateManagementButtons.get()) // Obsolete?!! { - LLPanel* panel_ssf_container = getRootView()->getChild("state_management_buttons_container"); + LLPanel* panel_ssf_container = gToolBarView->getChild("state_management_buttons_container"); if (panel_ssf_container) { mStateManagementButtons = panel_ssf_container->getHandle(); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 5f26821c4f..ef5ce155b1 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -271,9 +271,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLTextBox* forgot_password_text = getChild("forgot_password_text"); forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); - LLTextBox* need_help_text = getChild("login_help"); - need_help_text->setClickedCallback(onClickHelp, NULL); - // get the web browser control LLMediaCtrl* web_browser = getChild("login_html"); web_browser->addObserver(this); @@ -924,16 +921,6 @@ void LLPanelLogin::onClickForgotPassword(void*) } } -//static -void LLPanelLogin::onClickHelp(void*) -{ - if (sInstance) - { - LLViewerHelp* vhelp = LLViewerHelp::getInstance(); - vhelp->showTopic(vhelp->preLoginTopic()); - } -} - // static void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 82ef048493..852195b304 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -99,7 +99,6 @@ private: static void onClickNewAccount(void*); static void onClickVersion(void*); static void onClickForgotPassword(void*); - static void onClickHelp(void*); static void onPassKey(LLLineEditor* caller, void* user_data); static void updateServerCombo(); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index d0dea5d044..25cfb598e7 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -448,20 +448,6 @@ void LLPanelObject::getState( ) S32 roots_selected = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); BOOL editable = root_objectp->permModify(); - // Select Single Message - getChildView("select_single")->setVisible( FALSE); - getChildView("edit_object")->setVisible( FALSE); - if (!editable || single_volume || selected_count <= 1) - { - getChildView("edit_object")->setVisible( TRUE); - getChildView("edit_object")->setEnabled(TRUE); - } - else - { - getChildView("select_single")->setVisible( TRUE); - getChildView("select_single")->setEnabled(TRUE); - } - BOOL is_flexible = volobjp && volobjp->isFlexible(); BOOL is_permanent = root_objectp->flagObjectPermanent(); BOOL is_permanent_enforced = root_objectp->isPermanentEnforced(); @@ -1893,10 +1879,6 @@ void LLPanelObject::clearCtrls() mLabelTaper ->setEnabled( FALSE ); mLabelRadiusOffset->setEnabled( FALSE ); mLabelRevolutions->setEnabled( FALSE ); - - getChildView("select_single")->setVisible( FALSE); - getChildView("edit_object")->setVisible( TRUE); - getChildView("edit_object")->setEnabled(FALSE); getChildView("scale_hole")->setEnabled(FALSE); getChildView("scale_taper")->setEnabled(FALSE); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index eb2a297a35..30fef9f5f0 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -586,7 +586,6 @@ BOOL LLPanelPeople::postBuild() getChild("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); getChild("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); getChild("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); - getChild("fbc_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); if(gMaxAgentGroups <= BASE_MAX_AGENT_GROUPS) { diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index b1895bfc9b..95a535da50 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -282,7 +282,6 @@ void LLPanelVolume::getState( ) if (is_light && editable && single_volume) { - getChildView("label color")->setEnabled(true); //mLabelColor ->setEnabled( TRUE ); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) @@ -325,7 +324,6 @@ void LLPanelVolume::getState( ) getChild("Light Radius", true)->clear(); getChild("Light Falloff", true)->clear(); - getChildView("label color")->setEnabled(false); LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { @@ -567,9 +565,7 @@ void LLPanelVolume::clearCtrls() getChildView("select_single")->setVisible(true); getChildView("edit_object")->setEnabled(false); getChildView("edit_object")->setVisible(false); - getChildView("Light Checkbox Ctrl")->setEnabled(false); - getChildView("label color")->setEnabled(false); - getChildView("label color")->setEnabled(false); + getChildView("Light Checkbox Ctrl")->setEnabled(false);; LLColorSwatchCtrl* LightColorSwatch = getChild("colorswatch"); if(LightColorSwatch) { diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp index 6595da235c..6792137350 100644 --- a/indra/newview/llpanelvolumepulldown.cpp +++ b/indra/newview/llpanelvolumepulldown.cpp @@ -35,6 +35,7 @@ // Linden libs #include "llbutton.h" +#include "llcheckboxctrl.h" #include "lltabcontainer.h" #include "llfloaterreg.h" #include "llfloaterpreference.h" @@ -52,17 +53,15 @@ LLPanelVolumePulldown::LLPanelVolumePulldown() { mHoverTimer.stop(); - mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2)); + mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2)); + mCommitCallbackRegistrar.add("Vol.SetSounds", boost::bind(&LLPanelVolumePulldown::onClickSetSounds, this)); + mCommitCallbackRegistrar.add("Vol.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelVolumePulldown::updateMediaAutoPlayCheckbox, this, _1)); mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2)); buildFromFile( "panel_volume_pulldown.xml"); } BOOL LLPanelVolumePulldown::postBuild() { - // set the initial volume-slider's position to reflect reality - LLSliderCtrl* volslider = getChild( "mastervolume" ); - volslider->setValue(gSavedSettings.getF32("AudioLevelMaster")); - return LLPanel::postBuild(); } @@ -130,6 +129,28 @@ void LLPanelVolumePulldown::setControlFalse(const LLSD& user_data) control->set(LLSD(FALSE)); } +void LLPanelVolumePulldown::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) +{ + std::string name = ctrl->getName(); + + // Disable "Allow Media to auto play" only when both + // "Streaming Music" and "Media" are unchecked. STORM-513. + if ((name == "enable_music") || (name == "enable_media")) + { + bool music_enabled = getChild("enable_music")->get(); + bool media_enabled = getChild("enable_media")->get(); + + getChild("media_auto_play_btn")->setEnabled(music_enabled || media_enabled); + } +} + +void LLPanelVolumePulldown::onClickSetSounds() +{ + // Disable Enable gesture sounds checkbox if the master sound is disabled + // or if sound effects are disabled. + getChild("gesture_audio_play_btn")->setEnabled(!gSavedSettings.getBOOL("MuteSounds")); +} + //virtual void LLPanelVolumePulldown::draw() { diff --git a/indra/newview/llpanelvolumepulldown.h b/indra/newview/llpanelvolumepulldown.h index b843fab756..4f23112f50 100644 --- a/indra/newview/llpanelvolumepulldown.h +++ b/indra/newview/llpanelvolumepulldown.h @@ -47,6 +47,10 @@ class LLPanelVolumePulldown : public LLPanel private: void setControlFalse(const LLSD& user_data); + void onClickSetSounds(); + // Disables "Allow Media to auto play" check box only when both + // "Streaming Music" and "Media" are unchecked. Otherwise enables it. + void updateMediaAutoPlayCheckbox(LLUICtrl* ctrl); void onAdvancedButtonClick(const LLSD& user_data); LLFrameTimer mHoverTimer; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 62560a2fc8..7a4c41779a 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -751,7 +751,6 @@ bool idle_startup() if (gLoginMenuBarView == NULL) { LL_DEBUGS("AppInit") << "initializing menu bar" << LL_ENDL; - initialize_edit_menu(); initialize_spellcheck_menu(); init_menus(); } diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 72c5c961aa..43c0fbd53a 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -108,7 +108,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextTime(NULL), mSGBandwidth(NULL), mSGPacketLoss(NULL), - mBtnStats(NULL), mBtnVolume(NULL), mBoxBalance(NULL), mBalance(0), @@ -168,8 +167,6 @@ BOOL LLStatusBar::postBuild() mBoxBalance = getChild("balance"); mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this ); - - mBtnStats = getChildView("stat_btn"); mIconPresets = getChild( "presets_icon" ); mIconPresets->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterPresets, this)); @@ -242,8 +239,6 @@ BOOL LLStatusBar::postBuild() mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelNearByMedia->setVisible(FALSE); - mScriptOut = getChildView("scriptout"); - return TRUE; } @@ -297,7 +292,6 @@ void LLStatusBar::refresh() mSGBandwidth->setVisible(net_stats_visible); mSGPacketLoss->setVisible(net_stats_visible); - mBtnStats->setEnabled(net_stats_visible); // update the master volume button state bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 277f039f20..a3326e752a 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -105,12 +105,10 @@ private: LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; - LLView *mBtnStats; LLIconCtrl *mIconPresets; LLButton *mBtnVolume; LLTextBox *mBoxBalance; LLButton *mMediaToggle; - LLView *mScriptOut; LLFrameTimer mClockUpdateTimer; S32 mBalance; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e973363e0f..0eebf2051c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7976,6 +7976,23 @@ void handle_web_browser_test(const LLSD& param) LLWeb::loadURLInternal(url); } +bool callback_clear_cache_immediately(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( option == 0 ) // YES + { + //clear cache + LLAppViewer::instance()->purgeCacheImmediate(); + } + + return false; +} + +void handle_cache_clear_immediately() +{ + LLNotificationsUtil::add("ConfirmClearCache", LLSD(), LLSD(), callback_clear_cache_immediately); +} + void handle_web_content_test(const LLSD& param) { std::string url = param.asString(); @@ -9026,6 +9043,8 @@ void initialize_menus() //Develop (Texture Fetch Debug Console) view_listener_t::addMenu(new LLDevelopTextureFetchDebugger(), "Develop.SetTexFetchDebugger"); + //Develop (clear cache immediately) + commit.add("Develop.ClearCache", boost::bind(&handle_cache_clear_immediately) ); // Admin >Object view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy"); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e90b4ac86c..a6a083ec6b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1946,6 +1946,10 @@ void LLViewerWindow::initBase() // Create global views + // Login screen and main_view.xml need edit menus for preferences and browser + LL_DEBUGS("AppInit") << "initializing edit menu" << LL_ENDL; + initialize_edit_menu(); + // Create the floater view at the start so that other views can add children to it. // (But wait to add it as a child of the root view so that it will be in front of the // other views.) diff --git a/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml b/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml index 6adede0362..2034409111 100644 --- a/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml +++ b/indra/newview/skins/default/xui/en/panel_volume_pulldown.xml @@ -29,7 +29,7 @@ top="10" volume="true"> - - - - -- cgit v1.2.3 From 7fc86d1a99245556e7f886dd75546716d4a30cc8 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 22 May 2018 13:42:15 +0300 Subject: MAINT-8553 FIXED link is not copied from original folder in some cases --- indra/newview/llinventoryfunctions.cpp | 81 ++++++++++++++++++---------------- indra/newview/llinventoryfunctions.h | 2 + 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 0da4331af8..030c967019 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -398,61 +398,66 @@ void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id, - bool move_no_copy_items ) + bool move_no_copy_items ) { // Create the initial folder - LLUUID new_cat_uuid = gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName()); + inventory_func_type func = boost::bind(©_inventory_category_content, _1, model, cat, root_copy_id, move_no_copy_items); + gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName(), func); +} + +void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& root_copy_id, bool move_no_copy_items) +{ model->notifyObservers(); - + // We need to exclude the initial root of the copy to avoid recursively copying the copy, etc... LLUUID root_id = (root_copy_id.isNull() ? new_cat_uuid : root_copy_id); // Get the content of the folder LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; - gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); - - // If root_copy_id is null, tell the marketplace model we'll be waiting for new items to be copied over for this folder - if (root_copy_id.isNull()) - { - LLMarketplaceData::instance().setValidationWaiting(root_id,count_descendants_items(cat->getUUID())); - } + gInventory.getDirectDescendentsOf(cat->getUUID(), cat_array, item_array); + + // If root_copy_id is null, tell the marketplace model we'll be waiting for new items to be copied over for this folder + if (root_copy_id.isNull()) + { + LLMarketplaceData::instance().setValidationWaiting(root_id, count_descendants_items(cat->getUUID())); + } // Copy all the items LLInventoryModel::item_array_t item_array_copy = *item_array; for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) { LLInventoryItem* item = *iter; - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid)); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid)); - if (item->getIsLinkType()) - { - link_inventory_object(new_cat_uuid, item->getLinkedUUID(), cb); - } - else if(!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) - { - // If the item is nocopy, we do nothing or, optionally, move it - if (move_no_copy_items) - { - // Reparent the item - LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) item; - gInventory.changeItemParent(viewer_inv_item, new_cat_uuid, true); - } - // Decrement the count in root_id since that one item won't be copied over - LLMarketplaceData::instance().decrementValidationWaiting(root_id); - } - else - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - new_cat_uuid, - std::string(), - cb); - } + if (item->getIsLinkType()) + { + link_inventory_object(new_cat_uuid, item->getLinkedUUID(), cb); + } + else if (!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + // If the item is nocopy, we do nothing or, optionally, move it + if (move_no_copy_items) + { + // Reparent the item + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *)item; + gInventory.changeItemParent(viewer_inv_item, new_cat_uuid, true); + } + // Decrement the count in root_id since that one item won't be copied over + LLMarketplaceData::instance().decrementValidationWaiting(root_id); + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + new_cat_uuid, + std::string(), + cb); + } } - + // Copy all the folders LLInventoryModel::cat_array_t cat_array_copy = *cat_array; for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index d454d7e00b..fd106bc2d8 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -72,6 +72,8 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null, bool move_no_copy_items = false); +void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& root_copy_id, bool move_no_copy_items); + // Generates a string containing the path to the item specified by item_id. void append_path(const LLUUID& id, std::string& path); -- cgit v1.2.3 From 250a0396ac2c8af0a8139b50b55c81f036d37def Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 22 May 2018 14:24:09 +0300 Subject: MAINT-8635 Don't allow using 'close all windows' if modal toast is open --- indra/newview/lltoast.cpp | 15 +++++++++++++++ indra/newview/lltoast.h | 4 ++++ indra/newview/llviewermenufile.cpp | 5 +++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index edde7c8076..b9b05966bc 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -34,6 +34,7 @@ #include "llviewercontrol.h" using namespace LLNotificationsUI; +std::list LLToast::sModalToastsList; //-------------------------------------------------------------------------- LLToastLifeTimer::LLToastLifeTimer(LLToast* toast, F32 period) @@ -143,6 +144,11 @@ LLToast::LLToast(const LLToast::Params& p) { mOnDeleteToastSignal.connect(p.on_delete_toast()); } + + if (isModal()) + { + sModalToastsList.push_front(this); + } } void LLToast::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -187,6 +193,15 @@ LLToast::~LLToast() { mOnToastDestroyedSignal(this); } + + if (isModal()) + { + std::list::iterator iter = std::find(sModalToastsList.begin(), sModalToastsList.end(), this); + if (iter != sModalToastsList.end()) + { + sModalToastsList.erase(iter); + } + } } //-------------------------------------------------------------------------- diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index cd92189012..69074b1670 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -108,6 +108,8 @@ public: static void updateClass(); static void cleanupToasts(); + static BOOL isAlertToastShown() { return sModalToastsList.size() > 0; } + LLToast(const LLToast::Params& p); virtual ~LLToast(); BOOL postBuild(); @@ -245,6 +247,8 @@ private: commit_signal_t mToastMouseEnterSignal; commit_signal_t mToastMouseLeaveSignal; + + static std::list sModalToastsList; }; } diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 90355b7166..e4525609c2 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -46,6 +46,7 @@ #include "llimagetga.h" #include "llinventorymodel.h" // gInventory #include "llresourcedata.h" +#include "lltoast.h" #include "llfloaterperms.h" #include "llstatusbar.h" #include "llviewercontrol.h" // gSavedSettings @@ -482,7 +483,7 @@ class LLFileEnableCloseWindow : public view_listener_t bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); bool frontmost_snapshot_fl_exists = (NULL != gSnapshotFloaterView->getFrontmostClosableFloater()); - return frontmost_fl_exists || frontmost_snapshot_fl_exists; + return !LLNotificationsUI::LLToast::isAlertToastShown() && (frontmost_fl_exists || frontmost_snapshot_fl_exists); } }; @@ -519,7 +520,7 @@ class LLFileEnableCloseAllWindows : public view_listener_t bool is_floaters_snapshot_opened = (floater_snapshot && floater_snapshot->isInVisibleChain()) || (floater_outfit_snapshot && floater_outfit_snapshot->isInVisibleChain()); bool open_children = gFloaterView->allChildrenClosed() && !is_floaters_snapshot_opened; - return !open_children; + return !open_children && !LLNotificationsUI::LLToast::isAlertToastShown(); } }; -- cgit v1.2.3 From 9411bd1cef9c084f8e51751a60667cce58b77e36 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 22 May 2018 12:58:52 +0000 Subject: MAINT-2338 Unit tests --- indra/llcommon/tests/llsdserialize_test.cpp | 184 +++++++++++++++++++++++++++- 1 file changed, 181 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 8836230640..745e3a168c 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -513,19 +513,20 @@ namespace tut const std::string& msg, const std::string& in, const LLSD& expected_value, - S32 expected_count) + S32 expected_count, + S32 depth_limit = -1) { std::stringstream input; input.str(in); LLSD parsed_result; mParser->reset(); // reset() call is needed since test code re-uses mParser - S32 parsed_count = mParser->parse(input, parsed_result, in.size()); + S32 parsed_count = mParser->parse(input, parsed_result, in.size(), depth_limit); ensure_equals(msg.c_str(), parsed_result, expected_value); // This count check is really only useful for expected // parse failures, since the ensures equal will already - // require eqality. + // require equality. std::string count_msg(msg); count_msg += " (count)"; ensure_equals(count_msg, parsed_count, expected_count); @@ -714,6 +715,43 @@ namespace tut expected, 1); } + + template<> template<> + void TestLLSDXMLParsingObject::test<5>() + { + // test deeper nested levels + LLSD level_5 = LLSD::emptyMap(); level_5["level_5"] = 42.f; + LLSD level_4 = LLSD::emptyMap(); level_4["level_4"] = level_5; + LLSD level_3 = LLSD::emptyMap(); level_3["level_3"] = level_4; + LLSD level_2 = LLSD::emptyMap(); level_2["level_2"] = level_3; + LLSD level_1 = LLSD::emptyMap(); level_1["level_1"] = level_2; + LLSD level_0 = LLSD::emptyMap(); level_0["level_0"] = level_1; + + LLSD v; + v["deep"] = level_0; + + ensureParse( + "deep llsd xml map", + "" + "deep" + "level_0" + "level_1" + "level_2" + "level_3" + "level_4" + "level_542.0" + "" + "" + "" + "" + "" + "" + "", + v, + 8); + } + + /* TODO: test XML parsing @@ -975,6 +1013,146 @@ namespace tut LLSDParser::PARSE_FAILURE); } + template<> template<> + void TestLLSDNotationParsingObject::test<18>() + { + LLSD level_1 = LLSD::emptyMap(); level_1["level_2"] = 99; + LLSD level_0 = LLSD::emptyMap(); level_0["level_1"] = level_1; + + LLSD deep = LLSD::emptyMap(); + deep["level_0"] = level_0; + + LLSD root = LLSD::emptyMap(); + root["deep"] = deep; + + ensureParse( + "nested notation 3 deep", + "{'deep' : {'level_0':{'level_1':{'level_2': i99} } } }", + root, + 5, + 5); // 4 '{' plus i99 also counts as llsd, so real depth is 5 + } + + template<> template<> + void TestLLSDNotationParsingObject::test<19>() + { + LLSD level_9 = LLSD::emptyMap(); level_9["level_9"] = (S32)99; + LLSD level_8 = LLSD::emptyMap(); level_8["level_8"] = level_9; + LLSD level_7 = LLSD::emptyMap(); level_7["level_7"] = level_8; + LLSD level_6 = LLSD::emptyMap(); level_6["level_6"] = level_7; + LLSD level_5 = LLSD::emptyMap(); level_5["level_5"] = level_6; + LLSD level_4 = LLSD::emptyMap(); level_4["level_4"] = level_5; + LLSD level_3 = LLSD::emptyMap(); level_3["level_3"] = level_4; + LLSD level_2 = LLSD::emptyMap(); level_2["level_2"] = level_3; + LLSD level_1 = LLSD::emptyMap(); level_1["level_1"] = level_2; + LLSD level_0 = LLSD::emptyMap(); level_0["level_0"] = level_1; + + LLSD deep = LLSD::emptyMap(); + deep["deep"] = level_0; + + ensureParse( + "nested notation 10 deep", + "{'deep' : {'level_0':{'level_1':{'level_2':{'level_3':{'level_4':{'level_5':{'level_6':{'level_7':{'level_8':{'level_9':i99}" + "} } } } } } } } } }", + deep, + 12, + 15); + } + + template<> template<> + void TestLLSDNotationParsingObject::test<20>() + { + LLSD end = LLSD::emptyMap(); end["end"] = (S32)99; + + LLSD level_49 = LLSD::emptyMap(); level_49["level_49"] = end; + LLSD level_48 = LLSD::emptyMap(); level_48["level_48"] = level_49; + LLSD level_47 = LLSD::emptyMap(); level_47["level_47"] = level_48; + LLSD level_46 = LLSD::emptyMap(); level_46["level_46"] = level_47; + LLSD level_45 = LLSD::emptyMap(); level_45["level_45"] = level_46; + LLSD level_44 = LLSD::emptyMap(); level_44["level_44"] = level_45; + LLSD level_43 = LLSD::emptyMap(); level_43["level_43"] = level_44; + LLSD level_42 = LLSD::emptyMap(); level_42["level_42"] = level_43; + LLSD level_41 = LLSD::emptyMap(); level_41["level_41"] = level_42; + LLSD level_40 = LLSD::emptyMap(); level_40["level_40"] = level_41; + + LLSD level_39 = LLSD::emptyMap(); level_39["level_39"] = level_40; + LLSD level_38 = LLSD::emptyMap(); level_38["level_38"] = level_39; + LLSD level_37 = LLSD::emptyMap(); level_37["level_37"] = level_38; + LLSD level_36 = LLSD::emptyMap(); level_36["level_36"] = level_37; + LLSD level_35 = LLSD::emptyMap(); level_35["level_35"] = level_36; + LLSD level_34 = LLSD::emptyMap(); level_34["level_34"] = level_35; + LLSD level_33 = LLSD::emptyMap(); level_33["level_33"] = level_34; + LLSD level_32 = LLSD::emptyMap(); level_32["level_32"] = level_33; + LLSD level_31 = LLSD::emptyMap(); level_31["level_31"] = level_32; + LLSD level_30 = LLSD::emptyMap(); level_30["level_30"] = level_31; + + LLSD level_29 = LLSD::emptyMap(); level_29["level_29"] = level_30; + LLSD level_28 = LLSD::emptyMap(); level_28["level_28"] = level_29; + LLSD level_27 = LLSD::emptyMap(); level_27["level_27"] = level_28; + LLSD level_26 = LLSD::emptyMap(); level_26["level_26"] = level_27; + LLSD level_25 = LLSD::emptyMap(); level_25["level_25"] = level_26; + LLSD level_24 = LLSD::emptyMap(); level_24["level_24"] = level_25; + LLSD level_23 = LLSD::emptyMap(); level_23["level_23"] = level_24; + LLSD level_22 = LLSD::emptyMap(); level_22["level_22"] = level_23; + LLSD level_21 = LLSD::emptyMap(); level_21["level_21"] = level_22; + LLSD level_20 = LLSD::emptyMap(); level_20["level_20"] = level_21; + + LLSD level_19 = LLSD::emptyMap(); level_19["level_19"] = level_20; + LLSD level_18 = LLSD::emptyMap(); level_18["level_18"] = level_19; + LLSD level_17 = LLSD::emptyMap(); level_17["level_17"] = level_18; + LLSD level_16 = LLSD::emptyMap(); level_16["level_16"] = level_17; + LLSD level_15 = LLSD::emptyMap(); level_15["level_15"] = level_16; + LLSD level_14 = LLSD::emptyMap(); level_14["level_14"] = level_15; + LLSD level_13 = LLSD::emptyMap(); level_13["level_13"] = level_14; + LLSD level_12 = LLSD::emptyMap(); level_12["level_12"] = level_13; + LLSD level_11 = LLSD::emptyMap(); level_11["level_11"] = level_12; + LLSD level_10 = LLSD::emptyMap(); level_10["level_10"] = level_11; + + LLSD level_9 = LLSD::emptyMap(); level_9["level_9"] = level_10; + LLSD level_8 = LLSD::emptyMap(); level_8["level_8"] = level_9; + LLSD level_7 = LLSD::emptyMap(); level_7["level_7"] = level_8; + LLSD level_6 = LLSD::emptyMap(); level_6["level_6"] = level_7; + LLSD level_5 = LLSD::emptyMap(); level_5["level_5"] = level_6; + LLSD level_4 = LLSD::emptyMap(); level_4["level_4"] = level_5; + LLSD level_3 = LLSD::emptyMap(); level_3["level_3"] = level_4; + LLSD level_2 = LLSD::emptyMap(); level_2["level_2"] = level_3; + LLSD level_1 = LLSD::emptyMap(); level_1["level_1"] = level_2; + LLSD level_0 = LLSD::emptyMap(); level_0["level_0"] = level_1; + + LLSD deep = LLSD::emptyMap(); + deep["deep"] = level_0; + + ensureParse( + "nested notation deep", + "{'deep':" + "{'level_0' :{'level_1' :{'level_2' :{'level_3' :{'level_4' :{'level_5' :{'level_6' :{'level_7' :{'level_8' :{'level_9' :" + "{'level_10':{'level_11':{'level_12':{'level_13':{'level_14':{'level_15':{'level_16':{'level_17':{'level_18':{'level_19':" + "{'level_20':{'level_21':{'level_22':{'level_23':{'level_24':{'level_25':{'level_26':{'level_27':{'level_28':{'level_29':" + "{'level_30':{'level_31':{'level_32':{'level_33':{'level_34':{'level_35':{'level_36':{'level_37':{'level_38':{'level_39':" + "{'level_40':{'level_41':{'level_42':{'level_43':{'level_44':{'level_45':{'level_46':{'level_47':{'level_48':{'level_49':" + "{'end':i99}" + "} } } } } } } } } }" + "} } } } } } } } } }" + "} } } } } } } } } }" + "} } } } } } } } } }" + "} } } } } } } } } }" + "}", + deep, + 53); + } + + template<> template<> + void TestLLSDNotationParsingObject::test<21>() + { + ensureParse( + "nested notation 10 deep", + "{'deep' : {'level_0':{'level_1':{'level_2':{'level_3':{'level_4':{'level_5':{'level_6':{'level_7':{'level_8':{'level_9':i99}" + "} } } } } } } } } }", + LLSD(), + LLSDParser::PARSE_FAILURE, + 9); + } + /** * @class TestLLSDBinaryParsing * @brief Concrete instance of a parse tester. -- cgit v1.2.3 From d35a8fcb3fca2b080a029bd261894c3ba0fdb6f5 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 22 May 2018 18:18:57 +0300 Subject: MAINT-8670 Crash in: LLFace::getGeometryVolume() Guarded. --- indra/newview/llface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 50a4925c37..474645c084 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1217,6 +1217,12 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, { LL_RECORD_BLOCK_TIME(FTM_FACE_GET_GEOM); llassert(verify()); + + if (volume.getNumVolumeFaces() <= f) { + LL_WARNS() << "Attempt get volume face out of range! Total Faces: " << volume.getNumVolumeFaces() << " Attempt get access to: " << f << LL_ENDL; + return FALSE; + } + const LLVolumeFace &vf = volume.getVolumeFace(f); S32 num_vertices = (S32)vf.mNumVertices; S32 num_indices = (S32) vf.mNumIndices; -- cgit v1.2.3 From 3c12c7ce5695a1010646cdd01f5484c6c61b50f7 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 23 May 2018 11:58:42 +0300 Subject: MAINT-8619 Disable local textures for selection in Group profile --- indra/newview/llpanelgroupgeneral.cpp | 1 + indra/newview/lltexturectrl.cpp | 7 +++++++ indra/newview/lltexturectrl.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index d17f5494a0..f85a2ffbc1 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -194,6 +194,7 @@ void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group) if (mInsignia) { mInsignia->setCommitCallback(onCommitAny, this); + mInsignia->setAllowLocalTexture(FALSE); } mFounderName = getChild("founder_name"); diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index c7adaa908f..a5a2eec246 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -990,6 +990,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mOnSelectCallback(NULL), mBorderColor( p.border_color() ), mAllowNoTexture( FALSE ), + mAllowLocalTexture( TRUE ), mImmediateFilterPermMask( PERM_NONE ), mNonImmediateFilterPermMask( PERM_NONE ), mCanApplyImmediately( FALSE ), @@ -1198,6 +1199,12 @@ void LLTextureCtrl::showPicker(BOOL take_focus) floaterp->openFloater(); } + LLFloaterTexturePicker* picker_floater = dynamic_cast(floaterp); + if (picker_floater) + { + picker_floater->setLocalTextureEnabled(mAllowLocalTexture); + } + if (take_focus) { floaterp->setFocus(TRUE); diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 840feddfaf..6bcf9c3a75 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -142,6 +142,9 @@ public: void setAllowNoTexture( BOOL b ) { mAllowNoTexture = b; } bool getAllowNoTexture() const { return mAllowNoTexture; } + void setAllowLocalTexture(BOOL b) { mAllowLocalTexture = b; } + BOOL getAllowLocalTexture() const { return mAllowLocalTexture; } + const LLUUID& getImageItemID() { return mImageItemID; } virtual void setImageAssetName(const std::string& name); @@ -222,6 +225,7 @@ private: LLTextBox* mCaption; std::string mLabel; BOOL mAllowNoTexture; // If true, the user can select "none" as an option + BOOL mAllowLocalTexture; PermissionMask mImmediateFilterPermMask; PermissionMask mDnDFilterPermMask; PermissionMask mNonImmediateFilterPermMask; -- cgit v1.2.3 From a0d24f18b7675dfcb9b798c95bbc68cf9f1bc900 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 24 May 2018 14:02:51 +0300 Subject: MAINT-8687 Add a hotkey for Advanced > Set UI Size to Default --- indra/newview/skins/default/xui/en/menu_viewer.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index dcd8f0b495..d28f47c2e1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1487,7 +1487,8 @@ + name="Set UI Size to Default" + shortcut="control|alt|shift|R"> -- cgit v1.2.3 From 5b943c698aa08df54abefdd76bdfeb874bbebb6a Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 24 May 2018 18:14:54 +0300 Subject: MAINT-8634 Hide texture UUIDs for non-gods --- indra/newview/llvoavatar.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0f751de2e3..7458c00b70 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8539,6 +8539,8 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara apr_file_printf( file, "\n" ); apr_file_printf( file, "\n\t\n" ); + bool agent_is_godlike = gAgent.isGodlikeWithoutAdminMenuFakery(); + if (group_by_wearables) { for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) @@ -8564,8 +8566,11 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); if( te_image ) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); + std::string uuid_str = LLUUID().asString(); + if (agent_is_godlike) + { + te_image->getID().toString(uuid_str); + } apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); } } @@ -8587,8 +8592,11 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); if( te_image ) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); + std::string uuid_str = LLUUID().asString(); + if (agent_is_godlike) + { + te_image->getID().toString(uuid_str); + } apr_file_printf( file, "\t\t\n", te, uuid_str.c_str()); } } -- cgit v1.2.3 From a28a3b756d7688fcb917122efee01f16ab5319cd Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 25 May 2018 11:32:15 +0300 Subject: MAINT-8694 FIXED Typo in logging --- indra/newview/llvoavatarself.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 10af524ee7..00e72bfbff 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2758,7 +2758,7 @@ void LLVOAvatarSelf::sendHoverHeight() const // class responder if nothing else gets added. // (comment from removed Responder) LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, update, - "Hover hight sent to sim", "Hover hight not sent to sim"); + "Hover height sent to sim", "Hover height not sent to sim"); mLastHoverOffsetSent = hover_offset; } } -- cgit v1.2.3 From c10f8b1aa4f2badbf4b0f72b1747c2943568ed2e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 25 May 2018 12:34:14 +0000 Subject: MAINT-8674 Clean up already requested ids. --- indra/newview/llviewerobjectlist.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index dc54346d59..131434504a 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1046,9 +1046,11 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) mPendingObjectCost.begin(), mPendingObjectCost.end(), std::inserter(diff, diff.begin())); + mStaleObjectCost.clear(); + if (diff.empty()) { - LL_INFOS() << "No outstanding object IDs to request." << LL_ENDL; + LL_INFOS() << "No outstanding object IDs to request. Pending count: " << mPendingObjectCost.size() << " Requesting count: " << mStaleObjectCost.size() << LL_ENDL; return; } @@ -1057,7 +1059,6 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) for (uuid_set_t::iterator it = diff.begin(); it != diff.end(); ++it) { idList.append(*it); - mStaleObjectCost.erase(*it); } mPendingObjectCost.insert(diff.begin(), diff.end()); @@ -1094,9 +1095,7 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) { LLUUID objectId = it->asUUID(); - // If the object was added to the StaleObjectCost set after it had been - // added to mPendingObjectCost it would still be in the StaleObjectCost - // set when we got the response back. + // Object could have been added to the mStaleObjectCost after request started mStaleObjectCost.erase(objectId); mPendingObjectCost.erase(objectId); -- cgit v1.2.3 From 86ffcca29392b79d553ace9403bbf628fbefe3d0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 25 May 2018 16:01:59 +0300 Subject: MAINT-8674 Fixed logs --- indra/newview/llviewerobjectlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 131434504a..23a51b99f6 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1050,7 +1050,7 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) if (diff.empty()) { - LL_INFOS() << "No outstanding object IDs to request. Pending count: " << mPendingObjectCost.size() << " Requesting count: " << mStaleObjectCost.size() << LL_ENDL; + LL_INFOS() << "No outstanding object IDs to request. Pending count: " << mPendingObjectCost.size() << LL_ENDL; return; } -- cgit v1.2.3 From fadb6c7c65f4d531f513d5d896ca25b9bb22b48f Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 25 May 2018 18:00:57 +0300 Subject: MAINT-8459 Save favorite places and landmarks to Location Bar history list --- indra/newview/llnavigationbar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 84a2cd8be1..cfe2e6bf6a 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -443,6 +443,7 @@ void LLNavigationBar::onLocationSelection() { gAgent.teleportViaLandmark( LLUUID(value["AssetUUID"].asString())); + mSaveToLocationHistory = true; return; } else @@ -453,6 +454,7 @@ void LLNavigationBar::onLocationSelection() if (!landmark_items.empty()) { gAgent.teleportViaLandmark( landmark_items[0]->getAssetUUID()); + mSaveToLocationHistory = true; return; } } -- cgit v1.2.3 From 9e58cb266c1084e21c3d945f9d9fe23bf46bd01e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 25 May 2018 21:11:54 +0000 Subject: MAINT-8693 Fixed crashes during login if you wear a BOM tattoo layer --- indra/llappearance/llwearable.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 63069adcc8..edcfd49bb4 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -437,7 +437,13 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream, LL_WARNS() << "Bad Wearable asset: bad texture, #" << i << LL_ENDL; return LLWearable::FAILURE; } - + + if (te >= ETextureIndex::TEX_NUM_INDICES) //createLayers() converts to ETextureIndex + { + LL_WARNS() << "Bad Wearable asset: bad texture index: " << te << LL_ENDL; + return LLWearable::FAILURE; + } + if( !LLUUID::validate( uuid_buffer ) ) { LL_WARNS() << "Bad Wearable asset: bad texture uuid: " -- cgit v1.2.3 From 177f24f56fd6a3624efa1fa311c5a79025fbfa64 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 29 May 2018 17:26:10 +0300 Subject: MAINT-8586 Eliminate obsolete xui elements --- indra/newview/llfloaterproperties.cpp | 4 ---- indra/newview/llfloatertools.cpp | 12 +++-------- indra/newview/llpanelface.cpp | 13 +---------- indra/newview/llpanelvolume.cpp | 1 - indra/newview/llsidepaneliteminfo.cpp | 18 +--------------- .../xui/en/floater_inventory_item_properties.xml | 25 ---------------------- .../skins/default/xui/en/panel_tools_texture.xml | 8 ------- 7 files changed, 5 insertions(+), 76 deletions(-) diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 1310a60638..fbb7432f71 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -490,7 +490,6 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { - getChildView("SaleLabel")->setEnabled(is_complete); getChildView("CheckPurchase")->setEnabled(is_complete); getChildView("NextOwnerLabel")->setEnabled(TRUE); @@ -498,13 +497,11 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); combo_sale_type->setEnabled(is_complete && is_for_sale); edit_cost->setEnabled(is_complete && is_for_sale); } else { - getChildView("SaleLabel")->setEnabled(FALSE); getChildView("CheckPurchase")->setEnabled(FALSE); getChildView("NextOwnerLabel")->setEnabled(FALSE); @@ -512,7 +509,6 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); - getChildView("TextPrice")->setEnabled(FALSE); combo_sale_type->setEnabled(FALSE); edit_cost->setEnabled(FALSE); } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index cf7096da9c..7fc60ddaac 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1213,7 +1213,7 @@ void LLFloaterTools::getMediaState() &&first_object->permModify() )) { - getChildView("Add_Media")->setEnabled(FALSE); + getChildView("add_media")->setEnabled(FALSE); media_info->clear(); clearMediaSettings(); return; @@ -1224,7 +1224,7 @@ void LLFloaterTools::getMediaState() if(!has_media_capability) { - getChildView("Add_Media")->setEnabled(FALSE); + getChildView("add_media")->setEnabled(FALSE); LL_WARNS("LLFloaterTools: media") << "Media not enabled (no capability) in this region!" << LL_ENDL; clearMediaSettings(); return; @@ -1319,7 +1319,7 @@ void LLFloaterTools::getMediaState() // update UI depending on whether "object" (prim or face) has media // and whether or not you are allowed to edit it. - getChildView("Add_Media")->setEnabled(editable); + getChildView("add_media")->setEnabled(editable); // IF all the faces have media (or all dont have media) if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo ) { @@ -1341,10 +1341,7 @@ void LLFloaterTools::getMediaState() media_title = multi_media_info_str; } - getChildView("media_tex")->setEnabled(bool_has_media && editable); - getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); getChildView("delete_media")->setEnabled(bool_has_media && editable ); - getChildView("add_media")->setEnabled(editable); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1366,10 +1363,7 @@ void LLFloaterTools::getMediaState() } } - getChildView("media_tex")->setEnabled(TRUE); - getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); getChildView("delete_media")->setEnabled(TRUE); - getChildView("add_media")->setEnabled(editable); } navigateToTitleMedia(media_title); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 7e75dca908..01ce4470f0 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1165,16 +1165,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChild("combobox texgen")->setTentative(!identical); getChildView("tex gen")->setEnabled(editable); - if (selected_texgen == LLTextureEntry::TEX_GEN_PLANAR) - { - // EXP-1507 (change label based on the mapping mode) - getChild("rpt")->setValue(getString("string repeats per meter")); - } - else - if (selected_texgen == LLTextureEntry::TEX_GEN_DEFAULT) - { - getChild("rpt")->setValue(getString("string repeats per face")); - } } { @@ -1390,8 +1380,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mColorSwatch->setValid(FALSE); } getChildView("color trans")->setEnabled(FALSE); - getChildView("rpt")->setEnabled(FALSE); - getChildView("tex offset")->setEnabled(FALSE); + getChildView("rptctrl")->setEnabled(FALSE); getChildView("tex gen")->setEnabled(FALSE); getChildView("label shininess")->setEnabled(FALSE); getChildView("label bumpiness")->setEnabled(FALSE); diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 95a535da50..1c4384ff08 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -524,7 +524,6 @@ void LLPanelVolume::refresh() BOOL visible = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; - getChildView("label texture")->setVisible( visible); getChildView("Light FOV")->setVisible( visible); getChildView("Light Focus")->setVisible( visible); getChildView("Light Ambiance")->setVisible( visible); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 43e7e57814..a486a29aa2 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -441,7 +441,6 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) const std::string perm_and_sale_items[]={ "perms_inv", - "OwnerLabel", "perm_modify", "CheckOwnerModify", "CheckOwnerCopy", @@ -455,10 +454,8 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) "CheckNextOwnerCopy", "CheckNextOwnerTransfer", "CheckPurchase", - "SaleLabel", "ComboBoxSaleType", - "Edit Cost", - "TextPrice" + "Edit Cost" }; const std::string debug_items[]={ @@ -495,14 +492,6 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) /////////////////////// // OWNER PERMISSIONS // /////////////////////// - if(can_agent_manipulate) - { - getChild("OwnerLabel")->setValue(getString("you_can")); - } - else - { - getChild("OwnerLabel")->setValue(getString("owner_can")); - } U32 base_mask = perm.getMaskBase(); U32 owner_mask = perm.getMaskOwner(); @@ -510,7 +499,6 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) U32 everyone_mask = perm.getMaskEveryone(); U32 next_owner_mask = perm.getMaskNextOwner(); - getChildView("OwnerLabel")->setEnabled(TRUE); getChildView("CheckOwnerModify")->setEnabled(FALSE); getChild("CheckOwnerModify")->setValue(LLSD((BOOL)(owner_mask & PERM_MODIFY))); getChildView("CheckOwnerCopy")->setEnabled(FALSE); @@ -645,7 +633,6 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { - getChildView("SaleLabel")->setEnabled(is_complete); getChildView("CheckPurchase")->setEnabled(is_complete); getChildView("NextOwnerLabel")->setEnabled(TRUE); @@ -653,13 +640,11 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); combo_sale_type->setEnabled(is_complete && is_for_sale); edit_cost->setEnabled(is_complete && is_for_sale); } else { - getChildView("SaleLabel")->setEnabled(FALSE); getChildView("CheckPurchase")->setEnabled(FALSE); getChildView("NextOwnerLabel")->setEnabled(FALSE); @@ -667,7 +652,6 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); - getChildView("TextPrice")->setEnabled(FALSE); combo_sale_type->setEnabled(FALSE); edit_cost->setEnabled(FALSE); } diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml index 6667238232..45e16c59ae 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml @@ -418,30 +418,5 @@ width="90"> N: - - - diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index ffdbc5d227..8c769d87de 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -11,14 +11,6 @@ name="Texture" top="0" width="295"> - - Repeats Per Meter - - - Repeats Per Face - Date: Wed, 30 May 2018 18:31:30 +0300 Subject: MAINT-8700 FIXED The File dialog disconnects the viewer if you do not choose upload files within the first minute --- indra/newview/llfloaterautoreplacesettings.cpp | 108 ++++++----- indra/newview/llfloaterautoreplacesettings.h | 3 + indra/newview/llfloaterspellchecksettings.cpp | 16 +- indra/newview/llfloaterspellchecksettings.h | 1 + indra/newview/llpreviewscript.cpp | 48 ++--- indra/newview/llpreviewscript.h | 5 +- indra/newview/llviewermenufile.cpp | 253 +++++++++++++++++++------ indra/newview/llviewermenufile.h | 19 ++ 8 files changed, 303 insertions(+), 150 deletions(-) diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp index 5830f2f711..ec05ba924c 100644 --- a/indra/newview/llfloaterautoreplacesettings.cpp +++ b/indra/newview/llfloaterautoreplacesettings.cpp @@ -54,6 +54,7 @@ #include "llhost.h" #include "llassetstorage.h" #include "roles_constants.h" +#include "llviewermenufile.h" // LLFilePickerReplyThread #include "llviewertexteditor.h" #include @@ -349,62 +350,58 @@ void LLFloaterAutoReplaceSettings::onDeleteEntry() // called when the Import List button is pressed void LLFloaterAutoReplaceSettings::onImportList() { - LLFilePicker& picker = LLFilePicker::instance(); - if( picker.getOpenFile( LLFilePicker::FFLOAD_XML) ) + (new LLFilePickerReplyThread(boost::bind(&LLFloaterAutoReplaceSettings::loadListFromFile, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile(); +} + +void LLFloaterAutoReplaceSettings::loadListFromFile(const std::vector& filenames) +{ + llifstream file; + file.open(filenames[0].c_str()); + LLSD newList; + if (file.is_open()) { - llifstream file; - file.open(picker.getFirstFile().c_str()); - LLSD newList; - if (file.is_open()) - { - LLSDSerialize::fromXMLDocument(newList, file); - } - file.close(); + LLSDSerialize::fromXMLDocument(newList, file); + } + file.close(); - switch ( mSettings.addList(newList) ) - { - case LLAutoReplaceSettings::AddListOk: - mSelectedListName = LLAutoReplaceSettings::getListName(newList); + switch ( mSettings.addList(newList) ) + { + case LLAutoReplaceSettings::AddListOk: + mSelectedListName = LLAutoReplaceSettings::getListName(newList); - updateListNames(); - updateListNamesControls(); - updateReplacementsList(); - break; + updateListNames(); + updateListNamesControls(); + updateReplacementsList(); + break; - case LLAutoReplaceSettings::AddListDuplicateName: - { - std::string newName = LLAutoReplaceSettings::getListName(newList); - LL_WARNS("AutoReplace")<<"name '"<getFirstSelected()->getColumn(0)->getValue().asString(); - const LLSD* list = mSettings.exportList(listName); std::string listFileName = listName + ".xml"; - LLFilePicker& picker = LLFilePicker::instance(); - if( picker.getSaveFile( LLFilePicker::FFSAVE_XML, listFileName) ) - { - llofstream file; - file.open(picker.getFirstFile().c_str()); - LLSDSerialize::toPrettyXML(*list, file); - file.close(); - } + (new LLFilePickerReplyThread(boost::bind(&LLFloaterAutoReplaceSettings::saveListToFile, this, _1, listName), LLFilePicker::FFSAVE_XML, listFileName))->getFile(); +} + +void LLFloaterAutoReplaceSettings::saveListToFile(const std::vector& filenames, std::string listName) +{ + llofstream file; + const LLSD* list = mSettings.exportList(listName); + file.open(filenames[0].c_str()); + LLSDSerialize::toPrettyXML(*list, file); + file.close(); } void LLFloaterAutoReplaceSettings::onAddEntry() diff --git a/indra/newview/llfloaterautoreplacesettings.h b/indra/newview/llfloaterautoreplacesettings.h index 629aea3e3c..2109aa7026 100644 --- a/indra/newview/llfloaterautoreplacesettings.h +++ b/indra/newview/llfloaterautoreplacesettings.h @@ -112,6 +112,9 @@ private: bool selectedListIsLast(); void cleanUp(); + + void loadListFromFile(const std::vector& filenames); + void saveListToFile(const std::vector& filenames, std::string listName); }; #endif // LLFLOATERAUTOREPLACESETTINGS_H diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp index 5124dae147..b87044ef5a 100644 --- a/indra/newview/llfloaterspellchecksettings.cpp +++ b/indra/newview/llfloaterspellchecksettings.cpp @@ -30,12 +30,13 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llfloaterspellchecksettings.h" +#include "llnotificationsutil.h" #include "llscrolllistctrl.h" #include "llsdserialize.h" #include "llspellcheck.h" #include "lltrans.h" #include "llviewercontrol.h" -#include "llnotificationsutil.h" +#include "llviewermenufile.h" // LLFilePickerReplyThread #include @@ -258,13 +259,12 @@ BOOL LLFloaterSpellCheckerImport::postBuild(void) void LLFloaterSpellCheckerImport::onBtnBrowse() { - LLFilePicker& file_picker = LLFilePicker::instance(); - if (!file_picker.getOpenFile(LLFilePicker::FFLOAD_DICTIONARY)) - { - return; - } + (new LLFilePickerReplyThread(boost::bind(&LLFloaterSpellCheckerImport::importSelectedDictionary, this, _1), LLFilePicker::FFLOAD_DICTIONARY, false))->getFile(); +} - std::string filepath = file_picker.getFirstFile(); +void LLFloaterSpellCheckerImport::importSelectedDictionary(const std::vector& filenames) +{ + std::string filepath = filenames[0]; const std::string extension = gDirUtilp->getExtension(filepath); if ("xcu" == extension) @@ -277,7 +277,7 @@ void LLFloaterSpellCheckerImport::onBtnBrowse() } getChild("dictionary_path")->setValue(filepath); - + mDictionaryDir = gDirUtilp->getDirName(filepath); mDictionaryBasename = gDirUtilp->getBaseFileName(filepath, true); getChild("dictionary_name")->setValue(mDictionaryBasename); diff --git a/indra/newview/llfloaterspellchecksettings.h b/indra/newview/llfloaterspellchecksettings.h index de59d83f24..f9bbefafb7 100644 --- a/indra/newview/llfloaterspellchecksettings.h +++ b/indra/newview/llfloaterspellchecksettings.h @@ -58,6 +58,7 @@ protected: void onBtnBrowse(); void onBtnCancel(); void onBtnOK(); + void importSelectedDictionary(const std::vector& filenames); std::string parseXcuFile(const std::string& file_path) const; std::string mDictionaryDir; diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 945f3c370c..d4eecaffce 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -61,6 +61,7 @@ #include "llselectmgr.h" #include "llviewerinventory.h" #include "llviewermenu.h" +#include "llviewermenufile.h" // LLFilePickerReplyThread #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" @@ -1202,17 +1203,12 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask) void LLScriptEdCore::onBtnLoadFromFile( void* data ) { - LLScriptEdCore* self = (LLScriptEdCore*) data; - - // TODO Maybe add a dialogue warning here if the current file has unsaved changes. - LLFilePicker& file_picker = LLFilePicker::instance(); - if( !file_picker.getOpenFile( LLFilePicker::FFLOAD_SCRIPT ) ) - { - //File picking cancelled by user, so nothing to do. - return; - } + (new LLFilePickerReplyThread(boost::bind(&LLScriptEdCore::loadScriptFromFile, _1, data), LLFilePicker::FFLOAD_SCRIPT, false))->getFile(); +} - std::string filename = file_picker.getFirstFile(); +void LLScriptEdCore::loadScriptFromFile(const std::vector& filenames, void* data) +{ + std::string filename = filenames[0]; llifstream fin(filename.c_str()); @@ -1220,8 +1216,8 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data ) std::string text; std::string linetotal; while (!fin.eof()) - { - getline(fin,line); + { + getline(fin, line); text += line; if (!fin.eof()) { @@ -1231,7 +1227,8 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data ) fin.close(); // Only replace the script if there is something to replace with. - if (text.length() > 0) + LLScriptEdCore* self = (LLScriptEdCore*)data; + if (self && (text.length() > 0)) { self->mEditor->selectAll(); LLWString script(utf8str_to_wstring(text)); @@ -1247,16 +1244,21 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) if( self->mSaveCallback ) { - LLFilePicker& file_picker = LLFilePicker::instance(); - if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT, self->mScriptName ) ) - { - std::string filename = file_picker.getFirstFile(); - std::string scriptText=self->mEditor->getText(); - llofstream fout(filename.c_str()); - fout<<(scriptText); - fout.close(); - self->mSaveCallback( self->mUserdata, FALSE ); - } + (new LLFilePickerReplyThread(boost::bind(&LLScriptEdCore::saveScriptToFile, _1, userdata), LLFilePicker::FFSAVE_SCRIPT, self->mScriptName))->getFile(); + } +} + +void LLScriptEdCore::saveScriptToFile(const std::vector& filenames, void* data) +{ + LLScriptEdCore* self = (LLScriptEdCore*)data; + if (self) + { + std::string filename = filenames[0]; + std::string scriptText = self->mEditor->getText(); + llofstream fout(filename.c_str()); + fout << (scriptText); + fout.close(); + self->mSaveCallback(self->mUserdata, FALSE); } } diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index a185d85889..69cf9d9158 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -109,7 +109,10 @@ public: static void onBtnInsertSample(void*); static void onBtnInsertFunction(LLUICtrl*, void*); static void onBtnLoadFromFile(void*); - static void onBtnSaveToFile(void*); + static void onBtnSaveToFile(void*); + + static void loadScriptFromFile(const std::vector& filenames, void* data); + static void saveScriptToFile(const std::vector& filenames, void* data); static bool enableSaveToFileMenu(void* userdata); static bool enableLoadFromFileMenu(void* userdata); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 8160a3a139..f676519153 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -203,6 +203,40 @@ void LLFilePickerThread::clearDead() } } +LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ELoadFilter filter, bool get_multiple) + : LLFilePickerThread(filter, get_multiple), + mLoadFilter(filter), + mSaveFilter(LLFilePicker::FFSAVE_ALL), + mFilePickedSignal(NULL) +{ + mFilePickedSignal = new file_picked_signal_t(); + mFilePickedSignal->connect(cb); +} + +LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ESaveFilter filter, const std::string &proposed_name) + : LLFilePickerThread(filter, proposed_name), + mLoadFilter(LLFilePicker::FFLOAD_ALL), + mSaveFilter(filter), + mFilePickedSignal(NULL) +{ + mFilePickedSignal = new file_picked_signal_t(); + mFilePickedSignal->connect(cb); +} + +LLFilePickerReplyThread::~LLFilePickerReplyThread() +{ + delete mFilePickedSignal; +} + +void LLFilePickerReplyThread::notify(const std::vector& filenames) +{ + if (filenames.empty()) return; + + if (mFilePickedSignal) + { + (*mFilePickedSignal)(filenames, mLoadFilter, mSaveFilter); + } +} //============================================================================ @@ -249,6 +283,150 @@ std::string build_extensions_string(LLFilePicker::ELoadFilter filter) } } + +const bool check_file_extension(const std::string& filename, LLFilePicker::ELoadFilter type) +{ + std::string ext = gDirUtilp->getExtension(filename); + + //strincmp doesn't like NULL pointers + if (ext.empty()) + { + std::string short_name = gDirUtilp->getBaseFileName(filename); + + // No extension + LLSD args; + args["FILE"] = short_name; + LLNotificationsUtil::add("NoFileExtension", args); + return false; + } + else + { + //so there is an extension + //loop over the valid extensions and compare to see + //if the extension is valid + + //now grab the set of valid file extensions + std::string valid_extensions = build_extensions_string(type); + + BOOL ext_valid = FALSE; + + typedef boost::tokenizer > tokenizer; + boost::char_separator sep(" "); + tokenizer tokens(valid_extensions, sep); + tokenizer::iterator token_iter; + + //now loop over all valid file extensions + //and compare them to the extension of the file + //to be uploaded + for (token_iter = tokens.begin(); + token_iter != tokens.end() && ext_valid != TRUE; + ++token_iter) + { + const std::string& cur_token = *token_iter; + + if (cur_token == ext || cur_token == "*.*") + { + //valid extension + //or the acceptable extension is any + ext_valid = TRUE; + } + }//end for (loop over all tokens) + + if (ext_valid == FALSE) + { + //should only get here if the extension exists + //but is invalid + LLSD args; + args["EXTENSION"] = ext; + args["VALIDS"] = valid_extensions; + LLNotificationsUtil::add("InvalidFileExtension", args); + return false; + } + }//end else (non-null extension) + return true; +} + +const void upload_single_file(const std::vector& filenames, LLFilePicker::ELoadFilter type) +{ + std::string filename = filenames[0]; + if (!check_file_extension(filename, type)) return; + + if (!filename.empty()) + { + if (type == LLFilePicker::FFLOAD_WAV) + { + // pre-qualify wavs to make sure the format is acceptable + std::string error_msg; + if (check_for_invalid_wav_formats(filename, error_msg)) + { + LL_INFOS() << error_msg << ": " << filename << LL_ENDL; + LLSD args; + args["FILE"] = filename; + LLNotificationsUtil::add(error_msg, args); + return; + } + else + { + LLFloaterReg::showInstance("upload_sound", LLSD(filename)); + } + } + if (type == LLFilePicker::FFLOAD_IMAGE) + { + LLFloaterReg::showInstance("upload_image", LLSD(filename)); + } + if (type == LLFilePicker::FFLOAD_ANIM) + { + if (filename.rfind(".anim") != std::string::npos) + { + LLFloaterReg::showInstance("upload_anim_anim", LLSD(filename)); + } + else + { + LLFloaterReg::showInstance("upload_anim_bvh", LLSD(filename)); + } + } + } + return; +} + + +const void upload_bulk(const std::vector& filenames, LLFilePicker::ELoadFilter type) +{ + // TODO: + // Check user balance for entire cost + // Charge user entire cost + // Loop, uploading + // If an upload fails, refund the user for that one + // + // Also fix single upload to charge first, then refund + + S32 expected_upload_cost = LLGlobalEconomy::getInstance()->getPriceUpload(); + for (std::vector::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter) + { + std::string filename = (*in_iter); + if (!check_file_extension(filename, type)) continue; + + std::string name = gDirUtilp->getBaseFileName(filename, true); + std::string asset_name = name; + LLStringUtil::replaceNonstandardASCII(asset_name, '?'); + LLStringUtil::replaceChar(asset_name, '|', '?'); + LLStringUtil::stripNonprintable(asset_name); + LLStringUtil::trim(asset_name); + + LLResourceUploadInfo::ptr_t uploadInfo(new LLNewFileResourceUploadInfo( + filename, + asset_name, + asset_name, 0, + LLFolderType::FT_NONE, LLInventoryType::IT_NONE, + LLFloaterPerms::getNextOwnerPerms("Uploads"), + LLFloaterPerms::getGroupPerms("Uploads"), + LLFloaterPerms::getEveryonePerms("Uploads"), + expected_upload_cost)); + + upload_new_resource(uploadInfo, NULL, NULL); + } +} + /** char* upload_pick(void* data) @@ -369,12 +547,12 @@ class LLFileUploadImage : public view_listener_t { bool handleEvent(const LLSD& userdata) { - std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE); - if (!filename.empty()) + if (gAgentCamera.cameraMouselook()) { - LLFloaterReg::showInstance("upload_image", LLSD(filename)); + gAgentCamera.changeCameraToDefault(); } - return TRUE; + (new LLFilePickerReplyThread(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_IMAGE, false))->getFile(); + return true; } }; @@ -396,11 +574,11 @@ class LLFileUploadSound : public view_listener_t { bool handleEvent(const LLSD& userdata) { - std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV); - if (!filename.empty()) + if (gAgentCamera.cameraMouselook()) { - LLFloaterReg::showInstance("upload_sound", LLSD(filename)); + gAgentCamera.changeCameraToDefault(); } + (new LLFilePickerReplyThread(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_WAV, false))->getFile(); return true; } }; @@ -409,18 +587,11 @@ class LLFileUploadAnim : public view_listener_t { bool handleEvent(const LLSD& userdata) { - const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM); - if (!filename.empty()) + if (gAgentCamera.cameraMouselook()) { - if (filename.rfind(".anim") != std::string::npos) - { - LLFloaterReg::showInstance("upload_anim_anim", LLSD(filename)); - } - else - { - LLFloaterReg::showInstance("upload_anim_bvh", LLSD(filename)); - } + gAgentCamera.changeCameraToDefault(); } + (new LLFilePickerReplyThread(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_ANIM, false))->getFile(); return true; } }; @@ -429,55 +600,11 @@ class LLFileUploadBulk : public view_listener_t { bool handleEvent(const LLSD& userdata) { - if( gAgentCamera.cameraMouselook() ) + if (gAgentCamera.cameraMouselook()) { gAgentCamera.changeCameraToDefault(); } - - // TODO: - // Check extensions for uploadability, cost - // Check user balance for entire cost - // Charge user entire cost - // Loop, uploading - // If an upload fails, refund the user for that one - // - // Also fix single upload to charge first, then refund - - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getMultipleOpenFiles()) - { - std::string filename = picker.getFirstFile(); - S32 expected_upload_cost = LLGlobalEconomy::getInstance()->getPriceUpload(); - - while (!filename.empty()) - { - std::string name = gDirUtilp->getBaseFileName(filename, true); - - std::string asset_name = name; - LLStringUtil::replaceNonstandardASCII( asset_name, '?' ); - LLStringUtil::replaceChar(asset_name, '|', '?'); - LLStringUtil::stripNonprintable(asset_name); - LLStringUtil::trim(asset_name); - - LLResourceUploadInfo::ptr_t uploadInfo(new LLNewFileResourceUploadInfo( - filename, - asset_name, - asset_name, 0, - LLFolderType::FT_NONE, LLInventoryType::IT_NONE, - LLFloaterPerms::getNextOwnerPerms("Uploads"), - LLFloaterPerms::getGroupPerms("Uploads"), - LLFloaterPerms::getEveryonePerms("Uploads"), - expected_upload_cost)); - - upload_new_resource(uploadInfo, NULL, NULL); - - filename = picker.getNextFile(); - } - } - else - { - LL_INFOS() << "Couldn't import objects from file" << LL_ENDL; - } + (new LLFilePickerReplyThread(boost::bind(&upload_bulk, _1, _2), LLFilePicker::FFLOAD_ALL, true))->getFile(); return true; } }; diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 3e23940c3f..15bbdd1e2d 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -107,4 +107,23 @@ public: }; +class LLFilePickerReplyThread : public LLFilePickerThread +{ +public: + + typedef boost::signals2::signal& filenames, LLFilePicker::ELoadFilter load_filter, LLFilePicker::ESaveFilter save_filter)> file_picked_signal_t; + + LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ELoadFilter filter, bool get_multiple); + LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ESaveFilter filter, const std::string &proposed_name); + ~LLFilePickerReplyThread(); + + virtual void notify(const std::vector& filenames); + +private: + LLFilePicker::ELoadFilter mLoadFilter; + LLFilePicker::ESaveFilter mSaveFilter; + file_picked_signal_t* mFilePickedSignal; +}; + + #endif -- cgit v1.2.3 From f2113a037c7215d0234652f6ae69c63e8b91df58 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 31 May 2018 14:59:31 +0300 Subject: MAINT-8700 Remove obsolete code and update 'Save texture' file dialog --- indra/newview/llfilepicker.h | 2 - indra/newview/llpreviewtexture.cpp | 25 ++++---- indra/newview/llpreviewtexture.h | 2 + indra/newview/llviewermenufile.cpp | 116 ------------------------------------- 4 files changed, 15 insertions(+), 130 deletions(-) diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 7914067976..2fc496a144 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -198,6 +198,4 @@ public: ~LLFilePicker(); }; -const std::string upload_pick(void* data); - #endif diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 12bcd89cb0..9d8be4b2fe 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -46,6 +46,7 @@ #include "lltextureview.h" #include "llui.h" #include "llviewerinventory.h" +#include "llviewermenufile.h" // LLFilePickerReplyThread #include "llviewertexture.h" #include "llviewertexturelist.h" #include "lluictrlfactory.h" @@ -293,27 +294,27 @@ void LLPreviewTexture::saveAs() if( mLoadingFullImage ) return; - LLFilePicker& file_picker = LLFilePicker::instance(); - const LLInventoryItem* item = getItem() ; - if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGAPNG, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) ) - { - // User canceled or we failed to acquire save file. - return; - } - if(mPreviewToSave) + std::string filename = getItem() ? LLDir::getScrubbedFileName(getItem()->getName()) : LLStringUtil::null; + (new LLFilePickerReplyThread(boost::bind(&LLPreviewTexture::saveTextureToFile, this, _1), LLFilePicker::FFSAVE_TGAPNG, filename))->getFile(); +} + +void LLPreviewTexture::saveTextureToFile(const std::vector& filenames) +{ + const LLInventoryItem* item = getItem(); + if (item && mPreviewToSave) { mPreviewToSave = FALSE; LLFloaterReg::showTypedInstance("preview_texture", item->getUUID()); } // remember the user-approved/edited file name. - mSaveFileName = file_picker.getFirstFile(); + mSaveFileName = filenames[0]; mLoadingFullImage = TRUE; getWindow()->incBusyCount(); - mImage->forceToSaveRawImage(0) ;//re-fetch the raw image if the old one is removed. - mImage->setLoadedCallback( LLPreviewTexture::onFileLoadedForSave, - 0, TRUE, FALSE, new LLUUID( mItemUUID ), &mCallbackTextureList ); + mImage->forceToSaveRawImage(0);//re-fetch the raw image if the old one is removed. + mImage->setLoadedCallback(LLPreviewTexture::onFileLoadedForSave, + 0, TRUE, FALSE, new LLUUID(mItemUUID), &mCallbackTextureList); } // virtual diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index c156c48d0c..ad77d9e118 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -61,6 +61,8 @@ public: BOOL final, void* userdata ); void openToSave(); + + void saveTextureToFile(const std::vector& filenames); static void onSaveAsBtn(void* data); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index f676519153..dc05d98228 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -427,122 +427,6 @@ const void upload_bulk(const std::vector& filenames, LLFilePicker:: } } -/** - char* upload_pick(void* data) - - If applicable, brings up a file chooser in which the user selects a file - to upload for a particular task. If the file is valid for the given action, - returns the string to the full path filename, else returns NULL. - Data is the load filter for the type of file as defined in LLFilePicker. -**/ -const std::string upload_pick(void* data) -{ - if( gAgentCamera.cameraMouselook() ) - { - gAgentCamera.changeCameraToDefault(); - // This doesn't seem necessary. JC - // display(); - } - - LLFilePicker::ELoadFilter type; - if(data) - { - type = (LLFilePicker::ELoadFilter)((intptr_t)data); - } - else - { - type = LLFilePicker::FFLOAD_ALL; - } - - LLFilePicker& picker = LLFilePicker::instance(); - if (!picker.getOpenFile(type)) - { - LL_INFOS() << "Couldn't import objects from file" << LL_ENDL; - return std::string(); - } - - - const std::string& filename = picker.getFirstFile(); - std::string ext = gDirUtilp->getExtension(filename); - - //strincmp doesn't like NULL pointers - if (ext.empty()) - { - std::string short_name = gDirUtilp->getBaseFileName(filename); - - // No extension - LLSD args; - args["FILE"] = short_name; - LLNotificationsUtil::add("NoFileExtension", args); - return std::string(); - } - else - { - //so there is an extension - //loop over the valid extensions and compare to see - //if the extension is valid - - //now grab the set of valid file extensions - std::string valid_extensions = build_extensions_string(type); - - BOOL ext_valid = FALSE; - - typedef boost::tokenizer > tokenizer; - boost::char_separator sep(" "); - tokenizer tokens(valid_extensions, sep); - tokenizer::iterator token_iter; - - //now loop over all valid file extensions - //and compare them to the extension of the file - //to be uploaded - for( token_iter = tokens.begin(); - token_iter != tokens.end() && ext_valid != TRUE; - ++token_iter) - { - const std::string& cur_token = *token_iter; - - if (cur_token == ext || cur_token == "*.*") - { - //valid extension - //or the acceptable extension is any - ext_valid = TRUE; - } - }//end for (loop over all tokens) - - if (ext_valid == FALSE) - { - //should only get here if the extension exists - //but is invalid - LLSD args; - args["EXTENSION"] = ext; - args["VALIDS"] = valid_extensions; - LLNotificationsUtil::add("InvalidFileExtension", args); - return std::string(); - } - }//end else (non-null extension) - - //valid file extension - - //now we check to see - //if the file is actually a valid image/sound/etc. - if (type == LLFilePicker::FFLOAD_WAV) - { - // pre-qualify wavs to make sure the format is acceptable - std::string error_msg; - if (check_for_invalid_wav_formats(filename,error_msg)) - { - LL_INFOS() << error_msg << ": " << filename << LL_ENDL; - LLSD args; - args["FILE"] = filename; - LLNotificationsUtil::add( error_msg, args ); - return std::string(); - } - }//end if a wave/sound file - - - return filename; -} - class LLFileUploadImage : public view_listener_t { bool handleEvent(const LLSD& userdata) -- cgit v1.2.3 From b1f2b350799f10e0980b0814d10e85dd3543e2af Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 31 May 2018 18:24:42 +0300 Subject: MAINT-8702 FIXED Uploading any item results in opening previous Item Profile instead of Inventory Floater --- indra/newview/llinventorypanel.cpp | 10 ++++++---- indra/newview/llviewerassetupload.cpp | 9 +-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 7e3fa1d334..702675ad49 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1449,14 +1449,16 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) //static void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel, BOOL take_keyboard_focus, BOOL reset_filter) { - LLInventoryPanel *active_panel; + LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + sidepanel_inventory->showInventoryPanel(); + bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); if (main_panel && !in_inbox) { - LLFloaterSidePanelContainer::getPanel("inventory")->selectAllItemsPanel(); + sidepanel_inventory->selectAllItemsPanel(); } - active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if (active_panel) { @@ -1469,7 +1471,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L if (in_inbox) { - LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + LLInventoryPanel * inventory_panel = NULL; sidepanel_inventory->openInbox(); inventory_panel = sidepanel_inventory->getInboxPanel(); diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 346b2c0d1b..4e13eceb55 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -766,14 +766,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti // Show the preview panel for textures and sounds to let // user know that the image (or snapshot) arrived intact. LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (panel) - { - panel->setSelection(serverInventoryItem, TAKE_FOCUS_NO); - } - else - { - LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, TRUE, TAKE_FOCUS_NO, TRUE); - } + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, TRUE, TAKE_FOCUS_NO, (panel == NULL)); // restore keyboard focus gFocusMgr.setKeyboardFocus(focus); -- cgit v1.2.3 From c767c906b299116a38de826f8a442962ca0637d9 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 1 Jun 2018 14:14:02 +0300 Subject: MAINT-8714 Eliminate viewer duplicated ID nodes --- .../default/xui/en/floater_preferences_graphics_advanced.xml | 6 +++--- indra/newview/skins/default/xui/en/menu_people_blocked_gear.xml | 2 +- indra/newview/skins/default/xui/en/notifications.xml | 8 -------- indra/newview/skins/default/xui/en/panel_preferences_uploads.xml | 2 +- indra/newview/skins/default/xui/en/strings.xml | 3 +-- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 1425d16cf1..c2500951a6 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -253,7 +253,7 @@ follows="left|top" height="16" layout="topleft" - name="ShadersText" + name="HardwareText" top_delta="20" left="10" width="128"> @@ -426,7 +426,7 @@ follows="left|top" height="16" layout="topleft" - name="AvatarText" + name="MeshText" top_delta="20" left="400" top="21" @@ -917,7 +917,7 @@ are saved in a preset file. --> label="RenderAvatarMaxComplexity" layout="topleft" left="0" - name="RenderAvatarMaxNonImpostors" + name="RenderAvatarMaxComplexity" top_delta="0" width="0"> diff --git a/indra/newview/skins/default/xui/en/menu_people_blocked_gear.xml b/indra/newview/skins/default/xui/en/menu_people_blocked_gear.xml index 01ca38f51a..5e16707340 100644 --- a/indra/newview/skins/default/xui/en/menu_people_blocked_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_people_blocked_gear.xml @@ -53,7 +53,7 @@ + name="MuteParticles"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 73b7671824..7f9dc0c41f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10413,14 +10413,6 @@ Not enough script resources available to attach object! Cannot attach object because it is already being removed. - - fail - The attachment has requested a nonexistent point on the avatar. It has been attached to the chest instead. - - Models diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0a220e68fd..882fbaf634 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4199,8 +4199,7 @@ Try enclosing path to the editor with double quotes. Control Camera Teleport Permission - Unknown: [Permission] - + Conversations are not being logged. To begin keeping a log, choose "Save: Log only" or "Save: Log and transcripts" under Preferences > Chat. -- cgit v1.2.3 From 18bb3f6b86b32c4ca22f0466ee175d68969a03fd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 1 Jun 2018 13:51:03 +0000 Subject: MAINT-8712 Crash on close in LLWindowWin32 --- indra/llwindow/llwindowwin32.cpp | 8 ++++++++ indra/newview/llviewerwindow.cpp | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 6e3aba51cf..f98c2423e5 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2708,6 +2708,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ } } break; + default: + { + if (gDebugWindowProc) + { + LL_INFOS("Window") << "Unhandled windows message code: " << U32(u_msg) << LL_ENDL; + } + } + break; } window_imp->mCallbacks->handlePauseWatchdog(window_imp); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d54138b80e..f394d6913f 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2156,6 +2156,15 @@ void LLViewerWindow::shutdownViews() RecordToChatConsole::getInstance()->stopRecorder(); LL_INFOS() << "Warning logger is cleaned." << LL_ENDL ; + gFocusMgr.unlockFocus(); + gFocusMgr.setMouseCapture(NULL); + gFocusMgr.setKeyboardFocus(NULL); + gFocusMgr.setTopCtrl(NULL); + if (mWindow) + { + mWindow->allowLanguageTextInput(NULL, FALSE); + } + delete mDebugText; mDebugText = NULL; @@ -2188,7 +2197,11 @@ void LLViewerWindow::shutdownViews() view_listener_t::cleanup(); LL_INFOS() << "view listeners destroyed." << LL_ENDL ; - + + // Clean up pointers that are going to be invalid. (todo: check sMenuContainer) + mProgressView = NULL; + mPopupView = NULL; + // Delete all child views. delete mRootView; mRootView = NULL; -- cgit v1.2.3 From 0a36c8d3be17032db20a9bdeff2b00ae2ed608a0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 7 Jun 2018 20:10:24 +0300 Subject: MAINT-8689 Potential crash fix --- indra/newview/llavatarrenderinfoaccountant.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 7413dbed20..7c7f55f68c 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -286,6 +286,9 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio && regionp->getRenderInfoReportTimer().hasExpired() // Time to make request) ) { + // make sure we won't re-report, coro will update timer with correct time later + regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_REPORTS); + std::string coroname = LLCoros::instance().launch("LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro", boost::bind(&LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro, url, regionp->getHandle())); @@ -306,6 +309,9 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi << " from " << url << LL_ENDL; + // make sure we won't re-request, coro will update timer with correct time later + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST); + // First send a request to get the latest data std::string coroname = LLCoros::instance().launch("LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro", -- cgit v1.2.3 From 71fa94b3665b4554470314f481c9f0a35f8e6ef2 Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Wed, 30 May 2018 05:51:37 +0530 Subject: [MAINT-8693] - fix null check --- indra/llappearance/llwearable.cpp | 4 ++-- indra/newview/llfloateravatartextures.cpp | 4 ++-- indra/newview/llviewerwearable.cpp | 2 +- indra/newview/llvoavatar.cpp | 8 ++++---- indra/newview/llvoavatarself.cpp | 4 +++- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index edcfd49bb4..6079913a8e 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -184,7 +184,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) { LLTexLayerSet *layer_set = NULL; const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te); - if (texture_dict->mIsUsedByBakedTexture) + if (texture_dict && texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; @@ -197,7 +197,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) } else { - LL_ERRS() << "could not find layerset for LTO in wearable!" << LL_ENDL; + LL_WARNS() << "could not find layerset for LTO in wearable!" << LL_ENDL; } } diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index 78807a8e99..8e654a53c4 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -78,7 +78,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp, { LLUUID id = IMG_DEFAULT_AVATAR; const LLAvatarAppearanceDictionary::TextureEntry* tex_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture(te); - if (tex_entry->mIsLocalTexture) + if (tex_entry && tex_entry->mIsLocalTexture) { if (avatarp->isSelf()) { @@ -96,7 +96,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp, } else { - id = avatarp->getTE(te)->getID(); + id = tex_entry ? avatarp->getTE(te)->getID() : IMG_DEFAULT_AVATAR; } //id = avatarp->getTE(te)->getID(); if (id == IMG_DEFAULT_AVATAR) diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index ae9ce37a28..2d7a0f920f 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -301,7 +301,7 @@ void LLViewerWearable::setTexturesToDefaults() LLUUID LLViewerWearable::getDefaultTextureImageID(ETextureIndex index) const { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); - const std::string &default_image_name = texture_dict->mDefaultImageName; + const std::string &default_image_name = texture_dict ? texture_dict->mDefaultImageName : ""; if (default_image_name == "") { return IMG_DEFAULT_AVATAR; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7458c00b70..5eef48d735 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1007,7 +1007,7 @@ void LLVOAvatar::dumpBakedStatus() const ETextureIndex index = baked_dict->mTextureIndex; if (!inst->isTextureDefined(index)) { - LL_CONT << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName; + LL_CONT << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index) ? LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName : ""; } } LL_CONT << " ) " << inst->getUnbakedPixelAreaRank(); @@ -4715,7 +4715,7 @@ void LLVOAvatar::collectLocalTextureUUIDs(std::set& ids) const if (imagep) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)texture_index); - if (texture_dict->mIsLocalTexture) + if (texture_dict && texture_dict->mIsLocalTexture) { ids.insert(imagep->getID()); } @@ -4872,8 +4872,8 @@ void LLVOAvatar::updateTextures() if (imagep) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)texture_index); - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - if (texture_dict->mIsLocalTexture) + const EBakedTextureIndex baked_index = texture_dict ? texture_dict->mBakedTextureIndex : EBakedTextureIndex::BAKED_NUM_INDICES; + if (texture_dict && texture_dict->mIsLocalTexture) { addLocalTextureStats((ETextureIndex)texture_index, imagep, texel_area_ratio, render_avatar, mBakedTextureDatas[baked_index].mIsUsed); } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 00e72bfbff..b2954f4de2 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2606,6 +2606,8 @@ void LLVOAvatarSelf::requestLayerSetUpdate(ETextureIndex index ) if( mUpperBodyLayerSet ) mUpperBodyLayerSet->requestUpdate(); */ const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); + if (!texture_dict) + return; if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture) return; const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; @@ -2622,7 +2624,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const case TEX_HEAD_BODYPAINT: return mHeadLayerSet; */ const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); - if (texture_dict->mIsUsedByBakedTexture) + if (texture_dict && texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return getLayerSet(baked_index); -- cgit v1.2.3 From 5651b433d3fcfba6a98e31edc3a747059bf3560a Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Wed, 6 Jun 2018 03:23:32 +0530 Subject: fix xcode build --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5eef48d735..b221dc7c35 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1007,7 +1007,7 @@ void LLVOAvatar::dumpBakedStatus() const ETextureIndex index = baked_dict->mTextureIndex; if (!inst->isTextureDefined(index)) { - LL_CONT << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index) ? LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName : ""; + LL_CONT << " " << (LLAvatarAppearanceDictionary::getInstance()->getTexture(index) ? LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName : ""); } } LL_CONT << " ) " << inst->getUnbakedPixelAreaRank(); -- cgit v1.2.3 From 71b199bd140572c88d5d72feffc81fe6c8de8de8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 21 Jun 2018 08:54:26 -0400 Subject: Added tag 5.1.6-release for changeset 04538b8157c1 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index a81e5fa806..4b169ffba1 100755 --- a/.hgtags +++ b/.hgtags @@ -537,3 +537,4 @@ ad0e15543836d64d6399d28b32852510435e344a 5.1.0-release 7c00e5b6cb3d95712e9d8e29277c805bca2bda90 5.1.3-release 7b6b020fd5ad9a8dc3670c5c92d1ca92e55fc485 5.1.4-release 2ea47f358b171178eb9a95503a1670d519c2886f 5.1.5-release +04538b8157c1f5cdacd9403f0a395452d4a93689 5.1.6-release -- cgit v1.2.3 From dc07de2f4a4c49d1877bf743b6f0d209392f6eb6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 21 Jun 2018 08:54:26 -0400 Subject: increment viewer version to 5.1.7 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 8710cfdff2..cbad66a094 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -5.1.6 +5.1.7 -- cgit v1.2.3