diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-12-06 19:40:58 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-12-06 19:40:58 +0200 |
commit | 6fe00fd9adb967ff4da8b1ee53030a7f2e0ff052 (patch) | |
tree | 96f4e94d25f7ef0dba8a4f8b787d068159fdc949 /indra | |
parent | bc179e3b269aca63ad1c856d305e26969836e774 (diff) |
MAINT-8058 Fixed background requests on every prim edit
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatermediasettings.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llfloatertools.cpp | 49 | ||||
-rw-r--r-- | indra/newview/llfloatertools.h | 4 | ||||
-rw-r--r-- | indra/newview/llpanelmediasettingsgeneral.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llpanelmediasettingsgeneral.h | 2 |
5 files changed, 47 insertions, 23 deletions
diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index 4fd5c0587a..2afd889609 100644 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -171,8 +171,12 @@ void LLFloaterMediaSettings::onClose(bool app_quitting) void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editable ) { if (sInstance->hasFocus()) return; - - sInstance->clearValues(editable); + + // Clear values + sInstance->mPanelMediaSettingsGeneral->clearValues(sInstance->mPanelMediaSettingsGeneral, editable, false /*don't update preview*/); + sInstance->mPanelMediaSettingsSecurity->clearValues(sInstance->mPanelMediaSettingsSecurity, editable); + sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions, editable); + // update all panels with values from simulator sInstance->mPanelMediaSettingsGeneral-> initValues( sInstance->mPanelMediaSettingsGeneral, media_settings, editable ); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 2869256d09..9c3f0922b8 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1317,7 +1317,6 @@ void LLFloaterTools::getMediaState() std::string multi_media_info_str = LLTrans::getString("Multiple Media"); std::string media_title = ""; - mNeedMediaTitle = false; // update UI depending on whether "object" (prim or face) has media // and whether or not you are allowed to edit it. @@ -1335,17 +1334,18 @@ void LLFloaterTools::getMediaState() { // initial media title is the media URL (until we get the name) media_title = media_data_get.getHomeURL(); - - // kick off a navigate and flag that we need to update the title - navigateToTitleMedia( media_data_get.getHomeURL() ); - mNeedMediaTitle = true; + navigateToTitleMedia(media_title); + } + else + { + // all faces might be empty. Make sure we will navigate next time. + navigateToTitleMedia(std::string()); } - // else all faces might be empty. } else // there' re Different Medias' been set on on the faces. { media_title = multi_media_info_str; - mNeedMediaTitle = false; + navigateToTitleMedia(media_title); } getChildView("media_tex")->setEnabled(bool_has_media && editable); @@ -1362,7 +1362,7 @@ void LLFloaterTools::getMediaState() if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia) { media_title = multi_media_info_str; - mNeedMediaTitle = false; + navigateToTitleMedia(media_title); } else { @@ -1371,10 +1371,12 @@ void LLFloaterTools::getMediaState() { // initial media title is the media URL (until we get the name) media_title = media_data_get.getHomeURL(); - - // kick off a navigate and flag that we need to update the title - navigateToTitleMedia( media_data_get.getHomeURL() ); - mNeedMediaTitle = true; + navigateToTitleMedia(media_title); + } + else + { + // Make sure we will navigate next time. + navigateToTitleMedia(std::string()); } } @@ -1472,16 +1474,31 @@ void LLFloaterTools::clearMediaSettings() // void LLFloaterTools::navigateToTitleMedia( const std::string url ) { - if ( mTitleMedia ) + std::string multi_media_info_str = LLTrans::getString("Multiple Media"); + if (url.empty() || multi_media_info_str == url) + { + // nothing to show + mNeedMediaTitle = false; + } + else if (mTitleMedia) { LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin(); - if ( media_plugin ) + + if ( media_plugin ) // Shouldn't this be after navigateTo creates plugin? { // if it's a movie, we don't want to hear it media_plugin->setVolume( 0 ); }; - mTitleMedia->navigateTo( url ); - }; + + // check if url changed or if we need a new media source + if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == NULL) + { + mTitleMedia->navigateTo( url ); + } + + // flag that we need to update the title (even if no request were made) + mNeedMediaTitle = true; + } } ////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index 8f586f7da6..ffff564ad4 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -102,8 +102,6 @@ public: void onClickBtnAddMedia(); void onClickBtnEditMedia(); void clearMediaSettings(); - void updateMediaTitle(); - void navigateToTitleMedia( const std::string url ); bool selectedMediaEditable(); void updateLandImpacts(); @@ -116,6 +114,8 @@ private: void refreshMedia(); void getMediaState(); void updateMediaSettings(); + void navigateToTitleMedia( const std::string url ); // navigate if changed + void updateMediaTitle(); static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response); static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response); static void setObjectType( LLPCode pcode ); diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index d7c43c224c..3522189842 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -196,7 +196,7 @@ void LLPanelMediaSettingsGeneral::draw() //////////////////////////////////////////////////////////////////////////////// // static -void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) +void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable, bool update_preview) { LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata; self->mAutoLoop->clear(); @@ -217,7 +217,10 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) self->mHeightPixels ->setEnabled(editable); self->mHomeURL ->setEnabled(editable); self->mWidthPixels ->setEnabled(editable); - self->updateMediaPreview(); + if (update_preview) + { + self->updateMediaPreview(); + } } // static diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h index 0ae1401ab2..06793d91fc 100644 --- a/indra/newview/llpanelmediasettingsgeneral.h +++ b/indra/newview/llpanelmediasettingsgeneral.h @@ -59,7 +59,7 @@ public: void setParent( LLFloaterMediaSettings* parent ); static void initValues( void* userdata, const LLSD& media_settings ,bool editable); - static void clearValues( void* userdata, bool editable); + static void clearValues( void* userdata, bool editable, bool update_preview = true); // Navigates the current selected face to the Home URL. // If 'only_if_current_is_empty' is "true", it only performs |