diff options
author | Armin Weatherwax | 2011-03-01 14:29:08 +0100 |
---|---|---|
committer | Armin Weatherwax | 2011-03-01 14:29:08 +0100 |
commit | 3659dd79710a4cffd8ff6a76714de48af1c33aa6 (patch) | |
tree | c0ad3791a36fa0b46cda19f05eb0d49941d2f62d | |
parent | fix news bar doesn't open internal browser (diff) | |
download | meta-impy-3659dd79710a4cffd8ff6a76714de48af1c33aa6.zip meta-impy-3659dd79710a4cffd8ff6a76714de48af1c33aa6.tar.gz meta-impy-3659dd79710a4cffd8ff6a76714de48af1c33aa6.tar.bz2 meta-impy-3659dd79710a4cffd8ff6a76714de48af1c33aa6.tar.xz |
remove llfloaterhtml.* (not used anymore).
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 1 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterhtml.cpp | 253 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterhtml.h | 77 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermediabrowser.cpp | 5 | ||||
-rw-r--r-- | linden/indra/newview/llmediactrl.cpp | 1 |
5 files changed, 2 insertions, 335 deletions
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 @@ | |||
73 | #include "lllogchat.h" | 73 | #include "lllogchat.h" |
74 | #include "lltexteditor.h" | 74 | #include "lltexteditor.h" |
75 | #include "lltextparser.h" | 75 | #include "lltextparser.h" |
76 | #include "llfloaterhtml.h" | ||
77 | #include "llweb.h" | 76 | #include "llweb.h" |
78 | #include "llstylemap.h" | 77 | #include "llstylemap.h" |
79 | #include "llviewermenu.h" | 78 | #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 @@ | |||
1 | /** | ||
2 | * @file llfloaterhtml.cpp | ||
3 | * @brief In-world HTML dialog | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2005-2009, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at | ||
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
22 | * | ||
23 | * By copying, modifying or distributing this software, you acknowledge | ||
24 | * that you have read and understood your obligations described above, | ||
25 | * and agree to abide by those obligations. | ||
26 | * | ||
27 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
29 | * COMPLETENESS OR PERFORMANCE. | ||
30 | * $/LicenseInfo$ | ||
31 | */ | ||
32 | |||
33 | #include "llviewerprecompiledheaders.h" | ||
34 | |||
35 | #include "llfloaterhtml.h" | ||
36 | |||
37 | // viewer includes | ||
38 | #include "lluictrlfactory.h" | ||
39 | #include "llviewercontrol.h" | ||
40 | #include "lllineeditor.h" | ||
41 | #include "llviewerwindow.h" | ||
42 | #include "llweb.h" | ||
43 | |||
44 | |||
45 | LLFloaterHtml* LLFloaterHtml::sInstance = 0; | ||
46 | |||
47 | //////////////////////////////////////////////////////////////////////////////// | ||
48 | // | ||
49 | LLFloaterHtml* LLFloaterHtml::getInstance() | ||
50 | { | ||
51 | if ( ! sInstance ) | ||
52 | sInstance = new LLFloaterHtml(); | ||
53 | |||
54 | return sInstance; | ||
55 | } | ||
56 | |||
57 | //////////////////////////////////////////////////////////////////////////////// | ||
58 | // | ||
59 | LLFloaterHtml::LLFloaterHtml() | ||
60 | : LLFloater( std::string("HTML Floater") ) | ||
61 | |||
62 | , | ||
63 | mWebBrowser( 0 ) | ||
64 | { | ||
65 | LLUICtrlFactory::getInstance()->buildFloater( this, "floater_html.xml" ); | ||
66 | |||
67 | childSetAction("back_btn", onClickBack, this); | ||
68 | childSetAction("home_btn", onClickHome, this); | ||
69 | childSetAction("forward_btn", onClickForward, this); | ||
70 | childSetAction("close_btn", onClickClose, this); | ||
71 | childSetCommitCallback("url_edit", onCommitUrlEdit, this ); | ||
72 | childSetAction("go_btn", onClickGo, this ); | ||
73 | |||
74 | // reposition floater from saved settings | ||
75 | LLRect rect = gSavedSettings.getRect( "FloaterHtmlRect" ); | ||
76 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); | ||
77 | setRect( rect ); | ||
78 | |||
79 | mWebBrowser = getChild<LLWebBrowserCtrl>("html_floater_browser" ); | ||
80 | if ( mWebBrowser ) | ||
81 | { | ||
82 | // open links in internal browser | ||
83 | mWebBrowser->setOpenInExternalBrowser( false ); | ||
84 | } | ||
85 | } | ||
86 | |||
87 | //////////////////////////////////////////////////////////////////////////////// | ||
88 | // | ||
89 | LLFloaterHtml::~LLFloaterHtml() | ||
90 | { | ||
91 | // save position of floater | ||
92 | gSavedSettings.setRect( "FloaterHtmlRect", getRect() ); | ||
93 | |||
94 | sInstance = 0; | ||
95 | } | ||
96 | |||
97 | //////////////////////////////////////////////////////////////////////////////// | ||
98 | // virtual | ||
99 | void LLFloaterHtml::draw() | ||
100 | { | ||
101 | // enable/disable buttons depending on state | ||
102 | if ( mWebBrowser ) | ||
103 | { | ||
104 | bool enable_back = mWebBrowser->canNavigateBack(); | ||
105 | childSetEnabled( "back_btn", enable_back ); | ||
106 | |||
107 | bool enable_forward = mWebBrowser->canNavigateForward(); | ||
108 | childSetEnabled( "forward_btn", enable_forward ); | ||
109 | }; | ||
110 | |||
111 | LLFloater::draw(); | ||
112 | } | ||
113 | |||
114 | //////////////////////////////////////////////////////////////////////////////// | ||
115 | // | ||
116 | void LLFloaterHtml::show( std::string content_id, bool open_link_external, bool open_app_slurls ) | ||
117 | { | ||
118 | // calculate the XML labels we'll need (if only XML folders worked) | ||
119 | std::string title_str = content_id + "_title"; | ||
120 | std::string url_str = content_id + "_url"; | ||
121 | |||
122 | std::string title = getString( title_str ); | ||
123 | std::string url = getString( url_str ); | ||
124 | |||
125 | show( url, title, open_link_external, open_app_slurls ); | ||
126 | } | ||
127 | |||
128 | //////////////////////////////////////////////////////////////////////////////// | ||
129 | // | ||
130 | void LLFloaterHtml::show( std::string start_url, std::string title, bool open_link_external, bool trusted_browser ) | ||
131 | { | ||
132 | // set the title | ||
133 | setTitle( title ); | ||
134 | |||
135 | // navigate to the URL | ||
136 | if ( mWebBrowser ) | ||
137 | { | ||
138 | mWebBrowser->setTrusted( trusted_browser ); | ||
139 | mWebBrowser->setOpenInExternalBrowser( open_link_external ); | ||
140 | mWebBrowser->navigateTo( start_url ); | ||
141 | } | ||
142 | |||
143 | // make floater appear | ||
144 | setVisibleAndFrontmost(); | ||
145 | } | ||
146 | |||
147 | //////////////////////////////////////////////////////////////////////////////// | ||
148 | // | ||
149 | std::string LLFloaterHtml::getSupportUrl() | ||
150 | { | ||
151 | return getString("support_page_url"); | ||
152 | } | ||
153 | |||
154 | //////////////////////////////////////////////////////////////////////////////// | ||
155 | // | ||
156 | void LLFloaterHtml::onClose( bool app_quitting ) | ||
157 | { | ||
158 | setVisible( false ); | ||
159 | // HACK for fast XML iteration replace with: | ||
160 | // destroy(); | ||
161 | } | ||
162 | |||
163 | //////////////////////////////////////////////////////////////////////////////// | ||
164 | // | ||
165 | void LLFloaterHtml::onClickClose( void* data ) | ||
166 | { | ||
167 | LLFloaterHtml* self = ( LLFloaterHtml* )data; | ||
168 | self->close(); | ||
169 | } | ||
170 | |||
171 | //////////////////////////////////////////////////////////////////////////////// | ||
172 | // static | ||
173 | void LLFloaterHtml::onClickBack( void* data ) | ||
174 | { | ||
175 | LLFloaterHtml* self = ( LLFloaterHtml* )data; | ||
176 | if ( self ) | ||
177 | { | ||
178 | if ( self->mWebBrowser ) | ||
179 | { | ||
180 | self->mWebBrowser->navigateBack(); | ||
181 | }; | ||
182 | }; | ||
183 | } | ||
184 | |||
185 | //////////////////////////////////////////////////////////////////////////////// | ||
186 | // | ||
187 | void LLFloaterHtml::onClickHome( void* data ) | ||
188 | { | ||
189 | LLFloaterHtml* self = ( LLFloaterHtml* )data; | ||
190 | if ( self ) | ||
191 | { | ||
192 | if ( self->mWebBrowser ) | ||
193 | { | ||
194 | std::string home_url = self->getString("home_page_url"); | ||
195 | if ( home_url.length() > 4 ) | ||
196 | { | ||
197 | self->mWebBrowser->navigateTo( home_url ); | ||
198 | } | ||
199 | else | ||
200 | { | ||
201 | llwarns << "Invalid home page specified for HTML floater - navigating to default" << llendl; | ||
202 | self->mWebBrowser->navigateTo( "http://secondlife.com" ); | ||
203 | } | ||
204 | }; | ||
205 | }; | ||
206 | } | ||
207 | |||
208 | //////////////////////////////////////////////////////////////////////////////// | ||
209 | // static | ||
210 | void LLFloaterHtml::onClickForward( void* data ) | ||
211 | { | ||
212 | LLFloaterHtml* self = ( LLFloaterHtml* )data; | ||
213 | if ( self ) | ||
214 | { | ||
215 | if ( self->mWebBrowser ) | ||
216 | { | ||
217 | self->mWebBrowser->navigateForward(); | ||
218 | }; | ||
219 | }; | ||
220 | } | ||
221 | |||
222 | //////////////////////////////////////////////////////////////////////////////// | ||
223 | // static | ||
224 | void LLFloaterHtml::onCommitUrlEdit(LLUICtrl* ctrl, void* user_data) | ||
225 | { | ||
226 | LLFloaterHtml* self = (LLFloaterHtml*)user_data; | ||
227 | |||
228 | LLLineEditor* editor = (LLLineEditor*)ctrl; | ||
229 | std::string url = editor->getText(); | ||
230 | |||
231 | if ( self->mWebBrowser ) | ||
232 | { | ||
233 | self->mWebBrowser->navigateTo( url ); | ||
234 | }; | ||
235 | } | ||
236 | |||
237 | //////////////////////////////////////////////////////////////////////////////// | ||
238 | // static | ||
239 | void LLFloaterHtml::onClickGo( void* data ) | ||
240 | { | ||
241 | LLFloaterHtml* self = ( LLFloaterHtml* )data; | ||
242 | if ( self ) | ||
243 | { | ||
244 | std::string url = self->childGetValue( "url_edit" ).asString(); | ||
245 | if ( url.length() ) | ||
246 | { | ||
247 | if ( self->mWebBrowser ) | ||
248 | { | ||
249 | self->mWebBrowser->navigateTo( url ); | ||
250 | } | ||
251 | } | ||
252 | } | ||
253 | } | ||
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 @@ | |||
1 | /** | ||
2 | * @file llfloaterhtml.h | ||
3 | * @author James Cook | ||
4 | * @brief In-world HTML dialog | ||
5 | * | ||
6 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | ||
7 | * | ||
8 | * Copyright (c) 2005-2009, Linden Research, Inc. | ||
9 | * | ||
10 | * Second Life Viewer Source Code | ||
11 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
12 | * to you under the terms of the GNU General Public License, version 2.0 | ||
13 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
14 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
16 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
17 | * | ||
18 | * There are special exceptions to the terms and conditions of the GPL as | ||
19 | * it is applied to this Source Code. View the full text of the exception | ||
20 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
21 | * online at | ||
22 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
23 | * | ||
24 | * By copying, modifying or distributing this software, you acknowledge | ||
25 | * that you have read and understood your obligations described above, | ||
26 | * and agree to abide by those obligations. | ||
27 | * | ||
28 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
29 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
30 | * COMPLETENESS OR PERFORMANCE. | ||
31 | * $/LicenseInfo$ | ||
32 | */ | ||
33 | |||
34 | #ifndef LL_LLFLOATERHTML_H | ||
35 | #define LL_LLFLOATERHTML_H | ||
36 | |||
37 | #include "llfloater.h" | ||
38 | #include "llhtmlhelp.h" | ||
39 | |||
40 | class LLWebBrowserCtrl; | ||
41 | |||
42 | class LLFloaterHtml : | ||
43 | public LLFloater | ||
44 | { | ||
45 | public: | ||
46 | static LLFloaterHtml* getInstance(); | ||
47 | virtual ~LLFloaterHtml(); | ||
48 | |||
49 | virtual void draw(); | ||
50 | virtual void onClose( bool app_quitting ); | ||
51 | |||
52 | // Pass string like "in-world_help" or "additional help" | ||
53 | void show( std::string content_id, bool open_link_external, bool trusted_browser ); | ||
54 | |||
55 | // Pass raw URL and window title | ||
56 | // Can be set to handle secondlife:///app/ URLs, but this should | ||
57 | // usually be false. | ||
58 | void show( std::string start_url, std::string title, bool open_link_external, bool trusted_browser ); | ||
59 | |||
60 | std::string getSupportUrl(); | ||
61 | |||
62 | static void onClickClose( void* data ); | ||
63 | static void onClickBack( void* data ); | ||
64 | static void onClickHome( void* data ); | ||
65 | static void onClickForward( void* data ); | ||
66 | static void onCommitUrlEdit(LLUICtrl* ctrl, void* user_data); | ||
67 | static void onClickGo( void* data ); | ||
68 | |||
69 | private: | ||
70 | LLFloaterHtml(); | ||
71 | |||
72 | LLWebBrowserCtrl* mWebBrowser; | ||
73 | static LLFloaterHtml* sInstance; | ||
74 | LLButton* mCloseButton; | ||
75 | }; | ||
76 | |||
77 | #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 @@ | |||
1 | /** | 1 | /** |
2 | * @file llfloaterhtmlhelp.cpp | 2 | * @file llmediabrowser.cpp |
3 | * @brief HTML Help floater - uses embedded web browser control | 3 | * @brief embedded web browser |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2006&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2006&license=viewergpl$ |
6 | * | 6 | * |
@@ -33,7 +33,6 @@ | |||
33 | #include "llviewerprecompiledheaders.h" | 33 | #include "llviewerprecompiledheaders.h" |
34 | 34 | ||
35 | #include "llfloatermediabrowser.h" | 35 | #include "llfloatermediabrowser.h" |
36 | #include "llfloaterhtml.h" | ||
37 | 36 | ||
38 | #include "llchat.h" | 37 | #include "llchat.h" |
39 | #include "llfloaterchat.h" | 38 | #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 @@ | |||
36 | #include "llmediactrl.h" | 36 | #include "llmediactrl.h" |
37 | 37 | ||
38 | // viewer includes | 38 | // viewer includes |
39 | #include "llfloaterhtml.h" | ||
40 | #include "llfloatermediabrowser.h" | 39 | #include "llfloatermediabrowser.h" |
41 | #include "llfloaterworldmap.h" | 40 | #include "llfloaterworldmap.h" |
42 | #include "lluictrlfactory.h" | 41 | #include "lluictrlfactory.h" |