aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-11-11 13:22:13 -0700
committerMcCabe Maxsted2010-11-11 13:22:13 -0700
commite8e1ea571e15bd2d4773785cc11e945b59d7c3f4 (patch)
tree01d42f503df31cc153b98886141efc64ca39fb81 /linden
parentAdded missing 'Plugin' entry in logcontrol.xml (diff)
parentMore #700: remove llfloaterhtmlhelp.cpp (diff)
downloadmeta-impy-e8e1ea571e15bd2d4773785cc11e945b59d7c3f4.zip
meta-impy-e8e1ea571e15bd2d4773785cc11e945b59d7c3f4.tar.gz
meta-impy-e8e1ea571e15bd2d4773785cc11e945b59d7c3f4.tar.bz2
meta-impy-e8e1ea571e15bd2d4773785cc11e945b59d7c3f4.tar.xz
Merge remote branch 'thickbrick/weekly' into weekly
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/hippolimits.cpp11
-rw-r--r--linden/indra/newview/llfloaterhtmlhelp.cpp562
-rw-r--r--linden/indra/newview/llfloatermediabrowser.cpp43
-rw-r--r--linden/indra/newview/llfloatermediabrowser.h2
-rw-r--r--linden/indra/newview/llviewermenu.cpp8
5 files changed, 53 insertions, 573 deletions
diff --git a/linden/indra/newview/hippolimits.cpp b/linden/indra/newview/hippolimits.cpp
index 851e191..3368ba4 100644
--- a/linden/indra/newview/hippolimits.cpp
+++ b/linden/indra/newview/hippolimits.cpp
@@ -21,7 +21,8 @@ HippoLimits::HippoLimits()
21 mMaxHollow(0.95f), 21 mMaxHollow(0.95f),
22 mMinPrimScale(0.001f), 22 mMinPrimScale(0.001f),
23 mMaxPrimScale(256.0f), 23 mMaxPrimScale(256.0f),
24 mMaxLinkedPrims(-1) 24 mMaxLinkedPrims(-1),
25 mMaxDragDistance(0.f)
25{ 26{
26 setLimits(); 27 setLimits();
27} 28}
@@ -207,7 +208,7 @@ F32 HippoLimits::getMinPrimZPos() const
207 208
208F32 HippoLimits::getMaxDragDistance() const 209F32 HippoLimits::getMaxDragDistance() const
209{ 210{
210 if (mMaxDragDistance == 0) 211 if (mMaxDragDistance == 0.f)
211 { 212 {
212 return FLT_MAX; 213 return FLT_MAX;
213 } 214 }
@@ -215,9 +216,9 @@ F32 HippoLimits::getMaxDragDistance() const
215 { 216 {
216 F32 max_drag_distance = gSavedSettings.getBOOL("LimitDragDistance") ? gSavedSettings.getF32("MaxDragDistance") : FLT_MAX; 217 F32 max_drag_distance = gSavedSettings.getBOOL("LimitDragDistance") ? gSavedSettings.getF32("MaxDragDistance") : FLT_MAX;
217 218
218 if(max_drag_distance > mMaxDragDistance) //Chose the more restrictive 219 if(max_drag_distance > mMaxDragDistance) //Chose the more restrictive
219 { 220 {
220 max_drag_distance = mMaxDragDistance; 221 max_drag_distance = mMaxDragDistance;
221 } 222 }
222 return max_drag_distance; 223 return max_drag_distance;
223 } 224 }
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp
deleted file mode 100644
index c89c2e2..0000000
--- a/linden/indra/newview/llfloaterhtmlhelp.cpp
+++ /dev/null
@@ -1,562 +0,0 @@
1/**
2 * @file llfloaterhtmlhelp.cpp
3 * @brief HTML Help floater - uses embedded web browser control
4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
7 * Copyright (c) 2006-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloaterhtmlhelp.h"
36#include "llfloaterhtml.h"
37
38#include "llchat.h"
39#include "llfloaterchat.h"
40#include "llparcel.h"
41#include "lluictrlfactory.h"
42#include "llwebbrowserctrl.h"
43#include "llviewerwindow.h"
44#include "llviewercontrol.h"
45#include "llviewerparcelmgr.h"
46#include "llweb.h"
47#include "lltrans.h"
48#include "llui.h"
49#include "roles_constants.h"
50
51#include "llurlhistory.h"
52#include "llwebbrowserctrl.h"
53#include "llviewermedia.h"
54#include "llviewerparcelmedia.h"
55#include "llcombobox.h"
56
57#include "hippogridmanager.h"
58
59LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data)
60{
61 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_media_browser.xml");
62}
63
64void LLFloaterMediaBrowser::draw()
65{
66 BOOL url_exists = !mAddressCombo->getValue().asString().empty();
67 childSetEnabled("go", url_exists);
68 childSetEnabled("set_home", url_exists);
69 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
70 if(parcel)
71 {
72 childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA));
73 childSetEnabled("assign", !mAddressCombo->getValue().asString().empty());
74 }
75 LLFloater::draw();
76}
77
78BOOL LLFloaterMediaBrowser::postBuild()
79{
80 mBrowser = getChild<LLWebBrowserCtrl>("browser");
81 mBrowser->addObserver(this);
82
83 mAddressCombo = getChild<LLComboBox>("address");
84 mAddressCombo->setCommitCallback(onEnterAddress);
85 mAddressCombo->setCallbackUserData(this);
86
87 childSetAction("back", onClickBack, this);
88 childSetAction("forward", onClickForward, this);
89 childSetAction("reload", onClickRefresh, this);
90 childSetAction("go", onClickGo, this);
91 childSetAction("close", onClickClose, this);
92 childSetAction("open_browser", onClickOpenWebBrowser, this);
93 childSetAction("assign", onClickAssign, this);
94 childSetAction("home", onClickHome, this);
95 childSetAction("set_home", onClickSetHome, this);
96
97 buildURLHistory();
98
99 //Show home url if new session, last visited if not
100 std::string last_url = gSavedSettings.getString("BrowserLastVisited");
101 if (last_url.empty())
102 {
103 last_url = gSavedSettings.getString("BrowserHome");
104 }
105 openMedia(last_url);
106
107 return TRUE;
108}
109
110void LLFloaterMediaBrowser::buildURLHistory()
111{
112 LLCtrlListInterface* url_list = childGetListInterface("address");
113 if (url_list)
114 {
115 url_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
116 }
117
118 // Get all of the entries in the "parcel" collection
119 LLSD parcel_history = LLURLHistory::getURLHistory("browser");
120
121 LLSD::array_iterator iter_history =
122 parcel_history.beginArray();
123 LLSD::array_iterator end_history =
124 parcel_history.endArray();
125 for(; iter_history != end_history; ++iter_history)
126 {
127 std::string url = (*iter_history).asString();
128 if(! url.empty())
129 url_list->addSimpleElement(url);
130 }
131}
132
133void LLFloaterMediaBrowser::onClose(bool app_quitting)
134{
135 //setVisible(FALSE);
136 destroy();
137}
138
139void LLFloaterMediaBrowser::onLocationChange( const EventType& eventIn )
140{
141 // hitting the refresh button will navigate to same URL, so don't add to address history
142 mCurrentURL = eventIn.getStringValue();
143 std::string::size_type string_start = mCurrentURL.find("://");
144 std::string truncated_url;
145 if ((string_start == std::string::npos) || (1)) // NOTE: this conditional is forced true to disable truncation DEV-9834
146 {
147 truncated_url = mCurrentURL;
148 }
149 else
150 {
151 truncated_url = mCurrentURL.substr(string_start + 3);
152 }
153 // redirects will navigate momentarily to about:blank, don't add to history
154 if (truncated_url != "about:blank")
155 {
156 mAddressCombo->remove(truncated_url);
157 mAddressCombo->add(truncated_url, ADD_SORTED);
158 mAddressCombo->selectByValue(truncated_url);
159
160 // Serialize url history
161 LLURLHistory::removeURL("browser", truncated_url);
162 LLURLHistory::addURL("browser", truncated_url);
163 }
164 childSetEnabled("back", mBrowser->canNavigateBack());
165 childSetEnabled("forward", mBrowser->canNavigateForward());
166 childSetEnabled("reload", TRUE);
167 gSavedSettings.setString("BrowserLastVisited", truncated_url);
168}
169
170//static
171void LLFloaterMediaBrowser::helpF1()
172{
173 std::string url = gSavedSettings.getString("HelpSupportURL");
174 LLSD payload;
175 payload["url"] = url;
176
177 LLNotifications::instance().add("ClickOpenF1Help", LLSD(), payload, onClickF1HelpLoadURL);
178}
179
180// static
181bool LLFloaterMediaBrowser::onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response)
182{
183 S32 option = LLNotification::getSelectedOption(notification, response);
184 if (option == 0)
185 {
186 LLWeb::loadURL(notification["payload"]["url"].asString());
187 }
188 return false;
189}
190
191//static
192void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data)
193{
194 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
195 self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString());
196}
197
198//static
199void LLFloaterMediaBrowser::onClickRefresh(void* user_data)
200{
201 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
202
203 self->mAddressCombo->remove(0);
204 self->mBrowser->navigateTo(self->mCurrentURL);
205}
206
207//static
208void LLFloaterMediaBrowser::onClickForward(void* user_data)
209{
210 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
211
212 self->mBrowser->navigateForward();
213}
214
215//static
216void LLFloaterMediaBrowser::onClickBack(void* user_data)
217{
218 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
219
220 self->mBrowser->navigateBack();
221}
222
223//static
224void LLFloaterMediaBrowser::onClickGo(void* user_data)
225{
226 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
227
228 self->mBrowser->navigateTo(self->mAddressCombo->getValue().asString());
229}
230
231//static
232void LLFloaterMediaBrowser::onClickClose(void* user_data)
233{
234 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
235
236 self->close();
237}
238
239//static
240void LLFloaterMediaBrowser::onClickOpenWebBrowser(void* user_data)
241{
242 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
243
244 std::string url = self->mCurrentURL.empty() ?
245 self->mBrowser->getHomePageUrl() :
246 self->mCurrentURL;
247 LLWeb::loadURLExternal(url);
248}
249
250void LLFloaterMediaBrowser::onClickAssign(void* user_data)
251{
252 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
253
254 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
255 if (!parcel)
256 {
257 return;
258 }
259 std::string media_url = self->mAddressCombo->getValue().asString();
260 LLStringUtil::trim(media_url);
261
262 parcel->setMediaURL(media_url);
263 parcel->setMediaType(std::string("text/html"));
264
265 // Send current parcel data upstream to server
266 LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel, true );
267 // now check for video
268 LLViewerParcelMedia::update( parcel );
269}
270
271// static
272void LLFloaterMediaBrowser::onClickHome(void* user_data)
273{
274 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
275 if (self)
276 {
277 if (self->mBrowser)
278 {
279 std::string home_url = gSavedSettings.getString("BrowserHome");
280 self->mBrowser->navigateTo(home_url);
281 }
282 }
283}
284
285void LLFloaterMediaBrowser::onClickSetHome(void* user_data)
286{
287 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
288 std::string url = self->mCurrentURL;
289 if(!url.empty())
290 {
291 LLChat chat;
292 std::string log_message = LLTrans::getString("new_home_page") + " ";
293 log_message += url;
294 chat.mText = log_message;
295 LLFloaterChat::addChat(chat, FALSE, FALSE);
296 gSavedSettings.setString("BrowserHome", url);
297 }
298}
299
300void LLFloaterMediaBrowser::openMedia(const std::string& media_url)
301{
302 mBrowser->setHomePageUrl(media_url);
303 mBrowser->navigateTo(media_url);
304}
305
306LLViewerHtmlHelp gViewerHtmlHelp;
307
308class LLFloaterHtmlHelp :
309 public LLFloater,
310 public LLWebBrowserCtrlObserver
311{
312public:
313 LLFloaterHtmlHelp(std::string start_url, std::string title);
314 virtual ~LLFloaterHtmlHelp();
315
316 virtual void onClose( bool app_quitting );
317 virtual void draw();
318
319 static void show(std::string url, std::string title);
320
321private:
322 static void onClickBack( void* data );
323 //static void onClickHome( void* data );
324 static void onClickForward( void* data );
325 static void onClickClose( void* data );
326
327 // browser observer impls
328 virtual void onStatusTextChange( const EventType& eventIn );
329 virtual void onLocationChange( const EventType& eventIn );
330
331 // used for some stats logging - will be removed at some point
332 static BOOL sFloaterOpened;
333
334 static bool onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response);
335
336 LLWebBrowserCtrl* mWebBrowser;
337 static LLFloaterHtmlHelp* sInstance;
338 LLButton* mBackButton;
339 LLButton* mForwardButton;
340 LLButton* mCloseButton;
341 LLTextBox* mStatusText;
342 std::string mStatusTextContents;
343 std::string mCurrentUrl;
344 std::string mSupportUrl;
345};
346
347LLFloaterHtmlHelp* LLFloaterHtmlHelp::sInstance = 0;
348
349BOOL LLFloaterHtmlHelp::sFloaterOpened = FALSE;
350
351////////////////////////////////////////////////////////////////////////////////
352//
353LLFloaterHtmlHelp::LLFloaterHtmlHelp(std::string start_url, std::string title)
354: LLFloater( std::string("HTML Help") ),
355 mWebBrowser( 0 ),
356 mStatusTextContents( LLStringUtil::null ),
357 mCurrentUrl( LLStringUtil::null )
358{
359 sInstance = this;
360
361 // create floater from its XML definition
362 LLUICtrlFactory::getInstance()->buildFloater( this, "floater_html_help.xml" );
363
364 childSetAction("back_btn", onClickBack, this);
365 //childSetAction("home_btn", onClickHome, this);
366 childSetAction("forward_btn", onClickForward, this);
367
368 if (!title.empty())
369 {
370 setTitle(title);
371 }
372
373 mWebBrowser = getChild<LLWebBrowserCtrl>("html_help_browser" );
374 if ( mWebBrowser )
375 {
376 // observe browser control events
377 mWebBrowser->addObserver( this );
378
379 if (start_url != "")
380 {
381 mWebBrowser->navigateTo( start_url );
382 }
383 else
384 {
385 // if the last page we were at before the client was closed is valid, go there and
386 // override what is in the XML file
387 // (not when the window was closed - it's only ever hidden - not closed)
388 std::string lastPageUrl = gSavedSettings.getString( "HtmlHelpLastPage" );
389 if ( lastPageUrl != "" )
390 {
391 mWebBrowser->navigateTo( lastPageUrl );
392 };
393 }
394 };
395}
396
397////////////////////////////////////////////////////////////////////////////////
398//
399LLFloaterHtmlHelp::~LLFloaterHtmlHelp()
400{
401 // stop observing browser events
402 if ( mWebBrowser )
403 {
404 mWebBrowser->remObserver( this );
405 };
406
407 // save position of floater
408 gSavedSettings.setRect( "HtmlHelpRect", getRect() );
409
410 // save the location we were at when SL closed
411 gSavedSettings.setString( "HtmlHelpLastPage", mCurrentUrl );
412
413 sInstance = 0;
414}
415
416////////////////////////////////////////////////////////////////////////////////
417// virtual
418void LLFloaterHtmlHelp::draw()
419{
420 // enable/disable buttons depending on state
421 if ( mWebBrowser )
422 {
423 bool enable_back = mWebBrowser->canNavigateBack();
424 childSetEnabled( "back_btn", enable_back );
425
426 bool enable_forward = mWebBrowser->canNavigateForward();
427 childSetEnabled( "forward_btn", enable_forward );
428 };
429
430 LLFloater::draw();
431}
432
433////////////////////////////////////////////////////////////////////////////////
434//
435void LLFloaterHtmlHelp::show(std::string url, std::string title)
436{
437 LLFloaterHtml* floater_html = LLFloaterHtml::getInstance();
438 floater_html->setVisible(FALSE);
439
440 url = gHippoGridManager->getConnectedGrid()->getSupportUrl();
441 if (!url.empty())
442 {
443 if (gSavedSettings.getBOOL("UseExternalBrowser"))
444 {
445 LLSD payload;
446 payload["url"] = url;
447 LLNotifications::instance().add("ClickOpenF1Help", LLSD(), payload, onClickF1HelpLoadURL);
448 }
449 else
450 {
451 // don't wait, just do it
452 LLWeb::loadURLInternal(url);
453 }
454 }
455 else
456 {
457 LLNotifications::instance().add("NoSupportUrl");
458 }
459}
460
461// static
462bool LLFloaterHtmlHelp::onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response)
463{
464 S32 option = LLNotification::getSelectedOption(notification, response);
465 if (option == 0)
466 {
467 const std::string& url = notification["payload"]["url"].asString();
468 if (!url.empty())
469 {
470 LLWeb::loadURLExternal(url);
471 }
472 else
473 {
474 llwarns << "Support URL not available." << llendl;
475 }
476 }
477 return false;
478}
479
480////////////////////////////////////////////////////////////////////////////////
481//
482void LLFloaterHtmlHelp::onClose( bool app_quitting )
483{
484 setVisible( false );
485}
486
487////////////////////////////////////////////////////////////////////////////////
488//
489void LLFloaterHtmlHelp::onClickClose( void* data )
490{
491 LLFloaterHtmlHelp* self = ( LLFloaterHtmlHelp* )data;
492
493 self->setVisible( false );
494}
495
496////////////////////////////////////////////////////////////////////////////////
497//
498void LLFloaterHtmlHelp::onClickBack( void* data )
499{
500 LLFloaterHtmlHelp* self = ( LLFloaterHtmlHelp* )data;
501 if ( self )
502 {
503 if ( self->mWebBrowser )
504 {
505 self->mWebBrowser->navigateBack();
506 };
507 };
508}
509
510////////////////////////////////////////////////////////////////////////////////
511//
512void LLFloaterHtmlHelp::onClickForward( void* data )
513{
514 LLFloaterHtmlHelp* self = ( LLFloaterHtmlHelp* )data;
515 if ( self )
516 {
517 if ( self->mWebBrowser )
518 {
519 self->mWebBrowser->navigateForward();
520 };
521 };
522}
523
524////////////////////////////////////////////////////////////////////////////////
525//
526void LLFloaterHtmlHelp::onStatusTextChange( const EventType& eventIn )
527{
528 mStatusTextContents = std::string( eventIn.getStringValue() );
529
530 childSetText("status_text", mStatusTextContents);
531}
532
533////////////////////////////////////////////////////////////////////////////////
534//
535void LLFloaterHtmlHelp::onLocationChange( const EventType& eventIn )
536{
537 llinfos << "WEB> Location changed to " << eventIn.getStringValue() << llendl;
538 mCurrentUrl = std::string( eventIn.getStringValue() );
539}
540
541////////////////////////////////////////////////////////////////////////////////
542//
543LLViewerHtmlHelp::LLViewerHtmlHelp()
544{
545 LLUI::setHtmlHelp(this);
546}
547
548LLViewerHtmlHelp::~LLViewerHtmlHelp()
549{
550 LLUI::setHtmlHelp(NULL);
551}
552
553void LLViewerHtmlHelp::show()
554{
555 LLFloaterHtmlHelp::show("", "");
556}
557
558void LLViewerHtmlHelp::show(std::string url)
559{
560 std::string title; // empty
561 LLFloaterHtmlHelp::show(url, title);
562}
diff --git a/linden/indra/newview/llfloatermediabrowser.cpp b/linden/indra/newview/llfloatermediabrowser.cpp
index def0159..d658a11 100644
--- a/linden/indra/newview/llfloatermediabrowser.cpp
+++ b/linden/indra/newview/llfloatermediabrowser.cpp
@@ -35,6 +35,8 @@
35#include "llfloatermediabrowser.h" 35#include "llfloatermediabrowser.h"
36#include "llfloaterhtml.h" 36#include "llfloaterhtml.h"
37 37
38#include "llchat.h"
39#include "llfloaterchat.h"
38#include "llparcel.h" 40#include "llparcel.h"
39#include "llpluginclassmedia.h" 41#include "llpluginclassmedia.h"
40#include "lluictrlfactory.h" 42#include "lluictrlfactory.h"
@@ -43,6 +45,7 @@
43#include "llviewercontrol.h" 45#include "llviewercontrol.h"
44#include "llviewerparcelmgr.h" 46#include "llviewerparcelmgr.h"
45#include "llweb.h" 47#include "llweb.h"
48#include "lltrans.h"
46#include "llui.h" 49#include "llui.h"
47#include "roles_constants.h" 50#include "roles_constants.h"
48 51
@@ -64,12 +67,14 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data)
64 67
65void LLFloaterMediaBrowser::draw() 68void LLFloaterMediaBrowser::draw()
66{ 69{
67 childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); 70 BOOL url_exists = !mAddressCombo->getValue().asString().empty();
71 childSetEnabled("go", url_exists);
72 childSetEnabled("set_home", url_exists);
68 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 73 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
69 if(parcel) 74 if(parcel)
70 { 75 {
71 childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); 76 childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA));
72 childSetEnabled("assign", !mAddressCombo->getValue().asString().empty()); 77 childSetEnabled("assign", url_exists);
73 } 78 }
74 bool show_time_controls = false; 79 bool show_time_controls = false;
75 bool media_playing = false; 80 bool media_playing = false;
@@ -118,8 +123,11 @@ BOOL LLFloaterMediaBrowser::postBuild()
118 childSetAction("close", onClickClose, this); 123 childSetAction("close", onClickClose, this);
119 childSetAction("open_browser", onClickOpenWebBrowser, this); 124 childSetAction("open_browser", onClickOpenWebBrowser, this);
120 childSetAction("assign", onClickAssign, this); 125 childSetAction("assign", onClickAssign, this);
126 childSetAction("home", onClickHome, this);
127 childSetAction("set_home", onClickSetHome, this);
121 128
122 buildURLHistory(); 129 buildURLHistory();
130
123 return TRUE; 131 return TRUE;
124} 132}
125 133
@@ -283,6 +291,37 @@ void LLFloaterMediaBrowser::onClickAssign(void* user_data)
283 } 291 }
284 LLViewerParcelMedia::sendMediaNavigateMessage(media_url); 292 LLViewerParcelMedia::sendMediaNavigateMessage(media_url);
285} 293}
294
295// static
296void LLFloaterMediaBrowser::onClickHome(void* user_data)
297{
298 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
299 if (self)
300 {
301 if (self->mBrowser)
302 {
303 std::string home_url = gSavedSettings.getString("BrowserHome");
304 self->mBrowser->navigateTo(home_url);
305 }
306 }
307}
308
309// static
310void LLFloaterMediaBrowser::onClickSetHome(void* user_data)
311{
312 LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
313 std::string url = self->mCurrentURL;
314 if(!url.empty())
315 {
316 LLChat chat;
317 std::string log_message = LLTrans::getString("new_home_page") + " ";
318 log_message += url;
319 chat.mText = log_message;
320 LLFloaterChat::addChat(chat, FALSE, FALSE);
321 gSavedSettings.setString("BrowserHome", url);
322 }
323}
324
286//static 325//static
287void LLFloaterMediaBrowser::onClickRewind(void* user_data) 326void LLFloaterMediaBrowser::onClickRewind(void* user_data)
288{ 327{
diff --git a/linden/indra/newview/llfloatermediabrowser.h b/linden/indra/newview/llfloatermediabrowser.h
index 8a78df8..7de1900 100644
--- a/linden/indra/newview/llfloatermediabrowser.h
+++ b/linden/indra/newview/llfloatermediabrowser.h
@@ -85,6 +85,8 @@ public:
85 static void onClickClose(void* user_data); 85 static void onClickClose(void* user_data);
86 static void onClickOpenWebBrowser(void* user_data); 86 static void onClickOpenWebBrowser(void* user_data);
87 static void onClickAssign(void* user_data); 87 static void onClickAssign(void* user_data);
88 static void onClickHome(void* user_data);
89 static void onClickSetHome(void* user_data);
88 static void onClickRewind(void* user_data); 90 static void onClickRewind(void* user_data);
89 static void onClickPlay(void* user_data); 91 static void onClickPlay(void* user_data);
90 static void onClickStop(void* user_data); 92 static void onClickStop(void* user_data);
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index a663e60..b81a2a2 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -6091,10 +6091,10 @@ class LLShowFloater : public view_listener_t
6091 { 6091 {
6092 JCFloaterAnimList::toggleInstance(LLSD()); 6092 JCFloaterAnimList::toggleInstance(LLSD());
6093 } 6093 }
6094//imprudence fixme else if (floater_name == "inworld browser") 6094 else if (floater_name == "inworld browser")
6095// { 6095 {
6096// LLFloaterMediaBrowser::toggle(); 6096 LLWeb::loadURL(gSavedSettings.getString("BrowserHome"));
6097// } 6097 }
6098 else if (floater_name == "beacons") 6098 else if (floater_name == "beacons")
6099 { 6099 {
6100 LLFloaterBeacons::toggleInstance(LLSD()); 6100 LLFloaterBeacons::toggleInstance(LLSD());