aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhandler.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-11-19 04:19:06 -0600
committerJacek Antonelli2009-11-19 04:19:06 -0600
commit1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427 (patch)
treee09ccbc010e326a48fd91ba15b58afd7fb836b3f /linden/indra/newview/llfloaterhandler.cpp
parentFixed minor formatting issue in MANIFESTO.txt. (diff)
parentFixed CMake setting errors (diff)
downloadmeta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.zip
meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.gz
meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.bz2
meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.xz
Merge remote branch 'mccabe/1.3.0-next' into next
Conflicts: linden/indra/cmake/00-Common.cmake linden/indra/newview/skins/default/xui/de/floater_about.xml linden/indra/newview/skins/default/xui/fr/floater_about.xml linden/indra/newview/skins/default/xui/ja/floater_about.xml linden/indra/newview/skins/default/xui/ko/floater_about.xml linden/indra/newview/skins/default/xui/zh/floater_about.xml linden/install.xml
Diffstat (limited to 'linden/indra/newview/llfloaterhandler.cpp')
-rw-r--r--linden/indra/newview/llfloaterhandler.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterhandler.cpp b/linden/indra/newview/llfloaterhandler.cpp
new file mode 100644
index 0000000..f4c7e43
--- /dev/null
+++ b/linden/indra/newview/llfloaterhandler.cpp
@@ -0,0 +1,78 @@
1/**
2 * $LicenseInfo:firstyear=2008&license=viewergpl$
3 *
4 * Copyright (c) 2008-2009, Linden Research, Inc.
5 *
6 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at
18 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 * $/LicenseInfo$
28 */
29#include "llviewerprecompiledheaders.h"
30
31#include "llfloaterhandler.h"
32
33#include "llfloater.h"
34#include "llwebbrowserctrl.h"
35
36// register with dispatch via global object
37LLFloaterHandler gFloaterHandler;
38
39
40LLFloater* get_parent_floater(LLView* view)
41{
42 LLFloater* floater = NULL;
43 LLView* parent = view->getParent();
44 while (parent)
45 {
46 floater = dynamic_cast<LLFloater*>(parent);
47 if (floater)
48 {
49 break;
50 }
51 parent = parent->getParent();
52 }
53 return floater;
54}
55
56
57bool LLFloaterHandler::handle(const LLSD &params, const LLSD &query_map, LLWebBrowserCtrl *web)
58{
59 if (params.size() < 2) return false;
60 LLFloater* floater = NULL;
61 // *TODO: implement floater lookup by name
62 if (params[0].asString() == "self")
63 {
64 if (web)
65 {
66 floater = get_parent_floater(web);
67 }
68 }
69 if (params[1].asString() == "close")
70 {
71 if (floater)
72 {
73 floater->close();
74 return true;
75 }
76 }
77 return false;
78}