diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterhtmlhelp.cpp | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index f2a8374..0968734 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp | |||
@@ -34,7 +34,7 @@ | |||
34 | #include "llfloaterhtmlhelp.h" | 34 | #include "llfloaterhtmlhelp.h" |
35 | 35 | ||
36 | #include "llparcel.h" | 36 | #include "llparcel.h" |
37 | #include "llvieweruictrlfactory.h" | 37 | #include "lluictrlfactory.h" |
38 | #include "llwebbrowserctrl.h" | 38 | #include "llwebbrowserctrl.h" |
39 | #include "llviewerwindow.h" | 39 | #include "llviewerwindow.h" |
40 | #include "llviewercontrol.h" | 40 | #include "llviewercontrol.h" |
@@ -52,30 +52,27 @@ | |||
52 | 52 | ||
53 | LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data) | 53 | LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data) |
54 | { | 54 | { |
55 | gUICtrlFactory->buildFloater(this, "floater_media_browser.xml"); | 55 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_media_browser.xml"); |
56 | } | 56 | } |
57 | 57 | ||
58 | void LLFloaterMediaBrowser::draw() | 58 | void LLFloaterMediaBrowser::draw() |
59 | { | 59 | { |
60 | childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); | 60 | childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); |
61 | if ( gParcelMgr ) // this code can be called at login screen where gParcelMgr is NULL | 61 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
62 | if(parcel) | ||
62 | { | 63 | { |
63 | LLParcel* parcel = gParcelMgr->getAgentParcel(); | 64 | childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); |
64 | if(parcel) | 65 | childSetEnabled("assign", !mAddressCombo->getValue().asString().empty()); |
65 | { | 66 | } |
66 | childSetVisible("parcel_owner_controls", LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA)); | ||
67 | childSetEnabled("assign", !mAddressCombo->getValue().asString().empty()); | ||
68 | } | ||
69 | }; | ||
70 | LLFloater::draw(); | 67 | LLFloater::draw(); |
71 | } | 68 | } |
72 | 69 | ||
73 | BOOL LLFloaterMediaBrowser::postBuild() | 70 | BOOL LLFloaterMediaBrowser::postBuild() |
74 | { | 71 | { |
75 | mBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "browser"); | 72 | mBrowser = getChild<LLWebBrowserCtrl>("browser"); |
76 | mBrowser->addObserver(this); | 73 | mBrowser->addObserver(this); |
77 | 74 | ||
78 | mAddressCombo = LLUICtrlFactory::getComboBoxByName(this, "address"); | 75 | mAddressCombo = getChild<LLComboBox>("address"); |
79 | mAddressCombo->setCommitCallback(onEnterAddress); | 76 | mAddressCombo->setCommitCallback(onEnterAddress); |
80 | mAddressCombo->setCallbackUserData(this); | 77 | mAddressCombo->setCallbackUserData(this); |
81 | 78 | ||
@@ -221,7 +218,7 @@ void LLFloaterMediaBrowser::onClickAssign(void* user_data) | |||
221 | { | 218 | { |
222 | LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; | 219 | LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; |
223 | 220 | ||
224 | LLParcel* parcel = gParcelMgr->getAgentParcel(); | 221 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
225 | if (!parcel) | 222 | if (!parcel) |
226 | { | 223 | { |
227 | return; | 224 | return; |
@@ -233,7 +230,7 @@ void LLFloaterMediaBrowser::onClickAssign(void* user_data) | |||
233 | parcel->setMediaType("text/html"); | 230 | parcel->setMediaType("text/html"); |
234 | 231 | ||
235 | // Send current parcel data upstream to server | 232 | // Send current parcel data upstream to server |
236 | gParcelMgr->sendParcelPropertiesUpdate( parcel, true ); | 233 | LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel, true ); |
237 | // now check for video | 234 | // now check for video |
238 | LLViewerParcelMedia::update( parcel ); | 235 | LLViewerParcelMedia::update( parcel ); |
239 | 236 | ||
@@ -300,7 +297,7 @@ LLFloaterHtmlHelp::LLFloaterHtmlHelp(std::string start_url, std::string title) | |||
300 | sInstance = this; | 297 | sInstance = this; |
301 | 298 | ||
302 | // create floater from its XML definition | 299 | // create floater from its XML definition |
303 | gUICtrlFactory->buildFloater( this, "floater_html_help.xml" ); | 300 | LLUICtrlFactory::getInstance()->buildFloater( this, "floater_html_help.xml" ); |
304 | 301 | ||
305 | childSetAction("back_btn", onClickBack, this); | 302 | childSetAction("back_btn", onClickBack, this); |
306 | childSetAction("home_btn", onClickHome, this); | 303 | childSetAction("home_btn", onClickHome, this); |
@@ -311,7 +308,7 @@ LLFloaterHtmlHelp::LLFloaterHtmlHelp(std::string start_url, std::string title) | |||
311 | setTitle(title); | 308 | setTitle(title); |
312 | } | 309 | } |
313 | 310 | ||
314 | mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "html_help_browser" ); | 311 | mWebBrowser = getChild<LLWebBrowserCtrl>("html_help_browser" ); |
315 | if ( mWebBrowser ) | 312 | if ( mWebBrowser ) |
316 | { | 313 | { |
317 | // observe browser control events | 314 | // observe browser control events |
@@ -476,7 +473,7 @@ void LLFloaterHtmlHelp::onClickHome( void* data ) | |||
476 | if ( self ) | 473 | if ( self ) |
477 | { | 474 | { |
478 | // get the home page URL (which can differ from the start URL) from XML and go there | 475 | // get the home page URL (which can differ from the start URL) from XML and go there |
479 | LLWebBrowserCtrl* web_browser = LLViewerUICtrlFactory::getWebBrowserByName( self, "html_help_browser" ); | 476 | LLWebBrowserCtrl* web_browser = self->getChild<LLWebBrowserCtrl>("html_help_browser" ); |
480 | if ( web_browser ) | 477 | if ( web_browser ) |
481 | { | 478 | { |
482 | web_browser->navigateHome(); | 479 | web_browser->navigateHome(); |
@@ -527,14 +524,13 @@ LLViewerHtmlHelp::~LLViewerHtmlHelp() | |||
527 | LLUI::setHtmlHelp(NULL); | 524 | LLUI::setHtmlHelp(NULL); |
528 | } | 525 | } |
529 | 526 | ||
530 | void LLViewerHtmlHelp::show(std::string url, std::string title) | 527 | void LLViewerHtmlHelp::show() |
531 | { | 528 | { |
532 | LLFloaterHtmlHelp::show(url, title); | 529 | LLFloaterHtmlHelp::show("", ""); |
533 | } | 530 | } |
534 | 531 | ||
535 | BOOL LLViewerHtmlHelp::getFloaterOpened() | 532 | void LLViewerHtmlHelp::show(std::string url) |
536 | { | 533 | { |
537 | return LLFloaterHtmlHelp::sFloaterOpened; | 534 | std::string title; // empty |
535 | LLFloaterHtmlHelp::show(url, title); | ||
538 | } | 536 | } |
539 | |||
540 | |||