diff options
Diffstat (limited to 'linden/indra/newview/llfloatermediabrowser.cpp')
-rw-r--r-- | linden/indra/newview/llfloatermediabrowser.cpp | 43 |
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 | ||
65 | void LLFloaterMediaBrowser::draw() | 68 | void 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 | ||
296 | void 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 | ||
310 | void 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 |
287 | void LLFloaterMediaBrowser::onClickRewind(void* user_data) | 326 | void LLFloaterMediaBrowser::onClickRewind(void* user_data) |
288 | { | 327 | { |