From 5ba642526c3343eddf120b3cfbf3bdb23c1fdf95 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 21 Jan 2009 18:45:08 -0700 Subject: Fixed browser layout, toggling; removed legacy browser code --- linden/indra/newview/CMakeLists.txt | 3 - linden/indra/newview/app_settings/settings.xml | 27 +- linden/indra/newview/llfloaterchat.cpp | 1 - linden/indra/newview/llfloaterhtml.cpp | 253 ---------------- linden/indra/newview/llfloaterhtml.h | 76 ----- linden/indra/newview/llfloaterhtmlhelp.cpp | 323 ++++----------------- linden/indra/newview/llfloaterhtmlhelp.h | 19 +- linden/indra/newview/llimpanel.cpp | 1 - linden/indra/newview/llpanellogin.cpp | 4 +- linden/indra/newview/llurldispatcher.cpp | 1 - linden/indra/newview/llviewermenu.cpp | 14 +- linden/indra/newview/llviewerparcelmgr.cpp | 1 - linden/indra/newview/llviewerstats.cpp | 1 - linden/indra/newview/llwebbrowserctrl.cpp | 11 +- .../newview/skins/default/xui/de/floater_html.xml | 14 - .../skins/default/xui/en-us/floater_html.xml | 25 -- .../default/xui/en-us/floater_media_browser.xml | 16 +- .../newview/skins/default/xui/en-us/strings.xml | 1 + .../newview/skins/default/xui/es/floater_html.xml | 12 - .../newview/skins/default/xui/fr/floater_html.xml | 16 - .../newview/skins/default/xui/ja/floater_html.xml | 14 - .../newview/skins/default/xui/ko/floater_html.xml | 14 - .../newview/skins/default/xui/pt/floater_html.xml | 12 - .../newview/skins/default/xui/zh/floater_html.xml | 12 - 24 files changed, 89 insertions(+), 782 deletions(-) delete mode 100644 linden/indra/newview/llfloaterhtml.cpp delete mode 100644 linden/indra/newview/llfloaterhtml.h delete mode 100644 linden/indra/newview/skins/default/xui/de/floater_html.xml delete mode 100644 linden/indra/newview/skins/default/xui/en-us/floater_html.xml delete mode 100644 linden/indra/newview/skins/default/xui/es/floater_html.xml delete mode 100644 linden/indra/newview/skins/default/xui/fr/floater_html.xml delete mode 100644 linden/indra/newview/skins/default/xui/ja/floater_html.xml delete mode 100644 linden/indra/newview/skins/default/xui/ko/floater_html.xml delete mode 100644 linden/indra/newview/skins/default/xui/pt/floater_html.xml delete mode 100644 linden/indra/newview/skins/default/xui/zh/floater_html.xml (limited to 'linden') diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 0205ceb..4024fdd 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -150,7 +150,6 @@ set(viewer_SOURCE_FILES llfloatergroupinvite.cpp llfloatergroups.cpp llfloaterhardwaresettings.cpp - llfloaterhtml.cpp llfloaterhtmlhelp.cpp llfloaterhud.cpp llfloaterimagepreview.cpp @@ -544,7 +543,6 @@ set(viewer_HEADER_FILES llfloatergroupinvite.h llfloatergroups.h llfloaterhardwaresettings.h - llfloaterhtml.h llfloaterhtmlhelp.h llfloaterhud.h llfloaterimagepreview.h @@ -1047,7 +1045,6 @@ set(viewer_XUI_FILES skins/default/xui/en-us/floater_god_tools.xml skins/default/xui/en-us/floater_group_info.xml skins/default/xui/en-us/floater_hardware_settings.xml - skins/default/xui/en-us/floater_html.xml skins/default/xui/en-us/floater_hud.xml skins/default/xui/en-us/floater_image_preview.xml skins/default/xui/en-us/floater_import.xml diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 01f6add..e7e7303 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -2903,22 +2903,6 @@ 0 - FloaterHtmlRect - - Comment - Rectangle for HTML window - Persist - 1 - Type - Rect - Value - - 100 - 460 - 370 - 100 - - FloaterIMRect Comment @@ -3814,6 +3798,17 @@ Value help/index.html + HelpSupportURL + + Comment + Main URL of support page + Persist + 1 + Type + String + Value + http://support.secondlife.com + HighResSnapshot Comment diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 1f0c6ad..a626ad3 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -70,7 +70,6 @@ #include "llchatbar.h" #include "lllogchat.h" #include "lltexteditor.h" -#include "llfloaterhtml.h" #include "llweb.h" #include "llstylemap.h" diff --git a/linden/indra/newview/llfloaterhtml.cpp b/linden/indra/newview/llfloaterhtml.cpp deleted file mode 100644 index eb09754..0000000 --- a/linden/indra/newview/llfloaterhtml.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/** - * @file llfloaterhtml.cpp - * @brief In-world HTML dialog - * - * $LicenseInfo:firstyear=2005&license=viewergpl$ - * - * Copyright (c) 2005-2008, 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 "llfloaterhtml.h" - -// viewer includes -#include "lluictrlfactory.h" -#include "llviewercontrol.h" -#include "lllineeditor.h" -#include "llviewerwindow.h" -#include "llweb.h" - -#include "llwebbrowserctrl.h" - -LLFloaterHtml* LLFloaterHtml::sInstance = 0; - -//////////////////////////////////////////////////////////////////////////////// -// -LLFloaterHtml* LLFloaterHtml::getInstance() -{ - if ( ! sInstance ) - sInstance = new LLFloaterHtml(); - - return sInstance; -} - -//////////////////////////////////////////////////////////////////////////////// -// -LLFloaterHtml::LLFloaterHtml() -: LLFloater( std::string("HTML Floater") ) - - , - mWebBrowser( 0 ) -{ - LLUICtrlFactory::getInstance()->buildFloater( this, "floater_html.xml" ); - - childSetAction("back_btn", onClickBack, this); - childSetAction("home_btn", onClickHome, this); - childSetAction("forward_btn", onClickForward, this); - childSetAction("close_btn", onClickClose, this); - childSetCommitCallback("url_edit", onCommitUrlEdit, this ); - childSetAction("go_btn", onClickGo, this ); - - // reposition floater from saved settings - LLRect rect = gSavedSettings.getRect( "FloaterHtmlRect" ); - reshape( rect.getWidth(), rect.getHeight(), FALSE ); - setRect( rect ); - - mWebBrowser = getChild("html_floater_browser" ); - if ( mWebBrowser ) - { - // open links in internal browser - mWebBrowser->setOpenInExternalBrowser( false ); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// -LLFloaterHtml::~LLFloaterHtml() -{ - // save position of floater - gSavedSettings.setRect( "FloaterHtmlRect", getRect() ); - - sInstance = 0; -} - -//////////////////////////////////////////////////////////////////////////////// -// virtual -void LLFloaterHtml::draw() -{ - // enable/disable buttons depending on state - if ( mWebBrowser ) - { - bool enable_back = mWebBrowser->canNavigateBack(); - childSetEnabled( "back_btn", enable_back ); - - bool enable_forward = mWebBrowser->canNavigateForward(); - childSetEnabled( "forward_btn", enable_forward ); - }; - - LLFloater::draw(); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtml::show( std::string content_id, bool open_link_external, bool open_app_slurls ) -{ - // calculate the XML labels we'll need (if only XML folders worked) - std::string title_str = content_id + "_title"; - std::string url_str = content_id + "_url"; - - std::string title = getString( title_str ); - std::string url = getString( url_str ); - - show( url, title, open_link_external, open_app_slurls ); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtml::show( std::string start_url, std::string title, bool open_link_external, bool open_app_slurls ) -{ - // set the title - setTitle( title ); - - // navigate to the URL - if ( mWebBrowser ) - { - mWebBrowser->setOpenAppSLURLs( open_app_slurls ); - mWebBrowser->setOpenInExternalBrowser( open_link_external ); - mWebBrowser->navigateTo( start_url ); - } - - // make floater appear - setVisibleAndFrontmost(); -} - -//////////////////////////////////////////////////////////////////////////////// -// -std::string LLFloaterHtml::getSupportUrl() -{ - return getString("support_page_url"); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtml::onClose( bool app_quitting ) -{ - setVisible( false ); - // HACK for fast XML iteration replace with: - // destroy(); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtml::onClickClose( void* data ) -{ - LLFloaterHtml* self = ( LLFloaterHtml* )data; - self->close(); -} - -//////////////////////////////////////////////////////////////////////////////// -// static -void LLFloaterHtml::onClickBack( void* data ) -{ - LLFloaterHtml* self = ( LLFloaterHtml* )data; - if ( self ) - { - if ( self->mWebBrowser ) - { - self->mWebBrowser->navigateBack(); - }; - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtml::onClickHome( void* data ) -{ - LLFloaterHtml* self = ( LLFloaterHtml* )data; - if ( self ) - { - if ( self->mWebBrowser ) - { - std::string home_url = self->getString("home_page_url"); - if ( home_url.length() > 4 ) - { - self->mWebBrowser->navigateTo( home_url ); - } - else - { - llwarns << "Invalid home page specified for HTML floater - navigating to default" << llendl; - self->mWebBrowser->navigateTo( "http://secondlife.com" ); - } - }; - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// static -void LLFloaterHtml::onClickForward( void* data ) -{ - LLFloaterHtml* self = ( LLFloaterHtml* )data; - if ( self ) - { - if ( self->mWebBrowser ) - { - self->mWebBrowser->navigateForward(); - }; - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// static -void LLFloaterHtml::onCommitUrlEdit(LLUICtrl* ctrl, void* user_data) -{ - LLFloaterHtml* self = (LLFloaterHtml*)user_data; - - LLLineEditor* editor = (LLLineEditor*)ctrl; - std::string url = editor->getText(); - - if ( self->mWebBrowser ) - { - self->mWebBrowser->navigateTo( url ); - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// static -void LLFloaterHtml::onClickGo( void* data ) -{ - LLFloaterHtml* self = ( LLFloaterHtml* )data; - if ( self ) - { - std::string url = self->childGetValue( "url_edit" ).asString(); - if ( url.length() ) - { - if ( self->mWebBrowser ) - { - self->mWebBrowser->navigateTo( url ); - } - } - } -} diff --git a/linden/indra/newview/llfloaterhtml.h b/linden/indra/newview/llfloaterhtml.h deleted file mode 100644 index e236ffe..0000000 --- a/linden/indra/newview/llfloaterhtml.h +++ /dev/null @@ -1,76 +0,0 @@ - /** - * @file llfloaterhtml.h - * @author James Cook - * @brief In-world HTML dialog - * - * $LicenseInfo:firstyear=2005&license=viewergpl$ - * - * Copyright (c) 2005-2008, 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_LLFLOATERHTML_H -#define LL_LLFLOATERHTML_H - -#include "llfloater.h" -#include "llhtmlhelp.h" - -class LLWebBrowserCtrl; - -class LLFloaterHtml : - public LLFloater -{ - public: - static LLFloaterHtml* getInstance(); - virtual ~LLFloaterHtml(); - - virtual void draw(); - virtual void onClose( bool app_quitting ); - - // Pass string like "in-world_help" or "additional help" - void show( std::string content_id, bool open_link_external, bool open_app_slurls ); - - // Pass raw URL and window title - // Can be set to handle secondlife:///app/ URLs, but this should - // usually be false. - void show( std::string start_url, std::string title, bool open_link_external, bool open_app_slurls ); - - std::string getSupportUrl(); - - static void onClickClose( void* data ); - static void onClickBack( void* data ); - static void onClickHome( void* data ); - static void onClickForward( void* data ); - static void onCommitUrlEdit(LLUICtrl* ctrl, void* user_data); - static void onClickGo( void* data ); - - private: - LLFloaterHtml(); - - LLWebBrowserCtrl* mWebBrowser; - static LLFloaterHtml* sInstance; - LLButton* mCloseButton; -}; - -#endif diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index 7fe4d59..f637624 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp @@ -32,7 +32,6 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterhtmlhelp.h" -#include "llfloaterhtml.h" #include "llparcel.h" #include "lluictrlfactory.h" @@ -50,6 +49,13 @@ #include "llviewerparcelmedia.h" #include "llcombobox.h" +#include "llchat.h" +#include "lllineeditor.h" +#include "llfloaterchat.h" +#include "lltrans.h" + +// static +LLFloaterMediaBrowser* LLFloaterMediaBrowser::sInstance = NULL; LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data) { @@ -118,7 +124,7 @@ void LLFloaterMediaBrowser::buildURLHistory() void LLFloaterMediaBrowser::onClose(bool app_quitting) { - //setVisible(FALSE); + //setVisible(FALSE) destroy(); } @@ -155,20 +161,52 @@ void LLFloaterMediaBrowser::onLocationChange( const EventType& eventIn ) LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url) { - LLFloaterMediaBrowser* floaterp = LLUISingleton >::showInstance(media_url); + LLFloaterMediaBrowser* sInstance = LLUISingleton >::showInstance(media_url); - floaterp->openMedia(media_url.asString()); - return floaterp; + sInstance->openMedia(media_url.asString()); + return sInstance; } -void LLFloaterMediaBrowser::show() +//static +void LLFloaterMediaBrowser::toggle() +{ + bool visible = LLFloaterMediaBrowser::instanceVisible(); + LLFloaterMediaBrowser* self = sInstance->getInstance(); + + if(visible && self) + { + self->close(); + } + else + { + //Show home url if new session, last visited if not + std::string last_url = gSavedSettings.getString("BrowserLastVisited"); + if(last_url.empty()) + last_url = gSavedSettings.getString("BrowserHome"); + showInstance(last_url); + } +} + +//static +void LLFloaterMediaBrowser::helpF1() +{ + std::string url = gSavedSettings.getString("HelpSupportURL"); + std::string* url_copy = new std::string(url); + + gViewerWindow->alertXml("ClickOpenF1Help", onClickF1HelpLoadURL, url_copy); +} + +// static +void LLFloaterMediaBrowser::onClickF1HelpLoadURL(S32 option, void* userdata) { - //Show home url if new session, last visited if not - std::string last_url = gSavedSettings.getString("BrowserLastVisited"); - if(last_url.empty()) - last_url = gSavedSettings.getString("BrowserHome"); - showInstance(last_url); + std::string* urlp = (std::string*)userdata; + if (0 == option) + { + showInstance(urlp->c_str()); + } + delete urlp; } + //static void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data) { @@ -225,7 +263,7 @@ void LLFloaterMediaBrowser::onClickOpenWebBrowser(void* user_data) std::string url = self->mCurrentURL.empty() ? self->mBrowser->getHomePageUrl() : self->mCurrentURL; - LLWeb::loadURLExternal(url); + LLWeb::loadURL(url); } void LLFloaterMediaBrowser::onClickAssign(void* user_data) @@ -247,8 +285,6 @@ void LLFloaterMediaBrowser::onClickAssign(void* user_data) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel, true ); // now check for video LLViewerParcelMedia::update( parcel ); - - } void LLFloaterMediaBrowser::onClickHome(void* user_data) @@ -270,6 +306,11 @@ void LLFloaterMediaBrowser::onClickSetHome(void* user_data) std::string url = self->mCurrentURL; if(!url.empty()) { + LLChat chat; + std::string log_message = LLTrans::getString("new_home_page") + " "; + log_message += url; + chat.mText = log_message; + LLFloaterChat::addChat(chat, FALSE, FALSE); gSavedSettings.setString("BrowserHome", url); } } @@ -279,257 +320,3 @@ void LLFloaterMediaBrowser::openMedia(const std::string& media_url) mBrowser->setHomePageUrl(media_url); mBrowser->navigateTo(media_url); } - -LLViewerHtmlHelp gViewerHtmlHelp; - -class LLFloaterHtmlHelp : - public LLFloater, - public LLWebBrowserCtrlObserver -{ -public: - LLFloaterHtmlHelp(std::string start_url, std::string title); - virtual ~LLFloaterHtmlHelp(); - - virtual void onClose( bool app_quitting ); - virtual void draw(); - - static void show(std::string url, std::string title); - static void onClickBack( void* data ); - static void onClickHome( void* data ); - static void onClickForward( void* data ); - static void onClickClose( void* data ); - - // browser observer impls - virtual void onStatusTextChange( const EventType& eventIn ); - virtual void onLocationChange( const EventType& eventIn ); - - // used for some stats logging - will be removed at some point - static BOOL sFloaterOpened; - - static void onClickF1HelpLoadURL(S32 option, void* userdata); - -protected: - LLWebBrowserCtrl* mWebBrowser; - static LLFloaterHtmlHelp* sInstance; - LLButton* mBackButton; - LLButton* mForwardButton; - LLButton* mCloseButton; - LLTextBox* mStatusText; - std::string mStatusTextContents; - std::string mCurrentUrl; - std::string mSupportUrl; -}; - -LLFloaterHtmlHelp* LLFloaterHtmlHelp::sInstance = 0; - -BOOL LLFloaterHtmlHelp::sFloaterOpened = FALSE; - -//////////////////////////////////////////////////////////////////////////////// -// -LLFloaterHtmlHelp::LLFloaterHtmlHelp(std::string start_url, std::string title) -: LLFloater( std::string("HTML Help") ), - mWebBrowser( 0 ), - mStatusTextContents( LLStringUtil::null ), - mCurrentUrl( LLStringUtil::null ) -{ - sInstance = this; - - // create floater from its XML definition - LLUICtrlFactory::getInstance()->buildFloater( this, "floater_html_help.xml" ); - - childSetAction("back_btn", onClickBack, this); - childSetAction("home_btn", onClickHome, this); - childSetAction("forward_btn", onClickForward, this); - - if (!title.empty()) - { - setTitle(title); - } - - mWebBrowser = getChild("html_help_browser" ); - if ( mWebBrowser ) - { - // observe browser control events - mWebBrowser->addObserver( this ); - - if (start_url != "") - { - mWebBrowser->navigateTo( start_url ); - } - else - { - // if the last page we were at before the client was closed is valid, go there and - // override what is in the XML file - // (not when the window was closed - it's only ever hidden - not closed) - std::string lastPageUrl = gSavedSettings.getString( "HtmlHelpLastPage" ); - if ( lastPageUrl != "" ) - { - mWebBrowser->navigateTo( lastPageUrl ); - }; - } - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// -LLFloaterHtmlHelp::~LLFloaterHtmlHelp() -{ - // stop observing browser events - if ( mWebBrowser ) - { - mWebBrowser->remObserver( this ); - }; - - // save position of floater - gSavedSettings.setRect( "HtmlHelpRect", getRect() ); - - // save the location we were at when SL closed - gSavedSettings.setString( "HtmlHelpLastPage", mCurrentUrl ); - - sInstance = 0; -} - -//////////////////////////////////////////////////////////////////////////////// -// virtual -void LLFloaterHtmlHelp::draw() -{ - // enable/disable buttons depending on state - if ( mWebBrowser ) - { - bool enable_back = mWebBrowser->canNavigateBack(); - childSetEnabled( "back_btn", enable_back ); - - bool enable_forward = mWebBrowser->canNavigateForward(); - childSetEnabled( "forward_btn", enable_forward ); - }; - - LLFloater::draw(); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::show(std::string url, std::string title) -{ - LLFloaterHtml* floater_html = LLFloaterHtml::getInstance(); - floater_html->setVisible(FALSE); - - if(url.empty()) - { - url = floater_html->getSupportUrl(); - } - std::string* url_copy = new std::string(url); - - gViewerWindow->alertXml("ClickOpenF1Help", onClickF1HelpLoadURL, url_copy); - -} - -// static -void LLFloaterHtmlHelp::onClickF1HelpLoadURL(S32 option, void* userdata) -{ - std::string* urlp = (std::string*)userdata; - if (0 == option) - { - LLWeb::loadURL(urlp->c_str()); - } - delete urlp; -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::onClose( bool app_quitting ) -{ - setVisible( false ); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::onClickClose( void* data ) -{ - LLFloaterHtmlHelp* self = ( LLFloaterHtmlHelp* )data; - - self->setVisible( false ); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::onClickBack( void* data ) -{ - LLFloaterHtmlHelp* self = ( LLFloaterHtmlHelp* )data; - if ( self ) - { - if ( self->mWebBrowser ) - { - self->mWebBrowser->navigateBack(); - }; - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::onClickHome( void* data ) -{ - LLFloaterHtmlHelp* self = ( LLFloaterHtmlHelp* )data; - if ( self ) - { - // get the home page URL (which can differ from the start URL) from XML and go there - LLWebBrowserCtrl* web_browser = self->getChild("html_help_browser" ); - if ( web_browser ) - { - web_browser->navigateHome(); - }; - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::onClickForward( void* data ) -{ - LLFloaterHtmlHelp* self = ( LLFloaterHtmlHelp* )data; - if ( self ) - { - if ( self->mWebBrowser ) - { - self->mWebBrowser->navigateForward(); - }; - }; -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::onStatusTextChange( const EventType& eventIn ) -{ - mStatusTextContents = std::string( eventIn.getStringValue() ); - - childSetText("status_text", mStatusTextContents); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterHtmlHelp::onLocationChange( const EventType& eventIn ) -{ - llinfos << "MOZ> Location changed to " << eventIn.getStringValue() << llendl; - mCurrentUrl = std::string( eventIn.getStringValue() ); -} - -//////////////////////////////////////////////////////////////////////////////// -// -LLViewerHtmlHelp::LLViewerHtmlHelp() -{ - LLUI::setHtmlHelp(this); -} - -LLViewerHtmlHelp::~LLViewerHtmlHelp() -{ - LLUI::setHtmlHelp(NULL); -} - -void LLViewerHtmlHelp::show() -{ - LLFloaterHtmlHelp::show("", ""); -} - -void LLViewerHtmlHelp::show(std::string url) -{ - std::string title; // empty - LLFloaterHtmlHelp::show(url, title); -} diff --git a/linden/indra/newview/llfloaterhtmlhelp.h b/linden/indra/newview/llfloaterhtmlhelp.h index d726b77..d52d8d3 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.h +++ b/linden/indra/newview/llfloaterhtmlhelp.h @@ -36,16 +36,6 @@ #include "llfloater.h" #include "llwebbrowserctrl.h" -class LLViewerHtmlHelp : public LLHtmlHelp -{ -public: - LLViewerHtmlHelp(); - virtual ~LLViewerHtmlHelp(); - - /*virtual*/ void show(); - /*virtual*/ void show(std::string start_url); -}; - class LLComboBox; class LLWebBrowserCtrl; @@ -65,7 +55,9 @@ public: void buildURLHistory(); static LLFloaterMediaBrowser* showInstance(const LLSD& id); - static void show(); + + static void toggle(); + static void helpF1(); static void onEnterAddress(LLUICtrl* ctrl, void* user_data); static void onClickRefresh(void* user_data); static void onClickBack(void* user_data); @@ -76,14 +68,15 @@ public: static void onClickAssign(void* user_data); static void onClickHome(void* user_data); static void onClickSetHome(void* user_data); + static void onClickF1HelpLoadURL(S32 option, void* userdata); private: LLWebBrowserCtrl* mBrowser; LLComboBox* mAddressCombo; std::string mCurrentURL; -}; -extern LLViewerHtmlHelp gViewerHtmlHelp; + static LLFloaterMediaBrowser* sInstance; +}; #endif // LL_LLFLOATERHTMLHELP_H diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 5e260ec..dede746 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -68,7 +68,6 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" #include "lllogchat.h" -#include "llfloaterhtml.h" #include "llweb.h" #include "llhttpclient.h" #include "llmutelist.h" diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index a495516..aeb3b2d 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -70,8 +70,6 @@ #include "llweb.h" #include "llwebbrowserctrl.h" -#include "llfloaterhtml.h" - #include "llfloaterhtmlhelp.h" #include "llfloatertos.h" @@ -559,7 +557,7 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask) if ( KEY_F1 == key ) { llinfos << "Spawning HTML help window" << llendl; - gViewerHtmlHelp.show(); + LLFloaterMediaBrowser::helpF1(); return TRUE; } diff --git a/linden/indra/newview/llurldispatcher.cpp b/linden/indra/newview/llurldispatcher.cpp index 229314e..d574ea1 100644 --- a/linden/indra/newview/llurldispatcher.cpp +++ b/linden/indra/newview/llurldispatcher.cpp @@ -37,7 +37,6 @@ #include "llcommandhandler.h" #include "llfloaterurldisplay.h" #include "llfloaterdirectory.h" -#include "llfloaterhtml.h" #include "llfloaterworldmap.h" #include "llfloaterhtmlhelp.h" #include "llpanellogin.h" diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index d607afe..4c6de79 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -105,7 +105,6 @@ #include "llfloatergroupinfo.h" #include "llfloatergroupinvite.h" #include "llfloatergroups.h" -#include "llfloaterhtml.h" #include "llfloaterhtmlhelp.h" #include "llfloaterhud.h" #include "llfloaterinspect.h" @@ -5146,7 +5145,7 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "help f1") { - gViewerHtmlHelp.show(); + LLFloaterMediaBrowser::helpF1(); } else if (floater_name == "help tutorial") { @@ -5189,7 +5188,7 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "inworld browser") { - LLFloaterMediaBrowser::show(); + LLFloaterMediaBrowser::toggle(); } return true; } @@ -6968,13 +6967,8 @@ void handle_load_from_xml(void*) void handle_slurl_test(void*) { - const bool open_links_externally = false; - const bool open_app_slurls = true; - LLFloaterHtml::getInstance()->show( - "http://secondlife.com/app/search/slurls.html", - "SLURL Test", - open_links_externally, - open_app_slurls); + std::string test_slurl = "http://secondlife.com/app/search/slurls.html"; + LLFloaterMediaBrowser::showInstance(test_slurl); } void handle_rebake_textures(void*) diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index a1311d3..5ef6f83 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/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/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp index 9034634..edefb57 100644 --- a/linden/indra/newview/llviewerstats.cpp +++ b/linden/indra/newview/llviewerstats.cpp @@ -53,7 +53,6 @@ #include "llfasttimerview.h" #include "llviewerregion.h" #include "llvoavatar.h" -#include "llfloaterhtml.h" #include "llviewerwindow.h" // *TODO: remove, only used for width/height #include "llworld.h" #include "llfeaturemanager.h" diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp index e9a7132..c4a2b2b 100644 --- a/linden/indra/newview/llwebbrowserctrl.cpp +++ b/linden/indra/newview/llwebbrowserctrl.cpp @@ -35,7 +35,7 @@ #include "llwebbrowserctrl.h" // viewer includes -#include "llfloaterhtml.h" +#include "llfloaterhtmlhelp.h" #include "llfloaterworldmap.h" #include "lluictrlfactory.h" #include "llurldispatcher.h" @@ -750,15 +750,10 @@ void LLWebBrowserCtrl::onClickLinkHref( const EventType& eventIn ) if ( LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol1.length() ), protocol1 ) == 0 || LLStringUtil::compareInsensitive( eventIn.getStringValue().substr( 0, protocol2.length() ), protocol2 ) == 0 ) { - // If we spawn a new LLFloaterHTML, assume we want it to + // If we spawn a new LLFloaterMediaBrowser, assume we want it to // follow this LLWebBrowserCtrl's setting for whether or // not to open secondlife:///app/ links. JC. - const bool open_links_externally = false; - LLFloaterHtml::getInstance()->show( - eventIn.getStringValue(), - "Second Life Browser", - open_links_externally, - mOpenAppSLURLs); + LLFloaterMediaBrowser::showInstance(eventIn.getStringValue()); }; }; }; diff --git a/linden/indra/newview/skins/default/xui/de/floater_html.xml b/linden/indra/newview/skins/default/xui/de/floater_html.xml deleted file mode 100644 index 5d5877e..0000000 --- a/linden/indra/newview/skins/default/xui/de/floater_html.xml +++ /dev/null @@ -1,14 +0,0 @@ - - -