Merge from remote repo
commit
9a7f79cbcf
|
|
@ -36,7 +36,7 @@
|
|||
const S32 LL_VERSION_MAJOR = 1;
|
||||
const S32 LL_VERSION_MINOR = 31;
|
||||
const S32 LL_VERSION_PATCH = 0;
|
||||
const S32 LL_VERSION_BUILD = 2822;
|
||||
const S32 LL_VERSION_BUILD = 3256;
|
||||
|
||||
const char * const LL_CHANNEL = "Second Life Server";
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
const S32 LL_VERSION_MAJOR = 2;
|
||||
const S32 LL_VERSION_MINOR = 0;
|
||||
const S32 LL_VERSION_PATCH = 0;
|
||||
const S32 LL_VERSION_BUILD = 0;
|
||||
const S32 LL_VERSION_BUILD = 3256;
|
||||
|
||||
const char * const LL_CHANNEL = "Second Life Developer";
|
||||
|
||||
|
|
|
|||
|
|
@ -835,6 +835,11 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
|||
mCanPaste = message.getValueBoolean("paste");
|
||||
}
|
||||
}
|
||||
else if(message_name == "name_text")
|
||||
{
|
||||
mMediaName = message.getValue("name");
|
||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAME_CHANGED);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public:
|
|||
MEDIA_EVENT_NAVIGATE_COMPLETE, // browser has finished navigation
|
||||
MEDIA_EVENT_PROGRESS_UPDATED, // browser has updated loading progress
|
||||
MEDIA_EVENT_STATUS_TEXT_CHANGED, // browser has updated the status text
|
||||
MEDIA_EVENT_NAME_CHANGED, // browser has updated the name of the media (typically <title> tag)
|
||||
MEDIA_EVENT_LOCATION_CHANGED, // browser location (URL) has changed (maybe due to internal navagation/frames/etc)
|
||||
MEDIA_EVENT_CLICK_LINK_HREF, // I'm not entirely sure what the semantics of these two are
|
||||
MEDIA_EVENT_CLICK_LINK_NOFOLLOW,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -183,7 +183,7 @@ private:
|
|||
|
||||
#if LL_WINDOWS
|
||||
// Enable plugins
|
||||
LLQtWebKit::getInstance()->enablePlugins(false);
|
||||
LLQtWebKit::getInstance()->enablePlugins(true);
|
||||
#elif LL_DARWIN
|
||||
// Disable plugins
|
||||
LLQtWebKit::getInstance()->enablePlugins(false);
|
||||
|
|
@ -308,7 +308,16 @@ private:
|
|||
message.setValue("status", event.getStringValue());
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// virtual
|
||||
void onTitleChange(const EventType& event)
|
||||
{
|
||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text");
|
||||
message.setValue("name", event.getStringValue());
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// virtual
|
||||
void onLocationChange(const EventType& event)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
CFBundleName = "Second Life";
|
||||
|
||||
CFBundleShortVersionString = "Second Life version 2.0.0.2822";
|
||||
CFBundleGetInfoString = "Second Life version 2.0.0.2822, Copyright 2004-2009 Linden Research, Inc.";
|
||||
CFBundleShortVersionString = "Second Life version 2.0.0.3256";
|
||||
CFBundleGetInfoString = "Second Life version 2.0.0.3256, Copyright 2004-2009 Linden Research, Inc.";
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.0.0.2822</string>
|
||||
<string>2.0.0.3256</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ BOOL LLFloaterMediaSettings::postBuild()
|
|||
mTabContainer->addTabPanel(
|
||||
LLTabContainer::TabPanelParams().
|
||||
panel(mPanelMediaSettingsSecurity));
|
||||
mPanelMediaSettingsSecurity->setParent( this );
|
||||
|
||||
// restore the last tab viewed from persistance variable storage
|
||||
if (!mTabContainer->selectTab(gSavedSettings.getS32("LastMediaSettingsTab")))
|
||||
|
|
@ -248,3 +249,28 @@ void LLFloaterMediaSettings::enableOkApplyBtns( bool enable )
|
|||
childSetEnabled( "OK", enable );
|
||||
childSetEnabled( "Apply", enable );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
const std::string LLFloaterMediaSettings::getHomeUrl()
|
||||
{
|
||||
if ( mPanelMediaSettingsGeneral )
|
||||
return mPanelMediaSettingsGeneral->getHomeUrl();
|
||||
else
|
||||
return std::string( "" );
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
bool LLFloaterMediaSettings::passesWhiteList( const std::string& test_url )
|
||||
{
|
||||
// sanity check - don't think this can happen
|
||||
if ( mPanelMediaSettingsSecurity )
|
||||
// version in security dialog code is specialized so we pass in
|
||||
// empty string for first parameter since it's not used
|
||||
return mPanelMediaSettingsSecurity->passesWhiteList( "", test_url );
|
||||
else
|
||||
// this is all we can do
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ public:
|
|||
static void clearValues( bool editable);
|
||||
void enableOkApplyBtns( bool enable );
|
||||
LLPanelMediaSettingsSecurity* getPanelSecurity(){return mPanelMediaSettingsSecurity;};
|
||||
const std::string getHomeUrl();
|
||||
bool passesWhiteList( const std::string& test_url );
|
||||
|
||||
bool mIdenticalHasMediaInfo;
|
||||
bool mMultipleMedia;
|
||||
|
|
|
|||
|
|
@ -1114,8 +1114,8 @@ void LLFloaterTools::getMediaState()
|
|||
// Media data is valid
|
||||
if(media_data_get!=default_media_data)
|
||||
{
|
||||
//TODO: get Meida title
|
||||
//media_title = media_data_get->getTile();
|
||||
//TODO: get media title
|
||||
//media_title = media_data_get->getTitle();
|
||||
//LLFloaterMediaSettings::getInstance()->mIdenticalValidMedia = true;
|
||||
media_title = media_data_get.getHomeURL();
|
||||
}
|
||||
|
|
@ -1149,8 +1149,8 @@ void LLFloaterTools::getMediaState()
|
|||
// Media data is valid
|
||||
if(media_data_get!=default_media_data)
|
||||
{
|
||||
//TODO: get Meida title
|
||||
//media_title = media_data_get->getTile();
|
||||
//TODO: get media title
|
||||
//media_title = media_data_get->getTitle();
|
||||
media_title = media_data_get.getHomeURL();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llpanelmediasettingsgeneral.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
|
|
@ -47,6 +48,7 @@
|
|||
#include "llmediaentry.h"
|
||||
#include "llmediactrl.h"
|
||||
#include "llpanelcontents.h"
|
||||
#include "llpermissions.h"
|
||||
#include "llpluginclassmedia.h"
|
||||
#include "llfloatermediasettings.h"
|
||||
#include "llfloatertools.h"
|
||||
|
|
@ -159,8 +161,7 @@ void LLPanelMediaSettingsGeneral::draw()
|
|||
// current URL can change over time.
|
||||
// updateCurrentURL();
|
||||
|
||||
// enable/disable RESRET button depending on permissions
|
||||
// since this is the same as a navigate action
|
||||
LLPermissions perm;
|
||||
bool user_can_press_reset = gFloaterTools->selectedMediaEditable();
|
||||
|
||||
// several places modify this widget so we must collect states in one place
|
||||
|
|
@ -350,6 +351,16 @@ void LLPanelMediaSettingsGeneral::onClose(bool app_quitting)
|
|||
void LLPanelMediaSettingsGeneral::onCommitHomeURL( LLUICtrl* ctrl, void *userdata )
|
||||
{
|
||||
LLPanelMediaSettingsGeneral* self =(LLPanelMediaSettingsGeneral *)userdata;
|
||||
|
||||
// check url user is trying to enter for home URL will pass whitelist
|
||||
// and decline to accept it if it doesn't.
|
||||
std::string home_url = self->mHomeURL->getValue().asString();
|
||||
if ( ! self->mParent->passesWhiteList( home_url ) )
|
||||
{
|
||||
LLNotifications::instance().add("WhiteListInvalidatesHomeUrl");
|
||||
return;
|
||||
};
|
||||
|
||||
self->updateMediaPreview();
|
||||
}
|
||||
|
||||
|
|
@ -398,3 +409,10 @@ void LLPanelMediaSettingsGeneral::setParent( LLFloaterMediaSettings* parent )
|
|||
{
|
||||
mParent = parent;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
const std::string LLPanelMediaSettingsGeneral::getHomeUrl()
|
||||
{
|
||||
return mHomeURL->getValue().asString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ public:
|
|||
|
||||
void updateMediaPreview();
|
||||
void updateCurrentURL();
|
||||
|
||||
const std::string getHomeUrl();
|
||||
|
||||
protected:
|
||||
LLFloaterMediaSettings* mParent;
|
||||
|
|
@ -74,7 +76,6 @@ private:
|
|||
LLComboBox* mControls;
|
||||
LLCheckBoxCtrl* mAutoLoop;
|
||||
LLCheckBoxCtrl* mFirstClick;
|
||||
// LLTextureCtrl* mMediaPreview;
|
||||
LLCheckBoxCtrl* mAutoZoom;
|
||||
LLCheckBoxCtrl* mAutoPlay;
|
||||
LLCheckBoxCtrl* mAutoScale;
|
||||
|
|
|
|||
|
|
@ -1,255 +1,343 @@
|
|||
/**
|
||||
* @file llpanelmediasettingssecurity.cpp
|
||||
* @brief LLPanelMediaSettingsSecurity class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
/**
|
||||
* @file llpanelmediasettingssecurity.cpp
|
||||
* @brief LLPanelMediaSettingsSecurity class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llpanelmediasettingssecurity.h"
|
||||
#include "llpanelcontents.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "llscrolllistitem.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llwindow.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llsdutil.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llmediaentry.h"
|
||||
#include "llfloaterwhitelistentry.h"
|
||||
#include "llfloatermediasettings.h"
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() :
|
||||
mParent( NULL )
|
||||
{
|
||||
// build dialog from XML
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_security.xml");
|
||||
mCommitCallbackRegistrar.add("Media.whitelistAdd", boost::bind(&LLPanelMediaSettingsSecurity::onBtnAdd, this));
|
||||
mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
BOOL LLPanelMediaSettingsSecurity::postBuild()
|
||||
{
|
||||
mEnableWhiteList = getChild< LLCheckBoxCtrl >( LLMediaEntry::WHITELIST_ENABLE_KEY );
|
||||
mWhiteListList = getChild< LLScrollListCtrl >( LLMediaEntry::WHITELIST_KEY );
|
||||
|
||||
childSetAction("whitelist_add", onBtnAdd, this);
|
||||
childSetAction("whitelist_del", onBtnDel, this);
|
||||
|
||||
setDefaultBtn("whitelist_add");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// virtual
|
||||
LLPanelMediaSettingsSecurity::~LLPanelMediaSettingsSecurity()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void LLPanelMediaSettingsSecurity::draw()
|
||||
{
|
||||
// housekeeping
|
||||
LLPanel::draw();
|
||||
|
||||
// if list is empty, disable DEL button and checkbox to enable use of list
|
||||
if ( mWhiteListList->isEmpty() )
|
||||
{
|
||||
childSetEnabled( "whitelist_del", false );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_KEY, false );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_ENABLE_KEY, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
childSetEnabled( "whitelist_del", true );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_KEY, true );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_ENABLE_KEY, true );
|
||||
};
|
||||
|
||||
// if nothing is selected, disable DEL button
|
||||
if ( mWhiteListList->getSelectedValue().asString().empty() )
|
||||
{
|
||||
childSetEnabled( "whitelist_del", false );
|
||||
}
|
||||
else
|
||||
{
|
||||
childSetEnabled( "whitelist_del", true );
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
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( "" );
|
||||
|
||||
struct
|
||||
{
|
||||
std::string key_name;
|
||||
LLUICtrl* ctrl_ptr;
|
||||
std::string ctrl_type;
|
||||
|
||||
} data_set [] =
|
||||
{
|
||||
{ LLMediaEntry::WHITELIST_ENABLE_KEY, self->mEnableWhiteList, "LLCheckBoxCtrl" },
|
||||
{ LLMediaEntry::WHITELIST_KEY, self->mWhiteListList, "LLScrollListCtrl" },
|
||||
{ "", NULL , "" }
|
||||
};
|
||||
|
||||
for( int i = 0; data_set[ i ].key_name.length() > 0; ++i )
|
||||
{
|
||||
base_key = std::string( data_set[ i ].key_name );
|
||||
tentative_key = base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX );
|
||||
|
||||
// TODO: CP - I bet there is a better way to do this using Boost
|
||||
if ( media_settings[ base_key ].isDefined() )
|
||||
{
|
||||
if ( data_set[ i ].ctrl_type == "LLCheckBoxCtrl" )
|
||||
{
|
||||
static_cast< LLCheckBoxCtrl* >( data_set[ i ].ctrl_ptr )->
|
||||
setValue( media_settings[ base_key ].asBoolean() );
|
||||
}
|
||||
else
|
||||
if ( data_set[ i ].ctrl_type == "LLScrollListCtrl" )
|
||||
{
|
||||
// get control
|
||||
LLScrollListCtrl* list = static_cast< LLScrollListCtrl* >( data_set[ i ].ctrl_ptr );
|
||||
list->deleteAllItems();
|
||||
|
||||
// points to list of white list URLs
|
||||
LLSD url_list = media_settings[ base_key ];
|
||||
|
||||
// iterate over them and add to scroll list
|
||||
LLSD::array_iterator iter = url_list.beginArray();
|
||||
while( iter != url_list.endArray() )
|
||||
{
|
||||
// TODO: is iter guaranteed to be valid here?
|
||||
std::string url = *iter;
|
||||
list->addSimpleElement( url );
|
||||
++iter;
|
||||
};
|
||||
};
|
||||
data_set[ i ].ctrl_ptr->setEnabled(editable);
|
||||
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
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
|
||||
void LLPanelMediaSettingsSecurity::apply( void* userdata )
|
||||
{
|
||||
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
|
||||
|
||||
// build LLSD Fragment
|
||||
LLSD media_data_security;
|
||||
self->getValues(media_data_security);
|
||||
// this merges contents of LLSD passed in with what's there so this is ok
|
||||
LLSelectMgr::getInstance()->selectionSetMediaData( media_data_security );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in )
|
||||
{
|
||||
fill_me_in[LLMediaEntry::WHITELIST_ENABLE_KEY] = mEnableWhiteList->getValue();
|
||||
|
||||
// iterate over white list and extract items
|
||||
std::vector< LLScrollListItem* > white_list_items = mWhiteListList->getAllData();
|
||||
std::vector< LLScrollListItem* >::iterator iter = white_list_items.begin();
|
||||
fill_me_in[LLMediaEntry::WHITELIST_KEY].clear();
|
||||
while( iter != white_list_items.end() )
|
||||
{
|
||||
std::string white_list_url = (*iter)->getValue().asString();
|
||||
fill_me_in[ LLMediaEntry::WHITELIST_KEY ].append( white_list_url );
|
||||
++iter;
|
||||
};
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Try to make a valid URL if a fragment (
|
||||
// white list list box widget and build a list to test against. Can also
|
||||
const std::string LLPanelMediaSettingsSecurity::makeValidUrl( const std::string& src_url )
|
||||
{
|
||||
// use LLURI to determine if we have a valid scheme
|
||||
LLURI candidate_url( src_url );
|
||||
if ( candidate_url.scheme().empty() )
|
||||
{
|
||||
// build a URL comprised of default scheme and the original fragment
|
||||
const std::string default_scheme( "http://" );
|
||||
return default_scheme + src_url;
|
||||
};
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llpanelmediasettingssecurity.h"
|
||||
#include "llpanelcontents.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "llscrolllistitem.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llwindow.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llsdutil.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llmediaentry.h"
|
||||
#include "llfloaterwhitelistentry.h"
|
||||
#include "llfloatermediasettings.h"
|
||||
// we *could* test the "default scheme" + "original fragment" URL again
|
||||
// using LLURI to see if it's valid but I think the outcome is the same
|
||||
// in either case - our only option is to return the original URL
|
||||
|
||||
// we *think* the original url passed in was valid
|
||||
return src_url;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// wrapper for testing a URL against the whitelist. We grab entries from
|
||||
// white list list box widget and build a list to test against. Can also
|
||||
// optionally pass the URL that you are trying to add to the widget since
|
||||
// it won't be added until this call returns.
|
||||
bool LLPanelMediaSettingsSecurity::passesWhiteList( const std::string& added_url,
|
||||
const std::string& test_url )
|
||||
{
|
||||
// the checkUrlAgainstWhitelist(..) function works on a vector
|
||||
// of strings for the white list entries - in this panel, the white list
|
||||
// is stored in the widgets themselves so we need to build something compatible.
|
||||
std::vector< std::string > whitelist_strings;
|
||||
whitelist_strings.clear(); // may not be required - I forget what the spec says.
|
||||
|
||||
// step through whitelist widget entries and grab them as strings
|
||||
std::vector< LLScrollListItem* > white_list_items = mWhiteListList->getAllData();
|
||||
std::vector< LLScrollListItem* >::iterator iter = white_list_items.begin();
|
||||
while( iter != white_list_items.end() )
|
||||
{
|
||||
const std::string whitelist_url = (*iter)->getValue().asString();
|
||||
whitelist_strings.push_back( whitelist_url );
|
||||
|
||||
++iter;
|
||||
};
|
||||
|
||||
// add in the URL that might be added to the whitelist so we can test that too
|
||||
if ( added_url.length() )
|
||||
whitelist_strings.push_back( added_url );
|
||||
|
||||
// possible the URL is just a fragment so we validize it
|
||||
const std::string valid_url = makeValidUrl( test_url );
|
||||
|
||||
// indicate if the URL passes whitelist
|
||||
return LLMediaEntry::checkUrlAgainstWhitelist( valid_url, whitelist_strings );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void LLPanelMediaSettingsSecurity::addWhiteListItem(const std::string& url)
|
||||
{
|
||||
// grab home URL from the general panel (via the parent floater)
|
||||
std::string home_url( "" );
|
||||
if ( mParent )
|
||||
home_url = mParent->getHomeUrl();
|
||||
|
||||
// if the home URL is blank (user hasn't entered it yet) then
|
||||
// don't bother to check if it passes the white list
|
||||
if ( home_url.empty() )
|
||||
{
|
||||
mWhiteListList->addSimpleElement( url );
|
||||
return;
|
||||
};
|
||||
|
||||
// if the URL passes the white list, add it
|
||||
if ( passesWhiteList( url, home_url ) )
|
||||
{
|
||||
mWhiteListList->addSimpleElement( url );
|
||||
}
|
||||
else
|
||||
// display a message indicating you can't do that
|
||||
{
|
||||
LLNotifications::instance().add("WhiteListInvalidatesHomeUrl");
|
||||
};
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
void LLPanelMediaSettingsSecurity::onBtnAdd( void* userdata )
|
||||
{
|
||||
LLFloaterReg::showInstance("whitelist_entry");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
void LLPanelMediaSettingsSecurity::onBtnDel( void* userdata )
|
||||
{
|
||||
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
|
||||
|
||||
self->mWhiteListList->deleteSelectedItems();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity()
|
||||
void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent )
|
||||
{
|
||||
// build dialog from XML
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_security.xml");
|
||||
mCommitCallbackRegistrar.add("Media.whitelistAdd", boost::bind(&LLPanelMediaSettingsSecurity::onBtnAdd, this));
|
||||
mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this));
|
||||
}
|
||||
mParent = parent;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
BOOL LLPanelMediaSettingsSecurity::postBuild()
|
||||
{
|
||||
mEnableWhiteList = getChild< LLCheckBoxCtrl >( LLMediaEntry::WHITELIST_ENABLE_KEY );
|
||||
mWhiteListList = getChild< LLScrollListCtrl >( LLMediaEntry::WHITELIST_KEY );
|
||||
|
||||
childSetAction("whitelist_add", onBtnAdd, this);
|
||||
childSetAction("whitelist_del", onBtnDel, this);
|
||||
|
||||
setDefaultBtn("whitelist_add");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// virtual
|
||||
LLPanelMediaSettingsSecurity::~LLPanelMediaSettingsSecurity()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void LLPanelMediaSettingsSecurity::draw()
|
||||
{
|
||||
// housekeeping
|
||||
LLPanel::draw();
|
||||
|
||||
// if list is empty, disable DEL button and checkbox to enable use of list
|
||||
if ( mWhiteListList->isEmpty() )
|
||||
{
|
||||
childSetEnabled( "whitelist_del", false );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_KEY, false );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_ENABLE_KEY, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
childSetEnabled( "whitelist_del", true );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_KEY, true );
|
||||
childSetEnabled( LLMediaEntry::WHITELIST_ENABLE_KEY, true );
|
||||
};
|
||||
|
||||
// if nothing is selected, disable DEL button
|
||||
if ( mWhiteListList->getSelectedValue().asString().empty() )
|
||||
{
|
||||
childSetEnabled( "whitelist_del", false );
|
||||
}
|
||||
else
|
||||
{
|
||||
childSetEnabled( "whitelist_del", true );
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
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( "" );
|
||||
|
||||
struct
|
||||
{
|
||||
std::string key_name;
|
||||
LLUICtrl* ctrl_ptr;
|
||||
std::string ctrl_type;
|
||||
|
||||
} data_set [] =
|
||||
{
|
||||
{ LLMediaEntry::WHITELIST_ENABLE_KEY, self->mEnableWhiteList, "LLCheckBoxCtrl" },
|
||||
{ LLMediaEntry::WHITELIST_KEY, self->mWhiteListList, "LLScrollListCtrl" },
|
||||
{ "", NULL , "" }
|
||||
};
|
||||
|
||||
for( int i = 0; data_set[ i ].key_name.length() > 0; ++i )
|
||||
{
|
||||
base_key = std::string( data_set[ i ].key_name );
|
||||
tentative_key = base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX );
|
||||
|
||||
// TODO: CP - I bet there is a better way to do this using Boost
|
||||
if ( media_settings[ base_key ].isDefined() )
|
||||
{
|
||||
if ( data_set[ i ].ctrl_type == "LLCheckBoxCtrl" )
|
||||
{
|
||||
static_cast< LLCheckBoxCtrl* >( data_set[ i ].ctrl_ptr )->
|
||||
setValue( media_settings[ base_key ].asBoolean() );
|
||||
}
|
||||
else
|
||||
if ( data_set[ i ].ctrl_type == "LLScrollListCtrl" )
|
||||
{
|
||||
// get control
|
||||
LLScrollListCtrl* list = static_cast< LLScrollListCtrl* >( data_set[ i ].ctrl_ptr );
|
||||
list->deleteAllItems();
|
||||
|
||||
// points to list of white list URLs
|
||||
LLSD url_list = media_settings[ base_key ];
|
||||
|
||||
// iterate over them and add to scroll list
|
||||
LLSD::array_iterator iter = url_list.beginArray();
|
||||
while( iter != url_list.endArray() )
|
||||
{
|
||||
// TODO: is iter guaranteed to be valid here?
|
||||
std::string url = *iter;
|
||||
list->addSimpleElement( url );
|
||||
++iter;
|
||||
};
|
||||
};
|
||||
data_set[ i ].ctrl_ptr->setEnabled(editable);
|
||||
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
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
|
||||
void LLPanelMediaSettingsSecurity::apply( void* userdata )
|
||||
{
|
||||
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
|
||||
|
||||
// build LLSD Fragment
|
||||
LLSD media_data_security;
|
||||
self->getValues(media_data_security);
|
||||
// this merges contents of LLSD passed in with what's there so this is ok
|
||||
LLSelectMgr::getInstance()->selectionSetMediaData( media_data_security );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in )
|
||||
{
|
||||
fill_me_in[LLMediaEntry::WHITELIST_ENABLE_KEY] = mEnableWhiteList->getValue();
|
||||
|
||||
// iterate over white list and extract items
|
||||
std::vector< LLScrollListItem* > white_list_items = mWhiteListList->getAllData();
|
||||
std::vector< LLScrollListItem* >::iterator iter = white_list_items.begin();
|
||||
fill_me_in[LLMediaEntry::WHITELIST_KEY].clear();
|
||||
while( iter != white_list_items.end() )
|
||||
{
|
||||
std::string white_list_url = (*iter)->getValue().asString();
|
||||
fill_me_in[ LLMediaEntry::WHITELIST_KEY ].append( white_list_url );
|
||||
++iter;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
void LLPanelMediaSettingsSecurity::addWhiteListItem(const std::string& url)
|
||||
{
|
||||
mWhiteListList->addSimpleElement( url );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
void LLPanelMediaSettingsSecurity::onBtnAdd( void* userdata )
|
||||
{
|
||||
LLFloaterReg::showInstance("whitelist_entry");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// static
|
||||
void LLPanelMediaSettingsSecurity::onBtnDel( void* userdata )
|
||||
{
|
||||
LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
|
||||
|
||||
self->mWhiteListList->deleteSelectedItems();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
class LLCheckBoxCtrl;
|
||||
class LLScrollListCtrl;
|
||||
class LLFloaterMediaSettings;
|
||||
|
||||
class LLPanelMediaSettingsSecurity : public LLPanel
|
||||
{
|
||||
|
|
@ -52,6 +53,12 @@ class LLPanelMediaSettingsSecurity : public LLPanel
|
|||
static void initValues( void* userdata, const LLSD& media_settings,bool editable );
|
||||
static void clearValues( void* userdata, bool editable);
|
||||
void addWhiteListItem(const std::string& url);
|
||||
void setParent( LLFloaterMediaSettings* parent );
|
||||
const std::string makeValidUrl( const std::string& src_url );
|
||||
bool passesWhiteList( const std::string& added_url, const std::string& test_url );
|
||||
|
||||
protected:
|
||||
LLFloaterMediaSettings* mParent;
|
||||
|
||||
private:
|
||||
LLCheckBoxCtrl* mEnableWhiteList;
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur"
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,0,2822
|
||||
PRODUCTVERSION 2,0,0,2822
|
||||
FILEVERSION 2,0,0,3256
|
||||
PRODUCTVERSION 2,0,0,3256
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
|
@ -152,12 +152,12 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", "Linden Lab"
|
||||
VALUE "FileDescription", "Second Life"
|
||||
VALUE "FileVersion", "2.0.0.2822"
|
||||
VALUE "FileVersion", "2.0.0.3256"
|
||||
VALUE "InternalName", "Second Life"
|
||||
VALUE "LegalCopyright", "Copyright © 2001-2008, Linden Research, Inc."
|
||||
VALUE "OriginalFilename", "SecondLife.exe"
|
||||
VALUE "ProductName", "Second Life"
|
||||
VALUE "ProductVersion", "2.0.0.2822"
|
||||
VALUE "ProductVersion", "2.0.0.3256"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
|||
|
|
@ -659,6 +659,19 @@ To place the media on only one face, choose Select Texture and click on the desi
|
|||
yestext="OK"/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="WhiteListInvalidatesHomeUrl"
|
||||
type="alertmodal">
|
||||
Adding this entry to the whitelist will invalidate the home URL you
|
||||
specified for this instance of media. You are not allowed to do this
|
||||
so the entry cannot be added to the whitelist.
|
||||
<usetemplate
|
||||
name="okbutton"
|
||||
yestext="Ok"/>
|
||||
</notification>
|
||||
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="MustBeInParcel"
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ LLMediaPluginTest::LLMediaPluginTest( int app_window, int window_width, int wind
|
|||
mMediaBrowserControlBackButtonFlag( true ),
|
||||
mMediaBrowserControlForwardButtonFlag( true ),
|
||||
mHomeWebUrl( "http://www.google.com/" )
|
||||
//mHomeWebUrl( "file:///C|/Program Files/QuickTime/Sample.mov" )
|
||||
//mHomeWebUrl( "http://movies.apple.com/movies/wb/watchmen/watchmen-tlr2_480p.mov" )
|
||||
{
|
||||
// debugging spam
|
||||
std::cout << std::endl << " GLUT version: " << "3.7.6" << std::endl; // no way to get real version from GLUT
|
||||
|
|
@ -2008,6 +2010,11 @@ void LLMediaPluginTest::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent e
|
|||
std::cerr << "Media event: MEDIA_EVENT_STATUS_TEXT_CHANGED, new status text is: " << self->getStatusText() << std::endl;
|
||||
break;
|
||||
|
||||
case MEDIA_EVENT_NAME_CHANGED:
|
||||
std::cerr << "Media event: MEDIA_EVENT_NAME_CHANGED, new name is: " << self->getMediaName() << std::endl;
|
||||
glutSetWindowTitle( self->getMediaName().c_str() );
|
||||
break;
|
||||
|
||||
case MEDIA_EVENT_LOCATION_CHANGED:
|
||||
{
|
||||
std::cerr << "Media event: MEDIA_EVENT_LOCATION_CHANGED, new uri is: " << self->getLocation() << std::endl;
|
||||
|
|
|
|||
Loading…
Reference in New Issue