diff options
author | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
commit | c07901e29ed545bbb02e3bddf148fe1104b94e9f (patch) | |
tree | f1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/newview/llpreviewscript.cpp | |
parent | Second Life viewer sources 1.15.0.2 (diff) | |
download | meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.zip meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.gz meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.bz2 meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.xz |
Second Life viewer sources 1.15.1.3
Diffstat (limited to 'linden/indra/newview/llpreviewscript.cpp')
-rw-r--r-- | linden/indra/newview/llpreviewscript.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp index 39938d4..86c78a5 100644 --- a/linden/indra/newview/llpreviewscript.cpp +++ b/linden/indra/newview/llpreviewscript.cpp | |||
@@ -470,12 +470,14 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) | |||
470 | LLFloater* help_floater = LLFloater::getFloaterByHandle(mLiveHelpHandle); | 470 | LLFloater* help_floater = LLFloater::getFloaterByHandle(mLiveHelpHandle); |
471 | if (!help_floater) return; | 471 | if (!help_floater) return; |
472 | 472 | ||
473 | #if LL_LIBXUL_ENABLED | ||
473 | // update back and forward buttons | 474 | // update back and forward buttons |
474 | LLButton* fwd_button = LLUICtrlFactory::getButtonByName(help_floater, "fwd_btn"); | 475 | LLButton* fwd_button = LLUICtrlFactory::getButtonByName(help_floater, "fwd_btn"); |
475 | LLButton* back_button = LLUICtrlFactory::getButtonByName(help_floater, "back_btn"); | 476 | LLButton* back_button = LLUICtrlFactory::getButtonByName(help_floater, "back_btn"); |
476 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(help_floater, "lsl_guide_html"); | 477 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(help_floater, "lsl_guide_html"); |
477 | back_button->setEnabled(browser->canNavigateBack()); | 478 | back_button->setEnabled(browser->canNavigateBack()); |
478 | fwd_button->setEnabled(browser->canNavigateForward()); | 479 | fwd_button->setEnabled(browser->canNavigateForward()); |
480 | #endif // LL_LIBXUL_ENABLED | ||
479 | 481 | ||
480 | if (!immediate && !gSavedSettings.getBOOL("ScriptHelpFollowsCursor")) | 482 | if (!immediate && !gSavedSettings.getBOOL("ScriptHelpFollowsCursor")) |
481 | { | 483 | { |
@@ -521,7 +523,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) | |||
521 | mLiveHelpTimer.stop(); | 523 | mLiveHelpTimer.stop(); |
522 | } | 524 | } |
523 | } | 525 | } |
524 | else | 526 | else if (immediate) |
525 | { | 527 | { |
526 | setHelpPage(""); | 528 | setHelpPage(""); |
527 | } | 529 | } |
@@ -543,7 +545,9 @@ void LLScriptEdCore::setHelpPage(const LLString& help_string) | |||
543 | url_string.setArg("[LSL_STRING]", help_string); | 545 | url_string.setArg("[LSL_STRING]", help_string); |
544 | 546 | ||
545 | addHelpItemToHistory(help_string); | 547 | addHelpItemToHistory(help_string); |
548 | #if LL_LIBXUL_ENABLED | ||
546 | web_browser->navigateTo(url_string); | 549 | web_browser->navigateTo(url_string); |
550 | #endif // LL_LIBXUL_ENABLED | ||
547 | } | 551 | } |
548 | 552 | ||
549 | void LLScriptEdCore::addHelpItemToHistory(const LLString& help_string) | 553 | void LLScriptEdCore::addHelpItemToHistory(const LLString& help_string) |
@@ -675,8 +679,10 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) | |||
675 | live_help_floater->childSetAction("back_btn", onClickBack, userdata); | 679 | live_help_floater->childSetAction("back_btn", onClickBack, userdata); |
676 | live_help_floater->childSetAction("fwd_btn", onClickForward, userdata); | 680 | live_help_floater->childSetAction("fwd_btn", onClickForward, userdata); |
677 | 681 | ||
682 | #if LL_LIBXUL_ENABLED | ||
678 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); | 683 | LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); |
679 | browser->setAlwaysRefresh(TRUE); | 684 | browser->setAlwaysRefresh(TRUE); |
685 | #endif // LL_LIBXUL_ENABLED | ||
680 | 686 | ||
681 | LLComboBox* help_combo = LLUICtrlFactory::getComboBoxByName(live_help_floater, "history_combo"); | 687 | LLComboBox* help_combo = LLUICtrlFactory::getComboBoxByName(live_help_floater, "history_combo"); |
682 | LLKeywordToken *token; | 688 | LLKeywordToken *token; |
@@ -700,6 +706,7 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) | |||
700 | //static | 706 | //static |
701 | void LLScriptEdCore::onClickBack(void* userdata) | 707 | void LLScriptEdCore::onClickBack(void* userdata) |
702 | { | 708 | { |
709 | #if LL_LIBXUL_ENABLED | ||
703 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; | 710 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; |
704 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); | 711 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); |
705 | if (live_help_floater) | 712 | if (live_help_floater) |
@@ -710,11 +717,13 @@ void LLScriptEdCore::onClickBack(void* userdata) | |||
710 | browserp->navigateBack(); | 717 | browserp->navigateBack(); |
711 | } | 718 | } |
712 | } | 719 | } |
720 | #endif // LL_LIBXUL_ENABLED | ||
713 | } | 721 | } |
714 | 722 | ||
715 | //static | 723 | //static |
716 | void LLScriptEdCore::onClickForward(void* userdata) | 724 | void LLScriptEdCore::onClickForward(void* userdata) |
717 | { | 725 | { |
726 | #if LL_LIBXUL_ENABLED | ||
718 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; | 727 | LLScriptEdCore* corep = (LLScriptEdCore*)userdata; |
719 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); | 728 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); |
720 | if (live_help_floater) | 729 | if (live_help_floater) |
@@ -725,6 +734,7 @@ void LLScriptEdCore::onClickForward(void* userdata) | |||
725 | browserp->navigateForward(); | 734 | browserp->navigateForward(); |
726 | } | 735 | } |
727 | } | 736 | } |
737 | #endif // LL_LIBXUL_ENABLED | ||
728 | } | 738 | } |
729 | 739 | ||
730 | // static | 740 | // static |
@@ -757,16 +767,17 @@ void LLScriptEdCore::onHelpComboCommit(LLUICtrl* ctrl, void* userdata) | |||
757 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); | 767 | LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle); |
758 | if (live_help_floater) | 768 | if (live_help_floater) |
759 | { | 769 | { |
760 | LLWebBrowserCtrl* web_browser = gUICtrlFactory->getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); | ||
761 | |||
762 | LLString help_string = ctrl->getValue().asString(); | 770 | LLString help_string = ctrl->getValue().asString(); |
763 | 771 | ||
764 | corep->addHelpItemToHistory(help_string); | 772 | corep->addHelpItemToHistory(help_string); |
765 | 773 | ||
774 | #if LL_LIBXUL_ENABLED | ||
775 | LLWebBrowserCtrl* web_browser = gUICtrlFactory->getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html"); | ||
766 | LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); | 776 | LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); |
767 | url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir()); | 777 | url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir()); |
768 | url_string.setArg("[LSL_STRING]", help_string); | 778 | url_string.setArg("[LSL_STRING]", help_string); |
769 | web_browser->navigateTo(url_string); | 779 | web_browser->navigateTo(url_string); |
780 | #endif // LL_LIBXUL_ENABLED | ||
770 | } | 781 | } |
771 | } | 782 | } |
772 | 783 | ||
@@ -1336,10 +1347,6 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename, | |||
1336 | { | 1347 | { |
1337 | break; | 1348 | break; |
1338 | } | 1349 | } |
1339 | else if(!buffer) | ||
1340 | { | ||
1341 | continue; | ||
1342 | } | ||
1343 | else | 1350 | else |
1344 | { | 1351 | { |
1345 | line.assign(buffer); | 1352 | line.assign(buffer); |
@@ -1709,7 +1716,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) | |||
1709 | mScriptEd->mEditor->setEnabled(FALSE); | 1716 | mScriptEd->mEditor->setEnabled(FALSE); |
1710 | mAssetStatus = PREVIEW_ASSET_LOADED; | 1717 | mAssetStatus = PREVIEW_ASSET_LOADED; |
1711 | } | 1718 | } |
1712 | else if(mItem.notNull()) | 1719 | else if(item && mItem.notNull()) |
1713 | { | 1720 | { |
1714 | // request the text from the object | 1721 | // request the text from the object |
1715 | LLUUID* user_data = new LLUUID(mItemID ^ mObjectID); | 1722 | LLUUID* user_data = new LLUUID(mItemID ^ mObjectID); |
@@ -1835,6 +1842,7 @@ void LLLiveLSLEditor::loadScriptText(const char* filename) | |||
1835 | if(!filename) | 1842 | if(!filename) |
1836 | { | 1843 | { |
1837 | llerrs << "Filename is Empty!" << llendl; | 1844 | llerrs << "Filename is Empty!" << llendl; |
1845 | return; | ||
1838 | } | 1846 | } |
1839 | FILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ | 1847 | FILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ |
1840 | if(file) | 1848 | if(file) |
@@ -2115,10 +2123,6 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename, | |||
2115 | { | 2123 | { |
2116 | break; | 2124 | break; |
2117 | } | 2125 | } |
2118 | else if(!buffer) | ||
2119 | { | ||
2120 | continue; | ||
2121 | } | ||
2122 | else | 2126 | else |
2123 | { | 2127 | { |
2124 | line.assign(buffer); | 2128 | line.assign(buffer); |