aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatermediabrowser.cpp
diff options
context:
space:
mode:
authorthickbrick2010-11-10 20:10:13 +0200
committerthickbrick2010-11-10 20:10:13 +0200
commit7b5e0f297726bf58fd4dfd3ed2725af891952835 (patch)
treed576e0e77327f3b9ab91727b0c15ce7e7ad07906 /linden/indra/newview/llfloatermediabrowser.cpp
parentFix #699: Can't drag prims with translate manipulator (diff)
downloadmeta-impy-7b5e0f297726bf58fd4dfd3ed2725af891952835.zip
meta-impy-7b5e0f297726bf58fd4dfd3ed2725af891952835.tar.gz
meta-impy-7b5e0f297726bf58fd4dfd3ed2725af891952835.tar.bz2
meta-impy-7b5e0f297726bf58fd4dfd3ed2725af891952835.tar.xz
Fix #700: View -> Web Browser does nothing
Also made the "Home" and "Set Home" buttons work. "Send current URL to parcel" is still broken in SL, since it relies on the ParcelNavigateMedia capability which was never implemented by LL.
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloatermediabrowser.cpp43
1 files changed, 41 insertions, 2 deletions
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{