summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmediasettingssecurity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelmediasettingssecurity.cpp')
-rw-r--r--indra/newview/llpanelmediasettingssecurity.cpp64
1 files changed, 33 insertions, 31 deletions
diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp
index f5607aa287..bec2494eac 100644
--- a/indra/newview/llpanelmediasettingssecurity.cpp
+++ b/indra/newview/llpanelmediasettingssecurity.cpp
@@ -50,10 +50,11 @@
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));
+ // build dialog from XML
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_security.xml");
+
}
////////////////////////////////////////////////////////////////////////////////
@@ -62,10 +63,7 @@ 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;
@@ -200,17 +198,12 @@ void LLPanelMediaSettingsSecurity::clearValues( void* userdata , bool editable)
self->mEnableWhiteList->setEnabled(editable);
self->mWhiteListList->setEnabled(editable);
}
+
////////////////////////////////////////////////////////////////////////////////
-// static
-void LLPanelMediaSettingsSecurity::apply( void* userdata )
+//
+void LLPanelMediaSettingsSecurity::preApply()
{
- 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 );
+ // no-op
}
////////////////////////////////////////////////////////////////////////////////
@@ -222,7 +215,9 @@ void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in )
// 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();
+ // *NOTE: need actually set the key to be an emptyArray(), or the merge
+ // we do with this LLSD will think there's nothing to change.
+ fill_me_in[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray();
while( iter != white_list_items.end() )
{
std::string white_list_url = (*iter)->getValue().asString();
@@ -231,23 +226,30 @@ void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in )
};
}
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLPanelMediaSettingsSecurity::postApply()
+{
+ // no-op
+}
+
///////////////////////////////////////////////////////////////////////////////
// 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() )
- {
+ 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;
- };
-
- // 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 *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;
@@ -334,10 +336,10 @@ void LLPanelMediaSettingsSecurity::onBtnDel( void* userdata )
self->mWhiteListList->deleteSelectedItems();
}
-////////////////////////////////////////////////////////////////////////////////
-//
-void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent )
-{
- mParent = parent;
-};
-
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent )
+{
+ mParent = parent;
+};
+