From 3659dd79710a4cffd8ff6a76714de48af1c33aa6 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Tue, 1 Mar 2011 14:29:08 +0100 Subject: remove llfloaterhtml.* (not used anymore). --- linden/indra/newview/llfloaterchat.cpp | 1 - linden/indra/newview/llfloaterhtml.cpp | 253 ------------------------- linden/indra/newview/llfloaterhtml.h | 77 -------- linden/indra/newview/llfloatermediabrowser.cpp | 5 +- linden/indra/newview/llmediactrl.cpp | 1 - 5 files changed, 2 insertions(+), 335 deletions(-) delete mode 100644 linden/indra/newview/llfloaterhtml.cpp delete mode 100644 linden/indra/newview/llfloaterhtml.h (limited to 'linden/indra') diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index e9ea14b..79dddaa 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -73,7 +73,6 @@ #include "lllogchat.h" #include "lltexteditor.h" #include "lltextparser.h" -#include "llfloaterhtml.h" #include "llweb.h" #include "llstylemap.h" #include "llviewermenu.h" diff --git a/linden/indra/newview/llfloaterhtml.cpp b/linden/indra/newview/llfloaterhtml.cpp deleted file mode 100644 index 5822ed5..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-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 "llfloaterhtml.h" - -// viewer includes -#include "lluictrlfactory.h" -#include "llviewercontrol.h" -#include "lllineeditor.h" -#include "llviewerwindow.h" -#include "llweb.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 trusted_browser ) -{ - // set the title - setTitle( title ); - - // navigate to the URL - if ( mWebBrowser ) - { - mWebBrowser->setTrusted( trusted_browser ); - 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 4383472..0000000 --- a/linden/indra/newview/llfloaterhtml.h +++ /dev/null @@ -1,77 +0,0 @@ - /** - * @file llfloaterhtml.h - * @author James Cook - * @brief In-world HTML dialog - * - * $LicenseInfo:firstyear=2005&license=viewergpl$ - * - * Copyright (c) 2005-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_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 trusted_browser ); - - // 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 trusted_browser ); - - 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/llfloatermediabrowser.cpp b/linden/indra/newview/llfloatermediabrowser.cpp index d658a11..a78c9d1 100644 --- a/linden/indra/newview/llfloatermediabrowser.cpp +++ b/linden/indra/newview/llfloatermediabrowser.cpp @@ -1,6 +1,6 @@ /** - * @file llfloaterhtmlhelp.cpp - * @brief HTML Help floater - uses embedded web browser control + * @file llmediabrowser.cpp + * @brief embedded web browser * * $LicenseInfo:firstyear=2006&license=viewergpl$ * @@ -33,7 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "llfloatermediabrowser.h" -#include "llfloaterhtml.h" #include "llchat.h" #include "llfloaterchat.h" diff --git a/linden/indra/newview/llmediactrl.cpp b/linden/indra/newview/llmediactrl.cpp index ff7ba22..8b10fa3 100644 --- a/linden/indra/newview/llmediactrl.cpp +++ b/linden/indra/newview/llmediactrl.cpp @@ -36,7 +36,6 @@ #include "llmediactrl.h" // viewer includes -#include "llfloaterhtml.h" #include "llfloatermediabrowser.h" #include "llfloaterworldmap.h" #include "lluictrlfactory.h" -- cgit v1.1