diff options
Diffstat (limited to 'indra')
5 files changed, 94 insertions, 61 deletions
diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 85efe0f93e..5186a5888b 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -55,6 +55,8 @@ #include "llfloatertools.h" #include "lltrans.h" +const char *CHECKERBOARD_DATA_URL = "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%%22 height=%22100%%22 %3E%3Cdefs%3E%3Cpattern id=%22checker%22 patternUnits=%22userSpaceOnUse%22 x=%220%22 y=%220%22 width=%22128%22 height=%22128%22 viewBox=%220 0 128 128%22 %3E%3Crect x=%220%22 y=%220%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3Crect x=%2264%22 y=%2264%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3C/pattern%3E%3C/defs%3E%3Crect x=%220%22 y=%220%22 width=%22100%%22 height=%22100%%22 fill=%22url(#checker)%22 /%3E%3C/svg%3E"; + //////////////////////////////////////////////////////////////////////////////// // LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() : @@ -97,7 +99,6 @@ BOOL LLPanelMediaSettingsGeneral::postBuild() childSetCommitCallback( "current_url_reset_btn",onBtnResetCurrentUrl, this); // interrogates controls and updates widgets as required updateMediaPreview(); - updateCurrentURL(); return true; } @@ -160,9 +161,9 @@ void LLPanelMediaSettingsGeneral::draw() }; }; - // current URL can change over time. -// updateCurrentURL(); - + // current URL can change over time, update it here + updateCurrentUrl(); + LLPermissions perm; bool user_can_press_reset = mMediaEditable; @@ -215,26 +216,15 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) self->updateMediaPreview(); } -//////////////////////////////////////////////////////////////////////////////// -// static -void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_settings ,bool editable) +// static +bool LLPanelMediaSettingsGeneral::isMultiple() { - LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata; - self->mMediaEditable = editable; - - //llinfos << "---------------" << llendl; - //llinfos << ll_pretty_print_sd(media_settings) << llendl; - //llinfos << "---------------" << llendl; - // IF all the faces have media (or all dont have media) if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo ) { if(LLFloaterMediaSettings::getInstance()->mMultipleMedia) { - self->clearValues(self, self->mMediaEditable); - // only show multiple - self->mHomeURL ->setText(LLTrans::getString("Multiple Media")); - return; + return true; } } @@ -242,13 +232,32 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_ { if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia) { - self->clearValues(self, self->mMediaEditable); - // only show multiple - self->mHomeURL ->setText(LLTrans::getString("Multiple Media")); - return; - } - + return true; + } } + return false; +} + +//////////////////////////////////////////////////////////////////////////////// +// static +void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_settings ,bool editable) +{ + LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata; + self->mMediaEditable = editable; + + //llinfos << "---------------" << llendl; + //llinfos << ll_pretty_print_sd(media_settings) << llendl; + //llinfos << "---------------" << llendl; + + if ( LLPanelMediaSettingsGeneral::isMultiple() ) + { + self->clearValues(self, self->mMediaEditable); + // only show multiple + self->mHomeURL->setText(LLTrans::getString("Multiple Media")); + self->mCurrentURL->setText(LLTrans::getString("Multiple Media")); + return; + } + std::string base_key( "" ); std::string tentative_key( "" ); @@ -305,7 +314,6 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_ // interrogates controls and updates widgets as required self->updateMediaPreview(); - self->updateCurrentURL(); } //////////////////////////////////////////////////////////////////////////////// @@ -320,22 +328,11 @@ void LLPanelMediaSettingsGeneral::updateMediaPreview() // new home URL will be empty if media is deleted so display a // "preview goes here" data url page { - mPreviewMedia->navigateTo( "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%%22 height=%22100%%22 %3E%3Cdefs%3E%3Cpattern id=%22checker%22 patternUnits=%22userSpaceOnUse%22 x=%220%22 y=%220%22 width=%22128%22 height=%22128%22 viewBox=%220 0 128 128%22 %3E%3Crect x=%220%22 y=%220%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3Crect x=%2264%22 y=%2264%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3C/pattern%3E%3C/defs%3E%3Crect x=%220%22 y=%220%22 width=%22100%%22 height=%22100%%22 fill=%22url(#checker)%22 /%3E%3C/svg%3E" ); + mPreviewMedia->navigateTo( CHECKERBOARD_DATA_URL ); }; } //////////////////////////////////////////////////////////////////////////////// -// Helper to set current URL -void LLPanelMediaSettingsGeneral::updateCurrentURL() -{ - if( mCurrentURL->getText().empty() ) - { - childSetText( "current_url", mHomeURL->getText() ); - } - -} - -//////////////////////////////////////////////////////////////////////////////// // virtual void LLPanelMediaSettingsGeneral::onClose(bool app_quitting) @@ -441,6 +438,8 @@ bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace() LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection(); selected_objects->getSelectedTEValue( &functor_navigate_media, all_face_media_navigated ); + // Note: we don't update the 'current URL' field until the media data itself changes + return all_face_media_navigated; } @@ -451,3 +450,31 @@ const std::string LLPanelMediaSettingsGeneral::getHomeUrl() return mHomeURL->getValue().asString(); } +//////////////////////////////////////////////////////////////////////////////// +// +void LLPanelMediaSettingsGeneral::updateCurrentUrl() +{ + // Get the current URL from the selection + + const LLMediaEntry default_media_data; + std::string value_str = default_media_data.getCurrentURL(); + struct functor_getter_current_url : public LLSelectedTEGetFunctor< std::string > + { + functor_getter_current_url(const LLMediaEntry& entry): mMediaEntry(entry) {} + + std::string get( LLViewerObject* object, S32 face ) + { + if ( object ) + if ( object->getTE(face) ) + if ( object->getTE(face)->getMediaData() ) + return object->getTE(face)->getMediaData()->getCurrentURL(); + return mMediaEntry.getCurrentURL(); + }; + + const LLMediaEntry & mMediaEntry; + + } func_current_url(default_media_data); + bool identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func_current_url, value_str ); + mCurrentURL->setText(value_str); + mCurrentURL->setTentative(identical); +} diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h index e82a31382e..b48e081a1b 100644 --- a/indra/newview/llpanelmediasettingsgeneral.h +++ b/indra/newview/llpanelmediasettingsgeneral.h @@ -63,7 +63,6 @@ public: bool navigateHomeSelectedFace(); void updateMediaPreview(); - void updateCurrentURL(); const std::string getHomeUrl(); @@ -72,8 +71,12 @@ protected: bool mMediaEditable; private: + void updateCurrentUrl(); + static void onBtnResetCurrentUrl(LLUICtrl* ctrl, void *userdata); static void onCommitHomeURL(LLUICtrl* ctrl, void *userdata ); + + static bool isMultiple(); LLComboBox* mControls; LLCheckBoxCtrl* mAutoLoop; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 0b2a7e8756..73e19b3b2a 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -228,6 +228,7 @@ void LLPanelPrimMediaControls::updateShape() bool can_navigate = parcel->getMediaAllowNavigate(); bool enabled = false; + bool is_zoomed = (mCurrentZoom != ZOOM_NONE); // There is no such thing as "has_focus" being different from normal controls set // anymore (as of user feedback from bri 10/09). So we cheat here and force 'has_focus' // to 'true' (or, actually, we use a setting) @@ -256,7 +257,7 @@ void LLPanelPrimMediaControls::updateShape() LLUICtrl* stop_ctrl = getChild<LLUICtrl>("stop"); LLUICtrl* media_stop_ctrl = getChild<LLUICtrl>("media_stop"); LLUICtrl* home_ctrl = getChild<LLUICtrl>("home"); - LLUICtrl* close_ctrl = getChild<LLUICtrl>("close"); + LLUICtrl* unzoom_ctrl = getChild<LLUICtrl>("close"); // This is actually "unzoom" LLUICtrl* open_ctrl = getChild<LLUICtrl>("new_window"); LLUICtrl* zoom_ctrl = getChild<LLUICtrl>("zoom_frame"); LLPanel* media_loading_panel = getChild<LLPanel>("media_progress_indicator"); @@ -283,7 +284,8 @@ void LLPanelPrimMediaControls::updateShape() reload_ctrl->setVisible(has_focus); stop_ctrl->setVisible(false); home_ctrl->setVisible(has_focus); - close_ctrl->setVisible(has_focus); + zoom_ctrl->setVisible(!is_zoomed); + unzoom_ctrl->setVisible(has_focus && is_zoomed); open_ctrl->setVisible(true); media_address_ctrl->setVisible(has_focus && !mini_controls); media_play_slider_panel->setVisible(has_focus && !mini_controls); @@ -294,6 +296,7 @@ void LLPanelPrimMediaControls::updateShape() whitelist_icon->setVisible(!mini_controls && (media_data)?media_data->getWhiteListEnable():false); // Disable zoom if HUD zoom_ctrl->setEnabled(!objectp->isHUDAttachment()); + unzoom_ctrl->setEnabled(!objectp->isHUDAttachment()); secure_lock_icon->setVisible(false); mCurrentURL = media_impl->getCurrentMediaURL(); diff --git a/indra/newview/skins/default/xui/en/floater_media_settings.xml b/indra/newview/skins/default/xui/en/floater_media_settings.xml index 6b884d46a7..68dd2001af 100644 --- a/indra/newview/skins/default/xui/en/floater_media_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_media_settings.xml @@ -15,7 +15,7 @@ min_height="430" min_width="620" mouse_opaque="true" - name="Medis Settings" + name="Media Settings" help_topic = "media_settings" title="MEDIA SETTINGS"> <button diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index fc5ccdb63e..3bdd7114ee 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -494,13 +494,32 @@ disabled image_selected="media_btn_optimalzoom.png" image_unselected="media_btn_optimalzoom.png" layout="topleft" - tool_tip="Zoom" + tool_tip="Zoom into media" min_width="22" width="22"> <button.commit_callback function="MediaCtrl.Zoom" /> </button> </layout_panel> + <layout_panel + name="close" + auto_resize="false" + user_resize="false" + layout="topleft" + min_width="21" + width="21" > + <button + height="22" + image_selected="media_btn_done.png" + image_unselected="media_btn_done.png" + layout="topleft" + tool_tip ="Zoom Back" + top_delta="-4" + width="21" > + <button.commit_callback + function="MediaCtrl.Close" /> + </button> + </layout_panel> <!-- <panel height="22" @@ -554,25 +573,6 @@ disabled </panel> --> <layout_panel - name="close" - auto_resize="false" - user_resize="false" - layout="topleft" - min_width="21" - width="21" > - <button - height="22" - image_selected="media_btn_done.png" - image_unselected="media_btn_done.png" - layout="topleft" - tool_tip ="Close media control" - top_delta="-4" - width="21" > - <button.commit_callback - function="MediaCtrl.Close" /> - </button> - </layout_panel> - <layout_panel width="0" layout="topleft" user_resize="false" /> |