EXT-1738 [BSI] Manage Telehub... in Region/Estate floater silently fails when clicked

master
angela 2009-11-02 12:19:24 +08:00
parent af5a50916f
commit 3b6e5fb59e
5 changed files with 44 additions and 39 deletions

View File

@ -179,6 +179,8 @@ BOOL LLFloaterRegionInfo::postBuild()
LLPanelRegionInfo* panel;
panel = new LLPanelRegionGeneralInfo;
mInfoPanels.push_back(panel);
panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel));
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml");
mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true));
@ -554,6 +556,12 @@ void LLPanelRegionInfo::onClickHelp(std::string xml_alert)
LLNotifications::instance().add(xml_alert);
}
void LLPanelRegionInfo::onClickManageTelehub()
{
LLFloaterReg::hideInstance("region_info");
LLFloaterReg::showInstance("telehubs");
}
/////////////////////////////////////////////////////////////////////////////
// LLPanelRegionGeneralInfo
//
@ -604,7 +612,6 @@ BOOL LLPanelRegionGeneralInfo::postBuild()
childSetAction("kick_all_btn", onClickKickAll, this);
childSetAction("im_btn", onClickMessage, this);
// childSetAction("manage_telehub_btn", onClickManageTelehub, this);
mCommitCallbackRegistrar.add("RegionInfo.Cancel", boost::bind(&LLPanelRegionGeneralInfo::onClickManageTelehub, this));
return LLPanelRegionInfo::postBuild();
}
@ -712,11 +719,7 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L
return false;
}
void LLPanelRegionGeneralInfo::onClickManageTelehub()
{
LLFloaterReg::hideInstance("region_info");
LLFloaterReg::showInstance("telehubs");
}
// setregioninfo
// strings[0] = 'Y' - block terraform, 'N' - not

View File

@ -123,10 +123,13 @@ public:
void enableButton(const std::string& btn_name, BOOL enable = TRUE);
void disableButton(const std::string& btn_name);
void onClickManageTelehub();
protected:
void initCtrl(const std::string& name);
void initHelpBtn(const std::string& name, const std::string& xml_alert);
// Callback for all help buttons, data is name of XML alert to show.
void onClickHelp(std::string xml_alert);
@ -152,6 +155,7 @@ protected:
class LLPanelRegionGeneralInfo : public LLPanelRegionInfo
{
public:
LLPanelRegionGeneralInfo()
: LLPanelRegionInfo() {}
@ -161,16 +165,16 @@ public:
// LLPanel
virtual BOOL postBuild();
protected:
virtual BOOL sendUpdate();
static void onClickKick(void* userdata);
static void onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata);
static void onClickKickAll(void* userdata);
bool onKickAllCommit(const LLSD& notification, const LLSD& response);
static void onClickMessage(void* userdata);
bool onMessageCommit(const LLSD& notification, const LLSD& response);
void onClickManageTelehub();
};
/////////////////////////////////////////////////////////////////////////////

View File

@ -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;
@ -237,17 +235,17 @@ void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in )
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 +332,10 @@ void LLPanelMediaSettingsSecurity::onBtnDel( void* userdata )
self->mWhiteListList->deleteSelectedItems();
}
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent )
{
mParent = parent;
};
////////////////////////////////////////////////////////////////////////////////
//
void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent )
{
mParent = parent;
};

View File

@ -299,10 +299,7 @@
left="108"
name="apply_btn"
top="320"
width="100">
<button.commit_callback
function="RegionInfo.Cancel" />
</button>
width="100"/>
<button
follows="left|top"
height="20"
@ -338,5 +335,8 @@
left="250"
name="manage_telehub_btn"
top="70"
width="150" />
width="150">
<button.commit_callback
function="RegionInfo.ManageTelehub" />
</button>
</panel>

View File

@ -299,10 +299,7 @@
left="108"
name="apply_btn"
top="320"
width="100">
<button.commit_callback
function="RegionInfo.Cancel" />
</button>
width="100"/>
<button
follows="left|top"
height="20"
@ -338,5 +335,8 @@
left_delta="0"
name="manage_telehub_btn"
top_pad="20"
width="150" />
width="150" >
<button.commit_callback
function="RegionInfo.ManageTelehub" />
</button>
</panel>