diff options
Diffstat (limited to 'linden/indra/newview/llfloaterhtmlhelp.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterhtmlhelp.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index d6d249e..a9d2e46 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp | |||
@@ -58,7 +58,9 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data) | |||
58 | 58 | ||
59 | void LLFloaterMediaBrowser::draw() | 59 | void LLFloaterMediaBrowser::draw() |
60 | { | 60 | { |
61 | childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); | 61 | BOOL url_exists = !mAddressCombo->getValue().asString().empty(); |
62 | childSetEnabled("go", url_exists); | ||
63 | childSetEnabled("set_home", url_exists); | ||
62 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); | 64 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
63 | if(parcel) | 65 | if(parcel) |
64 | { | 66 | { |
@@ -84,6 +86,8 @@ BOOL LLFloaterMediaBrowser::postBuild() | |||
84 | childSetAction("close", onClickClose, this); | 86 | childSetAction("close", onClickClose, this); |
85 | childSetAction("open_browser", onClickOpenWebBrowser, this); | 87 | childSetAction("open_browser", onClickOpenWebBrowser, this); |
86 | childSetAction("assign", onClickAssign, this); | 88 | childSetAction("assign", onClickAssign, this); |
89 | childSetAction("home", onClickHome, this); | ||
90 | childSetAction("set_home", onClickSetHome, this); | ||
87 | 91 | ||
88 | buildURLHistory(); | 92 | buildURLHistory(); |
89 | return TRUE; | 93 | return TRUE; |
@@ -238,6 +242,29 @@ void LLFloaterMediaBrowser::onClickAssign(void* user_data) | |||
238 | 242 | ||
239 | } | 243 | } |
240 | 244 | ||
245 | void LLFloaterMediaBrowser::onClickHome(void* user_data) | ||
246 | { | ||
247 | LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; | ||
248 | if (self) | ||
249 | { | ||
250 | if (self->mBrowser) | ||
251 | { | ||
252 | std::string home_url = gSavedSettings.getString("BrowserHome"); | ||
253 | self->mBrowser->navigateTo(home_url); | ||
254 | } | ||
255 | } | ||
256 | } | ||
257 | |||
258 | void LLFloaterMediaBrowser::onClickSetHome(void* user_data) | ||
259 | { | ||
260 | LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; | ||
261 | std::string url = self->mCurrentURL; | ||
262 | if(!url.empty()) | ||
263 | { | ||
264 | gSavedSettings.setString("BrowserHome", url); | ||
265 | } | ||
266 | } | ||
267 | |||
241 | void LLFloaterMediaBrowser::openMedia(const std::string& media_url) | 268 | void LLFloaterMediaBrowser::openMedia(const std::string& media_url) |
242 | { | 269 | { |
243 | mBrowser->setHomePageUrl(media_url); | 270 | mBrowser->setHomePageUrl(media_url); |