aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhtmlhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterhtmlhelp.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp
index d6d249e..7fe4d59 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
59void LLFloaterMediaBrowser::draw() 59void 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;
@@ -146,6 +150,7 @@ void LLFloaterMediaBrowser::onLocationChange( const EventType& eventIn )
146 childSetEnabled("back", mBrowser->canNavigateBack()); 150 childSetEnabled("back", mBrowser->canNavigateBack());
147 childSetEnabled("forward", mBrowser->canNavigateForward()); 151 childSetEnabled("forward", mBrowser->canNavigateForward());
148 childSetEnabled("reload", TRUE); 152 childSetEnabled("reload", TRUE);
153 gSavedSettings.setString("BrowserLastVisited", truncated_url);
149} 154}
150 155
151LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url) 156LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url)
@@ -156,6 +161,14 @@ LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url
156 return floaterp; 161 return floaterp;
157} 162}
158 163
164void LLFloaterMediaBrowser::show()
165{
166 //Show home url if new session, last visited if not
167 std::string last_url = gSavedSettings.getString("BrowserLastVisited");
168 if(last_url.empty())
169 last_url = gSavedSettings.getString("BrowserHome");
170 showInstance(last_url);
171}
159//static 172//static
160void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data) 173void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data)
161{ 174{
@@ -238,6 +251,29 @@ void LLFloaterMediaBrowser::onClickAssign(void* user_data)
238 251
239} 252}
240 253
254void LLFloaterMediaBrowser::onClickHome(void* user_data)
255{
256 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
257 if (self)
258 {
259 if (self->mBrowser)
260 {
261 std::string home_url = gSavedSettings.getString("BrowserHome");
262 self->mBrowser->navigateTo(home_url);
263 }
264 }
265}
266
267void LLFloaterMediaBrowser::onClickSetHome(void* user_data)
268{
269 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
270 std::string url = self->mCurrentURL;
271 if(!url.empty())
272 {
273 gSavedSettings.setString("BrowserHome", url);
274 }
275}
276
241void LLFloaterMediaBrowser::openMedia(const std::string& media_url) 277void LLFloaterMediaBrowser::openMedia(const std::string& media_url)
242{ 278{
243 mBrowser->setHomePageUrl(media_url); 279 mBrowser->setHomePageUrl(media_url);