diff options
author | Adam Moss <moss@lindenlab.com> | 2009-09-30 17:46:31 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-09-30 17:46:31 +0000 |
commit | feabeb496518f28359f654fdc397354355743589 (patch) | |
tree | 99fa7dd202caac786d7032a2c8bd187a1f5a5ad0 | |
parent | a3ba111e39be0bfa0278dfce66f4608fac7c0aa2 (diff) |
DEV-35039 Viewer 2.0 Help System - Viewer Development
svn merge -r134800:134805 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer2help-3
48 files changed, 1005 insertions, 697 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 1e6b216a61..d7d411dee6 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -129,7 +129,7 @@ set(llui_HEADER_FILES llfocusmgr.h llfunctorregistry.h llhandle.h - llhtmlhelp.h + llhelp.h lliconctrl.h llkeywords.h lllayoutstack.h diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index fa13ced037..b9613b502c 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -39,7 +39,6 @@ #include "llstring.h" // Project includes -#include "llhtmlhelp.h" #include "llkeyboard.h" #include "llui.h" #include "lluiconstants.h" @@ -49,8 +48,10 @@ #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llwindow.h" +#include "llnotifications.h" #include "llrender.h" #include "lluictrlfactory.h" +#include "llhelp.h" static LLDefaultChildRegistry::Register<LLButton> r("button"); @@ -92,7 +93,6 @@ LLButton::Params::Params() mouse_held_callback("mouse_held_callback"), is_toggle("is_toggle", false), scale_image("scale_image", true), - help_url("help_url"), hover_glow_amount("hover_glow_amount"), commit_on_return("commit_on_return", true), picture_style("picture_style", false) @@ -173,11 +173,6 @@ LLButton::LLButton(const LLButton::Params& p) mMouseDownTimer.stop(); - if (p.help_url.isProvided()) - { - setHelpURLCallback(p.help_url); - } - // if custom unselected button image provided... if (p.image_unselected != default_params.image_unselected) { @@ -1034,24 +1029,6 @@ void LLButton::addImageAttributeToXML(LLXMLNodePtr node, } } -void clicked_help(void* data) -{ - LLButton* self = (LLButton*)data; - if (!self) return; - - if (!LLUI::sHtmlHelp) - { - return; - } - - LLUI::sHtmlHelp->show(self->getHelpURL()); -} - -void LLButton::setHelpURLCallback(const std::string &help_url) -{ - mHelpURL = help_url; - setClickedCallback(clicked_help,this); -} // static void LLButton::toggleFloaterAndSetToggleState(LLUICtrl* ctrl, const LLSD& sdname) @@ -1077,6 +1054,24 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname) button->setClickedCallback(boost::bind(&LLFloaterReg::toggleFloaterInstance, sdname)); } +// static +void LLButton::showHelp(LLUICtrl* ctrl, const LLSD& sdname) +{ + // search back through the button's parents for a panel + // with a help_topic string defined + std::string help_topic; + if (LLUI::sHelpImpl && + ctrl->findHelpTopic(help_topic)) + { + LLUI::sHelpImpl->showTopic(help_topic); + return; // success + } + + // display an error if we can't find a help_topic string. + // fix this by adding a help_topic attribute to the xui file + LLNotifications::instance().add("UnableToFindHelpTopic"); +} + void LLButton::resetMouseDownTimer() { mMouseDownTimer.stop(); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 06e1dac914..04716d605b 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -118,7 +118,6 @@ public: commit_on_return, picture_style; //if true, don't display label - Optional<std::string> help_url; Optional<F32> hover_glow_amount; Optional<TimeIntervalParam> held_down_delay; @@ -230,12 +229,10 @@ public: void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } BOOL getCommitOnReturn() const { return mCommitOnReturn; } - void setHelpURLCallback(const std::string &help_url); - const std::string& getHelpURL() const { return mHelpURL; } - static void onHeldDown(void *userdata); // to be called by gIdleCallbacks static void toggleFloaterAndSetToggleState(LLUICtrl* ctrl, const LLSD& sdname); static void setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname); + static void showHelp(LLUICtrl* ctrl, const LLSD& sdname); protected: const LLPointer<LLUIImage>& getImageUnselected() const { return mImageUnselected; } @@ -314,8 +311,6 @@ private: BOOL mCommitOnReturn; BOOL mFadeWhenDisabled; - std::string mHelpURL; - LLFrameTimer mFlashingTimer; }; diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 81915731c3..ff0288a32f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -59,6 +59,7 @@ #include "lltabcontainer.h" #include "v2math.h" #include "lltrans.h" +#include "llhelp.h" #include "llmultifloater.h" // use this to control "jumping" behavior when Ctrl-Tabbing @@ -66,48 +67,35 @@ const S32 TABBED_FLOATER_OFFSET = 0; std::string LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = { - "Icon_Close_Foreground", //BUTTON_CLOSE - "restore.tga", //BUTTON_RESTORE - "minimize.tga", //BUTTON_MINIMIZE - "tearoffbox.tga", //BUTTON_TEAR_OFF - "closebox.tga", //BUTTON_EDIT - "Icon_Dock_Foreground", - "Icon_Undock_Foreground" -}; - -// Empty string means programmatic glow effect, achieved by -// not setting explicit image. -std::string LLFloater::sButtonHoveredImageNames[BUTTON_COUNT] = -{ - "", //BUTTON_CLOSE - "restore_pressed.tga", //BUTTON_RESTORE - "minimize_pressed.tga", //BUTTON_MINIMIZE - "tearoff_pressed.tga", //BUTTON_TEAR_OFF - "close_in_blue.tga", //BUTTON_EDIT - "", //BUTTON_DOCK - "", //BUTTON_UNDOCK + "Icon_Close_Foreground", //BUTTON_CLOSE + "Icon_Restore_Foreground", //BUTTON_RESTORE + "Icon_Minimize_Foreground", //BUTTON_MINIMIZE + "tearoffbox.tga", //BUTTON_TEAR_OFF + "Icon_Dock_Foreground", //BUTTON_DOCK + "Icon_Undock_Foreground", //BUTTON_UNDOCK + "Icon_Help_Foreground" //BUTTON_HELP }; std::string LLFloater::sButtonPressedImageNames[BUTTON_COUNT] = { - "Icon_Close_Press", //BUTTON_CLOSE - "restore_pressed.tga", //BUTTON_RESTORE - "minimize_pressed.tga", //BUTTON_MINIMIZE - "tearoff_pressed.tga", //BUTTON_TEAR_OFF - "close_in_blue.tga", //BUTTON_EDIT - "Icon_Dock_Press", - "Icon_Undock_Press" + "Icon_Close_Press", //BUTTON_CLOSE + "Icon_Restore_Press", //BUTTON_RESTORE + "Icon_Minimize_Press", //BUTTON_MINIMIZE + "tearoff_pressed.tga", //BUTTON_TEAR_OFF + "Icon_Dock_Press", //BUTTON_DOCK + "Icon_Undock_Press", //BUTTON_UNDOCK + "Icon_Help_Press" //BUTTON_HELP }; std::string LLFloater::sButtonNames[BUTTON_COUNT] = { - "llfloater_close_btn", //BUTTON_CLOSE + "llfloater_close_btn", //BUTTON_CLOSE "llfloater_restore_btn", //BUTTON_RESTORE "llfloater_minimize_btn", //BUTTON_MINIMIZE "llfloater_tear_off_btn", //BUTTON_TEAR_OFF - "llfloater_edit_btn", //BUTTON_EDIT - "llfloater_dock_btn", - "llfloater_undock_btn" + "llfloater_dock_btn", //BUTTON_DOCK + "llfloater_undock_btn", //BUTTON_UNDOCK + "llfloater_help_btn" //BUTTON_HELP }; std::string LLFloater::sButtonToolTips[BUTTON_COUNT]; @@ -122,9 +110,9 @@ std::string LLFloater::sButtonToolTipsIndex[BUTTON_COUNT]= "BUTTON_RESTORE", //"Restore", //BUTTON_RESTORE "BUTTON_MINIMIZE", //"Minimize", //BUTTON_MINIMIZE "BUTTON_TEAR_OFF", //"Tear Off", //BUTTON_TEAR_OFF - "BUTTON_EDIT", //"Edit", //BUTTON_EDIT "BUTTON_DOCK", - "BUTTON_UNDOCK" + "BUTTON_UNDOCK", + "BUTTON_HELP" }; LLFloater::click_callback LLFloater::sButtonCallbacks[BUTTON_COUNT] = @@ -133,13 +121,12 @@ LLFloater::click_callback LLFloater::sButtonCallbacks[BUTTON_COUNT] = LLFloater::onClickMinimize, //BUTTON_RESTORE LLFloater::onClickMinimize, //BUTTON_MINIMIZE LLFloater::onClickTearOff, //BUTTON_TEAR_OFF - LLFloater::onClickEdit, //BUTTON_EDIT - LLFloater::onClickDock, - LLFloater::onClickDock + LLFloater::onClickDock, //BUTTON_DOCK + LLFloater::onClickDock, //BUTTON_UNDOCK + LLFloater::onClickHelp //BUTTON_HELP }; LLMultiFloater* LLFloater::sHostp = NULL; -BOOL LLFloater::sEditModeEnabled = FALSE; BOOL LLFloater::sQuitting = FALSE; // Flag to prevent storing visibility controls while quitting LLFloater::handle_map_t LLFloater::sFloaterMap; @@ -259,7 +246,6 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mMinimized(FALSE), mForeground(FALSE), mFirstLook(TRUE), - mEditing(FALSE), mButtonScale(1.0f), mAutoFocus(TRUE), // automatically take focus when opened mCanDock(false), @@ -314,6 +300,12 @@ void LLFloater::initFloater() mButtonsEnabled[BUTTON_CLOSE] = TRUE; } + // Help button: '?' + if ( !mHelpTopic.empty() ) + { + mButtonsEnabled[BUTTON_HELP] = TRUE; + } + // Minimize button only for top draggers if ( !mDragOnLeft && mCanMinimize ) { @@ -804,7 +796,7 @@ void LLFloater::setTitle( const std::string& title ) applyTitle(); } -std::string LLFloater::getTitle() +std::string LLFloater::getTitle() const { if (mTitle.empty()) { @@ -822,7 +814,7 @@ void LLFloater::setShortTitle( const std::string& short_title ) applyTitle(); } -std::string LLFloater::getShortTitle() +std::string LLFloater::getShortTitle() const { if (mShortTitle.empty()) { @@ -834,8 +826,6 @@ std::string LLFloater::getShortTitle() } } - - BOOL LLFloater::canSnapTo(const LLView* other_view) { if (NULL == other_view) @@ -1051,6 +1041,10 @@ void LLFloater::setMinimized(BOOL minimize) reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); } + // don't show the help button while minimized - it's + // not very useful when minimized and uses up space + mButtonsEnabled[BUTTON_HELP] = !minimize; + applyTitle (); make_ui_sound("UISndWindowClose"); @@ -1387,28 +1381,6 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock) } } -//static -void LLFloater::setEditModeEnabled(BOOL enable) -{ - if (enable != sEditModeEnabled) - { - S32 count = 0; - for(handle_map_iter_t iter = sFloaterMap.begin(); iter != sFloaterMap.end(); ++iter) - { - LLFloater* floater = iter->second; - if (!floater->isDead()) - { - iter->second->mButtonsEnabled[BUTTON_EDIT] = enable; - iter->second->updateButtons(); - } - count++; - } - } - - sEditModeEnabled = enable; -} - - // static void LLFloater::onClickMinimize(LLFloater* self) { @@ -1456,19 +1428,20 @@ void LLFloater::onClickTearOff(LLFloater* self) } // static -void LLFloater::onClickEdit(LLFloater* self) +void LLFloater::onClickDock(LLFloater* self) { - if (!self) - return; - self->mEditing = self->mEditing ? FALSE : TRUE; + if(self && self->mCanDock) + { + self->setDocked(!self->mDocked, true); + } } // static -void LLFloater::onClickDock(LLFloater* self) +void LLFloater::onClickHelp( LLFloater* self ) { - if(self && self->mCanDock) + if (self && LLUI::sHelpImpl) { - self->setDocked(!self->mDocked, true); + LLUI::sHelpImpl->showTopic(self->getHelpTopic()); } } @@ -1807,17 +1780,9 @@ void LLFloater::buildButtons() // Selected, no matter if hovered or not, is "pressed" p.image_selected.name(sButtonPressedImageNames[i]); p.image_hover_selected.name(sButtonPressedImageNames[i]); - // Empty string means programmatic glow effect, achieved by - // not setting explicit image. - if (sButtonHoveredImageNames[i].empty()) - { - // These icons are really small, need glow amount increased - p.hover_glow_amount( 0.22f ); - } - else - { - p.image_hover_unselected.name(sButtonHoveredImageNames[i]); - } + // Use a glow effect when the user hovers over the button + // These icons are really small, need glow amount increased + p.hover_glow_amount( 0.33f ); p.click_callback.function(boost::bind(sButtonCallbacks[i], this)); p.tab_stop(false); p.follows.flags(FOLLOWS_TOP|FOLLOWS_RIGHT); diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 513f6a6918..2a31ba4e8f 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -101,9 +101,9 @@ public: BUTTON_RESTORE, BUTTON_MINIMIZE, BUTTON_TEAR_OFF, - BUTTON_EDIT, BUTTON_DOCK, BUTTON_UNDOCK, + BUTTON_HELP, BUTTON_COUNT }; @@ -173,9 +173,9 @@ public: void applyTitle(); const std::string& getCurrentTitle() const; void setTitle( const std::string& title); - std::string getTitle(); + std::string getTitle() const; void setShortTitle( const std::string& short_title ); - std::string getShortTitle(); + std::string getShortTitle() const; void setTitleVisible(bool visible); virtual void setMinimized(BOOL b); void moveResizeHandlesToFront(); @@ -256,12 +256,10 @@ public: static void onClickClose(LLFloater* floater); static void onClickMinimize(LLFloater* floater); static void onClickTearOff(LLFloater* floater); - static void onClickEdit(LLFloater* floater); static void onClickDock(LLFloater* floater); + static void onClickHelp(LLFloater* floater); static void setFloaterHost(LLMultiFloater* hostp) {sHostp = hostp; } - static void setEditModeEnabled(BOOL enable); - static BOOL getEditModeEnabled() { return sEditModeEnabled; } static LLMultiFloater* getFloaterHost() {return sHostp; } protected: @@ -331,7 +329,6 @@ private: BOOL mFirstLook; // TRUE if the _next_ time this floater is visible will be the first time in the session that it is visible. - BOOL mEditing; typedef std::set<LLHandle<LLFloater> > handle_set_t; typedef std::set<LLHandle<LLFloater> >::iterator handle_set_iter_t; @@ -350,11 +347,8 @@ private: bool mDocked; static LLMultiFloater* sHostp; - static BOOL sEditModeEnabled; static BOOL sQuitting; static std::string sButtonActiveImageNames[BUTTON_COUNT]; - // Images to use when cursor hovered over an enabled button - static std::string sButtonHoveredImageNames[BUTTON_COUNT]; static std::string sButtonPressedImageNames[BUTTON_COUNT]; static std::string sButtonNames[BUTTON_COUNT]; static std::string sButtonToolTips[BUTTON_COUNT]; diff --git a/indra/llui/llhelp.h b/indra/llui/llhelp.h new file mode 100644 index 0000000000..c06d29a4bd --- /dev/null +++ b/indra/llui/llhelp.h @@ -0,0 +1,45 @@ +/** + * @file llhelp.h + * @brief Abstract interface to the Help system + * @author Tofu Linden + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLHELP_H +#define LL_LLHELP_H + +class LLHelp +{ + public: + virtual void showTopic(const std::string &topic) = 0; + // return default (fallback) topic name suitable for showTopic() + virtual std::string defaultTopic() = 0; +}; + +#endif // headerguard diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 26136e0a23..b9bbb4db22 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -80,6 +80,7 @@ LLPanel::Params::Params() strings("string"), filename("filename"), class_name("class"), + help_topic("help_topic"), visible_callback("visible_callback") { name = "panel"; @@ -98,6 +99,7 @@ LLPanel::LLPanel(const LLPanel::Params& p) mDefaultBtn(NULL), mBorder(NULL), mLabel(p.label), + mHelpTopic(p.help_topic), mCommitCallbackRegistrar(false), mEnableCallbackRegistrar(false), mXMLFilename(p.filename) @@ -416,6 +418,7 @@ void LLPanel::initFromParams(const LLPanel::Params& p) } setLabel(p.label()); + setHelpTopic(p.help_topic); setShape(p.rect); parseFollowsFlags(p); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 81b5b68f05..8b23ea7030 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -83,6 +83,7 @@ public: Optional<std::string> filename; Optional<std::string> class_name; + Optional<std::string> help_topic; Multiple<LocalizedString> strings; @@ -139,10 +140,11 @@ public: void updateDefaultBtn(); void setLabel(const LLStringExplicit& label) { mLabel = label; } std::string getLabel() const { return mLabel; } + void setHelpTopic(const std::string& help_topic) { mHelpTopic = help_topic; } + std::string getHelpTopic() const { return mHelpTopic; } void setCtrlsEnabled(BOOL b); - LLHandle<LLPanel> getHandle() const { return mPanelHandle; } const LLCallbackMap::map_t& getFactoryMap() const { return mFactoryMap; } @@ -243,6 +245,8 @@ protected: EnableCallbackRegistry::ScopedRegistrar mEnableCallbackRegistrar; commit_signal_t mVisibleSignal; // Called when visibility changes, passes new visibility as LLSD() + + std::string mHelpTopic; // the name of this panel's help topic to display in the Help Viewer private: LLUIColor mBgColorAlpha; @@ -259,7 +263,7 @@ private: // for setting the xml filename when building panel in context dependent cases std::string mXMLFilename; - + }; // end class LLPanel #endif diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 000e85f78c..d5b67f53b7 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -79,10 +79,10 @@ std::list<std::string> gUntranslated; /*static*/ LLUIAudioCallback LLUI::sAudioCallback = NULL; /*static*/ LLVector2 LLUI::sGLScaleFactor(1.f, 1.f); /*static*/ LLWindow* LLUI::sWindow = NULL; -/*static*/ LLHtmlHelp* LLUI::sHtmlHelp = NULL; /*static*/ LLView* LLUI::sRootView = NULL; -/*static*/ BOOL LLUI::sDirty = FALSE; -/*static*/ LLRect LLUI::sDirtyRect; +/*static*/ BOOL LLUI::sDirty = FALSE; +/*static*/ LLRect LLUI::sDirtyRect; +/*static*/ LLHelp* LLUI::sHelpImpl = NULL; /*static*/ std::vector<std::string> LLUI::sXUIPaths; /*static*/ LLFrameTimer LLUI::sMouseIdleTimer; @@ -695,44 +695,6 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre } -void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect) -{ - if (NULL == image) - { - llwarns << "image == NULL; aborting function" << llendl; - return; - } - - LLGLSUIDefault gls_ui; - - gGL.pushMatrix(); - { - gGL.translatef((F32)x, (F32)y, 0.f); - - gGL.getTexUnit(0)->bind(image); - - gGL.color4fv(color.mV); - - gGL.begin(LLRender::QUADS); - { - gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(width, height ); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(0, height ); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(0, 0); - - gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(width, 0); - } - gGL.end(); - } - gGL.popMatrix(); -} - - void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase ) { phase = fmod(phase, 1.f); @@ -1592,6 +1554,9 @@ void LLUI::initClass(const settings_map_t& settings, // Button initialization callback for toggle buttons LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2)); + // Display the help topic for the current context + LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.ShowHelp", boost::bind(&LLButton::showHelp, _1, _2)); + // Currently unused, but kept for reference: LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("Button.ToggleFloater", boost::bind(&LLButton::toggleFloaterAndSetToggleState, _1, _2)); @@ -1850,12 +1815,6 @@ LLPointer<LLUIImage> LLUI::getUIImage(const std::string& name) return NULL; } -// static -void LLUI::setHtmlHelp(LLHtmlHelp* html_help) -{ - LLUI::sHtmlHelp = html_help; -} - LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname) { for (settings_map_t::iterator itor = sSettingGroups.begin(); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index fddf8192ad..86cb516500 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -57,13 +57,13 @@ #include "llfontgl.h" class LLColor4; -class LLHtmlHelp; class LLVector3; class LLVector2; class LLUIImage; class LLUUID; class LLWindow; class LLView; +class LLHelp; // UI colors extern const LLColor4 UI_VERTEX_COLOR; @@ -104,8 +104,6 @@ void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LL void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); -// Flip vertical, used for LLFloaterHTML -void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f)); void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom); void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f ); @@ -203,7 +201,6 @@ public: static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); static void screenRectToGL(const LLRect& screen, LLRect *gl); static void glRectToScreen(const LLRect& gl, LLRect *screen); - static void setHtmlHelp(LLHtmlHelp* html_help); // Returns the control group containing the control name, or the default group static LLControlGroup& getControlControlGroup (const std::string& controlname); static F32 getMouseIdleTime() { return sMouseIdleTimer.getElapsedTimeF32(); } @@ -223,8 +220,8 @@ public: static LLUIAudioCallback sAudioCallback; static LLVector2 sGLScaleFactor; static LLWindow* sWindow; - static LLHtmlHelp* sHtmlHelp; static LLView* sRootView; + static LLHelp* sHelpImpl; private: static LLImageProviderInterface* sImageProvider; static std::vector<std::string> sXUIPaths; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 2cd9c8844e..fe99d9c267 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -762,6 +762,27 @@ LLUICtrl* LLUICtrl::getParentUICtrl() const return NULL; } +bool LLUICtrl::findHelpTopic(std::string& help_topic_out) +{ + LLUICtrl* ctrl = this; + + // search back through the control's parents for a panel + // with a help_topic string defined + while (ctrl) + { + LLPanel *panel = dynamic_cast<LLPanel *>(ctrl); + if (panel && !panel->getHelpTopic().empty()) + { + help_topic_out = panel->getHelpTopic(); + return true; // success + } + + ctrl = ctrl->getParentUICtrl(); + } + + return false; // no help topic found +} + // *TODO: Deprecate; for backwards compatability only: boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data) { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 0ca3acfa1c..c2502732f3 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -223,6 +223,10 @@ public: LLUICtrl* getParentUICtrl() const; + // return true if help topic found by crawling through parents - + // topic then put in help_topic_out + bool findHelpTopic(std::string& help_topic_out); + boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb ) { return mCommitSignal.connect(cb); } boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb ) { return mValidateSignal.connect(cb); } diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index 3b689b93c0..f3401f91f7 100644 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -134,4 +134,3 @@ void LLUrlAction::copyLabelToClipboard(std::string url) LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(match.getLabel())); } } - diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e4e4d8a2fa..b74f67e72e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -169,9 +169,8 @@ set(viewer_SOURCE_FILES llfloatergroups.cpp llfloaterhandler.cpp llfloaterhardwaresettings.cpp - llfloaterhtmlcurrency.cpp + llfloaterhelpbrowser.cpp llfloatermediabrowser.cpp - llfloaterhtmlsimple.cpp llfloaterhud.cpp llfloaterimagepreview.cpp llfloaterinspect.cpp @@ -426,6 +425,8 @@ set(viewer_SOURCE_FILES llviewerfloaterreg.cpp llviewergenericmessage.cpp llviewergesture.cpp + llviewerhelp.cpp + llviewerhelputil.cpp llviewerinventory.cpp llviewerjointattachment.cpp llviewerjoint.cpp @@ -632,9 +633,8 @@ set(viewer_HEADER_FILES llfloatergroups.h llfloaterhandler.h llfloaterhardwaresettings.h - llfloaterhtmlcurrency.h + llfloaterhelpbrowser.h llfloatermediabrowser.h - llfloaterhtmlsimple.h llfloaterhud.h llfloaterimagepreview.h llfloaterinspect.h @@ -891,6 +891,7 @@ set(viewer_HEADER_FILES llviewerfloaterreg.h llviewergenericmessage.h llviewergesture.h + llviewerhelp.h llviewerinventory.h llviewerjoint.h llviewerjointattachment.h @@ -1526,6 +1527,7 @@ endif (INSTALL) include(LLAddBuildTest) SET(viewer_TEST_SOURCE_FILES llagentaccess.cpp + llviewerhelputil.cpp ) set_source_files_properties( ${viewer_TEST_SOURCE_FILES} diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 19d503390c..8cbe6d20c6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3542,28 +3542,28 @@ <string>S32</string> <key>Value</key> <integer>400</integer> - </map> - <key>HelpHomeURL</key> + </map> + <key>HelpUseLocal</key> <map> <key>Comment</key> - <string>URL of initial help page</string> + <string>If set, always use this for help: skins/default/html/[LANGUAGE]/help-offline/index.html</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> - <string>String</string> + <string>Boolean</string> <key>Value</key> - <string>help/index.html</string> + <integer>0</integer> </map> - <key>HelpLastVisitedURL</key> + <key>HelpURLFormat</key> <map> <key>Comment</key> - <string>URL of last help page, will be shown next time help is accessed</string> + <string>URL pattern for help page; arguments will be encoded; see llviewerhelp.cpp:buildHelpURL for arguments</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>String</string> <key>Value</key> - <string>help/index.html</string> + <string>http://www.google.com/search?q=site%3Awiki.secondlife.com+[TOPIC]&ignore_channel=[CHANNEL]&ignore_version=[VERSION]&ignore_os=[OS]&ignore_language=[LANGUAGE]&ignore_version_major=[VERSION_MAJOR]&ignore_version_minor=[VERSION_MINOR]&ignore_version_patch=[VERSION_PATCH]&ignore_version_build=[VERSION_BUILD]</string> </map> <key>HighResSnapshot</key> <map> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 355660faa5..30e0a5770c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -67,6 +67,7 @@ #include "llviewerobjectlist.h" #include "llworldmap.h" #include "llmutelist.h" +#include "llviewerhelp.h" #include "lluicolortable.h" #include "llurldispatcher.h" #include "llurlhistory.h" @@ -663,8 +664,6 @@ bool LLAppViewer::init() mNumSessions++; gSavedSettings.setS32("NumSessions", mNumSessions); - gSavedSettings.setString("HelpLastVisitedURL",gSavedSettings.getString("HelpHomeURL")); - if (gSavedSettings.getBOOL("VerboseLogs")) { LLError::setPrintLocation(true); @@ -694,6 +693,9 @@ bool LLAppViewer::init() LLUrlAction::setOpenURLExternalCallback(&LLWeb::loadURLExternal); LLUrlAction::setExecuteSLURLCallback(&LLURLDispatcher::dispatchFromTextEditor); + // Let code in llui access the viewer help floater + LLUI::sHelpImpl = LLViewerHelp::getInstance(); + // Set the link color for any Urls in text fields LLTextBase::setLinkColor( LLUIColorTable::instance().getColor("HTMLLinkColor") ); diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 14fb93df61..ca43f41d05 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -66,7 +66,6 @@ #include "lllogchat.h" #include "lltexteditor.h" #include "lltextparser.h" -#include "llfloaterhtml.h" #include "llweb.h" #include "llstylemap.h" diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp new file mode 100644 index 0000000000..d67b26d36c --- /dev/null +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -0,0 +1,138 @@ +/** + * @file llfloaterhelpbrowser.cpp + * @brief HTML Help floater - uses embedded web browser control + * + * $LicenseInfo:firstyear=2006&license=viewergpl$ + * + * Copyright (c) 2006-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterhelpbrowser.h" + +#include "llfloaterreg.h" +#include "llpluginclassmedia.h" +#include "llmediactrl.h" +#include "llviewerwindow.h" +#include "llviewercontrol.h" +#include "llweb.h" +#include "llui.h" + +#include "llurlhistory.h" +#include "llmediactrl.h" +#include "llviewermedia.h" + + +LLFloaterHelpBrowser::LLFloaterHelpBrowser(const LLSD& key) + : LLFloater(key) +{ + // really really destroy the help browser when it's closed, it'll be recreated. + // *TODO: when onClose() is resurrected as a virtual, this bind can go away. + mCloseSignal.connect(boost::bind(&LLFloaterHelpBrowser::onClose, this)); +} + +BOOL LLFloaterHelpBrowser::postBuild() +{ + mBrowser = getChild<LLMediaCtrl>("browser"); + mBrowser->addObserver(this); + + childSetAction("open_browser", onClickOpenWebBrowser, this); + + buildURLHistory(); + return TRUE; +} + +void LLFloaterHelpBrowser::buildURLHistory() +{ + // Get all of the entries in the "browser" collection + LLSD browser_history = LLURLHistory::getURLHistory("browser"); + + // initialize URL history in the plugin + mBrowser->getMediaPlugin()->initializeUrlHistory(browser_history); +} + +void LLFloaterHelpBrowser::onClose() +{ + destroy(); // really destroy this dialog on closure, it's relatively heavyweight. +} + +void LLFloaterHelpBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if(event == MEDIA_EVENT_LOCATION_CHANGED) + { + setCurrentURL(self->getLocation()); + } + else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) + { + // nothing yet + } +} + +void LLFloaterHelpBrowser::setCurrentURL(const std::string& url) +{ + mCurrentURL = url; + + // redirects will navigate momentarily to about:blank, don't add to history + if (mCurrentURL != "about:blank") + { + // Serialize url history + LLURLHistory::removeURL("browser", mCurrentURL); + LLURLHistory::addURL("browser", mCurrentURL); + } +} + +//static +void LLFloaterHelpBrowser::onClickClose(void* user_data) +{ + LLFloaterHelpBrowser* self = (LLFloaterHelpBrowser*)user_data; + + self->closeFloater(); +} + +//static +void LLFloaterHelpBrowser::onClickOpenWebBrowser(void* user_data) +{ + LLFloaterHelpBrowser* self = (LLFloaterHelpBrowser*)user_data; + + std::string url = self->mCurrentURL.empty() ? + self->mBrowser->getHomePageUrl() : + self->mCurrentURL; + LLWeb::loadURLExternal(url); +} + +void LLFloaterHelpBrowser::openMedia(const std::string& media_url) +{ + mBrowser->setHomePageUrl(media_url); + //mBrowser->navigateTo("data:text/html;charset=utf-8,I'd really love to be going to:<br><b>" + media_url + "</b>"); // tofu HACK for debugging =:) + mBrowser->navigateTo(media_url); + setCurrentURL(media_url); +} + +void LLFloaterHelpBrowser::navigateToLocalPage( const std::string& subdir, const std::string& filename_in ) +{ + mBrowser->navigateToLocalPage(subdir, filename_in); +} diff --git a/indra/newview/llfloaterhelpbrowser.h b/indra/newview/llfloaterhelpbrowser.h new file mode 100644 index 0000000000..14a276b428 --- /dev/null +++ b/indra/newview/llfloaterhelpbrowser.h @@ -0,0 +1,72 @@ +/** + * @file llfloatermediabrowser.h + * @brief HTML Help floater - uses embedded web browser control + * + * $LicenseInfo:firstyear=2006&license=viewergpl$ + * + * Copyright (c) 2006-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERHELPBROWSER_H +#define LL_LLFLOATERHELPBROWSER_H + +#include "llfloater.h" +#include "llmediactrl.h" + + +class LLMediaCtrl; + +class LLFloaterHelpBrowser : + public LLFloater, + public LLViewerMediaObserver +{ + public: + LLFloaterHelpBrowser(const LLSD& key); + + /*virtual*/ BOOL postBuild(); + void onClose(); + + // inherited from LLViewerMediaObserver + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + + void openMedia(const std::string& media_url); + + void navigateToLocalPage( const std::string& subdir, const std::string& filename_in ); + + private: + void buildURLHistory(); + void setCurrentURL(const std::string& url); + + static void onClickClose(void* user_data); + static void onClickOpenWebBrowser(void* user_data); + + private: + LLMediaCtrl* mBrowser; + std::string mCurrentURL; +}; + +#endif // LL_LLFLOATERHELPBROWSER_H + diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp index c580cdef8a..c7ec4bd585 100644 --- a/indra/newview/llfloatermediabrowser.cpp +++ b/indra/newview/llfloatermediabrowser.cpp @@ -1,6 +1,6 @@ /** - * @file llfloaterhtmlhelp.cpp - * @brief HTML Help floater - uses embedded web browser control + * @file llfloatermediabrowser.cpp + * @brief media browser floater - uses embedded media browser control * * $LicenseInfo:firstyear=2006&license=viewergpl$ * @@ -33,7 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "llfloatermediabrowser.h" -#include "llfloaterhtml.h" #include "llfloaterreg.h" #include "llparcel.h" @@ -330,69 +329,3 @@ void LLFloaterMediaBrowser::openMedia(const std::string& media_url) mBrowser->navigateTo(media_url); setCurrentURL(media_url); } -//////////////////////////////////////////////////////////////////////////////// -// - -LLViewerHtmlHelp gViewerHtmlHelp; - - -//////////////////////////////////////////////////////////////////////////////// -// -LLViewerHtmlHelp::LLViewerHtmlHelp() -{ - - LLUI::setHtmlHelp(this); -} - -LLViewerHtmlHelp::~LLViewerHtmlHelp() -{ - - LLUI::setHtmlHelp(NULL); -} - -void LLViewerHtmlHelp::show() -{ - show(""); -} - -void LLViewerHtmlHelp::show(std::string url) -{ - LLFloaterMediaBrowser* floater_html = dynamic_cast<LLFloaterMediaBrowser*>(LLFloaterReg::getInstance("media_browser")); - floater_html->setVisible(FALSE); - - if (url.empty()) - { - url = floater_html->getSupportURL(); - } - - if (gSavedSettings.getBOOL("UseExternalBrowser")) - { - LLSD notificationData; - notificationData["url"] = url; - - LLNotifications::instance().add("ClickOpenF1Help", notificationData, LLSD(), onClickF1HelpLoadURL); - floater_html->closeFloater(); - } - else - { - // don't wait, just do it - floater_html->setVisible(TRUE); - floater_html->openMedia(url); - } -} - -// static -bool LLViewerHtmlHelp::onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response) -{ - LLFloaterMediaBrowser* floater_html = dynamic_cast<LLFloaterMediaBrowser*>(LLFloaterReg::getInstance("media_browser")); - floater_html->setVisible(FALSE); - std::string url = floater_html->getSupportURL(); - S32 option = LLNotification::getSelectedOption(notification, response); - if (option == 0) - { - LLWeb::loadURL(url); - } - floater_html->closeFloater(); - return false; -} - diff --git a/indra/newview/llfloatermediabrowser.h b/indra/newview/llfloatermediabrowser.h index 76e8b517a0..c315f9e797 100644 --- a/indra/newview/llfloatermediabrowser.h +++ b/indra/newview/llfloatermediabrowser.h @@ -1,6 +1,6 @@ /** * @file llfloatermediabrowser.h - * @brief HTML Help floater - uses embedded web browser control + * @brief media browser floater - uses embedded media browser control * * $LicenseInfo:firstyear=2006&license=viewergpl$ * @@ -33,23 +33,9 @@ #ifndef LL_LLFLOATERMEDIABROWSER_H #define LL_LLFLOATERMEDIABROWSER_H -#include "llhtmlhelp.h" #include "llfloater.h" #include "llmediactrl.h" -class LLViewerHtmlHelp : public LLHtmlHelp -{ -public: - LLViewerHtmlHelp(); - virtual ~LLViewerHtmlHelp(); - - /*virtual*/ void show(); - /*virtual*/ void show(std::string start_url); - void show(std::string start_url, std::string title); - - static bool onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response); - -}; class LLComboBox; class LLMediaCtrl; @@ -93,7 +79,5 @@ private: std::string mCurrentURL; }; -extern LLViewerHtmlHelp gViewerHtmlHelp; - #endif // LL_LLFLOATERMEDIABROWSER_H diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 4d154c4cd3..3dcdc2f56e 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -1,6 +1,6 @@ /** * @file llfloaterreporter.cpp - * @brief Bug and abuse reports. + * @brief Abuse reports. * * $LicenseInfo:firstyear=2002&license=viewergpl$ * @@ -220,8 +220,7 @@ LLFloaterReporter::~LLFloaterReporter() void LLFloaterReporter::draw() { // this is set by a static callback sometime after the dialog is created. - // Only disable screenshot for abuse reports to estate owners - bug reports always - // allow screenshots to be taken. + // Only disable screenshot for abuse reports to estate owners if ( mEmailToEstateOwner ) { childSetValue("screen_check", FALSE ); @@ -479,15 +478,6 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) if (f) { f->setReportType(report_type); - - if (report_type == BUG_REPORT) - { - LLNotifications::instance().add("HelpReportBug"); - } - else - { - // popup for abuse reports is triggered elsewhere - } } } @@ -528,14 +518,7 @@ bool LLFloaterReporter::validateReport() U8 category = (U8)category_sd.asInteger(); if (category == 0) { - if ( mReportType != BUG_REPORT ) - { - LLNotifications::instance().add("HelpReportAbuseSelectCategory"); - } - else - { - LLNotifications::instance().add("HelpReportBugSelectCategory"); - } + LLNotifications::instance().add("HelpReportAbuseSelectCategory"); return false; } @@ -561,27 +544,13 @@ bool LLFloaterReporter::validateReport() if ( childGetText("summary_edit").empty() ) { - if ( mReportType != BUG_REPORT ) - { - LLNotifications::instance().add("HelpReportAbuseSummaryEmpty"); - } - else - { - LLNotifications::instance().add("HelpReportBugSummaryEmpty"); - } + LLNotifications::instance().add("HelpReportAbuseSummaryEmpty"); return false; }; if ( childGetText("details_edit") == mDefaultSummary ) { - if ( mReportType != BUG_REPORT ) - { - LLNotifications::instance().add("HelpReportAbuseDetailsEmpty"); - } - else - { - LLNotifications::instance().add("HelpReportBugDetailsEmpty"); - } + LLNotifications::instance().add("HelpReportAbuseDetailsEmpty"); return false; }; return true; diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index f363b9531e..7e8f05e3fc 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -1,7 +1,7 @@ /** * @file llfloaterreporter.h * @author Andrew Meadows - * @brief Bug and abuse reports. + * @brief Abuse reports. * * $LicenseInfo:firstyear=2006&license=viewergpl$ * @@ -48,7 +48,7 @@ class LLMeanCollisionData; struct LLResourceData; // these flags are used to label info requests to the server -const U32 BUG_REPORT_REQUEST = 0x01 << 0; +//const U32 BUG_REPORT_REQUEST = 0x01 << 0; // DEPRECATED const U32 COMPLAINT_REPORT_REQUEST = 0x01 << 1; const U32 OBJECT_PAY_REQUEST = 0x01 << 2; @@ -73,7 +73,7 @@ enum EReportType { NULL_REPORT = 0, // don't use this value anywhere UNKNOWN_REPORT = 1, - BUG_REPORT = 2, + //BUG_REPORT = 2, // DEPRECATED COMPLAINT_REPORT = 3, CS_REQUEST_REPORT = 4 }; diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 09a7edaa43..6ec098b92b 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -36,7 +36,6 @@ #include "llmediactrl.h" // viewer includes -#include "llfloaterhtml.h" #include "llfloaterworldmap.h" #include "lluictrlfactory.h" #include "llurldispatcher.h" @@ -898,15 +897,7 @@ void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self ) if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 || LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 ) { - // If we spawn a new LLFloaterHTML, assume we want it to - // follow this LLMediaCtrl's trust for whether or - // not to open secondlife:///app/ links. JC. -// const bool open_links_externally = false; -// LLFloaterHtml::getInstance()->show( -// event_in.mStringPayload, -// "Second Life Browser", -// open_links_externally, -// mTrusted); + llwarns << "Dead, unimplemented path that we used to send to the built-in browser long ago." << llendl; } } } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 809e1852f4..daf0fbd5e0 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -57,6 +57,7 @@ #include "lluiconstants.h" #include "llurlsimstring.h" #include "llviewerbuild.h" +#include "llviewerhelp.h" #include "llviewertexturelist.h" #include "llviewermenu.h" // for handle_preferences() #include "llviewernetwork.h" @@ -69,7 +70,6 @@ #include "llmediactrl.h" #include "llrootview.h" -#include "llfloatermediabrowser.h" #include "llfloatertos.h" #include "lltrans.h" #include "llglheaders.h" @@ -412,8 +412,8 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask) if ( KEY_F1 == key ) { - llinfos << "Spawning HTML help window" << llendl; - gViewerHtmlHelp.show(); + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + vhelp->showTopic(vhelp->getTopicFromFocus()); return TRUE; } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 0ecdec65d6..19bb60b237 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -44,6 +44,7 @@ #include "llinventorymodel.h" #include "llkeyboard.h" #include "lllineeditor.h" +#include "llhelp.h" #include "llresmgr.h" #include "llscrollbar.h" @@ -103,7 +104,7 @@ const std::string HELLO_LSL = " llSay(0, \"Touched.\");\n" " }\n" "}\n"; -const std::string HELP_LSL_URL = "http://wiki.secondlife.com/wiki/LSL_Portal"; +const std::string HELP_LSL_PORTAL_TOPIC = "LSL_Portal"; const std::string DEFAULT_SCRIPT_NAME = "New Script"; // *TODO:Translate? const std::string DEFAULT_SCRIPT_DESC = "(No Description)"; // *TODO:Translate? @@ -264,7 +265,6 @@ struct LLSECKeywordCompare LLScriptEdCore::LLScriptEdCore( const std::string& sample, - const std::string& help_url, const LLHandle<LLFloater>& floater_handle, void (*load_callback)(void*), void (*save_callback)(void*, BOOL), @@ -274,7 +274,6 @@ LLScriptEdCore::LLScriptEdCore( : LLPanel(), mSampleText(sample), - mHelpURL(help_url), mEditor( NULL ), mLoadCallback( load_callback ), mSaveCallback( save_callback ), @@ -436,7 +435,7 @@ void LLScriptEdCore::initMenu() menuItem = getChild<LLMenuItemCallGL>("Help..."); menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnHelp, this)); - menuItem = getChild<LLMenuItemCallGL>("LSL Wiki Help..."); + menuItem = getChild<LLMenuItemCallGL>("Keyword Help..."); menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnDynamicHelp, this)); } @@ -539,9 +538,12 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) mLiveHelpTimer.stop(); } } - else if (immediate) + else { - setHelpPage(LLStringUtil::null); + if (immediate) + { + setHelpPage(LLStringUtil::null); + } } } @@ -557,6 +559,7 @@ void LLScriptEdCore::setHelpPage(const std::string& help_string) if (!history_combo) return; LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); + url_string.setArg("[LSL_STRING]", help_string); addHelpItemToHistory(help_string); @@ -647,69 +650,52 @@ bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLS return false; } -// static -bool LLScriptEdCore::onHelpWebDialog(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - - switch(option) - { - case 0: - LLWeb::loadURL(notification["payload"]["help_url"]); - break; - default: - break; - } - return false; -} - void LLScriptEdCore::onBtnHelp() { - LLSD payload; - payload["help_url"] = mHelpURL; - LLNotifications::instance().add("WebLaunchLSLGuide", LLSD(), payload, onHelpWebDialog); + LLUI::sHelpImpl->showTopic(HELP_LSL_PORTAL_TOPIC); } void LLScriptEdCore::onBtnDynamicHelp() { LLFloater* live_help_floater = mLiveHelpHandle.get(); - if (live_help_floater) - { - live_help_floater->setFocus(TRUE); - updateDynamicHelp(TRUE); + if (!live_help_floater) + { + live_help_floater = new LLFloater(LLSD()); + LLUICtrlFactory::getInstance()->buildFloater(live_help_floater, "floater_lsl_guide.xml", NULL); + LLFloater* parent = dynamic_cast<LLFloater*>(getParent()); + parent->addDependentFloater(live_help_floater, TRUE); + live_help_floater->childSetCommitCallback("lock_check", onCheckLock, this); + live_help_floater->childSetValue("lock_check", gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); + live_help_floater->childSetCommitCallback("history_combo", onHelpComboCommit, this); + live_help_floater->childSetAction("back_btn", onClickBack, this); + live_help_floater->childSetAction("fwd_btn", onClickForward, this); + + LLMediaCtrl* browser = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html"); + browser->setAlwaysRefresh(TRUE); + + LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo"); + LLKeywordToken *token; + LLKeywords::keyword_iterator_t token_it; + for (token_it = mEditor->keywordsBegin(); + token_it != mEditor->keywordsEnd(); + ++token_it) + { + token = token_it->second; + help_combo->add(wstring_to_utf8str(token->getToken())); + } + help_combo->sortByName(); - return; + // re-initialize help variables + mLastHelpToken = NULL; + mLiveHelpHandle = live_help_floater->getHandle(); + mLiveHelpHistorySize = 0; } - live_help_floater = new LLFloater(LLSD()); - LLUICtrlFactory::getInstance()->buildFloater(live_help_floater, "floater_lsl_guide.xml", NULL); - LLFloater* parent = dynamic_cast<LLFloater*>(getParent()); - parent->addDependentFloater(live_help_floater, TRUE); - live_help_floater->childSetCommitCallback("lock_check", onCheckLock, this); - live_help_floater->childSetValue("lock_check", gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); - live_help_floater->childSetCommitCallback("history_combo", onHelpComboCommit, this); - live_help_floater->childSetAction("back_btn", onClickBack, this); - live_help_floater->childSetAction("fwd_btn", onClickForward, this); - - LLMediaCtrl* browser = live_help_floater->getChild<LLMediaCtrl>("lsl_guide_html"); - browser->setAlwaysRefresh(TRUE); - - LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo"); - LLKeywordToken *token; - LLKeywords::keyword_iterator_t token_it; - for (token_it = mEditor->keywordsBegin(); - token_it != mEditor->keywordsEnd(); - ++token_it) - { - token = token_it->second; - help_combo->add(wstring_to_utf8str(token->getToken())); - } - help_combo->sortByName(); + BOOL visible = TRUE; + BOOL take_focus = TRUE; + live_help_floater->setVisible(visible); + live_help_floater->setFrontmost(take_focus); - // re-initialize help variables - mLastHelpToken = NULL; - mLiveHelpHandle = live_help_floater->getHandle(); - mLiveHelpHistorySize = 0; updateDynamicHelp(TRUE); } @@ -945,7 +931,6 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) self->mScriptEd = new LLScriptEdCore( HELLO_LSL, - HELP_LSL_URL, self->getHandle(), LLPreviewLSL::onLoad, LLPreviewLSL::onSave, @@ -1411,7 +1396,6 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) self->mScriptEd = new LLScriptEdCore( HELLO_LSL, - HELP_LSL_URL, self->getHandle(), &LLLiveLSLEditor::onLoad, &LLLiveLSLEditor::onSave, diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 623886101a..a00f580e32 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -64,7 +64,6 @@ class LLScriptEdCore : public LLPanel public: LLScriptEdCore( const std::string& sample, - const std::string& help_url, const LLHandle<LLFloater>& floater_handle, void (*load_callback)(void* userdata), void (*save_callback)(void* userdata, BOOL close_after_save), @@ -86,7 +85,6 @@ public: bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); bool handleReloadFromServerDialog(const LLSD& notification, const LLSD& response); - static bool onHelpWebDialog(const LLSD& notification, const LLSD& response); static void onCheckLock(LLUICtrl*, void*); static void onHelpComboCommit(LLUICtrl* ctrl, void* userdata); static void onClickBack(void* userdata); @@ -116,7 +114,6 @@ protected: private: std::string mSampleText; - std::string mHelpURL; LLTextEditor* mEditor; void (*mLoadCallback)(void* userdata); void (*mSaveCallback)(void* userdata, BOOL close_after_save); @@ -124,7 +121,6 @@ private: void* mUserdata; LLComboBox *mFunctions; BOOL mForceClose; - //LLPanel* mGuiPanel; LLPanel* mCodePanel; LLScrollListCtrl* mErrorList; LLDynamicArray<LLEntryAndEdCore*> mBridges; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 6a55b571ae..053b863b6d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1429,6 +1429,17 @@ bool idle_startup() LLStartUp::deletePasswordFromDisk(); } + // this is the base used to construct help URLs + text = LLUserAuth::getInstance()->getResponse("help_url_format"); + if (!text.empty()) + { + // replace the default help URL format + gSavedSettings.setString("HelpURLFormat",text); + + // don't fall back to Nebraska's pre-connection static help + gSavedSettings.setBOOL("HelpUseLocal", false); + } + // this is their actual ability to access content text = LLUserAuth::getInstance()->getResponse("agent_access_max"); if (!text.empty()) diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 901d0594f1..e7a8ad6605 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -37,7 +37,7 @@ #include "llagent.h" // teleportViaLocation() #include "llcommandhandler.h" #include "llfloaterdirectory.h" -#include "llfloatermediabrowser.h" +#include "llfloaterhelpbrowser.h" #include "llfloaterreg.h" #include "llfloaterurldisplay.h" #include "llfloaterworldmap.h" @@ -105,7 +105,7 @@ bool LLURLDispatcherImpl::dispatchCore(const std::string& url, bool trusted_browser) { if (url.empty()) return false; - if (dispatchHelp(url, right_mouse)) return true; + //if (dispatchHelp(url, right_mouse)) return true; if (dispatchApp(url, right_mouse, web, trusted_browser)) return true; if (dispatchRegion(url, right_mouse)) return true; @@ -140,19 +140,6 @@ bool LLURLDispatcherImpl::dispatchRightClick(const std::string& url) } // static -bool LLURLDispatcherImpl::dispatchHelp(const std::string& url, bool right_mouse) -{ -#if LL_LIBXUL_ENABLED - if (LLSLURL::isURLHelp(url)) - { - gViewerHtmlHelp.show(); - return true; - } -#endif - return false; -} - -// static bool LLURLDispatcherImpl::dispatchApp(const std::string& url, bool right_mouse, LLMediaCtrl* web, diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 51d699c0f7..725ed57d20 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -65,7 +65,7 @@ #include "llfloatergodtools.h" #include "llfloatergroups.h" #include "llfloaterhardwaresettings.h" -#include "llfloaterhtmlcurrency.h" +#include "llfloaterhelpbrowser.h" #include "llfloatermediabrowser.h" #include "llfloaterhud.h" #include "llfloaterimagepreview.h" @@ -164,8 +164,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("god_tools", "floater_god_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGodTools>); LLFloaterReg::add("group_picker", "floater_choose_group.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGroupPicker>); + LLFloaterReg::add("help_browser", "floater_help_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHelpBrowser>); LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>); - LLFloaterReg::add("html_simple", "floater_html_simple.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHtmlSimple>); LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>); LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventory>); @@ -244,11 +244,6 @@ void LLViewerFloaterReg::registerFloaters() // debug use only LLFloaterReg::add("media_remote_ctrl", "floater_media_remote.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaRemoteCtrl>); - - // Untested / dangerous - not for release -#if !LL_RELEASE_FOR_DOWNLOAD - LLFloaterReg::add("buy_currency_html", "floater_html_simple.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHtmlCurrency>); -#endif LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving } diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp new file mode 100644 index 0000000000..0e0727e382 --- /dev/null +++ b/indra/newview/llviewerhelp.cpp @@ -0,0 +1,125 @@ +/** + * @file llviewerhelp.cpp + * @brief Utility functions for the Help system + * @author Tofu Linden + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterhelpbrowser.h" +#include "llfloaterreg.h" +#include "llfocusmgr.h" +#include "llviewercontrol.h" +#include "llversionviewer.h" +#include "llappviewer.h" + +#include "llviewerhelputil.h" +#include "llviewerhelp.h" + + +////////////////////////////// +// implement LLHelp interface + +void LLViewerHelp::showTopic(const std::string &topic) +{ + showHelp(); + + if( gSavedSettings.getBOOL("HelpUseLocal") ) + { + LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); + helpbrowser->navigateToLocalPage( "help-offline" , "index.html" ); + } + else + { + const LLOSInfo& osinfo = LLAppViewer::instance()->getOSInfo(); + std::string helpURL = LLViewerHelpUtil::buildHelpURL( topic, gSavedSettings, osinfo ); + setRawURL( helpURL ); + } +} + +std::string LLViewerHelp::defaultTopic() +{ + // *hack: to be done properly + return "this_is_fallbacktopic"; +} + +////////////////////////////// +// our own interfaces + +std::string LLViewerHelp::getTopicFromFocus() +{ + // use UI element with viewer's keyboard focus as basis for searching + LLUICtrl* focused = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); + + if (focused) + { + std::string topic; + if (focused->findHelpTopic(topic)) + { + return topic; + } + } + + // didn't find a help topic in the UI hierarchy for focused + // element, return the fallback topic name instead. + return defaultTopic(); +} + +// static +void LLViewerHelp::showHelp() +{ + LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); + if (helpbrowser) + { + BOOL visible = TRUE; + BOOL take_focus = TRUE; + helpbrowser->setVisible(visible); + helpbrowser->setFrontmost(take_focus); + } + else + { + llwarns << "Eep, help_browser floater not found" << llendl; + } +} + +// static +void LLViewerHelp::setRawURL(std::string url) +{ + LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); + if (helpbrowser) + { + helpbrowser->openMedia(url); + } + else + { + llwarns << "Eep, help_browser floater not found" << llendl; + } +} + diff --git a/indra/newview/llviewerhelp.h b/indra/newview/llviewerhelp.h new file mode 100644 index 0000000000..17aab6f239 --- /dev/null +++ b/indra/newview/llviewerhelp.h @@ -0,0 +1,65 @@ +/** + * @file llviewerhelp.h + * @brief Utility functions for the Help system + * @author Tofu Linden + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLVIEWERHELP_H +#define LL_LLVIEWERHELP_H + +// The Help UI lives in llfloaterhelpbrowser, llviewerhelp provides a +// layer of abstraction that protects help-system-using code from the details of +// the Help UI floater and how help topics are converted into URLs. + +#include "llhelp.h" // our abstract base +#include "llsingleton.h" + +class LLUICtrl; + +class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> +{ + friend class LLSingleton<LLViewerHelp>; + + public: + /// display the specified help topic in the help viewer + /*virtual*/ void showTopic(const std::string &topic); + + /// return default (fallback) topic name suitable for showTopic() + /*virtual*/ std::string defaultTopic(); + + // return topic derived from viewer UI focus, else default topic + std::string getTopicFromFocus(); + + private: + static void showHelp(); // make sure help UI is visible & raised + static void setRawURL(std::string url); // send URL to help UI +}; + +#endif // header guard diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp new file mode 100644 index 0000000000..c1555eacdc --- /dev/null +++ b/indra/newview/llviewerhelputil.cpp @@ -0,0 +1,114 @@ +/** + * @file llviewerhelp.cpp + * @brief Utility functions for the Help system + * @author Soft Linden + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llversionviewer.h" + +//#include "llfloaterhelpbrowser.h" +//#include "llfloaterreg.h" +//#include "llfocusmgr.h" +//#include "llviewercontrol.h" +//#include "llappviewer.h" + +#include "llstring.h" +#include "lluri.h" +#include "llsys.h" + +#include "llcontrol.h" + +#include "llviewerhelputil.h" + + +////////////////////////////////////////////// +// Build a help URL from a topic and formatter + +//static +std::string LLViewerHelpUtil::helpURLEncode( const std::string &component ) +{ + // Every character rfc3986 allows as unreserved in 2.3, minus the tilde + // which we may grant special meaning. Yay. + const char* allowed = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "-._"; + std::string escaped = LLURI::escape(component, allowed); + + return escaped; +} + +static std::string buildHelpVersion( const U32 ver_int ) +{ + std::ostringstream ver_str; + ver_str << ver_int; + return ver_str.str(); // not encoded - numbers are rfc3986-safe +} + +//static +std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic, + LLControlGroup &savedSettings, + const LLOSInfo &osinfo ) +{ + std::string helpURL = savedSettings.getString("HelpURLFormat"); + LLSD substitution; + substitution["TOPIC"] = helpURLEncode(topic); + + substitution["CHANNEL"] = helpURLEncode(savedSettings.getString("VersionChannelName")); + + // *TODO: We should put this version pattern in a central place; this and near + // equivalents are replicated in other code - what's a good location? + std::ostringstream version; + version << LL_VERSION_MAJOR << "." + << LL_VERSION_MINOR << "." + << LL_VERSION_PATCH << "." + << LL_VERSION_BUILD; + substitution["VERSION"] = helpURLEncode(version.str()); + substitution["VERSION_MAJOR"] = buildHelpVersion(LL_VERSION_MAJOR); + substitution["VERSION_MINOR"] = buildHelpVersion(LL_VERSION_MINOR); + substitution["VERSION_PATCH"] = buildHelpVersion(LL_VERSION_PATCH); + substitution["VERSION_BUILD"] = buildHelpVersion(LL_VERSION_BUILD); + + substitution["OS"] = helpURLEncode(osinfo.getOSStringSimple()); + + std::string language = savedSettings.getString("Language"); + if( language.empty() || language == "default" ) + { + language = savedSettings.getString("SystemLanguage"); + } + substitution["LANGUAGE"] = helpURLEncode(language); + + LLStringUtil::format(helpURL, substitution); + + return helpURL; +} diff --git a/indra/newview/llviewerhelputil.h b/indra/newview/llviewerhelputil.h new file mode 100644 index 0000000000..8ee0d96023 --- /dev/null +++ b/indra/newview/llviewerhelputil.h @@ -0,0 +1,49 @@ +/** + * @file llviewerhelputil.h + * @brief Utility functions for the Help system + * @author Soft Linden + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLVIEWERHELPUTIL_H +#define LL_LLVIEWERHELPUTIL_H + +class LLControlGroup; +class LLOSInfo; + +class LLViewerHelpUtil +{ + public: + static std::string helpURLEncode( const std::string &component ); + static std::string buildHelpURL( const std::string &topic, + LLControlGroup &savedSettings, + const LLOSInfo &osinfo); +}; + +#endif // header guard diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a0bd5f301b..671a62962b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -103,9 +103,6 @@ #include "llfloatergodtools.h" #include "llfloatergroupinvite.h" #include "llfloatergroups.h" -#include "llfloaterhtmlcurrency.h" -#include "llfloatermediabrowser.h" // gViewerHtmlHelp -#include "llfloaterhtmlsimple.h" #include "llfloaterhud.h" #include "llfloaterinspect.h" #include "llfloaterlagmeter.h" @@ -182,6 +179,7 @@ #include "lluuid.h" #include "llviewercamera.h" #include "llviewergenericmessage.h" +#include "llviewerhelp.h" #include "llviewertexturelist.h" // gTextureList #include "llviewerinventory.h" #include "llviewermenufile.h" // init_menu_file() @@ -375,7 +373,6 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt void dump_select_mgr(void*); void dump_inventory(void*); -void edit_ui(void*); void toggle_visibility(void*); BOOL get_visibility(void*); @@ -1247,21 +1244,6 @@ class LLAdvancedBuyCurrencyTest : public view_listener_t }; -//////////////////////// -// TOGGLE EDITABLE UI // -//////////////////////// - - -class LLAdvancedToggleEditableUI : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - edit_ui(NULL); - return true; - } -}; - - ///////////////////// // DUMP SELECT MGR // ///////////////////// @@ -5587,11 +5569,6 @@ class LLObjectEnableSitOrStand : public view_listener_t } }; -void edit_ui(void*) -{ - LLFloater::setEditModeEnabled(!LLFloater::getEditModeEnabled()); -} - void dump_select_mgr(void*) { LLSelectMgr::getInstance()->dump(); @@ -5649,8 +5626,8 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "help f1") { - llinfos << "Spawning HTML help window" << llendl; - gViewerHtmlHelp.show(); + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + vhelp->showTopic(vhelp->getTopicFromFocus()); } else if (floater_name == "complaint reporter") { @@ -7886,7 +7863,6 @@ void initialize_menus() // Advanced > UI view_listener_t::addMenu(new LLAdvancedWebBrowserTest(), "Advanced.WebBrowserTest"); view_listener_t::addMenu(new LLAdvancedBuyCurrencyTest(), "Advanced.BuyCurrencyTest"); - view_listener_t::addMenu(new LLAdvancedToggleEditableUI(), "Advanced.ToggleEditableUI"); view_listener_t::addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr"); view_listener_t::addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory"); view_listener_t::addMenu(new LLAdvancedDumpFocusHolder(), "Advanced.DumpFocusHolder"); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index c5b09403cb..7ca11d8364 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -50,7 +50,6 @@ #include "llfirstuse.h" #include "llfloaterbuyland.h" #include "llfloatergroups.h" -//#include "llfloaterhtml.h" #include "llfloatersellland.h" #include "llfloatertools.h" #include "llnotify.h" diff --git a/indra/newview/skins/default/html/en-us/help-offline/index.html b/indra/newview/skins/default/html/en-us/help-offline/index.html new file mode 100644 index 0000000000..bf3677603e --- /dev/null +++ b/indra/newview/skins/default/html/en-us/help-offline/index.html @@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Offline Help</title> +<style> +body {background-color:#000000;font-family:verdana,helvetica,sans-serif;font-size:62.5%;color:#e9f1f8;width:100%;padding:0px;margin:0px;} +a {color:#93a9d5;} +a:active {color:#50607C;text-decoration:underline;} +a:hover {color:#ff7900;text-decoration:underline;} +#infobox{position:absolute;top:40%;left:50%;z-index:1;padding:0;width:592px;margin-left:-296px;margin-top:-150px;text-align:center;font-size:1.2em; color:#ccc;} +#infobox #submitbtn {padding:15px 3px 5px 15px;height:28px;width:127px;margin-left:244px;} +#infobox #submitbtn input {text-transform:capitalize;color:#fff;font-size:1.0em;height:28px;width:127px;border:none;font-weight:normal;background:url(../../btn_purplepill_bg.png) bottom left no-repeat;vertical-align:text-bottom;font-weight:bold;} +#infobox #submitbtn input:hover.input_over, #login_box #submitbtn input:hover.input_off {color:#fff;border:none;background:url(../../btn_purplepill_bg.png) bottom right no-repeat;} +#infobox #submitbtn input:active.input_over {color:#fff;border:none;background:url(../../btn_purplepill_bg.png) top left no-repeat;} +#infobox #submitbtn input.pressed {color:#888;border:none;background:url(../../btn_purplepill_bg.png) top right no-repeat;} +</style> +</head> +<body> +<div id="infobox"> + <p> + Second Life Offline Help. + </p> + <p> + You are not online and are configured not to fetch help remotely. This is all the help that is available + until more stuff is done. Yeah. + </p> + </div> +</div> +</body> diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 46c294768d..66ea444c15 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -110,12 +110,10 @@ <texture name="Home_Off" file_name="navbar/Home_Off.png" preload="false" /> <texture name="Home_Press" file_name="navbar/Home_Press.png" preload="false" /> - <texture name="Icon_Close_Background" file_name="windows/Icon_Close_Background.png" preload="true" /> <texture name="Icon_Close_Foreground" file_name="windows/Icon_Close_Foreground.png" preload="true" /> <texture name="Icon_Close_Press" file_name="windows/Icon_Close_Press.png" preload="true" /> <texture name="Icon_Close_Toast" file_name="windows/Icon_Close_Toast.png" preload="true" /> - <texture name="Icon_Dock_Background" file_name="windows/Icon_Dock_Background.png" preload="true" /> <texture name="Icon_Dock_Foreground" file_name="windows/Icon_Dock_Foreground.png" preload="true" /> <texture name="Icon_Dock_Press" file_name="windows/Icon_Dock_Press.png" preload="true" /> @@ -125,16 +123,16 @@ <texture name="Icon_Gear_Foreground" file_name="windows/Icon_Gear_Foreground.png" preload="false" /> <texture name="Icon_Gear_Press" file_name="windows/Icon_Gear_Press.png" preload="false" /> - <texture name="Icon_Help_Background" file_name="windows/Icon_Help_Background.png" preload="false" /> <texture name="Icon_Help_Foreground" file_name="windows/Icon_Help_Foreground.png" preload="false" /> <texture name="Icon_Help_Press" file_name="windows/Icon_Help_Press.png" preload="false" /> <texture name="Icon_Info" file_name="windows/Icon_Info.png" preload="false" /> - <texture name="Icon_Minimize_Background" file_name="windows/Icon_Minimize_Background.png" preload="true" /> <texture name="Icon_Minimize_Foreground" file_name="windows/Icon_Minimize_Foreground.png" preload="true" /> <texture name="Icon_Minimize_Press" file_name="windows/Icon_Minimize_Press.png" preload="true" /> - <texture name="Icon_Undock_Background" file_name="windows/Icon_Undock_Background.png" preload="false" /> + <texture name="Icon_Restore_Foreground" file_name="windows/Icon_Restore_Foreground.png" preload="false" /> + <texture name="Icon_Restore_Press" file_name="windows/Icon_Restore_Press.png" preload="false" /> + <texture name="Icon_Undock_Foreground" file_name="windows/Icon_Undock_Foreground.png" preload="false" /> <texture name="Icon_Undock_Press" file_name="windows/Icon_Undock_Press.png" preload="false" /> @@ -442,8 +440,6 @@ <texture name="cam_zoom_plus_in.tga" preload="false" /> <texture name="cam_zoom_minus_in.tga" preload="false" /> - <texture name="close_inactive_blue.tga" /> - <texture name="closebox.tga" /> <texture name="icn_clear_lineeditor.tga" /> <texture name="icn_chatbar.tga" /> @@ -493,10 +489,6 @@ <texture name="up_arrow.tga" file_name="up_arrow.png" /> <texture name="down_arrow.tga" file_name="down_arrow.png" /> - <texture name="restore_inactive.tga" /> - <texture name="restore.tga" /> - <texture name="restore_pressed.tga" /> - <texture name="tearoffbox.tga" /> <texture name="tearoff_pressed.tga" /> diff --git a/indra/newview/skins/default/textures/windows/Icon_Restore_Foreground.png b/indra/newview/skins/default/textures/windows/Icon_Restore_Foreground.png Binary files differnew file mode 100644 index 0000000000..1e753aaf1d --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Icon_Restore_Foreground.png diff --git a/indra/newview/skins/default/textures/windows/Icon_Restore_Press.png b/indra/newview/skins/default/textures/windows/Icon_Restore_Press.png Binary files differnew file mode 100644 index 0000000000..be66b05230 --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Icon_Restore_Press.png diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 97afe6d324..c9e143bf95 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -3,6 +3,7 @@ height="440" layout="topleft" name="floater_about" + help_topic="floater_about" save_rect="true" title="About [APP_NAME]" width="470"> diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml index a1265d49f9..512b4c85a1 100644 --- a/indra/newview/skins/default/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater can_resize="true" - height="440" + height="400" layout="topleft" min_height="140" min_width="467" @@ -9,8 +9,8 @@ help_topic="floater_help_browser" save_rect="true" single_instance="true" - title="Holy Bananas, it's the Help Browser" - width="820"> + title="Help Browser" + width="620"> <floater.string name="home_page_url"> http://www.secondlife.com @@ -20,150 +20,13 @@ http://support.secondlife.com </floater.string> <layout_stack - bottom="440" + bottom="400" follows="left|right|top|bottom" layout="topleft" left="10" name="stack1" top="20" - width="800"> - <layout_panel - auto_resize="false" - height="20" - layout="topleft" - left="0" - name="nav_controls" - top="400" - user_resize="false" - width="800"> - <button - follows="left|top" - height="20" - label="Back" - layout="topleft" - left="0" - name="back" - top="0" - width="55" /> - <button - follows="left|top" - height="20" - label="Forward" - layout="topleft" - left_pad="3" - name="forward" - top_delta="0" - width="68" /> - <button - enabled="false" - follows="left|top" - height="20" - label="Reload" - layout="topleft" - left_pad="2" - name="reload" - top_delta="0" - width="70"/> - <combo_box - allow_text_entry="true" - follows="left|top|right" - height="20" - layout="topleft" - left_pad="5" - max_chars="255" - name="address" - top_delta="0" - width="540" /> - <button - enabled="false" - follows="right|top" - height="20" - label="Go" - layout="topleft" - left_pad="5" - name="go" - top_delta="0" - width="55" /> - </layout_panel> - <layout_panel - auto_resize="false" - height="20" - layout="topleft" - left_delta="0" - name="time_controls" - top_delta="0" - user_resize="false" - width="800"> - <button - follows="left|top" - height="20" - label="rewind" - layout="topleft" - left="0" - name="rewind" - top="0" - width="55" /> - <button - follows="left|top" - height="20" - image_selected="button_anim_play_selected.tga" - image_unselected="button_anim_play.tga" - layout="topleft" - left_delta="55" - name="play" - picture_style="true" - top_delta="0" - width="55" /> - <button - follows="left|top" - height="20" - image_selected="button_anim_pause_selected.tga" - image_unselected="button_anim_pause.tga" - layout="topleft" - left_delta="0" - name="pause" - picture_style="true" - top_delta="0" - width="55" /> - <button - follows="left|top" - height="20" - label="stop" - layout="topleft" - left_pad="10" - name="stop" - top_delta="0" - width="55" /> - <button - follows="left|top" - height="20" - label="forward" - layout="topleft" - left_pad="20" - name="seek" - top_delta="0" - width="55" /> - </layout_panel> - <layout_panel - auto_resize="false" - height="20" - layout="topleft" - left_delta="0" - name="parcel_owner_controls" - top_delta="0" - user_resize="false" - width="540"> - <button - enabled="false" - follows="left|top" - height="20" - label="Send Current URL to Parcel" - layout="topleft" - left="0" - name="assign" - top="0" - width="200" /> - </layout_panel> + width="600"> <layout_panel height="20" layout="topleft" @@ -171,7 +34,7 @@ name="external_controls" top_delta="0" user_resize="false" - width="540"> + width="570"> <web_browser bottom="-10" follows="left|right|top|bottom" @@ -179,7 +42,7 @@ left="0" name="browser" top="0" - width="540" /> + width="570" /> <button follows="bottom|left" height="20" @@ -189,25 +52,17 @@ name="open_browser" top_pad="5" width="185" /> - <check_box - control_name="UseExternalBrowser" - follows="bottom|left" - height="20" - label="Always open in my web browser" - layout="topleft" - left_pad="5" - name="open_always" - top_delta="0" - width="200" /> +<!-- <button follows="bottom|right" height="20" label="Close" layout="topleft" - left_pad="80" + left_pad="290" name="close" top_delta="0" width="70" /> +--> </layout_panel> </layout_stack> </floater> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 10aa23b715..648c3458e0 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1042,15 +1042,6 @@ <menu_item_separator layout="topleft" /> <menu_item_call - label="Report Bug..." - layout="topleft" - name="ReportBug"> - <menu_item_call.on_click - function="PromptShowURL" - name="ReportBug_url" - parameter="hud,http://help.secondlife.com/en/bugreport/" /> - </menu_item_call> - <menu_item_call label="Report Abuse..." layout="topleft" name="Report Abuse"> @@ -2771,15 +2762,6 @@ function="Advanced.ShowDebugSettings" parameter="skin" /> </menu_item_call> - <menu_item_check - label="Editable UI" - layout="topleft" - name="Editable UI"> - <menu_item_check.on_check - function="Advanced.CheckEditableUI" /> - <menu_item_check.on_click - function="Advanced.ToggleEditableUI" /> - </menu_item_check> <menu_item_call label="Dump SelectMgr" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 044194a4ed..ebe7a0236b 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1691,7 +1691,6 @@ No Group selected. type="alertmodal"> Unable to deed land: Cannot find the region this land is in. -Please use Help > Report Bug to report this. </notification> <notification @@ -1772,8 +1771,6 @@ Parcels you own appear in green. type="alertmodal"> Unable to abandon land: Cannot find the region this land is in. - -Please use Help > Report Bug to report this. </notification> <notification @@ -1846,8 +1843,6 @@ Divide land? type="alertmodal"> Unable to divide land: Cannot find the region this land is in. - -Please use Help > Report Bug to report this. </notification> <notification @@ -1856,8 +1851,6 @@ Please use Help > Report Bug to report this. type="alertmodal"> Unable to join land: Cannot find the region this land is in. - -Please use Help > Report Bug to report this. </notification> <notification @@ -1973,8 +1966,6 @@ Unable to save '[NAME]' to wearable file. You will need to free up so type="alertmodal"> Unable to save [NAME] to central asset store. This is usually a temporary failure. Please customize and save the wearable again in a few minutes. - -If this problem persists, please click on Help > Report Bug and provide details about your network setup. </notification> <notification @@ -2758,18 +2749,6 @@ Go to secondlife.com to manage your account? <notification icon="alertmodal.tga" - name="WebLaunchBugReport101" - type="alertmodal"> -Visit the [SECOND_LIFE] Wiki and learn how to report bugs correctly. - <usetemplate - ignoretext="Launch my browser to learn how to report a Bug" - name="okcancelignore" - notext="Cancel" - yestext="OK"/> - </notification> - - <notification - icon="alertmodal.tga" name="WebLaunchSecurityIssues" type="alertmodal"> Visit the [SECOND_LIFE] Wiki for details of how to report a security issue. @@ -4275,22 +4254,6 @@ The resolution of this report applies only to this Region. Residents' acces <notification icon="alertmodal.tga" - name="HelpReportBug" - type="alertmodal"> -Use this tool to *only* report technical features that do not perform as described or expected, please provide as much detail as possible. -You may reply to the auto-response email to add more details to your report. - -All bug reports are investigated and assessed. No email response will be sent. - -If you are having a technical difficulty, please contact Support at: - -http://secondlife.com/community/support.php - -Note: Incomplete reports will not be investigated - </notification> - - <notification - icon="alertmodal.tga" name="HelpReportAbuseSelectCategory" type="alertmodal"> Please select a category for this abuse report. @@ -4299,14 +4262,6 @@ Selecting a category helps us file and process abuse reports. <notification icon="alertmodal.tga" - name="HelpReportBugSelectCategory" - type="alertmodal"> -Please select a category for this bug. -Selecting a category helps us file and process bug reports. - </notification> - - <notification - icon="alertmodal.tga" name="HelpReportAbuseAbuserNameEmpty" type="alertmodal"> Please enter the name of the abuser. @@ -4331,14 +4286,6 @@ Entering an accurate summary helps us file and process abuse reports. <notification icon="alertmodal.tga" - name="HelpReportBugSummaryEmpty" - type="alertmodal"> -Please enter a summary of the bug. -Entering an accurate summary helps us file and process bug reports. - </notification> - - <notification - icon="alertmodal.tga" name="HelpReportAbuseDetailsEmpty" type="alertmodal"> Please enter a detailed description of the abuse that took place. @@ -4348,15 +4295,6 @@ Entering an accurate description helps us file and process abuse reports. <notification icon="alertmodal.tga" - name="HelpReportBugDetailsEmpty" - type="alertmodal"> -Please enter a detailed description of the bug. -Be as specific as you can, including steps to reproduce the bug if possible. -Entering an accurate description helps us file and process bug reports. - </notification> - - <notification - icon="alertmodal.tga" name="HelpReportAbuseContainsCopyright" type="alertmodal"> Dear Resident, diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml index 5738879c5a..a3c714ce72 100644 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -184,9 +184,9 @@ layout="topleft" name="Help..." /> <menu_item_call - label="LSL Wiki Help..." + label="Keyword Help..." layout="topleft" - name="LSL Wiki Help..." /> + name="Keyword Help..." /> </menu> </menu_bar> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml b/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml index f25c4bfbba..aa76a61c15 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml @@ -19,4 +19,17 @@ top="4" value="Side Panel" width="255" /> + <button + follows="left|right|top" + font="SansSerif" + height="23" + label="?" + layout="topleft" + name="show_help" + top="5" + right="-8" + width="28"> + <button.commit_callback + function="Button.ShowHelp" /> + </button> </panel> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 13a53a4ce3..0f7afcba6e 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -93,7 +93,6 @@ <string name="BUTTON_RESTORE">Restore</string> <string name="BUTTON_MINIMIZE">Minimize</string> <string name="BUTTON_TEAR_OFF">Tear Off</string> - <string name="BUTTON_EDIT">Edit</string> <string name="BUTTON_DOCK">Dock</string> <string name="BUTTON_UNDOCK">Undock</string> <string name="BUTTON_HELP">Show Help</string> diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp new file mode 100644 index 0000000000..40f7d532bc --- /dev/null +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -0,0 +1,127 @@ +/** + * @file llviewerhelputil_test.cpp + * @brief LLViewerHelpUtil tests + * @author Tofu Linden + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "../test/lltut.h" + +#include "../llviewerhelputil.h" +#include "llcontrol.h" +#include "llsys.h" + +#include <iostream> + +//---------------------------------------------------------------------------- +// Implementation of enough of LLControlGroup to support the tests: + +static std::map<std::string,std::string> test_stringvec; + +LLControlGroup::LLControlGroup(const std::string& name) + : LLInstanceTracker<LLControlGroup, std::string>(name) +{ +} + +LLControlGroup::~LLControlGroup() +{ +} + +// Implementation of just the LLControlGroup methods we requre +BOOL LLControlGroup::declareString(const std::string& name, + const std::string& initial_val, + const std::string& comment, + BOOL persist) +{ + test_stringvec[name] = initial_val; + return true; +} + +void LLControlGroup::setString(const std::string& name, const std::string& val) +{ + test_stringvec[name] = val; +} + +std::string LLControlGroup::getString(const std::string& name) +{ + return test_stringvec[name]; +} + +//---------------------------------------------------------------------------- + +namespace tut +{ + struct viewerhelputil + { + }; + + typedef test_group<viewerhelputil> viewerhelputil_t; + typedef viewerhelputil_t::object viewerhelputil_object_t; + tut::viewerhelputil_t tut_viewerhelputil("viewerhelputil"); + + template<> template<> + void viewerhelputil_object_t::test<1>() + { + LLOSInfo osinfo; + LLControlGroup cgr("test"); + cgr.declareString("HelpURLFormat", "fooformat", "declared_for_test", FALSE); + cgr.declareString("VersionChannelName", "foochannelname", "declared_for_test", FALSE); + cgr.declareString("Language", "foolanguage", "declared_for_test", FALSE); + std::string topic("test_topic"); + + std::string subresult; + + cgr.setString("HelpURLFormat", "fooformat"); + subresult = LLViewerHelpUtil::buildHelpURL(topic, cgr, osinfo); + ensure_equals("no substitution tags", subresult, "fooformat"); + + cgr.setString("HelpURLFormat", ""); + subresult = LLViewerHelpUtil::buildHelpURL(topic, cgr, osinfo); + ensure_equals("blank substitution format", subresult, ""); + + cgr.setString("HelpURLFormat", "[LANGUAGE]"); + cgr.setString("Language", ""); + subresult = LLViewerHelpUtil::buildHelpURL(topic, cgr, osinfo); + ensure_equals("simple substitution with blank", subresult, ""); + + cgr.setString("HelpURLFormat", "[LANGUAGE]"); + cgr.setString("Language", "Esperanto"); + subresult = LLViewerHelpUtil::buildHelpURL(topic, cgr, osinfo); + ensure_equals("simple substitution", subresult, "Esperanto"); + + cgr.setString("HelpURLFormat", "[XXX]"); + subresult = LLViewerHelpUtil::buildHelpURL(topic, cgr, osinfo); + ensure_equals("unknown substitution", subresult, "[XXX]"); + + cgr.setString("HelpURLFormat", "[LANGUAGE]/[LANGUAGE]"); + cgr.setString("Language", "Esperanto"); + subresult = LLViewerHelpUtil::buildHelpURL(topic, cgr, osinfo); + ensure_equals("multiple substitution", subresult, "Esperanto/Esperanto"); + } + +} |