summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorJiao Li <angela@lindenlab.com>2009-10-07 08:18:51 +0000
committerJiao Li <angela@lindenlab.com>2009-10-07 08:18:51 +0000
commita99449bea167ba4710d7cc32a3961d0499bf6e09 (patch)
tree968440270dfe97d6113e57a8c5ccef308966493b /indra/newview
parent9f2f620cdfd722f9bc46dc378072f490001529e2 (diff)
DEV-40215, DEV-40829,DEV-40374 ,DEV-40197, DEV-40749, DEV-3877 -- reviewed by rick
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatermediasettings.cpp23
-rw-r--r--indra/newview/llfloatermediasettings.h9
-rw-r--r--indra/newview/llfloatertools.cpp371
-rw-r--r--indra/newview/llfloatertools.h3
-rw-r--r--indra/newview/llpanelface.cpp4
-rw-r--r--indra/newview/llpanelmediasettingsgeneral.cpp103
-rw-r--r--indra/newview/llpanelmediasettingsgeneral.h6
-rw-r--r--indra/newview/llpanelmediasettingspermissions.cpp45
-rw-r--r--indra/newview/llpanelmediasettingspermissions.h4
-rw-r--r--indra/newview/llpanelmediasettingssecurity.cpp30
-rw-r--r--indra/newview/llpanelmediasettingssecurity.h4
-rw-r--r--indra/newview/llselectmgr.h50
-rw-r--r--indra/newview/skins/default/xui/en/floater_tools.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_media_settings_general.xml97
-rw-r--r--indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml156
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml3
16 files changed, 681 insertions, 229 deletions
diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp
index 811cc26efb..f67d663772 100644
--- a/indra/newview/llfloatermediasettings.cpp
+++ b/indra/newview/llfloatermediasettings.cpp
@@ -52,7 +52,10 @@ LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key)
mPanelMediaSettingsGeneral(NULL),
mPanelMediaSettingsSecurity(NULL),
mPanelMediaSettingsPermissions(NULL),
- mWaitingToClose( false )
+ mWaitingToClose( false ),
+ mIdenticalHasMediaInfo( true ),
+ mMultipleMedia(false),
+ mMultipleValidMedia(false)
{
// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_media_settings.xml");
}
@@ -164,18 +167,18 @@ void LLFloaterMediaSettings::onClose()
////////////////////////////////////////////////////////////////////////////////
//static
-void LLFloaterMediaSettings::initValues( const LLSD& media_settings )
+void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editable )
{
- sInstance->clearValues();
+ sInstance->clearValues(editable);
// update all panels with values from simulator
sInstance->mPanelMediaSettingsGeneral->
- initValues( sInstance->mPanelMediaSettingsGeneral, media_settings );
+ initValues( sInstance->mPanelMediaSettingsGeneral, media_settings, editable );
sInstance->mPanelMediaSettingsSecurity->
- initValues( sInstance->mPanelMediaSettingsSecurity, media_settings );
+ initValues( sInstance->mPanelMediaSettingsSecurity, media_settings, editable );
sInstance->mPanelMediaSettingsPermissions->
- initValues( sInstance->mPanelMediaSettingsPermissions, media_settings );
+ initValues( sInstance->mPanelMediaSettingsPermissions, media_settings, editable );
}
@@ -195,12 +198,12 @@ void LLFloaterMediaSettings::commitFields()
////////////////////////////////////////////////////////////////////////////////
//static
-void LLFloaterMediaSettings::clearValues()
+void LLFloaterMediaSettings::clearValues( bool editable)
{
// clean up all panels before updating
- sInstance->mPanelMediaSettingsGeneral->clearValues(sInstance->mPanelMediaSettingsGeneral);
- sInstance->mPanelMediaSettingsSecurity->clearValues(sInstance->mPanelMediaSettingsSecurity);
- sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions);
+ sInstance->mPanelMediaSettingsGeneral ->clearValues(sInstance->mPanelMediaSettingsGeneral, editable);
+ sInstance->mPanelMediaSettingsSecurity ->clearValues(sInstance->mPanelMediaSettingsSecurity, editable);
+ sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions, editable);
}
diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h
index b95c590346..10dc31b4f9 100644
--- a/indra/newview/llfloatermediasettings.h
+++ b/indra/newview/llfloatermediasettings.h
@@ -50,11 +50,15 @@ public:
virtual BOOL postBuild();
static LLFloaterMediaSettings* getInstance();
static void apply();
- static void initValues( const LLSD& media_settings );
- static void clearValues();
+ static void initValues( const LLSD& media_settings , bool editable);
+ static void clearValues( bool editable);
void enableOkApplyBtns( bool enable );
LLPanelMediaSettingsSecurity* getPanelSecurity(){return mPanelMediaSettingsSecurity;};
+ bool mIdenticalHasMediaInfo;
+ bool mMultipleMedia;
+ bool mMultipleValidMedia;
+
protected:
LLButton *mOKBtn;
LLButton *mCancelBtn;
@@ -65,6 +69,7 @@ protected:
LLPanelMediaSettingsSecurity* mPanelMediaSettingsSecurity;
LLPanelMediaSettingsPermissions* mPanelMediaSettingsPermissions;
+
void onClose();
static void onBtnOK(void*);
static void onBtnCancel(void*);
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index c08996cc26..500dc1e50c 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -77,12 +77,14 @@
#include "lltoolpipette.h"
#include "lltoolplacer.h"
#include "lltoolselectland.h"
+#include "lltrans.h"
#include "llui.h"
+#include "llviewercontrol.h"
+#include "llviewerjoystick.h"
+#include "llviewerregion.h"
#include "llviewermenu.h"
#include "llviewerparcelmgr.h"
#include "llviewerwindow.h"
-#include "llviewercontrol.h"
-#include "llviewerjoystick.h"
#include "lluictrlfactory.h"
// Globals
@@ -980,27 +982,86 @@ void LLFloaterTools::onFocusReceived()
void LLFloaterTools::refreshMedia()
{
getMediaState();
- LLFloaterMediaSettings::getInstance();
- LLFloaterMediaSettings::initValues(mMediaSettings );
}
-
+bool LLFloaterTools::selectedMediaEditable()
+{
+ U32 owner_mask_on;
+ U32 owner_mask_off;
+ U32 valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm( PERM_OWNER,
+ &owner_mask_on, &owner_mask_off );
+ U32 group_mask_on;
+ U32 group_mask_off;
+ U32 valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm( PERM_GROUP,
+ &group_mask_on, &group_mask_off );
+ U32 everyone_mask_on;
+ U32 everyone_mask_off;
+ S32 valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm( PERM_EVERYONE,
+ &everyone_mask_on, &everyone_mask_off );
+
+ bool selected_Media_editable = false;
+
+ // if perms we got back are valid
+ if ( valid_owner_perms &&
+ valid_group_perms &&
+ valid_everyone_perms )
+ {
+
+ if ( ( owner_mask_on & PERM_MODIFY ) ||
+ ( group_mask_on & PERM_MODIFY ) ||
+ ( group_mask_on & PERM_MODIFY ) )
+ {
+ selected_Media_editable = true;
+ }
+ else
+ // user is NOT allowed to press the RESET button
+ {
+ selected_Media_editable = false;
+ };
+ };
+
+ return selected_Media_editable;
+}
void LLFloaterTools::getMediaState()
{
- LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
+ LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection();
+ LLViewerObject* first_object = selected_objects->getFirstObject();
+ LLLineEditor* media_info = getChild<LLLineEditor>("media_info");
+
+ if( !(first_object
+ && first_object->getPCode() == LL_PCODE_VOLUME
+ &&first_object->permModify()
+ ))
+ {
+ childSetEnabled("media_tex", FALSE);
+ childSetEnabled("add_media", FALSE);
+ childSetEnabled("delete_media", FALSE);
+ childSetEnabled("edit_media", FALSE);
+ childSetEnabled("media_info", FALSE);
+ media_info->setEnabled(FALSE);
+ media_info->clear();
+ clearMediaSettings();
+ return;
+ }
- if( !objectp )
+ std::string url = first_object->getRegion()->getCapability("ObjectMedia");
+ bool has_media_capability = (!url.empty());
+
+ if(!has_media_capability)
{
childSetEnabled("media_tex", FALSE);
childSetEnabled("add_media", FALSE);
childSetEnabled("delete_media", FALSE);
childSetEnabled("edit_media", FALSE);
- updateMediaSettings();
+ childSetEnabled("media_info", FALSE);
+ media_info->setEnabled(FALSE);
+ media_info->clear();
+ clearMediaSettings();
return;
}
- bool editable = gAgent.isGodlike() || (objectp->permModify() && objectp->getPCode() == LL_PCODE_VOLUME);
+ bool editable = (first_object->permModify());// && selectedMediaEditable());
// Media settings
U8 has_media = (U8)0;
@@ -1011,24 +1072,104 @@ void LLFloaterTools::getMediaState()
return (object->getTE(face)->getMediaTexGen());
}
} func;
- bool identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, has_media );
+ // check if all faces have media(or, all dont have media)
+ LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo = selected_objects->getSelectedTEValue( &func, has_media );
+ bool bool_has_media = (has_media & LLTextureEntry::MF_HAS_MEDIA);
+
+ const LLMediaEntry default_media_data;
+
+ struct functor_getter_media_data : public LLSelectedTEGetFunctor< LLMediaEntry>
+ {
+ functor_getter_media_data(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
+ LLMediaEntry get( LLViewerObject* object, S32 face )
+ {
+ if ( object )
+ if ( object->getTE(face) )
+ if ( object->getTE(face)->getMediaData() )
+ return *(object->getTE(face)->getMediaData());
+ return mMediaEntry;
+ };
+
+ const LLMediaEntry& mMediaEntry;
+
+ } func_media_data(default_media_data);
+
+ LLMediaEntry media_data_get;
+ LLFloaterMediaSettings::getInstance()->mMultipleMedia = !(selected_objects->getSelectedTEValue( &func_media_data, media_data_get ));
+
+ std::string multi_media_info_str = LLTrans::getString("Multiple Media");
+ std::string media_title = "";
// update UI depending on whether "object" (prim or face) has media
// and whether or not you are allowed to edit it.
- bool bool_has_media = (has_media & LLTextureEntry::MF_HAS_MEDIA);
- childSetEnabled("media_tex", bool_has_media & editable);
- childSetEnabled( "edit_media", bool_has_media & editable );
- childSetEnabled( "delete_media", bool_has_media & editable );
- childSetEnabled( "add_media", ( ! bool_has_media ) & editable );
+
+ // IF all the faces have media (or all dont have media)
+ if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo )
+ {
+ // TODO: get media title and set it.
+ media_info->clear();
+ // if identical is set, all faces are same (whether all empty or has the same media)
+ if(!(LLFloaterMediaSettings::getInstance()->mMultipleMedia) )
+ {
+ // Media data is valid
+ if(media_data_get!=default_media_data)
+ {
+ //TODO: get Meida title
+ //media_title = media_data_get->getTile();
+ //LLFloaterMediaSettings::getInstance()->mIdenticalValidMedia = true;
+ media_title = media_data_get.getHomeURL();
+ }
+ // else all faces might be empty.
+
+
+ }
+ else // there' re Different Medias' been set on on the faces.
+ {
+ media_title = multi_media_info_str;
+ }
+
+ childSetEnabled("media_tex", bool_has_media & editable);
+ childSetEnabled( "edit_media", bool_has_media & editable );
+ childSetEnabled( "delete_media", bool_has_media & editable );
+ childSetEnabled( "add_media", ( ! bool_has_media ) & editable );
+ media_info->setEnabled(bool_has_media & 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.
+ {
+ // seleted faces have not identical value
+ LLFloaterMediaSettings::getInstance()->mMultipleValidMedia = selected_objects->isMultipleTEValue(&func_media_data, default_media_data );
+
+ if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
+ {
+ media_title = multi_media_info_str;
+ }
+ else
+ {
+ // Media data is valid
+ if(media_data_get!=default_media_data)
+ {
+ //TODO: get Meida title
+ //media_title = media_data_get->getTile();
+ media_title = media_data_get.getHomeURL();
+ }
+
+ }
+
+ media_info->setEnabled(TRUE);
+ media_info->setTentative(true);
+ childSetEnabled("media_tex", TRUE);
+ childSetEnabled( "edit_media", TRUE);
+ childSetEnabled( "delete_media", TRUE);
+ childSetEnabled( "add_media", FALSE );
+ }
+ media_info->setText(media_title);
// load values for media settings
updateMediaSettings();
- // if identical is set, all faces are same
- if ( identical )
- {
- // TODO: display a list of all media on the face - use 'identical' flag
- };
+ LLFloaterMediaSettings::initValues(mMediaSettings, editable );
}
@@ -1104,6 +1245,12 @@ bool LLFloaterTools::deleteMediaConfirm(const LLSD& notification, const LLSD& re
return false;
}
+void LLFloaterTools::clearMediaSettings()
+{
+ LLFloaterMediaSettings::getInstance();
+ LLFloaterMediaSettings::clearValues(false);
+
+}
//////////////////////////////////////////////////////////////////////////////
//
void LLFloaterTools::updateMediaSettings()
@@ -1116,23 +1263,26 @@ void LLFloaterTools::updateMediaSettings()
LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection();
// TODO: (CP) refactor this using something clever or boost or both !!
- LLMediaEntry default_media_data;
+ const LLMediaEntry default_media_data;
// controls
U8 value_u8 = default_media_data.getControls();
struct functor_getter_controls : public LLSelectedTEGetFunctor< U8 >
{
+ functor_getter_controls(const LLMediaEntry &entry) : mMediaEntry(entry) {}
+
U8 get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getControls();
- LLMediaEntry default_media_data;
- return default_media_data.getControls();
+ return mMediaEntry.getControls();
};
- } func_controls;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_controls(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_controls, value_u8 );
base_key = std::string( LLMediaEntry::CONTROLS_KEY );
mMediaSettings[ base_key ] = value_u8;
@@ -1142,17 +1292,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = default_media_data.getFirstClickInteract();
struct functor_getter_first_click : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_first_click(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getFirstClickInteract();
- LLMediaEntry default_media_data;
- return default_media_data.getFirstClickInteract();
+ return mMediaEntry.getFirstClickInteract();
};
- } func_first_click;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_first_click(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_first_click, value_bool );
base_key = std::string( LLMediaEntry::FIRST_CLICK_INTERACT_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1162,38 +1315,43 @@ void LLFloaterTools::updateMediaSettings()
value_str = default_media_data.getHomeURL();
struct functor_getter_home_url : public LLSelectedTEGetFunctor< std::string >
{
+ functor_getter_home_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()->getHomeURL();
- LLMediaEntry default_media_data;
- return default_media_data.getHomeURL();
+ return mMediaEntry.getHomeURL();
};
- } func_home_url;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_home_url(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_home_url, value_str );
base_key = std::string( LLMediaEntry::HOME_URL_KEY );
mMediaSettings[ base_key ] = value_str;
mMediaSettings[ base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX ) ] = ! identical;
- llwarns<<"Angela debug : home url string == "<<value_str<<llendl;
// Current URL
value_str = default_media_data.getCurrentURL();
struct functor_getter_current_url : public LLSelectedTEGetFunctor< std::string >
{
- std::string get( LLViewerObject* object, S32 face )
+ 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();
- LLMediaEntry default_media_data;
- return default_media_data.getCurrentURL();
+ return mMediaEntry.getCurrentURL();
};
- } func_current_url;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_current_url(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_current_url, value_str );
base_key = std::string( LLMediaEntry::CURRENT_URL_KEY );
mMediaSettings[ base_key ] = value_str;
@@ -1203,17 +1361,21 @@ void LLFloaterTools::updateMediaSettings()
value_bool = default_media_data.getAutoZoom();
struct functor_getter_auto_zoom : public LLSelectedTEGetFunctor< bool >
{
+
+ functor_getter_auto_zoom(const LLMediaEntry& entry) : mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getAutoZoom();
- LLMediaEntry default_media_data;
- return default_media_data.getAutoZoom();
+ return mMediaEntry.getAutoZoom();
};
- } func_auto_zoom;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_auto_zoom(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_auto_zoom, value_bool );
base_key = std::string( LLMediaEntry::AUTO_ZOOM_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1223,37 +1385,44 @@ void LLFloaterTools::updateMediaSettings()
value_bool = default_media_data.getAutoPlay();
struct functor_getter_auto_play : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_auto_play(const LLMediaEntry& entry) : mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getAutoPlay();
- LLMediaEntry default_media_data;
- return default_media_data.getAutoPlay();
+ return mMediaEntry.getAutoPlay();
};
- } func_auto_play;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_auto_play(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_auto_play, value_bool );
base_key = std::string( LLMediaEntry::AUTO_PLAY_KEY );
mMediaSettings[ base_key ] = value_bool;
mMediaSettings[ base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX ) ] = ! identical;
+
// Auto scale
value_bool = default_media_data.getAutoScale();
struct functor_getter_auto_scale : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_auto_scale(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getAutoScale();
- LLMediaEntry default_media_data;
- return default_media_data.getAutoScale();;
+ return mMediaEntry.getAutoScale();;
};
- } func_auto_scale;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_auto_scale(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_auto_scale, value_bool );
base_key = std::string( LLMediaEntry::AUTO_SCALE_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1263,17 +1432,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = default_media_data.getAutoLoop();
struct functor_getter_auto_loop : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_auto_loop(const LLMediaEntry& entry) : mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getAutoLoop();
- LLMediaEntry default_media_data;
- return default_media_data.getAutoLoop();
+ return mMediaEntry.getAutoLoop();
};
- } func_auto_loop;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_auto_loop(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_auto_loop, value_bool );
base_key = std::string( LLMediaEntry::AUTO_LOOP_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1283,17 +1455,20 @@ void LLFloaterTools::updateMediaSettings()
value_int = default_media_data.getWidthPixels();
struct functor_getter_width_pixels : public LLSelectedTEGetFunctor< int >
{
+ functor_getter_width_pixels(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
int get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getWidthPixels();
- LLMediaEntry default_media_data;
- return default_media_data.getWidthPixels();
+ return mMediaEntry.getWidthPixels();
};
- } func_width_pixels;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_width_pixels(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_width_pixels, value_int );
base_key = std::string( LLMediaEntry::WIDTH_PIXELS_KEY );
mMediaSettings[ base_key ] = value_int;
@@ -1303,17 +1478,20 @@ void LLFloaterTools::updateMediaSettings()
value_int = default_media_data.getHeightPixels();
struct functor_getter_height_pixels : public LLSelectedTEGetFunctor< int >
{
- int get( LLViewerObject* object, S32 face )
+ functor_getter_height_pixels(const LLMediaEntry& entry) : mMediaEntry(entry) {}
+
+ int get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getHeightPixels();
- LLMediaEntry default_media_data;
- return default_media_data.getHeightPixels();
+ return mMediaEntry.getHeightPixels();
};
- } func_height_pixels;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_height_pixels(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_height_pixels, value_int );
base_key = std::string( LLMediaEntry::HEIGHT_PIXELS_KEY );
mMediaSettings[ base_key ] = value_int;
@@ -1323,17 +1501,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = default_media_data.getAltImageEnable();
struct functor_getter_enable_alt_image : public LLSelectedTEGetFunctor< bool >
{
- bool get( LLViewerObject* object, S32 face )
+ functor_getter_enable_alt_image(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
+ bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getAltImageEnable();
- LLMediaEntry default_media_data;
- return default_media_data.getAltImageEnable();
+ return mMediaEntry.getAltImageEnable();
};
- } func_enable_alt_image;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_enable_alt_image(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_enable_alt_image, value_bool );
base_key = std::string( LLMediaEntry::ALT_IMAGE_ENABLE_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1343,17 +1524,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = 0 != ( default_media_data.getPermsInteract() & LLMediaEntry::PERM_OWNER );
struct functor_getter_perms_owner_interact : public LLSelectedTEGetFunctor< bool >
{
- bool get( LLViewerObject* object, S32 face )
+ functor_getter_perms_owner_interact(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
+ bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return (0 != (object->getTE(face)->getMediaData()->getPermsInteract() & LLMediaEntry::PERM_OWNER));
- LLMediaEntry default_media_data;
- return 0 != ( default_media_data.getPermsInteract() & LLMediaEntry::PERM_OWNER );
+ return 0 != ( mMediaEntry.getPermsInteract() & LLMediaEntry::PERM_OWNER );
};
- } func_perms_owner_interact;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_perms_owner_interact(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_perms_owner_interact, value_bool );
base_key = std::string( LLPanelContents::PERMS_OWNER_INTERACT_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1363,17 +1547,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = 0 != ( default_media_data.getPermsControl() & LLMediaEntry::PERM_OWNER );
struct functor_getter_perms_owner_control : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_perms_owner_control(const LLMediaEntry& entry) : mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return (0 != (object->getTE(face)->getMediaData()->getPermsControl() & LLMediaEntry::PERM_OWNER));
- LLMediaEntry default_media_data;
- return 0 != ( default_media_data.getPermsControl() & LLMediaEntry::PERM_OWNER );
+ return 0 != ( mMediaEntry.getPermsControl() & LLMediaEntry::PERM_OWNER );
};
- } func_perms_owner_control;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_perms_owner_control(default_media_data);
identical = selected_objects ->getSelectedTEValue( &func_perms_owner_control, value_bool );
base_key = std::string( LLPanelContents::PERMS_OWNER_CONTROL_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1383,17 +1570,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = 0 != ( default_media_data.getPermsInteract() & LLMediaEntry::PERM_GROUP );
struct functor_getter_perms_group_interact : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_perms_group_interact(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return (0 != (object->getTE(face)->getMediaData()->getPermsInteract() & LLMediaEntry::PERM_GROUP));
- LLMediaEntry default_media_data;
- return 0 != ( default_media_data.getPermsInteract() & LLMediaEntry::PERM_GROUP );
+ return 0 != ( mMediaEntry.getPermsInteract() & LLMediaEntry::PERM_GROUP );
};
- } func_perms_group_interact;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_perms_group_interact(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_perms_group_interact, value_bool );
base_key = std::string( LLPanelContents::PERMS_GROUP_INTERACT_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1403,17 +1593,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = 0 != ( default_media_data.getPermsControl() & LLMediaEntry::PERM_GROUP );
struct functor_getter_perms_group_control : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_perms_group_control(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return (0 != (object->getTE(face)->getMediaData()->getPermsControl() & LLMediaEntry::PERM_GROUP));
- LLMediaEntry default_media_data;
- return 0 != ( default_media_data.getPermsControl() & LLMediaEntry::PERM_GROUP );
+ return 0 != ( mMediaEntry.getPermsControl() & LLMediaEntry::PERM_GROUP );
};
- } func_perms_group_control;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_perms_group_control(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_perms_group_control, value_bool );
base_key = std::string( LLPanelContents::PERMS_GROUP_CONTROL_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1423,17 +1616,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = 0 != ( default_media_data.getPermsInteract() & LLMediaEntry::PERM_ANYONE );
struct functor_getter_perms_anyone_interact : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_perms_anyone_interact(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return (0 != (object->getTE(face)->getMediaData()->getPermsInteract() & LLMediaEntry::PERM_ANYONE));
- LLMediaEntry default_media_data;
- return 0 != ( default_media_data.getPermsInteract() & LLMediaEntry::PERM_ANYONE );
+ return 0 != ( mMediaEntry.getPermsInteract() & LLMediaEntry::PERM_ANYONE );
};
- } func_perms_anyone_interact;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_perms_anyone_interact(default_media_data);
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func_perms_anyone_interact, value_bool );
base_key = std::string( LLPanelContents::PERMS_ANYONE_INTERACT_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1443,17 +1639,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = 0 != ( default_media_data.getPermsControl() & LLMediaEntry::PERM_ANYONE );
struct functor_getter_perms_anyone_control : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_perms_anyone_control(const LLMediaEntry& entry) : mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return (0 != (object->getTE(face)->getMediaData()->getPermsControl() & LLMediaEntry::PERM_ANYONE));
- LLMediaEntry default_media_data;
- return 0 != ( default_media_data.getPermsControl() & LLMediaEntry::PERM_ANYONE );
+ return 0 != ( mMediaEntry.getPermsControl() & LLMediaEntry::PERM_ANYONE );
};
- } func_perms_anyone_control;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_perms_anyone_control(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_perms_anyone_control, value_bool );
base_key = std::string( LLPanelContents::PERMS_ANYONE_CONTROL_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1463,17 +1662,20 @@ void LLFloaterTools::updateMediaSettings()
value_bool = default_media_data.getWhiteListEnable();
struct functor_getter_whitelist_enable : public LLSelectedTEGetFunctor< bool >
{
+ functor_getter_whitelist_enable(const LLMediaEntry& entry) : mMediaEntry(entry) {}
+
bool get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getWhiteListEnable();
- LLMediaEntry default_media_data;
- return default_media_data.getWhiteListEnable();
+ return mMediaEntry.getWhiteListEnable();
};
- } func_whitelist_enable;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_whitelist_enable(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_whitelist_enable, value_bool );
base_key = std::string( LLMediaEntry::WHITELIST_ENABLE_KEY );
mMediaSettings[ base_key ] = value_bool;
@@ -1483,17 +1685,20 @@ void LLFloaterTools::updateMediaSettings()
std::vector<std::string> value_vector_str = default_media_data.getWhiteList();
struct functor_getter_whitelist_urls : public LLSelectedTEGetFunctor< std::vector<std::string> >
{
+ functor_getter_whitelist_urls(const LLMediaEntry& entry): mMediaEntry(entry) {}
+
std::vector<std::string> get( LLViewerObject* object, S32 face )
{
if ( object )
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getWhiteList();
- LLMediaEntry default_media_data;
- return default_media_data.getWhiteList();
+ return mMediaEntry.getWhiteList();
};
- } func_whitelist_urls;
+ const LLMediaEntry & mMediaEntry;
+
+ } func_whitelist_urls(default_media_data);
identical = selected_objects->getSelectedTEValue( &func_whitelist_urls, value_vector_str );
base_key = std::string( LLMediaEntry::WHITELIST_KEY );
mMediaSettings[ base_key ].clear();
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 008c9677ed..e5d1174044 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -105,7 +105,8 @@ public:
void onClickBtnDeleteMedia();
void onClickBtnAddMedia();
void onClickBtnEditMedia();
-
+ void clearMediaSettings();
+ bool selectedMediaEditable();
private:
void onClose();
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index c61b987b1c..ee0426c7df 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -786,8 +786,8 @@ void LLPanelFace::getState()
childSetEnabled("button align",FALSE);
childSetEnabled("button apply",FALSE);
- childSetEnabled("has media", FALSE);
- childSetEnabled("media info set", FALSE);
+ //childSetEnabled("has media", FALSE);
+ //childSetEnabled("media info set", FALSE);
}
}
diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp
index be40d6fb5f..1ae6b23b2d 100644
--- a/indra/newview/llpanelmediasettingsgeneral.cpp
+++ b/indra/newview/llpanelmediasettingsgeneral.cpp
@@ -49,6 +49,8 @@
#include "llpanelcontents.h"
#include "llpluginclassmedia.h"
#include "llfloatermediasettings.h"
+#include "llfloatertools.h"
+#include "lltrans.h"
////////////////////////////////////////////////////////////////////////////////
//
@@ -155,43 +157,11 @@ void LLPanelMediaSettingsGeneral::draw()
};
// current URL can change over time.
- updateCurrentURL();
+// updateCurrentURL();
// enable/disable RESRET button depending on permissions
// since this is the same as a navigate action
- U32 owner_mask_on;
- U32 owner_mask_off;
- U32 valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm( PERM_OWNER,
- &owner_mask_on, &owner_mask_off );
- U32 group_mask_on;
- U32 group_mask_off;
- U32 valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm( PERM_GROUP,
- &group_mask_on, &group_mask_off );
- U32 everyone_mask_on;
- U32 everyone_mask_off;
- S32 valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm( PERM_EVERYONE,
- &everyone_mask_on, &everyone_mask_off );
-
- bool user_can_press_reset = false;
-
- // if perms we got back are valid
- if ( valid_owner_perms &&
- valid_group_perms &&
- valid_everyone_perms )
- {
- // if user is allowed to press the RESET button
- if ( ( owner_mask_on & PERM_MODIFY ) ||
- ( group_mask_on & PERM_MODIFY ) ||
- ( group_mask_on & PERM_MODIFY ) )
- {
- user_can_press_reset = true;
- }
- else
- // user is NOT allowed to press the RESET button
- {
- user_can_press_reset = false;
- };
- };
+ bool user_can_press_reset = gFloaterTools->selectedMediaEditable();
// several places modify this widget so we must collect states in one place
if ( reset_button_is_active )
@@ -216,7 +186,7 @@ void LLPanelMediaSettingsGeneral::draw()
////////////////////////////////////////////////////////////////////////////////
// static
-void LLPanelMediaSettingsGeneral::clearValues( void* userdata )
+void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
self->mAltImageEnable ->clear();
@@ -230,12 +200,23 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata )
self->mHeightPixels->clear();
self->mHomeURL->clear();
self->mWidthPixels->clear();
+ self->mAltImageEnable ->setEnabled(editable);
+ self->mAutoLoop ->setEnabled(editable);
+ self->mAutoPlay ->setEnabled(editable);
+ self->mAutoScale ->setEnabled(editable);
+ self->mAutoZoom ->setEnabled(editable);
+ self->mControls ->setEnabled(editable);
+ self->mCurrentURL ->setEnabled(editable);
+ self->mFirstClick ->setEnabled(editable);
+ self->mHeightPixels ->setEnabled(editable);
+ self->mHomeURL ->setEnabled(editable);
+ self->mWidthPixels ->setEnabled(editable);
self->mPreviewMedia->unloadMediaSource();
}
////////////////////////////////////////////////////////////////////////////////
// static
-void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_settings )
+void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_settings ,bool editable)
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
@@ -243,6 +224,29 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_
//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, editable);
+ // only show multiple
+ self->mHomeURL ->setText(LLTrans::getString("Multiple Media"));
+ return;
+ }
+
+ }
+ else
+ {
+ if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
+ {
+ self->clearValues(self, editable);
+ // only show multiple
+ self->mHomeURL ->setText(LLTrans::getString("Multiple Media"));
+ return;
+ }
+
+ }
std::string base_key( "" );
std::string tentative_key( "" );
@@ -293,10 +297,11 @@ void LLPanelMediaSettingsGeneral::initValues( void* userdata, const LLSD& media_
static_cast< LLSpinCtrl* >( data_set[ i ].ctrl_ptr )->
setValue( media_settings[ base_key ].asInteger() );
+ data_set[ i ].ctrl_ptr->setEnabled(editable);
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
};
};
-
+
// interrogates controls and updates widgets as required
self->updateMediaPreview();
self->updateCurrentURL();
@@ -322,25 +327,11 @@ void LLPanelMediaSettingsGeneral::updateMediaPreview()
// Helper to set current URL
void LLPanelMediaSettingsGeneral::updateCurrentURL()
{
- if( mPreviewMedia )
+ if( mCurrentURL->getText().empty() )
{
- LLPluginClassMedia* media_plugin = mPreviewMedia->getMediaPlugin();
- if( media_plugin )
- {
- // get current URL from plugin and display
- std::string current_location = media_plugin->getLocation();
- if ( current_location.length() )
- {
- childSetText( "current_url", current_location );
- }
- else
- // current location may be empty so we need to clear it
- {
- const std::string empty_string( "" );
- childSetText( "current_url", empty_string );
- };
- };
- };
+ childSetText( "current_url", mHomeURL->getText() );
+ }
+
}
////////////////////////////////////////////////////////////////////////////////
@@ -374,7 +365,7 @@ void LLPanelMediaSettingsGeneral::onBtnResetCurrentUrl()
void LLPanelMediaSettingsGeneral::apply( void* userdata )
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
-
+ self->mHomeURL->onCommit();
// build LLSD Fragment
LLSD media_data_general;
self->getValues(media_data_general);
diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h
index 24678a3a07..527a6f5e3a 100644
--- a/indra/newview/llpanelmediasettingsgeneral.h
+++ b/indra/newview/llpanelmediasettingsgeneral.h
@@ -56,8 +56,8 @@ public:
~LLPanelMediaSettingsGeneral();
void setParent( LLFloaterMediaSettings* parent );
- static void initValues( void* userdata, const LLSD& media_settings );
- static void clearValues( void* userdata );
+ static void initValues( void* userdata, const LLSD& media_settings ,bool editable);
+ static void clearValues( void* userdata, bool editable);
void updateMediaPreview();
void updateCurrentURL();
@@ -74,7 +74,7 @@ private:
LLComboBox* mControls;
LLCheckBoxCtrl* mAutoLoop;
LLCheckBoxCtrl* mFirstClick;
- LLTextureCtrl* mMediaPreview;
+// LLTextureCtrl* mMediaPreview;
LLCheckBoxCtrl* mAutoZoom;
LLCheckBoxCtrl* mAutoPlay;
LLCheckBoxCtrl* mAutoScale;
diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp
index d6a2677f4b..4d84874e7a 100644
--- a/indra/newview/llpanelmediasettingspermissions.cpp
+++ b/indra/newview/llpanelmediasettingspermissions.cpp
@@ -49,7 +49,8 @@
#include "llselectmgr.h"
#include "llmediaentry.h"
#include "llnamebox.h"
-
+#include "lltrans.h"
+#include "llfloatermediasettings.h"
////////////////////////////////////////////////////////////////////////////////
//
LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() :
@@ -119,7 +120,7 @@ void LLPanelMediaSettingsPermissions::draw()
////////////////////////////////////////////////////////////////////////////////
// static
-void LLPanelMediaSettingsPermissions::clearValues( void* userdata )
+void LLPanelMediaSettingsPermissions::clearValues( void* userdata, bool editable)
{
LLPanelMediaSettingsPermissions *self =(LLPanelMediaSettingsPermissions *)userdata;
self->mPermsOwnerInteract->clear();
@@ -128,16 +129,41 @@ void LLPanelMediaSettingsPermissions::clearValues( void* userdata )
self->mPermsGroupControl->clear();
self->mPermsWorldInteract ->clear();
self->mPermsWorldControl ->clear();
-// mPermsGroupName ->setValue(0);
-
+
+ self->mPermsOwnerInteract->setEnabled(editable);
+ self->mPermsOwnerControl ->setEnabled(editable);
+ self->mPermsGroupInteract->setEnabled(editable);
+ self->mPermsGroupControl ->setEnabled(editable);
+ self->mPermsWorldInteract->setEnabled(editable);
+ self->mPermsWorldControl ->setEnabled(editable);
}
////////////////////////////////////////////////////////////////////////////////
// static
-void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& media_settings )
+void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& media_settings , bool editable)
{
LLPanelMediaSettingsPermissions *self =(LLPanelMediaSettingsPermissions *)userdata;
+ if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo )
+ {
+ if(LLFloaterMediaSettings::getInstance()->mMultipleMedia)
+ {
+ self->clearValues(self, editable);
+ // only show multiple
+ return;
+ }
+
+ }
+ else
+ {
+ if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
+ {
+ self->clearValues(self, editable);
+ // only show multiple
+ return;
+ }
+
+ }
std::string base_key( "" );
std::string tentative_key( "" );
@@ -178,10 +204,17 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me
if ( data_set[ i ].ctrl_type == "LLComboBox" )
static_cast< LLComboBox* >( data_set[ i ].ctrl_ptr )->
setCurrentByIndex( media_settings[ base_key ].asInteger() );
-
+ data_set[ i ].ctrl_ptr->setEnabled(editable);
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
};
};
+ self->childSetEnabled("media_perms_label_owner", editable );
+ self->childSetText("media_perms_label_owner", LLTrans::getString("Media Perms Owner") );
+ self->childSetEnabled("media_perms_label_group", editable );
+ self->childSetText("media_perms_label_group", LLTrans::getString("Media Perms Group") );
+ self->childSetEnabled("media_perms_label_anyone", editable );
+ self->childSetText("media_perms_label_anyone", LLTrans::getString("Media Perms Anyone") );
+
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelmediasettingspermissions.h b/indra/newview/llpanelmediasettingspermissions.h
index ce293e07b9..ecc50e3582 100644
--- a/indra/newview/llpanelmediasettingspermissions.h
+++ b/indra/newview/llpanelmediasettingspermissions.h
@@ -55,8 +55,8 @@ class LLPanelMediaSettingsPermissions : public LLPanel
LLPanelMediaSettingsPermissions();
~LLPanelMediaSettingsPermissions();
- static void initValues( void* userdata, const LLSD& media_settings );
- static void clearValues( void* userdata );
+ static void initValues( void* userdata, const LLSD& media_settings, bool editable );
+ static void clearValues( void* userdata, bool editable);
private:
LLCheckBoxCtrl* mPermsOwnerInteract;
diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp
index a4eee82aa9..cea105d7de 100644
--- a/indra/newview/llpanelmediasettingssecurity.cpp
+++ b/indra/newview/llpanelmediasettingssecurity.cpp
@@ -44,7 +44,7 @@
#include "llselectmgr.h"
#include "llmediaentry.h"
#include "llfloaterwhitelistentry.h"
-
+#include "llfloatermediasettings.h"
////////////////////////////////////////////////////////////////////////////////
//
LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity()
@@ -110,10 +110,30 @@ void LLPanelMediaSettingsSecurity::draw()
////////////////////////////////////////////////////////////////////////////////
// static
-void LLPanelMediaSettingsSecurity::initValues( void* userdata, const LLSD& media_settings )
+void LLPanelMediaSettingsSecurity::initValues( void* userdata, const LLSD& media_settings , bool editable)
{
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
+ if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo )
+ {
+ if(LLFloaterMediaSettings::getInstance()->mMultipleMedia)
+ {
+ self->clearValues(self, editable);
+ // only show multiple
+ return;
+ }
+
+ }
+ else
+ {
+ if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
+ {
+ self->clearValues(self, editable);
+ // only show multiple
+ return;
+ }
+
+ }
std::string base_key( "" );
std::string tentative_key( "" );
@@ -163,7 +183,7 @@ void LLPanelMediaSettingsSecurity::initValues( void* userdata, const LLSD& media
++iter;
};
};
-
+ data_set[ i ].ctrl_ptr->setEnabled(editable);
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
};
};
@@ -171,11 +191,13 @@ void LLPanelMediaSettingsSecurity::initValues( void* userdata, const LLSD& media
////////////////////////////////////////////////////////////////////////////////
// static
-void LLPanelMediaSettingsSecurity::clearValues( void* userdata )
+void LLPanelMediaSettingsSecurity::clearValues( void* userdata , bool editable)
{
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
self->mEnableWhiteList->clear();
self->mWhiteListList->deleteAllItems();
+ self->mEnableWhiteList->setEnabled(editable);
+ self->mWhiteListList->setEnabled(editable);
}
////////////////////////////////////////////////////////////////////////////////
// static
diff --git a/indra/newview/llpanelmediasettingssecurity.h b/indra/newview/llpanelmediasettingssecurity.h
index d77509897d..b7cf67c039 100644
--- a/indra/newview/llpanelmediasettingssecurity.h
+++ b/indra/newview/llpanelmediasettingssecurity.h
@@ -49,8 +49,8 @@ class LLPanelMediaSettingsSecurity : public LLPanel
LLPanelMediaSettingsSecurity();
~LLPanelMediaSettingsSecurity();
- static void initValues( void* userdata, const LLSD& media_settings );
- static void clearValues( void* userdata );
+ static void initValues( void* userdata, const LLSD& media_settings,bool editable );
+ static void clearValues( void* userdata, bool editable);
void addWhiteListItem(const std::string& url);
private:
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index c60d37a999..296502ff16 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -279,7 +279,8 @@ public:
// iterate through texture entries
template <typename T> bool getSelectedTEValue(LLSelectedTEGetFunctor<T>* func, T& res);
-
+ template <typename T> bool isMultipleTEValue(LLSelectedTEGetFunctor<T>* func, const T& ignore_value);
+
void addNode(LLSelectNode *nodep);
void addNodeAtEnd(LLSelectNode *nodep);
void moveNodeToFront(LLSelectNode *nodep);
@@ -785,5 +786,52 @@ template <typename T> bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGet
return identical;
}
+// Templates
+//-----------------------------------------------------------------------------
+// isMultipleTEValue iterate through all TEs and test for uniqueness
+// with certain return value ignored when performing the test.
+// e.g. when testing if the selection has a unique non-empty homeurl :
+// you can set ignore_value = "" and it will only compare among the non-empty
+// homeUrls and ignore the empty ones.
+//-----------------------------------------------------------------------------
+template <typename T> bool LLObjectSelection::isMultipleTEValue(LLSelectedTEGetFunctor<T>* func, const T& ignore_value)
+{
+ bool have_first = false;
+ T selected_value = T();
+
+ // Now iterate through all TEs to test for sameness
+ bool unique = TRUE;
+ for (iterator iter = begin(); iter != end(); iter++)
+ {
+ LLSelectNode* node = *iter;
+ LLViewerObject* object = node->getObject();
+ for (S32 te = 0; te < object->getNumTEs(); ++te)
+ {
+ if (!node->isTESelected(te))
+ {
+ continue;
+ }
+ T value = func->get(object, te);
+ if(value == ignore_value)
+ {
+ continue;
+ }
+ if (!have_first)
+ {
+ have_first = true;
+ }
+ else
+ {
+ if (value !=selected_value )
+ {
+ unique = false;
+ return !unique;
+ }
+ }
+ }
+ }
+ return !unique;
+}
+
#endif
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 053215f8ae..c65206d629 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -2688,7 +2688,7 @@
height="18"
layout="topleft"
left="20"
- max_length="63"
+ read_only="true"
name="media_info"
select_on_focus="true"
top_delta="12"
diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
index 1e7ca7aa3f..cb7a473c9a 100644
--- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml
@@ -64,7 +64,7 @@
<web_browser
border_visible="false"
- bottom_delta="-120"
+ bottom_delta="-133"
follows="top|left"
left="120"
name="preview_media"
@@ -83,7 +83,7 @@
</text>
<text
- bottom_delta="-20"
+ bottom_delta="-5"
follows="top|left"
height="15"
left="10"
@@ -161,32 +161,85 @@
radio_style="false"
width="150" />
- <check_box bottom_delta="-25" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Use Default Alternative Image" left="10" mouse_opaque="true"
- name="alt_image_enable" radio_style="false" width="150" />
+ <check_box
+ bottom_delta="-25"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Use Default Alternative Image"
+ left="10"
+ mouse_opaque="true"
+ name="alt_image_enable"
+ radio_style="false"
+ width="150" />
- <check_box bottom_delta="-25" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Auto Play Media" left="10" mouse_opaque="true"
- name="auto_play" radio_style="false" width="150" />
- <text bottom_delta="-14" follows="top|left" height="15" left="30" width="340"
- enabled="false" name="">
+ <check_box
+ bottom_delta="-25"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Auto Play Media"
+ left="10"
+ mouse_opaque="true"
+ name="auto_play"
+ radio_style="false"
+ width="150" />
+
+ <text
+ bottom_delta="-14"
+ follows="top|left"
+ height="15"
+ left="30"
+ width="340"
+ enabled="false"
+ name="meida_setting_note">
Note: Residents can override this setting
</text>
- <check_box bottom_delta="-25" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Auto Scale Media on Face of Object" left="10" mouse_opaque="true"
- name="auto_scale" radio_style="false" width="150" />
- <text bottom_delta="-20" follows="top|left" height="15" left="30" name="">
+ <check_box
+ bottom_delta="-25"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Auto Scale Media on Face of Object"
+ left="10"
+ mouse_opaque="true"
+ name="auto_scale"
+ radio_style="false"
+ width="150" />
+
+ <text
+ bottom_delta="-20"
+ follows="top|left"
+ height="15"
+ left="30"
+ name="">
Size:
</text>
- <spinner bottom_delta="0"
- decimal_digits="0" enabled="true" follows="left|top" height="16"
- increment="1" initial_val="256" label="" label_width="0"
- left_delta="40" max_val="2000" min_val="0" mouse_opaque="true"
- name="width_pixels" width="50" />
+
+ <spinner
+ bottom_delta="0"
+ decimal_digits="0"
+ enabled="true"
+ follows="left|top"
+ height="16"
+ increment="1"
+ initial_val="256"
+ label=""
+ label_width="0"
+ left_delta="40"
+ max_val="2000"
+ min_val="0"
+ mouse_opaque="true"
+ name="width_pixels"
+ width="50" />
+
<text bottom_delta="0" follows="top|left" height="15" left_delta="60" name="">
X
</text>
diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml b/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml
index f11364874a..0cc1406d62 100644
--- a/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml
+++ b/indra/newview/skins/default/xui/en/panel_media_settings_permissions.xml
@@ -1,49 +1,137 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel border="true" enabled="true" follows="left|top|right|bottom"
- height="500" label="Controls" left="102" mouse_opaque="true"
- name="Media settings for controls" width="365">
+<panel
+ border="true"
+ enabled="true"
+ follows="left|top|right|bottom"
+ height="500"
+ label="Controls"
+ left="102"
+ mouse_opaque="true"
+ name="Media settings for controls"
+ width="365">
- <text bottom_delta="-50" follows="top|left" height="15" left="10" name="" enabled="false">
+ <text
+ bottom_delta="-50"
+ follows="top|left"
+ height="15"
+ left="10"
+ name="media_perms_label_owner"
+ enabled="false">
Owner
</text>
- <check_box bottom_delta="-22" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Disable Navigation &amp; Interactivity" left="30" mouse_opaque="true"
- name="perms_owner_interact" radio_style="false" width="250" />
+
+ <check_box
+ bottom_delta="-22"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Disable Navigation &amp; Interactivity"
+ left="30"
+ mouse_opaque="true"
+ name="perms_owner_interact"
+ radio_style="false"
+ width="250" />
- <check_box bottom_delta="-22" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Hide Control Bar" left="30" mouse_opaque="true"
- name="perms_owner_control" radio_style="false" width="250" />
+ <check_box
+ bottom_delta="-22"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Hide Control Bar"
+ left="30"
+ mouse_opaque="true"
+ name="perms_owner_control"
+ radio_style="false"
+ width="250" />
- <text bottom_delta="-36" follows="top|left" height="15" left="10" name="perms_group_name_label" enabled="false">
+ <text
+ bottom_delta="-36"
+ follows="top|left"
+ height="15"
+ left="10"
+ name="media_perms_label_group"
+ enabled="false">
Group
</text>
- <name_box bottom_delta="-5" enabled="false" follows="left|top" font="SansSerif"
- height="20" left="60" name="perms_group_name"
- value =""
- width="200" />
- <check_box bottom_delta="-22" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Disable Navigation &amp; Interactivity" left="30" mouse_opaque="true"
- name="perms_group_interact" radio_style="false" width="250" />
+
+ <name_box
+ bottom_delta="-5"
+ enabled="false"
+ follows="left|top"
+ font="SansSerif"
+ height="20" left="60"
+ name="perms_group_name"
+ value =""
+ width="200" />
+
+ <check_box
+ bottom_delta="-22"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Disable Navigation &amp; Interactivity"
+ left="30"
+ mouse_opaque="true"
+ name="perms_group_interact"
+ radio_style="false"
+ width="250" />
- <check_box bottom_delta="-22" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Hide Control Bar" left="30" mouse_opaque="true"
- name="perms_group_control" radio_style="false" width="250" />
+ <check_box
+ bottom_delta="-22"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Hide Control Bar"
+ left="30"
+ mouse_opaque="true"
+ name="perms_group_control"
+ radio_style="false"
+ width="250" />
- <text bottom_delta="-36" follows="top|left" height="15" left="10" name="" enabled="false">
+ <text
+ bottom_delta="-36"
+ follows="top|left"
+ height="15"
+ left="10"
+ name="media_perms_label_anyone"
+ enabled="false">
Anyone
</text>
- <check_box bottom_delta="-22" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Disable Navigation &amp; Interactivity" left="30" mouse_opaque="true"
- name="perms_anyone_interact" radio_style="false" width="250" />
+
+ <check_box
+ bottom_delta="-22"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Disable Navigation &amp; Interactivity"
+ left="30"
+ mouse_opaque="true"
+ name="perms_anyone_interact"
+ radio_style="false"
+ width="250" />
- <check_box bottom_delta="-22" enabled="true" follows="left|top" font="SansSerifSmall"
- height="16" initial_value="false"
- label="Hide Control Bar" left="30" mouse_opaque="true"
- name="perms_anyone_control" radio_style="false" width="250" />
+ <check_box
+ bottom_delta="-22"
+ enabled="true"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="16"
+ initial_value="false"
+ label="Hide Control Bar"
+ left="30"
+ mouse_opaque="true"
+ name="perms_anyone_control"
+ radio_style="false"
+ width="250" />
</panel>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index cfe339d9b3..134d430e35 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2184,6 +2184,9 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh
<string name="'">'</string>
<string name="---">---</string>
+ <!-- media -->
+ <string name="Multiple Media">Multiple Media</string>
+
<!-- OSMessageBox messages -->
<string name="MBCmdLineError">
An error was found parsing the command line.