aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhtmlhelp.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-11-09 15:38:46 -0700
committerMcCabe Maxsted2009-11-09 15:38:46 -0700
commita7395832cd58596098e04882d29b8defa8ef905c (patch)
tree92c680d1239b67aa311ed94dce9f4c4f643dd88b /linden/indra/newview/llfloaterhtmlhelp.cpp
parentMoved 1.2 alerts to the new notification system (diff)
downloadmeta-impy-a7395832cd58596098e04882d29b8defa8ef905c.zip
meta-impy-a7395832cd58596098e04882d29b8defa8ef905c.tar.gz
meta-impy-a7395832cd58596098e04882d29b8defa8ef905c.tar.bz2
meta-impy-a7395832cd58596098e04882d29b8defa8ef905c.tar.xz
Media browser now compiles (TODO: rewrite this file again)
Diffstat (limited to 'linden/indra/newview/llfloaterhtmlhelp.cpp')
-rw-r--r--linden/indra/newview/llfloaterhtmlhelp.cpp47
1 files changed, 46 insertions, 1 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp
index 9f07e0f..8de489a 100644
--- a/linden/indra/newview/llfloaterhtmlhelp.cpp
+++ b/linden/indra/newview/llfloaterhtmlhelp.cpp
@@ -62,7 +62,9 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data)
62 62
63void LLFloaterMediaBrowser::draw() 63void LLFloaterMediaBrowser::draw()
64{ 64{
65 childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); 65 BOOL url_exists = !mAddressCombo->getValue().asString().empty();
66 childSetEnabled("go", url_exists);
67 childSetEnabled("set_home", url_exists);
66 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 68 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
67 if(parcel) 69 if(parcel)
68 { 70 {
@@ -88,6 +90,8 @@ BOOL LLFloaterMediaBrowser::postBuild()
88 childSetAction("close", onClickClose, this); 90 childSetAction("close", onClickClose, this);
89 childSetAction("open_browser", onClickOpenWebBrowser, this); 91 childSetAction("open_browser", onClickOpenWebBrowser, this);
90 childSetAction("assign", onClickAssign, this); 92 childSetAction("assign", onClickAssign, this);
93 childSetAction("home", onClickHome, this);
94 childSetAction("set_home", onClickSetHome, this);
91 95
92 buildURLHistory(); 96 buildURLHistory();
93 return TRUE; 97 return TRUE;
@@ -150,6 +154,7 @@ void LLFloaterMediaBrowser::onLocationChange( const EventType& eventIn )
150 childSetEnabled("back", mBrowser->canNavigateBack()); 154 childSetEnabled("back", mBrowser->canNavigateBack());
151 childSetEnabled("forward", mBrowser->canNavigateForward()); 155 childSetEnabled("forward", mBrowser->canNavigateForward());
152 childSetEnabled("reload", TRUE); 156 childSetEnabled("reload", TRUE);
157 gSavedSettings.setString("BrowserLastVisited", truncated_url);
153} 158}
154 159
155LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url) 160LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url)
@@ -160,6 +165,46 @@ LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url
160 return floaterp; 165 return floaterp;
161} 166}
162 167
168//static
169void LLFloaterMediaBrowser::toggle()
170{
171 LLFloaterMediaBrowser* self = LLFloaterMediaBrowser::getInstance();
172
173 if(self->getVisible())
174 {
175 self->close();
176 }
177 else
178 {
179 //Show home url if new session, last visited if not
180 std::string last_url = gSavedSettings.getString("BrowserLastVisited");
181 if(last_url.empty())
182 last_url = gSavedSettings.getString("BrowserHome");
183 showInstance(last_url);
184 }
185}
186
187//static
188void LLFloaterMediaBrowser::helpF1()
189{
190 std::string url = gSavedSettings.getString("HelpSupportURL");
191 LLSD payload;
192 payload["url"] = url;
193
194 LLNotifications::instance().add("ClickOpenF1Help", LLSD(), payload, onClickF1HelpLoadURL);
195}
196
197// static
198bool LLFloaterMediaBrowser::onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response)
199{
200 S32 option = LLNotification::getSelectedOption(notification, response);
201 if (option == 0)
202 {
203 LLWeb::loadURL(notification["payload"]["url"].asString());
204 }
205 return false;
206}
207
163//static 208//static
164void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data) 209void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data)
165{ 210{